#include "dsi.h"#include "problem.h"
Go to the source code of this file.
Functions | |
| int | gs_comp_dsi_object (void *key, void *d) |
| void | gs_free_dsi_object (void *d) |
| int | gs_insert_dsi_object (DSI_OBJECT *dsi_obj) |
| int | gs_remove_dsi_object (DSI_OBJECT *dsi_obj) |
| int | gs_is_dsi_object (void *obj) |
Variables | |
| icl_list_t * | dsi_objects = NULL |
Routines to keep track of which input args are DSI objects.
Definition in file dsi_storage.c.
| int gs_comp_dsi_object | ( | void * | key, | |
| void * | d | |||
| ) |
Comparison function for DSI objects.
| key | -- arg pointer to be compared | |
| d | -- arg pointer to be compared |
Definition at line 31 of file dsi_storage.c.
{
return (key != d);
}

| void gs_free_dsi_object | ( | void * | d | ) |
Frees a DSI object.
| d | -- pointer to object to be freed. |
Definition at line 43 of file dsi_storage.c.
{
free(d);
}

| int gs_insert_dsi_object | ( | DSI_OBJECT * | dsi_obj | ) |
Inserts the object into the list of DSI objects.
| dsi_obj | -- object to be inserted. |
Definition at line 57 of file dsi_storage.c.
{
if(!dsi_objects) {
dsi_objects = icl_list_new();
if(!dsi_objects)
return -1;
}
if(icl_list_append(dsi_objects, dsi_obj) == NULL)
return -1;
return 0;
}


| int gs_is_dsi_object | ( | void * | obj | ) |
Determines whether the specified pointer is a DSI object or just a regular argument.
| obj | -- pointer to the argument to check |
Definition at line 108 of file dsi_storage.c.
{
icl_list_t *tmp;
if(!dsi_objects)
return 0;
tmp = icl_list_search(dsi_objects, obj, gs_comp_dsi_object);
return (tmp != NULL);
}


| int gs_remove_dsi_object | ( | DSI_OBJECT * | dsi_obj | ) |
Removes the specified object from the DSI object list.
| dsi_obj | -- the object to be removed |
Definition at line 80 of file dsi_storage.c.
{
icl_list_t *tmp;
if(!dsi_objects)
return 0;
tmp = icl_list_search(dsi_objects, dsi_obj, gs_comp_dsi_object);
if(!tmp)
return -1;
if(icl_list_delete(dsi_objects, tmp, gs_free_dsi_object) < 0)
return -1;
return 0;
}

| icl_list_t* dsi_objects = NULL |
Definition at line 19 of file dsi_storage.c.
1.6.3-20100507