diff options
Diffstat (limited to 'src/software-dbus/sw-utils.h')
-rw-r--r-- | src/software-dbus/sw-utils.h | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/src/software-dbus/sw-utils.h b/src/software-dbus/sw-utils.h index 1cb7593..16e6ca1 100644 --- a/src/software-dbus/sw-utils.h +++ b/src/software-dbus/sw-utils.h @@ -23,6 +23,15 @@ #define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <konkret/konkret.h> +#include <packagekit-glib2/packagekit.h> + +#include "globals.h" +#include "LMI_SoftwareIdentity.h" + #define VER_STR_LEN 256 #define ELEM_NAME_LEN 256 #define INSTANCE_ID_LEN 282 @@ -31,16 +40,22 @@ #define PK_DETAILS_LIMIT 4999 #define SW_IDENTITY_CLASS_NAME "SoftwareIdentity" +#define SYSTEM_SW_COLLECTION_CLASS_NAME "SystemSoftwareCollection" +#define SW_IDENTITY_RESOURCE_CLASS_NAME "SoftwareIdentityResource" +#define MEM_SW_COLL_CLASS_NAME "MemberOfSoftwareCollection" +#define INST_SW_IDENTITY_CLASS_NAME "InstalledSoftwareIdentity" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <packagekit-glib2/packagekit.h> -#include <konkret/konkret.h> +#define COLLECTION_ATTR "Collection" +#define MEMBER_ATTR "Member" +#define SYSTEM_ATTR "System" +#define INST_SW_ATTR "InstalledSoftware" -#include "globals.h" +#define SW_IDENTITY_INSTANCE_ID_PREFIX ORGID ":" ORGID "_" SW_IDENTITY_CLASS_NAME ":" +#define SW_IDENTITY_INSTANCE_ID_PREFIX_LEN 25 -#include "LMI_SoftwareIdentity.h" +#define get_sw_pkg_from_sw_identity_op(cop, sw_pkg) \ + create_sw_package_from_elem_name(get_elem_name_from_instance_id(\ + get_str_property_from_op(cop, "InstanceID")), sw_pkg) const char *provider_name; const ConfigEntry *provider_config_defaults; @@ -219,6 +234,13 @@ gint pk_det_cmp(gpointer a, gpointer b); * Functions related to CMPI ******************************************************************************/ /* + * Get SwPackage element name from InstanceID of LMI_SoftwareIdentity object. + * @param instance_id of LMI_SoftwareIdentity object + * @return element name or empty string in case of some problem + */ +const char *get_elem_name_from_instance_id(const char *instance_id); + +/* * Create standard instance ID based on class name and ID. * @param class_name * @param id, may by null |