<?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-package-id">
<refmeta>
<refentrytitle role="top_of_page" id="PackageKit-pk-package-id.top_of_page">pk-package-id</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PACKAGEKIT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>pk-package-id</refname>
<refpurpose>Functionality to read a PackageID</refpurpose>
</refnamediv>

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

<synopsis>
#define             <link linkend="PK-PACKAGE-ID-NAME--CAPS">PK_PACKAGE_ID_NAME</link>
#define             <link linkend="PK-PACKAGE-ID-VERSION--CAPS">PK_PACKAGE_ID_VERSION</link>
#define             <link linkend="PK-PACKAGE-ID-ARCH--CAPS">PK_PACKAGE_ID_ARCH</link>
#define             <link linkend="PK-PACKAGE-ID-DATA--CAPS">PK_PACKAGE_ID_DATA</link>
<link linkend="void">void</link>                <link linkend="pk-package-id-test">pk_package_id_test</link>                  (<link linkend="gpointer">gpointer</link> user_data);
<link linkend="gchar">gchar</link> *             <link linkend="pk-package-id-build">pk_package_id_build</link>                 (const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="gchar">gchar</link> *version,
                                                         const <link linkend="gchar">gchar</link> *arch,
                                                         const <link linkend="gchar">gchar</link> *data);
<link linkend="gboolean">gboolean</link>            <link linkend="pk-package-id-check">pk_package_id_check</link>                 (const <link linkend="gchar">gchar</link> *package_id);
<link linkend="gchar">gchar</link> **            <link linkend="pk-package-id-split">pk_package_id_split</link>                 (const <link linkend="gchar">gchar</link> *package_id);
<link linkend="gchar">gchar</link> *             <link linkend="pk-package-id-to-printable">pk_package_id_to_printable</link>          (const <link linkend="gchar">gchar</link> *package_id);
<link linkend="gboolean">gboolean</link>            <link linkend="pk-package-id-equal-fuzzy-arch">pk_package_id_equal_fuzzy_arch</link>      (const <link linkend="gchar">gchar</link> *package_id1,
                                                         const <link linkend="gchar">gchar</link> *package_id2);
</synopsis>
</refsynopsisdiv>









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

<refsect1 id="PackageKit-pk-package-id.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="PK-PACKAGE-ID-NAME--CAPS" role="macro">
<title>PK_PACKAGE_ID_NAME</title>
<indexterm zone="PK-PACKAGE-ID-NAME--CAPS"><primary sortas="PK_PACKAGE_ID_NAME">PK_PACKAGE_ID_NAME</primary></indexterm><programlisting>#define PK_PACKAGE_ID_NAME	0
</programlisting>
<para>
Alias to get a name field from the result of pk_package_id_split</para>
<para>
</para></refsect2>
<refsect2 id="PK-PACKAGE-ID-VERSION--CAPS" role="macro">
<title>PK_PACKAGE_ID_VERSION</title>
<indexterm zone="PK-PACKAGE-ID-VERSION--CAPS"><primary sortas="PK_PACKAGE_ID_VERSION">PK_PACKAGE_ID_VERSION</primary></indexterm><programlisting>#define PK_PACKAGE_ID_VERSION	1
</programlisting>
<para>
Alias to get a version field from the result of pk_package_id_split</para>
<para>
</para></refsect2>
<refsect2 id="PK-PACKAGE-ID-ARCH--CAPS" role="macro">
<title>PK_PACKAGE_ID_ARCH</title>
<indexterm zone="PK-PACKAGE-ID-ARCH--CAPS"><primary sortas="PK_PACKAGE_ID_ARCH">PK_PACKAGE_ID_ARCH</primary></indexterm><programlisting>#define PK_PACKAGE_ID_ARCH	2
</programlisting>
<para>
Alias to get an arch field from the result of pk_package_id_split</para>
<para>
</para></refsect2>
<refsect2 id="PK-PACKAGE-ID-DATA--CAPS" role="macro">
<title>PK_PACKAGE_ID_DATA</title>
<indexterm zone="PK-PACKAGE-ID-DATA--CAPS"><primary sortas="PK_PACKAGE_ID_DATA">PK_PACKAGE_ID_DATA</primary></indexterm><programlisting>#define PK_PACKAGE_ID_DATA	3
</programlisting>
<para>
Alias to get a data field from the result of pk_package_id_split</para>
<para>
</para></refsect2>
<refsect2 id="pk-package-id-test" role="function">
<title>pk_package_id_test ()</title>
<indexterm zone="pk-package-id-test"><primary sortas="pk_package_id_test">pk_package_id_test</primary></indexterm><programlisting><link linkend="void">void</link>                pk_package_id_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>
<refsect2 id="pk-package-id-build" role="function">
<title>pk_package_id_build ()</title>
<indexterm zone="pk-package-id-build"><primary sortas="pk_package_id_build">pk_package_id_build</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             pk_package_id_build                 (const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="gchar">gchar</link> *version,
                                                         const <link linkend="gchar">gchar</link> *arch,
                                                         const <link linkend="gchar">gchar</link> *data);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the package name
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>version</parameter>&#160;:</term>
<listitem><simpara> the package version
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>arch</parameter>&#160;:</term>
<listitem><simpara> the package architecture
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> the package extra data
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> returns a string to form the PackageID.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-package-id-check" role="function">
<title>pk_package_id_check ()</title>
<indexterm zone="pk-package-id-check"><primary sortas="pk_package_id_check">pk_package_id_check</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pk_package_id_check                 (const <link linkend="gchar">gchar</link> *package_id);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>package_id</parameter>&#160;:</term>
<listitem><simpara> the PackageID to check
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the PackageID was well formed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-package-id-split" role="function">
<title>pk_package_id_split ()</title>
<indexterm zone="pk-package-id-split"><primary sortas="pk_package_id_split">pk_package_id_split</primary></indexterm><programlisting><link linkend="gchar">gchar</link> **            pk_package_id_split                 (const <link linkend="gchar">gchar</link> *package_id);</programlisting>
<para>
Splits a PackageID into the correct number of parts, checking the correct
number of delimiters are present.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>package_id</parameter>&#160;:</term>
<listitem><simpara> the ; delimited PackageID to split
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a GStrv or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if invalid, use <link linkend="g-strfreev"><function>g_strfreev()</function></link> to free
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-package-id-to-printable" role="function">
<title>pk_package_id_to_printable ()</title>
<indexterm zone="pk-package-id-to-printable"><primary sortas="pk_package_id_to_printable">pk_package_id_to_printable</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             pk_package_id_to_printable          (const <link linkend="gchar">gchar</link> *package_id);</programlisting>
<para>
Formats the PackageID to be printable to the user.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>package_id</parameter>&#160;:</term>
<listitem><simpara> the PackageID
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the name-version.arch formatted string, use <link linkend="g-free"><function>g_free()</function></link> to free.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-package-id-equal-fuzzy-arch" role="function">
<title>pk_package_id_equal_fuzzy_arch ()</title>
<indexterm zone="pk-package-id-equal-fuzzy-arch"><primary sortas="pk_package_id_equal_fuzzy_arch">pk_package_id_equal_fuzzy_arch</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pk_package_id_equal_fuzzy_arch      (const <link linkend="gchar">gchar</link> *package_id1,
                                                         const <link linkend="gchar">gchar</link> *package_id2);</programlisting>
<para>
Only compare the name, version, and arch, where the architecture will fuzzy
match with i*86.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>package_id1</parameter>&#160;:</term>
<listitem><simpara> the first PackageID
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>package_id2</parameter>&#160;:</term>
<listitem><simpara> the second PackageID
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the PackageIDs can be considered equal.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
