![]() |
SolarCapture C Bindings User Guide
SF-115721-CD
Issue 3
|
sc_object: Opaque object interface. Use this to pass all types of data that are not ints, doubles or char arrays (see SC_PARAM_INT, SC_PARAM_DBL and SC_PARAM_STR respectively for these). More...
Enumerations | |
enum | sc_object_type { SC_OBJ_ANY, SC_OBJ_OPAQUE, SC_OBJ_PKT_PREDICATE, SC_OBJ_C_ATTR, SC_OBJ_NODE, SC_OBJ_POOL } |
The type of data the sc_object contains. More... | |
Functions | |
enum sc_object_type | sc_object_type (struct sc_object *obj) |
Return the type of data contained within the sc_object. More... | |
int | sc_opaque_alloc (struct sc_object **obj_out, void *opaque) |
Allocate memory for an opaque sc_object. More... | |
void | sc_opaque_free (struct sc_object *obj) |
Free an sc_object previously allocated using sc_opaque_alloc. Only use this to free an opaque sc_object. The underlying data wrapped by this object will not be freed. More... | |
void | sc_opaque_set_ptr (struct sc_object *obj, void *opaque) |
Set the opaque pointer in an sc_object. More... | |
void * | sc_opaque_get_ptr (const struct sc_object *obj) |
Get the opaque pointer stored in an sc_object. More... | |
sc_object: Opaque object interface. Use this to pass all types of data that are not ints, doubles or char arrays (see SC_PARAM_INT, SC_PARAM_DBL and SC_PARAM_STR respectively for these).
enum sc_object_type |
The type of data the sc_object contains.
Enumerator | |
---|---|
SC_OBJ_OPAQUE |
An opaque pointer |
SC_OBJ_PKT_PREDICATE |
A packet predicate (see sc_pkt_predicate) |
SC_OBJ_C_ATTR |
Const attributes (see sc_attr) |
SC_OBJ_NODE |
A node (see sc_node) |
SC_OBJ_POOL |
A packet pool |
enum sc_object_type sc_object_type | ( | struct sc_object * | obj | ) |
int sc_opaque_alloc | ( | struct sc_object ** | obj_out, |
void * | opaque | ||
) |
Allocate memory for an opaque sc_object.
obj_out | On success the allocated object. |
opaque | A pointer to the data to be wrapped by the object. |
void sc_opaque_free | ( | struct sc_object * | obj | ) |
Free an sc_object previously allocated using sc_opaque_alloc. Only use this to free an opaque sc_object. The underlying data wrapped by this object will not be freed.
obj | The object to free |
void* sc_opaque_get_ptr | ( | const struct sc_object * | obj | ) |
Get the opaque pointer stored in an sc_object.
obj | The object to fetch the opaque pointer from. |