automotive-dlt
|
Go to the source code of this file.
Macros | |
#define | DLT_ENV_LL_SET_INCREASE 10 |
Functions | |
int | dlt_env_extract_id (char **const env, char *id) |
extract id out of given string More... | |
int | dlt_env_helper_to_lower (char **const env, char *result, int const res_len) |
convert a given string to lower-case More... | |
int | dlt_env_extract_symbolic_ll (char **const env, int8_t *ll) |
int | dlt_env_extract_ll (char **const env, int8_t *ll) |
extract log-level out of given string More... | |
int | dlt_env_extract_ll_item (char **const env, dlt_env_ll_item *const item) |
extract one item out of string More... | |
int | dlt_env_init_ll_set (dlt_env_ll_set *const ll_set) |
initialize ll_set More... | |
void | dlt_env_free_ll_set (dlt_env_ll_set *const ll_set) |
release ll_set More... | |
int | dlt_env_increase_ll_set (dlt_env_ll_set *const ll_set) |
increase size of ll_set by LL_SET_INCREASE elements More... | |
int | dlt_env_extract_ll_set (char **const env, dlt_env_ll_set *const ll_set) |
extract all items out of string More... | |
int | dlt_env_ids_match (char const *const a, char const *const b) |
check if two ids match More... | |
int | dlt_env_ll_item_get_matching_prio (dlt_env_ll_item const *const item, char const *const apid, char const *const ctid) |
check if (and how) apid and ctid match with given item More... | |
int | dlt_env_adjust_ll_from_env (dlt_env_ll_set const *const ll_set, char const *const apid, char const *const ctid, int const ll) |
adjust log-level based on values given through environment More... | |
Definition in file dlt_env_ll.c.
#define DLT_ENV_LL_SET_INCREASE 10 |
Definition at line 31 of file dlt_env_ll.c.
Referenced by dlt_env_increase_ll_set(), and dlt_env_init_ll_set().
int dlt_env_extract_id | ( | char **const | env, |
char * | id | ||
) |
extract id out of given string
Extract 4-byte string out of given environment string, the pointer of the environment string is moved to the next un-used character and the extracted id is copied into
id | Example: env[] = "abcd:1234:3" char res[4u]; char * tmp = &env[0]; int ret = extract_id(&tmp, res); assert(ret == 0); assert(*tmp == ':'); assert(res[3] == 'd'); |
Definition at line 58 of file dlt_env_ll.c.
Referenced by dlt_env_extract_ll_item().
int dlt_env_extract_ll | ( | char **const | env, |
int8_t * | ll | ||
) |
extract log-level out of given string
A valid log-level is a numeric value in the range of -1 .. 6, with: -1: default 0: off 1: fatal 2: error 3: warning 4: info 5: debug 6: verbose During parsing, the environment string is moved to the next un-used character and the extracted log-level is written into
ll | Example: env[] = "abcd:1234:6" int ll; char ** tmp = &env[10]; // tmp points to '6'! int ret = extract_ll(&tmp, &ll); assert(ret == 0); assert(*tmp == NULL); assert(ll == 6); |
Definition at line 228 of file dlt_env_ll.c.
References dlt_env_extract_symbolic_ll().
Referenced by dlt_env_extract_ll_item().
int dlt_env_extract_ll_item | ( | char **const | env, |
dlt_env_ll_item *const | item | ||
) |
extract one item out of string
Definition at line 281 of file dlt_env_ll.c.
References dlt_env_ll_item::appId, dlt_env_ll_item::ctxId, dlt_env_extract_id(), dlt_env_extract_ll(), and dlt_env_ll_item::ll.
Referenced by dlt_env_extract_ll_set().
int dlt_env_extract_symbolic_ll | ( | char **const | env, |
int8_t * | ll | ||
) |
Definition at line 136 of file dlt_env_ll.c.
References dlt_env_helper_to_lower().
Referenced by dlt_env_extract_ll().
int dlt_env_helper_to_lower | ( | char **const | env, |
char * | result, | ||
int const | res_len | ||
) |
convert a given string to lower-case
Stops end of string or if ';' is detected
Definition at line 93 of file dlt_env_ll.c.
Referenced by dlt_env_extract_symbolic_ll().
int dlt_env_ids_match | ( | char const *const | a, |
char const *const | b | ||
) |
check if two ids match
Definition at line 454 of file dlt_env_ll.c.
Referenced by dlt_env_ll_item_get_matching_prio().
int dlt_env_increase_ll_set | ( | dlt_env_ll_set *const | ll_set | ) |
increase size of ll_set by LL_SET_INCREASE elements
Definition at line 370 of file dlt_env_ll.c.
References dlt_env_ll_set::array_size, DLT_ENV_LL_SET_INCREASE, and dlt_env_ll_set::item.
Referenced by dlt_env_extract_ll_set().
int dlt_env_init_ll_set | ( | dlt_env_ll_set *const | ll_set | ) |
initialize ll_set
Must call release_ll_set before exit to release all memory
Definition at line 327 of file dlt_env_ll.c.
References dlt_env_ll_set::array_size, DLT_ENV_LL_SET_INCREASE, dlt_env_ll_set::item, and dlt_env_ll_set::num_elem.
Referenced by dlt_env_extract_ll_set().
int dlt_env_ll_item_get_matching_prio | ( | dlt_env_ll_item const *const | item, |
char const *const | apid, | ||
char const *const | ctid | ||
) |
check if (and how) apid and ctid match with given item
Resulting priorities:
In case of error, -1 is returned.
Definition at line 488 of file dlt_env_ll.c.
References dlt_env_ll_item::appId, dlt_env_ll_item::ctxId, and dlt_env_ids_match().
Referenced by dlt_env_adjust_ll_from_env().