[109] | 1 |
|
---|
| 2 | /*
|
---|
| 3 | *@@sourcefile nls.h:
|
---|
| 4 | * header file for nls.c. See notes there.
|
---|
| 5 | *
|
---|
| 6 | * Note: Version numbering in this file relates to XWorkplace version
|
---|
| 7 | * numbering.
|
---|
| 8 | *
|
---|
| 9 | *@@include #define INCL_DOSDATETIME
|
---|
| 10 | *@@include #include <os2.h>
|
---|
[113] | 11 | *@@include #include "helpers\nls.h"
|
---|
[109] | 12 | */
|
---|
| 13 |
|
---|
| 14 | /*
|
---|
[390] | 15 | * Copyright (C) 1997-2011 Ulrich Mller.
|
---|
[109] | 16 | * This file is part of the "XWorkplace helpers" source package.
|
---|
| 17 | * This is free software; you can redistribute it and/or modify
|
---|
| 18 | * it under the terms of the GNU General Public License as published
|
---|
| 19 | * by the Free Software Foundation, in version 2 as it comes in the
|
---|
| 20 | * "COPYING" file of the XWorkplace main distribution.
|
---|
| 21 | * This program is distributed in the hope that it will be useful,
|
---|
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 24 | * GNU General Public License for more details.
|
---|
| 25 | */
|
---|
| 26 |
|
---|
| 27 | #if __cplusplus
|
---|
| 28 | extern "C" {
|
---|
| 29 | #endif
|
---|
| 30 |
|
---|
| 31 | #ifndef NLS_HEADER_INCLUDED
|
---|
| 32 | #define NLS_HEADER_INCLUDED
|
---|
| 33 |
|
---|
[174] | 34 | #include "helpers\simples.h"
|
---|
| 35 | // V0.9.19 (2002-06-13) [umoeller]
|
---|
[109] | 36 |
|
---|
[174] | 37 | /* ******************************************************************
|
---|
| 38 | *
|
---|
| 39 | * DBCS support
|
---|
| 40 | *
|
---|
| 41 | ********************************************************************/
|
---|
[109] | 42 |
|
---|
[174] | 43 | #define TYPE_SBCS 0x0000
|
---|
| 44 | #define TYPE_DBCS_1ST 0x0001
|
---|
| 45 | #define TYPE_DBCS_2ND 0x0002
|
---|
[109] | 46 |
|
---|
[249] | 47 | ULONG XWPENTRY nlsQueryCodepage(VOID);
|
---|
| 48 |
|
---|
[174] | 49 | BOOL XWPENTRY nlsDBCS(VOID);
|
---|
[109] | 50 |
|
---|
[174] | 51 | ULONG XWPENTRY nlsQueryDBCSChar(PCSZ pcszString,
|
---|
| 52 | ULONG ulOfs);
|
---|
[109] | 53 |
|
---|
[174] | 54 | PSZ XWPENTRY nlschr(PCSZ p, char c);
|
---|
[109] | 55 |
|
---|
[174] | 56 | PSZ XWPENTRY nlsrchr(PCSZ p, char c);
|
---|
[109] | 57 |
|
---|
[174] | 58 | /* ******************************************************************
|
---|
| 59 | *
|
---|
| 60 | * Country-dependent formatting
|
---|
| 61 | *
|
---|
| 62 | ********************************************************************/
|
---|
[109] | 63 |
|
---|
[174] | 64 | #ifdef OS2_INCLUDED
|
---|
[109] | 65 |
|
---|
[174] | 66 | /*
|
---|
| 67 | *@@ COUNTRYSETTINGS:
|
---|
| 68 | * structure used for returning country settings
|
---|
| 69 | * with nlsQueryCountrySettings.
|
---|
| 70 | */
|
---|
[115] | 71 |
|
---|
[174] | 72 | typedef struct _COUNTRYSETTINGS
|
---|
| 73 | {
|
---|
| 74 | ULONG ulDateFormat,
|
---|
| 75 | // date format:
|
---|
| 76 | // -- 0 mm.dd.yyyy (English)
|
---|
| 77 | // -- 1 dd.mm.yyyy (e.g. German)
|
---|
| 78 | // -- 2 yyyy.mm.dd (Japanese)
|
---|
| 79 | // -- 3 yyyy.dd.mm
|
---|
| 80 | ulTimeFormat;
|
---|
| 81 | // time format:
|
---|
| 82 | // -- 0 12-hour clock
|
---|
| 83 | // -- >0 24-hour clock
|
---|
| 84 | CHAR cDateSep,
|
---|
| 85 | // date separator (e.g. '/')
|
---|
| 86 | cTimeSep,
|
---|
| 87 | // time separator (e.g. ':')
|
---|
| 88 | cDecimal,
|
---|
| 89 | // decimal separator (e.g. '.')
|
---|
| 90 | cThousands;
|
---|
| 91 | // thousands separator (e.g. ',')
|
---|
| 92 | } COUNTRYSETTINGS, *PCOUNTRYSETTINGS;
|
---|
[147] | 93 |
|
---|
[242] | 94 | /*
|
---|
| 95 | *@@ COUNTRYAMPM:
|
---|
| 96 | *
|
---|
| 97 | *@@added V1.0.1 (2003-01-17) [umoeller]
|
---|
| 98 | */
|
---|
[147] | 99 |
|
---|
[242] | 100 | typedef struct _COUNTRYAMPM
|
---|
| 101 | {
|
---|
| 102 | CHAR sz2359[10],
|
---|
| 103 | sz1159[10];
|
---|
| 104 | } COUNTRYAMPM, *PCOUNTRYAMPM;
|
---|
| 105 |
|
---|
| 106 | /*
|
---|
| 107 | *@@ COUNTRYSETTINGS:
|
---|
| 108 | * second structure to finally get the AM/PM
|
---|
| 109 | * stuff right too. I suspect people have used
|
---|
| 110 | * this structure in XCenter DLLs and such so
|
---|
| 111 | * I cannot easily change it... hence a second
|
---|
| 112 | * one.
|
---|
| 113 | *
|
---|
| 114 | *@@changed V1.0.1 (2003-01-17) [umoeller]
|
---|
| 115 | */
|
---|
| 116 |
|
---|
| 117 | typedef struct _COUNTRYSETTINGS2
|
---|
| 118 | {
|
---|
| 119 | COUNTRYSETTINGS cs;
|
---|
| 120 | COUNTRYAMPM ampm;
|
---|
| 121 | } COUNTRYSETTINGS2, *PCOUNTRYSETTINGS2;
|
---|
| 122 |
|
---|
| 123 | VOID XWPENTRY nlsQueryCountrySettings(PCOUNTRYSETTINGS2 pcs);
|
---|
| 124 |
|
---|
[174] | 125 | PSZ XWPENTRY nlsThousandsULong(PSZ pszTarget, ULONG ul, CHAR cThousands);
|
---|
| 126 | typedef PSZ XWPENTRY NLSTHOUSANDSULONG(PSZ pszTarget, ULONG ul, CHAR cThousands);
|
---|
| 127 | typedef NLSTHOUSANDSULONG *PNLSTHOUSANDSULONG;
|
---|
[147] | 128 |
|
---|
[390] | 129 | PSZ XWPENTRY nlsThousandsLong(PSZ pszTarget, LONG l, CHAR cThousands);
|
---|
| 130 |
|
---|
[174] | 131 | PSZ XWPENTRY nlsThousandsDouble(PSZ pszTarget, double dbl, CHAR cThousands);
|
---|
[147] | 132 |
|
---|
[174] | 133 | PSZ XWPENTRY nlsVariableDouble(PSZ pszTarget,
|
---|
| 134 | double dbl,
|
---|
[184] | 135 | PCSZ pszUnits,
|
---|
[174] | 136 | CHAR cThousands);
|
---|
[147] | 137 |
|
---|
[242] | 138 | VOID XWPENTRY nlsDate(const COUNTRYSETTINGS2 *pcs2,
|
---|
| 139 | PSZ pszDate,
|
---|
| 140 | USHORT year,
|
---|
| 141 | BYTE month,
|
---|
| 142 | BYTE day);
|
---|
| 143 |
|
---|
| 144 | VOID XWPENTRY nlsTime(const COUNTRYSETTINGS2 *pcs,
|
---|
| 145 | PSZ pszTime,
|
---|
| 146 | BYTE hours,
|
---|
| 147 | BYTE minutes,
|
---|
| 148 | BYTE seconds);
|
---|
| 149 |
|
---|
[174] | 150 | VOID XWPENTRY nlsFileDate(PSZ pszBuf,
|
---|
[242] | 151 | const FDATE *pfDate,
|
---|
| 152 | const COUNTRYSETTINGS2 *pcs);
|
---|
[174] | 153 |
|
---|
| 154 | VOID XWPENTRY nlsFileTime(PSZ pszBuf,
|
---|
[242] | 155 | const FTIME *pfTime,
|
---|
| 156 | const COUNTRYSETTINGS2 *pcs);
|
---|
[174] | 157 |
|
---|
| 158 | VOID XWPENTRY nlsDateTime(PSZ pszDate,
|
---|
| 159 | PSZ pszTime,
|
---|
[242] | 160 | const DATETIME *pDateTime,
|
---|
[174] | 161 | ULONG ulDateFormat,
|
---|
| 162 | CHAR cDateSep,
|
---|
| 163 | ULONG ulTimeFormat,
|
---|
| 164 | CHAR cTimeSep);
|
---|
| 165 | typedef VOID XWPENTRY NLSDATETIME(PSZ pszDate,
|
---|
| 166 | PSZ pszTime,
|
---|
[242] | 167 | const DATETIME *pDateTime,
|
---|
[174] | 168 | ULONG ulDateFormat,
|
---|
| 169 | CHAR cDateSep,
|
---|
| 170 | ULONG ulTimeFormat,
|
---|
| 171 | CHAR cTimeSep);
|
---|
| 172 | typedef NLSDATETIME *PNLSDATETIME;
|
---|
| 173 |
|
---|
[242] | 174 | VOID XWPENTRY nlsDateTime2(PSZ pszDate,
|
---|
| 175 | PSZ pszTime,
|
---|
| 176 | const DATETIME *pDateTime,
|
---|
| 177 | const COUNTRYSETTINGS2 *pcs2);
|
---|
| 178 | typedef VOID XWPENTRY NLSDATETIME2(PSZ pszDate,
|
---|
| 179 | PSZ pszTime,
|
---|
| 180 | const DATETIME *pDateTime,
|
---|
| 181 | const COUNTRYSETTINGS2 *pcs2);
|
---|
| 182 | typedef NLSDATETIME2 *PNLSDATETIME2;
|
---|
[174] | 183 |
|
---|
| 184 | #endif
|
---|
| 185 |
|
---|
[242] | 186 | ULONG nlsUpper(PSZ psz);
|
---|
| 187 |
|
---|
[109] | 188 | #endif
|
---|
| 189 |
|
---|
| 190 | #if __cplusplus
|
---|
| 191 | }
|
---|
| 192 | #endif
|
---|
| 193 |
|
---|