PackageKit Reference Manual: pk-common

## pk-common pk-common — Common utility functions for PackageKit |

## Functions

void | pk_common_test ()
gchar ** | pk_ptr_array_to_strv ()
gchar * | pk_iso8601_present ()
gchar * | pk_iso8601_from_date ()
GDate * | pk_iso8601_to_date ()
GDateTime * | pk_iso8601_to_datetime ()
gchar * | pk_get_distro_id ()

## Types and Values

#define | PK_DBUS_SERVICE
#define | PK_DBUS_PATH
#define | PK_DBUS_INTERFACE
#define | PK_DBUS_INTERFACE_TRANSACTION
#define | PK_DBUS_INTERFACE_OFFLINE
#define | PK_SYSTEM_PACKAGE_LIST_FILENAME
#define | PK_SYSTEM_PACKAGE_CACHE_FILENAME

## Description

This file contains functions that may be useful.

## Functions

### pk_common_test ()

    void
    pk_common_test (gpointer user_data);

### pk_ptr_array_to_strv ()

    gchar **
    pk_ptr_array_to_strv (GPtrArray *array);

Form a composite string array of strings. The data in the GPtrArray is copied.

#### Parameters

array | the GPtrArray of strings |

#### Returns

the string array, or `NULL` if invalid.

[transfer full]

Since 0.5.2

### pk_iso8601_present ()

    gchar *
    pk_iso8601_present (void);

#### Returns

The current iso8601 date and time

Since 0.5.2

### pk_iso8601_from_date ()

    gchar *
    pk_iso8601_from_date (const GDate *date);

#### Parameters

date | a `GDate` to convert |

#### Returns

If valid then a new ISO8601 date, else NULL

Since 0.5.2

### pk_iso8601_to_date ()

    GDate *
    pk_iso8601_to_date (const gchar *iso_date);

#### Parameters

iso_date | The ISO8601 date to convert |

#### Returns

If valid then a new `GDate`, else NULL

Since 0.5.2

### pk_iso8601_to_datetime ()

    GDateTime *
    pk_iso8601_to_datetime (const gchar *iso_date);

#### Parameters

iso_date | The ISO8601 date to convert |

#### Returns

If valid then a new `GDateTime`, else NULL

Since 0.8.11

### pk_get_distro_id ()

    gchar *
    pk_get_distro_id (void);

#### Returns

the distro-id, typically "distro;version;arch"

## Types and Values

### PK_DBUS_SERVICE

    #define PK_DBUS_SERVICE			"org.freedesktop.PackageKit"

The SYSTEM service DBUS name

### PK_DBUS_PATH

    #define PK_DBUS_PATH			"/org/freedesktop/PackageKit"

The DBUS path

### PK_DBUS_INTERFACE

    #define PK_DBUS_INTERFACE		"org.freedesktop.PackageKit"

The DBUS interface

### PK_DBUS_INTERFACE_TRANSACTION

    #define PK_DBUS_INTERFACE_TRANSACTION "org.freedesktop.PackageKit.Transaction"

The DBUS interface for the transactions

### PK_DBUS_INTERFACE_OFFLINE

    #define PK_DBUS_INTERFACE_OFFLINE "org.freedesktop.PackageKit.Offline"

The DBUS interface for the offline update functionality

### PK_SYSTEM_PACKAGE_LIST_FILENAME

    #define PK_SYSTEM_PACKAGE_LIST_FILENAME "/var/lib/PackageKit/system.package-list"

### PK_SYSTEM_PACKAGE_CACHE_FILENAME

    #define PK_SYSTEM_PACKAGE_CACHE_FILENAME "/var/lib/PackageKit/package-cache.db"