source: trunk/include/winos2def.h@ 175

Last change on this file since 175 was 175, checked in by sandervl, 26 years ago

Added wrappers for OS/2 apis and added DosQueryCtryInfo

File size: 2.4 KB
RevLine 
[175]1/* $Id: winos2def.h,v 1.5 1999-06-24 08:46:35 sandervl Exp $ */
[4]2
3/*
4 *
5 * OS/2 declarations when including os2win.h
6 *
7 * Project Odin Software License can be found in LICENSE.TXT
8 *
9 */
10
11#ifndef __WINOS2DEF_H__
12#define __WINOS2DEF_H__
13
[17]14#define APIENTRY_OS2 _System
[4]15
[17]16/*
17typedef unsigned long HMODULE;
[4]18typedef unsigned long HINSTANCE;
[17]19//typedef unsigned long ULONG;
20typedef char * PSZ;
21typedef ULONG MPARAM;
22typedef ULONG APIRET;
23*/
[4]24
[17]25#ifndef MPARAM
26# define MPARAM void*
27#endif
28
29#ifndef APIRET
30# define APIRET ULONG
31#endif
32
[18]33#ifndef PSZ
34# define PSZ char *
35#endif
[17]36
[18]37
[4]38extern "C" {
39 BOOL APIENTRY_OS2 WinPostMsg(HWND hwnd,
40 ULONG msg,
41 MPARAM mp1,
42 MPARAM mp2);
43
44 APIRET APIENTRY_OS2 DosSleep(ULONG msec);
45
46}
47
[175]48inline BOOL _WinPostMsg(HWND a, ULONG b, MPARAM c, MPARAM d)
49{
50 BOOL yyrc;
51 USHORT sel = GetFS();
52
53 yyrc = WinPostMsg(a, b, c, d);
54 SetFS(sel);
55
56 return yyrc;
57}
58
59#undef WinPostMsg
60#define WinPostMsg _WinPostMsg
61
62inline ULONG _DosSleep(ULONG a)
63{
64 ULONG yyrc;
65 USHORT sel = GetFS();
66
67 yyrc = DosSleep(a);
68 SetFS(sel);
69
70 return yyrc;
71}
72
73#undef DosSleep
74#define DosSleep _DosSleep
75
76
77 typedef struct _COUNTRYCODE /* ctryc */
78 {
79 ULONG country;
80 ULONG codepage;
81 } COUNTRYCODE;
82 typedef COUNTRYCODE *PCOUNTRYCODE;
83
84 typedef struct _COUNTRYINFO /* ctryi */
85 {
86 ULONG country;
87 ULONG codepage;
88 ULONG fsDateFmt;
89 CHAR szCurrency[5];
90 CHAR szThousandsSeparator[2];
91 CHAR szDecimal[2];
92 CHAR szDateSeparator[2];
93 CHAR szTimeSeparator[2];
94 UCHAR fsCurrencyFmt;
95 UCHAR cDecimalPlace;
96 UCHAR fsTimeFmt;
97 USHORT abReserved1[2];
98 CHAR szDataSeparator[2];
99 USHORT abReserved2[5];
100 } COUNTRYINFO, *PCOUNTRYINFO;
101
102extern "C" {
103 APIRET APIENTRY_OS2 DosQueryCtryInfo(ULONG cb,
104 PCOUNTRYCODE pcc,
105 PCOUNTRYINFO pci,
106 PULONG pcbActual);
107}
108
109inline ULONG _DosQueryCtryInfo(ULONG a, PCOUNTRYCODE b, PCOUNTRYINFO c, PULONG d)
110{
111 ULONG yyrc;
112 USHORT sel = GetFS();
113
114 yyrc = DosQueryCtryInfo(a, b, c, d);
115 SetFS(sel);
116
117 return yyrc;
118}
119
120#undef DosQueryCtryInfo
121#define DosQueryCtryInfo _DosQueryCtryInfo
122
123
124
[17]125#endif //__WINOS2DEF_H__
Note: See TracBrowser for help on using the repository browser.