1.\" $NetBSD: dwarf_seterrarg.3,v 1.2 2014/03/09 16:58:04 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 2075 2011-10-27 03:47:28Z jkoshy 27.\" 28.Dd May 01, 2010 29.Os 30.Dt DWARF_SETERRARG 3 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.Ar arg 55is the callback argument being set. 56Argument 57.Ar dbg 58can be a debug context allocated by a prior call to 59.Xr dwarf_init 3 , 60or can be NULL to indicate that the library-wide callback argument 61is to be set. 62.Pp 63Function 64.Fn dwarf_seterrhand 65may be used to associate an error handler denoted by argument 66.Ar handler 67with the DWARF debug context descriptor denoted by argument 68.Ar dbg . 69Argument 70.Ar dbg 71should be a debug context allocated by a prior call to 72.Xr dwarf_init 3 , 73or may be NULL to indicate that the library-wide error handler 74is to be set. 75.Sh RETURN VALUES 76Function 77.Fn dwarf_seterrhand 78returns the previous error handler associated with argument 79.Ar dbg . 80If argument 81.Ar dbg 82is NULL, function 83.Fn dwarf_seterrhand 84returns the previous library-wide error handler. 85.Pp 86Function 87.Fn dwarf_seterrarg 88returns the previous callback argument associated with argument 89.Ar dbg . 90If argument 91.Ar dbg 92is NULL, function 93.Fn dwarf_seterrarg 94returns the previous library-wide callback argument. 95.Pp 96.Sh COMPATIBILITY 97The behavior of these functions when argument 98.Ar dbg 99is NULL is a local extension. 100.Sh ERRORS 101These functions do not set an error code. 102.Sh SEE ALSO 103.Xr dwarf 3 , 104.Xr dwarf_init 3 105