libprelude Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#define LIBPRELUDE_VERSION int prelude_init (int *argc, char **argv); void prelude_deinit (void); const char * prelude_check_version (const char *req_version); int prelude_thread_init (void *nil); void prelude_fork_child (void); void prelude_fork_parent (void); void prelude_fork_prepare (void);
Before any operation are done using the prelude library, the user first need
to initialize it using the prelude_init()
function.
int ret; ret = prelude_init(&argc, argv); if ( ret < 0 ) { prelude_perror(ret, "unable to initialize the prelude library"); return -1; }
int prelude_init (int *argc, char **argv);
Call this function before using any other Prelude functions in your applications.
It will initialize everything needed to operate the library and parses some standard
command line options. argc
and argv
are adjusted accordingly so your own code will
never see those standard arguments.
|
Address of the argc parameter of your main() function.
|
|
Address of the argv parameter of your main() function.
|
Returns : |
0 on success, a negative value if an error occured. |
void prelude_deinit (void);
Call this function if you're done using the library and want to free global shared ressource allocated by libprelude.
const char * prelude_check_version (const char *req_version);
If req_version
is NULL this function will return the version of the library.
Otherwise, req_version
will be compared to the current library version. If
the library version is higher or equal, this function will return the current
library version. Otherwise, NULL is returned.
|
The minimum acceptable version number. |
Returns : |
The current library version, or NULL if req_version doesn't match.
|