23#ifndef __STUMPLESS_PARAM_H
24# define __STUMPLESS_PARAM_H
27# include <stumpless/config.h>
31# define STUMPLESS_MAX_PARAM_NAME_LENGTH 32
40#ifdef STUMPLESS_JOURNALD_TARGETS_SUPPORTED
128# ifdef STUMPLESS_JOURNALD_TARGETS_SUPPORTED
132# ifdef STUMPLESS_THREAD_SAFETY_SUPPORTED
#define STUMPLESS_PUBLIC_FUNCTION
Marks functions that are provided for use by the library.
定义 config.h:31
Types and functions for creating and modifying entries.
void stumpless_unload_param(const struct stumpless_param *param)
Unloads a param.
const char * stumpless_get_param_value(const struct stumpless_param *param)
Returns the value of the given param.
struct stumpless_param * stumpless_set_param_name(struct stumpless_param *param, const char *name)
Sets the name of the given param.
#define STUMPLESS_MAX_PARAM_NAME_LENGTH
The maximum length of a parameter name, as specified by RFC 5424.
定义 param.h:31
size_t(* stumpless_param_namer_func_t)(const struct stumpless_entry *entry, size_t element_index, size_t param_index, char *destination, size_t size)
Gets the name to use for the journald field corresponding to this param.
定义 param.h:81
struct stumpless_param * stumpless_set_param_value(struct stumpless_param *param, const char *value)
Sets the value of the given param.
const char * stumpless_param_to_string(const struct stumpless_param *param)
Returns the name and the value from param as a formatted string.
void stumpless_destroy_param(const struct stumpless_param *param)
Destroys a param, freeing any allocated memory.
struct stumpless_param * stumpless_load_param(struct stumpless_param *param, const char *name, const char *value)
Loads a provided param with the given values.
struct stumpless_param * stumpless_new_param_from_string(const char *string)
Creates a new param given a string by parsing the string and calling stumpless_new_param.
struct stumpless_param * stumpless_copy_param(const struct stumpless_param *param)
Creates a copy of a param.
struct stumpless_param * stumpless_new_param(const char *name, const char *value)
Creates a new param with the given name and value.
const char * stumpless_get_param_name(const struct stumpless_param *param)
Returns the name of the given param.
A log entry.
定义 entry.h:60
A parameter within a structured data element.
定义 param.h:93
size_t name_length
The number of characters in name (not including the NULL character).
定义 param.h:110
char * value
The value may be any UTF-8 string.
定义 param.h:125
char name[32+1]
The name of the parameter.
定义 param.h:108
void * mutex
A pointer to a mutex which protects all target fields.
定义 param.h:137
stumpless_param_namer_func_t get_journald_name
Gets the name to use for the journald field corresponding to this param.
定义 param.h:130
size_t value_length
The number of characters in value (not including the NULL character).
定义 param.h:127