diff options
author | Dmitri Pal <dpal@redhat.com> | 2009-09-17 00:01:09 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-10-05 10:32:08 -0400 |
commit | 8140cea7b4e3d3c9c6003eb6ae30e5e0fdd7c1ae (patch) | |
tree | 3f6ec4cf35410fa2c19c2dc448d311d4bd0ef4b3 /common/elapi/elapi_event.c | |
parent | ea7d823fa584b36e9a34a43c32dc476beede5ea2 (diff) | |
download | sssd-8140cea7b4e3d3c9c6003eb6ae30e5e0fdd7c1ae.tar.gz sssd-8140cea7b4e3d3c9c6003eb6ae30e5e0fdd7c1ae.tar.xz sssd-8140cea7b4e3d3c9c6003eb6ae30e5e0fdd7c1ae.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 'common/elapi/elapi_event.c')
-rw-r--r-- | common/elapi/elapi_event.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/common/elapi/elapi_event.c b/common/elapi/elapi_event.c index 735de5998..e1baf4249 100644 --- a/common/elapi/elapi_event.c +++ b/common/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); |