1.\" Copyright (c) 2011 Kai Wang
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $Id: dwarf_get_form_class.3 3640 2018-10-14 14:09:13Z jkoshy $
26.\"
27.Dd June 26, 2011
28.Dt DWARF_GET_FORM_CLASS 3
29.Os
30.Sh NAME
31.Nm dwarf_get_form_class
32.Nd retrieve the form class of an attribute
33.Sh LIBRARY
34.Lb libdwarf
35.Sh SYNOPSIS
36.In libdwarf.h
37.Ft enum Dwarf_Form_Class
38.Fo dwarf_get_form_class
39.Fa "Dwarf_Half dwversion"
40.Fa "Dwarf_Half attr"
41.Fa "Dwarf_Half offset_size"
42.Fa "Dwarf_Half form"
43.Fc
44.Sh DESCRIPTION
45Function
46.Fn dwarf_get_form_class
47returns the class of the form of a DWARF attribute.
48.Pp
49Argument
50.Ar dwversion
51should specify the version number of DWARF specification
52to use: 2 for DWARF2, 3 for DWARF3 and 4 for DWARF4.
53.Pp
54Argument
55.Ar attr
56should hold the attribute code of the attribute, i.e., one of the
57.Li DW_AT_*
58values defined in
59.In libdwarf.h .
60.Pp
61Argument
62.Ar offset_size
63should hold the size of a DWARF offset for the relevant compilation
64unit.
65.Pp
66Argument
67.Ar form
68should hold the form code of the attribute.
69.Sh RETURN VALUES
70On success, function
71.Fn dwarf_get_form_class
72returns the form class code, which is one of the
73.Dv DW_FORM_CLASS_*
74contants defined in header file
75.In libdwarf.h .
76If the function was not able to determine the form class of the
77attribute, it returns the special form class code
78.Dv DW_FORM_CLASS_UNKNOWN .
79.Sh ERRORS
80Function
81.Fn dwarf_get_form_class
82does not return an error.
83.Sh SEE ALSO
84.Xr dwarf 3 ,
85.Xr dwarf_attr 3 ,
86.Xr dwarf_whatattr 3 ,
87.Xr dwarf_whatform 3
88