ggiGAEmptyList

Name

ggiGAEmptyList, ggiGAEmptyFailures -- Free LibGAlloc resource list structure

Synopsis

#include <ggi/galloc.h>

int ggiGAEmptyList(ggiGA_resource_list *reqlist);

int ggiGAEmptyFailures(ggiGA_resource_list *reqlist);

Description

ggiGAEmptyList frees the request list linked list structures and all attached properties, modes, and private structure members. ggiGAEmptyFailures empties the rest of the list starting at the first failed resource.

Do not worry: if you have used ggiGASet() successfully on the list, then GAlloc is keeping an internal copy which you can get back with ggiGAGet().

Do worry: If you have gotten any handles, properties, modes, directbuffer structures, or private data structures from the destroyed resources, then they are now pointing at invalid memory addresses. If you want to keep them, you must copy them before calling ggiGAEmptyList.

Return value

Returns GALLOC_OK (== 0) on success, or a non-zero error if passed an invalid list.

Examples

Example 1. ggiGAEmptyList Example


        ggi_visual_t vis;
	ggiGA_resource_list list;
	ggiGA_resource_handle handle;
	struct ggiGA_ResourceProperties *props, copy;

	ggiGAGet(vis, &list);
	handle = ggiGetHandle(list, oldrequesthandle);
	props = ggiGetProperties(handle);
	if (handle != NULL)
  	   memcpy(&copy, props, sizeof(struct ggiGA_ResourceProperties));
	ggiEmptyList(list);
	list == NULL;