summaryrefslogtreecommitdiffstats
path: root/elapi/elapi_event.c
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-09-17 00:01:09 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-05 10:32:08 -0400
commita524f461e75aed88ae14c0d28ae2a0536c201a07 (patch)
tree3f0f7081a3f4c786210d4240c239bfcefd54bb04 /elapi/elapi_event.c
parent93c4bf8ee18f1b58dc6646e8bb43d536cc824166 (diff)
downloadding-libs-a524f461e75aed88ae14c0d28ae2a0536c201a07.tar.gz
ding-libs-a524f461e75aed88ae14c0d28ae2a0536c201a07.tar.xz
ding-libs-a524f461e75aed88ae14c0d28ae2a0536c201a07.zip
ELAPI Event resolver
Started working on the async processing and realised that I need to have a good copy of the event with all the fields resolved so this patch has some foundation for the async functions (module elapi_async.c) but they are mostly stubbed out. The actual code will be added down the road. Instead the patch focuses on the code introduced in elapi_resolve.c module and the use of the functions from it. It also adds the implementation of the high level calls that initialize ELAPI with the external callbacks to be used during async processing (elapi_log.c).
Diffstat (limited to 'elapi/elapi_event.c')
-rw-r--r--elapi/elapi_event.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/elapi/elapi_event.c b/elapi/elapi_event.c
index 735de59..e1baf42 100644
--- a/elapi/elapi_event.c
+++ b/elapi/elapi_event.c
@@ -449,7 +449,7 @@ static int interpret_key(char *key,
adjust_by = 2;
}
else if ((*cursor == 'u') && (*(cursor+1) == '(')) {
- *type = COL_TYPE_INTEGER;
+ *type = COL_TYPE_UNSIGNED;
adjust_by = 2;
}
else if ((*cursor == 'l') && ((*(cursor+1) == 'i')||(*(cursor+1) == 'd')) && (*(cursor+2) == '(')) {
@@ -457,7 +457,7 @@ static int interpret_key(char *key,
adjust_by = 3;
}
else if ((*cursor == 'l') && (*(cursor+1) == 'u') && (*(cursor+2) == '(')) {
- *type = COL_TYPE_LONG;
+ *type = COL_TYPE_ULONG;
adjust_by = 3;
}
else if (((*cursor == 'f')||(*cursor == 'e')) && (*(cursor+1) == '(')) {
@@ -866,6 +866,7 @@ int elapi_create_event_with_vargs(struct collection_item **event,
{
int error = EOK;
struct collection_item *evt = NULL;
+ const char *alias;
TRACE_FLOW_STRING("elapi_create_event_with_vargs", "Entry");
@@ -897,9 +898,17 @@ int elapi_create_event_with_vargs(struct collection_item **event,
}
}
- /* Add elements from the template */
+ /* Add elements from the collection */
if (collection != NULL) {
- error = col_add_collection_to_collection(evt, NULL, NULL, collection, mode);
+ /* If we are told to use FLAT DOT mode
+ * add collection with prefixing here.
+ */
+ if (mode == COL_ADD_MODE_FLATDOT) {
+ alias = col_get_item_property(collection, NULL);
+ }
+ else alias = NULL;
+
+ error = col_add_collection_to_collection(evt, NULL, alias, collection, mode);
if (error) {
TRACE_ERROR_NUMBER("Failed to add elements from external collection. Error", error);
col_destroy_collection(evt);
@@ -955,6 +964,7 @@ int elapi_modify_event(struct collection_item *event,
{
int error = EOK;
va_list args;
+ const char *alias;
TRACE_FLOW_STRING("elapi_modify_event", "Entry");
@@ -966,7 +976,14 @@ int elapi_modify_event(struct collection_item *event,
/* Add elements from the template */
if (collection != NULL) {
- error = col_add_collection_to_collection(event, NULL, NULL, collection, mode);
+ /* If we are told to use FLAT DOT mode
+ * add collection with prefixing here.
+ */
+ if (mode == COL_ADD_MODE_FLATDOT) {
+ alias = col_get_item_property(collection, NULL);
+ }
+ else alias = NULL;
+ error = col_add_collection_to_collection(event, NULL, alias, collection, mode);
if (error) {
TRACE_ERROR_NUMBER("Failed to add elements from external collection. Error", error);
col_destroy_collection(event);