---
name: "ggiSPrintMode"
section: "3ggi"
platform: "linux"
package: "libggi2-dev"
version: "1:2.0.1-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/ggiParseMode/3ggi"
---

# ggiSPrintMode(3ggi)

Parse and print formatted strings specifying LibGGI modes

Part of [ggiParseMode(3ggi)](/ggiParseMode/3ggi.md).

## NAME

ggiParseMode, ggiPrintMode, ggiSPrintMode, ggiFPrintMode - Parse and print formatted strings specifying LibGGI modes

## SYNOPSIS

**#include \<ggi/ggi.h\>**

**int ggiParseMode(const char \****s***, ggi\_mode \****m***);**

**int ggiPrintMode(ggi\_mode \****m***);**

**int ggiSPrintMode(char \****s***, ggi\_mode \****m***);**

**int ggiFPrintMode(FILE \****s***, ggi\_mode \****m***);** .SH "DESCRIPTION"

**ggiParseMode** parses a string into a **ggi\_mode**.

The **ggi\*PrintMode** functions print all the members of **ggi\_mode** 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)](/sprintf/3.md),  [**fprintf**(3)](/fprintf/3.md),  [**printf**(3)](/printf/3.md),  respectively.

The format of the string used by these functions is exactly the same as the one used in the **GGI\_DEFMODE** environment variable.

## RETURN VALUE

**ggiParseMode** returns:

- **0**

  on success, i.e. the string was correct. However, errors involving **GT\_\***, position information, or mismatched brackets do not make it fail; these errors are simply ignored.

- **\<0**

  if there is text that can not be parsed. This text is printed to stderr. All parameters parsed so far are written into *m*.

So *m* contains all parameters that have been successfully parsed. For most applications there will be no need for testing **ggiParseMode** for failure.
