Added /caps command

This commit is contained in:
James Booth
2013-02-17 01:04:10 +00:00
parent ab591b41b2
commit 44d2f8da7a
7 changed files with 130 additions and 6 deletions

View File

@@ -48,7 +48,8 @@ void
caps_add(const char * const caps_str, const char * const category,
const char * const type, const char * const name,
const char * const software, const char * const software_version,
const char * const os, const char * const os_version)
const char * const os, const char * const os_version,
GSList *features)
{
Capabilities *new_caps = malloc(sizeof(struct capabilities_t));
@@ -87,6 +88,11 @@ caps_add(const char * const caps_str, const char * const category,
} else {
new_caps->os_version = NULL;
}
if (features != NULL) {
new_caps->features = features;
} else {
new_caps->features = NULL;
}
g_hash_table_insert(capabilities, strdup(caps_str), new_caps);
}
@@ -284,6 +290,10 @@ _caps_destroy(Capabilities *caps)
FREE_SET_NULL(caps->software_version);
FREE_SET_NULL(caps->os);
FREE_SET_NULL(caps->os_version);
if (caps->features != NULL) {
g_slist_free_full(caps->features, free);
caps->features = NULL;
}
FREE_SET_NULL(caps);
}
}