C library function manual classification function, the function library is ctype.hint isalpha (int CH) if CH is the letter ('A' - 'Z', 'A' - 'Z') Returns 0 value, otherwise returns 0INT IsalNum INT CH) If CH is a letter ('A' - 'Z', 'A' - 'Z') or numbers ('0' - '9') returns to non-0 value, otherwise returns 0InT isascii (int CH) if ch Is a character (0-127 in the ASCII code) Returns a non-0 value, otherwise returns 0INT ISCNTRL (INT CH) If the CH is a waste character (0x7f) or the normal control character (0x00-0x1f) returns a non-0 value, return 0int isdigit (int CH) If the CH is a number ('0' - '9') returns a non-zero, it will return 0INT ISGRAPH (INT CH) if the CH is a printable character (excluding space) (0x21-0x7e) returns non-0 value Otherwise, returning 0int islower (int CH) If CH is lowercase letters ('A' - 'z') returns non-0 value, otherwise returning 0int isprint (int CH) if ch is a printable character (including air) (0x20-0x7e) Returns a non-0 value, otherwise returns 0INT ISPUNCT (INT CH) Returns a non-0 value if the CH is the punctuation character (0x00-0x1f), otherwise returns 0INT ISSPACE (INT CH) if ch is space (''), horizontal tab ('/ t'), Enter ('/ R'), Paper Wrap ('/ f'), Vertical Table ('/ V'), Retained ('/ N') Returns Non 0 Value Otherwise, returning 0INT Isupper (int CH) If the CH is uppercase letters ('A' - 'Z') returns to a non-0 value, otherwise returns 0INT Isxdigit (int CH) if CH is a 16-en-load number ('0' - '9 ',' A '-' f ',' a '-' f ') Returns a non-0 value, otherwise returns 0int Tolower (int CH) if ch is uppercase letter (' A '-' Z ') Returns the corresponding lowercase letters ('A' - 'Z') INT TouPper (INT CH) If CH is lowercase letters ('A' - 'Z') Returns the corresponding uppercase letters ('A' - 'Z') mathematical functions, the function library is Math.h, stdlib.h, string.h, float.hi NT ABS (INT i) Returns the absolute value of the entire parameter i Double Cabs (STRUCT Complex Znum) Returns the absolute value of the recovered Znum Double Fabs (double x) Returns the absolute value of the double precision parameter x Long Labs (long n) Returns long The absolute value Double EXP (Double X) returns the value of the index function EX Double frexp (Double Value, INT * EPTR) Returns the value of X * 2N, N storage in the EPTR Double LDEXP (Double Value INT Exp);
Returns Value * 2EXP Value Double Log (Double X) Returns Double Log10 (Double X) Returns Double Pow (Double X, Double Y) Returns Double Pow10 (INT P) Returns 10p Double Double Double Double Double Double Double SQRT (Double X) Returns √x's value Double ACOS (Double X) Returns the anti-residual COS-1 (X) value of the X, X) Returns X-1 (X) Returns X-1 (x) Value, X is an arc Double ATAN (Double X) Returns the Untishable Tan-1 (X) value of X, X is an arc Double Atan2 (Double Y, Double X) Returns an anti-fixed TAN-1 (X) value of Y / X Y X X is the cosine COS (X) value returns the X of the x, X is the sinusoidal SiN (X) value returns the X (Double X), X is the curvature Double Tan (Double X) Returns the orthodium Tan (X) value of X, X is a double cosine Cosh (X) value returns the X of X, X), X is a dual sine SINH (X) returns X-x-x-x-x Value, X is the two-dicing Tanh (X) value returns the X of X, X) value, X is the radio double hypot (double x, double y) Returns the length (z) of the right triangular horns (Z), X and Y are Straight angle length, z2 = x2
Y2DOUBLE CEIL (Double X) Returns the minimal integer of X. Double Floor (Double X) Returns the maximum integer Void Srand (unsigned seed) in which X initializes the random number INT rand () generates a random number and returns this number Double Poly (double x, int N, double c []) generates a multi-term Double MODF (Double Value, Double * IPTR) from the parameter, decomposes the double-precision value value into the mantissa and the order Double Fmod (Double X, Double Y) Returns to X / Y's remaining Double Frexp (Double Value, INT * EPTR) divides the double-precision value value into the mantissa and the order Double ATOF (Char * NPTR) converts the string NPTR into floating point number and returns this floating point number Double ATOI (Char * NPTR) String NPTR Converted into an integer and returns this integer Double Atol (Char * NPTR) to convert the string NPTR to the integer and return this integer char * ECVT (Double Value, int NDIGIT, INT * DECPT, INT * SIGN) to floating the floating point value VALUE Convert the string and return this string char * FCVT (Double Value, Int NDIGIT, INT * DECPT, INT * SIGN) converts floating point value value into a string and returns the string char * GCVT (Double Value, Int NDIGIT, Char * BUF) Converting VALUE into a string and returned to BUF's pointer char * ULTOA (unsigned long value, char * string, int RADIX) converts unsigned integer values into a string and returns to String, Radix Classic CHAR * LTOA (Long Value, Char * String, Int Ra) DIX) Convert long-interaction VALUE into a string and returns the string, Radix is converted to the base char * itoa (int value, char * string, int RADIX) to store the integer value into a string String, Radix Converting the string NPTR to double precision when converting, returns to this number, error returns 0INT ATOI (Char * NPTR) Converting the string NPTR into an integer, and returns this number Error returns 0long atol (char * nptr) converts the string NPTR to the total number, and returns this number, the error returns 0double StRTOD (Char * STR, CHAR ** ENDPTR) converts the string STR to double precision, and Returns this number, Long Strtol (CHAR * STR, CHAR ** Endptr, INT Base) converts the string STR to the total number, return this number, int match (STRUCT Exception * e) user modified mathematical error returns information function ( No need to use) Double _Matherr (_Mexcep why, char * fun, double * arg1p, double * arg2p,
Double Retval) User Modify Mathematical Error Return Information Functions (Nothing Use) Unsigned INT_CLEAR87 () Clears floating point status words and return the original floating point status void _fpreset () Reproduces the floating point math package unsigned int _STATUS87 () Returns the floating point status word directory function, the function library is dir.h, dos.hint chdir (char * path) to make the specified directory PATH (eg "C: // WPS") into the current working directory, success Returns 0INT FINDFIRST (CHAR * PATHNAME, STRUCT FFB * FFBLK, INT Attrib) Find the specified file, successfully returns 0 pathName as the specified directory name and file name, such as "c: // wps // txt" ffblk for the specified saved file A structure of information, defined as follows: ┏┏━━━━━━━━━━━━━━━━━┓┓┓┓━━━━━━┓ ┓ ┓Struct Ffblk ┓ {{ff_reserved [21]; / * DOS reserved word * / Char ff_attrib; / * file attribute * / INT ff_ftime; / * file time * / int FF_FDATE; / * File date * / LONG FF_FSIZE; / * File length * / ce ff_name [13] ; / * File name * /} ┗┗━━━━━┛┛━━━━━━━━━┛ attrib for file properties, by the following characters, ┏┏━━━━━━━━━━ ┳┳━━━━━┓┓ ┓ ┓_rdonly read-only file FFA_Label volume marking number a_hidden hidden file Ffa_direc directory a_system system file a__━ ┗ ┗┗━━━━━━━━┻┻━━ ━━━━ ┛┛: Struct ffblk ff; FindFirst ("*. WPS", & ff, fa_rdonly); int FindNext (Struct Ffblk * ffblk) Repeates the file with Findirstirst, successfully returns 0void FuMerge (Char * Path, Char * Drive, Char * Dir, Char * Name, char * ext) This function passes the Dir (C:, / BC / LIB, etc.), the file name Name (TC, WPS, etc.), the file name Name (.Exe) , .Com, etc., form a file name and Path .int fnsplit (char * path, char * drive, char * dir, char * name, char * ext) This function breaks down the file name Path DRIVE (C :, A:, etc.), path DIR (/ tc, / bc / lib, etc.), file name Name (TC, WPS, etc.), extension ext (.exe, .com, etc.) and deposit into corresponding variables, respectively .int getCurdir (int DRIVE, CHAR * DIREC) This function returns the current working directory name Drive specified by the specified drive (0 = Current, 1 = A, 2 = B, 3 = C, etc.) DIREC Save Specical Drive Current Work Path The variable successfully returns 0CHAR * getCwd (char * buf, IINT N) This function takes the current working directory and stores in BUF.
Until n-by-word segmentation. Error returns nullint getDisk () Takes a drive that is currently using, returns an integer (0 = a, 1 = b, 2 = C, etc.) int setDisk (int DRIVE) set the drive to use. Drive (0 = A, 1 = B, 2 = C, etc.), returns to create a new directory Pathname using the total number of drives, successfully returns 0INT RMDIR (Char * Pathname) Delete a directory Pathname Returns 0CHAR * MKTEMP (Char * Template) Constructing a file name not in a current directory and stores a file file file file file file file file FileName using MSDOS, this function uses DOS's Path variable, not found The file returns the NULL process function, the function library is stdlib.h, and process.hvoid abort () This function writes a termination information in Stderr by calling _exit with export code 3, and terminates the program. Non-return value int exec ... loading and run other program int execl (char * arg1, char * argn, char * arg1, ..., char * argn, null) int execle (char * pathname, char * arg0, char * arg1, ..., Char * Argn, NULL, CHAR * ENVP []) int execlp (char * pathname, char * arg0, char * arg1, ..., null) int execlpe (char * pathname, char * arg0, char * arg1, ..., NULL, Char * Envp [] Int Execv (Char * Pathname, Char * Argv []) Int Execve (Char * Pathname, Char * Argv [], Char * Envp []) int execvp (char * pathname, char * argv []) int execvpe (char * pathname, char * argv [], char * envp []) Exec function family is loaded and running the program Pathname, and the parameter arg0 (arg1, arg2, argv [], envp []) passed To the subroutine, error returns -1 In the exec function family, the suffix L, V, P, E are added to the exec, the specified function will have some kind of operational ability with suffix P, the function can take advantage of DOS's PATH variable lookup Subprogram file. L When the number of parameters transmitted in the function is fixed. V When the function passed is not fixed. E, the function passes the specified parameter ENVP, allows the environment where the sub-process is allowed, the sub-process uses the current program. Void_exit (int stat (int stat (int stat (int stat (int stat (int status) termination of the current program, turn off all files, write the output of the buffer (wait for the output), and call any register "exit function", no return Value int Spawn ... running program int Spawnl (int MODE, CHAR * PATHNAME, CHAR * ARG0, CHAR * Arg1, ..., char * argn, null) int Spawnle (int mode, char * pathname, char * arg0, char * arg1 , ...,
Char * argn, null, char * envp []) int Spawnlp (int mode, char * pathname, char * arg0, char * arg1, ..., char * argn, null) int Spawnlpe (int mode, char * pathname, char * Arg0, Char * Arg1, ..., Char * Argn, Null, Char * Envp []) int Spawnv (int mode, char * pathname, char * argv []) int Spawnve (int mode, char * pathname, char * argv [ ], char * envp []) int Spawnvp (int mode, char * pathname, char * argv []) int spawnvpe (int mode, char * pathname, char * argv [], char * envp []) spawn function family Urban program Pathname and the parameter Arg0 (Arg1, Arg2, Argv [], envp []), and ENVP []), and ENVP []). Error Returns -1 Mode For the running mode Mode to reply to the subroutine after running after running Program p_nowait Indicates that the program is running this program (not available) in the subroutine runtime, indicates that the operator is added to the SPAWN function family after this program is exited, and the suffix L, V, p, e add to the spawn, the specified function will When there is a suffix P, the function is used to find the subroutine file L, the function passed the number of parameters fixed. V, the number of parameters passed is not fixed. E, the specified parameter ENVP can be passed To the subroutine, allow the subroutine to run environment. When there is an adfied E, the subroutine uses the environment of this program. Init System (Char * Command) passes the MSDOS command command to the DOS execution of the transducer, the library is MAT HH, stdlib.h, ctype.h, float.hchar * ECVT (Double value, int ndigit, int * decpt, int * sign) convert floating point value VALUE into a string and returns the string char * FCVT (Double Value, INT NDIGIT, INT * DECPT, INT * SIGN converts floating point value VALUE into a string and returns the string char * GCVT (Double Value, int NDIGIT, CHAR * BUF) converts the number Value into a string and stored in BUF, Returns BUF's pointer char * ULTOA (Unsigned long value, char * string, INT RADIX) converts unsigned integer values into a string and returns to the string, and Radix is a base char * LTOA (Long Value, Char * string, int RADIX converts long-integrated value VALUE into a string and returns the string, and RADIX is converted to the base char * itoa (int value, char * string, int RADIX) converts the integer value into a string. Store String, RADIX is converted to the base number Double ATOF (Char * nptr) to convert the string NPTR to a double precision and return this number. Error Returns 0ItOii (Char * NPTR) Convert NPTR to integer And return this number, the error returns 0long atol (char * nptr) to convert the string NPTR to growth,
And return this number, the error returns 0douBLE STRTOD (CHAR * STR, CHAR ** ENDPTR) Converting the string STR to double precision, returns this number, Long Strtol (Char * Str, Char ** Endptr, Int Base) String STR conversion to the total number of intensive numbers, and returns this number, INT TOASCII (INT C) Returns the corresponding ASCIIIInt Tolower (INT CH) if CH is uppercase letters ('A' - 'Z') Returns the corresponding lowercase letters ( 'A' - 'Z') INT _TOLOWER (INT CH) Returns CHA corresponding lowercase letters ('A' - 'Z') Int Toupper (INT CH) If CH is lowercase letters ('A' - 'Z') returns Corresponding uppercase letters ('A' - 'Z') INT _TOUPPER (INT CH) Returns the CHOPL ('A' - 'Z') diagnostic function, the function library is Assert.h, Math.hvoid Assert ( INT test is a macro extends to an IF statement. If the Test test fails, it displays an information and termination of the program. No return value void perror (char * String) This function will display the most recent error message, the format is as follows: Character String string: Error message Char * strerror (Char * STR) This function returns the last error message, the format is as follows: String str: Error message int match (Struct Exception * e) User Modify Mathematical Error Return Information Function (no need to use Double _Matherr (_Mexcep why, char * fun, double * arg1p, double * arg2p, double return) User Modify Mathematical Error Return Information Function (Nothing Use) Input Output Subprint, the Library is IO.H, Conio.h, Stat.h, dos.h, stdio.h, signal.hint kbhit () This function returns the recently knocked button int FGetChar () from the console (keyboard) reads a character, displayed on the screen INT getch () control Table (keyboard) read a character, not displayed on the screen INT PUTCH () Write a character int GETCHAR () from the console (keyboard) to the console (keyboard), displayed on the screen INT PUTCHAR () to control Taiwan (keyboard) Write a character int GETCHE () reads a character from the console (keyboard), displayed on the screen INT UNGETCH (INT C) returns the character C back to the console (keyboard) char * cgets (char * string) Console (keyboard) read strings in string int Scanf (char * format [, argument ...]) reads a string from the console, assigns each parameter, using BIOS to output int vscanf (char * FORMAT, VALIST PARAM) Reads a string from the console, assigns the respective parameters, using the BIOS to output, the parameters get int Cscanf (char * format [, argument ...] from the VALIST Param, read one from the console String, assign each parameter, directly to the control table, such as the display when the display is displayed when the characters are displayed, the direct SSCANF (Char * string, char * format [, argument, ...]) passes characters. String string,
Assign each parameter int vsscanf (Char * String, Char * Format, Vlist Param), respectively, assigns each parameter, and the parameters have a string that obtained int PUTS (Char * String) in VLIST PARAM. String to the console (display), using the BIOS to output VOID CPUTS (Char * String) Send a string string to the console (display), directly on the control table, such as the display is directly written mode display int printf ( Char * format [, argument, ...]) Send a formatted string Output to the console (display) Use the BIOS to output int Vprintf (Char * Format, Valist param) Send formatted string Output to console (display) using BIOS Output, parameters take int CPRINTF (Char * Format [, Argument, ...]) to send formatted strings from Valist Param to output to consumers (displays), directly on control table operation, such as the display is direct write frequency Display INT VCPRINTF (Char * Format, Valist Param) Send formatted strings Output to console (display), directly on the control table, such as the display is displayed directly, the parameters take int SPRINTF from Valist Param ( Char * string, char * format [, argument, ...]) Reconnect the contents of the string String to formatted strings INT vSprintf (char * string, char * format, valist param) will string String content Written as a string after formatting, the parameter gets int RENAME (Char * OldName, Char * newname) from Valist Param to change the name of the file OldName to NewNameint IOCTL (int Handle, Int CMD [, Int * argdx, int argcx] This function is used to control input / output devices, please see the following table: ┌ - ┬───────────────────── ┐ │CMD value │ function │ ├─────────────── ──────────────────── ─ ─ │ │ │ │ │ 1 │ Settings Equipment Information │ │ 2 │ Read Argcx byte Read by Argdx │ 3 │ The address referred to argdx Write argcx bytes │ │ 4 │ In addition to handle as a device number (0 = current, 1 = A, etc.), allo the same and cmd = 2 │ │ 5 │ divided Outside the handle as a device number (0 = current, 1 = A, etc.),
Whenex │ │ │ │ Take Input Status │ │ 7 │ Take Output Status │ │ 8 │ Test Conversion; Only for DOS 3.x │ │ 11 │ Set Sharing Conflicts Reduction; DOS 3.x │ └ - ─ ─────────────────────────────────────gy / * Action) ()) ()) () executes software signals (unnecessary) INT GSIGNAL (INT SIG) executes software signals (unnecessary) int _open (char * pathname, int access) to read or write a file, press Access is to be a read file or write files, and the Access value is here - ─────────────────────────── ─ ─ │ACCESS value │ meaning │ ├──────────────────── ─ │O_RDONLY │ Read File │ │O_WRONLY │written file │ │O_RDWR │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ O_noinherit │ If the file is not passed to the subroutine, it is included │ │O_DENYALL │ only allows the current handler to access the file │ │O_DenyWrite │ only allows the file read from any other open file │ │O_DENYREAD │ only allows from any Other open files │ │O_Denynone │ allows other shared open files │ └ - ─ ─ ────────────────────────────── Pathname, int access [, int permiss]) To read or write a file, press Access to determine whether it is reading the file or writes the file, and the Access value is seen in the table. ┌──────────────────────── ───────── ─ ┐ │ACCESS value │ Significance │ ├──────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ File │ │O_WRONLY│Written File │ │O_RDWR │ │ │ │O_NDELAY│No; Neix System Compatibility │ │O_APpend│ Read Also Write, But each time you write always add │ │O_CREAT │ The file exists, this flag is useless; if there is no existence, build a new file │ │O_TRUNC │ If the file exists, the length is intercepted 0.
Attribute constant │ │O_EXCL │ unused; to Unix system compatibility │ │O_BINARY│ This flag can be displayed to open files in binary mode │ │O_TEXT │ This flag can be used to show the text to open files in text │ └─ ─ ─ ────────────────────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ (Char * filename, int permiss) establishes a new file filename and sets read and write. Permiss is read or written for file, allowing the following value S_IWRITE to write S_IREAD to allow reading, INIREAD | S_IWRITE to allow reading, write int _CREAT (CHAR * FileName, int Attrib) to establish a new file filename, and set file properties. Attrib for file properties, you can hide the following value FA_RDONLY read-only FA_HIDDEN hide the FA_SYSTEM system INT CreatNew (Char * filenamt, int attrib) to create a new file filename, and set file properties. Attrib for file properties, you can hide the following value FA_RDONLY read-only FA_HIDDEN hide the FA_SYSTEM system INT CreatTemp (Char * filenamt, int attrib) to create a new file filename, and set file properties. Attrib for file properties, you can hide the following value FA_RDONLY read-only FA_HIDDEN hide the FA_SYSTEM system int ie, the NBYTE "from the file number is written in the file number, the NBYTE" is stored in BUF INT _READ (INT HANDLE) , void * buf, int nbyte) Read NBYTE characters from the file number to Handle to store into buf, call MSDOS to operate .int Write (int Handle, Void * BUF, INT NBYTE) Put the NBYTE in BUF The character writes the file number in the file number in the file number INT _WRITE (INT HANDLE, VOID * BUF, INT NBYTE) Write the NBYTE character in the BUF to the file number for the Int Dup (Int Handle) Copy a file processing pointer Handle, returning this pointer int DUP2 (INT HANDLE, INT NewHandle) Copy a file processing pointer Handle to NewHandleint EOF (int * handle) Check if the file ends, end returns 1, otherwise returns 0long fileLength Returns the file length, Handle For the file number int setmode (int Handle, unsigned mode) This function is used to set the file number to open the file number INT getftime (int Handle, Struct FTIME * ftime) Read the file number of the file number. And save the file time in the FTIME structure, successfully returns 0,
The FTIME structure is as follows: ┌ - ────────── │Struct FTIME │ │ {│ │ unsigned ft_tsec: 5; / * second * / │ │ unsigned ft_min: 6; / * Division * / │ │ Unsigned ft_Hour: 5; / * * / │ │ unsigned ft_day: 5; / * day * / │ │ unsigned ft_month: 4; / * month * / │ │ unsigned ft_year: 1; / * year - year - 1980 * / │ │} │ └─────────────────────────── ─ ─ ─ ─ ┘┘ * ftime Rewinds the file number for the file time, new time Structure ftime. Successful returns 0. Structure ftime as follows: ┌ - ────────── ─ │ 斯truct ftime │ │ {│ │ Unsigned ft_tsec: 5; / * 秒 * / │ │ unsigned ft_min: 6; / * 分 * / │ │ Unsigned ft_Hour: 5; / * * / │ │ unsigned ft_day: 5; / * day * / │ │ unsigned ft_month: 4; / * month * / │ │ unsigned FT_Year: 1; / * Years -1980 * / │ │} │ └ - ─────────────── ─ ┘L ONG LSEEK (INT HANDLE, Long Offset, INT fromwhere) This function moves the file number of the file number of the file number to the origin of the FROMWHER. Seek_set file Switch Seek_cur Current location SEEK_END file tail long tell (int Handle) This function returns the file number of the file number to the file pointer in bytes, which is used to take the INT LOCK (INT HANDE, Long Offset, Long Length) to share the INT UNLOCK for the file. INT HANDLE, Long Offset, Long Length Opens Block Int Close (INT Handle) to Share Document Close Handle, Handle is from _CREAT, CREAT, CREATNEW, CREATTEMP, DUP, DUP2, _OPEN, OPEN A file processing obtained by calling successfully returns 0 Otherwise, returning -1, can be used for UNIX system int _close (int Handle) to turn off the files represented by Handle, Handle is from _CREAT, CREAT, CREATNEW, CREATTEMP, DUP, DUP2, _Open The file processing obtained in the Open is successfully returned. Otherwise, returning -1, can only be used for MSDOS system file * fopen (char * filename, char * type) open a file filename,
Open mode is TYPE and return this file pointer, Type can add suffix to the following string - ┬────────────────────────── Write │ Text / 2 Encord │ Jianxin / Open Old File │ ├─ ┼───────────────────── ─ ─ ─ ─ ─ ─ ─ ─ │R │ │ │ Open Old file │ │W │ 写 │ │ │ │ Add │ Text │ Open Improvement │ │R │ Read / Write │ Unlimited │ Open │ │W │ Read / write │ │ │ │ │ Building new file │ │A │ read / add │ unlimited │ 有 无 无 无 无 无 建 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新 新T, b. Plus B indicates that the document is operated in binary form, T is not necessarily used: ┌ --──────────────── │ │ │MAIN () │ │ {│ │ File * fp; │ │ │FP = FOPS.exe, "R B"); │ └────────────── ───── ─ ┘file * fdopen (int Ahndle, Char * Type) File * Freopen (Char * FileName, Char * Type, File * Stream) INT GETC (File * Stream) Reads a character from the stream stream and returns this Character INT PUTC (INT CH, File * Stream) Writes a character chint getw (file * stream) from the stream stream into an integer, error Returns EOFINT PUTW (INT W, File * Stream) Writing to stream Stream An integer int ungetc (Char C, File * Stream) returns the character C back to the stream stream, the next read character will be Cint Fgetc (File * Stream) to read a character from the stream stream and return this character INT FPUTC ( INTCH, FILE * Stream) CHAR * FGETS (CHAR * STRING, INT N, FILE * STREAM) from the stream stream in the stream StREAM (Char * String, File) * stream) Write string string to stream Stream INT FREAD (Void * PTR, int size, int nitems, file * stream) Read the NITEMS length from the stream stream to the NITEMS length SIZE STR in the PTR in Int Fwrite ( Void * Ptr, INT Size, INT NITEMS, FILE * STREAM) Write a string of NITEMs in the stream stream, string in PTR in Int fscanf (file * stream, char * format [, argument, ...]) to format In the form of a string Int Vfscanf (file * stream, char * format) from the stream stream
Valist param This is read from the stream stream in a formatted form. The parameters take int fprintf (file * stream, char * format [, argument, ...]) from the Valist Param to write a string to write a string to the format. The specified stream streamint vfprintf (file * stream, char * format, valist param) writes a string to the specified stream stream in formatted form, parameter from Valist Param (File * Street, Long Offset, int fromwhere The function moves the file pointer to the backstart item of the location indicated by FROMWHER, and the fromwhere can be the following value: seek_set file switch seek_cur Current position seek_end file tail long ftell (file * stream) function returns the current position in Stream File pointer position, by byte INT REWIND (File * Stream) Move the current file pointer Stream to the file start INT feof (file * stream) detection streaming file pointer on the end position int fileno (file * stream) Document processing on Stream Stream and Returns the file processing INT FERROR (File * Stream) Detection Stream Stream Does Writing Errors, Returns 1VOID Clearerr (File * Street) Clear Stream Stream Read / write error void setBUF (File * Stream, Char * BUF) Give Stream Specify a buffer bufvoid setvbuf (file * stream, char * buf, int type, unsigned size) Give Stream Specify a buffer BUF, size size, type Type, The value of TYPE is here. - ─ ───────────────────────── ─ ─ │ ┐ │ │ │ │ │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ├──────────────────────────────────────────────────────────────── ─ ─ ─ │_IOFBF│Fin is a complete buffer, when the buffer is When the next input operation, the next input operation will set the entire loop. When you write any data, you will completely fill the buffer before the data is written to the file. │ │_iolbf│ file is a row buffer. When buffer area is empty, the next input operation will attempt to fill the entire buffer │ │ │ buffer zone. However, at the output, whenever the new line is written to the file, the buffer was washed off. │ │_IONBF│ file is unbuffered The .buf and size parameters are ignored. Each input operation will be read directly from the │ │ │
Each output will immediately write data to the file. │ └ - ─ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┘int fclose (file * stream) Close a stream, which can be a file or device (for example, LPT1) int Fcloseall () Close all streams except STDIN or STDOUT Close a stream, and make a buffer Treatment processing, that is, the shared stream, read the contents within the buffer; written flow, write the contents of the buffer in the buffer. Successfully returned 0INT FFLUSHALL () to close all streams, and the respective buffer is processed by the target, the flow of the stream, read the contents within the buffer; the write stream, write the contents within the buffer. Successfully returned 0INT Access (CHAR * Filename, Int Amode) This function checks file filename and returns the properties of the file, the function exists in Amode, and the combination of Amode is written by the combination of the following bit. You can read 02 can be written 01 Perform (ignored) 00 files There is if FileName is a directory, the function will only determine if the directory exists to perform successful returns 0, otherwise returns -1int chmod (int permiss) This function is used to set the file filename properties Permiss can allow S_IREAD to allow reading S_IREAD to allow reading S_IREAD | S_IWRITE to allow read, write int _chmod (char * filename, int func [, int attrib]); this function is used to read or set the properties of file filename, when func When = 0, the function returns the properties of the file; when func = 1, the attribute of the function setting file is for setting file properties, attrib can use one of the following constants to hide the FA_SYSTEM system interface subroutine, the library To: dos.h, bios.hunsigned sleep (unsigned seconds) Pounte SECONDS microseconds (one percent) Int unlink (char * filename) Delete file filenameunsigned fp_off (Void Far * Farptr) This function is used to take far pointer Farptr Offset Unsigned FP_SEG (Void Far * Farptr) This function is used to set a FAR * mk_fp (unsigned seg, unsigned off) according to segment SEG and offset OFF, and construct a FAR pointer unsigned getPSP according to segment seg and offset OFF. ) The segment address of the process sequence segment, and return this address char * PARSFNM (CHAR * CMDLINE, STRUCT FCB * FCBPTR, INT OPTION) function to analyze a string, usually, for a file name, it is referred to by cmdline A command line. The file name is put in an FCB As a drive, file name and extension. FCB is specified by the FCBPTR. The value is the value of the Al text when the DOS analysis system is called .int Absread (Int Drive, Int Nsects, Int Sectno, Void * Buffer) The function function is a read-specific disk sector. The drive is the drive number (0 = a, 1 = b, etc.), and Nsects is the number of sectors to be read, and the sectno starts logo area number, buffer is the read data. Save space int Abswrite (int Drive,
INT Nsects, int SECTNO, VOID * BUFFER This function function is written in a specific disk sector, Drive is driven number (0 = a, 1 = b, etc.), NSECTS is the number of sectors to be written, SECTNO starts logo Sean code, buffer is the space for Save the space to save the data. Void getDfree (int drive, Struct DFREE * DFREEP) This function is used to take the free space of the disk, and Drive is the disk number (0 = Current, 1 = a, etc.). Function During the DFREE structure of the disk characteristics, DFreep is directed. DFree structure is as follows: ┌ --─────────────── │ │ │ │ │ {│ │ unsigned DF_AVAIL; / * Useful clusters * / │ │ unsigned df_total; / * Total cluster number * / │ │ unsigned df_bsec; / * Each sector byout the number * / │ │ unsigned DF_SClus; / * Each cluster sector * / │ │} │ └ - ───────────────────JCHAR FAR * GETDTA () Take the disk conversion address DTAVOID SETDTA (CHAR FAR * DTA) Set Disk Convert Address DTAVOID GETFAT ( INT Drive, Fatinfo * Fatblkp) This function returns file allocation table information of the specified drive Drive (0 = current, 1 = A, 2 = B, etc.) and stored in FATBLKP, the structure is as follows: ┌────── ───────── ┐ │STRUCT FATINFO │ │ {│ │ Char Fi_SClus; / * Each cluster sector number * / │ │ char fi_fatid; / * File allocation table bytes * / │ │ │ │ │ 字 字 * / │ │} │ └───────── ──────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─te ──────────┐ │struct fatinfo │ │ {│ │ char fi_sclus; / * number of clusters per sector * / │ │ char fi_fatid; / * number of bytes in the file allocation table * / │ │ int Fi_nclus; / * Number of clusters * / │ │ in 字 * / │ │} │ └─────────────────────────────────── BDOS (int dosfun, unsigned dosdx, unsigned dosal) This function calls the MSDOS system, DOSDX is the value of the register DX, and DOSAL is the value of the register AL.
DOSFUN is called the MSDOS system for the function number INT BDOSPTR (INT DOSFUN, VOID * ARGUMENT, UNSIIGNED DOSAL), and argument is the value of the register DX, and DOSAL is the value of the register AL. DOSFUN is the function number INT INT86 (Int INTR_NUM, Union Regs * INREGS, Union Regs * Outregs executes the INTR_NU number interrupt, the user-defined register value exists in INREGS, and the returned register value will be stored in Outregs after executing .int INT86X (int INTR_NUM, Union Regs * INREGS, Union regs * OUTREGS, STRUCT SREGS * SegRegs executes the INTR_NU number interrupt, the user-defined register value is stored in the structure inRegs and the structure Segregs, and the returned register value is stored in Outregs .int INTDOS (Union Regs * Inregs, Union Regs * Outregs This function performs DOS interrupt 0x21 to call a specified DOS function, the user-defined register value is stored in INREGS, and the run function will be returned to the register value in Outregs in Outregs INT INTDOSX (Union) Regs * INREGS, Union Regs * OUTREGS, STRUCT SREGS * Segregs This function performs DOS interrupt 0x21 to call a specified DOS function, the user-defined register value exists in INREGS and SegRegs, and executes the register value returned by the function. Surveying the Structure Outregs VOID INTR (INT INTR_NUM, STRUCT REGPACK * PREG) This function is an alternate 8086 software interrupt interface that generates a 8086 software interrupt specified by the parameter INTR_NUM. The function is replicated from the structure pregoner before the software is executed User-defined registers values to each register. After the software is broken, the function is copied to the value of the current registers to the structure pregon. The parameter is as follows: INTR_NUM executes the interrupt number preg to save the user-defined register value, the structure is as follows ┌ --────────────── │ {│ │ Unsigned R_AX, R_BX, R_CX, R_DX; │ │ Unsigned R_bp, R_SI, R_Di, r_ds, r_es, r_flags; │ │} │ └──────────────────────┘ function is completed, a new register value stored in the void structure preg Keep (int status, int size) Returns MSDOS in Status, but the program remains in memory, the occupied space is determined by Size .void CtrlBrk (int (* fptr) ()) Set the interrupt handler after the interrupt .void disable () disable interrupt VOID enable () allows interrupt VOID GENINTERRUPT (INT INTR_NUM) to execute the software interrupt by INTR_NUM (* getvect (int INTR_NUM)) () returns an interrupt handler for INTR_NUM For example: OLD_INT_10H = getVect (0x10); Void setVect (int INTR_NUM,
VOID INTERRUPT (* ISR) ()) Sets the interrupt code for INTR_NUM for ISR, for example: setVect (0x10, new_int_10h); Void Harden ()) Defines a hardware error handler, each When an error occurs, the program void HardResume (int RESCODE) hardware error handler Void HardRetn (INT ") hardware error handler Int Inport (Int prot) is read from the specified input port and returned to this. Word INT INPORTB (INT Port) reads a byte from the specified input port and returns this byte void output (int port, int Word) Word Word Write the specified output port Portvoid Outportb (int port, char Byte) Return the byte Byte to the specified output port portint peek (int segment) function Returns a word CHAR PEEKB (INT Segment, unsigned offset) function at the Offset function Returns a byte void Poke at the Segment: Offset INT segment, int offset, char value) Write the word value to segment: offset Void Pokeb (int segment, int offset, int value) Write byte value to segment: Offset, int RANDBRD (Struct FCB * fcbptr, int Recnt The function uses the FCB read RECCNT record in the FCBPTR to read the Reccnt function writes the RECCNT record in the FCB referred to in the FCBPTR to the Void Segread (Struct Sregs * segtbl) function. Put the current value of the segment register in the structure segtbl INT GETVERIFY () to take the inspection mark (0 = verification, 1 = verification Open) Void setver (int value) Set the current inspection status, Value is 0 indicates a closed inspection, and the current setting of the Open Test INT getcBRK () This function returns the current settings of the control interrupt detection INT setCBRK (INT VALUE) This function is used to set the control interrupt detection to switch or disconnect when Value = 0 In order to disconnect. When Value = 1, the extended error is taken for INT DOSEXTERR (Struct Doserr * EBLKP). After the DOS error occurs, this function fills the expanded error message in the Doserr structure referred to in EBLKP. This structure is defined as follows: ┌ --────────── ┐ │STRUCT DOSERR │ │ {│ │ Int EXTERROR; / * Extension error * / │ │ Char class; / * Error type * / │ │ CHAR ACTION; / * Ways * / │ │ Char Locus; / * Error Guests * / │ │} │ └─────────────────────────────── ─ ┘int Bioscom (int CMD, Char Type, INT port) This function is responsible for the communication of the data, the CMD can be the following value: 0 Communication parameters as byte byte value 1 Send Character Transmission 2 Retrieve character 3 from the communication line to the current state port for communication port , port = 0 When the communication port is COM1, Port = 1 When the communication port is COM2,
In order to transmit or receive data, the parameters when transmitting or receiving data are combined: ┌ - ─ ────────────────────────────────────── │byte value │ │ significance │byte meaning │byte value value meaning │ │ │ ├───┼─────┼───┼─────┼───┼─────┤ │0x02 │7 data │0x03 │8 data 位 │0x00 │1 stop bit │ │ │0x04 │2 stop bit │0x00 │ 无 奇 奇 │0x08 │ odd parity │ │ │0x18 │ 数 奇性 │0x00 │ 110 baud │0x20 │ │ │ │ │0x40 │300 baud │0x60 │600 baud │0X80 │1200 baud │ │ │0xa0 │2400 baud │0XC0 │4800 baud │0XE0 │9600 Baud │ │ └─ ─ ┴────────────────────────────────── ┘, for example: 0xE0 | 0x08 | 0x00 | 0x03 means that the communication port is 9600 baud, odd parity Sex, 1 stop bit, 8 data bits. Function return value is a 16-bit integer, defined as follows: 15th time timeout 14th transfer shift register empty line 13 Transfer fixed register empty 12th interrupt detection of the 11th frame Error 10th Parity Error 9th Overrive Run Error 8th Data Ready 7th Receiver Signal Signal Detection of the 6th Ring Indicator Fifth Bit Data Setting Ready 4th Bit Clear Send 3rd Bit δ Receiver Line Signal Detector 2nd drop edge annular detector No. 1 Δ data setting ready 0th bit Δ cleaning Send INT BiosDisk (int CMD, int DRIVE, INTHEAD, INT TRACK, INT Sector, Int nsects, void * buffer This function is used to make a certain operation for the drive, the cmd is the function number, Drive is the drive letter (0 = A, 1 = B, 0x80 = C, 0x81 = D,
0x82 = e, etc.). Cmd can be the following value: 0 Reset Soft disk system. This forces the drive controller to perform hard reset. Ignore all other parameters. 1 Return the last hard disk operation status. Ignore all other parameters 2 read one or more Disk sector to memory. The sector read is given by Head, Track, Sector. The sector number is given by nsects. Reading 512 bytes of data of each sector into buffer 3 writes from memory read data to one or more sectors. The sector written by Write is given by Head, Track, and Sector. The sector number is given by nsects. Write data in Buffer, 512 bytes per sector. 4 Test one or more sectors. Start the sector by Head, Track, Sector. The sector number is given by nsects. 5 Format a track, which is given by Head and Track. Buffer points a table to the sector header written on the specified track. The following CMD values are only allowed for XT or AT microcomputers: 6 formatted a track, and set a bad sector flag. 7 Format the beginning of the drive on the specified track. 8 Returns the current drive parameter, the drive information returns to the buffer (indicated in four bytes). 9 Initialize a pair of driver characteristics. 10 Perform a long reading, each sector reading 512 plus 4 additional bytes 11 Perform a long writing, each sector write 512 plus 4 additional bytes 12 Perform a disk lookup 13 alternate disk reset 14 read fan District buffer 15 write sector buffer 16 Check that the specified drive is ready 17 Review Drive 18 Controller RAM Diagnostics 19 Drive Diagnostics 20 Controller The internal diagnosis function returns the status byte of the following bits: 0x00 operation success 0x01 bad Command 0x02 address tags Can't find 0x04 records Can't find 0x05 Reset failure 0x07 Drive Parameters Activity Failure 0x09 Attempt DMA At 64K Limit 0x0B Check DBR Tag 0x10 Direct ECC Reads 0x11 ECC Correction Data Errors (Note It Not an error) 0x20 Controller Failure 0x40 Finding Failed 0x80 Response Link Failed 0xBB Appearance Unfained Error 0xFF Read Operation Fail INT Biodquip () Check Device, Function Returns a Byte, the byte represents a message, as follows: The 15th printer number 14th printer number 13th unused 12th bit connection game I / O No. 11 RS232 port number 8th unwinding the 7th-bit soft disk number, 00 is No. 1 drive 01 is the No. 2 driver, 10 is the No. 3 driver, 11 is the No. 4 driver 5th bit initialized the 4th display mode 00 is not used, 01 is 40x25bW color display card 10 is 80x25bw color display card, 11 is 80x25bw Monochrome The third random memory capacity of the third mother housing is displayed, 00 is 16K, 01 is 32K, 10 is 48K,
11 is 64K 1-bit floating point shared processor 0th bit From a soft disk Guide Int Bioskey (int CMD) This function is used to perform various keyboard operations, determined by the CMD. The CMD can be the following value: 0 Returns the next button on the keyboard. If the low 8 bits are non-0, it is an ASCII character; if the low 8 bits are 0, return the expanded keyboard code. 1 Test if the keyboard can be used to read. Returns 0 indicates that there is no key to be available; otherwise returns the next knock key value. The knock key itself keeps the value returned by the Bioskey, which is 0, the CMD value of the next call. 2 Returns the current keyboard status, which is represented by each bit of an integer, see the table: ┌ - ┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │ 0 0 意 意 意 1 1 意 意 意 意 意 状态 ┼ ┼ 状态 状态 ┼ ┼ 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态│ 大写 │ │ 5 │ Digital Status, Numlock Lights Light │ Corbital Status, Numlock Lights Off - │ │ 4 │Scrollock Lights Light │Scrolllock Lights Off │ │ 3 │ALT Press │ALT Unpaid │ │ │CTRL Press Lower │CTRL unpub │ │ 1 │ left Shift Press │ Left Shift Unforce │ │ 0 │ Right Shift Press │ Right Shift Unforgettable │ └ - ┴──────── ┴──────────── ─ ┘int biosmemory () Returns the memory size, in K.int BiospRINT (INT CMD, INT BYTE, INT Port) Controls the input / output of the printer. Port is the printer number, 0 is LPT1, 1 is LPT2, 2 is LPT3 and other CMDs may be the following value: 0 print characters, send character BYTE to the printer 1 Printer port Initialization 2 Read the printer status function Return value consisting of the following bit value indicating the current printer status 0x01 device Time timeout 0x08 input / output error 0x10 selected 0x20 Paper 0x40 Approve 0x80 Not Busy INT Biostime (int CMD, Long NewTime) Timer Control, cm D is the function number, and the current value of the following value 0 function returns the timer 1 Set the timer to the new value NewTimeStruct Country * Country (int countrycmode, struct country * countryp) This function is used to control relevant information about a country. Such as date, time, currency, etc. If countryp = -1, the current country is set to countrycode values (must be non-0). Otherwise,
The country-related information poised by Countryp: (1) Current country (if countrycode is 0 or 2) by CountryCode, the country is defined as follows: ┌─────────────────────────────────────────────────────────────────────── ────────── │ │ │ {│ │ __date; / * Date format * / │ │ CHAR CO_CURR [5]; / * Currency Symbol * / │ │ Char Co_thsep [ 2]; / * Digital Division * / │ │ CHAR CO_DESEP [2]; / * Dadix points * / │ │ CHAR CO_DTSEP [2]; / * Date Separator * / │ │ CHAR CO_TMSEP [2]; / * Time Split符 * / │ │ CHAR CO_CURRSTYLE; / * Monetary Form * / │ │ CHAR CO_DIGITS; / * Valid Number * / │ │ INT (FAR * CO_CASE) (); / * Event Processing Function * / │ │ CHAR CO_DASEP; / * Data separator * / │ │ char CO_FILL [10]; / * Supplemental character * / │ │} │ └───────────────────── ─ ┘ CO_DATE representative The date format is: the currency display of the value of the value of the month, the value of CO_CURRSTRLE, 0 months, 0 currency symbols before the value, the middle spaceless 1 currency symbol After the value, there is no space 2 currency symbol Before the value, there is a space 3 currency symbol after the value, there is a space function function in the middle, and the function library is string.h. Mem.hmem ... Operating storage array void * Memccpy (Void * Destin, Void * Source, unsigned char ch, unsigned n) void * Memchr (Void * S, Char ch, unsigned n) void * Memcmp (Void * S1, Void * S2, unsigned n) int MemicMP (Void * S1, Void * S2, unsigned n) void * Memmove (Void * Destin, Void * Source, unsigned n) void * Memcpy (Void * Destin, Void * Source, unsigned n) Void * MemSet (Void * S, CHAR Ch, UNSIGNED N) These functions, all members of the MEM ... series are operated in all these functions. In all these functions, arrays are N-bytes long .Memcpy Copy a n-byte from Source Blocks to Destin. If the source block and the target block are overlap, select the copy direction to correctly copy the overlay bytes. MEMMOVE is the same as Memcpy. MEMSET places all the words S in byte CH.s array The length is given by n. Memcmp is exactly the two strings S1 and S2 for N-byte lengths. Some functions are comparing bytes in unsigned characters, so MEMCMP ("0xFF", "/ x7f", 1) returns The value is greater than 0.MEMICMP compares the first n bytes of S1 and S2,
Regardless of the character capital or lowercase .Memccpy, from the source copy byte to Destin. The following is the following case: (1) Character CH preferred copy to Destin. (2) N bytes have been copied to destin.Memchr pair characters CH Retrieves the previous n bytes of the S array. Return Value: Memmove and Memcpy Return to Destin MemSet Returns Memcmp and Memicmp─ ─ ─ ─ ┬ S1
Const Char * S2, SIZE_T MAXLEN) Compare Strings S1 and S2 Pre-Maxlen Character CHAR STRNSET (CHAR * S, INT CH, SIZE_T N) in S2 Place the first n characters of the string S in CHAR STRPBRK (Const CHAR * S1, ConST Char * S2) Scan string S1 and returns a character string of the number of characters all in S1 and S2, and a string of a given character C is finally displayed. Schar Strrev (Char * S) All characters in the string S are rearranged in order, and return all characters in a string S to one in one string S, INT CHAR STRSET (CHAR * S, INT CH). The character chsize_t strspn (const char * s1, const char * s2) Scan string S1 and returns a character number of characters in S1 and S2 CHAR STRSTR (Const Char * S1, Const Char * S2) Scan string S2, and returned to the first time S1 position CHAR STRTOK (CHAR * S1, Const Char * S2) Retrieving strings S1, the string S1 is separated by a delimiter defined in the string S2 (char *) s) All lowercase letters in the strings S are converted into uppercase letters and return the converted string storage distribution subroutine, the library is dos.h, alloc.h, malloc.h, stdlib.h, process . Hint Allocmem (unsigned size, unsigned * seg) Using DOS assignment idle memory, Size is allocated memory size, SEG is allocated memory pointer INT FreeMem (unsigned seg) release the memory allocated by allocmem, SEG is the specified memory Pointer int setblock (int seg, int newsize) This function is used to modify the assigned memory length, and the seg is the memory pointer that has been allocated, and newsize is the new length Int brk (void * endds) This function is used to change the division. The number of spaces for the data segment of the calling program, the new space end address is Enddschar * SBRK (INT INCR) This function is used to increase the amount of space assigned to the data segment assigned to the calling program, increase the space of the INCR byte unsigned long coreleft. This function returns the length of the unused storage area, assigns the NELEM length of ELSIZE in bytes in bytes, and returns the pointer of the assigned memory void * malloc (unsigned size) Allocate the memory space of the SIZE byte and return the pointer Void Free (Void * Ptr) allocated in the allocated memory release the memory allocated, the memory of the memory to be released is Ptrvoid * Realloc (Void * PTR, unsigned new.comize) The size of the memory is allocated, the PTR is a pointer to which the memory area is allocated, and newsize is the new length, returns the allocated memory pointer .long farcoreleft () This function returns the length of the stored storage area in the far, with bytes For the unit Void Far * Farcalloc (unsigned long sets, unsigned long setsz) from the far-reactors allocated unit length of Units, and returns the pointer Void * Farmalloc (unsigned long size) allocated by the assigned memory to allocate SIZE Space, and return allocated memory pointer Void Farfree (Void Far * Block) Releases the memory space previously assigned from the far,
The pointer to the far-resembled memory to be released is the size of the allocated far-memory, the block, which blocks allocated with the memory area, the block is a new length, and newzie is the new length. Returns allocated memory pointer time dates function, the library is Time.h, DOS.H In the time date function, the mainly used structure has the following: Total time date Storage structure TM ┌────── ─────────────── ┐│StructTM ││ {││ inTTm_sec; / * second, 0-59 * / ││ IntTm_min; / * points, 0-59 * / ││ INTTM_HOUR; / *, 0-23 * / ││ INTTM_MDAY; / * Number, 1-31 * / ││ INTTM_MON; / * Month, 0-11 * / │ ■ IntTm_Year; / * Since 1900, the number of days * / │ Int TM_WDAY; / * Since Sunday 0-6 * / ││ int TM_YDAY; / * Since January 1st, 0-365 * / ││ INTTM_ISDST; / * Whether to use summer time, it is positive * / │ │ │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── << ─────────── ─ ┐│Struct Date ││ {││ Int Da_Year; / * Since 1900 Number * / │ CHAR Da_DAY; / * Number * / ││CHAR Da_MON; / * Month 1 = Jan * / ││} │ └──────────────────────────────── Time storage structure Time ┌ - ──────── ─ ┐│truct time ││ {│ │ unsigned char Ti_min; / * 分 * / │ │ unsigned char Ti_Hour; / * Hours * / ││ unsigned char Ti_hund; │ │ unsigned char Ti_sec; / * 秒 * / ││ │ └─────────────────────── ─ ─ ┘char * ctime (long * clock) This function puts the clock The time (if the time returned by the function time) is converted into a string of the following format: MON NOV 21 11:31:54 1983 / N / 0CHAR * ASCTIME (STRUCT TM * TM) This function puts the specified TM structure class String of the following format: MON NOV 21 11:31:54 1983 / N / 0Double DIFFTIME (Time_t Time2, Time_t Time1) Calculate the time gap between TIME2 and TIME1 (in seconds) StructTM * GMTIME (long * clock) This function converts the time (such as the time returned by the function time) into Greenwich time, such as the time returned by the function time.