Go to the documentation of this file.
23 #ifndef __STUMPLESS_ENTRY_H
24 # define __STUMPLESS_ENTRY_H
37 #define STUMPLESS_MAX_PROCID_LENGTH 128
40 #define STUMPLESS_MAX_HOSTNAME_LENGTH 255
43 # define STUMPLESS_MAX_APP_NAME_LENGTH 48
46 # define STUMPLESS_MAX_MSGID_LENGTH 32
49 # define STUMPLESS_MAX_PARAM_NAME_LENGTH 32
113 # ifdef STUMPLESS_WINDOWS_EVENT_LOG_TARGETS_SUPPORTED
117 # ifdef STUMPLESS_THREAD_SAFETY_SUPPORTED
233 const char *element_name,
234 const char *param_name,
235 const char *param_value );
688 size_t element_index,
689 size_t param_index );
728 const char *element_name,
729 const char *param_name );
767 size_t element_index,
768 size_t param_index );
813 const char *element_name,
814 const char *param_name );
1180 const char *
msgid );
1300 size_t element_index,
1338 size_t element_index,
1340 const char *value );
1387 const char *element_name,
1388 const char *param_name,
1389 const char *value );
#define STUMPLESS_MAX_PROCID_LENGTH
The maximum length of a procid, as specified by RFC 5424.
Definition: entry.h:37
struct stumpless_entry * stumpless_set_entry_param_value_by_name(struct stumpless_entry *entry, const char *element_name, const char *param_name, const char *value)
Sets the value of the first param in the named element an entry.
stumpless_id_t id
A unique identifier of this entry.
Definition: entry.h:65
stumpless_severity
All possible severity codes available to log entries.
Definition: severity.h:185
void * wel_data
A pointer to a wel_data structure.
Definition: entry.h:115
const char * stumpless_get_entry_app_name(const struct stumpless_entry *entry)
Returns the app name of the given entry.
int prival
The prival of this entry.
Definition: entry.h:96
struct stumpless_entry * stumpless_set_entry_app_name(struct stumpless_entry *entry, const char *app_name)
Sets the app name for an entry.
void stumpless_destroy_entry_and_contents(const struct stumpless_entry *entry)
Destroys an entry as well as all elements and params that it contains, freeing any allocated memory.
struct stumpless_entry * vstumpless_set_entry_message(struct stumpless_entry *entry, const char *message, va_list subs)
Sets the message of a given entry.
size_t stumpless_get_element_count(const struct stumpless_entry *entry)
Returns the number of elements in the given entry.
struct stumpless_entry * stumpless_set_entry_message_str(struct stumpless_entry *entry, const char *message)
Sets the message of a given entry.
void stumpless_destroy_entry(const struct stumpless_entry *entry)
An alias for stumpless_destroy_entry_and_contents.
struct stumpless_entry * stumpless_set_entry_param_value_by_index(struct stumpless_entry *entry, size_t element_index, size_t param_index, const char *value)
Sets the value of the param in the element at the given index of an entry.
struct stumpless_entry * stumpless_set_entry_facility(struct stumpless_entry *entry, enum stumpless_facility facility)
Sets the facility of an entry.
struct stumpless_entry * stumpless_new_entry(enum stumpless_facility facility, enum stumpless_severity severity, const char *app_name, const char *msgid, const char *message,...)
Creates a new entry with the given characteristics.
int stumpless_get_entry_prival(const struct stumpless_entry *entry)
Returns the prival of the given entry, as defined in RFC 5424.
A parameter within a structured data element.
Definition: param.h:90
const char * stumpless_get_entry_message(const struct stumpless_entry *entry)
Returns the message of the given entry.
const char * stumpless_get_entry_msgid(const struct stumpless_entry *entry)
Returns the msgid of the given entry.
struct stumpless_element ** elements
An array holding the elements of this entry.
Definition: entry.h:110
size_t stumpless_get_element_index(const struct stumpless_entry *entry, const char *name)
Returns the index of the element with the given name in this entry, if it is found.
const char * stumpless_get_entry_hostname(const struct stumpless_entry *entry)
Returns the hostname of a given entry.
struct stumpless_entry * stumpless_set_entry_severity(struct stumpless_entry *entry, enum stumpless_severity severity)
Sets the severity of an entry.
struct stumpless_entry * vstumpless_new_entry(enum stumpless_facility facility, enum stumpless_severity severity, const char *app_name, const char *msgid, const char *message, va_list subs)
Creates a new entry with the given parameters.
#define STUMPLESS_MAX_APP_NAME_LENGTH
The maximum length of an app name, as specified by RFC 5424.
Definition: entry.h:43
struct stumpless_entry * stumpless_add_new_element(struct stumpless_entry *entry, const char *name)
Creates a new element with the given name and adds it to this entry.
#define STUMPLESS_MAX_HOSTNAME_LENGTH
The maximum length of a hostname, as specified by RFC 5424.
Definition: entry.h:40
struct stumpless_entry * stumpless_set_entry_priority(struct stumpless_entry *entry, enum stumpless_facility facility, enum stumpless_severity severity)
Sets the facility and severity of an entry.
char name[32+1]
The name of the element.
Definition: element.h:114
enum stumpless_severity stumpless_get_entry_severity(const struct stumpless_entry *entry)
Returns the severity code of the given entry.
struct stumpless_entry * stumpless_add_element(struct stumpless_entry *entry, struct stumpless_element *element)
Adds an element to an entry.
size_t msgid_length
The length of the message id, without the NULL terminator.
Definition: entry.h:108
stumpless_facility
All possible facility codes available to log entries.
Definition: facility.h:346
void stumpless_destroy_entry_only(const struct stumpless_entry *entry)
Destroys an entry, freeing any allocated memory.
struct stumpless_entry * stumpless_set_element(struct stumpless_entry *entry, size_t index, struct stumpless_element *element)
Puts the element at the given index in the given entry.
char app_name[48+1]
The app name of this entry, as a NULL-terminated string.
Definition: entry.h:98
const char * stumpless_get_entry_param_value_by_name(const struct stumpless_entry *entry, const char *element_name, const char *param_name)
Gets the value of the first param from the element with the given name in an entry.
struct stumpless_element * stumpless_get_element_by_name(const struct stumpless_entry *entry, const char *name)
Returns the element with the given name in this entry, if it is found.
struct stumpless_entry * stumpless_copy_entry(const struct stumpless_entry *entry)
Creates a copy of an entry.
size_t procid_length
The length of the procid of this entry (in bytes), without a NULL terminator.
Definition: entry.h:78
size_t message_length
The length of the message in bytes, without the NULL terminator.
Definition: entry.h:104
void * stumpless_id_t
Definition: id.h:30
char * message
The message of this entry, as a NULL-terminated string.
Definition: entry.h:102
struct stumpless_entry * stumpless_new_entry_str(enum stumpless_facility facility, enum stumpless_severity severity, const char *app_name, const char *msgid, const char *message)
Creates a new entry with the given characteristics.
#define STUMPLESS_PUBLIC_FUNCTION
Marks functions that are provided for use by the library.
Definition: config.h:31
size_t app_name_length
The length of the app name, without the NULL terminator.
Definition: entry.h:100
struct stumpless_entry * stumpless_set_entry_procid(struct stumpless_entry *entry, const char *procid)
Sets the procid of a given entry.
size_t element_count
The number of elements in this entry.
Definition: entry.h:112
struct stumpless_entry * stumpless_set_entry_param_by_index(struct stumpless_entry *entry, size_t element_index, size_t param_index, struct stumpless_param *param)
Puts the param in the element at the given index of an entry.
const char * stumpless_get_entry_param_value_by_index(const struct stumpless_entry *entry, size_t element_index, size_t param_index)
Gets the value of the param from the element at the given index in an entry.
struct stumpless_entry * stumpless_set_entry_prival(struct stumpless_entry *entry, int prival)
Sets the prival of an entry, as defined in RFC 5424.
A log entry.
Definition: entry.h:63
void * mutex
A pointer to a mutex which protects all entry fields.
Definition: entry.h:122
char msgid[32+1]
The message id of this entry, as a NULL-terminated string.
Definition: entry.h:106
struct stumpless_param * stumpless_get_entry_param_by_name(const struct stumpless_entry *entry, const char *element_name, const char *param_name)
Gets the first param from the element with the given name in an entry.
size_t hostname_length
The length of the hostname of this entry (in bytes), without a NULL terminator.
Definition: entry.h:91
#define STUMPLESS_MAX_MSGID_LENGTH
The maximum length of a msgid, as specified by RFC 5424.
Definition: entry.h:46
struct stumpless_entry * stumpless_set_entry_msgid(struct stumpless_entry *entry, const char *msgid)
Sets the msgid for an entry.
An element of structured data.
Definition: element.h:93
struct stumpless_entry * stumpless_add_new_param_to_entry(struct stumpless_entry *entry, const char *element_name, const char *param_name, const char *param_value)
Creates a new param and adds it to the given element in the given entry.
bool stumpless_entry_has_element(const struct stumpless_entry *entry, const char *name)
True if the given entry has an element with the given name, false otherwise.
struct stumpless_param * stumpless_get_entry_param_by_index(const struct stumpless_entry *entry, size_t element_index, size_t param_index)
Gets the param from the element at the given index in an entry.
char hostname[255+1]
The hostname of this entry, as a NULL-terminated string.
Definition: entry.h:84
char procid[128+1]
The procid of this entry, as a NULL-terminated string.
Definition: entry.h:71
const char * stumpless_get_entry_procid(const struct stumpless_entry *entry)
Returns the procid of a given entry.
struct stumpless_entry * stumpless_set_entry_hostname(struct stumpless_entry *entry, const char *hostname)
Sets the hostname of a given entry.
struct stumpless_entry * stumpless_set_entry_message(struct stumpless_entry *entry, const char *message,...)
Sets the message of a given entry.
enum stumpless_facility stumpless_get_entry_facility(const struct stumpless_entry *entry)
Returns the facility code of the given entry.
struct stumpless_element * stumpless_get_element_by_index(const struct stumpless_entry *entry, size_t index)
Returns the element at the given index in this Entry.