#include <ggi/ggi.h> int ggiParseMode(const char *s, ggi_mode *m); #define ggiPrintMode(m) ggiFPrintMode(stdout,(m)) int ggiSPrintMode(char *s, const ggi_mode *m); int ggiFPrintMode(FILE *s, const ggi_mode *m);
The ggi*PrintMode functions print all the members of ggi_mode(3) in a human-readable form. ggiSPrintMode outputs to a preallocated string buffer, ggiFPrintMode outputs to a stdio FILE, and ggiPrintMode outputs to standard output. These functions correspond to sprintf(3), fprintf(3) and printf(3) respectively.
The format of the string used by these functions is exactly the same as the one used in the GGI_DEFMODE environment variable described in libggi(7).
The string returned by both ggiSPrintMode and ggiFPrintMode does not contain a trailing newline.
So m contains all parameters that have been successfully parsed. For most applications there will be no need for testing ggiParseMode for failure.