| 1 | /* $Id: winos2def.h,v 1.6 1999-06-26 18:24:23 sandervl Exp $ */
|
|---|
| 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 |
|
|---|
| 14 | #define APIENTRY_OS2 _System
|
|---|
| 15 |
|
|---|
| 16 | /*
|
|---|
| 17 | typedef unsigned long HMODULE;
|
|---|
| 18 | typedef unsigned long HINSTANCE;
|
|---|
| 19 | //typedef unsigned long ULONG;
|
|---|
| 20 | typedef char * PSZ;
|
|---|
| 21 | typedef ULONG MPARAM;
|
|---|
| 22 | typedef ULONG APIRET;
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | #ifndef MPARAM
|
|---|
| 26 | # define MPARAM void*
|
|---|
| 27 | #endif
|
|---|
| 28 |
|
|---|
| 29 | #ifndef APIRET
|
|---|
| 30 | # define APIRET ULONG
|
|---|
| 31 | #endif
|
|---|
| 32 |
|
|---|
| 33 | typedef char *PSZ;
|
|---|
| 34 | typedef const char *PCSZ;
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 | extern "C" {
|
|---|
| 38 | BOOL APIENTRY_OS2 WinPostMsg(HWND hwnd,
|
|---|
| 39 | ULONG msg,
|
|---|
| 40 | MPARAM mp1,
|
|---|
| 41 | MPARAM mp2);
|
|---|
| 42 |
|
|---|
| 43 | APIRET APIENTRY_OS2 DosSleep(ULONG msec);
|
|---|
| 44 |
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | inline BOOL _WinPostMsg(HWND a, ULONG b, MPARAM c, MPARAM d)
|
|---|
| 48 | {
|
|---|
| 49 | BOOL yyrc;
|
|---|
| 50 | USHORT sel = RestoreOS2FS();
|
|---|
| 51 |
|
|---|
| 52 | yyrc = WinPostMsg(a, b, c, d);
|
|---|
| 53 | SetFS(sel);
|
|---|
| 54 |
|
|---|
| 55 | return yyrc;
|
|---|
| 56 | }
|
|---|
| 57 |
|
|---|
| 58 | #undef WinPostMsg
|
|---|
| 59 | #define WinPostMsg _WinPostMsg
|
|---|
| 60 |
|
|---|
| 61 | inline ULONG _DosSleep(ULONG a)
|
|---|
| 62 | {
|
|---|
| 63 | ULONG yyrc;
|
|---|
| 64 | USHORT sel = RestoreOS2FS();
|
|---|
| 65 |
|
|---|
| 66 | yyrc = DosSleep(a);
|
|---|
| 67 | SetFS(sel);
|
|---|
| 68 |
|
|---|
| 69 | return yyrc;
|
|---|
| 70 | }
|
|---|
| 71 |
|
|---|
| 72 | #undef DosSleep
|
|---|
| 73 | #define DosSleep _DosSleep
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 | typedef struct _COUNTRYCODE /* ctryc */
|
|---|
| 77 | {
|
|---|
| 78 | ULONG country;
|
|---|
| 79 | ULONG codepage;
|
|---|
| 80 | } COUNTRYCODE;
|
|---|
| 81 | typedef COUNTRYCODE *PCOUNTRYCODE;
|
|---|
| 82 |
|
|---|
| 83 | typedef struct _COUNTRYINFO /* ctryi */
|
|---|
| 84 | {
|
|---|
| 85 | ULONG country;
|
|---|
| 86 | ULONG codepage;
|
|---|
| 87 | ULONG fsDateFmt;
|
|---|
| 88 | CHAR szCurrency[5];
|
|---|
| 89 | CHAR szThousandsSeparator[2];
|
|---|
| 90 | CHAR szDecimal[2];
|
|---|
| 91 | CHAR szDateSeparator[2];
|
|---|
| 92 | CHAR szTimeSeparator[2];
|
|---|
| 93 | UCHAR fsCurrencyFmt;
|
|---|
| 94 | UCHAR cDecimalPlace;
|
|---|
| 95 | UCHAR fsTimeFmt;
|
|---|
| 96 | USHORT abReserved1[2];
|
|---|
| 97 | CHAR szDataSeparator[2];
|
|---|
| 98 | USHORT abReserved2[5];
|
|---|
| 99 | } COUNTRYINFO, *PCOUNTRYINFO;
|
|---|
| 100 |
|
|---|
| 101 | extern "C" {
|
|---|
| 102 | APIRET APIENTRY_OS2 DosQueryCtryInfo(ULONG cb,
|
|---|
| 103 | PCOUNTRYCODE pcc,
|
|---|
| 104 | PCOUNTRYINFO pci,
|
|---|
| 105 | PULONG pcbActual);
|
|---|
| 106 | }
|
|---|
| 107 |
|
|---|
| 108 | inline ULONG _DosQueryCtryInfo(ULONG a, PCOUNTRYCODE b, PCOUNTRYINFO c, PULONG d)
|
|---|
| 109 | {
|
|---|
| 110 | ULONG yyrc;
|
|---|
| 111 | USHORT sel = RestoreOS2FS();
|
|---|
| 112 |
|
|---|
| 113 | yyrc = DosQueryCtryInfo(a, b, c, d);
|
|---|
| 114 | SetFS(sel);
|
|---|
| 115 |
|
|---|
| 116 | return yyrc;
|
|---|
| 117 | }
|
|---|
| 118 |
|
|---|
| 119 | #undef DosQueryCtryInfo
|
|---|
| 120 | #define DosQueryCtryInfo _DosQueryCtryInfo
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 | #endif //__WINOS2DEF_H__
|
|---|