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