Create and destroy LibGAlloc resource list structures
Name
ggiGACreateList, ggiGADestroyList : Create and destroy LibGAlloc resource list structures
Synopsis
#include <ggi/galloc.h> ggiGA_resource_list ggiGACreateList(void); int ggiGADestroyList(ggiGA_resource_list *list);
Description
ggiGACreateList creates an empty resource list.
ggiGADestroyList destroys the resource list. It empties the list via ggiGAEmptyList(3) before destroying.
Some functions create a new list internally when passed an NULL-list. It must be destroyed as shown below:
ggiGA_resource_list list = NULL; ggiGAGet(vis, &list); /* use list */ ggiGADestroyList(&list);
Return value
ggiGACreateList returns a pointer to the list, NULL on failure.
ggiGADestroyList returns GALLOC_OK on success or an error code, otherwise.
Example
int rc; ggiGA_resource_list list; list = ggiGACreateList(); if (list == NULL) { /* error handling */ } /* do something with list */ rc = ggiGADestroy(list); if (rc != GALLOC_OK) { /* error handling */ }