event.h

// SPDX-License-Identifier: MIT

safuResultE_t elosEventClone(elosEvent_t **to, elosEvent_t const *from)
[source]

Allocates a new event as a copy of an existing one

Parameters:
Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

safuResultE_t elosEventDeepCopy(elosEvent_t *to, elosEvent_t const *from)
[source]

Creates a deep copy into an exsiting event.

Parameters:
Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

safuResultE_t elosEventDelete(elosEvent_t *event)
[source]

Free the memory of an event.

Parameters:
Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

safuResultE_t elosEventDeleteMembers(elosEvent_t *event)
[source]

Free the memory for all the mebers of an event.

Parameters:
  • event (elosEvent_t*) – the event to remove the members from.

Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

safuResultE_t elosEventDeserialize(elosEvent_t *to, const char *fromJsonString)
[source]

Parse an event from a JSON string.

Parameters:
  • to (elosEvent_t*) – Pointer to the event to deserialize into.

  • from (const char*) – the string to deserialize.

Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

safuResultE_t elosEventFromJsonObject(elosEvent_t *to, const json_object *from)
[source]

Fill an event with data from a JSON object.

Parameters:
Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

safuResultE_t elosEventInitialize(elosEvent_t *event)
[source]

Zero initilizes an event.

Parameters:
Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

bool elosEventIsDateEmpty(const elosEvent_t *const event)
[source]

Check if the date field of an event is empty.

Parameters:
  • event (const elosEvent_t *const) – the event to check.

Returns:

true if seconds and nano second of date are 0

safuResultE_t elosEventNew(elosEvent_t **event)
[source]

Allocates a new zero initialized event.

Parameters:
  • event (elosEvent_t**) – the event is allocated and needs to be freed later.

Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

safuResultE_t elosEventSerialize(char **toJsonString, const elosEvent_t *from)
[source]

Serializes an event into a JSON string

Parameters:
  • toJsonString (char**) – the string to serialize into.

  • from (const elosEvent_t*) – the event to serialize.

Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure

safuResultE_t elosEventToJsonObject(json_object *to, const elosEvent_t *from)
[source]

Generates a JSON object from an event.

Parameters:
Returns:

  • SAFU_RESULT_OK on success

  • SAFU_RESULT_FAILED on failure