Misc
Various functions which don't fit into any other category.

API

ec_init()

ec_err_t ec_init(void);
Initialises libec and its dependencies. Returns a nonzero error code on failure. ec_init() must be called before any other function in the library.
This function may be called more than once, but is not thread-safe.
1
#include <ec/h>
2
...
3
if(ec_init() == 0) {
4
//initialised OK
5
}
6
...
Copied!

ec_version()

char *ec_version(void);
Returns the version of libec in use. This function is guaranteed to return a valid string.
1
#include <ec.h>
2
...
3
printf("Libec version: %s\n", ec_version());
4
...
Copied!

ec_errstr()

char *ec_errstr(ec_err_t error);
Get a string description for a libec error code.
1
#include <ec.h>
2
...
3
printf("Error: %s\n", ec_errstr(error));
4
...
Copied!
Last modified 1yr ago