Functions

SetC

Inspect or change a character system setting

Syntax

Signature
const char *SetC( int specifier, const char *value );

Arguments

specifier _SET_COLOR or _SET_DATEFORMAT, from xdev-wtui-set.h.

value New string value, or NULL to read the current setting.

Return value

A pointer to the previous setting string, or NULL for an unsupported specifier.

Description

Use this string-setting interface for `_SET_DATEFORMAT` and `_SET_COLOR`. `_SET_DATEFORMAT` sets the day, month and year order used by `CToD()` and the display format used by `DToC()`. For example, `"dd/mm/yyyy"` displays a four-digit year. `_SET_COLOR` delegates to `SetColor()`.

Passing `NULL` reads the current value. The function returns a pointer to a shared buffer. Copy the text before another call that reads or changes the same setting when you need to restore it later.

Example

setc.c
#include "xdev-wtui.h"
#include "xdev-wtui-set.h"

#include <stdio.h>

int main( void )
{
   SetC( _SET_DATEFORMAT, "mm/dd/yyyy" );
   puts( DToC( 19901010 ) );

   return 0;
}