Function profile (no case)
Classification function, the function library is ctype.h
Int isalpha (int CH) If the CH is the letter ('A' - 'Z', 'A' - 'Z') returns to a non-0 value, otherwise it returns 0INT IsalNum (int CH) if ch is the letter ('A'-' Z ',' A '-' Z ') or numbers (' 0 '-' 9 ') returns to a non-0 value, otherwise returns 0INT ISASCII (INTC) if the CH is character (0-127 in the ASCII code) returns 0 value, otherwise returning 0int iscntrl (int CH) If the CH is a waste character (0x7f) or normal control character (0x00-0x1f) returns a non-0 value, returning 0int isdigit (int CH) if ch is a number ('0'- '9') Returns a non-0 value, otherwise returning 0INT ISGRAPH (INT CH) If CH is a printable character (excluding space) (0x21-0x7e) Returns a non-0 value, otherwise return 0int islower (int CH) if ch is lowercase Letters ('A' - 'Z') returns a non-0 value, otherwise returns 0INT Isprint (INT CH) If the CH is the printable character (including the air) (0x20-0x7e) Returns a non-0 value, return 0int ispunct (int CH) If the CH is the punctuation character (0x00-0x1f) returns a non-0 value, returning 0int isspace (int CH) if the CH is a space (''), horizontal tab ('/ t'), carriage return ('/ R '), paper wrap (' / f '), vertical tab (' / v '), the wrapper (' / n ') returns a non-0 value, otherwise returns 0INT Isupper (int CH) if ch is capitalized Letters ('A' - 'Z') returns a non-0 value, otherwise it returns 0INT Isxdigit (int CH) if CH is 16-en-number ('0' - '9', 'A' - 'F', 'A' -'f ') Returns a non-0 value, otherwise returns 0Int Tolower (INT CH) If CH is uppercase letters (' A '-' Z ') Returns the corresponding lowercase letters (' A '-' Z ') Int Toupper CH) If CH is lowercase letters ('A' - 'Z') returns the corresponding uppercase letters ('A' - 'Z')
Mathematical functions, the library is math.h, stdlib.h, string.h, float.h
INT 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) Return long finishing 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 Double Log (Double X) Returns Double Log10 (Double X) Returns Double Pow (Double X, Double Y) Returns Double Pow10 (INT P) Returns 10p 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 the arc Double Asin (double x) Returns an anti-String Sin -1 (x) value, X is the 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 Y / X Anyway Tan- 1 (x) value, Y X is the cosine COS (X) value returns the X of the arc Double Cos (Double X), X is the sinusoidal SIN (X) value returns X (Double X), X is an arc
Double Tan (double x) Returns the orthosis TAN (X) value of X, X is an arc
Double Cosh (double x) Returns the double cosine COSH (X) value of the X, X is a dual sine SINH (X) value returns x, X) value, X is the radians Double Tanh (Double X) Returns x Double-dicing Tanh (X) value, X is the arc Double Hypot (double x, double y) Returns the length (z) of the right angle triangle, X and Y is the length of the straight corner, Z2 = x2 Y2Double CEIL (Double x) Returns the minimum integer Double Floor (Double X) of not less than X Returns the maximum integer VOID SRAND (unsigned seed) in which X is initialized to generate a random number and return this number Double Poly (Double X) INT N, DOUBLE C []) Generate a multi-term Double MODF (Double Value, Double * IPTR) from the parameter, break down the double-precision value VALUE into the mantissa and the flyx fmod (double x, double y) Returns the remaining number of X / Y Double Double 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) Converts the string NPTR into an integer and returns this integer
Double Atol (Char * NPTR) Converts String NPTR to the integer and return this integer 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 value into a string and returns to the string char * GCVT (Double Value, Int Ndigit, Char * BUF) converts the number Value into characters String and returned to BUF and returns the BUF's pointer char * ULTOA (unsigned long value, char * string, int RADIX) converts unsigned integer values into a string and returns the string, and Radix is a base char. CHAR * LTOA (Long Value, Char * String, Int Radix) Converts Long Integer VALUE into a string and returns the string, and RADIX is a base char * itoa (int value, char * string, int RADIX) Integer Value Converts to Strings Deposit String, Radix The Base Double ATOF (Char * NPTR) used by RADIX to convert the string NPTR to double precision, return this number, error returns 0Itoi (char * nptr) to string NPTR is converted into an integer, returns this number, error returns 0long atol (char * nptr) converts the string NPTR to grow integer, return this number, error Return 0Double Strtod (Char * Str, Char ** ENDPTR) Convert the string STR to double precision and return this number,
Long Strtol (CHAR * STR, CHAR ** ENDPTR, INT BASE) Converts String STR to the total number, return this number, int match (STRUCT EXCEPTION * E) user modifying mathematical error returns 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) Unsigned Int_Clear87 () Clears floating point status words and returns the original floating point status Void _fpreset () Reproduces the floating point mathematics package Unsigned int _status87 () Returns floating point status
Directory function, the function library is dir.h, dos.h
INT Chdir (Char * Path) turns the specified directory path (eg "C: // WPS") into the current working directory, successfully returns 0Int FindFirst (Char * Pathname, Struct Ffblk * ffblk, int attrib) Find specified File, successfully returns 0 pathname as the specified directory name and file name, such as "c: // wps // txt" ffblk is a structure of the specified save file information, is defined as follows: ┏┏━━━━━━━━━━ ━━━━━━━┓ ┓ ┓Truct FFBLK ┓s ce [保 保; / * File Properties * / * / * File date * / 文件 长 * /;}} ┗━━━━━━ ━━━━━━━━━┛┛attrib as the file attribute, by the following characters, ┏┏━━━━━━━┳┳┳┳━━━━┓┓┓aa_rdonly read-only file f_Label volume mark __Direc directory _ s 系统 ┗ ┗━━━━━━ ┻┻━━━━━┛┛┛: struct ffblk ff; findfirst ("*. Wps" , & ff, fa_rdonly; int FindNext (Struct Ffblk * ffblk) Repends on the Findirst's file, successfully returns 0void FuMerge (Char * path, char * diame, char * dir, char * name, char * ext) This function passes Drive (C:, A:, etc.), path DIR (/ TC, / BC / LIB, etc.), file name Name (TC, WPS, etc.), extension ext (.exe, .com, etc.) form a file store In Path .int fnsplit (Char * DIR, CHAR * DRIVE, CHAR * DIR, CHAR * NAME, CHAR * EXT) This function breaks down the file name PATH into a disc server DRIVE (C:, A:, etc.), path DIR (/ TC, / BC / LIB, etc.), file name Name (TC, WPS, etc.), extension ext (.exe, .com, etc.) and deposit the corresponding change separately In the amount .int getCurdir (int DRIVE, CHAR * DIREC) This function returns the current working directory name Drive specified by the drive (0 = Current, 1 = A, 2 = B, 3 = C, etc.) DIREC Save the specified drive. The variable of the working path successfully returns 0CHAR * getCwd (CHAR * BUF, IINT N) This function takes the current working directory and stores in BUF until the N-byte length is long. Error returns nullint getDisk () Take the currently used drive Returns an integer (0 = a, 1 = b, 2 = c, etc.) int setDisk (int DRIVE) set the drive drive to use (0 = A, 1 = B, 2 = C, etc.), return to the total number of drivers INT MKDIR (Char * Pathname) establishes a new directory PathName, successfully returns 0INT RMDIR (CHAR * PATHNAME) Delete a directory PathName, successfully returns 0CHAR * mktemp (char * template) Constructing a file name not in a current directory and saving Template CHAR * SearchPath (Char * Pathname) uses MSDOS to find the path of file filename, this function uses DOS's PATH variable, no files are found to return NULL
Process function, 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 []) Exec function family is loaded and runs the program Pathname and passes the parameter arg0 (arg1, arg2, argv [], envp []) to the subroutine Error returning -1 In the Exec function family, the suffix L, V, P, E are added to the exec, and the specified function will have some kind of operational ability with suffix P, the function can use DOS's PATH variable to find subroutine files. . 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 []) Spawn function races in the Mode mode, pass the parameter arg0 (arg1, arg2, argv [], envp []) to the subroutine. Error returns -1Mode to run mode MODE To p_wait, return this program after running in the subroutine. P_NOWAIT indicates that the program is running the program (not available) p_overlay in the subroutine runtime indicates that the operator is in the SPAWN function family, suffix L, V, P, E Add to SPAWN, the specified function will have some of the operational capabilities with suffix P, and the function passes the number of parameters that the function passes the number of parameters, the function passed the number of parameters. Not fixed. ENVP, specifying parameter ENVP can be passed to the subroutine, allowing to change the subroutine running environment. When there is a bracket, the subroutine uses the environment of this program. Init System (Char * Command) passes the msdos command command to DOS carried out
Converter, 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) Floating point value VALUE converts the 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 converts unsigned integer values into a string and returns the string, and Radix is a base CHAR * LTOA (Long Value, Char * String, Int Radix) for the conversion. Value converts the string and returns the string, RADIX uses the base char * ITOA (int value, char * string, int RADIX) to convert the integer value into a string to store String, and Radix is a base Double Atof. (char * nptr) converts the string nptr into a double-precision number, returns this number, error returns 0INT ATOI (Char * NPTR) Converting the string nptr into an integer number, return this number, error Returns 0long atol (charr * NPTR) Convert the string NPTR to the constant number, return this number, 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 TOASCII (INT C) Returns C The corresponding ASCIIINT TOLOWER (INT CH) If Ch is uppercase letter (' A '-' Z ') Returns the corresponding lowercase letters (' A '-' Z ') INT _TOLOWER (INT CH) Returns CHA corresponding lowercase letters (' A '-' Z ') Int Toupper (int CH) Is lowercase letters ('A' - 'Z') Returns the corresponding uppercase letters ('A' - 'Z') INT _TOUPPER (INT CH) Returns the Capper Capital Letter ('A' - 'Z')
Diagnostic function, the library is assert.h, Math.h
Void assert (int test) macro is extends to an IF statement, if the Test test fails, display an information and termination of the program, non-return VOID PERROR (CHAR * STRING) This function will display the most recent error message, format As follows: 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 ( There is no need to use) Double _Matherr (_Mexcep why, char * fun, double * arg1p, double * arg2p, double return) user modified mathematical error returns 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 INT getch () 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 (keyboard) on the screen. Table (keyboard) read a character, displayed on the screen INT UNGETCH (INT C) Retinals the character C back to the console (keyboard) Cgets (char * string) from the console (keyboard) to read the string in 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) to read a string from the console The respective parameters are assigned, and the BIOS is output. The parameters take int CSCANF (Char * Format [, Argument ...] from the VALIST param, read a string from the console, assigning each parameter, directly control Taiwan operation, such as the display, when the display is displayed, the direct write frequency is displayed in the direct write frequency (char * string, char * format [, argument, ...]) through the string string, assigning Int Vsscanf for each parameter, respectively. * String, char * format, vlist param) By string String, assigning each parameter, the parameters are sent from the VLIST PARAM to the console (display), using the BIOS Performing Void CPUTS (Char * String) Send a string string to the console (display), directly on the control table, such as the display is direct write frequency display INT Printf (char * format [, argument, ...]) Send formatted string Output to the console (display) Output INT VPRINTF (Char * FORMAT, VALIST PARAM) Send formatted string Output to the console (display) Output using the BIOS, the parameters take int rt PARAM CPRINTF (Char * Format [, Argument, ...]) Sends 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 (charr * Format, Valist Param Send formatted strings to output to consumers (displays), directly on control table operation, such as displaying direct write-frequency mode, parameters to get int sprintf from Valist Param (Char * String, CHAR * format [, argument, ...]) Reconnect the contents of the string String to formatted string int vsprintf (char * string, char * format, valist param) Re-write the contents of the string String as formatted String, parameters Get int Rename (Char * OldName, Char * NewName) from Valist Param Change the name of the file OldName to NewNameInt ioctl (int Handle, Int CMD [, INT * Argdx, Int Argcx]) This function is used To control the input / output device, please see the following table: ┌ - ─ ──────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ function │├─────────────────────────── ─ ─ ─ │ │ │ │ 1 │ Setting up device information ││ 2 │ Read the argcx byte into the address referred to by argdx ││ 3 │ ∎ Added ARGCX bytes in ArgDX ││ 4 │ In addition to handle as a device number (0 = Current, 1 = A, Outside the same, both, both CMD = 2 ││ 5 │ In addition to the handle as a device number (0 = current, 1 = A, etc.), both CMD = 3 ││ 6 │ Take input Status ││ 7 │ Take Output Status ││ 8 │ Test Replaceability;
Only for DOS 3.x ││ 11 │ set conflict of sharing conflicts; only DOS 3.x │ └ - ┴────────────────────── ─────── ─ ┘int (* Ssignal (INT SIGNAL (INT SIGNAL) () executes software signals (unnecessary) INT GSIGNAL (INT SIG) executes software signals (no need to use) int _open (char * pathname, int access) to open a file for reading or writing, press Access to determine whether it is reading the file or writes the file, the Access value is seen in the table --- - ─ ┬────── ────────── ─ ┐│ACCESS value │ Significance │├──────────────────────────── 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 handler to access the file ││O_DENYWRITE │ Only available files from any other opens │ │O_Denyread │ only allowed to write ││O_DENYNONE │ Allow other shared open files │ └─────────────────────────── ─────────── ─ ┘ Int open (int permissame, int access [, int permiss) is a file to read or write, press Access to determine whether reading file or writes files, Access value See the table below - ─ ─────────────── ─ ─ ─ ─ ─ ─ ─ ─ ├───────────────────────────────── ───────── ─ ┤ │O_RDONLY│T reading file │ │O_WRONLY│ 写 文件 │ │ │ │ o_ndlay│No; Neix System Compatible ││O_APpend│ o o 也Written, but each time you write always add ││O_CREAT │ if the file exists, this flag is useless; if there is no existence, new files │ │O_TRUNC │ If the file exists, the length is 0, the property is unchanged ││ O_EXCL │ is unused; the UNIX system is compatible with │ │O_Binary│ This flag can be displayed in binary mode Open file ││O_TEXT │ This flag can be used to show the text to open files in text │ └─── ┴─ ─────────────── ─ ┘permiss is the file attribute, can be the following value: S_IWRITE allows S_ IREAD allows read S_IREAD | S_IWRITE to allow reading, write int Creat (CHAR * FileName, INT Permiss) to create 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 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 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 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) reads the time of the file number Handle, and exists 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; / * Time * / ││ UNSIGNED FT_DAY: 5; / * Japan * / ││ UNSIGNED FT_MONTH: 4; / * Month * / ││ UNSIGNED FT_Year: 1; / * Years -1980 * / ││} └───── ───────────── ─ ┘int setftime (int Handle, Struct ftime * ftime) Rewinds the file number to the file time of the handle, the new time is in the structure ftime. Successful returns 0. Structure ftime as follows: ┌─ ───────────── ─ ┐│Struct ftime ││ {││ UNSIGNED FT_TSEC: 5; / * Second * / │ Unsigned ft_min: 6; / * 分 * / ││ unsigned FT_HOUR: 5; / * Time * / ││ unsigned ft_day: 5; / * day * / ││ unsigned ft_month: 4; / * month * / │ unsigned ft_year: 1; / * year -1980 * / ││} │ └──────────────────────── ─ ─ ┘long Lseek (int.comwhere This function moves the file number of the file number of the file number to the origin of fromwhere One byte. 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, indicates the type of ISATTY (Int Handle) This function is used to take the type of device handle. INT LOCK (INT HANDLE, Long Offset, Long Length) Share a Block Int Unlock (INT HANDLE, Long Offset, Long Length) to open a block lock
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. ┬─────────────────── ─ ─ ─ ─ │ │ 文 2 进 文件 │ Building / Open Old File │├────────────── ─ ┼────────────── ─ ─ ─ │ │ Open Old File ││W │ 写 │ Text │ Building File │ │ Add │ Text │ Open no new ││R │ read / write │ unlimited │ Open │ │W │ Building new file ││A │ Read / Add │ 无 限 │ 有 有 打 无 无 建 新 新 新 新 新 新┴──────────────────────── ┘ 加 的 suffix is T, B. Plus B indicates that the document is operated in binary form, and T is not necessarily used: ┌──────────────── ─ ─ ─ │ # cd
│
│main () │
│ {│
│ File * fp; │
│ fp = fopen ("c: //wps//WPS.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) to write a character CH
INT GETW (File * Stream) reads an integer from the stream stream, error Returns EOFINT PUTW (INT W, File * Stream) Writing an integer c, file * stream) Returns the character C back to the stream STREAM, the next reading character will be a character in Cint Fgetc (File * Stream) from the stream stream, and return this character INT FPUTC (INT Ch, File * Stream) to write the character chrius in stream in stream in CHAR * FGETS (char * string, int n, file * stream) Read N characters from the stream Stream into the string Int FPUTS (Char * String, File * Stream) Write the string string into the stream Stream INT FREAD (Void * Ptr , int size, int nitems, file * stream) Read the NITEMS in the stream stream to store the string of the size of the Size in the PTR in Int Fwrite (Void * PTR, INT Size, INT NITEMS, FILE * STREAM). Write the NITEMS length string for size, string in the PTR Int fscanf (file * stream, char * format [, argument, ...]) reads a string int vfscanf from the stream stream in a formatted form. * stream, char * format, 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 format The form will write a string to the specified stream streamint vfprintf (file * stream, char * format, valist param) to form a string to the specified stream stream, and the parameter gets int FSeek from the Valist Param (file * STREAM, long offset, int.comwhere function Moves file pointers to the backstart by the FROMWHERE, and fromwhere can be the following value: seek_set file switch S EEK_CUR Current location SEEK_END File Tail Long Ftell (File * Stream) Function Returns the current file pointer position positioning in Stream, indicating INT REWIND (file * stream) to move the current file pointer Stream to the beginning Int feof (file * STREAM) Detects the file pointer on the stream Stream to deactivate the file processing on the stream int fileno (file * stream), and return file processing
INT FERROR (File * Stream) Checks if there is a read and write error on Stream, if there is an error, return 1
Void Clearerr (File * Stream) Clearing the read and write error on the stream stream
Void SetBuf (File * Stream, Char * BUF) Give 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 Value │ │├───────────────── ─────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ District. When you write any data, you will completely fill the buffer. ││_iolbf│ file is a buffer. When the buffer is empty, the next input operation will still try to fill the entire ││ │ Rushing. However, when the output is written, the buffer is cleaned each time the new line is written. │ │_ionbf│ file is a buffered .BUF and Size parameters are ignored. Each input operation will be directly From Wen ││ │ piece read, each output will immediately write data to the file. │ └ - ┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ───────── ─ ┘ Int Fclose (file * stream) Close a stream, can be a file or device (for example, LPT1) int Fcloseall () Close All streams except STDIN or STDOUT INT FFLUSH (File * Stream) Off A stream, and the buffer is handled by the buffer, read the stream, read the contents within the buffer; write the stream of the buffer to write the stream 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 set to one of the following constants, FA_RDOONLY read-only FA_HIDDEN hide the FA_SYSTEM system.
Interface subroutine, the function library is: dos.h, bios.h
Unsigned Sleep (unsigned seconds) Pause Seconds microseconds (one percent) Int unlink (char * filename) Delete file filenameunsigned 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 of the FAR * mk_fp (unsigned seg, unsigned off) of the far pointer Farptr, constructed a FAR pointer unsigned getPSP () section address according to the segment SEG and offset OFF. And return this address char * PARSFNM (CHAR * CMDLINE, STRUCT FCB * FCBPTR, INT Option) function to analyze a string, usually, for a file name, a command line referred to by cmdline. File name is put Entering a drive, file name and extension in an FCB. Fcb is the value specified by the FCBPTR is the value of the DOS analysis system call, the DOS analysis system.
INT Absread (int DRID * BUFFER) This function function is read to read a specific disk sector, Drive is the driver number (0 = a, 1 = b, etc.), NSECTS is the number of sectors to read. , SECTNO starts logical sector number, Buffer to save the read data Int Abswrite (int DRIVE, INT NSECTS, INT Sectno, Void * Buffer) This function is written to write a specific disk sector, Drive is the drive letter ( 0 = a, 1 = b, etc.), nsects is the number of sectors to be written, and SECTNO starts the logical sector number starting, Buffer is the space for Save the space Void getDFree (int Drive, Struct Dfree * DFreeP) this function. To take the free space of the disk, Drive is a disk number (0 = Current, 1 = A, etc.). The function puts the DFREE structure of the disk characteristic by DFreeP. DFREE structure is as follows: ┌─────────────────────────────────────────────────────────────────────────────── ───────── ─ ┐│TRUCT DFREE ││ {││ │ UNSIGNED DF_AVAIL; / * Useful cluster number * / ││ unsigned df_total; / * Total cluster number * / ││ unsigned df_bsec; / * Several byte number * / ││ UNSIGNED DF_SCLUS; / * The number of sectors per cluster * / ││} │ └──────────────────── ─ ─ ─┘char 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 the specified drive Drive (0 = Current, 1 = A, 2 = B, etc.) The file allocation table information is stored in FATBLKP, the structure is as follows: ┌ --────────────────── ─ │ 斯truct Fatinfo ││ {││CHAR FI_SCLUS; / * Each Cluster sector number * / ││ CHAR FI_FATID; / * File allocation table byte number * / │ │ INT FI_NCLUS; / * Number of clusters * / │ │ int Fi_Bysec; / * Each sector Number * / │ │} └──────────────────────────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ In BLKP, the structure is as follows: ┌ - ────────────── ─ ┐│Struct Fatinfo ││ {││CHAR FI_SCLUS; / * Each cluster number * / ││CHAR FI_FATID; / * File Allocation Table bytes Number * / │ │ INT FI_NCLUS; / * Number of Clusters * / │ │ Int Fi_Bysec; / * Each sector Number * / ││} └───── ─────────────
INT BDOS (int DOSFUN, UNSIGNED DOSDX, Unsigned Dosal) This function calls the MSDOS system, DOSDX is the value of the register DX, DOSAL is the value of the register Al, DOSFUN is the function number Int Bdosptr (int dosfun, void * argument, unsiigned dosal This function is called by the MSDOS system, and the argument is the value of the register DX. Dosal is the value of the register Al, and DOSFUN is the function number INT INT86 (INT INTR_NUM, Union Regs * INREGS, Union Regs * Outregs) executes INTR_NUM interrupt, user-defined The register value is stored in the structural INREGS. After execution, the returned register value is used in Outregs .int INT86X (INT INTR_NUM, UNION Regs * INREGS, Union Regs * Outregs, Struct Sregs * segregs) Perform INTR_NUM number interrupt, user The defined register value is stored in the structure inregs in Segregs. After execution, save the returned register value in Outregs .int INTDOS (Union Regs * INREGS, UNION Regs * Outregs) This function performs DOS interrupt 0x21 to call one The specified DOS function, the user-defined register value is stored in the structural INREGS, and the function is executed to save the returned register value in Outregs int INTDOSX (Union Regs * INREGS, UNION Regs * Outregs, Struct Sregs * segregs) This function Perform DOS Interrupt 0x21 to call a specified DOS function, the user-defined register value exists in the structure inRegs and SegRegs, and the running function will save the returned register value in the structure OUTREGS VOID INTR (int INTR_NUM, STRUCT Regpack * PREG) An alternate 8086 software interrupt interface in this function generates an 8086 software interrupt specified by the parameter INTR_NUM. The function replicates the user-defined register value to each register before executing the software interrupt. After the software is broken, the function is completed. Copy the value of the current registers to the structural preg. The parameter is as follows: INTR_NUM executed interrupt number preg is the structure of the user-defined register value, the structure is as follows - ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ─────────────── ─ ┐│TRUCT Regpack ││ {│ │ UNSIGNED R_AX, R_BX, R_CX, R_DX; │ │ UNSIGNED R_BP, R_SI, R_DI, R_DS, R_ES, R_FLAGS; ││} ──────── ────────────── ─ ┘ Function After execution, the new register value is stored in the structure of Void Keep (int stats) in the Status state, but the program remains in memory. The occupied space is determined by size. VOID CTRLBRK (INT (* fptr) ()) Sets the interrupt handler after the interrupt .void disable () prohibits interrupt VOID Enable () allows interrupt VOID GenInterrupt (int INTR_NUM) Interrupted by INTR_NUM
Void Interrupt (* getvect (int INTR_NUM)) () Returns an interrupt handler for INTR_NUM, for example: OLD_INT_10H = getVect (0x10); void setVect (int interstR_num, void interrupt (* isr) ()) set interrupt number INTR_NUM interrupt handler is ISR, for example: setVect (0x10, new_int_10h); Void Harden ()) defines a hardware error handler, whenever an error occurs, the program refers to the program referred to in FPTR Void Hardresume ( INT RESCODE HUID HARDRETN (INT errcode) Hardware Error Error handler INT Inport (int prot) is read from the specified input port and returns this word INT InportB (int port) read from the specified input port One byte, and returns this byte void output (int port, int Word) Write the word Word to the specified output port PortVoid Outportb (int port, char Byte) Write byte byte to the specified output port Portint PEEK. Segment, unsigned offset function Returns a word CHAR Peekb (Int Segment, unsigned offset "at the Offset function Returns a word Void Poke (int segment, int offset, char value) written by the word value Value in the segment: offset. Segment: Offset Void Pokeb (int segment, int offset, int value) Write byte value to segment: offset
INT randbrd (struct fcb * fcbptr, int RECCNT) function is written to the FCB of the FCBWR (Struct) function referring to the FCBWR (Struct) function referred to in the FCBPTR to write the RECCNT record in the FCB referred to in FCBPTR to disk. The Void Segread (STRUCT SREGS * SEGTBL) function puts the current value of the segment register into the structure of the int GETVERIFY () to take the inspection mark (0 = inspection, 1 = verification Open) Void setVerify (int value) settings Inspection status, value is 0 indicates a shutdown test, and the current setting of the Open Test 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 disconnect. = 0, for disconnection. When value = 1, for the detection
INT DOSEXTERR (STRUCT DOSERR * EBLKP) takes 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: ┌──────── ─ ─ ─ ┐│TRUCT DOSERR ││ {││ Int ExtError; / * Extension Error * / ││ Char Class; / * Error Type * / ││CHAR Action; / * Way * / ││CHAR LOCUS; / * Error premises * / ││} │ └─────────────────────────────────── 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 For COM2, the parameters when transmitting or receiving data is to transmit or receive data, and the combination of the following bit: ┌ - ─ ───────────────────────── ─ ┐│BYTE Value │ Significance │BYTE Value │ meaning │BYTE Value │ │ │├ - ┼────────────────────────────────────── ┤│0x02 │7 data 位 │0x03 │8 data │0x00 │1 stop bit │ │ │0X04 │2 stop 位 │0x00 │ 无 奇 │0x08 │ odd parity │ │ │0X18 │ 数 奇性 │0x00 │ 110 baud │0x20 │150 baud │ ││0x40 │300 baud │0x60 │600 baud │0x80 │1200 baud │ │ │0xa0 │2400 baud │0XC0 │4800 Port │0XE0 │9600 baud │0XE0 │9600 Port └ └ - ┴──────────────────────────────────────────────────X, 0xE0 | 0x08 | 0x00 | 0x03 means an address port is 9600 baud , Odd parity, 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 11-bit Frame Error 10th Parity Error 9th Overrive Running Error 8th Data Ready 7th Receive Line Signal Detection Line 6 Ring Indicator 5th Data Setting Ready 4th Clear Send 3rd Bit Δ Receipt Signal detector, second-bit falling edge annular detector, first bit Δ data set ready 0th Δ clearance
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. Ignore all other parameters. 1 Return the last hard disk Operating status. Ignore all other parameters 2 read one or more disk sectors to memory. The sector read is given by Head, Track, Sector. The sector number is given by nsects. Reading the 512 bytes of data of each sector into the buffer3 written from the 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 sector is displayed, 00 is 16K, 01 is 32K, 10 is 48K, 11 is 64K 1st Point Point Shared processor 0th bit from soft disk guidance
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 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 returning an integer, see below: ┌ - ┬──────────────────────── │ 0 意 意 意 意 意 意 意 意 意 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态 状态│ Undears ││ │ │ │ Digital Status, Numlock Lights Light │ Corbizitor Status, Numlock Lights ││ 4 │Scrollock Lights Lights │Scrolllock Lights Off ││ 3 │ALT Press│alt Unpaid ││ 2 │CTRL Press Lower │CTRL unpaid ││ 1 │ Left Shift Press │ Left Shift Un Press ││ │ Right Shift Press │ Right Shift Unforgettable │ └ - ┴──────── ┴────────── ─ ┘ Int BiosMemory () Returns the size of the memory, with K unit .int BiospRINT (int CMD, int Byte, int port) Control 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, cmd is function number, can return the current value of the timer for the following value 0 function 1 The timer is set 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 ││ {││ _ _│; / * 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; / * Monetary form * / │ │ Char Co_Digits; / * Valid Number * / │ │ │ 数 * / │ │ / * Event Process 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 symbols, there is a space 3 currency symbol after the value, there is a space in the middle.
Operating function, the function library is string.h, mem.h
MEM ... 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 memory (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 memory. In all of these functions, arrays are N-bytes long. Memcpy Copy a n-byte block from Source To Destin. If the source block and the target block are overlap, select the replication direction to correctly copy the overlay byte. Memmove is the same. MEMSET places all the words S. The length of the .s array length Ged by n. Memcmp is exactly the N-byte long two strings S1 and S2. Some functions are compared by no symbolic characters, so MEMCMP ("0xFF", "/ x7f", 1) return value is greater than 0.
MemicMP compares the first n bytes of S1 and S2, regardless of 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 to retrieve the primary n bytes of the S array for characters. Return Value: Memmove and Memcpy Return to DestinMemSet Returns Memcmp and Memicmp - ┬ If S1
├若 If S1 = S2 return value is equal to 0
└─ If S1> S2 return value is greater than 0
If Memccpy copies CH, return to a pointer directly following the bytes in Destin;
Otherwise returning NULL
Memchr Returns a pointer to the CH in S; if CH does not appear in the S array, returns NULL.
Void MoveData (int SEGSRC, INT OFFFSRC, int SEGDEST, INT OFFDEST, Unsigned NumBytes) This function copies the NumBytes by the source address (segsrc: offsrc) to the target address (SEGDEST: OFFDEST) VOID MOVEMEM (Void * Source, Void * Destin, unsigned len This function copies a long LEN byte data from Source to Destin. If the source address and the target address string are overlap, select the copy direction in order to correctly copy the data .void setmem (void * Addr, int LEN, CHAR VALUE This function places the first byte of the block referred to in the ADDR in byte Value.
STR ... string operation function
CHAR STPCPY (CHAR * DEST, Const Char * src) Copy the string src to Destchar Strcat (CHAR * DEST, CONST CHAR * SRC) Add a string SRC to the end of DEST CHAR STRCHR (Const Char * S, INT C) retrieval 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-S2CHAR STRCPY (Char * Dest, Const Char) * SRC) Copy the string SRC to DESTSIZE_T STRCSPN (Const Char * S1, Const Char * S2) Scan S1, returns in S1, and some characters in S2 have the number of CHAR STRDUP (const char * s) will string S Copy to the recently established unit int STRICMP (Const Char * S1, Const Char * S2) comparison strings S1 and S2, and returns the length of the S1-S2SIZE_T STRLEN (Const Char * S) Returns the length of the string Strlwr (char * s) All uppercase letters in the string S are converted into lowercase letters, and return the converted string char strncat (char * dest, const char * src, size_t maxlen) to copy the most Maxlen characters in the string SRC to characters Intrin (Const Char * S1, Const Char * S2, SIZE_T MAXLEN) comparison string S1 and S2 before the string S1 (CHAR * DEST, CONST CHAR * SRC, SIZE_T MAXLEN) Copy SRC Former Maxlen characters to DEST INT STRNICMP (Const Char * S1, Const Char * S2, SIZE_T MAXLEN) Compare Strings S1 and S2 Pre-Maxlen Character CHAR STRNSET (CHAR * S, INT CH, SIZE_T N) Put Character The first n characters of string S are placed in CHAR STRPBRK (const char * s1, const char * s2) scan string S1, and return characters in S1 and S2 CHAR STRRCHR (Const Char) * s, int C) Scan a string SCHAR STRREV (CHAR * S) in which a given character C is displayed, rearrange the characters in the string S, and returns a string CHAR STRSET (Char *) S, INTCH) Place all characters in a string S in a given character chsize_t strspn scan string S1, and returns characters in S1 and S2 Number of CHAR STRSTR (const char * s1, const char * s2) scan string S2, returns to the first time S1 position CHAR STRTOK (CHAR * S1, CONST CHAR * S2) retrieval string S1, the string S1 It is partitioned by the delimiter of the string S2 to convert the lowercase letters in the string S to uppercase letters, and returns the converted string.
Storage distribution subroutine, the library is dos.h, alloc.h, malloc.h, stdlib.h, process.h
INT Allocmem (unsigned size, unsigned * seg) utilizes DOS assignment idle memory, Size is allocated memory size, SEG-assigned memory pointer INT FreeMem (unsigned seg) releases 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, Newsize is a new length.
INT brk (void * endds) This function is used to change the number of spaces assigned to the calling program, and the new space end address is endDSCHAR * SBRK (INT INCR) This function is used to increase the space assigned to the calling program. Quantity, increasing the space of the INCR byte UNSigned long core () This function returns the length of the unused storage area, assigns the NELEM length of Elsize in bytes in bytes, and is allocated with the memory space of the ELSIZE. Returns the pointer VOID * malloc (unsigned size) assigned the SIZE byte, and returns the pointer Void Free (Void * Ptr) allocated in the allocated memory, and the pointer to the memory to be released is Ptrvoid * Realloc (Void * PTR, Unsigned Newsize changes the size of the assigned memory, the PTR is a pointer assigned with the memory area, and newsize is the new length, returns the allocated memory pointer.
LONG FARCOREFT () This function returns the length of the unused storage area in the distortion, with bytes VOID FAR * FARCALLOC (UNSIGNED Long Units, Unsigned Long Units) Saves Units Units Units from the far, and Returns the pointer void * farmalloc (unsigned long size) assigned the SIZE byte, and returns the allocated memory pointer Void Farfree (Void Far * Block) Release the memory space that is previously assigned from the far, what to release The pointer of the long stack of memory changes the size of the allocked far * FarRealloc (Void Far * Block, unsigned long news, Block is a pointer allocated with memory area, Newzie is a new length, returning allocated Memory pointer
Time date function, 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; / * Division, 0-59 * / ││ INTTM_HOUR; / *, 0-23 * / ││ IntTM_MDAY; / * Number, 1-31 * / ││ INTTM_MON; / * Month, 0-11 * / ││ INTTM_YEAR; / * Since 1900's number of days * / │ │ │ IntTm_wday; / * Sunday's days 0-6 * / ││ INTTM_YDAY; / * Since January 1st, 0-365 * / │ │ INTTM_ISDST; / * Whether to use a summer time system, use a positive number * / │} │ └─── ───────────────────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ Da_Year; / * Since 1900 * / ││ Char Da_DAY; / * 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