Amendment to prev commit: We can distinguish these two scenarios by the return
[nedit.git] / util / prefFile.h
blobd0e1c7315da575b1ec6623caece2581eb2d7a51a
1 /* $Id: prefFile.h,v 1.8 2004/11/09 21:58:45 yooden Exp $ */
2 /*******************************************************************************
3 * *
4 * prefFile.h -- Nirvana Editor Preference File Header File *
5 * *
6 * Copyright 2002 The NEdit Developers *
7 * *
8 * This is free software; you can redistribute it and/or modify it under the *
9 * terms of the GNU General Public License as published by the Free Software *
10 * Foundation; either version 2 of the License, or (at your option) any later *
11 * version. In addition, you may distribute versions of this program linked to *
12 * Motif or Open Motif. See README for details. *
13 * *
14 * This software is distributed in the hope that it will be useful, but WITHOUT *
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
17 * more details. *
18 * *
19 * You should have received a copy of the GNU General Public License along with *
20 * software; if not, write to the Free Software Foundation, Inc., 59 Temple *
21 * Place, Suite 330, Boston, MA 02111-1307 USA *
22 * *
23 * Nirvana Text Editor *
24 * July 31, 2001 *
25 * *
26 *******************************************************************************/
28 #ifndef NEDIT_PREFFILE_H_INCLUDED
29 #define NEDIT_PREFFILE_H_INCLUDED
31 #include <X11/Intrinsic.h>
33 enum PrefDataTypes {PREF_INT, PREF_BOOLEAN, PREF_ENUM, PREF_STRING,
34 PREF_ALLOC_STRING};
36 typedef struct _PrefDescripRec {
37 char *name;
38 char *class;
39 int dataType;
40 char *defaultString;
41 void *valueAddr;
42 void *arg;
43 int save;
44 } PrefDescripRec;
46 XrmDatabase CreatePreferencesDatabase(const char *fileName,
47 const char *appName, XrmOptionDescList opTable,
48 int nOptions, unsigned int *argcInOut, char **argvInOut);
49 void RestorePreferences(XrmDatabase prefDB, XrmDatabase appDB,
50 const char *appName, const char *appClass, PrefDescripRec *rsrcDescrip, int nRsrc);
51 void OverlayPreferences(XrmDatabase prefDB, const char *appName,
52 const char *appClass, PrefDescripRec *rsrcDescrip, int nRsrc);
53 void RestoreDefaultPreferences(PrefDescripRec *rsrcDescrip, int nRsrc);
54 int SavePreferences(Display *display, const char *fileName,
55 const char *fileHeader, PrefDescripRec *rsrcDescrip, int nRsrc);
57 #endif /* NEDIT_PREFFILE_H_INCLUDED */