[ prev :: next :: up ] libgalloc-current (3)

Get a human readable string from a LibGAlloc resource list

Name

ggiGAanprintf : Get a human readable string from a LibGAlloc resource list

Synopsis

#include <ggi/galloc.h>

int ggiGAanprintf(ggi_visual_t vis, ggiGA_resource_list list,
                  size_t size, char *format, char **out);

Description

Allocates a string of maximum length :p:`size` + 1, and puts in it zero terminated string with a textual representation of the resource :p:`list` pointed to by request. The format argument is for future expansion. :p:`out` is pointed to the newly allocated string.

System Message: ERROR/3 (../ggi-core/libgalloc/doc/libgalloc.txt, line 407); backlink

Unknown interpreted text role "p".

System Message: ERROR/3 (../ggi-core/libgalloc/doc/libgalloc.txt, line 407); backlink

Unknown interpreted text role "p".

System Message: ERROR/3 (../ggi-core/libgalloc/doc/libgalloc.txt, line 407); backlink

Unknown interpreted text role "p".

Return value

The length of the generated string is returned, less the terminating \0.

Example

ggi_visual_t vis;

void sub autopsy(ggiGA_resquest_list req) {
     char *str;
     ggiGAanprintf(vis, req, 1024, NULL, &str);
     fprintf(stderr, "Resource list contained:\n%s\n", str);
     free(str);
     exit(-1);
}
 
[ prev :: next :: up ] libgalloc-current (3)
2006/11/09 16:51:04