diff options
Diffstat (limited to 'src/software-dbus/sw-utils.h')
-rw-r--r-- | src/software-dbus/sw-utils.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/software-dbus/sw-utils.h b/src/software-dbus/sw-utils.h index f479824..b8b7598 100644 --- a/src/software-dbus/sw-utils.h +++ b/src/software-dbus/sw-utils.h @@ -45,6 +45,9 @@ const char *provider_name; const ConfigEntry *provider_config_defaults; +/******************************************************************************* + * SwPackage & related functions + ******************************************************************************/ /* Software Package */ typedef struct _SwPackage { char *name; /* Package name w/o anything else */ @@ -103,12 +106,22 @@ void sw_pkg_get_version_str(const SwPackage *pkg, char *ver_str, void sw_pkg_get_element_name(const SwPackage *pkg, char *elem_name, const unsigned elem_name_len); +/******************************************************************************* + * Functions related to single PkPackage + ******************************************************************************/ /* - * Check with PackageKit whether the element name is valid. - * @param elem_name element name - * @return 1 if element name is valid, 0 otherwise + * Get PkPackage according to the SwPackage. + * @param sw_pkg SwPackage + * @param pk_pkg PkPackage; needs to be passed to g_object_unref() when not needed + */ +void get_pk_pkg_from_sw_pkg(const SwPackage *sw_pkg, PkPackage **pk_pkg); + +/* + * Get PkDetails from PkPackage. + * @param pk_pkg PkPackage + * @param pk_det PkDetails, needs to be passed to g_object_unref() when not needed */ -short is_valid_sw_pkg_elem_name(const char *elem_name); +void get_pk_det_from_pk_pkg(PkPackage *pk_pkg, PkDetails **pk_det); /* * Create LMI_SoftwareIdentity instance from data from PackageKit. @@ -123,6 +136,9 @@ void create_instance_from_pkgkit_data(PkPackage *pk_pkg, PkDetails *pk_det, SwPackage *sw_pkg, const CMPIBroker *cb, const char *ns, LMI_SoftwareIdentity *w); +/******************************************************************************* + * Functions related to multiple PkPackages + ******************************************************************************/ /* * Enumerate SoftwareIdentity instances. This function calls KReturnInstance(), * so instances are returned directly from within the function. @@ -132,11 +148,16 @@ void create_instance_from_pkgkit_data(PkPackage *pk_pkg, PkDetails *pk_det, * @param cr CMPI Result * @param error_msg error message, if filled, problem occured * @param error_msg_len error message length + * @param names if true, this function will enumerate only SoftwareIdentityRef + * instances */ void enum_sw_identity_instances(PkBitfield filters, const CMPIBroker *cb, const char *ns, const CMPIResult* cr, char *error_msg, - const unsigned error_msg_len); + const unsigned error_msg_len, const short names); +/******************************************************************************* + * Functions related to PackageKit + ******************************************************************************/ /* * Analyze PkResults and construct error message if error occurred. * @param results from package kit call @@ -169,6 +190,9 @@ gint pk_pkg_cmp(gpointer a, gpointer b); */ gint pk_det_cmp(gpointer a, gpointer b); +/******************************************************************************* + * Functions related to CMPI + ******************************************************************************/ /* * Create standard instance ID based on class name and ID. * @param class_name |