A couple of context functions to catch errors and display them. More...
Classes | |
| struct | _pcp_ctx_t |
| PCP context object. More... | |
Functions | |
| PCPCTX * | ptx_new () |
| Create a new PCP Context. More... | |
| void | ptx_clean (PCPCTX *ptx) |
| Frees the memory allocated by the context. More... | |
| void | fatal (PCPCTX *ptx, const char *fmt,...) |
| Set an error message. More... | |
| void | fatals_ifany (PCPCTX *ptx) |
| Prints error messages to STDERR, if there are some. More... | |
| void | fatals_reset (PCPCTX *ptx) |
| Reset the error variables. More... | |
A couple of context functions to catch errors and display them.
The context also holds the key hashes.
| void fatal | ( | PCPCTX * | ptx, |
| const char * | fmt, | ||
| ... | |||
| ) |
Set an error message.
This function gets a printf() like error message, which it stores in the global PCP_ERR variable and sets PCP_ERRSET to 1.
| [in] | ptx | PCP Context object. |
| [in] | fmt | printf() like format description. |
| [in] | ... | format parameters, if any. |
| void fatals_ifany | ( | PCPCTX * | ptx | ) |
Prints error messages to STDERR, if there are some.
FIXME: add something like this which returns the message.
| [in] | ptx | PCP Context object. |
| void fatals_reset | ( | PCPCTX * | ptx | ) |
Reset the error variables.
This can be used to ignore previous errors. Use with care.
| [in] | ptx | PCP Context object. |
| void ptx_clean | ( | PCPCTX * | ptx | ) |
Frees the memory allocated by the context.
| [in] | ptx | PCP Context object. |
| PCPCTX* ptx_new | ( | ) |
Create a new PCP Context.
Sets all context pointers to NULL.
1.8.3.1