source: trunk/include/helpers/prfh.h@ 33

Last change on this file since 33 was 33, checked in by umoeller, 25 years ago

misc. changes

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