1*0a6a1f1dSLionel Sambuc.\" $NetBSD: dwarf_hasform.3,v 1.2 2014/03/09 16:58:04 christos Exp $ 2*0a6a1f1dSLionel Sambuc.\" 3*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2010 Joseph Koshy. All rights reserved. 4*0a6a1f1dSLionel Sambuc.\" 5*0a6a1f1dSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 6*0a6a1f1dSLionel Sambuc.\" modification, are permitted provided that the following conditions 7*0a6a1f1dSLionel Sambuc.\" are met: 8*0a6a1f1dSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright 9*0a6a1f1dSLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 10*0a6a1f1dSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright 11*0a6a1f1dSLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 12*0a6a1f1dSLionel Sambuc.\" documentation and/or other materials provided with the distribution. 13*0a6a1f1dSLionel Sambuc.\" 14*0a6a1f1dSLionel Sambuc.\" This software is provided by Joseph Koshy ``as is'' and 15*0a6a1f1dSLionel Sambuc.\" any express or implied warranties, including, but not limited to, the 16*0a6a1f1dSLionel Sambuc.\" implied warranties of merchantability and fitness for a particular purpose 17*0a6a1f1dSLionel Sambuc.\" are disclaimed. in no event shall Joseph Koshy be liable 18*0a6a1f1dSLionel Sambuc.\" for any direct, indirect, incidental, special, exemplary, or consequential 19*0a6a1f1dSLionel Sambuc.\" damages (including, but not limited to, procurement of substitute goods 20*0a6a1f1dSLionel Sambuc.\" or services; loss of use, data, or profits; or business interruption) 21*0a6a1f1dSLionel Sambuc.\" however caused and on any theory of liability, whether in contract, strict 22*0a6a1f1dSLionel Sambuc.\" liability, or tort (including negligence or otherwise) arising in any way 23*0a6a1f1dSLionel Sambuc.\" out of the use of this software, even if advised of the possibility of 24*0a6a1f1dSLionel Sambuc.\" such damage. 25*0a6a1f1dSLionel Sambuc.\" 26*0a6a1f1dSLionel Sambuc.\" Id: dwarf_hasform.3 2073 2011-10-27 03:30:47Z jkoshy 27*0a6a1f1dSLionel Sambuc.\" 28*0a6a1f1dSLionel Sambuc.Dd May 22, 2010 29*0a6a1f1dSLionel Sambuc.Os 30*0a6a1f1dSLionel Sambuc.Dt DWARF_HASFORM 3 31*0a6a1f1dSLionel Sambuc.Sh NAME 32*0a6a1f1dSLionel Sambuc.Nm dwarf_hasform , 33*0a6a1f1dSLionel Sambuc.Nm dwarf_whatform , 34*0a6a1f1dSLionel Sambuc.Nm dwarf_whatform_direct 35*0a6a1f1dSLionel Sambuc.Nd query attribute forms 36*0a6a1f1dSLionel Sambuc.Sh LIBRARY 37*0a6a1f1dSLionel Sambuc.Lb libdwarf 38*0a6a1f1dSLionel Sambuc.Sh SYNOPSIS 39*0a6a1f1dSLionel Sambuc.In libdwarf.h 40*0a6a1f1dSLionel Sambuc.Ft int 41*0a6a1f1dSLionel Sambuc.Fo dwarf_hasform 42*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Attribute attr" 43*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Half form" 44*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Bool *ret" 45*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err" 46*0a6a1f1dSLionel Sambuc.Fc 47*0a6a1f1dSLionel Sambuc.Ft int 48*0a6a1f1dSLionel Sambuc.Fo dwarf_whatform 49*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Attribute attr" 50*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Half *retform" 51*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err" 52*0a6a1f1dSLionel Sambuc.Fc 53*0a6a1f1dSLionel Sambuc.Ft int 54*0a6a1f1dSLionel Sambuc.Fo dwarf_whatform_direct 55*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Attribute attr" 56*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Half *retform" 57*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err" 58*0a6a1f1dSLionel Sambuc.Fc 59*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION 60*0a6a1f1dSLionel SambucFunction 61*0a6a1f1dSLionel Sambuc.Fn dwarf_hasform 62*0a6a1f1dSLionel Sambucindicates whether the DWARF attribute denoted by argument 63*0a6a1f1dSLionel Sambuc.Ar attr 64*0a6a1f1dSLionel Sambuchas the attribute form specified by argument 65*0a6a1f1dSLionel Sambuc.Ar form . 66*0a6a1f1dSLionel SambucIf the attribute has the specified form, then 67*0a6a1f1dSLionel Sambucargument 68*0a6a1f1dSLionel Sambuc.Ar ret 69*0a6a1f1dSLionel Sambucis set to a non-zero value, otherwise it is set to zero. 70*0a6a1f1dSLionel SambucIf argument 71*0a6a1f1dSLionel Sambuc.Ar err 72*0a6a1f1dSLionel Sambucis non-NULL, it will be used to return an error descriptor in 73*0a6a1f1dSLionel Sambuccase of an error. 74*0a6a1f1dSLionel Sambuc.Pp 75*0a6a1f1dSLionel SambucFunction 76*0a6a1f1dSLionel Sambuc.Fn dwarf_whatform 77*0a6a1f1dSLionel Sambucsets the location specified by argument 78*0a6a1f1dSLionel Sambuc.Ar retform 79*0a6a1f1dSLionel Sambucto the attribute form code for the DWARF attribute referenced 80*0a6a1f1dSLionel Sambucby argument 81*0a6a1f1dSLionel Sambuc.Ar attr . 82*0a6a1f1dSLionel SambucIf the attribute referenced by argument 83*0a6a1f1dSLionel Sambuc.Ar attr 84*0a6a1f1dSLionel Sambuchas an indirect form attribute, this function will return the final 85*0a6a1f1dSLionel Sambucform for the attribute. 86*0a6a1f1dSLionel SambucIf argument 87*0a6a1f1dSLionel Sambuc.Ar err 88*0a6a1f1dSLionel Sambucis non-NULL, it will be used to return an error descriptor in 89*0a6a1f1dSLionel Sambuccase of an error. 90*0a6a1f1dSLionel Sambuc.Pp 91*0a6a1f1dSLionel SambucFunction 92*0a6a1f1dSLionel Sambuc.Fn dwarf_whatform_direct 93*0a6a1f1dSLionel Sambucsets the location specified by argument 94*0a6a1f1dSLionel Sambuc.Ar retform 95*0a6a1f1dSLionel Sambucto the attribute form code for the DWARF attribute referenced 96*0a6a1f1dSLionel Sambucby argument 97*0a6a1f1dSLionel Sambuc.Ar attr . 98*0a6a1f1dSLionel SambucIf the form is an indirect form, the function sets the location 99*0a6a1f1dSLionel Sambucspecified by argument 100*0a6a1f1dSLionel Sambuc.Ar retform 101*0a6a1f1dSLionel Sambucto 102*0a6a1f1dSLionel Sambuc.Dv DW_FORM_indirect . 103*0a6a1f1dSLionel SambucIf argument 104*0a6a1f1dSLionel Sambuc.Ar err 105*0a6a1f1dSLionel Sambucis non-NULL, it will be used to return an error descriptor in 106*0a6a1f1dSLionel Sambuccase of an error. 107*0a6a1f1dSLionel Sambuc.Sh RETURN VALUES 108*0a6a1f1dSLionel SambucThese functions return 109*0a6a1f1dSLionel Sambuc.Dv DW_DLV_OK 110*0a6a1f1dSLionel Sambucon success. 111*0a6a1f1dSLionel SambucIn case of an error, these functions return 112*0a6a1f1dSLionel Sambuc.Dv DW_DLV_ERR 113*0a6a1f1dSLionel Sambucand set argument 114*0a6a1f1dSLionel Sambuc.Ar err . 115*0a6a1f1dSLionel Sambuc.Sh ERRORS 116*0a6a1f1dSLionel SambucThese functions may fail with the following errors: 117*0a6a1f1dSLionel Sambuc.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" 118*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_ARGUMENT 119*0a6a1f1dSLionel SambucAny of the arguments 120*0a6a1f1dSLionel Sambuc.Ar attr , 121*0a6a1f1dSLionel Sambuc.Ar ret , 122*0a6a1f1dSLionel Sambucor 123*0a6a1f1dSLionel Sambuc.Ar retform 124*0a6a1f1dSLionel Sambucwas NULL. 125*0a6a1f1dSLionel Sambuc.El 126*0a6a1f1dSLionel Sambuc.Sh SEE ALSO 127*0a6a1f1dSLionel Sambuc.Xr dwarf 3 , 128*0a6a1f1dSLionel Sambuc.Xr dwarf_attr 3 , 129*0a6a1f1dSLionel Sambuc.Xr dwarf_hasattr 3 130