1260684Skaiw/*-
2260684Skaiw * Copyright (c) 2009 Kai Wang
3260684Skaiw * All rights reserved.
4260684Skaiw *
5260684Skaiw * Redistribution and use in source and binary forms, with or without
6260684Skaiw * modification, are permitted provided that the following conditions
7260684Skaiw * are met:
8260684Skaiw * 1. Redistributions of source code must retain the above copyright
9260684Skaiw *    notice, this list of conditions and the following disclaimer.
10260684Skaiw * 2. Redistributions in binary form must reproduce the above copyright
11260684Skaiw *    notice, this list of conditions and the following disclaimer in the
12260684Skaiw *    documentation and/or other materials provided with the distribution.
13260684Skaiw *
14260684Skaiw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15260684Skaiw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16260684Skaiw * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17260684Skaiw * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18260684Skaiw * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19260684Skaiw * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20260684Skaiw * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21260684Skaiw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22260684Skaiw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23260684Skaiw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24260684Skaiw * SUCH DAMAGE.
25260684Skaiw */
26260684Skaiw
27260684Skaiw#include "_libdwarf.h"
28260684Skaiw
29260684SkaiwELFTC_VCSID("$Id: dwarf_finish.c 2073 2011-10-27 03:30:47Z jkoshy $");
30260684Skaiw
31260684Skaiwint
32260684Skaiwdwarf_finish(Dwarf_Debug dbg, Dwarf_Error *error)
33260684Skaiw{
34260684Skaiw	(void) error;	/* unused */
35260684Skaiw
36260684Skaiw	if (dbg == NULL)
37260684Skaiw		return (DW_DLV_OK);
38260684Skaiw
39260684Skaiw	_dwarf_deinit(dbg);
40260684Skaiw	_dwarf_elf_deinit(dbg);
41260684Skaiw
42260684Skaiw	free(dbg);
43260684Skaiw
44260684Skaiw	return (DW_DLV_OK);
45260684Skaiw}
46260684Skaiw
47260684Skaiw
48260684Skaiwint
49260684Skaiwdwarf_object_finish(Dwarf_Debug dbg, Dwarf_Error *error)
50260684Skaiw{
51260684Skaiw	(void) error;	/* unused */
52260684Skaiw
53260684Skaiw	if (dbg == NULL)
54260684Skaiw		return (DW_DLV_OK);
55260684Skaiw
56260684Skaiw	_dwarf_deinit(dbg);
57260684Skaiw
58260684Skaiw	free(dbg);
59260684Skaiw
60260684Skaiw	return (DW_DLV_OK);
61260684Skaiw}
62