home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 November / VPR9611B.ISO / vabasic / ntclnt.exe / DISK8 / data.8 / datab / INCLUDE / OS.H < prev    next >
C/C++ Source or Header  |  1996-07-29  |  21KB  |  759 lines

  1. /*--------------------------------------------------------------
  2. // $Source: /rcs/crcs/general/os.h,v $
  3. // Checked in by: $Author: clement $
  4. // $Date: 1996/07/22 13:39:36 $                $Revision: 1.70 $
  5. //--------------------------------------------------------------
  6. //         Copyright(c) 1992, Visual Edge Software Ltd.
  7. //         Copyright(c) 1994, International Business Machines Corp.
  8. //
  9. // ALL RIGHTS RESERVED. This notice is intended as a precaution
  10. // against inadvertent publication, and shall not be deemed to
  11. // consitute an acknowledgment that publication has occurred
  12. // nor to imply any waiver of confidentiality. The year included
  13. // in the notice is the year of the creation of the work.
  14. //--------------------------------------------------------------
  15. // DESCRIPTION:
  16. //            This file contains global definitions & includes
  17. //            specific of the Operating system.
  18. // NOTE: Includes are dependent on typedefs so must be last.
  19. //-------------------------------------------------------------*/
  20.  
  21. #ifndef OS_H
  22. #define OS_H
  23.  
  24. #include <stdio.h>
  25. #include <stdlib.h>
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. /*-----------------------------------------------*/
  32. /* Platform Independent Defines                  */
  33. /*-----------------------------------------------*/
  34. #define VE_MIN(x, y)    (((x) < (y)) ? (x) : (y))
  35. #define VE_MAX(x, y)    (((x) > (y)) ? (x) : (y))
  36.  
  37. #ifndef UXPROTO
  38. #ifdef _NO_PROTO
  39. #define UXPROTO(x) ()
  40. #else
  41. #define UXPROTO(x) x
  42. #endif
  43. #endif
  44.  
  45. int OsDirExist UXPROTO((const char *aDirName));
  46.  
  47. /* name of the etc dir. Currently only used by   */
  48. /* the Object Bridge.                            */
  49. #define ETCDIR        "etc"
  50.  
  51. /*-----------------------------------------------*/
  52. /* MSDOS Defines                                 */
  53. /*-----------------------------------------------*/
  54.  
  55. #ifdef MSDOS
  56. #include <io.h>
  57. #include <float.h>
  58. #define MAXFLOAT        FLT_MAX
  59. #define R_OK 04
  60. #define F_OK 00
  61. #define VMAXPATHLEN    _MAX_PATH
  62. #define VPutenv        _putenv
  63.  
  64. #define VSYS_WINDOWS
  65. #define VSYS_WIN16
  66. #define VSYS_WININTEL
  67.  
  68. #define VUSES_PLACEABLE    1
  69. #define VUSES_FRAMES    1
  70.  
  71. #if (defined(_WINDLL) || defined(_DLL)) && !defined(VSYS_DLL)
  72. #define VSYS_DLL
  73. #endif
  74.  
  75. #ifndef USE_OLE2
  76. #define USE_OLE2
  77. #endif
  78.  
  79. #ifdef __cplusplus
  80. #ifdef _MSC_VER
  81. #pragma warning (disable : 4250) /* multiple inheritance */
  82. #endif
  83. #endif /* cplusplus */
  84.  
  85. typedef void (__cdecl * VTSigFunc)(int);
  86. #define FILESEPSTRING   "\\"
  87. #define FILESEPCHAR     '\\'
  88. #define ALTFILESEPSTRING "/"
  89. #define ALTFILESEPCHAR  '/'
  90. #define FILEROOTCHAR    ':'
  91. #define FILEROOTSTRING  ":"
  92. #define FILEROOTDIRPOS  1
  93. #define FILEBADCHARS    ""
  94. #define NULLDEVICE      "nul"
  95. #define NEWLINE         "\r\n"
  96. #define VDYNLIBEXT      "dll"
  97. #define VCURRENTDIR      "."
  98. #define VHOMEDIR         "\\"
  99.  
  100. #define PATHSEPCHAR     ';'
  101. #define PATHSEPSTRING   ";"
  102. #define WILDCHARS       "?*"
  103.  
  104. #define WIDEFILESEPSTRING    L"\\"
  105. #define WIDEFILESEPCHAR      L'\\'
  106. #define WIDEALTFILESEPSTRING L"/"
  107. #define WIDEALTFILESEPCHAR   L'/'
  108. #define WIDEFILEROOTCHAR     L':'
  109. #define WIDEFILEROOTSTRING   L":"
  110. #define WIDEFILEBADCHARS     L""
  111. #define WIDENULLDEVICE       L"nul"
  112. #define WIDENEWLINE          L"\r\n"
  113. #define VWIDEDYNLIBEXT       L"dll"
  114. #define VWIDECURRENTDIR      L "."
  115.  
  116. #define WIDEPATHSEPCHAR      L';'
  117. #define WIDEPATHSEPSTRING    L";"
  118. #define WIDEWILDCHARS        L"?*"
  119.  
  120. #define INTPCALL
  121. #define EXPORT  __export
  122. #define VPASCAL  __pascal
  123. #define FUNCEXPORT      __pascal __export
  124. #define DATAEXPORT      __export
  125.  
  126. #define VOPERDECL               __export
  127. #define VOPERDEF                __export
  128. #define VMETHODDECL(x)          x __export
  129. #define VMETHODDEF(x)           x __export
  130. #define VFUNCPTR(x)             (__cdecl * x)
  131. #define VFUNCDECL(x)            x __cdecl __export
  132. #define VFUNCDEF(x)             x __cdecl __export
  133. #define VDATADECL(x)            extern x __export
  134. #define VDATADEF(x)             x __export
  135. #ifdef __cplusplus
  136. #define VCDATADECL(x)        extern "C" x __export
  137. #define VCFUNCDECL(x)        extern "C" VFUNCDECL(x)
  138. #else
  139. #define VCDATADECL(x)        VDATADECL(x)
  140. #define VCFUNCDECL(x)        VFUNCDECL(x)
  141. #endif
  142. #define VCALLBACKDECL(x)        x CALLBACK __export
  143. #define VCALLBACKDEF(x)         x CALLBACK __export
  144. #define VCALLBACKDATADECL(x)    x CALLBACK __export
  145. #define VCALLBACKDATADEF(x)     x CALLBACK __export
  146. #define VGLOBALOPERDECL(x)      x
  147. #define VGLOBALOPERDEF(x)       x
  148.  
  149. #define VVIRTUALDECL(x)         virtual VMETHODDECL(x)
  150. #define VVIRTUALDEF(x)          VMETHODDEF(x)
  151. #define VVIRTOPERDECL           virtual VOPERDECL
  152. #define VVIRTOPERDEF            VOPERDEF
  153.  
  154. #define VINLINEDECL(x)          x
  155. #define VINLINEDEF(x)           inline x
  156. #define VINLINEOPERDECL
  157. #define VINLINEOPERDEF          inline
  158. #define VSIGHDLRTYPE            void
  159. typedef void (*VSIGHDLRPTR)(int);
  160.  
  161. #if defined(_MSC_VER)
  162. #define VCLASS  class __far
  163. #elif defined(__TURBOC__)
  164. #define VCLASS  class __huge
  165. #else
  166. #define VCLASS  class
  167. #endif
  168.  
  169. #define VHUGE   _huge
  170.  
  171. #ifndef _SIZE_T_DEFINED
  172. typedef unsigned int size_t;
  173. #define _SIZE_T_DEFINED
  174. #endif
  175.  
  176. typedef int     OsWord;         /* native type for 16 bit signed word */
  177.  
  178. #if defined(_MSC_VER) && !defined(NOTEMPLATES)
  179. #       define NOTEMPLATES
  180. #endif
  181.  
  182. /*  not provided in MS runtime library */
  183.  
  184. VFUNCDECL(int) getopt(int argc, char *argv[], char *opts);
  185. VDATADECL(int) optind;
  186. VDATADECL(char*) optarg;
  187.  
  188. /* Define the items that are not defined
  189.  * for Windows DLLs
  190.  */
  191. #ifdef _WINDLL
  192.         #define stdin  (&_iob[0])
  193.         #define stdout (&_iob[1])
  194.         #define stderr (&_iob[2])
  195. #endif /* _WINDLL */
  196.  
  197. /* low level functions common
  198.  * to all operating systems
  199.  */
  200. int __cdecl EXPORT VosFprintf( FILE *, const char *, ...);
  201. void __cdecl EXPORT VosAbort(void);
  202. char * __cdecl EXPORT VosGets(char *);
  203. int __cdecl EXPORT VosCancelMessage( const char * );
  204. void __cdecl EXPORT VosExit( int );
  205. void __cdecl EXPORT VosTerminateLoop( void );
  206.  
  207. #endif /* MSDOS */
  208.  
  209. /*-----------------------------------------------*/
  210. /* NT (Win32) Defines                            */
  211. /*-----------------------------------------------*/
  212.  
  213. #ifdef _WIN32
  214. #include <io.h>
  215. #include <float.h>
  216.  
  217. #ifndef NT
  218. #define NT
  219. #endif
  220.  
  221. #define MAXFLOAT        FLT_MAX
  222. #define R_OK 04
  223. #define F_OK 00
  224. #define VMAXPATHLEN    _MAX_PATH
  225. #define VPutenv        _putenv
  226.  
  227. #define VSYS_WINDOWS
  228. #define VSYS_NT
  229. #define VSYS_WIN32
  230. #define VSYS_WININTEL
  231.  
  232. #define VUSES_PLACEABLE    1
  233. #define VUSES_FRAMES    1
  234.  
  235. #if !defined(VSYS_STATIC) && !defined(VSYS_DLL)
  236. #define VSYS_DLL
  237. #endif
  238.  
  239. #ifndef USE_OLE2
  240. #define USE_OLE2
  241. #endif
  242.  
  243. #define VUSE_ODBC
  244.  
  245. #ifdef __cplusplus
  246. #ifdef _MSC_VER
  247. #pragma warning (disable : 4250) /* multiple inheritance */
  248. #endif
  249. #endif /* cplusplus */
  250. #pragma warning(disable:4273)
  251.  
  252. typedef void (__cdecl * VTSigFunc)(int);
  253. #define FILESEPSTRING   "\\"
  254. #define FILESEPCHAR     '\\'
  255. #define ALTFILESEPSTRING "/"
  256. #define ALTFILESEPCHAR  '/'
  257. #define FILEROOTCHAR    ':'
  258. #define FILEROOTSTRING  ":"
  259. #define FILEROOTDIRPOS  1
  260. #define FILEBADCHARS    ""
  261. #define NULLDEVICE      "nul"
  262. #define NEWLINE         "\r\n"
  263. #define VDYNLIBEXT      "dll"
  264. #define VCURRENTDIR     "."
  265. #define VHOMEDIR        "\\"
  266.  
  267. #define PATHSEPCHAR     ';'
  268. #define PATHSEPSTRING   ";"
  269. #define WILDCHARS       "?*"
  270.  
  271. #define WIDEFILESEPSTRING    L"\\"
  272. #define WIDEFILESEPCHAR      L'\\'
  273. #define WIDEALTFILESEPSTRING L"/"
  274. #define WIDEALTFILESEPCHAR   L'/'
  275. #define WIDEFILEROOTCHAR     L':'
  276. #define WIDEFILEROOTSTRING   L":"
  277. #define WIDEFILEBADCHARS     L""
  278. #define WIDENULLDEVICE       L"nul"
  279. #define WIDENEWLINE          L"\r\n"
  280. #define VWIDEDYNLIBEXT       L"dll"
  281. #define VWIDECURRENTDIR      L"."
  282.  
  283. #define WIDEPATHSEPCHAR      L';'
  284. #define WIDEPATHSEPSTRING    L";"
  285. #define WIDEWILDCHARS        L"?*"
  286.  
  287. #define INTPCALL
  288. #define EXPORT
  289. #define VPASCAL
  290. #define FUNCEXPORT
  291. #define DATAEXPORT
  292.  
  293. #ifndef VSYS_STATIC
  294. #define VDLLIMPORT              __declspec(dllexport)
  295. #define VDLLEXPORT              __declspec(dllexport)
  296. #define VDLLDATAIMPORT          __declspec(dllimport)
  297. #define VDLLDATAEXPORT          __declspec(dllexport)
  298. #else
  299. #define VDLLIMPORT
  300. #define VDLLEXPORT
  301. #define VDLLDATAIMPORT
  302. #define VDLLDATAEXPORT
  303. #endif
  304.  
  305. #define VOPERDECL               VDLLIMPORT
  306. #define VOPERDEF                VDLLEXPORT
  307. #define VMETHODDECL(x)          VDLLIMPORT x
  308. #define VMETHODDEF(x)           VDLLEXPORT x
  309. #define VFUNCPTR(x)             (* x)
  310. #define VFUNCDECL(x)            VDLLIMPORT x __cdecl
  311. #define VFUNCDEF(x)             VDLLEXPORT x __cdecl
  312. #define VDATADECL(x)            extern VDLLDATAIMPORT x
  313. #define VDATADEF(x)             VDLLDATAEXPORT x
  314. #ifdef __cplusplus
  315. #define VCDATADECL(x)           extern "C" VDLLDATAIMPORT x
  316. #define VCFUNCDECL(x)        extern "C" VFUNCDECL(x)
  317. #else
  318. #define VCDATADECL(x)           VDATADECL(x)
  319. #define VCFUNCDECL(x)        VFUNCDECL(x)
  320. #endif
  321. #define VCALLBACKDECL(x)        VDLLIMPORT x CALLBACK
  322. #define VCALLBACKDEF(x)         VDLLEXPORT x CALLBACK
  323. #define VCALLBACKDATADECL(x)    VDLLIMPORT x
  324. #define VCALLBACKDATADEF(x)     VDLLEXPORT x
  325. #define VGLOBALOPERDECL(x)      x __cdecl
  326. #define VGLOBALOPERDEF(x)       x __cdecl
  327.  
  328. #define VVIRTUALDECL(x)         virtual VMETHODDECL(x)
  329. #define VVIRTUALDEF(x)          VMETHODDEF(x)
  330. #define VVIRTOPERDECL           virtual VOPERDECL
  331. #define VVIRTOPERDEF            VOPERDEF
  332.  
  333. #define VINLINEDECL(x)          x
  334. #define VINLINEDEF(x)           inline x
  335. #define VINLINEOPERDECL
  336. #define VINLINEOPERDEF          inline
  337. #define VSIGHDLRTYPE            void __cdecl
  338. typedef void (__cdecl *VSIGHDLRPTR)(int);
  339.  
  340. #define VCLASS  class
  341.  
  342. #define VHUGE
  343.  
  344. #ifndef _SIZE_T_DEFINED
  345. typedef unsigned int size_t;
  346. #define _SIZE_T_DEFINED
  347. #endif
  348.  
  349. typedef short int     OsWord;         /* native type for 16 bit signed word */
  350.  
  351. /*  not provided in MS runtime library */
  352. VFUNCDECL(int) getopt(int argc, char *argv[], char *opts);
  353. VDATADECL(int) optind;
  354. VDATADECL(char*) optarg;
  355.  
  356. /* Define the items that are not defined
  357.  * for Windows DLLs
  358.  */
  359. #ifdef _WINDLL
  360.         #define stdin  (&_iob[0])
  361.         #define stdout (&_iob[1])
  362.         #define stderr (&_iob[2])
  363. #endif /* _WINDLL */
  364.  
  365. /* low level functions common
  366.  * to all operating systems
  367.  */
  368. VFUNCDECL(int) VosFprintf( FILE *, const char *, ...);
  369. VFUNCDECL(void) VosAbort(void);
  370. VFUNCDECL(char *) VosGets(char *);
  371. VFUNCDECL(int) VosCancelMessage( const char * );
  372. VFUNCDECL(void) VosExit( int );
  373. VFUNCDECL(void) VosTerminateLoop( void );
  374.  
  375.  
  376. #endif /*  Win32  */
  377.  
  378. /*-----------------------------------------------*/
  379. /* UNIX Defines                                  */
  380. /*-----------------------------------------------*/
  381.  
  382. #if defined(unix) || defined(__unix) || defined(_AIX) || defined(UX_INTERPRETER) || defined(__unix__)
  383. #include <unistd.h>
  384. #include <pwd.h>
  385. #include <values.h>
  386.  
  387. #ifndef UNIX
  388. #define UNIX  /* to standardize the defines */
  389. #endif
  390.  
  391. #include <sys/param.h>
  392. #define VMAXPATHLEN    MAXPATHLEN
  393. #define VPutenv        putenv
  394.  
  395. #define VSYS_UNIX
  396. #define VSYS_X11
  397. #define VSYS_MOTIF
  398.  
  399. #define VUSES_PLACEABLE    0
  400. #define VUSES_FRAMES    0
  401.  
  402. #if defined(__GNUC__) && defined(__cplusplus)
  403. #define VSYS_ANSICPP
  404. #endif
  405.  
  406. #ifdef hpux
  407. #define VSYS_NO_SIGNED
  408. #define signed
  409. #endif
  410.  
  411. typedef void (* VTSigFunc) UXPROTO((int));
  412.  
  413. #define FILESEPSTRING   "/"
  414. #define FILESEPCHAR     '/'
  415. #define ALTFILESEPSTRING "\\"
  416. #define ALTFILESEPCHAR  '\\'
  417. #define FILEROOTCHAR    FILESEPCHAR
  418. #define FILEROOTSTRING  FILESEPSTRING
  419. #define FILEROOTDIRPOS  0
  420. #define FILEBADCHARS    "!@%^&*()=|\\`<>?\'\"[]{}; "
  421. #define NULLDEVICE      "/dev/null"
  422. #define NEWLINE         "\n"
  423. #define VCURRENTDIR      "."
  424. #define VHOMEDIR         getenv("HOME")
  425.  
  426. #if defined(_AIX)
  427. #define VDYNLIBEXT      "a"
  428. #elif defined(hp700v9)
  429. #define VDYNLIBEXT      "sl"
  430. #else
  431. #define VDYNLIBEXT      "so"
  432. #endif
  433.  
  434. #define PATHSEPCHAR     ':'
  435. #define PATHSEPSTRING   ":"
  436. #define WILDCHARS       "?*"
  437.  
  438. #if defined(hp700v9) || defined(__CLCC__)
  439. /* Special code to work around a compiler flaw on HP.
  440.  * See file <ob/wconst.hh> for detailed explanation.
  441.  * Also applies to the CenterLine compiler.
  442.  */
  443. extern wchar_t    kVwsWideFileSepString[];
  444. extern wchar_t    kVwsWideAltFileSepString[];
  445. extern wchar_t    kVwsWideFileBadChars[];
  446. extern wchar_t    kVwsWideNullDevice[];
  447. extern wchar_t    kVwsWideNewLine[];
  448. extern wchar_t    kVwsWideCurrentDir[];
  449. extern wchar_t    kVwsWideVDynLibExt[];
  450. extern wchar_t    kVwsWidePathSepString[];
  451. extern wchar_t    kVwsWideWildChars[];
  452. #define WIDEFILESEPSTRING    kVwsWideFileSepString
  453. #define WIDEFILESEPCHAR      ((wchar_t)'/')
  454. #define WIDEALTFILESEPSTRING kVwsWideAltFileSepString
  455. #define WIDEALTFILESEPCHAR   ((wchar_t)'\\')
  456. #define WIDEFILEROOTCHAR     WIDEFILESEPCHAR
  457. #define WIDEFILEROOTSTRING   WIDEFILESEPSTRING
  458. #define WIDEFILEBADCHARS     kVwsWideFileBadChars
  459. #define WIDENULLDEVICE       kVwsWideNullDevice
  460. #define WIDENEWLINE          kVwsWideNewLine
  461. #define VWIDECURRENTDIR      kVwsWideCurrentDir
  462. #define VWIDEDYNLIBEXT       kVwsWideVDynLibExt
  463. #define WIDEPATHSEPCHAR      ((wchar_t)':')
  464. #define WIDEPATHSEPSTRING    kVwsWidePathSepString
  465. #define WIDEWILDCHARS        kVwsWideWildChars
  466.  
  467. #else /* all unix platforms, except HP and CenterLine environment */
  468.  
  469. #define WIDEFILESEPSTRING    L"/"
  470. #define WIDEFILESEPCHAR      L'/'
  471. #define WIDEALTFILESEPSTRING L"\\"
  472. #define WIDEALTFILESEPCHAR   L'\\'
  473. #define WIDEFILEROOTCHAR     WIDEFILESEPCHAR
  474. #define WIDEFILEROOTSTRING   WIDEFILESEPSTRING
  475. #define WIDEFILEBADCHARS     L"!@%^&*()=|\\`<>?\'\"[]{}; "
  476. #define WIDENULLDEVICE       L"/dev/null"
  477. #define WIDENEWLINE          L"\n"
  478. #define VWIDECURRENTDIR      L"."
  479. #if defined(_AIX)
  480. #define VWIDEDYNLIBEXT       L"a"
  481. #else
  482. #define VWIDEDYNLIBEXT       L"so"
  483. #endif /* _AIX */
  484. #define WIDEPATHSEPCHAR      L':'
  485. #define WIDEPATHSEPSTRING    L":"
  486. #define WIDEWILDCHARS        L"?*"
  487. #endif /* hp700v9 || __CLCC__ */
  488.  
  489. #define INTPCALL
  490. #define EXPORT
  491. #define VPASCAL
  492. #define FUNCEXPORT
  493. #define DATAEXPORT
  494.  
  495. #define VOPERDECL
  496. #define VOPERDEF
  497. #define VMETHODDECL(x)          x
  498. #define VMETHODDEF(x)           x
  499. #define VFUNCDECL(x)            x
  500. #define VFUNCPTR(x)             (* x)
  501. #define VFUNCDEF(x)             x
  502. #define VDATADECL(x)            extern x
  503. #define VDATADEF(x)             x
  504. #ifdef __cplusplus
  505. #define VCDATADECL(x)           extern "C" x
  506. #define VCFUNCDECL(x)        extern "C" VFUNCDECL(x)
  507. #else
  508. #define VCDATADECL(x)           VDATADECL(x)
  509. #define VCFUNCDECL(x)        VFUNCDECL(x)
  510. #endif
  511. #define VCALLBACKDECL(x)        x
  512. #define VCALLBACKDEF(x)         x
  513. #define VCALLBACKDATADECL(x)    x
  514. #define VCALLBACKDATADEF(x)     x
  515. #define VGLOBALOPERDECL(x)      x
  516. #define VGLOBALOPERDEF(x)       x
  517.  
  518. #define VVIRTUALDECL(x)         virtual VMETHODDECL(x)
  519. #define VVIRTUALDEF(x)          VMETHODDEF(x)
  520. #define VVIRTOPERDECL           virtual VOPERDECL
  521. #define VVIRTOPERDEF            VOPERDEF
  522.  
  523. #define VINLINEDECL(x)          x
  524. #define VINLINEDEF(x)           inline x
  525. #define VINLINEOPERDECL
  526. #define VINLINEOPERDEF          inline
  527. #define VSIGHDLRTYPE            void
  528. typedef void (*VSIGHDLRPTR) UXPROTO((int));
  529.  
  530. #define VCLASS          class
  531.  
  532. #define VHUGE
  533.  
  534. typedef short OsWord;           /* native type for 16 bit signed word */
  535.  
  536. /* low level functions common
  537.  * to all operating systems
  538.  */
  539. int VosCancelMessage UXPROTO((const char *));
  540. void VosTerminateLoop UXPROTO((void));
  541.  
  542. #define VosFprintf       fprintf
  543. #define VosAbort         abort
  544. #define VosGets          gets
  545. #define VosExit          exit
  546.  
  547. #endif /* unix */
  548.  
  549. /*-----------------------------------------------*/
  550. /* OS2 Defines                                   */
  551. /*-----------------------------------------------*/
  552.  
  553. #ifdef _OS2
  554. #include <io.h>
  555. #include <float.h>
  556. #define MAXFLOAT        FLT_MAX
  557. #define R_OK 04
  558. #define F_OK 00
  559. #define VMAXPATHLEN    _MAX_PATH
  560. #define VPutenv        _putenv
  561. #include <signal.h>
  562. typedef _SigFunc VTSigFunc;
  563.  
  564. #define VSYS_OS2
  565. #define VSYS_WININTEL
  566.  
  567. #define VUSES_PLACEABLE    1
  568. #define VUSES_FRAMES    1
  569.  
  570. #if (defined(OS2DLL) || defined(_DLL)) && !defined(VSYS_DLL)
  571. #define VSYS_DLL
  572. #endif
  573.  
  574. #define FILESEPSTRING   "\\"
  575. #define FILESEPCHAR     '\\'
  576. #define ALTFILESEPSTRING "/"
  577. #define ALTFILESEPCHAR  '/'
  578. #define FILEROOTCHAR    ':'
  579. #define FILEROOTSTRING  ":"
  580. #define FILEROOTDIRPOS  1
  581. #define FILEBADCHARS    ""
  582. #define NULLDEVICE      "nul"
  583. #define NEWLINE         "\r\n"
  584. #define VDYNLIBEXT      "dll"
  585. #define VCURRENTDIR      "."
  586. #define VHOMEDIR         "\\"
  587.  
  588. #define PATHSEPCHAR     ';'
  589. #define PATHSEPSTRING   ";"
  590. #define WILDCHARS       "?*"
  591.  
  592. #define WIDEFILESEPSTRING    L"\\"
  593. #define WIDEFILESEPCHAR      L'\\'
  594. #define WIDEALTFILESEPSTRING L"/"
  595. #define WIDEALTFILESEPCHAR   L'/'
  596. #define WIDEFILEROOTCHAR     L':'
  597. #define WIDEFILEROOTSTRING   L":"
  598. #define WIDEFILEBADCHARS     L""
  599. #define WIDENULLDEVICE       L"nul"
  600. #define WIDENEWLINE          L"\r\n"
  601. #define VWIDEDYNLIBEXT       L"dll"
  602. #define VWIDECURRENTDIR      L"."
  603.  
  604. #define WIDEPATHSEPCHAR      L';'
  605. #define WIDEPATHSEPSTRING    L";"
  606. #define WIDEWILDCHARS        L"?*"
  607.  
  608. #define INTPCALL
  609. #ifdef OS2DLL
  610. #define EXPORT _Export
  611. #else
  612. #define EXPORT
  613. #endif
  614. #define VPASCAL
  615. #define FUNCEXPORT   EXPORT
  616. #define DATAEXPORT   EXPORT
  617.  
  618. #define VOPERDECL
  619. #define VOPERDEF               EXPORT
  620. #define VMETHODDECL(x)          x
  621. #define VMETHODDEF(x)           x EXPORT
  622. #define VFUNCPTR(x)             (* x)
  623. #define VFUNCDECL(x)            x
  624. #define VFUNCDEF(x)             x EXPORT
  625. #define VDATADECL(x)            extern x
  626. #define VDATADEF(x)             x EXPORT
  627. #ifdef __cplusplus
  628. #define VCDATADECL(x)           extern "C" x
  629. #define VCFUNCDECL(x)        extern "C" VFUNCDECL(x)
  630. #else
  631. #define VCDATADECL(x)           VDATADECL(x)
  632. #define VCFUNCDECL(x)        VFUNCDECL(x)
  633. #endif
  634. #define VCALLBACKDECL(x)        x
  635. #define VCALLBACKDEF(x)         x EXPORT
  636. #define VCALLBACKDATADECL(x)    x
  637. #define VCALLBACKDATADEF(x)     x EXPORT
  638. #define VGLOBALOPERDECL(x)      x
  639. #define VGLOBALOPERDEF(x)       x
  640.  
  641. #define VVIRTUALDECL(x)         virtual VMETHODDECL(x)
  642. #define VVIRTUALDEF(x)          VMETHODDEF(x)
  643. #define VVIRTOPERDECL           virtual VOPERDECL
  644. #define VVIRTOPERDEF            VOPERDEF
  645.  
  646. #define VINLINEDECL(x)          x
  647. #define VINLINEDEF(x)           inline x
  648. #define VINLINEOPERDECL
  649. #define VINLINEOPERDEF          inline
  650. #define VSIGHDLRTYPE            void
  651. typedef void (*VSIGHDLRPTR)(int);
  652.  
  653. #define VCLASS          class
  654.  
  655. #define VHUGE
  656.  
  657. typedef short OsWord;           /* native type for 16 bit signed word */
  658.  
  659.  
  660. /*  not provided in OS runtime library */
  661.  
  662. VFUNCDECL(int) getopt(int argc, char *argv[], char *opts);
  663. VDATADECL(int) optind;
  664. VDATADECL(char*) optarg;
  665.  
  666. /* low level functions common
  667.  * to all operating systems
  668.  */
  669. int VosCancelMessage( const char * );
  670.  
  671. #define VosAbort         abort
  672. #define VosExit          exit
  673. VFUNCDECL(void) VosTerminateLoop( void );
  674.  
  675. VFUNCDECL(int)  VosFprintf( FILE *, const char *, ...);
  676. VFUNCDECL(char *) VosGets(char *);
  677. VFUNCDECL(int)  VosCancelMessage( const char * );
  678.  
  679. #endif /* os2 */
  680.  
  681.  
  682. /***
  683.  *** The following definitions are not platforms
  684.  *** dependant.  They shall not be needed, but a
  685.  *** compiler flaw on the HP platform forces us
  686.  *** to define them.  The HP compiler does not
  687.  *** implement the wide characters constant declaration
  688.  *** syntax (ref. ANSI X3.159-1989 3.1.3.4 and 3.1.4).
  689.  *** Until that compiler gets fixed, the following
  690.  *** definitions are required by applications that
  691.  *** use wide character constants.
  692.  *** Also applies to the CenterLine compiler.
  693.  ***/
  694. #if defined(hp700v9) || defined(__CLCC__)
  695. #define    WIDECOLON        ((wchar_t)':')
  696. #define    WIDEDOT            ((wchar_t)'.')
  697. #define WIDENUL            ((wchar_t)'\0')
  698. #else /* !hp700v9 && !__CLCC__ */
  699. #define    WIDECOLON        (L':')
  700. #define    WIDEDOT            (L'.')
  701. #define WIDENUL            (L'\0')
  702. #endif /* hp700v9 || __CLCC__ */
  703.  
  704. /***
  705.  *** For Intel platforms, the printf functions family does not
  706.  *** support parameters reordering, i.e. does not let you do the
  707.  *** following:
  708.  ***    printf("%2$s likes %1$s\n", "ice cream", "Fred");
  709.  ***
  710.  ***    output -->  Fred likes ice cream
  711.  ***
  712.  *** Once the platforms support it, the following declarations and macros
  713.  *** can be removed with "crcs/general/xpg_prnt.cc" and
  714.  *** "crcs/general/xpg_prnt.h" altogether.
  715.  *** see fix11102
  716.  ***/
  717. #if defined(VSYS_WININTEL)
  718.  
  719. #if defined(VSYS_OS2)
  720. #include <stdarg.h>
  721. #endif
  722.  
  723. VFUNCDECL(int) VePrintf(const char *format, ...);
  724. VFUNCDECL(int) VeFprintf(FILE *file, const char *format, ...);
  725. VFUNCDECL(int) VeSprintf(char *outp, const char *format, ...);
  726.  
  727. VFUNCDECL(int) VeVprintf(const char *format, va_list argptr);
  728. VFUNCDECL(int) VeVfprintf(FILE *file, const char *format, va_list argptr);
  729. VFUNCDECL(int) VeVsprintf(char *outp, const char *format, va_list argptr);
  730.  
  731. #define printf        VePrintf
  732. #define fprintf        VeFprintf
  733. #define sprintf        VeSprintf
  734.  
  735. #define vprintf        VeVprintf
  736. #define vfprintf    VeVfprintf
  737. #define vsprintf    VeVsprintf
  738.  
  739. #endif /* VSYS_WININTEL */
  740.  
  741. #ifdef __cplusplus
  742. }
  743. #endif
  744.  
  745. #ifdef powerc    /* VSYS_MAC is defined in osmac.h */
  746. #    include <osmac.h>
  747. #endif
  748.  
  749. /*
  750.  * here we verify all the VUSES got set
  751.  */
  752. #if !defined(VUSES_PLACEABLE)    /* cplace.h, VwpPlaceable, etc */
  753.     *** intentional error ***
  754. #elif !defined(VUSES_FRAMES)    /* 3dframes around views */
  755.     *** intentional error ***
  756. #endif
  757.  
  758. #endif /* OS_H */
  759.