home *** CD-ROM | disk | FTP | other *** search
/ Oracle Video Server 3.0.3.1 / OVS_3031_NT.iso / win32 / medianet / server / include / sysx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-28  |  3.6 KB  |  138 lines

  1. /* Copyright (c) 1995 by Oracle Corporation.  All Rights Reserved.
  2.  
  3.  *
  4.  
  5.  * sysx.h - Oracle MOOSE system-dependent external declarations
  6.  
  7.  */
  8.  
  9.  
  10.  
  11. #ifndef SYSX_ORACLE
  12.  
  13. #define SYSX_ORACLE
  14.  
  15.  
  16.  
  17. /*
  18.  
  19.  * C++ extern "C" wrappers should be placed around all header files for
  20.  
  21.  * C code so that they can safely be included in C++ compilations.
  22.  
  23.  */
  24.  
  25. #ifdef __cplusplus
  26.  
  27. #define EXTC_START extern "C" {
  28.  
  29. #define EXTC_END }
  30.  
  31. #else
  32.  
  33. #define EXTC_START
  34.  
  35. #define EXTC_END
  36.  
  37. #endif
  38.  
  39.  
  40.  
  41. EXTC_START
  42.  
  43.  
  44.  
  45. #include <stdarg.h>
  46.  
  47.  
  48.  
  49. #ifndef SX_ORACLE
  50.  
  51. #include <sx.h>
  52.  
  53. #endif
  54.  
  55.  
  56.  
  57. /*
  58.  
  59.  * The following definitions appear in public headers but are not in
  60.  
  61.  * sx.h.  Therefore, if they are not already defined, we define them
  62.  
  63.  * here.
  64.  
  65.  */
  66.  
  67. #ifndef DISCARD
  68.  
  69. #define DISCARD (void)
  70.  
  71. #endif
  72.  
  73. #ifndef externdef
  74.  
  75. #define externdef
  76.  
  77. #endif
  78.  
  79. #ifndef externref
  80.  
  81. #ifdef NO_DLLIMPORT
  82.  
  83. #define externref extern
  84.  
  85. #else
  86.  
  87. #define externref extern __declspec(dllimport)
  88.  
  89. #endif
  90.  
  91. #endif
  92.  
  93. #ifndef externref
  94.  
  95. #define externref extern
  96.  
  97. #endif
  98.  
  99. #ifndef CONST
  100.  
  101. #define CONST const
  102.  
  103. #endif
  104.  
  105. #ifndef CONST_DATA
  106.  
  107. #define CONST_DATA const
  108.  
  109. #endif
  110.  
  111. #ifndef CONST_W_PTR
  112.  
  113. #define CONST_W_PTR
  114.  
  115. #endif
  116.  
  117.  
  118.  
  119. #ifndef SYSB8_ORACLE
  120.  
  121. #include <sysb8.h>
  122.  
  123. #endif
  124.  
  125. #ifndef YSID_ORACLE
  126.  
  127. #include <ysid.h>
  128.  
  129. #endif
  130.  
  131. #ifndef YSB8_ORACLE
  132.  
  133. #include <ysb8.h>
  134.  
  135. #endif
  136.  
  137.  
  138.  
  139. /*
  140.  
  141.  * OSD Layer State
  142.  
  143.  *
  144.  
  145.  * SYNOPSIS
  146.  
  147.  * size_t SYSX_OSDPTR_SIZE;
  148.  
  149.  *
  150.  
  151.  * DESCRIPTION
  152.  
  153.  * This is the size in bytes of the space to allocate for the OSD layer
  154.  
  155.  * state.  See ysInit() and sysiInit() for more information.  (NOTE:
  156.  
  157.  * do not define this as zero, even if you have no state; it is illegal
  158.  
  159.  * to declare an array with a zero or negative subscript.
  160.  
  161.  */
  162.  
  163. #define SYSX_OSDPTR_SIZE  ( 1280+128 )
  164.  
  165.  
  166.  
  167. /*
  168.  
  169.  * Non-local Goto
  170.  
  171.  *
  172.  
  173.  * SYNOPSIS
  174.  
  175.  * typedef <> sysejb;
  176.  
  177.  * int        syseSet(sysejb jb);
  178.  
  179.  * void       syseJmp(sysejb jb, int val);
  180.  
  181.  * void       sysePanic(void);
  182.  
  183.  * void       sysePrtPC(char *buf, dvoid *faddr);
  184.  
  185.  *
  186.  
  187.  * DESCRIPTION
  188.  
  189.  * syseSet()/syseJmp() provide access to a setjmp()/longjmp()-style
  190.  
  191.  * non-local goto facility.  They are expected to observe the same
  192.  
  193.  * semantics as setjmp() and longjmp() as defined by ANSI C.  A non-
  194.  
  195.  * zero value is guaranteed to be passed to syseJmp().
  196.  
  197.  *
  198.  
  199.  * sysePanic() is called to generate a process fault.  It is used only
  200.  
  201.  * in the event of a catastrophic failure.  This routine should terminate
  202.  
  203.  * execution of the process and never return.  It should also attempt to
  204.  
  205.  * record system-specific information about the dying process, if possible.
  206.  
  207.  *
  208.  
  209.  * sysePrtPC() takes a function pointer address and writes a string form
  210.  
  211.  * of it to buf.
  212.  
  213.  */
  214.  
  215. #include <setjmp.h>
  216.  
  217.  
  218.  
  219. typedef jmp_buf sysejb;
  220.  
  221. #define syseSet(jb)          setjmp(jb)
  222.  
  223. #define syseJmp(jb, val)     longjmp((jb), (val))
  224.  
  225. #define sysePanic()          abort()
  226.  
  227. #define sysePrtPC(nm, addr)  (void) sprintf((nm), "0x%08lp", (addr));
  228.  
  229.  
  230.  
  231. /*
  232.  
  233.  * Context Management
  234.  
  235.  *
  236.  
  237.  * SYNOPSIS
  238.  
  239.  * dvoid *syscGetPG(void);
  240.  
  241.  * void   syscSetPG(dvoid *ptr);
  242.  
  243.  *
  244.  
  245.  * DESCRIPTION
  246.  
  247.  * These routines provide access to a process-wide global variable.
  248.  
  249.  * syscSetPG() sets the value of the global pointer.  syscGetPG()
  250.  
  251.  * returns the last value set.  If it is was never set, syscGetPG()
  252.  
  253.  * should return a null pointer.  If syscSetPG() is called with a
  254.  
  255.  * null pointer, any resources required to maintain the global
  256.  
  257.  * variable may be released and reset to original conditions.
  258.  
  259.  */
  260.  
  261. externref dvoid *syscPG;                      /* process-wide global pointer */
  262.  
  263.  
  264.  
  265. dvoid * syscGetPG(void);
  266.  
  267. #define syscSetPG(ptr)  (syscPG = (ptr))
  268.  
  269.  
  270.  
  271. EXTC_END
  272.  
  273. #endif /* SYSX_ORACLE */
  274.  
  275.