home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / NFSRC305.ZIP / CPMI / CPMI.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-01  |  2.3 KB  |  72 lines

  1. /*
  2.  * File......: CPMI.H
  3.  * Author....: Ted Means
  4.  * CIS ID....: 73067,3332
  5.  *
  6.  * This is an original work by Ted Means and is placed in the
  7.  * public domain.
  8.  *
  9.  * Modification history:
  10.  * ---------------------
  11.  *    Rev 1.0   01 Jan 1995 03:01:00   TED
  12.  *    Initial release
  13.  *
  14.  */
  15.  
  16. //  This is the header file for the Clipper Protected Mode Interface.
  17.  
  18. #define SUCCEED             1
  19. #define FAIL                0
  20.  
  21. #define TRUE                1
  22. #define FALSE               0
  23.  
  24. #define AR_READ             1          // For cpmiWillGPF() & cpmiMakeAlias()
  25. #define AR_WRITE            2          // For cpmiWillGPF() & cpmiMakeAlias()
  26. #define AR_EXECUTE          4          // For cpmiWillGPF() & cpmiMakeAlias()
  27.  
  28. #define INVALID_SELECTOR   -1          // Returned by cpmiWillGPF()
  29. #define INVALID_ACCESS     -2          // Returned by cpmiWillGPF()
  30. #define BEYOND_LIMIT       -3          // Returned by cpmiWillGPF()
  31.  
  32. typedef unsigned int  SELECTOR;
  33. typedef unsigned int  REGISTER;
  34. typedef unsigned int  SEGMENT;
  35. typedef unsigned long LINEAR;
  36. typedef unsigned int  BOOLEAN;
  37.  
  38. typedef union
  39. {
  40.    REGISTER Regs[ 10 ];
  41.    struct
  42.    {
  43.       REGISTER AX;
  44.       REGISTER BX;
  45.       REGISTER CX;
  46.       REGISTER DX;
  47.       REGISTER SI;
  48.       REGISTER DI;
  49.       REGISTER BP;
  50.       REGISTER DS;
  51.       REGISTER ES;
  52.       REGISTER Flags;
  53.    } Reg;
  54. } CPUREGS;
  55.  
  56. BOOLEAN      pascal cpmiIsProtected( void );
  57. int          pascal cpmiWillGPF( void *, unsigned int, unsigned int );
  58. SELECTOR     pascal cpmiAllocateSelector( void );
  59. unsigned int pascal cpmiFreeSelector( SELECTOR );
  60. SELECTOR     pascal cpmiSegmentToSelector( SEGMENT );
  61. LINEAR       pascal cpmiGetBase( SELECTOR );
  62. unsigned int pascal cpmiSetBase( SELECTOR, LINEAR );
  63. unsigned int pascal cpmiGetLimit( SELECTOR );
  64. unsigned int pascal cpmiSetLimit( SELECTOR, int );
  65. void *       pascal cpmiRealPtr( void * );
  66. SELECTOR     pascal cpmiProtectedPtr( void *, unsigned int );
  67. SELECTOR     pascal cpmiMakeAlias( SELECTOR, unsigned int );
  68. SELECTOR     pascal cpmiAllocateDOSMem( unsigned int );
  69. int          pascal cpmiResizeDOSMem( SELECTOR, unsigned int );
  70. int          pascal cpmiFreeDOSMem( SELECTOR );
  71. int          pascal cpmiInt86( unsigned char, CPUREGS *, CPUREGS * );
  72. int          pascal cpmiFarCallReal( void *, CPUREGS *, CPUREGS * );