![]() |
![]() |
![]() |
ZIF Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define ZIF_UTILS_ERROR enum ZifUtilsError; #define ZIF_PACKAGE_ID_NAME #define ZIF_PACKAGE_ID_VERSION #define ZIF_PACKAGE_ID_ARCH #define ZIF_PACKAGE_ID_DATA gboolean zif_init (void
); GQuark zif_utils_error_quark (void
); void zif_list_print_array (GPtrArray *array
); gchar * zif_package_id_from_nevra (const gchar *name
,guint epoch
,const gchar *version
,const gchar *release
,const gchar *arch
,const gchar *data
); gboolean zif_boolean_from_text (const gchar *text
); gint zif_compare_evr (const gchar *a
,const gchar *b
); gboolean zif_file_untar (const gchar *filename
,const gchar *directory
,GError **error
); gboolean zif_file_decompress (const gchar *in
,const gchar *out
,ZifState *state
,GError **error
); gchar * zif_file_get_uncompressed_name (const gchar *filename
); gboolean zif_file_is_compressed_name (const gchar *filename
); gchar ** zif_package_id_split (const gchar *package_id
); gboolean zif_package_id_check (const gchar *package_id
);
typedef enum { ZIF_UTILS_ERROR_FAILED, ZIF_UTILS_ERROR_FAILED_TO_READ, ZIF_UTILS_ERROR_FAILED_TO_WRITE, ZIF_UTILS_ERROR_CANCELLED, ZIF_UTILS_ERROR_LAST } ZifUtilsError;
gboolean zif_init (void
);
This must be called before any of the zif_* functions are called.
Returns : |
TRUE if we initialised correctly
|
Since 0.1.0
GQuark zif_utils_error_quark (void
);
Returns : |
Our personal error quark. |
Since 0.1.0
void zif_list_print_array (GPtrArray *array
);
Print an array of strings to STDOUT
.
|
The string array to print |
Since 0.1.0
gchar * zif_package_id_from_nevra (const gchar *name
,guint epoch
,const gchar *version
,const gchar *release
,const gchar *arch
,const gchar *data
);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean zif_boolean_from_text (const gchar *text
);
Convert a text boolean into it's enumerated boolean state
Since 0.1.0
gint zif_compare_evr (const gchar *a
,const gchar *b
);
Compare two [epoch:]version[-release] strings
|
the first version string |
|
the second version string |
Returns : |
1 for a>b, 0 for a==b, -1 for b>a |
Since 0.1.0
gboolean zif_file_untar (const gchar *filename
,const gchar *directory
,GError **error
);
Untar files into a directory
|
the filename to unpack |
|
the directory to unpack into |
|
a valid GError
|
Returns : |
TRUE if the file was decompressed
|
Since 0.1.0
gboolean zif_file_decompress (const gchar *in
,const gchar *out
,ZifState *state
,GError **error
);
Decompress files into a directory
|
the filename to unpack |
|
the file to create |
|
a ZifState to use for progress reporting |
|
a valid GError
|
Returns : |
TRUE if the file was decompressed
|
Since 0.1.0
gchar * zif_file_get_uncompressed_name (const gchar *filename
);
Finds the uncompressed filename.
|
the filename, e.g. /lib/dave.tar.gz |
Returns : |
the uncompressed file name, e.g. /lib/dave.tar, use g_free() to free.
|
Since 0.1.0
gboolean zif_file_is_compressed_name (const gchar *filename
);
Finds out if the filename is compressed
|
the filename, e.g. /lib/dave.tar.gz |
Returns : |
TRUE if the file needs decompression
|
Since 0.1.0
gchar ** zif_package_id_split (const gchar *package_id
);
Splits a PackageID into the correct number of parts, checking the correct number of delimiters are present.
|
the ; delimited PackageID to split |
Returns : |
a GStrv or NULL if invalid, use g_strfreev() to free
|
Since 0.1.0