<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="PackageKit-pk-bitfield">
<refmeta>
<refentrytitle role="top_of_page" id="PackageKit-pk-bitfield.top_of_page">pk-bitfield</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PACKAGEKIT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>pk-bitfield</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="PackageKit-pk-bitfield.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
typedef             <link linkend="PkBitfield">PkBitfield</link>;
#define             <link linkend="PK-BITFIELD-FORMAT--CAPS">PK_BITFIELD_FORMAT</link>
#define             <link linkend="pk-bitfield-add">pk_bitfield_add</link>                     (bitfield,enum)
#define             <link linkend="pk-bitfield-remove">pk_bitfield_remove</link>                  (bitfield,enum)
#define             <link linkend="pk-bitfield-invert">pk_bitfield_invert</link>                  (bitfield,enum)
#define             <link linkend="pk-bitfield-contain">pk_bitfield_contain</link>                 (bitfield,enum)
#define             <link linkend="pk-bitfield-value">pk_bitfield_value</link>                   (enum)
<link linkend="gint">gint</link>                <link linkend="pk-bitfield-contain-priority">pk_bitfield_contain_priority</link>        (<link linkend="PkBitfield">PkBitfield</link> values,
                                                         <link linkend="gint">gint</link> value,
                                                         ...);
<link linkend="PkBitfield">PkBitfield</link>          <link linkend="pk-bitfield-from-enums">pk_bitfield_from_enums</link>              (<link linkend="gint">gint</link> value,
                                                         ...);
<link linkend="PkBitfield">PkBitfield</link>          <link linkend="pk-role-bitfield-from-text">pk_role_bitfield_from_text</link>          (const <link linkend="gchar">gchar</link> *roles);
<link linkend="gchar">gchar</link> *             <link linkend="pk-role-bitfield-to-text">pk_role_bitfield_to_text</link>            (<link linkend="PkBitfield">PkBitfield</link> roles);
<link linkend="PkBitfield">PkBitfield</link>          <link linkend="pk-group-bitfield-from-text">pk_group_bitfield_from_text</link>         (const <link linkend="gchar">gchar</link> *groups);
<link linkend="gchar">gchar</link> *             <link linkend="pk-group-bitfield-to-text">pk_group_bitfield_to_text</link>           (<link linkend="PkBitfield">PkBitfield</link> groups);
<link linkend="PkBitfield">PkBitfield</link>          <link linkend="pk-filter-bitfield-from-text">pk_filter_bitfield_from_text</link>        (const <link linkend="gchar">gchar</link> *filters);
<link linkend="gchar">gchar</link> *             <link linkend="pk-filter-bitfield-to-text">pk_filter_bitfield_to_text</link>          (<link linkend="PkBitfield">PkBitfield</link> filters);
<link linkend="void">void</link>                <link linkend="pk-bitfield-test">pk_bitfield_test</link>                    (<link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsynopsisdiv>









<refsect1 id="PackageKit-pk-bitfield.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>

<refsect1 id="PackageKit-pk-bitfield.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="PkBitfield" role="typedef">
<title>PkBitfield</title>
<indexterm zone="PkBitfield"><primary sortas="PkBitfield">PkBitfield</primary></indexterm><programlisting>typedef guint64 PkBitfield;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="PK-BITFIELD-FORMAT--CAPS" role="macro">
<title>PK_BITFIELD_FORMAT</title>
<indexterm zone="PK-BITFIELD-FORMAT--CAPS"><primary sortas="PK_BITFIELD_FORMAT">PK_BITFIELD_FORMAT</primary></indexterm><programlisting>#define PK_BITFIELD_FORMAT G_GUINT64_FORMAT
</programlisting>
<para>
</para></refsect2>
<refsect2 id="pk-bitfield-add" role="macro">
<title>pk_bitfield_add()</title>
<indexterm zone="pk-bitfield-add"><primary sortas="pk_bitfield_add">pk_bitfield_add</primary></indexterm><programlisting>#define pk_bitfield_add(bitfield,enum)		do { ((bitfield) |= (pk_bitfield_value(enum))); } while (0)
</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bitfield</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>enum</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-bitfield-remove" role="macro">
<title>pk_bitfield_remove()</title>
<indexterm zone="pk-bitfield-remove"><primary sortas="pk_bitfield_remove">pk_bitfield_remove</primary></indexterm><programlisting>#define pk_bitfield_remove(bitfield,enum)	do { ((bitfield) &amp;= ~(pk_bitfield_value(enum))); } while (0)
</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bitfield</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>enum</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-bitfield-invert" role="macro">
<title>pk_bitfield_invert()</title>
<indexterm zone="pk-bitfield-invert"><primary sortas="pk_bitfield_invert">pk_bitfield_invert</primary></indexterm><programlisting>#define pk_bitfield_invert(bitfield,enum)	do { ((bitfield) ^= (pk_bitfield_value(enum))); } while (0)
</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bitfield</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>enum</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-bitfield-contain" role="macro">
<title>pk_bitfield_contain()</title>
<indexterm zone="pk-bitfield-contain"><primary sortas="pk_bitfield_contain">pk_bitfield_contain</primary></indexterm><programlisting>#define pk_bitfield_contain(bitfield,enum)	(((bitfield) &amp; (pk_bitfield_value(enum))) &gt; 0)
</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bitfield</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>enum</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-bitfield-value" role="macro">
<title>pk_bitfield_value()</title>
<indexterm zone="pk-bitfield-value"><primary sortas="pk_bitfield_value">pk_bitfield_value</primary></indexterm><programlisting>#define pk_bitfield_value(enum)			((PkBitfield) 1 &lt;&lt; (enum))
</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>enum</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-bitfield-contain-priority" role="function">
<title>pk_bitfield_contain_priority ()</title>
<indexterm zone="pk-bitfield-contain-priority"><primary sortas="pk_bitfield_contain_priority">pk_bitfield_contain_priority</primary></indexterm><programlisting><link linkend="gint">gint</link>                pk_bitfield_contain_priority        (<link linkend="PkBitfield">PkBitfield</link> values,
                                                         <link linkend="gint">gint</link> value,
                                                         ...);</programlisting>
<para>
Finds elements in a list, but with priority going to the preceeding entry</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>values</parameter>&#160;:</term>
<listitem><simpara> a valid bitfield instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> the values we are searching for
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The return enumerated type, or -1 if none are found
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-bitfield-from-enums" role="function">
<title>pk_bitfield_from_enums ()</title>
<indexterm zone="pk-bitfield-from-enums"><primary sortas="pk_bitfield_from_enums">pk_bitfield_from_enums</primary></indexterm><programlisting><link linkend="PkBitfield">PkBitfield</link>          pk_bitfield_from_enums              (<link linkend="gint">gint</link> value,
                                                         ...);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> the values we want to add to the bitfield
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The return bitfield, or 0 if invalid
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-role-bitfield-from-text" role="function">
<title>pk_role_bitfield_from_text ()</title>
<indexterm zone="pk-role-bitfield-from-text"><primary sortas="pk_role_bitfield_from_text">pk_role_bitfield_from_text</primary></indexterm><programlisting><link linkend="PkBitfield">PkBitfield</link>          pk_role_bitfield_from_text          (const <link linkend="gchar">gchar</link> *roles);</programlisting>
<para>
Converts text representation to its enumerated type bitfield</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>roles</parameter>&#160;:</term>
<listitem><simpara> the enumerated constant value, e.g. "available;~gui"
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The enumerated type values, or 0 for invalid
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-role-bitfield-to-text" role="function">
<title>pk_role_bitfield_to_text ()</title>
<indexterm zone="pk-role-bitfield-to-text"><primary sortas="pk_role_bitfield_to_text">pk_role_bitfield_to_text</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             pk_role_bitfield_to_text            (<link linkend="PkBitfield">PkBitfield</link> roles);</programlisting>
<para>
Converts a enumerated type bitfield to its text representation</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>roles</parameter>&#160;:</term>
<listitem><simpara> The enumerated type values
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the enumerated constant value, e.g. "install-file;update-system"
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-group-bitfield-from-text" role="function">
<title>pk_group_bitfield_from_text ()</title>
<indexterm zone="pk-group-bitfield-from-text"><primary sortas="pk_group_bitfield_from_text">pk_group_bitfield_from_text</primary></indexterm><programlisting><link linkend="PkBitfield">PkBitfield</link>          pk_group_bitfield_from_text         (const <link linkend="gchar">gchar</link> *groups);</programlisting>
<para>
Converts text representation to its enumerated type bitfield</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>groups</parameter>&#160;:</term>
<listitem><simpara> the enumerated constant value, e.g. "available;~gui"
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The enumerated type values, or 0 for invalid
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-group-bitfield-to-text" role="function">
<title>pk_group_bitfield_to_text ()</title>
<indexterm zone="pk-group-bitfield-to-text"><primary sortas="pk_group_bitfield_to_text">pk_group_bitfield_to_text</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             pk_group_bitfield_to_text           (<link linkend="PkBitfield">PkBitfield</link> groups);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>groups</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-filter-bitfield-from-text" role="function">
<title>pk_filter_bitfield_from_text ()</title>
<indexterm zone="pk-filter-bitfield-from-text"><primary sortas="pk_filter_bitfield_from_text">pk_filter_bitfield_from_text</primary></indexterm><programlisting><link linkend="PkBitfield">PkBitfield</link>          pk_filter_bitfield_from_text        (const <link linkend="gchar">gchar</link> *filters);</programlisting>
<para>
Converts text representation to its enumerated type bitfield, or 0 for invalid</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filters</parameter>&#160;:</term>
<listitem><simpara> the enumerated constant value, e.g. "available;~gui"
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The enumerated type values
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-filter-bitfield-to-text" role="function">
<title>pk_filter_bitfield_to_text ()</title>
<indexterm zone="pk-filter-bitfield-to-text"><primary sortas="pk_filter_bitfield_to_text">pk_filter_bitfield_to_text</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             pk_filter_bitfield_to_text          (<link linkend="PkBitfield">PkBitfield</link> filters);</programlisting>
<para>
Converts a enumerated type bitfield to its text representation</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filters</parameter>&#160;:</term>
<listitem><simpara> The enumerated type values
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the enumerated constant value, e.g. "available;~gui"
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-bitfield-test" role="function">
<title>pk_bitfield_test ()</title>
<indexterm zone="pk-bitfield-test"><primary sortas="pk_bitfield_test">pk_bitfield_test</primary></indexterm><programlisting><link linkend="void">void</link>                pk_bitfield_test                    (<link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
