1 |
|
---|
2 | /*
|
---|
3 | *@@sourcefile prfh.h:
|
---|
4 | * header file for prfh.c. See remarks there.
|
---|
5 | *
|
---|
6 | * This file is new with V0.82.
|
---|
7 | *
|
---|
8 | * Note: Version numbering in this file relates to XWorkplace version
|
---|
9 | * numbering.
|
---|
10 | *
|
---|
11 | *@@include #define INCL_WINWINDOWMGR
|
---|
12 | *@@include #define INCL_WINSHELLDATA
|
---|
13 | *@@include #include <os2.h>
|
---|
14 | *@@include #include <stdio.h>
|
---|
15 | *@@include #include "prfh.h"
|
---|
16 | */
|
---|
17 |
|
---|
18 | /* Copyright (C) 1997-2000 Ulrich Mller.
|
---|
19 | * This file is part of the "XWorkplace helpers" source package.
|
---|
20 | * This is free software; you can redistribute it and/or modify
|
---|
21 | * it under the terms of the GNU General Public License as published
|
---|
22 | * by the Free Software Foundation, in version 2 as it comes in the
|
---|
23 | * "COPYING" file of the XWorkplace main distribution.
|
---|
24 | * This program is distributed in the hope that it will be useful,
|
---|
25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
27 | * GNU General Public License for more details.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #if __cplusplus
|
---|
31 | extern "C" {
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #ifndef PRFH_HEADER_INCLUDED
|
---|
35 | #define PRFH_HEADER_INCLUDED
|
---|
36 |
|
---|
37 | /* common error codes used by the prfh* functions */
|
---|
38 |
|
---|
39 | #define PRFERR_DATASIZE 10001 // couldn't query data size for key
|
---|
40 | #define PRFERR_READ 10003 // couldn't read data from source (PrfQueryProfileData error)
|
---|
41 | #define PRFERR_WRITE 10004 // couldn't write data to target (PrfWriteProfileData error)
|
---|
42 | #define PRFERR_APPSLIST 10005 // couldn't query apps list
|
---|
43 | #define PRFERR_KEYSLIST 10006 // couldn't query keys list
|
---|
44 | #define PRFERR_ABORTED 10007 // aborted by user
|
---|
45 | #define PRFERR_QUERY 10007 // PrfQueryProfile failed
|
---|
46 | #define PRFERR_INVALID_FILE_NAME 10008 // profile names don't contain .INI
|
---|
47 | #define PRFERR_INVALID_KEY 10009
|
---|
48 | #define PRFERR_KEY_EXISTS 10010
|
---|
49 |
|
---|
50 | PSZ prfhQueryKeysForApp(HINI hIni,
|
---|
51 | const char *pcszApp);
|
---|
52 |
|
---|
53 | #ifdef __XWPMEMDEBUG__ // setup.h, helpers\memdebug.c
|
---|
54 | PSZ prfhQueryProfileDataDebug(HINI hIni,
|
---|
55 | const char *pcszApp,
|
---|
56 | const char *pcszKey,
|
---|
57 | PULONG pcbBuf,
|
---|
58 | const char *file,
|
---|
59 | unsigned long line,
|
---|
60 | const char *function);
|
---|
61 | #define prfhQueryProfileData(a, b, c, d) prfhQueryProfileDataDebug((a), (b), (c), (d), __FILE__, __LINE__, __FUNCTION__)
|
---|
62 | #else
|
---|
63 | PSZ prfhQueryProfileData(HINI hIni,
|
---|
64 | const char *pcszApp,
|
---|
65 | const char *pcszKey,
|
---|
66 | PULONG pcbBuf);
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | CHAR prfhQueryProfileChar(HINI hini,
|
---|
70 | const char *pcszApp,
|
---|
71 | const char *pcszKey,
|
---|
72 | CHAR cDefault);
|
---|
73 |
|
---|
74 | LONG prfhQueryColor(const char *pcszKeyName, const char *pcszDefault);
|
---|
75 |
|
---|
76 | /*
|
---|
77 | *@@ COUNTRYSETTINGS:
|
---|
78 | * structure used for returning country settings
|
---|
79 | * with prfhQueryCountrySettings.
|
---|
80 | */
|
---|
81 |
|
---|
82 | typedef struct _COUNTRYSETTINGS
|
---|
83 | {
|
---|
84 | ULONG ulDateFormat,
|
---|
85 | // date format:
|
---|
86 | // -- 0 mm.dd.yyyy (English)
|
---|
87 | // -- 1 dd.mm.yyyy (e.g. German)
|
---|
88 | // -- 2 yyyy.mm.dd (Japanese)
|
---|
89 | // -- 3 yyyy.dd.mm
|
---|
90 | ulTimeFormat;
|
---|
91 | // time format:
|
---|
92 | // -- 0 12-hour clock
|
---|
93 | // -- >0 24-hour clock
|
---|
94 | CHAR cDateSep,
|
---|
95 | // date separator (e.g. '/')
|
---|
96 | cTimeSep,
|
---|
97 | // time separator (e.g. ':')
|
---|
98 | cDecimal,
|
---|
99 | // decimal separator (e.g. '.')
|
---|
100 | cThousands;
|
---|
101 | // thousands separator (e.g. ',')
|
---|
102 | } COUNTRYSETTINGS, *PCOUNTRYSETTINGS;
|
---|
103 |
|
---|
104 | VOID prfhQueryCountrySettings(PCOUNTRYSETTINGS pcs);
|
---|
105 |
|
---|
106 | ULONG prfhCopyKey(HINI hiniSource,
|
---|
107 | const char *pcszSourceApp,
|
---|
108 | const char *pcszKey,
|
---|
109 | HINI hiniTarget,
|
---|
110 | const char *pcszTargetApp);
|
---|
111 |
|
---|
112 | ULONG prfhCopyApp(HINI hiniSource,
|
---|
113 | const char *pcszSourceApp,
|
---|
114 | HINI hiniTarget,
|
---|
115 | const char *pcszTargetApp,
|
---|
116 | PSZ pszErrorKey);
|
---|
117 |
|
---|
118 | ULONG prfhRenameKey(HINI hini,
|
---|
119 | const char *pcszOldApp,
|
---|
120 | const char *pcszOldKey,
|
---|
121 | const char *pcszNewApp,
|
---|
122 | const char *pcszNewKey);
|
---|
123 |
|
---|
124 | BOOL prfhSetUserProfile(HAB hab,
|
---|
125 | const char *pcszUserProfile);
|
---|
126 |
|
---|
127 | ULONG prfhINIError(ULONG ulOptions,
|
---|
128 | FILE* fLog,
|
---|
129 | PFNWP fncbError,
|
---|
130 | PSZ pszErrorString);
|
---|
131 |
|
---|
132 | ULONG prfhINIError2(ULONG ulOptions,
|
---|
133 | const char *pcszINI,
|
---|
134 | FILE* fLog,
|
---|
135 | PFNWP fncbError,
|
---|
136 | PSZ pszErrorString);
|
---|
137 |
|
---|
138 | BOOL prfhCopyProfile(HAB hab,
|
---|
139 | FILE* fLog,
|
---|
140 | HINI hOld,
|
---|
141 | PSZ pszOld,
|
---|
142 | PSZ pszNew,
|
---|
143 | PFNWP fncbUpdate,
|
---|
144 | HWND hwnd, ULONG msg, ULONG ulCount, ULONG ulMax,
|
---|
145 | PFNWP fncbError);
|
---|
146 |
|
---|
147 | APIRET prfhSaveINIs(HAB hab,
|
---|
148 | FILE* fLog,
|
---|
149 | PFNWP fncbUpdate,
|
---|
150 | HWND hwnd, ULONG msg,
|
---|
151 | PFNWP fncbError);
|
---|
152 |
|
---|
153 | #endif
|
---|
154 |
|
---|
155 | #if __cplusplus
|
---|
156 | }
|
---|
157 | #endif
|
---|
158 |
|
---|