Event module implementation file. More...
#include "definitions.h"
#include "event.h"
#include "log_util.h"
#include "memory.h"
#include "random.h"
#include "json_util.h"
#include "time_util.h"
#include "mcl/mcl_event.h"
Go to the source code of this file.
Functions | |
E_MCL_ERROR_CODE | event_initialize (item_meta_t *meta, const char *type, const char *version, mcl_int32_t severity, const char *timestamp, event_t **event) |
This function creates and initializes a data struct of event_t. More... | |
E_MCL_ERROR_CODE | mcl_event_set_option (mcl_event_t *event, E_MCL_EVENT_OPTION option, const void *value) |
This function is used to set optional payload fields of event. More... | |
void | event_destroy (event_t **event) |
To destroy the event_t data struct. More... | |
Event module implementation file.
Definition in file event.c.
void event_destroy | ( | event_t ** | event | ) |
To destroy the event_t
data struct.
Will release the event_t data struct. After destroy() operation, the data struct shouldn't be used.
[in] | event | Stores all field members of event json string. |
Definition at line 108 of file event.c.
References DEBUG_ENTRY, DEBUG_LEAVE, json_util_destroy(), MCL_FREE, MCL_NULL, and string_destroy().
Referenced by event_initialize(), event_list_destroy(), and mcl_store_new_event().
E_MCL_ERROR_CODE event_initialize | ( | item_meta_t * | meta, |
const char * | type, | ||
const char * | version, | ||
mcl_int32_t | severity, | ||
const char * | timestamp, | ||
event_t ** | event | ||
) |
This function creates and initializes a data struct of event_t.
[in] | meta | Meta of event set which is going to be added. |
[in] | type | Type of event. |
[in] | version | Version number of event . |
[in] | severity | Severity level. |
[in] | timestamp | Timestamp of the event in YYYY-MM-DDThh:mm:ss.sssZ format. Ex:2016-04-26T08:06:25.317Z. |
[out] | event | Event handle which is going to be initialized. |
Definition at line 23 of file event.c.
References DEBUG_ENTRY, DEBUG_LEAVE, event_destroy(), MCL_DEBUG, MCL_ERROR_RETURN, MCL_FREE, MCL_NEW, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, random_generate_guid(), and string_initialize_new().
Referenced by mcl_store_new_event().
E_MCL_ERROR_CODE mcl_event_set_option | ( | mcl_event_t * | event, |
E_MCL_EVENT_OPTION | option, | ||
const void * | value | ||
) |
This function is used to set optional payload fields of event.
[in] | event | Event to set its option. |
[in] | option | One of the options listed in E_MCL_EVENT_OPTION. |
[in] | value | New value of the option . |
event
or value
is NULL. option
is invalid. Definition at line 77 of file event.c.
References ASSERT_NOT_NULL, DEBUG_ENTRY, DEBUG_LEAVE, json_util_destroy(), json_util_duplicate(), MCL_EVENT_OPTION_CORRELATION_ID, MCL_EVENT_OPTION_DESCRIPTION, MCL_EVENT_OPTION_DETAILS, MCL_INVALID_PARAMETER, MCL_TRUE, string_destroy(), and string_initialize_new().