CAPS Universe documentation
1.0.4
All you need to know to be successful
|
How to deal with error messages. More...
Functions | |
int | caps_si_error_messages_catch (struct caps_si_handle *h, char **ptr, size_t *size) |
void | caps_si_error_messages_reset (struct caps_si_handle *h) |
This mechanism is similar to the one in libcapsclient. Thus, refer its description for details.
If not used, all error messages go to a tty or are suppressed entirely.
int caps_si_error_messages_catch | ( | struct caps_si_handle * | h, |
char ** | ptr, | ||
size_t * | size | ||
) |
Setup a self growing storage to catch error messages
[in,out] | h | Library instance |
[out] | ptr | Where to store the base address of the buffer |
[out] | size | Where to store the buffer size |
0 | Error catching successfully initialized |
negative | errno from the open_memstream() call |
If your local ptr is still NULL or your local size is still '0', then no error messages were created. Else the memory was dynamically allocated and needs to be freed after use. The buffer contains a '\0' terminated string.
void caps_si_error_messages_reset | ( | struct caps_si_handle * | h | ) |
Reset the error message buffer
[in] | h | Library instance |
If you have processed an error message, you can reset the buffer for the next error message.