event.c File Reference

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"
Include dependency graph for event.c:

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...
 

Detailed Description

Event module implementation file.


Date
Jul 27, 2016

Definition in file event.c.

Function Documentation

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.

Parameters
[in]eventStores 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]metaMeta of event set which is going to be added.
[in]typeType of event.
[in]versionVersion number of event.
[in]severitySeverity level.
[in]timestampTimestamp of the event in YYYY-MM-DDThh:mm:ss.sssZ format. Ex:2016-04-26T08:06:25.317Z.
[out]eventEvent handle which is going to be initialized.
Returns

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
[in]eventEvent to set its option.
[in]optionOne of the options listed in E_MCL_EVENT_OPTION.
[in]valueNew value of the option.
Returns

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().

Here is the call graph for this function: