Preferences structure definition
typedef struct { int skeletonData; } Prefs; Prefs prefs;
Open preferences
void startApp() { Int16 prefSize = sizeof(Prefs); if ((PrefGetAppPreferences (AppCreator, 1000, // pref database id &prefs, &prefSize, true) // saved during Hotsync == noPreferenceFound) || (prefSize != sizeof(Prefs))) { // default initialization, since discovered // Prefs was missing or old. prefs.skeletonData=1; } }
Write preferences
void stopApp() { PrefSetAppPreferences (AppCreator, 1000, // pref database id 1, // version of pref database &prefs, sizeof(Prefs), true); // saved during hotsync }