glip
0.1.0-dev
The Generic Logic Interfacing Project
|
Functions | |
int | glip_new (struct glip_ctx **ctx, char *backend_name, struct glip_option backend_options[], size_t num_backend_options) |
int | glip_free (struct glip_ctx *ctx) |
Before using any of the library's functionality, it's necessary to initialize it. After using it, you need to free all claimed resources again.
To create a new library instance, call glip_new() and pass the name of the used backend and all necessary options (e.g. connection parameters). The available options differ from backend to backend, refer to the backend documentation for details. As result you get an initialized library context of type struct glip_ctx
. This context needs to be passed to all other GLIP function calls, and is similar to a this
pointer in C++.
After you're done using GLIP, free all resources by calling glip_free().
int glip_new | ( | struct glip_ctx ** | ctx, |
char * | backend_name, | ||
struct glip_option | backend_options[], | ||
size_t | num_backend_options | ||
) |
Create a new GLIP context (constructor)
Call this function to create a new glip library context for the backend with ID backend_id
. The resulting context is allocated by this function; you need to free those resources with glip_free().
You can specify the options to be used by the backend by passing those to backend_options
, and passing the number of entries in the backend_options
array to num_backend_options
.
[out] | ctx | the newly created library context, or NULL if something went wrong |
[in] | backend_name | the name of the used backend |
[in] | backend_options | options (key/value pairs) for the library and the backend |
[in] | num_backend_options | number of entries in the options array |
backend_name
is not available int glip_free | ( | struct glip_ctx * | ctx | ) |
Free all library resources (destructor)
The ctx
object is invalid after calling this function and may not be accessed any more.
ctx | the library context |