?? exec.h
字號:
/*
--- Version 3.3 91-11-21 16:12 ---
EXEC.H: EXEC function with memory swap - Main function header file.
Public domain software by
Thomas Wagner
Ferrari electronic GmbH
Beusselstrasse 27
D-1000 Berlin 21
Germany
*/
extern int do_exec (char *xfn, char *pars, int spawn, unsigned needed,
char **envp);
/*>e
The EXEC function.
Parameters:
xfn is a string containing the name of the file
to be executed. If the string is empty,
the COMSPEC environment variable is used to
load a copy of COMMAND.COM or its equivalent.
If the filename does not include a path, the
current PATH is searched after the default.
If the filename does not include an extension,
the path is scanned for a COM, EXE, or BAT file
in that order.
pars The program parameters.
spawn If 0, the function will terminate after the
EXECed program returns, the function will not return.
NOTE: If the program file is not found, the function
will always return with the appropriate error
code, even if 'spawn' is 0.
If non-0, the function will return after executing the
program. If necessary (see the "needed" parameter),
memory will be swapped out before executing the program.
For swapping, spawn must contain a combination of the
following flags:
USE_EMS (0x01) - allow EMS swap
USE_XMS (0x02) - allow XMS swap
USE_FILE (0x04) - allow File swap
The order of trying the different swap methods can be
controlled with one of the flags
EMS_FIRST (0x00) - EMS, XMS, File (default)
XMS_FIRST (0x10) - XMS, EMS, File
If swapping is to File, the attribute of the swap file
can be set to "hidden", so users are not irritated by
strange files appearing out of nowhere with the flag
and the behaviour on Network drives can be changed with
NO_PREALLOC (0x100) - don't preallocate
CHECK_NET (0x200) - don't preallocate if file on net.
This checking for Network is mainly to compensate for
a strange slowdown on Novell networks when preallocating
a file. You can either set NO_PREALLOC to avoid allocation
in any case, or let the prep_swap routine decide whether
to do preallocation or not depending on the file being
on a network drive (this will only work with DOS 3.1 or
later).
needed The memory needed for the program in paragraphs (16 Bytes).
If not enough memory is free, the program will
be swapped out.
Use 0 to never swap, 0xffff to always swap.
If 'spawn' is 0, this parameter is irrelevant.
envp The environment to be passed to the spawned
program. If this parameter is NULL, a copy
of the parent's environment is used (i.e.
'putenv' calls have no effect). If non-NULL,
envp must point to an array of pointers to
strings, terminated by a NULL pointer (the
standard variable 'environ' may be used).
Return value:
0x0000..00FF: The EXECed Program's return code
0x0101: Error preparing for swap: no space for swapping
0x0102: Error preparing for swap: program too low in memory
0x0200: Program file not found
0x0201: Program file: Invalid drive
0x0202: Program file: Invalid path
0x0203: Program file: Invalid name
0x0204: Program file: Invalid drive letter
0x0205: Program file: Path too long
0x0206: Program file: Drive not ready
0x0207: Batchfile/COMMAND: COMMAND.COM not found
0x0208: Error allocating temporary buffer
0x03xx: DOS-error-code xx calling EXEC
0x0400: Error allocating environment buffer
0x0500: Swapping requested, but prep_swap has not
been called or returned an error.
0x0501: MCBs don't match expected setup
0x0502: Error while swapping out
0x0600: Redirection syntax error
0x06xx: DOS error xx on redirection
<*/
/*>d
Die EXEC Funktion.
Parameter:
xfn ist ein String mit dem Namen der auszuf乭renden Datei.
Ist der String leer, wird die COMSPEC Umgebungsvariable
benutzt um COMMAND.COM oder das Equivalent zu laden.
Ist kein Pfad angegeben, wird nach dem aktuellen Pfad
der in der PATH Umgebungsvariablen angegebene Pfad
durchsucht.
Ist kein Dateityp angegeben, wird der Pfad nach
einer COM oder EXE Datei (in dieser Reihenfolge) abgesucht.
pars Die Kommandozeile
spawn Wenn 0, wird der Programmlauf beendet wenn das
aufgerufene Programm zur乧kkehrt, die Funktion kehrt
nicht zur乧k.
HINWEIS: Wenn die auszuf乭rende Datei nicht gefunden
wird, kehrt die Funktion mit einem Fehlercode
zur乧k, auch wenn der 'spawn' Parameter 0 ist.
Wenn nicht 0, kehrt die Funktion nach Ausf乭rung des
Programms zur乧k. Falls notwendig (siehe den Parameter
"needed") wird der Programmspeicherbereich vor Aufruf
ausgelagert.
Zur Auslagerung mu
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -