| 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 | APIRET prfhQueryKeysForApp(HINI hIni,
|
|---|
| 51 | const char *pcszApp,
|
|---|
| 52 | PSZ *ppszKeys);
|
|---|
| 53 |
|
|---|
| 54 | #ifdef __DEBUG_MALLOC_ENABLED__ // setup.h, helpers\memdebug.c
|
|---|
| 55 | PSZ prfhQueryProfileDataDebug(HINI hIni,
|
|---|
| 56 | const char *pcszApp,
|
|---|
| 57 | const char *pcszKey,
|
|---|
| 58 | PULONG pcbBuf,
|
|---|
| 59 | const char *file,
|
|---|
| 60 | unsigned long line,
|
|---|
| 61 | const char *function);
|
|---|
| 62 | #define prfhQueryProfileData(a, b, c, d) prfhQueryProfileDataDebug((a), (b), (c), (d), __FILE__, __LINE__, __FUNCTION__)
|
|---|
| 63 | #else
|
|---|
| 64 | PSZ prfhQueryProfileData(HINI hIni,
|
|---|
| 65 | const char *pcszApp,
|
|---|
| 66 | const char *pcszKey,
|
|---|
| 67 | PULONG pcbBuf);
|
|---|
| 68 | #endif
|
|---|
| 69 |
|
|---|
| 70 | CHAR prfhQueryProfileChar(HINI hini,
|
|---|
| 71 | const char *pcszApp,
|
|---|
| 72 | const char *pcszKey,
|
|---|
| 73 | CHAR cDefault);
|
|---|
| 74 |
|
|---|
| 75 | LONG prfhQueryColor(const char *pcszKeyName, const char *pcszDefault);
|
|---|
| 76 |
|
|---|
| 77 | /*
|
|---|
| 78 | *@@ COUNTRYSETTINGS:
|
|---|
| 79 | * structure used for returning country settings
|
|---|
| 80 | * with prfhQueryCountrySettings.
|
|---|
| 81 | */
|
|---|
| 82 |
|
|---|
| 83 | typedef struct _COUNTRYSETTINGS
|
|---|
| 84 | {
|
|---|
| 85 | ULONG ulDateFormat,
|
|---|
| 86 | // date format:
|
|---|
| 87 | // -- 0 mm.dd.yyyy (English)
|
|---|
| 88 | // -- 1 dd.mm.yyyy (e.g. German)
|
|---|
| 89 | // -- 2 yyyy.mm.dd (Japanese)
|
|---|
| 90 | // -- 3 yyyy.dd.mm
|
|---|
| 91 | ulTimeFormat;
|
|---|
| 92 | // time format:
|
|---|
| 93 | // -- 0 12-hour clock
|
|---|
| 94 | // -- >0 24-hour clock
|
|---|
| 95 | CHAR cDateSep,
|
|---|
| 96 | // date separator (e.g. '/')
|
|---|
| 97 | cTimeSep,
|
|---|
| 98 | // time separator (e.g. ':')
|
|---|
| 99 | cDecimal,
|
|---|
| 100 | // decimal separator (e.g. '.')
|
|---|
| 101 | cThousands;
|
|---|
| 102 | // thousands separator (e.g. ',')
|
|---|
| 103 | } COUNTRYSETTINGS, *PCOUNTRYSETTINGS;
|
|---|
| 104 |
|
|---|
| 105 | VOID prfhQueryCountrySettings(PCOUNTRYSETTINGS pcs);
|
|---|
| 106 |
|
|---|
| 107 | APIRET prfhCopyKey(HINI hiniSource,
|
|---|
| 108 | const char *pcszSourceApp,
|
|---|
| 109 | const char *pcszKey,
|
|---|
| 110 | HINI hiniTarget,
|
|---|
| 111 | const char *pcszTargetApp);
|
|---|
| 112 |
|
|---|
| 113 | APIRET prfhCopyApp(HINI hiniSource,
|
|---|
| 114 | const char *pcszSourceApp,
|
|---|
| 115 | HINI hiniTarget,
|
|---|
| 116 | const char *pcszTargetApp,
|
|---|
| 117 | PSZ pszErrorKey);
|
|---|
| 118 |
|
|---|
| 119 | ULONG prfhRenameKey(HINI hini,
|
|---|
| 120 | const char *pcszOldApp,
|
|---|
| 121 | const char *pcszOldKey,
|
|---|
| 122 | const char *pcszNewApp,
|
|---|
| 123 | const char *pcszNewKey);
|
|---|
| 124 |
|
|---|
| 125 | BOOL prfhSetUserProfile(HAB hab,
|
|---|
| 126 | const char *pcszUserProfile);
|
|---|
| 127 |
|
|---|
| 128 | ULONG prfhINIError(ULONG ulOptions,
|
|---|
| 129 | FILE* fLog,
|
|---|
| 130 | PFNWP fncbError,
|
|---|
| 131 | PSZ pszErrorString);
|
|---|
| 132 |
|
|---|
| 133 | ULONG prfhINIError2(ULONG ulOptions,
|
|---|
| 134 | const char *pcszINI,
|
|---|
| 135 | FILE* fLog,
|
|---|
| 136 | PFNWP fncbError,
|
|---|
| 137 | PSZ pszErrorString);
|
|---|
| 138 |
|
|---|
| 139 | BOOL prfhCopyProfile(HAB hab,
|
|---|
| 140 | FILE* fLog,
|
|---|
| 141 | HINI hOld,
|
|---|
| 142 | PSZ pszOld,
|
|---|
| 143 | PSZ pszNew,
|
|---|
| 144 | PFNWP fncbUpdate,
|
|---|
| 145 | HWND hwnd, ULONG msg, ULONG ulCount, ULONG ulMax,
|
|---|
| 146 | PFNWP fncbError);
|
|---|
| 147 |
|
|---|
| 148 | APIRET prfhSaveINIs(HAB hab,
|
|---|
| 149 | FILE* fLog,
|
|---|
| 150 | PFNWP fncbUpdate,
|
|---|
| 151 | HWND hwnd, ULONG msg,
|
|---|
| 152 | PFNWP fncbError);
|
|---|
| 153 |
|
|---|
| 154 | #endif
|
|---|
| 155 |
|
|---|
| 156 | #if __cplusplus
|
|---|
| 157 | }
|
|---|
| 158 | #endif
|
|---|
| 159 |
|
|---|