1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"file:///usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd">
<!--
Copyright Intel 2012
This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0
US). To view a copy of this license, visit http://creativecommons.org.license/by-sa/3.0/us.
-->
<refentry
id="waffle_attrib_list"
xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- See http://www.docbook.org/tdg/en/html/refentry.html. -->
<refmeta>
<refentrytitle>waffle_attrib_list</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>waffle_attrib_list</refname>
<refname>waffle_attrib_list_length</refname>
<refname>waffle_attrib_list_get</refname>
<refname>waffle_attrib_list_get_with_default</refname>
<refname>waffle_attrib_list_update</refname>
<refpurpose>Utilities for attribute lists</refpurpose>
</refnamediv>
<refentryinfo>
<title>Waffle Manual</title>
<productname>waffle</productname>
<xi:include href="common/author-chad.versace.xml"/>
<xi:include href="common/copyright.xml"/>
<xi:include href="common/legalnotice.xml"/>
</refentryinfo>
<refsynopsisdiv>
<funcsynopsis language="C">
<funcsynopsisinfo>#include <waffle.h></funcsynopsisinfo>
<funcprototype>
<funcdef>DEPRECATED bool <function>waffle_attrib_list_length</function></funcdef>
<paramdef>const int32_t <parameter>attrib_list</parameter>[]</paramdef>
</funcprototype>
<funcprototype>
<funcdef>DEPRECATED bool <function>waffle_attrib_list_get</function></funcdef>
<paramdef>const int32_t <parameter>attrib_list</parameter>[]</paramdef>
<paramdef>int32_t <parameter>key</parameter></paramdef>
<paramdef>int32_t *<parameter>value</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>DEPRECATED bool <function>waffle_attrib_list_get_with_default</function></funcdef>
<paramdef>const int32_t <parameter>attrib_list</parameter>[]</paramdef>
<paramdef>int32_t <parameter>key</parameter></paramdef>
<paramdef>int32_t *<parameter>value</parameter></paramdef>
<paramdef>int32_t <parameter>default_value</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>DEPRECATED bool <function>waffle_attrib_list_update</function></funcdef>
<paramdef>int32_t <parameter>attrib_list</parameter>[]</paramdef>
<paramdef>int32_t <parameter>key</parameter></paramdef>
<paramdef>int32_t *<parameter>value</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<refsect2>
<title>Deprecation</title>
<para>All functions above are deprecated in Waffle 1.6 and later.</para>
</refsect2>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
An attribute list is a zero-terminated list of <type>int32_t</type> key/value pairs or a null pointer. A null
pointer is interpreted as an empty list, whose only member is the terminal zero. For concrete examples of
attribute lists, see the "Examples" section in
<citerefentry><refentrytitle><function>waffle_config</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<para>
All attribute list functions can be called before waffle has been successfully initialized with
<citerefentry><refentrytitle><function>waffle_init</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<variablelist>
<varlistentry>
<term><function>waffle_attrib_list_length()</function></term>
<listitem>
<para>
Return the number of key/value pairs in the list.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><function>waffle_attrib_list_get()</function></term>
<listitem>
<para>
Get the <parameter>value</parameter> associated with <parameter>key</parameter>. If the list does not
contain the <parameter>key</parameter>, then <parameter>value</parameter> is not dereferenced.
Return true if and only if the list contains the <parameter>key</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><function>waffle_attrib_list_get_with_default()</function></term>
<listitem>
<para>
Equivalent to <function>waffle_attrib_list_get()</function> except that if the list does not contain the
<parameter>key</parameter> then <parameter>value</parameter> is set to a <parameter>default_value</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><function>waffle_attrib_list_update()</function></term>
<listitem>
<para>
Update the <parameter>value</parameter> associated with <parameter>key</parameter>.
If the list does not contain the <parameter>key</parameter> then the list is not modified.
Return true if and only if the list contains the <parameter>key</parameter>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Errors</title>
<para>
All attribute list functions set the error code to <constant>WAFFLE_NO_ERROR</constant> and can be called before
waffle has been successfully initialized with
<citerefentry><refentrytitle><function>waffle_init</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<xi:include href="common/error-codes.xml"/>
</refsect1>
<xi:include href="common/issues.xml"/>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>waffle</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>
<!--
vim:tw=120 et ts=2 sw=2:
-->
|