Functions

Set

Inspect or change a system setting

Syntax

Signature
int Set( int specifier, int value );

Arguments

specifier _SET_CANCEL, _SET_CURSOR, _SET_EVENTMASK, _SET_EPOCH or _SET_EXACT, from xdev-wtui-set.h.

value New setting value, or NIL to read it without changing it.

Return value

The previous setting value, or NIL for an unsupported specifier.

Description

Use a constant from `xdev-wtui-set.h` to read or change a numeric or logical setting. Pass `NIL` to read it. To change it temporarily, keep the previous value returned by the setter and pass that value back when done.

Besides `_SET_CANCEL`, `_SET_CURSOR`, `_SET_EVENTMASK`, `_SET_EPOCH` and `_SET_EXACT`, the numeric and logical interface handles `_SET_FIXED` and `_SET_DECIMALS` for number formatting. It also handles `_SET_BELL`, `_SET_CONFIRM`, `_SET_ESCAPE`, `_SET_INSERT`, `_SET_EXIT` and `_SET_SCOREBOARD` for READ behavior.

Use `SetC()` for string settings such as the date format or palette.

Example

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

#include <stdio.h>

int main( void )
{
   int previous = Set( _SET_EPOCH, 1950 );
   printf( "Current epoch: %d\n", Set( _SET_EPOCH, NIL ) );
   Set( _SET_EPOCH, previous );

   return 0;
}