Loading...
Searching...
No Matches
cyaml_config Struct Reference

`#include <cyaml.h>`

## Data Fields

cyaml_log_fn_t | log_fn
void * | log_ctx
cyaml_mem_fn_t | mem_fn
void * | mem_ctx
cyaml_log_t | log_level
cyaml_cfg_flags_t | flags

## Detailed Description

Client CYAML configuration data.

Todo
  Should provide facility for client to provide its own custom allocation functions.

## Field Documentation

## flags

cyaml_cfg_flags_t cyaml_config::flags

CYAML behaviour flags.

## log_ctx

void* cyaml_config::log_ctx

Client logging function context pointer.

Clients using their own custom logging function can pass their context here, which will be passed through to their log_fn.

The default logging function, cyaml_log doesn't require a logging context, so pass NULL for the log_ctx if using that.

## log_fn

cyaml_log_fn_t cyaml_config::log_fn

Client function to use for logging.

Clients can implement their own logging function and set it here. Otherwise, set log_fn to cyaml_log if CYAML's default logging to stderr is suitable (see its documentation for more details), or set to NULL to suppress all logging.

Note
  Useful backtraces are issued through the log_fn at CYAML_LOG_ERROR level. If your application needs to load user YAML data, these backtraces can help users figure out what's wrong with their YAML, causing it to be rejected by your schema.

## log_level

cyaml_log_t cyaml_config::log_level

Minimum logging priority level to be issued.

Specifying e.g. CYAML_LOG_WARNING will cause only warnings and errors to emerge.

## mem_ctx

void* cyaml_config::mem_ctx

Client memory function context pointer.

Clients using their own custom allocation function can pass their context here, which will be passed through to their mem_fn.

The default allocation function, cyaml_mem doesn't require an allocation context, so pass NULL for the mem_ctx if using that.

## mem_fn

cyaml_mem_fn_t cyaml_config::mem_fn

Client function to use for memory allocation handling.

Clients can implement their own, or pass cyaml_mem to use CYAML's default allocator.

Note
  Depending on platform, when using CYAML's default allocator, clients may need to take care to ensure any allocated memory is freed using cyaml_mem too.

The documentation for this struct was generated from the following file:

- include/cyaml/cyaml.h