Macaw OS C reference

Function getpref

#include <macaw.h>
int getpref(const char *key, char *buf, int size);

Reads one of the system preferences, the settings in System Preferences, as text.

Parameters

keyconst char *
The setting's name, like "volume" or "clock_24h".
bufchar *
Where its value goes: a number like "0.8", "true" or "false", or the setting's own text.
sizeint
How many bytes buf holds. A value that doesn't fit is cut short.

Returns int

The value's whole length, or -1 if there's no setting called key.

In The desktop, with openpath, setpref.