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

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

Misc. updates.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1/* $Id: prfh.h 22 2001-01-14 16:42:22Z 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
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 BOOL prfhSetUserProfile(HAB hab,
119 const char *pcszUserProfile);
120
121 ULONG prfhINIError(ULONG ulOptions,
122 FILE* fLog,
123 PFNWP fncbError,
124 PSZ pszErrorString);
125
126 ULONG prfhINIError2(ULONG ulOptions,
127 const char *pcszINI,
128 FILE* fLog,
129 PFNWP fncbError,
130 PSZ pszErrorString);
131
132 BOOL prfhCopyProfile(HAB hab,
133 FILE* fLog,
134 HINI hOld,
135 PSZ pszOld,
136 PSZ pszNew,
137 PFNWP fncbUpdate,
138 HWND hwnd, ULONG msg, ULONG ulCount, ULONG ulMax,
139 PFNWP fncbError);
140
141 APIRET prfhSaveINIs(HAB hab,
142 FILE* fLog,
143 PFNWP fncbUpdate,
144 HWND hwnd, ULONG msg,
145 PFNWP fncbError);
146
147#endif
148
149#if __cplusplus
150}
151#endif
152
Note: See TracBrowser for help on using the repository browser.