source: trunk/include/helpers/nls.h@ 242

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

First attempt at new container contol.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 6.7 KB
Line 
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>
11 *@@include #include "helpers\nls.h"
12 */
13
14/*
15 * Copyright (C) 1997-2001 Ulrich M”ller.
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
28extern "C" {
29#endif
30
31#ifndef NLS_HEADER_INCLUDED
32 #define NLS_HEADER_INCLUDED
33
34 #include "helpers\simples.h"
35 // V0.9.19 (2002-06-13) [umoeller]
36
37 /* ******************************************************************
38 *
39 * DBCS support
40 *
41 ********************************************************************/
42
43 #define TYPE_SBCS 0x0000
44 #define TYPE_DBCS_1ST 0x0001
45 #define TYPE_DBCS_2ND 0x0002
46
47 BOOL XWPENTRY nlsDBCS(VOID);
48
49 ULONG XWPENTRY nlsQueryDBCSChar(PCSZ pcszString,
50 ULONG ulOfs);
51
52 PSZ XWPENTRY nlschr(PCSZ p, char c);
53
54 PSZ XWPENTRY nlsrchr(PCSZ p, char c);
55
56 /* ******************************************************************
57 *
58 * Country-dependent formatting
59 *
60 ********************************************************************/
61
62 #ifdef OS2_INCLUDED
63
64 /*
65 *@@ COUNTRYSETTINGS:
66 * structure used for returning country settings
67 * with nlsQueryCountrySettings.
68 */
69
70 typedef struct _COUNTRYSETTINGS
71 {
72 ULONG ulDateFormat,
73 // date format:
74 // -- 0 mm.dd.yyyy (English)
75 // -- 1 dd.mm.yyyy (e.g. German)
76 // -- 2 yyyy.mm.dd (Japanese)
77 // -- 3 yyyy.dd.mm
78 ulTimeFormat;
79 // time format:
80 // -- 0 12-hour clock
81 // -- >0 24-hour clock
82 CHAR cDateSep,
83 // date separator (e.g. '/')
84 cTimeSep,
85 // time separator (e.g. ':')
86 cDecimal,
87 // decimal separator (e.g. '.')
88 cThousands;
89 // thousands separator (e.g. ',')
90 } COUNTRYSETTINGS, *PCOUNTRYSETTINGS;
91
92 /*
93 *@@ COUNTRYAMPM:
94 *
95 *@@added V1.0.1 (2003-01-17) [umoeller]
96 */
97
98 typedef struct _COUNTRYAMPM
99 {
100 CHAR sz2359[10],
101 sz1159[10];
102 } COUNTRYAMPM, *PCOUNTRYAMPM;
103
104 /*
105 *@@ COUNTRYSETTINGS:
106 * second structure to finally get the AM/PM
107 * stuff right too. I suspect people have used
108 * this structure in XCenter DLLs and such so
109 * I cannot easily change it... hence a second
110 * one.
111 *
112 *@@changed V1.0.1 (2003-01-17) [umoeller]
113 */
114
115 typedef struct _COUNTRYSETTINGS2
116 {
117 COUNTRYSETTINGS cs;
118 COUNTRYAMPM ampm;
119 } COUNTRYSETTINGS2, *PCOUNTRYSETTINGS2;
120
121 VOID XWPENTRY nlsQueryCountrySettings(PCOUNTRYSETTINGS2 pcs);
122
123 PSZ XWPENTRY nlsThousandsULong(PSZ pszTarget, ULONG ul, CHAR cThousands);
124 typedef PSZ XWPENTRY NLSTHOUSANDSULONG(PSZ pszTarget, ULONG ul, CHAR cThousands);
125 typedef NLSTHOUSANDSULONG *PNLSTHOUSANDSULONG;
126
127 PSZ XWPENTRY nlsThousandsDouble(PSZ pszTarget, double dbl, CHAR cThousands);
128
129 PSZ XWPENTRY nlsVariableDouble(PSZ pszTarget,
130 double dbl,
131 PCSZ pszUnits,
132 CHAR cThousands);
133
134 VOID XWPENTRY nlsDate(const COUNTRYSETTINGS2 *pcs2,
135 PSZ pszDate,
136 USHORT year,
137 BYTE month,
138 BYTE day);
139
140 VOID XWPENTRY nlsTime(const COUNTRYSETTINGS2 *pcs,
141 PSZ pszTime,
142 BYTE hours,
143 BYTE minutes,
144 BYTE seconds);
145
146 VOID XWPENTRY nlsFileDate(PSZ pszBuf,
147 const FDATE *pfDate,
148 const COUNTRYSETTINGS2 *pcs);
149
150 VOID XWPENTRY nlsFileTime(PSZ pszBuf,
151 const FTIME *pfTime,
152 const COUNTRYSETTINGS2 *pcs);
153
154 VOID XWPENTRY nlsDateTime(PSZ pszDate,
155 PSZ pszTime,
156 const DATETIME *pDateTime,
157 ULONG ulDateFormat,
158 CHAR cDateSep,
159 ULONG ulTimeFormat,
160 CHAR cTimeSep);
161 typedef VOID XWPENTRY NLSDATETIME(PSZ pszDate,
162 PSZ pszTime,
163 const DATETIME *pDateTime,
164 ULONG ulDateFormat,
165 CHAR cDateSep,
166 ULONG ulTimeFormat,
167 CHAR cTimeSep);
168 typedef NLSDATETIME *PNLSDATETIME;
169
170 VOID XWPENTRY nlsDateTime2(PSZ pszDate,
171 PSZ pszTime,
172 const DATETIME *pDateTime,
173 const COUNTRYSETTINGS2 *pcs2);
174 typedef VOID XWPENTRY NLSDATETIME2(PSZ pszDate,
175 PSZ pszTime,
176 const DATETIME *pDateTime,
177 const COUNTRYSETTINGS2 *pcs2);
178 typedef NLSDATETIME2 *PNLSDATETIME2;
179
180 #endif
181
182 ULONG nlsUpper(PSZ psz);
183
184#endif
185
186#if __cplusplus
187}
188#endif
189
Note: See TracBrowser for help on using the repository browser.