2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
8 This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0
9 US). To view a copy of this license, visit http://creativecommons.org.license/by-sa/3.0/us.
13 id="waffle_attrib_list"
14 xmlns:xi="http://www.w3.org/2001/XInclude">
16 <!-- See http://www.docbook.org/tdg/en/html/refentry.html. -->
19 <refentrytitle>waffle_attrib_list</refentrytitle>
20 <manvolnum>3</manvolnum>
24 <refname>waffle_attrib_list</refname>
25 <refname>waffle_attrib_list_length</refname>
26 <refname>waffle_attrib_list_get</refname>
27 <refname>waffle_attrib_list_get_with_default</refname>
28 <refname>waffle_attrib_list_update</refname>
29 <refpurpose>Utilities for attribute lists</refpurpose>
33 <title>Waffle Manual</title>
34 <productname>waffle</productname>
35 <xi:include href="common/author-chad.versace.xml"/>
36 <xi:include href="common/copyright.xml"/>
37 <xi:include href="common/legalnotice.xml"/>
42 <funcsynopsis language="C">
44 <funcsynopsisinfo>#include <waffle.h></funcsynopsisinfo>
47 <funcdef>bool <function>waffle_attrib_list_length</function></funcdef>
48 <paramdef>const int32_t <parameter>attrib_list</parameter>[]</paramdef>
52 <funcdef>bool <function>waffle_attrib_list_get</function></funcdef>
53 <paramdef>const int32_t <parameter>attrib_list</parameter>[]</paramdef>
54 <paramdef>int32_t <parameter>key</parameter></paramdef>
55 <paramdef>int32_t *<parameter>value</parameter></paramdef>
59 <funcdef>bool <function>waffle_attrib_list_get_with_default</function></funcdef>
60 <paramdef>const int32_t <parameter>attrib_list</parameter>[]</paramdef>
61 <paramdef>int32_t <parameter>key</parameter></paramdef>
62 <paramdef>int32_t *<parameter>value</parameter></paramdef>
63 <paramdef>int32_t <parameter>default_value</parameter></paramdef>
67 <funcdef>bool <function>waffle_attrib_list_update</function></funcdef>
68 <paramdef>int32_t <parameter>attrib_list</parameter>[]</paramdef>
69 <paramdef>int32_t <parameter>key</parameter></paramdef>
70 <paramdef>int32_t *<parameter>value</parameter></paramdef>
77 <title>Description</title>
80 An attribute list is a zero-terminated list of <type>int32_t</type> key/value pairs or a null pointer. A null
81 pointer is interpreted as an empty list, whose only member is the terminal zero. For concrete examples of
82 attribute lists, see the "Examples" section in
83 <citerefentry><refentrytitle><function>waffle_config</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
87 All attribute list functions can be called before waffle has been successfully initialized with
88 <citerefentry><refentrytitle><function>waffle_init</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
94 <term><function>waffle_attrib_list_length()</function></term>
97 Return the number of key/value pairs in the list.
103 <term><function>waffle_attrib_list_get()</function></term>
106 Get the <parameter>value</parameter> associated with <parameter>key</parameter>. If the list does not
107 contain the <parameter>key</parameter>, then <parameter>value</parameter> is not dereferenced.
108 Return true if and only if the list contains the <parameter>key</parameter>.
114 <term><function>waffle_attrib_list_get_with_default()</function></term>
117 Equivalent to <function>waffle_attrib_list_get()</function> except that if the list does not contain the
118 <parameter>key</parameter> then <parameter>value</parameter> is set to a <parameter>default_value</parameter>.
124 <term><function>waffle_attrib_list_update()</function></term>
127 Update the <parameter>value</parameter> associated with <parameter>key</parameter>.
128 If the list does not contain the <parameter>key</parameter> then the list is not modified.
129 Return true if and only if the list contains the <parameter>key</parameter>.
138 <title>Errors</title>
141 All attribute list functions set the error code to <constant>WAFFLE_NO_ERROR</constant> and can be called before
142 waffle has been successfully initialized with
143 <citerefentry><refentrytitle><function>waffle_init</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
146 <xi:include href="common/error-codes.xml"/>
150 <xi:include href="common/issues.xml"/>
153 <title>See Also</title>
155 <citerefentry><refentrytitle>waffle</refentrytitle><manvolnum>7</manvolnum></citerefentry>
162 vim:tw=120 et ts=2 sw=2: