| [223] | 1 | /* $Id: winos2def.h,v 1.6 1999-06-26 18:24:23 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 | /* | 
|---|
|  | 17 | typedef unsigned long   HMODULE; | 
|---|
| [4] | 18 | typedef unsigned long   HINSTANCE; | 
|---|
| [17] | 19 | //typedef unsigned long         ULONG; | 
|---|
|  | 20 | typedef char *          PSZ; | 
|---|
|  | 21 | typedef ULONG           MPARAM; | 
|---|
|  | 22 | typedef 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] | 38 | extern "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] | 48 | inline BOOL _WinPostMsg(HWND a, ULONG b, MPARAM c, MPARAM d) | 
|---|
|  | 49 | { | 
|---|
|  | 50 | BOOL yyrc; | 
|---|
| [223] | 51 | USHORT sel = RestoreOS2FS(); | 
|---|
| [175] | 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 |  | 
|---|
|  | 62 | inline ULONG _DosSleep(ULONG a) | 
|---|
|  | 63 | { | 
|---|
|  | 64 | ULONG yyrc; | 
|---|
| [223] | 65 | USHORT sel = RestoreOS2FS(); | 
|---|
| [175] | 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 |  | 
|---|
|  | 102 | extern "C" { | 
|---|
|  | 103 | APIRET APIENTRY_OS2  DosQueryCtryInfo(ULONG cb, | 
|---|
|  | 104 | PCOUNTRYCODE pcc, | 
|---|
|  | 105 | PCOUNTRYINFO pci, | 
|---|
|  | 106 | PULONG pcbActual); | 
|---|
|  | 107 | } | 
|---|
|  | 108 |  | 
|---|
|  | 109 | inline ULONG _DosQueryCtryInfo(ULONG a, PCOUNTRYCODE b, PCOUNTRYINFO c, PULONG d) | 
|---|
|  | 110 | { | 
|---|
|  | 111 | ULONG yyrc; | 
|---|
| [223] | 112 | USHORT sel = RestoreOS2FS(); | 
|---|
| [175] | 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__ | 
|---|