xref: /netbsd-src/external/bsd/elftoolchain/dist/libdwarf/dwarf_seterrarg.3 (revision 5ac3bc719ce6e70593039505b491894133237d12)
1.\"	$NetBSD: dwarf_seterrarg.3,v 1.6 2024/03/03 17:37:32 christos Exp $
2.\"
3.\" Copyright (c) 2010 Joseph Koshy.  All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" This software is provided by Joseph Koshy ``as is'' and
15.\" any express or implied warranties, including, but not limited to, the
16.\" implied warranties of merchantability and fitness for a particular purpose
17.\" are disclaimed.  in no event shall Joseph Koshy be liable
18.\" for any direct, indirect, incidental, special, exemplary, or consequential
19.\" damages (including, but not limited to, procurement of substitute goods
20.\" or services; loss of use, data, or profits; or business interruption)
21.\" however caused and on any theory of liability, whether in contract, strict
22.\" liability, or tort (including negligence or otherwise) arising in any way
23.\" out of the use of this software, even if advised of the possibility of
24.\" such damage.
25.\"
26.\" Id: dwarf_seterrarg.3 3963 2022-03-12 16:07:32Z jkoshy
27.\"
28.Dd May 01, 2010
29.Dt DWARF_SETERRARG 3
30.Os
31.Sh NAME
32.Nm dwarf_seterrarg ,
33.Nm dwarf_seterrhand
34.Nd configure error handling
35.Sh LIBRARY
36.Lb libdwarf
37.Sh SYNOPSIS
38.In libdwarf.h
39.Ft Dwarf_Ptr
40.Fn dwarf_seterrarg "Dwarf_Debug dbg" "Dwarf_Ptr arg"
41.Ft Dwarf_Handler
42.Fn dwarf_seterrhand "Dwarf_Debug dbg" "Dwarf_Handler handler"
43.Sh DESCRIPTION
44These functions may be used by applications to configure error handling
45callbacks.
46The error handling scheme used by the library is described in
47.Xr dwarf 3 .
48.Pp
49Function
50.Fn dwarf_seterrarg
51may be used to set the callback argument passed to a configured
52error handler at the time it is invoked.
53Argument
54.Fa arg
55is the callback argument being set.
56Argument
57.Fa dbg
58can be a debug context allocated by a prior call to
59.Xr dwarf_init 3 ,
60or can be
61.Dv NULL
62to indicate that the library-wide callback argument
63is to be set.
64.Pp
65Function
66.Fn dwarf_seterrhand
67may be used to associate an error handler denoted by argument
68.Fa handler
69with the DWARF debug context descriptor denoted by argument
70.Fa dbg .
71Argument
72.Fa dbg
73should be a debug context allocated by a prior call to
74.Xr dwarf_init 3 ,
75or may be
76.Dv NULL
77to indicate that the library-wide error handler
78is to be set.
79.Sh RETURN VALUES
80Function
81.Fn dwarf_seterrhand
82returns the previous error handler associated with argument
83.Fa dbg .
84If argument
85.Fa dbg
86is
87.Dv NULL ,
88function
89.Fn dwarf_seterrhand
90returns the previous library-wide error handler.
91.Pp
92Function
93.Fn dwarf_seterrarg
94returns the previous callback argument associated with argument
95.Fa dbg .
96If argument
97.Fa dbg
98is
99.Dv NULL ,
100function
101.Fn dwarf_seterrarg
102returns the previous library-wide callback argument.
103.Sh COMPATIBILITY
104The behavior of these functions when argument
105.Fa dbg
106is
107.Dv NULL
108is a local extension.
109.Sh ERRORS
110These functions do not set an error code.
111.Sh SEE ALSO
112.Xr dwarf 3 ,
113.Xr dwarf_init 3
114