jose\_cfg(3) Library Functions Manual jose\_cfg(3)

# [NAME](#NAME)

jose\_cfg - José Configuration.

# [SYNOPSIS](#SYNOPSIS)

## [Typedefs](#Typedefs)

typedef jose\_cfg\_t **jose\_cfg\_auto\_t**  
Defines a jose\_cfg\_t which calls **jose\_cfg\_decref()** at end of scope.

## [Functions](#Functions)

jose\_cfg\_t * **jose\_cfg** (void)  
Creates a new configuration instance. jose\_cfg\_t * **jose\_cfg\_incref** (jose\_cfg\_t \*cfg)  
Increases the reference count of a configuration instance. void **jose\_cfg\_decref** (jose\_cfg\_t \*cfg)  
Decreases the reference count of a configuration instance. void **jose\_cfg\_set\_err\_func** (jose\_cfg\_t \*cfg, jose\_cfg\_err\_t \*err, void \*misc)  
Sets the error handler function for this configuration instance. void * **jose\_cfg\_get\_err\_misc** (jose\_cfg\_t \*cfg)  
Gets the miscellaneous data associated with the current error handler. void **jose\_cfg\_err** (jose\_cfg\_t \*cfg, uint64\_t err, const char \*fmt,...)  
Submit an error.

# [Detailed Description](#Detailed_Description)

José Configuration.

# [Typedef Documentation](#Typedef_Documentation)

## [typedef jose\_cfg\_t **jose\_cfg\_auto\_t**](#typedef_jose_cfg_t_)

Defines a jose\_cfg\_t which calls **jose\_cfg\_decref()** at end of scope. For example:

```
void foo() {


    jose_cfg_auto_t *cfg = jose_cfg();


    // jose_cfg_decref() implicitly called
}
```

# [Function Documentation](#Function_Documentation)

## [jose\_cfg\_t* jose\_cfg (void)](#jose_cfg_t*_jose_cfg_%28void%29)

Creates a new configuration instance.

**Returns:**

A newly-allocated configuration instance.

## [jose\_cfg\_t* jose\_cfg\_incref (jose\_cfg\_t * cfg)](#jose_cfg_t*_jose_cfg_incref_%28jose_cfg_t_*_cfg%29)

Increases the reference count of a configuration instance. This function always succeeds.

**Parameters:**

*cfg* The configuration context.

**Returns:**

The value of cfg **(for convenience).**

## [void jose\_cfg\_decref (jose\_cfg\_t * cfg)](#void_jose_cfg_decref_%28jose_cfg_t_*_cfg%29)

Decreases the reference count of a configuration instance. When the reference count reaches zero, the configuration instance is freed.

**Parameters:**

*cfg* The configuration context.

## [void jose\_cfg\_set\_err\_func (jose\_cfg\_t * cfg, jose\_cfg\_err\_t * err, void * misc)](#void_jose_cfg_set_err_func_%28jose_cfg_t_*_cfg,_jose_cfg_err_t_*_err,_void_*_misc%29)

Sets the error handler function for this configuration instance. The value of misc *will be passed to the error handler function.*

You may pass NULL to err *to return to the default error handler.*

**Parameters:**

*cfg* The configuration context.  
*err* The error handler function you wish to enable.  
*misc* The miscellaneous data you wish to pass to the error handler.

## [void* jose\_cfg\_get\_err\_misc (jose\_cfg\_t * cfg)](#void*_jose_cfg_get_err_misc_%28jose_cfg_t_*_cfg%29)

Gets the miscellaneous data associated with the current error handler.

**Parameters:**

*cfg* The configuration context.

**Returns:**

The miscellaneous data associated with the error handler.

## [void jose\_cfg\_err (jose\_cfg\_t * cfg, uint64\_t err, const char * fmt, ...)](#void_jose_cfg_err_%28jose_cfg_t_*_cfg,_uint64_t_err,_const_char_*_fmt,__)

Submit an error. The error handler will be called with the error provided.

**Parameters:**

*cfg* The configuration context (optional).  
*err* The number corresponding to this error type.  
*fmt* A printf()-style format string.  
*...* The printf()-style arguments.

# [Author](#Author)

Generated automatically by Doxygen for José from the source code.

Tue May 30 2017 José

---

Document: jose_cfg(3) from libjose 15-r7 (Chainguard OS)
Source: https://github.com/latchset/jose.git
