home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / win3 / patches / symantec / rtlinc.exe / SWAP.H < prev    next >
C/C++ Source or Header  |  1993-05-18  |  6KB  |  97 lines

  1. /* swap.h     written by: G. Eric Engstrom
  2.  *            (C)Copyright Concentric Software Designs, Inc. 1990
  3.  *            All Rights Reserved
  4.  */
  5.  
  6. #define SWAP_FREEMEMERROR -2
  7. /* errno == SWAP_FREEMEMERROR when DOS will not allow swap to shrink the allocation block */
  8. #define SWAP_NOVMSPACE    -3
  9. /* errno == SWAP_NOVMSPACE when there is not enough room for the memory image file */
  10.  
  11. #ifdef __cplusplus
  12. extern "C"
  13.   {
  14. #endif
  15. /* defaults for _swapX are:
  16.  *
  17.  * swapping is turned on
  18.  * windowing is turned off
  19.  * piping is turned off
  20.  * free paragraphs is turned off
  21.  *
  22.  * this allows you to link _swapX into your program without source code
  23.  * modifications.
  24.  *
  25.  * _SWAPX position in the EXE determines how much of the program will get
  26.  * "swapped out" to disk. For example, if _SWAPX is the first OBJ file in
  27.  * linker's parameter list, then the entire EXE will be swapped to disk,
  28.  * with the exception of the SWAP kernel required to control windowing,
  29.  * piping, and reloading. You can get swap to leave more of the program
  30.  * in memory by positioning it in the linker OBJ file list after the OBJ
  31.  * files you want to remain in memory. For instance, your programs
  32.  * CRITICAL ERROR HANDLER or some other ISR. Any ISR left in memory and
  33.  * active while the rest of the program is "swapped out" must not access
  34.  * any global data as it will mostly likely have been "swapped out" with
  35.  * the rest of the program.
  36.  *
  37.  * on and off switches are incremental, like in the disp and msm libraries.
  38.  * i.e.
  39.  *    swap_off();
  40.  *    swap_off();
  41.  *    swap_on();
  42.  *
  43.  * will result in swap still being off, two swap_on's will be required
  44.  * to neutralize the effect of two swap_off's.
  45.  *
  46.  * swap_tempcheck routines are provided in case TMP/TEMP points to RAM disk
  47.  *         or other specialized memory that you don't want consumed
  48.  *               by a memory image of the program being swapped.
  49.  *
  50.  * swap_window's parameters are the line and column of the the upper left
  51.  *               corner of the window followed by the width[x] (in columns)
  52.  *               and the depth[y] (in lines). It can be used with or without
  53.  *               a pipe file.
  54.  *
  55.  * swap_pipe's   parameter is the filespec where you would like all output
  56.  *               to be saved. It can be used with or without a window.
  57.  *
  58.  * swap_freeparagraphs' parameter is the number of 16 byte paragraphs of
  59.  *               memory you want SWAP to make available for the spawned
  60.  *               process. SWAP normally free's all the memory it can, but
  61.  *               if you are running a program you know will only require
  62.  *               40K then SWAP will execute faster if you tell it to only
  63.  *               free up 40 * 64 paragraphs of memory. This call is for
  64.  *               speed enhancement only. NOTE: If you the number of paragraph's
  65.  *               specified is greater than SWAP can free, SWAP will free all
  66.  *               it can and still spawn the process.
  67.  */
  68.  
  69.  int __cdecl swap_ison(void);                           /* default on   returns value of swap control flag, positive non-zero is on */
  70.  int __cdecl swap_istempcheckon(void);                  /* default on   returns value of swap temp check flag, positive non-zero is on */
  71.  int __cdecl swap_iswindowon(void);                     /* default off  returns value of swap window control flag, positive non-zero is on */
  72.  int __cdecl swap_ispipeon(void);                       /* default off  returns value of swap pipe control flag, positive non-zero is on */
  73.  int __cdecl swap_isfreeparagraphson(void);     /* default off  returns value of swap free paragraphs control flag, positive, non-zero is on*/
  74.  int __cdecl swap_istrapcbreakon(void);                 /* default on   returns value of swap trap ^C/^Break flag, positive, non-zero is on */
  75.  int __cdecl swap_isclearkeyboardon(void);              /* default on   returns value of swap clear keyboard flag, positive, non-zero is on */
  76. void __cdecl swap_on(void);                             /* turns swap on */
  77. void __cdecl swap_off(void);                            /* turns swap off */
  78. void __cdecl swap_tempcheckon(void);                    /* turns TMP\TEMP checking on, SWAP will put the image file where they say */
  79. void __cdecl swap_tempcheckoff(void);                   /* turns TMP\TEMP checking off, SWAP will put the image file in the CWD */
  80. void __cdecl swap_window(int col,int lin,int x,int y);  /* defines spawned apps screen */
  81. void __cdecl swap_windowon(void);                       /* turns window on */
  82. void __cdecl swap_windowoff(void);                      /* turns window off */
  83. void __cdecl swap_pipe(const char *file);               /* specifies output pipe file */
  84. void __cdecl swap_pipeon(void);                         /* turns output piping on */
  85. void __cdecl swap_pipeoff(void);                                /* turns output piping off */
  86. void __cdecl swap_freeparagraphs(unsigned int sz);      /* specifies number of paragraphs SWAP should attempt to FREE for spawned process */
  87. void __cdecl swap_freeparagraphson(void);               /* turns free paragraphs on */
  88. void __cdecl swap_freeparagraphsoff(void);              /* turns free paragraphs off */
  89. void __cdecl swap_trapcbreakon(void);                   /* turns control C/Break trapping on  */
  90. void __cdecl swap_trapcbreakoff(void);                  /* turns control C/Break trapping off */
  91. void __cdecl swap_clearkeyboardon(void);                        /* turns clear keyboard buffer on */
  92. void __cdecl swap_clearkeyboardoff(void);               /* turns clear keyboard buffer off */
  93. #ifdef __cplusplus
  94.   }
  95. #endif
  96.  
  97.