home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / ntscmlib.h < prev    next >
C/C++ Source or Header  |  1999-01-02  |  5KB  |  185 lines

  1. /* -*-C-*-
  2.  
  3. $Id: ntscmlib.h,v 1.9 1999/01/02 06:11:34 cph Exp $
  4.  
  5. Copyright (c) 1993-1999 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21.  
  22. /* MIT Scheme under Windows system-dependent utilities. */
  23.  
  24. #ifndef SCM_NTLIB_H
  25.  
  26. #include <windows.h>
  27.  
  28. /* Timer installation status codes. */
  29.  
  30. #define WIN32_ASYNC_TIMER_OK        0
  31. #define WIN32_ASYNC_TIMER_NONE        1
  32. #define WIN32_ASYNC_TIMER_EXHAUSTED    2
  33. #define WIN32_ASYNC_TIMER_RESOLUTION    3
  34. #define WIN32_ASYNC_TIMER_NOLOCK    4
  35. #define WIN32_ASYNC_TIMER_NOMEM        5
  36. #define WIN32_ASYNC_TIMER_NOLDT        6
  37.  
  38. #ifndef W32SUT_16
  39.  
  40. /* Exports to Scheme */
  41.  
  42. typedef struct {
  43.  
  44.   BOOL (__cdecl *under_win32s_p) ();
  45.  
  46.   char *
  47.     (__cdecl *allocate_heap) (unsigned long,        /* size */
  48.                   unsigned long *);        /* handle */
  49.   void
  50.     (__cdecl *release_heap) (char *,            /* base */
  51.              unsigned long);            /* handle */
  52.  
  53.   BOOL
  54.     (__cdecl *lock_memory_area) (void *,        /* area */
  55.                  unsigned long);    /* size */
  56.   void
  57.     (__cdecl *unlock_memory_area) (void *,        /* area */
  58.                    unsigned long);    /* size */
  59.  
  60.   UINT
  61.     (__cdecl *install_async_timer)
  62.       (void **,            /* timer state */
  63.        unsigned long *,        /* regs */
  64.        long,            /* memtop_off */
  65.        long,            /* int_code_off */
  66.        long,            /* int_mask_off */
  67.        unsigned long,        /* mask */
  68.        long,            /* ctr_off */
  69.        unsigned long,        /* catatonia_message */
  70.        unsigned long,        /* interrupt_message */
  71.        HWND,            /* window */
  72.        void (*) (void),        /* procedure to grab int regs */
  73.        void (*) (void)        /* procedure to release int regs */
  74.        );
  75.  
  76.   void
  77.     (__cdecl *flush_async_timer) (void *);
  78.  
  79.   BOOL
  80.     (__cdecl *alloc_scheme_selectors) (unsigned long,        /* base */
  81.                        unsigned long,        /* limit */
  82.                        unsigned short *,    /* cs */
  83.                        unsigned short *,    /* ds */
  84.                        unsigned short *);    /* ss */
  85.   
  86.   void
  87.     (__cdecl *release_scheme_selectors) (unsigned short,    /* cs */
  88.                      unsigned short,    /* ds */
  89.                      unsigned short);    /* ss */
  90.  
  91. } WIN32_SYSTEM_UTILITIES;
  92.  
  93. extern WIN32_SYSTEM_UTILITIES win32_system_utilities;
  94. #endif /* not W32SUT_16 */
  95.  
  96. #if defined(W32SUT_32) || defined(W32SUT_16)
  97.  
  98. /* Under Win3.1, there is a 16-bit "universal thunk".
  99.    The following define the communications protocol.
  100.  */
  101.  
  102. #include <stdarg.h>
  103. #include <w32sut.h>
  104.  
  105. #ifdef W32SUT_16
  106.   typedef unsigned long FAR * SCM_ULPTR;
  107. #else
  108.   typedef unsigned long * SCM_ULPTR;
  109. #endif
  110.  
  111. typedef LPVOID SCM_VDPTR;
  112. typedef long SCM_LONG;
  113. typedef unsigned long SCM_ULONG;
  114. typedef unsigned short SCM_BOOL;
  115. typedef unsigned short SCM_SEL;
  116.  
  117. #define STRINGIFY(arg) #arg
  118.  
  119. #define NTW16LIB_DLL_NAME    "scheme16.dll"
  120. #define NTW16LIB_DLL_INIT    ntw16lib_init
  121. #define NTW16LIB_DLL_ENTRY    ntw16lib_handler
  122.  
  123. #define NTW32LIB_RESERVED        0
  124.  
  125. #define NTW32LIB_VIRTUAL_LOCK        1
  126. struct ntw32lib_vlock_s
  127. {
  128.   SCM_VDPTR area;        /* ->16 */
  129.   SCM_ULONG size;        /* ->16 */
  130. };
  131.  
  132. #define NTW32LIB_VIRTUAL_UNLOCK        2
  133. struct ntw32lib_vulock_s
  134. {
  135.   SCM_VDPTR area;        /* ->16 */
  136.   SCM_ULONG size;        /* ->16 */
  137. };
  138.  
  139. #define NTW32LIB_INSTALL_TIMER        3
  140. struct ntw32lib_itimer_s
  141. {
  142.   SCM_ULONG handle;        /* ->32 */
  143.   SCM_ULPTR base;        /* ->16 */
  144.   SCM_LONG memtop_off;        /* ->16 */
  145.   SCM_LONG int_code_off;    /* ->16 */
  146.   SCM_LONG int_mask_off;    /* ->16 */
  147.   SCM_ULONG bit_mask;        /* ->16 */
  148.   SCM_LONG ctr_off;        /* ->16 */
  149.   SCM_ULONG catatonia_message;    /* ->16 */
  150.   SCM_ULONG interrupt_message;    /* ->16 */
  151.   SCM_ULONG window;        /* ->16 */
  152. };
  153.  
  154. #define NTW32LIB_FLUSH_TIMER        4
  155. struct ntw32lib_ftimer_s
  156. {
  157.   SCM_ULONG handle;        /* ->16 */
  158. };
  159.  
  160. #define NTW32LIB_ALLOC_SELECTORS    5
  161. struct ntw32lib_selalloc_s
  162. {
  163.   SCM_ULONG base;        /* ->16 */
  164.   SCM_ULONG limit;        /* ->16 */
  165.   SCM_SEL cs32;            /* ->16 */
  166.   SCM_SEL ds32;            /* ->16 */
  167.   SCM_SEL cs;            /* ->32 */
  168.   SCM_SEL ds;            /* ->32 */
  169.   SCM_SEL ss;            /* ->32 */
  170. };
  171.  
  172. #define NTW32LIB_FREE_SELECTORS        6
  173. struct ntw32lib_selfree_s
  174. {
  175.   SCM_SEL cs32;            /* ->16 */
  176.   SCM_SEL ds32;            /* ->16 */
  177.   SCM_SEL cs;            /* ->16 */
  178.   SCM_SEL ds;            /* ->16 */
  179.   SCM_SEL ss;            /* ->16 */
  180. };
  181.  
  182. #endif /* defined(W32SUT_32) || defined(W32SUT_16) */
  183.  
  184. #endif /* SCM_NTLIB_H */
  185.