The classification function, the function library is CTYPE.H INT ISALPHA (INT CH) if CH is the letter ('A' - 'Z', 'A' - 'Z') Returns a non-0 value, otherwise returns 0 ISALNUM (INTC If CH is the letter ('A' - 'Z', 'A' - 'Z') or numbers ('0' - '9'), return non-0 value, otherwise returns 0 int ISASCII (INT CH) if Ch Is a character (0-127 in the ASCII code) Returns a non-0 value, otherwise it returns 0 int ISCNTRL (INT CH) If the CH is a waste character (0x7f) or normal control character (0x00-0x1f), return non-0 value, otherwise returns 0 INT isdigit (int CH) If the CH is a number ('0' - '9') returns a non-0 value, otherwise returns 0 int ipegraph (int CH) if CH is a printable character (excluding space) (0x21-0x7e) Returns a non-0 value, otherwise it returns 0 ISLOWER (INT CH) if the ch is lowercase letters ('A' - 'Z') returns a non-0 value, otherwise returns 0 int isprint (int CH) if CH is printable characters (including Space) (0x20-0x7e) Returns a non-0 value, otherwise returns 0 int IPUNCT (INT CH) Returns a non-0 value if the CH is the punctuation character (0x00-0x1f), otherwise returns 0 int ISSPACE (INT CH) if ch is a space ( ''), Horizontal tabs ('/ t'), Enter ('/ R'), Paper Wavel ('/ f'), Vertical Table ('/ V'), Repair (' / n '), return a non-0 value, otherwise returning 0 int isupper (int CH) If the CH is uppercase letters (' a '-' z ') returns a non-0 value, otherwise returning 0 int isxdigit (int CH) if ch is 16 Enter ('0' - '9', 'A' - 'F', 'A' - 'F') Returns Non 0 Values, otherwise returns 0 int 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 letter (' A ' -'Z')
Mathematical functions, the function library is Math.h, stdlib.h, string.h, float.h int ABS (INT i) Returns the absolute value Double Cabs of the entire parameter i Double Cabs (Struct Complex Znum) Returns the absolute value of the recoverable znum Fabs (double x) Returns the absolute value of the double precision parameter x Returns the absolute value Double Exp (Double X) of the long integer parameter N Returns Double Frexp (Double Value, Int * EPTR) Returns the value of x in value = x * 2n, n Store Double LDEXP (Double Value, INT Exp) in EPTR; Returns Value * 2EXP Double Log (Double X) Returns Double Log10 (Double X) Returns LOG10X Double Pow (Double X, Double Y) Returns the value of XY Double Pow10 (INT P) Returns 10p Double SQRT (Double X) Returns the X Return Double ACOS (Double X) Returns X's anti-rest COS- 1 (x) value, X is the arc Double Asin Returns the X-1 (X) value of the X, X is the arc Double ATAN (Double X) Returns an anti-fixed TAN-1 (X) value of X, X is an arc Double ATAN2 (Double Y, Double X) Returns Y / X of the UF Tan-1 (X) value, Y X is the curve COS (X) value of the x-race Double Cos (Double X), X is Arc Double SIN (Double X) Returns the sinusoidal SIN (X) value of the X, X is the orthosis TAN (X) value returns X of X, X is the two songs that returns the arc Double Cosh (Double X). The cosine COSH (X) value, X is a dual sine SINH (X) value returns X of the radians Double SINH (Double X), and X is a double-diced Tanh (X) value returns x-x, X) value, X) value, X. For the arc Double Hypot (double x, double y) Returns the length (z) of the right angle triangle, X and Y are the length of the straight angle, Z2 = x2
Y2 Double CEIL (Double X) Returns the minimum integer floor (double x) of the NOD (Double X) Returns the maximum integer void Srand (unsigned seed) initialization random number generator 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 to decompose the double-precision value value to the mantissa and Double Fmod (double x, double y) Return to X The remainder of / y 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) Converting the string NPTR 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 float Value converts the 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 returned to the buf pointer char * ULTOA (unsigned long value, char * string, int RADIX) converts unsigned integer values into a string and returns This string, RADIX is converted to the conversion CHAR * LTOA (Long Value, CHAR * STRING, INT RADIX) converts long-intensive value VALUE into a string and returns the string, and Radix is based on the base char * ITOA ( INT Value, Char * String, Int Radix converts the integer value into a string to store String, Radix is the base Double Atof (Char * nptr) using the base Double ATOF (Char * nptr) when converting PTR conversion into a double-precision number, return this number, error Returns 0 int atoi (char * nptr) Converting the string nptr into an integer number, return this number, error Returns 0 long atol (char * nptr) will string NPTR conversion to the total number, and return this number, the error returns 0 Double StRTOD (Char * Str, Char ** Endptr) converts the string STR into double precision, returns this number, Long Strtol (Char * Str, Char ** endptr, int base converts the string STR conversion to the total number, returns this number, int match (Struct Exception * e) user modifies mathematical error return 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 returns the original floating point status void _fpreset () Reproduction Floating point mathematics package unsigned int _Status87 () Returns floating point status word
Catalog functions, where the library is dir.h, dos.h int chdir (char * path) the specified directory path (such as: "C: // WPS") becomes the current working directory, the successful return 0 int findfirst ( Char * pathname, struct ffblk * 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 is a structure for the specified save file information The definition is as follows: ┏┏━━━━━━━━━━━━━━━━┓┓┓┓┓━━━━━━┓┓ ┓Struct Ffblk ┓ ┓ h {cer ff_reserved [21]; / * DOS reserved word * / char ff_attrib; / * File attribute * / INT ff_ftime; / * File time * / INT ff_fdate; / * File date * / f FF_FSIZE; / * File length * / cer ff_name [13]; / * file Name * /}} ┗┗━━━━━┛┛━━━━━━━━┛┛┛┛━ 为 为 为 为 为 为 属 属 属┏ 代┏ 代 代 代 代 代━━━━━━━━━━━ ━━━━ ┓ ┓ _ _ _ l 卷 号 号 _ _ 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 文件 ┗ 文件 ┗ 文件 ┗ ┻ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┗ ┛ ┛ ┛: struct ffblf; findfirst ("*. Wps", & ff, fa_rdonly); int FindNext (Struct Ffblk * ffblk) Repeats FindirSt files, successfully returns 0 void fumege (char * path, char * drive, char * DIR, Char * name, char * ext) This function is expanded by the disk DIR (/ TC, / BC / LIB, etc.), the file name Name (TC, WPS, etc.), file name Name (TC, WPS, etc.). Ext (.exe, .com, etc.) form a file store and PATH. INT FNSPLIT (Char * path, char * drive, char * dir, char * name, char * ext) This function breaks down the file name PATH into Drive DRIVE (C:, A:, etc.), path DIR (/ TC, / BC / Lib, etc.), file name Name (TC, WPS, etc.), extension ext (.exe, .com, etc.) and store into corresponding variables. INT getCurdir (int DRIVE, CHAR * DIREC) This function returns to specify The current working directory name of the drive. Successfully returned 0 Drive Specified drive (0 = Current, 1 = A, 2 = B, 3 = C, etc.) DIREC Save Variables of the Specifies Drive Current Work Path Char * getCwd (Char * BUF, IINT N) This function takes the current work The directory is stored in BUF until the N-byte length is long. Error Returns NULL INT GETDISK () Take a drive that is currently in use, returns an integer (0 = a, 1 = B, 2 = C, etc.) int SetDisk INT Drive) The drive drive to use (0 = a, 1 = b, 2 = c, etc.), returns to build a new directory Pathname using the total number of drives, and successfully returns 0 int RMDir (charr * Pathname Delete a directory PathName, successfully returned 0 Char * mktemp (char * template) Constructing a file name not in a current directory and stores a file file file file file file file file file file file file file in TemPlate, this Function uses DOS's path variable, no files are found to return NULL
Process functions, the function library is stdlib.h, process.h void abort () This function writes a termination information in stderr by calling _exit with exit 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 [])
The EXEC function is loaded and runs the program Pathname and passes the parameter arg0 (arg1, arg2, argv [], envp []) to the subroutine, error returns -1. In the Exec function family, the suffix L, V, P, E are added to EXEC, and the specified function will have some operational capabilities. When there is suffix P, the function can use the DOS's PATH variable to find the subroutine 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 ... Run 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 [])
The spawn function is running the subroutine Pathname in the MODE mode and passes the parameter arg0 (arg1, arg2, argv [], envp []) to the subroutine. Error returns -1 Mode to run mode: Mode is represented in subroutine After running, return this program P_NOWAIT to run this program (not available) p_overlay while running the program in the subroutine, indicating that the subscriber is added to the spawn function family, suffix L, V, p, and e add to the spawn, When the specified function will have some operace with a suffix P, the function uses DOS's PATH to find the subroutine file L. The number of parameters passed by the function is fixed. V, the number of parameters passed is not fixed. E, Specifying parameter ENVP can be passed to a subroutine, allowing to change the subroutine running environment. When the suffix E, the subroutine uses the environment of this program.
INT System (Char * Command) passes the MSDOS command Command to DOS execution of the converter subroutine, the library is math.h, stdlib.h, ctype.h, float.h char * ECVT (Double Value, int NDIGIT, INT * DECPT INT * SIGN converts 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 into a string and returns the string char * GCVT (Double Value, Int NDIGIT, CHAR * BUF) converts the number Value into a string and returned to BUF's pointer char * ULTOA (unsigned long value, char * string, int Radix) will not be symbolically integrated The number Value converts the string and returns the string, and RADIX uses the base char * LTOA (Long Value, Char * String, INT RADIX) for the conversion, converts long-interanging value VALUE into a string and returns the string, RADIX is The base char * ITOA (int value, char * string, int RADIX) is converted into strings to store String, and Radix is converted to a string NPTR to double precision when the base number Double ATOF (Char * nptr) is converted into a double precision. Number, and return this number, the error returns 0 int atoi (char * nptr) converts the string nptr into an integer number, returns this number, error Returns 0 long atol (char * nptr) converts the string NPTR conversion growth integer Number, and return this number, the error returns 0 Double StRTOD (Char * Str, Char ** Endptr) converts the string STR to the 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 TOASCII (INT C) Returns the corresponding ASCII INT TOLOWER (INT CH) If CH is uppercase letters ('A' - 'Z') returns the corresponding Small-write letters ('A'-' Z ') INT _TOLOWER (int CH) Returns CH corresponding lowercase letters (' A ' -'z ') INT Toupper (int CH) If CH is lowercase letters (' a '-' z ') returns the corresponding uppercase letters (' a'- 'z') int _toupper (int CH) Returns CH corresponding uppercase Letters ('A' - 'Z')
Diagnostic function, the function library is assert.h, Math.h void assert (int test) macro, if the test test fails, display an information and terminating the program without returning VOID PERROR (char * String) This function will display the most recent error message, format, string string: Error message CHAR * STRERROR (CHAR * STR) This function returns the most recent error message, format, string Str: error message int match (STRUCT EXCEPTION * E) User Modify Mathematical Error Return Information Functions (Nothing Use) Double _Matherr (_Mexcep Why, Char * Fun, Double * Arg1p, Double * Arg2p, Double Retval) User Modify Mathematical Error Return Information Function (no need to use ) Enter the output subroutine, the library is IO.H, Conio.h, Stat.h, dos.h, stdio.h, sternal.h
INT kbhit () This function returns the recently knocked button int FGETCHAR () reads a character from the console (keyboard), displayed on the screen () reads a character from the console (keyboard), not displayed on the screen Int PUTCH () Write a character int GETCHAR () from the console (keyboard) to the console (keyboard), displaying a character INT getche () from the console on the screen Int Putchar () (Keyboard) Read a character, displayed on the screen INT UNGETCH (INT C) Returns the character C back to the console (keyboard) CGETS (Char * String) from the console (keyboard) read the string in string in the string Int Scanf (char * format [, argument ...] reads a string from the console, assigns each parameter, using the BIOS to output int vscanf (char * format, valist param) from the console into a string, Assign each parameter, using the BIOS for output, the parameters acquire int CSCANF (Char * Format [, Argument ...] from the Valist Param, read a string from the console, assigning each parameter, directly to the console Operation, such as the display when the display is displayed when the character is displayed, INT SSCANF (Char * String, Char * FORMAT [, Argument, ...]), assigns VSSSSSSCANF for each parameter, respectively, respectively. Int vsscanf (char * String, Char * Format, Vlist Param This is assigned to each parameter, and the parameters are assigned from the VList param to the console (display), using BIOS. Output Void CPUTS (Char * String) Sends a string string to the console (display), directly on the control table, such as the display is the direct write-frequency mode display int printf (char * format [, argument, ...]) Format string output to the console (display), using the BIOS to output int vprintf (char * format, valist param) Send formatted string output to the console (display), use BIOS to output, participate The number from the Valist Param to send the Int CPrintf (Char * Format [, ARGUMENT, ...]) Send a format string to output to the console (display), directly on the control table, such as the display is directly write-frequency mode display INT VCPRINTF (Char * Format, Valist Param Send formatted strings Output to console (display), directly on control table operation, such as displaying direct write-frequency mode, parameter from Valist Param, Int Sprintf (Char * String , char * format [, argument, ...]) Reconnect the contents of the string String to formatted strings INT vSprintf (char * string, char * format, valist param) Re-write the contents of the string String as format After the atriation, the parameters are changed from the Valist Param to change the name of the file oldName to NewName IOCTL (Int Handle, Int CMD [, Int * Argdx, Int Argcx]). If the function is used to control the input / output device, please see the table below:
┌ - ┬──────────────────── ─ │CMD value │ function │ ├──────── ──────────────── ┤ │ 0 │ Remove Equipment Information │ │ 1 │ Settings Equipment Information │ │ 2 │ Put the argcx byte by Argdx Address │ │ 3 │ The address referred to argdx Write argcx bytes │ │ 4 │ In addition to the handle as a device number (0 = current, 1 = a, etc.), both CMD = 2 │ │ │ 5 │ In addition to handle as a device number (0 = current, 1 = A, etc.), alliances with cmd = 3 │ │ 6 │ Take Input Status │ │ 7 │ Take Output Status │ │ 8 │ Test Rechangeability; only for DOS 3.x │ │ 11 │ set conflict of sharing conflicts; only DOS 3.x │ └ - ─ ──────────── ───────── ─ ┘ int (* Ssignal (int SiG, int (* action) () executes software signals (unnecessary) INT GSIGNAL (INT SIG) executes software signals (no Useful
INT _OPEN (CHAR * PATHNAME, INT Access) to open a file for reading or writing, press Access to determine whether reading file or write files, Access values see the table below - ────────── ────────── ─ ┐ │ACCESS value │ │ ├──────────────────────────── │O_RDONLY │ Read File │ │O_WRONLY │ │ │O_RDWR │ │ │ │O_NOINHERIT │ If the file is not passed to the subroutine, it is included │ │O_Denyall │ only allows the current handleable file │ │O_Denywrite │ Allows from any other open file read │ │O_DENYREAD │ Allows from any other open file │ │O_DENYNONE │ allows other shared files │ └─────────────────────── ─────────── ─ ┘ ┘ ┘ ((int permiss) For reading or writing, pressing a file, press Access to determine whether reading file or write files, Access See the table below - ─ ────────────── ─ ─ │ACCESS │ Significance │ ├───────── ───────── ─ ┤ │O_RDONLY│T reading file │ │O_WRONLY│ 写 文件 │ │O_RDWR │ │ │ │O_NDELAY│No; Neix System Compatible │ │O_APpend│ 即 Read Also written, but each time you write always add │ │O_CREAT │ if the file exists, this flag is useless; if there is no existence, the new file │ │O_TRUNC │ If the file exists, the length is 0, the property is unchanged │ │O_EXCL │ unused; BNTRY │ │O_BINARY│ This flag can be displayed to open files in binary mode │ │O_TEXT │ This flag can be used to give a text mode to open files │ └───┴ ───────────────── ┘ Permiss For the file attribute, the following values: s_iwrite allows you to write s_iread allowed to read S_IREAD | S_IWRITE to read, write int Creat (char * filename INT Permiss, build a new file filename, and set 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 the file number to store the NBYTE, directly 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 in the file number, 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 NewHandle Int EOF (INT * HANDLE) Check if the file ends, end returns 1, otherwise returns 0 long fileLength Returns the file length Handle is the time for the file number for the file number Int setmode (int Handle, Unsigned Mode) to set the file number to open the file number INT getftime (int Handle, Struct ftime * ftime) Read the file number for the file number And save the file time in the FTIME structure, successfully returned 0, the FTIME structure is as follows: ┌───────────── │Struct FTIME │ │ {│ │ unsigned ft_tsec: 5 ; / * Second * / │ │ unsigned ft_min: 6; / * 分 * / │ │ unsigned ft_Hour: 5; / * * / │ │ unsigned ft_day: 5; / * day * / │ │ unsigned ft_month: 4; / * Month * / │ │ UNSIGNED FT_Year: 1; / * Years -1980 * / │ │} │ └──────────────── ─ ┘ Int setftime (int Handle, Struct FT IME * ftime) Reword file number is the file time of Handle, the new time is in the structure ftime. Successful returns 0. Structure ftime as follows: ┌────────────── ─ │STRUCT 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 * / │ │} │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┘ LONG LSEEK (INT HANDLE, Long Offset, Int fromwhere) This function moves the file number to 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, in bytes Int isatty (int Handle) This function is used to take the type of de Lock (INT HANDE, Long Offset, Long Length) to sharing the file to block Int Unlock (int Handle, Long Offset, Long Length Opens blockade shared by file
INT Close (int Handle) Close the file processing represented by Handle, handle is a file processing obtained from _CREAT, CREAT, CREATNEW, CREATTEMP, DUP, DUP2, _OPEN, and one of the options to be called successfully 0 Otherwise, returns -1, Can be used in Unix System INT _CLOSE (INT Handle) to turn off the file processing represented by Handle, handle is from _CREAT, CREAT, CREATNEW, CREATTEMP, DUP, DUP2, _OPEN, and one of the files obtained in one of the options to be successfully returned to 0 otherwise Return -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 a suffix to the following string. ┬─────────────────── ─ ─ │TYPE│Express │ Text / 2 credit │ Building / Open Old File │ ├──────── ─ ┼─────────────── ─ │ │ │ │ Open Old File │ │W │ 写 │ │ │ │ │ │ │ │ Text │ Open the unwanted │ │R │ read / write │ unlimited │ Open │ │W │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ If you open, you will open it. ┴──────────────────────── ┘ 加 的 suffix is 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 ch INT GETW (File * Stream) from the stream stream into an integer, error Returns EOF INT PUTW (Int W, File * Stream) Stream Stream Write an integer int ungetc (Char C, File * Stream) Returns the character c back to the stream stream, the next read character will be C int FGetc (File * Stream) to read a character from the stream stream and return this character. INT FPUTC (INT CH, File * Stream) CHAR * FGETS (CHAR * STRING, INT N, FILE * STREAM) from Stream Stream from the stream stream (char *) String, File * Stream) Write string string to stream Stream INTFREAD (Void * PTR, int size, int nitems, file * stream) reads NITEMS in the stream stream to store NITEMs in a string in the PTR INT FWRITE (Void * PTR, int size, int nitems, file * stream) writes a string of NITEMS lengths in the stream stream, string in PTR in Int fscanf (file * stream, char * format [, argument , ...]) read a string int vfscanf (file * stream, char * f in the format form) from the stream stream (file * stream, char * f) ORMAT, VALIST PARAM, reads a string from the stream stream in a formatted form, and the parameters take int fprintf (file * stream, char * format [, argument, ...]) from the Valist Param to form a string in formatting. Write the specified stream Stream Int vfprintf (file * stream, char * format, valist param) to write a string to the specified stream Stream, parameter from Valist Param (File * Street, long offset The int.comwhere function moves the file pointer to the backstart item by the file pointer, fromwhere can be the following value: seek_set file switch seek_cur Current location seek_end file tail long ftell (file * stream) function Return to Stream The current file pointer position, with byte indicating INT REWIND (File * Stream) to move the current file pointer stream to the beginning INT feof (file * stream) detection streaming file pointer on the end position int fileno (file * Stream) Replace the file processing on the stream, and return to the file processing INT FERROR (File * Stream) Detection Stream Stream Does Writing Error,
If there is a mistake, return 1 Void Clearerr (File * Stream) Clear Stream, readbuf (File * Stream, Char * BUF) on Stream, specify a buffer buf void setvbuf (file * stream, char * buf) , int type, unsigned size) Give Stream Specifies a buffer BUF, size size, type Type, Type's value see the table ┌ - ─ ───────────── ──────────── ─ ┐ │TYPE │ │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ───────── ─ ┤ │_IOFBF│Fable is a full buffer, when the buffer is empty, the next input operation will attempt to fill the entire loose │ │ │ 区. When output, any data Before writing to the file, you will completely fill the buffer. │ │_iolbf│ file is a row buffer. When the buffer is empty, the next input operation will still try to fill the entire loose │ │ │ 区. However, when output, every When the new line is written, the buffer is cleaned. │ │_ ionbbf│ file is unbuffered .buf and size parameters are ignored. Each input operation will directly read directly from │ │ │-read, each The output will immediately write the 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 turn off a stream, and processing the buffer processing That is, the stream is read, read the contents of the stream into the buffer; the write stream, write the contents within the buffer. Successfully returned 0 int fflushall () Close all streams, and conveys the respective buffer works processing, that is, the stream is read, and the content is read into the buffer; the write stream, write the contents in the buffer. Successfully Returns 0 INT Access (CHAR * FileName, Int Amode) This function checks file filename and returns the properties of the file. The function exists in Amode. Amode is written by the combination of the following bits. You can read 02 can be read. 01 Perform (ignored) 00 file existence If FileName is a directory, the function will only determine if the directory exists to perform successful returns 0, otherwise returns -1 int chmod (int permiss) This function is used to set file filename The attribute Permiss can allow the following value S_IWRITE to write s_iread to allow reading S_IREAD | S_IWRITE to read, write int _chmod (Char * filename, int func [, int attrib]); this function is used to read or set the properties of the file filename, When FUNC = 0, the function returns the properties of the file; when func = 1, the attribute of the function sets the file is set to one of the following constants, FA_RDOONLY read-only FA_HIDDEN hide the FA_System system.
Interface subroutine, the function library is Os.h, Bios.h unsigned sleep (unsigned seconds) Pause Seconds microseconds (one percent) Int unlink (char * filename) Delete file filename unsigned fp_off (Void Far * Farptr) This function is used to take the offset of far pointer FARPTR UNSigned FP_SEG (Void Far * Farptr) This function is used to set the segment value Void Far * mk_fp (unsigned seg, unsigned off) according to segment seg and offset according to segment SEG and offset. OFF constructs a segment address of the FAR pointer unsigned getpsp () applying sequence segment prefix, and returns this address char * PARSFNM (CHAR * CMDLINE, STRUCT FCB * FCBPTR, INT OPTION) function to analyze a string, usually, for a file name Say, it is a command line referred to by cmdline. The file name is put into a FCB as a drive, file name and extension. Fcb is specified by FCBPTR. Option parameter is the value of the DOS analysis system, Al text value Int Absread (int DRID * BUFFER) This function function is read a specific disk sector, Drive is the drive number (0 = a, 1 = b, etc.), Nsects is the sector to read. Number, sectno starts logical sector number, buffer to save space for the read data INT Abswrite (int rouffer) This function is written to write specific disk sectors, Drive is drive letter (0 = a, 1 = b, etc.), Nsects is the number of sectors to be written, and SECTNO is the logical sector number starting, and Buffer is the space for Save the space Void getDfree (int Drive, Struct Dfree * DFreeP) this function. Used to take the free space of the disk, Drive is a disk number (0 = Current, 1 = A, etc.). The function is the DFREE structure of the disk characteristic by DFreeP. DFree structure is as follows: ┌ --─────── ────────── ┐ │STRUCT DFREE │ │ {│ │ unsigned df_avail; / * Useful cluster number * / │ │ unsigned DF_T OTAL; / * A total of total clusters * / │ │ unsigned df_bsec; / * Each sector byte number * / │ │ unsigned df_sclus; / * Each cluster sector * / │ │} │ └─── ──────────────────Tu Char Far * getdta () Take the disk conversion address DTA Void SetDTA (Char Far * DTA) Set Disk Conversion Address DTA Void Getfat (int Drive, Fatinfo * Fatblkp) This function returns the 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 Assignment Table bytes * / │ │ in _nclus; / * Cluster Number * / │ │ INT FI_BYSEC; / * Each sector byout the number * / │ │} │ └ - ───────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ) this function returns the current drive information of the file allocation table, and stored fatblkp structure, the structure is as follows: ┌──────────────────┐ │struct fatinfo │ │ {│ │ Char fi_sclus; / * Each cluster sector * / │ │ CHAR FI_FATID; / * File allocation table byte * / │ │ │ │ │ │ │ │ │ │ │ │ Sec;
/ * Each sector is * / │ │} │ └ --───────────────────────── ─ ┘ Int Bdos (int dosfun, unsigned dosdx, unsigned dosal) This function is The MSDOS system is called, and DOSDX is the value of the register DX. Dosal is the value of the register Al, and the dosfun is called the function number INT BDOSPTR (INT DOSFUN, VOID * ARGUMENT, UNSIIGNED DOSAL) This function is called, and argument is the value of the register DX. , DOSAL is the value of the register Al, DOSFUN is executed in the function number int inru, the INTR_NUM number is interrupted, and the user-defined register value is stored in the structure inregs, and will return after execution. The register value is stored in Outregs. INT INT86X (INT INTR_NUM, Union Regs * INREGS, Union Regs * Outregs, Struct Sregs * SegRegs) Execute the INTR_NUM number, the user-defined register value exists in the structure inregs, and the structure Segregs, execute The returned register value will be stored in the structure Outregs. INT INTDOS (Union Regs * INREGS, Union Regs * Outregs) This function performs DOS interrupt 0x21 to call a specified DOS function, and the user-defined register value is stored in the structure inregs. After the function is executed, the return register value is stored in the structure Outregs INT INTDOSX (Union Regs * INREGS, UNION REGS * OUTREGS, STRUCT SREGS * SegRegs) This function performs DOS interrupt 0x21 to call a specified DOS function, user-defined The register value is stored in the structural INREGS and SegRegs, and the function is executed to save the returned register value in the structure Outregs VOID INTR (INT INTR_NUM, STRUCT REGPACK * PREG) This function is an alternate 8086 software interrupt interface in this function. It can generate a Parameters INTR_NUM Interrupt. The function replicates the user-defined register value to each register before executing the software interrupt. After the software is complete, the function is copied to the value of the current registers to the structural preg. The parameters are as follows:INTR_NUM is executed, preg is the structure of saving user-defined register values - ──────────────────────────── │STRUCT Regpack │ { │ │ UNSIGNED R_AX, R_BX, R_CX, R_DX; │ │ UNSIGNED R_BP, R_SI, R_DI, R_DS, R_ES, R_FLAGS; │ │} │ └──────────────────────── After the function is executed, the new register value is stored in the structure of the Void Keep (int status) in the STATUS state, but the program remains in memory, and the occupied space is determined by size. Void Ctrlbrk ()) Sets the interrupt handler after the interrupt. Void disable () disables the interrupt Void Enable () allows interrupt VOID GenInterrupt (int INTR_NUM) to execute the software specified by INTR_NUM VOID INTERRUPT (* getVect (int INTR_NUM)) () Returns an interrupt handler for the interrupt number INTR_NUM, for example: OLD_INT_10H = GetVect (0x10); Void setVect (int INTR_NUM, VOID INTERRUPT (* ISR) ()) Set the interrupt number INTR_NUM The interrupt handler is ISR, for example: setVect (0x10, new_int_10h);
Void Harderr ()) Defines a hardware error handler, whenever an error occurs, call the program Void HardResume (int RESCODE) hardware error handling function void hardretn (int errcode) hardware error handler for FPTR INT Inport (int prot) is read from the specified input port and returns this word int inportb (int port) to read a byte from the specified input port and return this byte void outport (int port, int Word) ) Write the word Word to the specified output port port void outputb (int port, char Byte) Write byte Byte to the specified output port Port Int peek (Int Segment) function returns a word Char PEEKB at the segmentffset function at the Segmentffset function. INT segment, unsigned offset function Returns a byte void poke (int segment, int offset, char value) at Segmentffset, Write the word value to the segmentffset Void Pokeb (int segment, int offset, int value) Writing bytes Value To the Segmentffset, the Int Randbrd (Struct) function is used to open the FCB read Reccnt record in the FCBPTR. Int RandbWr (strunt fcb * fcbptr, int RECCNT) function will record the RECCNT record in the FCB referred to in FCBPTR Writing a Void Segread (Struct Sregs * SEGTBL) function puts the current value of the segment register in the structure segtbl INT GETVERIFY () Take the current state of the inspection mark (0 = test is closed, 1 = test Open) Void setVerify (int value) ) Set the current inspection status, value is 0 indicates the shutdown test, and indicates that INT GETCBRK () This function returns the current setting of the control interrupt detection. INT setCBRK (int value) This function is used to set the control interrupt detection to turn it on or broken. When Value = 0 is detected. When Value = 1, for the detection I NT Dosexterr (Struct Doserr * EBLKP) Removes an extended error. After the DOS error occurs, this function fills the extended error message in the Doserr structure referred to EBLKP. This structure is defined as follows: ┌───────────────────────────────────────────────────────────────────── ─ ─ ┐ │STRUCT DOSERR │ │ {│ │ Int EXTERROR; / * Extension error * / │ │ │ │ │ │ 错 错 错 类 * / │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ar * Errors * / │ │} │ └ - ───────────────────────────────── This function is responsible for the communication of data, CMD can be the following Value: 0 Communication parameters as byte BYTE Value 1 Send Characters By communication line output 2 Retrieve character 3 from the communication line Returns the communication port, port = 0 When the communication port is COM1, Port =
1 When the communication port is COM2, the parameters when transmitting or receiving data are transmitted or received: ┌ - ─ ──────────────────────────────────── ┬──── ┐ │BYTE Value │ meaning │BYTE Value │ meaning │BYTE Value │ Significance │ ├─────────────────────────────────────────────────────────────────────────── ─ ─ ┤ │0x02 │7 data 位 │0x03 │8 data │0x00 │1 stop bit │ │04 │2 stop bit │0x00 │ 无 奇 奇 │0x08 │ odd parity │ │0x18 │ 数 奇性 │0x00 │110 Potter │0x20 │150 │300 baud │0x60 │600 baud │0x80 │1200 baud │ │0xa0 │2400 baud │0XC0 │4800 baud │0xe0 │9600 Port │ └ └ ─ ┴─────────────────────────────────────── ┘, 0x00 | 0x08 | 0x00 | 0x03 means that the communication port is 9600 baud, odd Packet, 1 stop bit, 8 data bits. Function return value is a 16-bit integer, defined as follows: 15th timeout 14th transfer shift register empty 13th transfer fixed register empty 12th interrupt detection 11th bit Frame Error 10th Parity Error 9th Overrive Run Error 8th Data Ready 7th Receive Line Signal Detection of the 6th Ring Indicator Fifth Bit Data Setting Ready The 4th Clear Send the third bit δ receiving line signal detection L. 2nd falling edge detector, first bit Δ data setting ready 0th bit Δ clear transmission
INT BiosDisk (int CMD, int DRIVE, 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. 1 Return to the last hard disk operation status. Ignore all other parameters 2 read one or more disk sectors to memory. Read the sector 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 the specified drive to be ready 17 Review Drive 18 Controller RAM Diagnostics 19 Drive Diagnostics 20 Controller Interior Diagnosis
Function returns the status byte by the following bits: 0x00 operation success 0x01 bad command 0x02 address tag found 0x04 record could not find 0x05 reset failed 0x07 driver parameter activity failed 0x09 attempt DMA After 64K limit 0x0b inspection of bad disk Mark 0x10 Direct ECC Read 0x11 ECC Correction Data ECC (Note It Not Error) 0x20 Controller Failure 0x40 Finding Failed 0x80 Response Connection Failure 0xBB Disabled Error 0xFF Read Operation Failure
INT biodquip () checks the device, the function returns a byte, which represents a message, as follows: 15th printer number 14th printer number 13th unworthoped game I / O No. 11 The 8th bit of the RS232 port number did not use the seventh-bit soft disk number sixth-bit soft disk number, 00 is No. 1 driver, 01 is 2 drivers, 10 is driven, 11 is the 5th digit of the No. 4 driver. 4th Display mode 00 is not used, 01 is 40x25BW color display card 10 is 80x25bw color display card, 11 is 80x25bw monochrome display card 3rd mother sections 2nd random memory capacity, 00 is 16K, 01 is 32K, 10 is 48k, 11 is 64K 1st Pointers to the 0th Bit from the soft disk
INT BIOSKEY (INT CMD) This function is used to perform various keyboard operations, determined by 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 button itself keeps the value returned by the Bioskey of the next CMD value of 0. 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 recognition 0x80 is not busy
INT Biostime (int CMD, long newtime timer control, cmd is function number, can be the following
0 Function Returns the current value of the timer 1 Set the timer to the new value newtime
Struct Country * Country (int COUNTRYCMODE, STRUCTRUCTRY * Countryp) This function is used to control relevant information in a country, such as date, time, currency, etc. If countryp = -1, the current country is set to Countrycode value (must be Non 0). Otherwise, the COUNTRY structure pointed by the CountryP: (1) Current country (if countrycode is 0 or 2), the country given by CountryCode. Structure country is as follows: ┌─ ──────────────── │Struct Country │ │ {│ │ Int Co_date; / * Date format * / │ │ CHAR CO_CURR [5]; / * Currency symbol * / │ │ CHAR CO_THSEP [2]; / * Digital Division * / │ │ CHAR CO_DESEP [2]; / * Decan Point * / │ │ CHAR CO_DTSEP [2]; / * Date Separator * / │ │ CHAR CO_TMSEP [2 ]; / * Time separator * / │ │ char CO_CURRSTYLE; / * Money form * / │ │ CHAR CO_DIGITS; / * Valid Number * / │ │ INT (FAR * CO_CASE) (); / * Event Processing Function * / │ │ CHAR CO_DASEP; / * Data Separator * / │ │ CHAR CO_FILL [10]; / * Supplemental Character * / │ │} │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── The date format represented by the value of CO_DATE is: the currency display of the value of the value of CO_CURRSTRLE, the month of the 0 months of the 0 month, the currency symbol is in front of the value, and the monetary symbol is in the numerical value. In the middle without space 2 currency symbol, there is a space 3 currency symbol After the value, there is a space operation function in the middle, the function library is string.h, MEM.H MEM ... Operating storage array void * Memccpy (Void * Destin , void * source, unsigned n) Void * Memchr (void * s, char ch, unsigned n) void * Memcmp (Void * S1, Void * S2, unsigned n) int memory (Void * S1, void * s 2, 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)
All members of these functions, all members of the MEM ... series are operated. In all of these functions, arrays are N-bytes long. Memcpy copies an N-byte block to Destin from Source. If the source block and target block are overlap it, Then select the replication direction to correctly copy the overlay bytes. Memmove is the same as Memcpy. MEMSET places all the words S in the byte CH. The length of the array is given by n. MEMCMP is exactly the n-byte Long two strings S1 and S2. Some functions Compare bytes in unsigned characters, so Memcmp ("0xFF", "/ x7f", 1) return value is greater than 0. MemicMP compares the first n word of S1 and S2 Section, regardless of the character capital or lowercase. Memccpy Copy byte from Source to Destin. The following is the following: (1) Character CH preferred copy to Destin. (2) N-bytes have been copied to Destin. Memchr Retrieve the front n bytes of the S array in characters. Return Value: Memmove and Memcpy Return to Destin MemSet Returns Memcmp and Memicmp─ ─ ─ ─ ─ ┬ S1
Otherwise, returning NULL MEMCHR Returns a pointer to CH in S; if you do not appear in the S array, return null.void MoveData (int SGSRC, int offsrc, int segdest, int offdest, unsigned numbytes) This function will The NumBytes by the address (Segsrcffsrc) is copied to the segdestffdest Void MoveMem (Void * Source, Void * Destin, Unsigned Len) This function is copied from the Source to Destin. If the source address And target address string overlap, select the replication direction so that the correct copy data. Void setmem (void * addr, int LEN, char value) This function puts the first byte of the block referred to in Addr to bytes Value.
Str ... String Operation Function CHAR STPCPY (CHAR * DEST, Const Char * src) Copy the string src to Dest Char STRCAT (CHAR * DEST, Const Char * SRC) Add String SRC to Dest Last CHAR STRCHR (Const Char * S, INT C) Retrieves and returns the character c in the first occurrence of the first time INT STRCMP (const char * s1, const char * s2) compares the size of the string S1 and S2, and returns S1-S2 Char STRCPY (CHAR * DEST, CONST CHAR * SRC) Copy the string SRC to DEST SIZE_T STRCSPN (Const Char * S1, Const Char * S2) Scan S1, returned in S1, and some characters in S2 are also char strDUP (const char * s) Copy the string S to the most recently established unit int STRICMP (Const Char * S1, Const Char * S2) comparison strings S1 and S2, and return to S1-S2 SIZE_T STRLEN (Const Char * S) Returns The length of the string s CHAR STRLWR (Char * S) converts all uppercase letters in the string S to lowercase letters, and return the converted string char strncat (char * dest, const char * src, size_t maxlen) Up to Maxlen characters in string SRC Copy into string DEST INT STRNCMP (Const Char * S1, Const Char * S2, SIZE_T MAXLEN) Comparison Strings S1 and S2 Pre-Maxlen Character CHAR STRNCPY (CHAR * DEST, Const Char * SRC, SIZE_T MAXLEN) Copy the former Maxlen characters in the SRC to Dest in int STRNICMP (Const Char * S1, Const Char * S2, SIZE_T MAXLEN) Comparison Strings S1 and S2 in front Maxlen character char strnset (char *) s, int CH, SIZE_T N) Place the primary N characters of the string S in CHAR STRPBRK (Const Char * S1, Const Char * S2) Scan Strings S 1. Returns the number of characters all in S1 and S2 CHAR STRCHR (Const Char * S, INT C) scanning a string S CHAR STRREV (CHAR * S) of a given character C will string S The characters in the middle are reversed in the order, and return a string CHAR STRSET (CHAR * S, INT CH) to place all characters in a string S in a given character CH size_t strspn (const char * s1) , const char * s2) Scan string S1 and returns the number of characters in S1 and S2 CHAR STRSTR (const char * s1, const char * s2) scan string S2, and returns the first time S1 Location CHAR STRTOK (CHAR * S1, ConST Char * S2) Retrieve string S1, the string S1 is a lowercase letter in the string STRUPR (CHAR * S) divided by the delimiter defined by the string S2 Convert all to uppercase letters and return the converted string
Storage distribution subroutine, the function library is dos.h, alloc.h, malloc.h, stdlib.h, process.h int allocmem (unsigned size, unsigned * seg) using DOS assignment free memory, size is allocated memory Size, SEG is allocated memory pointer int freemem (unsigned seg) release the memory allocated by allocmem, SEG is used for the specified memory pointer Int setBlock (int seg, int newsize) This function is used to modify the assigned memory length, SEG For memory pointers that have allocated memory, Newsize is the new length INT brk (void * endds) this function to change the number of space assigned to the data segment assigned to the calling program, the new space end address is endds char * sbrk (int INCR) This function is used to increase the number of spaces assigned to the data segment assigned to the calling program, increasing the space of the INCR byte UNSigned long core () This function returns the length of the unused storage area, in bytes, Void * Calloc (unsigned NELEM) , unsigned elsize assigns NELEM length to ELSIZE memory space and returns the pointer VOID * malloc (unsigned size) assigned the SIZE byte, and returns the pointer of the assigned memory Void FREE (Void * PTR) Release the internal allocated memory, the pointer to the memory to be released is the size of the allocated memory, the PTR is the pointer that has been allocated, and newsize is new, return Assigned a good memory pointer. Long farcoreleft () This function returns the length of the unused storage area in the distortion, with bytes Void Far * Farcalloc (unsigned long sets, unsigned long setsz) from the far-referential UnitS length Units's memory space, and returns the pointer void * farmalloc (unsigned long size) assigned the SIZE byte, and returns the assigned memory pointer Void Farfree (Void Far * Block) released previously allocated Memory space, the pointer to the far-resembled memory to be released is Block Void Far * Farre Alloc (Void Far * Block, Unsigned Long News) Changes the size of the allocated far-resemble, Block is a pointer assigned with a memory area, NewZie is a new length, returns the assigned memory pointer
The time date function, the function library is Time.h, DOS.H In the time date function, the mainly used structure has the following: Total time date Storage structure TM ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ──────── ─ │STRUCT TM │ │ {│ │ INTTM_SEC; / * Second, 0-59 * / │ │ INTTM_MIN; / * Pie, 0-59 * / │ │ INTTM_HOUR; / * When 0-23 * / │ │ INTTM_MDAY; / * Number, 1-31 * / │ │ INTTM_MON; / * Month, 0-11 * / │ │ INTTM_YEAR; / * Since 1900's number * / │ │ INTTM_WDAY; / * Since the day of the day 0-6 * / │ │ INTTM_YDAY; / * Since January 1st, 0-365 * / │ │ INTTM_ISDST; / * Whether to use a summer time system, The positive number * / │ │} │ └ - ────────────────────────────────────────────────────────── ─ ─ ┐ │STRUCT DATE │ │ {│ │ Int Da_Year; / * Since 1900 Number * / │ │ │ │ │ │ CHAR Da_MON; / * Month 1 = Jan * / │ │ │ │ │ └ - ─ ─ ─ ──────────────────────────────────── │STRUCT TIME │ │ {│ │ unsigned CHAR TI_MIN; / * Minute * / │ │ unsigned char Ti_HOUR; / * Hours * / │ │ unsigned char Ti_hund; │ │ UNSIGNED CHAR TI_SEC;