digitalmars.com                      
Last update Sun Mar 4 12:00:59 2018

swap.h

Swaps spawned program with calling program.

swap_clearkeyboardon, swap_clearkeyboardoff

Header
swap.h
Prototype
void swap_clearkeyboardon(void);
void swap_clearkeyboardoff(void);
Description
These functions turn on or off the clear keyboard buffer feature. When on, the keyboard buffer is cleared before returning from a spawned process. The default is on. These functions can be nested. If two calls are made to the off function, two calls must also be made to the on function in order to reactivate the keyboard feature.
Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off

swap_freeparagraphs

Header
swap.h
Prototype
void swap_freeparagraphs(unsigned int para);
Description
This function specifies the number of 16-byte paragraphs of memory that will be made available for the spawned process. The argument para is the number of 16 byte paragraphs of memory to make available for the spawned process. The swap facility normally frees all the memory it can, but if you are running a program that will only require only a small amount of memory then the use of the swap_freeparagraphs function will allow the swap to execute faster. Each kilobyte of memory consists of 64 paragraphs.

Calling swap_freeparagraphs implicitly turns on the free paragraphs feature. A call to swap_freeparagraphsoff turns it off again. If the number of paragraphs specified is greater than can be freed, the swap facility frees all it can and continues to spawn the process.

Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off swap_freeparagraphson swap_freeparagraphsoff

swap_freeparagraphson, swap_freeparagraphsoff

Header
swap.h
Prototype
void swap_freeparagraphson(void);
void swap_freeparagraphsoff(void);
Description
These functions turn on or off the "free paragraph" feature. When on, swap frees only the specified amount of memory during the spawning of a child process. The number of paragraphs to be freed must be specified first by a call to swap_freeparagraphs. This call automatically turns on the free paragraph feature, without needing a call to swap_freeparagraphson. To turn it off, use swap_freeparagraphsoff.

Calls to the off and on functions can be nested. If two calls are made to the off function, two calls must also be made to the on function to reactivate the feature.

Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off swap_freeparagraphs

swap_isclearkeyboardon, swap_isfreeparagraphson, swap_ison, swap_ispipeon, swap_istempcheckon, swap_istrapcbreakon swap_iswindowon

Header
swap.h
Prototype
int swap_isclearkeyboardon(void);
int swap_isfreeparagraphson(void);
int swap_ison(void);
int swap_ispipeon(void);
int swap_istempcheckon(void);
int swap_istrapcbreakon(void);
int swap_iswindowon(void);
Description
These functions return the flag status of the configurable features of the swap_functions. See the descriptions of the corresponding control functions for more information.
Return Value
A non-zero, positive return value indicates the feature is turned on.
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off

swap_on, swap_off

Header
swap.h
Prototype
void swap_on(void);
void swap_off(void);
Description
These functions turn swapping on or off. When off, calls to spawn and system behave as normal. The default is on. Function calls can be nested; if two calls are made to the off function, two calls must be made to the on function to reactivate swapping. swap_functions are for use only in real mode MS-DOS. They support the C (compact), L (Large), and V (Virtual) memory models. To use these functions, link the appropriate object file with your program. Object files are _swapc. obj, _swapl. obj, and _swapv. obj respectively.
Return Value
None
Compatibility
DOS Large and Compact memory models only.

swap_pipe

Header
swap.h
Prototype
void swap_pipe(const char *file);
Description
This function copies the output from a spawned program and redirects it to a file. The output must be stdout or stderr. Calling swap_pipeoff suspends output to the pipe file. The swap_pipe function can be use simultaneously with swap_window.
Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off swap_pipeon swap_pipeoff

swap_pipeon, swap_pipeoff

Header
swap.h
Prototype
void swap_pipeon(void);
void swap_pipeoff(void);
Description
These functions turn on or off piping output to a file. When on, all output from the spawned program that goes through stdout or stderr is piped to the pipe file. A pipe file must be specified by calling swap_pipe, which automatically turns on piping. To turn off automatic piping, invoke swap_pipeoff. To turn it back on again, call swap_pipeon.

Calls can be nested. If two calls are made to the off function, two calls must be made to the on function to reactivate the pipe.

Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off

swap_tempcheckon, swap_tempcheckoff

Header
swap.h
Prototype
void swap_tempcheckon(void);
void swap_tempcheckoff(void);
Description
These functions determine where the memory image file is saved when a program is spawned. By default the swap facility saves its memory image file in the directory pointed to by the TEMP or TMP environment variable if there is one, or in the current working directory if there is not. If this behavior is turned off, the swap file is always stored in the current working directory.

The ability to disable checking of TEMP or TMP is useful when the environment variable points to a RAM disk or other specialized memory that you do not want used for the memory image of the program being swapped.

Calls to swap_tempcheckon and swap_tempcheckoff can be nested. If two calls are made to the off function, two calls must be made to the on function to reactivate checking of TEMP or TMP.

Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off

swap_trapcbreakon, swap_trapcbreakoff

Header
swap.h
Prototype
void swap_trapcbreakon(void);
void swap_trapcbreakoff(void);
Description
These functions turn on or off control-c trapping when a program is spawned. When on, control-c and control-break are trapped by the swap facility and ignored. The default is on. If you want a spawned program to react to control-c or control-break, you install a control-c handler using the controlc_functions, and then turn off the swap facility by calling swap_trapcbreakoff.
Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off controlc_open

swap_window

Header
swap.h
Prototype
void swap_window(int col, int lin, int x, int y);
Description
This function receives output sent by stdout or stderr from a spawned program and displays the output on the screen in a specified window area. The window area dimensions are:
col The left column of the window
lin The top line of the window
x The width of the window in columns
y The depth of the window in rows
Output to the window is scrolled and wrapped appropriately. Calling swap_windowoff suspends output.
Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off swap_windowon swap_windowoff

swap_windowon, swap_windowoff

Header
swap.h
Prototype
void swap_windowon(void);
void swap_windowoff(void);
Description
These functions turn on or off the window program output for spawned programs. When on, all output from the program that goes through stdout or stderr is sent to a specified screen area (window). The window must be defined first by calling swap_window, in which case swap_windowon is only required if a previous call has been made to swap_windowoff.

Calls to swap_windowoff and swap_windowon can be nested. If two calls are made to the off function, two calls must be made to the on function to reactivate the feature.

Return Value
None
Compatibility
DOS Large and Compact memory models only.
See Also
swap_on swap_off swap_window
Home | Compiler & Tools | IDDE Reference | STL | Search | Download | Forums