home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 3 / CDASC03.ISO / sorties / 314 / c.txt < prev    next >
Text File  |  1993-04-01  |  164KB  |  5,928 lines

  1. @C Programming Topics                            Copyright 1991 David Jurgens
  2. :C declarations
  3. ^Complex C Declarations
  4.  
  5.  
  6.     int i;            i as an int
  7.     int *i;         i as a pointer to an int
  8.     int **i;        i is a pointer to a pointer to an int
  9.     int *(*i)();        i is a pointer to a function returning a
  10.                   pointer to int
  11.     int *(*i[])();        i is an array of pointers to functions
  12.                   returning pointers to an int
  13.     int *i[5];        i is an array of 5 pointers to int
  14.     int (*i)[5];        i is a pointer to an array of 5 ints
  15.     int *i();        i is a function returning a pointer to an int
  16.     int (*i)();        i is a pointer to a function returning int
  17.     int *(*(*i)())[5]    i is a pointer to a function returning a
  18.                   pointer to an array of 5 pointers to an int
  19.  
  20.  
  21. :C errors (MSC):MSC errors
  22. ^Microsoft C Compiler Fatal Errors
  23.  
  24.     C1000    unknown fatal error; contact Microsoft
  25.     C1001    internal compiler error; contact Microsoft
  26.     C1002    compiler out of heap space in C2.EXE
  27.     C1003    error count exceeded; stopping compilation
  28.     C1004    unexpected end-of-file found; disk full or unmatched #if
  29.     C1005    string too big for buffer
  30.     C1006    compiler intermediate file create/write error
  31.     C1007    invalid option on compiler command line
  32.     C1008    no source file specified
  33.     C1009    macros nested too deeply
  34.     C1010    macro expansion exceeded available space
  35.     C1011    macro definition too large
  36.     C1012    unmatched parenthesis in preprocessor directive
  37.     C1014    nesting of #include's exceed 10-level nesting limit
  38.     C1016    #ifdef & #ifndef directives expect an identifier
  39.     C1018    unexpected #elif;  #elif without #if directive
  40.     C1019    unexpected #else;  #else without #if directive
  41.     C1020    unexpected #endif;  #endif without #if directive
  42.     C1021    invalid preprocessor command
  43.     C1022    expected #endif;  #if directive not terminated by #endif
  44.     C1023    can't open specified source file
  45.     C1024    can't open specified include file
  46.     C1026    parser stack overflow; module too complex
  47.     C1027    DGROUP default data allocation exceeds 64K
  48.     C1028    modules far data segment allocation exceeds 64K (QC)
  49.     C1031    function calls nested too deeply
  50.     C1032    can't open object listing file
  51.     C1033    can't open assembly language output file
  52.     C1035    expression too complex; must be simplified
  53.     C1036    can't open source listing file
  54.     C1037    can't open object file
  55.     C1039    unrecoverable heap overflow in Pass 3 (post-optimizer)
  56.     C1040    unexpected EOF in source file; file disappeared
  57.     C1041    can't open intermediate file; no free file handles
  58.     C1042    can't open intermediate file; invalid TMP environment var
  59.     C1043    can't open intermediate file; unknown error
  60.     C1044    no disk space available for intermediate file
  61.     C1047    compiler option was specified too many times
  62.     C1048    unknown option specified
  63.     C1049    invalid numerical argument
  64.     C1050    code segment too large; within 36 bytes of 64K
  65.     C1052    #if/#ifdef nested too deeply;  max of 32 levels
  66.     C1053    struct/union nested too deeply; max of 15
  67.     C1054    initializers nested too deeply; max from 10 to 15 levels
  68.     C1055    out of keys; file has too many symbols
  69.     C1056    out of macro expansion space; macro to large/complex
  70.     C1057    unexpected EOF in macro expansion or missing ')'
  71.     C1059    compiler has run out of near heap space
  72.     C1060    compiler has run out of far heap space
  73.     C1062    error writing preprocessor output file for /P option
  74.     C1063    compiler stack overflow; module too complex
  75.     C1064    identifier too long causing token to overflow internal buffer
  76.     C1068    can't open file specified file
  77.     C1069    file write error on specified file; disk space low
  78.     C1070    mismatched #if/#endif pair; missing #endif
  79.     C1071    unexpected EOF found in comment; missing end of comment
  80.     C1072    can't read indicated file
  81.     C1090    data allocation exceeds 64K on _based allocation
  82.     C1015    can't open include file (check name, searchpath and FILES=)
  83.     C1126    automatic allocation (local variable) exceeds size
  84.     C1127    segment redefinition; overwritten by specified segment
  85.  
  86. ^Microsoft C Compiler Nonfatal Errors
  87.  
  88.     C2015    too many characters in constant; escape sequence too large
  89.     C2016    missing closing single quotation mark on code line
  90.     C2017    illegal escape sequence; occurred outside of string
  91.     C2018    unknown character found in source file
  92.     C2019    expected preprocessor directive; # followed by non-directive
  93.     C2021    expected exponent value but found non-numeric character
  94.     C2022    octal value following '\' is too large for a single character
  95.     C2025    given identifier redefines enum, struct or union tag
  96.     C2026    given identifier already used as enum constant
  97.     C2027    given identifier refers to undefined enum, struct or union
  98.     C2028    struct/union member needs to be inside a struct/union
  99.     C2030    identifier used more than once in struct or union tag
  100.     C2031    function can't be use as struct or union member
  101.     C2033    bit field can't be declared as a pointer or use indirection
  102.     C2034    type of host bit field is too small for number of bits
  103.     C2035    given structure or union has undefined size
  104.     C2037    undefined struct or union identifier on left of -> or .
  105.     C2038    identifier is not a struct or union member
  106.     C2055    expected formal-parameter list instead of argument-type list
  107.     C2056    illegal expression; possibly from previous unreported problem
  108.     C2057    expected constant expression
  109.     C2058    expected integral constant expression
  110.     C2059    invalid token caused a syntax error
  111.     C2060    syntax error; EOF found before expected token
  112.     C2061    identifier caused syntax error
  113.     C2062    unexpected type
  114.     C2063    identifier is not a function but used as such
  115.     C2064    term does not evaluate to a function pointer
  116.     C2065    identifier not defined
  117.     C2066    illegal cast to function type
  118.     C2067    illegal cast to array type
  119.     C2068    illegal cast type used in expression
  120.     C2069    cast of void term to non-void is invalid
  121.     C2070    illegal sizeof operand; must be expression or type name
  122.     C2071    illegal storage class for identifier
  123.     C2072    attempt to initialize a function identifier
  124.     C2092    arrays of functions illegal; use array of ptrs to function
  125.     C2093    can't use address of auto variable as static initializer
  126.     C2094    label was undefined in function
  127.     C2095    void argument cannot be passed to function; (void *) may
  128.     C2096    struct & union comparison is illegal; compare members
  129.     C2097    illegal initialization
  130.     C2098    expected address as initialization expression
  131.     C2099    non-constant initializer
  132.     C2100    illegal indirection; * applied to a non-pointer value
  133.     C2101    address of operator '&' used on constant; requires lvalue
  134.     C2102    address of operator '&' requires lvalue
  135.     C2103    address of operator '&' can't be used on a register variable
  136.     C2104    address of operator '&' used on bit field not allowed
  137.     C2105    operator needs lvalue
  138.     C2106    left side of an operation must be lvalue
  139.     C2107    subscript applied to expression didn't evaluate to pointer
  140.     C2108    non-integral expression used as array subscript
  141.     C2109    subscript used on non-array variable
  142.     C2127    allocation for function parameters exceeds 32K
  143.     C2128    array crosses 2 segments & element size not power of 2
  144.     C2129    static function referenced was never defined
  145.     C2130    #line expected string containing file name; found other
  146.     C2131    more than one memory attribute applied to and identifier
  147.     C2132    syntax error : unexpected identifier
  148.     C2133    attempt to declare an unsized array as a local variable
  149.     C2134    struct or union too large; exceeded 64k
  150.     C2136    prototype must have a valid type for each variable
  151.     C2137    use of empty character constant '' is illegal
  152.     C2139    more than one type used in a variable declaration
  153.     C2140    argument can't be a function
  154.     C2141    enum constant value out of int range
  155.     C2143    expected 'token1' before 'token2' or missing ')', '}' or ';'
  156.     C2144    expected 'token' before 'type' or missing ')', '}' or ';'
  157.     C2145    expected 'token' before identifier or declaration missing ';'
  158.     C2146    expected 'token' before identifier
  159.     C2147    increment of index or array pointer with unknown base type
  160.     C2162    token following stringizing operator # isn't formal parameter
  161.     C2163    function in pragma not available as intrinsic function
  162.     C2164    intrinsic function not declared before use wit /Oi option
  163.     C2165    _pascal, _cdecl, _???? keywords can't modify pointers to data
  164.     C2166    attempt to modify item declared as const; lvalue is constant
  165.     C2167    too many parameters in call to an intrinsic function
  166.     C2168    too few parameters in call to an intrinsic function
  167.     C2169    function definition for function already declared intrinsic
  168.     C2170    intrinsic pragma used for function without intrinsic form
  169.     C2171    unary operator used on illegal operand type
  170.     C2172    non-pointer argument passed to a function expecting pointer
  171.     C2173    non-pointer argument passed to a function expecting pointer
  172.     C2174    cant pass parameter with void type to function
  173.     C2176    static huge data not supported by /qc; use halloc()
  174.     C2177    constant too large for data type
  175.     C2178    storage class for same_seg pragma variables must be extern
  176.     C2179    same_seg pragma variable class has changed from extern
  177.     C2207    middle member of struct/union has zero-sized array
  178.     C2208    enum, struct or union defined w/o members using /Za option
  179.     C2209    type cast used in _based construct must be (_segment)
  180.     C2210    base in _based declarator must be near/far data pointer
  181.     C2211    item cast in _based declarator can't be a function
  182.     C2212    _based not available for functions or pointers to functions
  183.     C2213    symbol used as base must be type _segment, near far pointer
  184.     C2214    _based pointer based on void can't be de-referenced; use :>
  185.     C2215    :> operator only for objects based on void
  186.     C2216    given function attributes are incompatible
  187.     C2217    function attribute requires another attributes also
  188.     C2218    type in _based construct must be void
  189.     C2219    const/volatile appeared where type or qualifier not allowed
  190.     C2220    no object file generated; warning treated as error due to /WX
  191.     C2221    left operand of '.' is pointer to struct/union, must use '->'
  192.     C2222    left operand of '->' is struct or union, must use '.'
  193.     C2223    left operand of '->' must be pointer struct or union
  194.     C2411    identifier is not a member of the specified struct or union
  195.     C2412    identifier redefined within current function
  196.     C2413    alignment size used with ALIGN directive missing or invalid
  197.     C2414    illegal number of operands in assembly code; see /G1 & /G2
  198.     C2415    improper operand type
  199.     C2416    illegal opcode for processor in assembly code; see /G1 & /G2
  200.     C2417    divisor used within the given context is zero
  201.     C2418    in-line asm identifier referenced as register and isn't
  202.     C2419    divisor argument to mod is zero in given context
  203.     C2420    given identifier is illegal in this context
  204.     C2421    PTR must not be used with register operand in this context
  205.     C2422    illegal segment override used in given context
  206.     C2424    given token used to form improper expression in this context
  207.     C2425    token used fto form non-constant expression in this context
  208.     C2426    given token is illegal operator in this context
  209.     C2427    jump referencing label is out of range
  210.     C2429    FAR PTR can't be use on jmp or call to label
  211.  
  212. ^Microsoft C Command-Line Errors
  213.  
  214.     D2000    unknown CL command line error; contact Microsoft
  215.     D2001    too many symbols predefined with /D; max is 30
  216.     D2002    memory-model specification conflict; only 1 allowed
  217.     D2003    missing source file name for CL command
  218.     D2008    option specified too many times
  219.     D2011    more than one /FP option specified; only 1 allowed
  220.     D2012    too many linker flags in command; max of 128 flags/files
  221.     D2013    incomplete model specification in /A:
  222.     D2018    can't open linker response file
  223.     D2019    can't overwrite source with object file; output = input
  224.     D2020    /Gc requires extended keywords be enabled via /Ze
  225.     D2021    invalid numerical argument; numeric args must be < 65534
  226.     D2022    can't open help file for /HELP
  227.     D2027    CL could not execute one of the compiler components
  228.     D2028    too many open files; can't dup/redirect specified stream
  229.     D2030    internal compiler component error; contact Microsoft
  230.     D2031    too many flags/files in command; max of 128 arguments to CL
  231.  
  232. ^Microsoft C Command-Line Warning
  233.  
  234.     D4000    unknown command line warning in CL; contact Microsoft
  235.     D4001    listing overrides assembly output; /Fc and /Fa used together
  236.     D4002    unknown flag ignored by CL command
  237.     D4003    multiple processors selected for code generation
  238.     D4005    CL could not locate compiler component
  239.     D4007    /C must be used in conjunction with /P or /E or /EP
  240.     D4009    threshold valid for far/huge data models only; /Gt ignored
  241.     D4011    preprocessor listing specified; source listing not generated
  242.     D4012    function prototyping specified; source listing not generated
  243.     D4013    combined listing /Fc overrides object listing /Fl
  244.     D4014    invalid value for option; default value used
  245.     D4018    .DEF files supported in OS/2 only (/Lr /Lc)
  246.     D4019    string too long for /ND, /NT, /NM, /St, /Ss option of CL
  247.  
  248. ^Microsoft Link Errors (incomplete list)
  249.  
  250.     L2002    fixup overflow (probably incompatible memory models .OBJs)
  251.  
  252. ^Microsoft C Floating-Point Math Errors
  253.  
  254.     M6101    invalid operation occurred; usually NAN or infinity problem
  255.     M6102    denormal; significance loss with very small generated number
  256.     M6103    attempt to divide by zero in floating-point operation
  257.     M6104    overflow in floating-point operation
  258.     M6105    underflow occurred in floating-point operation
  259.     M6106    inexact; loss of precision occurred in FP operation
  260.     M6107    unemulated/unsupported 8087/287/387 instruction executed
  261.     M6108    square root operand somehow became negative; C won't allow
  262.     M6110    coprocessor or emulator stack overflow
  263.     M6111    stack underflow due to unretrieved double return values
  264.  
  265. ^Microsoft C Run-Time Errors
  266.  
  267.     R6000    stack overflow; stack needs enlarged or problem program
  268.     R6001    null pointer assignment, NULL segment modified
  269.     R6002    floating-point support not linked into executable
  270.     R6005    not enough memory to load child process (EXEC)
  271.     R6006    target executable is not a valid executable (EXEC)
  272.     R6007    invalid environment on exec of child process (EXEC)
  273.     R6008    not enough space for argument vector after program loads
  274.     R6009    not enough space for environment after program loads
  275.     R6010    abnormal program termination
  276.     R6012    illegal null near-pointer use
  277.     R6013    illegal out of range far-pointer use
  278.     R6016    not enough space for thread data
  279.     R6017    unexpected multithread lock error
  280.  
  281. :cl:MSC options
  282. ^Microsoft C Options (v6.0)
  283.  
  284. %    CL [options] [filenames] [libraries link-options]
  285.  
  286.     /AT      Tiny Memory Model; combined code and data limited to 64K
  287.     /AS      Small Memory Model; code and data limited to 64K each
  288.     /AM      Medium Memory Model; data is limited to 64K
  289.     /AC      Compact Memory Model; code is limited to 64K
  290.     /AL      Large Memory Model; unlimited code and data but arrays
  291.           are limited to 64K
  292.     /AH      Huge Memory Model; unlimited code, data and array size
  293.     /Astring  where string is compose of the following:
  294.  
  295. %          Code Pointer Control
  296.           s    all code pointers are near
  297.           l    all code pointers are far
  298.  
  299. %          Data Pointer Control
  300.           n    all data pointers are near
  301.           f    all data pointer are far
  302.           h    all data pointers are huge
  303.  
  304. %          Segment Setup Control
  305.           d    stack segment (SS) defaults to data segment (DS)
  306.           u    stack segment (SS) is not equal to data segment (DS);
  307.             DS is loaded on function entry
  308.           w    stack segment (SS) is not equal to data segment (DS);
  309.             DS is NOT loaded on function entry
  310.  
  311.     /B1[path] used to invoke the large version of the compiler C1L.EXE;
  312.           normally used when the compiler runs out of heap space
  313.     /B2      invokes large compiler version pass 2
  314.     /B3      invokes large compiler version pass 3
  315.     /C      preserves file comments when preprocessing a file
  316.     /c      do not link, create .OBJ file only
  317.     /D<string> defines string as a preprocessor constant.  If string is
  318.           of the form "ID=xxx" then "ID" represents the value "xxx"
  319.           If no equals sign is present, "ID" has the value 0.    If
  320.           an equals sign is present without a value, ID has the
  321.           value 1.
  322.     /E      output from preprocessor is written to stdout with
  323.           interspersed #line directives.
  324.     /EP      output from preprocessor is written to stdout without,
  325.           adding #line directives.
  326.     /F<size>  sets stack to <size> bytes.  Size must be hexadecimal.
  327.     /Fa[file] generate assembly listing.  Filename defaults to source
  328.           file with .ASM extension.
  329.     /Fb<file> creates bound executable.  Should be used only with /Lp.
  330.     /Fc[file] generates combined assembly/source listing.    The filename
  331.           defaults to the source file name with the .COD extension.
  332.     /Fe<file> creates the executable with specified name
  333.     /Fl[file] generates object code listing.   Default file name is the
  334.           source file name with a .COD extension.
  335.     /Fm[file] generate a link MAP file.  Default file name is the source
  336.           file name with the extension .MAP.
  337.     /Fo<file> generate and object file using the name <file>.
  338.     /FPa      generates floating point calls and selects the alternate
  339.           math library.
  340.     /FPc      generates floating point calls and selects the emulation
  341.           library.
  342.     /FPc87      generates floating point calls and selects the 80x87
  343.           library.
  344.     /FPi      generates inline 80x87 instructions and selects the 80x87
  345.           library.  Default floating point option.
  346.     /FPi87      generates floating point calls and selects the 80x87
  347.           library.
  348.     /Fr[file] generates a standard PWB Source Browser Database.  The
  349.           default name is the source file with the .SBR extension.
  350.     /FR[file] generates a standard PWB Source Browser Database.  The
  351.           default name is the source file with the .SBR extension.
  352.     /Fs      generate a source file listing with .LST extension.
  353.     /Fx      generate a cross reference listing with .CRF extension.
  354.     /G0      generate code using 8088/8086 instruction set
  355.     /G1      generate code using 80188/80186 instruction set
  356.     /G2      generate code using 80286 instruction set
  357.     /Gc      generate code using FORTRAN/PASCAL calling and naming
  358.           conventions
  359.     /Gd      generate code using standard C calling and naming
  360.           conventions (default)
  361.     /Ge      generate code using stack checking routines (default)
  362.     /Gi      incremental compile if used with /qc; only functions that
  363.           have changed are compiled;  implies /Li option
  364.     /Gm      strings are generated in the CONST segment
  365.     /Gr      _fastcall functions are enabled.   Parameters can be
  366.           passed via registers instead of on the stack
  367.     /Gs      suppress generation of stack checking code
  368.     /Gt[num]  places data items larger than "num" bytes into different
  369.           segments. The default value for "num is 256 bytes.
  370.     /Gw      generate Windows functions entry/exit code
  371.     /GW      generates more efficient Windows functions entry/exit
  372.           code.  Use /Gw for callback routines.
  373.     /H<num>   external name length restriction (default 31)
  374.     /HELP      calls QuickHelp utility.  /help is also valid.
  375.     /I<path>  inserts <path> in front of current include search path
  376.     /J      all chars should be unsigned (default is signed)
  377.     /Lc      linker is to generate compatibility mode programs.
  378.     /Li[num]  incremental link using ILINK instead of LINK.  Results
  379.           in larger EXE size.
  380.     /Lp      linker is to generate protected mode executable.
  381.     /Lr      linker is to create real mode executable.
  382.     /link <info> passes library names in <info> to LINK
  383.     /MA<opt>  passes <opt> to MASM if .ASM files found on command line
  384.     /MD      creates Dynamic Link Library for OS/2;  The same as:
  385.           /ALw /FPi /G2 /DDLL /DMT.   No library search record is defined
  386.     /ML      links the C run-time library as part of the Dynamic Link
  387.           Library.  The library search record is set to LLIBCDLL.LIB.
  388.            
  389.     /MT      enable multithread program support in OS/2
  390.     /ND<dseg> set data segment name to <dseg>
  391.     /NM<name> set module name to <name>
  392.     /nologo   suppress sign-on banner display
  393.     /NT<name> set code segment name to <name>
  394.     /O[opts]  where "opts" is a string containing the following:
  395.  
  396.         a   relax alias checking
  397.         c   enable block level local common expressions
  398.         d   disable all optimizations
  399.         e   enable global register optimization
  400.         g   enable global optimizations and global common
  401.             expressions
  402.         i   enable generation of intrinsic functions
  403.         l   enable loop optimization
  404.         n   disable unsafe loop optimization (default)
  405.         p   improve consistency in floating-point calculations
  406.         r   disable inline returns from functions
  407.         s   optimize for size
  408.         t   optimize for speed (default)
  409.         w   assume no aliasing except across function calls
  410.         x   maximize optimization (/Ocegilt/Gs)
  411.         z   enable maximum loop and global-register allocation
  412.             optimization
  413.  
  414.     /P       preprocess source generating .I intermediate file
  415.     /qc       quick compile option.  Incompatible with the following
  416.            options: /Fa /Fc /Fl /FPa /FPc /FPc87 /Fs /Gm /H /Ow /Zc
  417.     /Sl<wid>   set listing file line width to <wid> (79-132, default 79)
  418.     /Sp<len>   set page length  (15-255, default 63)
  419.     /Ss<stitle> set source listing subtitle
  420.     /St<title> set source listing title
  421.     /Ta<file>  <file> is to be treated as an assembler source file
  422.            regardless of the file extension
  423.     /Tc<file>  <file> is to be treated as an C source file regardless
  424.            of the file extension
  425.     /u       undefines all predefined indentifiers
  426.     /U<id>       undefines <id> predefined indentifier
  427.     /V<ver>    version string <ver> is copied to the .OBJ file
  428.     /w       suppress compiler warnings (same as /W0)
  429.     /W0       suppress compiler warnings
  430.     /W<n>       warning level (1..4) 1=fewer, 4=more warnings (default 1)
  431.     /WX       all warnings should be treated as fatal
  432.     /X       ignore standard places in include path search
  433.     /Za       disables Microsoft language extensions insuring ANSI
  434.            code compatibility
  435.     /Zc       pascal functions are to be case insensitive
  436.     /Zd       generate line number information for debuggers
  437.     /Ze       enable Microsoft C language extensions
  438.     /Zg       generate function prototypes and display via stdout
  439.            without compiling.
  440.     /Zi       generate symbolic debugging information
  441.     /Zl       suppress library search record generation
  442.     /Zp1       structures are not to be packed (Turbo C default)
  443.     /Zp2       pack structure on word boundaries
  444.     /Zp4       pack structure on dword boundary
  445.     /Zr       generate code to check null pointers and out of range
  446.            far pointers
  447.     /Zs<file>  perform syntax check only
  448.  
  449. %    Environment Variables
  450.  
  451.     CL       default input files and command line options
  452.     INCLUDE    paths to search for include files (separated by ";")
  453.     LIB       paths to search for library files (separated by ";")
  454.     LINK       command line options for link
  455.     TMP       path where temporary files are created
  456. :C escape sequences
  457. ^C Escape Sequences
  458.  
  459.             \a    Bell
  460.             \b    Backspace
  461.             \f    Form feed
  462.             \n    Line feed
  463.             \r    Carriage return
  464.             \t    Horizontal tab
  465.             \v    Vertical tab
  466.             \'    Single quote
  467.             \"    Double quote
  468.             \\    Backslash
  469.             \0    NULL character
  470.             \7    Bell
  471.             \ddd    Octal value
  472.             \xddd    Hexadecimal value
  473.  
  474. :C operators:operator precedence
  475. ^C Operators
  476.  
  477. %    Operation        C Operator        Associativity
  478.  
  479.     Array            []        ( ── )
  480.     Function        ()        ( ── )
  481.     Member            ->        ( ── )
  482.     Member            .        ( ── )
  483.  
  484.     Unary minus        -        ( ── )
  485.     Unary plus        +        ( ── )
  486.     Logical NOT        !        ( ── )
  487.     Bitwise compliment    ~~        ( ── )
  488.     Address of        &        ( ── )
  489.     Indirection        *        ( ── )
  490.     Sizeof            sizeof        ( ── )
  491.     Increment        ++        ( ── )
  492.     Decrement        --        ( ── )
  493.     Cast            (type)        ( ── )
  494.  
  495.     Multiplication        *        ( ── )
  496.     Division        /        ( ── )
  497.     Modulus         %        ( ── )
  498.  
  499.     Addition        +        ( ── )
  500.     Subtraction        -        ( ── )
  501.  
  502.     Shift right        >>        ( ── )
  503.     Shift left        <<        ( ── )
  504.  
  505.     Greater than        >        ( ── )
  506.     Greater or equal    >=        ( ── )
  507.     Less than        <        ( ── )
  508.     Less or equal        <=        ( ── )
  509.  
  510.     Equal            ==        ( ── )
  511.     Not equal        !=        ( ── )
  512.  
  513.     Bitwise AND        &        ( ── )
  514.  
  515.     Bitwise XOR        ^        ( ── )
  516.  
  517.     Bitwise OR        |        ( ── )
  518.  
  519.     Logical AND        &&        ( ── )
  520.  
  521.     Logical OR        ||        ( ── )
  522.  
  523.     Conditional        ?:        ( ── )
  524.  
  525.     Simple assignment    =        ( ── )
  526.     Addition assignment    +=        ( ── )
  527.     Subtraction assignment    -=        ( ── )
  528.     Multiplication assign    *=        ( ── )
  529.     Division assignment    \=        ( ── )
  530.     Modulus assignment    %=        ( ── )
  531.     Left shift assignment    <<=        ( ── )
  532.     Right shift assignment    >>=        ( ── )
  533.     Bitwise XOR assignment    ^=        ( ── )
  534.     Bitwise AND assignment    &=        ( ── )
  535.     Bitwise OR assignment    |=        ( ── )
  536.     Compliment assignment    ~~=        ( ── )
  537.  
  538.     Sequence operator    ,        ( ── )
  539.  
  540.  
  541.     - all operations grouped together have the same precedence
  542. :regs:byteregs:wordregs:sregs:regpack
  543. ^Register Structures for Turbo C and MS C
  544.  
  545. %        Turbo C             MS C
  546.  
  547. %    struct WORDREGS         struct WORDREGS
  548.        {                    {
  549.        unsigned int ax;            unsigned int ax;
  550.        unsigned int bx;            unsigned int bx;
  551.        unsigned int cx;            unsigned int cx;
  552.        unsigned int dx;            unsigned int dx;
  553.        unsigned int si;            unsigned int si;
  554.        unsigned int di;            unsigned int di;
  555.        unsigned int cflag;            unsigned int cflag;
  556.        unsigned int flags;            };
  557.        };
  558.  
  559. %    struct BYTEREGS
  560.        {
  561.        unsigned char al;
  562.        unsigned char ah;
  563.        unsigned char bl;
  564.        unsigned char bh;        ─  same as Turbo C
  565.        unsigned char cl;
  566.        unsigned char ch;
  567.        unsigned char dl;
  568.        unsigned char dh;
  569.        };
  570.  
  571. %    union REGS
  572.        {
  573.        struct   WORDREGS x;        ─  same as Turbo C
  574.        struct   BYTEREGS h;
  575.        };
  576.  
  577. %    struct SREGS
  578.        {
  579.        unsigned int es;
  580.        unsigned int cs;        ─  same as Turbo C
  581.        unsigned int ss;
  582.        unsigned int ds;
  583.        };
  584.  
  585. %    struct REGPACK
  586.        {
  587.        unsigned r_ax;
  588.        unsigned r_bx;
  589.        unsigned r_cx;
  590.        unsigned r_dx;
  591.        unsigned r_bp;        Turbo C only
  592.        unsigned r_si;
  593.        unsigned r_di;
  594.        unsigned r_ds;
  595.        unsigned r_es;
  596.        unsigned r_flags;
  597.        };
  598.  
  599. :abort
  600. ^void abort( void )
  601.  
  602.  
  603.     - prototype in stdlib.h & process.h
  604.  
  605.     - terminates a process & calls ~exit~(3)
  606.  
  607. :abs
  608. ^int abs( int n )
  609.  
  610.  
  611.     - prototype in stdlib.h
  612.  
  613.     - returns the absolute value of int n
  614.  
  615. :absread
  616. ^TC: int absread( int drive, int count, int start, void *buffer )
  617.  
  618.  
  619.     - prototype in dos.h
  620.  
  621.     - reads absolute logical disk sectors
  622.     - drive = (0=A:, 1=B:, 2=C:, ...)
  623.     - count = # of sectors to read
  624.     - start = beginning logical sector number
  625.     - buffer = address of buffer
  626.     - TC++ accounts for DOS 4.x+ long sector values while TC 2.0 and
  627.       earlier do not (see ~INT 25~)
  628.     - returns 0 if OK; -1 on error; errno has DOS error number
  629. :abswrite
  630. ^TC: int abswrite( int drive, int sectors, int start, void *buffer )
  631.  
  632.  
  633.     - prototype in dos.h
  634.  
  635.     - writes absolute logical disk sectors
  636.     - drive =  (0=A:, 1=B:, 2=C:, ...)
  637.     - sectors = # of sectors to write
  638.     - start = beginning logical sector number
  639.     - buffer = address of buffer
  640.     - TC++ accounts for DOS 4.x+ long sector values while TC 2.0 and
  641.       earlier do not (see ~INT 25~)
  642.     - returns 0 if OK; -1 on error; errno has DOS error number
  643. :access
  644. ^int access( const char *filename, int amode )
  645.  
  646.  
  647.     - prototype in io.h
  648.  
  649.     - checks filename for existence & R/W access
  650.  
  651.     - amode = 06 -- check for R/W permission
  652.           04 -- check for R
  653.           02 -- check for W
  654.           01 -- execute (ignored)
  655.           00 -- check if filename exists
  656.  
  657.     - filename can be directory
  658.     - returns 0 if OK
  659.          -1 on error
  660.             errno = ENOENT if path or filename not found
  661.             errno = EACCES if permission denied
  662.  
  663. :acos
  664. ^double acos( double x )
  665.  
  666.  
  667.     - prototype in math.h
  668.  
  669.     - returns arc cosine of x
  670.     - values must be in range -1 to 1
  671.  
  672. :alloca
  673. ^MSC: void *alloca( size_t size )
  674.  
  675.  
  676.     - prototype in malloc.h
  677.  
  678.     - allocates size bytes for the application stack
  679.     - memory is automatically freed upon exiting the calling function
  680.     - this function cannot be used as a parameter to another function
  681.       or stack corruption will occur
  682.     - the pointer returned CANNOT be passed as an argument to free()
  683.       since it isn't allocated from DOS
  684.     - see    ~stackavail~
  685. :allocmem
  686. ^TC: int allocmem( unsigned size, unsigned *seg )
  687.  
  688.  
  689.     - prototype in dos.h
  690.  
  691.     - allocates memory in size paragraphs, where seg is pointer to
  692.       a word containing segment address
  693.     - returns -1 if ok, else largest available memory in paragraphs
  694.     - MS C uses _dos_allocmem
  695.     - see  ~INT 21,48~
  696. :asctime
  697. ^char *asctime( const struct tm *tm )
  698.  
  699.  
  700.     - prototype in time.h
  701.  
  702.     - converts time in struct tm to 26-character ASCII string
  703.     - returns a pointer to the ASCII string
  704.  
  705. :asin
  706. ^double asin( double x )
  707.  
  708.  
  709.     - prototype in math.h
  710.  
  711.     - returns arc sine of x
  712.     - values must be in range -1 to 1
  713.  
  714. :assert
  715. ^void assert( int test )
  716.  
  717.  
  718.     - prototype in assert.h
  719.  
  720.     - if test fails, prints error message & aborts program
  721.     - test can be a condition
  722.  
  723. :atan
  724. ^double atan( double x )
  725.  
  726.  
  727.     - prototype in math.h
  728.  
  729.     - returns arc tangent of x
  730.  
  731. :atan2
  732. ^double tan( double y, double x )
  733.  
  734.  
  735.     - prototype in math.h
  736.  
  737.     - returns arc tangent of x*2
  738.     - used instead of atan when the resulting angle is near
  739.       pi/2 or -pi/2
  740.  
  741. :atexit
  742. ^int atexit( void func )
  743.  
  744.  
  745.     - prototype in stdlib.h
  746.  
  747.     - func is defined as void (*func)(void)
  748.     - calls func() before exiting to DOS
  749.     - up to 32 functions can be called (if 32 atexit calls registered)
  750.     - should be located in main & executed before anything else
  751.     - returns 0 if OK, else nonzero if no space to register function
  752.  
  753. :atof
  754. ^double atof( const char *s )
  755.  
  756.  
  757.     - prototype in math.h & stdlib.h
  758.  
  759.     - converts ASCII string "s" to a double value
  760.     - common problems with this function include forgetting to include
  761.       the header file that contains the prototype.  In this case atof()
  762.       will incorrectly return an "int"
  763.  
  764. :atoi
  765. ^int atoi( const char *s )
  766.  
  767.  
  768.     - prototype in stdlib.h
  769.  
  770.     - converts ASCII string to integer value
  771.  
  772. :atol
  773. ^long atol( const char *s )
  774.  
  775.  
  776.     - prototype in stdlib.h
  777.  
  778.     - converts ASCII string "s" to a long value
  779.     - common problems with this function include forgetting to include
  780.       the header file that contains the prototype.  In this case atol()
  781.       will incorrectly return an "int"
  782.  
  783. :bar:bar3d
  784. %    TC: void far bar(int left, int top, int right, int bottom)
  785. %    TC: void far bar3d(int left, int top, int right, int bottom,
  786. %            int depth, int topflag)
  787.  
  788.  
  789.     - prototype in graphics.h
  790.  
  791.     - draws a bar/3D bar in graphics mode
  792.  
  793. :bdos
  794. ^int bdos( int dosfun, unsigned dosdx, unsigned dosal )
  795.  
  796.  
  797.     - prototype in dos.h
  798.  
  799.     - make DOS system call for function dosfun, passing DX and AL
  800.       values via dosdx and dosal
  801.     - use only in small memory model
  802.     - unique to DOS
  803.     - returns value of AX set by system call
  804.  
  805. :bdosptr
  806. ^TC: int bdosptr( int dosfun, void *argument, unsigned dosal )
  807.  
  808.  
  809.     - prototype in dos.h
  810.  
  811.     - make DOS system call for function dosfun, passing POINTER
  812.       to values via argument and passing AL via dosal
  813.     - use for small or large memory models
  814.     - returns value of AX set by system call, else -1 on failure
  815.       (where errno & _doserrno are then set)
  816.  
  817. :_bfree:_ffree:_nfree
  818. %      MSC: void _bfree( _segment seg, void _based(void) *block )
  819. %      MSC: void _ffree( void far *block )
  820. %      MSC: void _nfree( void near *block )
  821.  
  822.  
  823.     - prototype in malloc.h
  824.  
  825.     - block = previously allocated buffer
  826.     - in large data memory models free() maps to _ffree()
  827.     - in small data memory models free() maps to _nfree()
  828.     - NULL pointer parameter is ignored
  829.  
  830. :_bios_disk
  831. ^MSC: unsigned _bios_disk(unsigned cmd,struct diskinfo_t *dskinfo)
  832.  
  833.  
  834.     - prototype in bios.h
  835.  
  836.     - cmd    = _DISK_RESET    resets disk system  (~INT 13,0~)
  837.         = _DISK_STATUS    return disk status  (~INT 13,1~)
  838.         = _DISK_READ    read disk sectors  (~INT 13,2~)
  839.         = _DISK_WRITE    write disk sectors  (~INT 13,3~)
  840.         = _DISK_VERIFY    verify disk sectors  (~INT 13,4~)
  841.         = _DISK_FORMAT    format disk track  (~INT 13,5~)
  842.  
  843.     - dskinfo = pointer to structure containing disk information:
  844.  
  845.     struct diskinfo_t
  846.        {
  847.        unsigned drive;        - physical drive number
  848.        unsigned head;        - head number
  849.        unsigned track;        - track number
  850.        unsigned sector;        - sector number
  851.        unsigned nsectors;        - sectors to deal with
  852.        void _far *buffer;        - data buffer
  853.        };
  854.  
  855.     - returns status of operation (AX register, AH contains status)
  856.     - drive numbers represent physical drives (0 = A:, 1 = B:,
  857.       80h = drive 0, 81h = drive 1
  858.     - disk reads should be retried at least 3 times
  859.     - Turbo C uses ~biosdisk~()
  860.  
  861.     - see  ~INT 13~
  862. :_bios_equiplist
  863. ^MSC: unsigned _bios_equiplist( void )
  864.  
  865.  
  866.     - prototype in bios.h
  867.  
  868.     - returns flags found in BIOS data area at 40:10 & 40:11
  869.     - Turbo C uses ~biosequip~()
  870.     - see  ~INT 11~
  871. :_bios_keybrd
  872. ^MSC: int _bios_keybrd( int cmd )
  873.  
  874.  
  875.     - prototype in bios.h
  876.  
  877.     - cmd    = _KEYBRD_READ  return next keystroke w/o echo (~INT 16,0~)
  878.         = _KEYBRD_READY  test if key avail; 0=none  (~INT 16,1~)
  879.         = _KEYBRD_SHIFTSTATUS  return shift key status (~INT 16,2~)
  880.         = _NKEYBRD_READ  return next keystroke w/o echo (~INT 16,10~)
  881.         = _NKEYBRD_READY  test if key avail; 0=none  (~INT 16,11~)
  882.         = _NKEYBRD_SHIFTSTATUS  return shift key status (~INT 16,12~)
  883.  
  884.     - AND returned value with 0x00FF to get ASCII value
  885.     - _NKEYBRD_READ, _NKEYBRD_READY, _NKEYBRD_SHIFTSTATUS are available
  886.       on AT and newer machines only
  887.     - Turbo C uses ~bioskey~()
  888.     - see  ~INT 16~
  889. :_bios_memsize
  890. ^MSC: unsigned _bios_memsize( void )
  891.  
  892.  
  893.     - prototype in bios.h
  894.  
  895.     - returns memory size in 1K blocks (16..640K)
  896.     - Turbo C uses ~biosmemory~()
  897.     - see  ~INT 12~
  898. :_bios_printer
  899. %    unsigned _bios_printer(unsigned cmd,unsigned port,unsigned data)
  900.  
  901.  
  902.     - prototype in bios.h
  903.  
  904.     - cmd     = _PRINTER_WRITE   print character  (~INT 17,0~)
  905.         = _PRINTER_INIT       initialize printer port  (~INT 17,1~)
  906.         = _PRINTER_STATUS  read port status  (~INT 17,2~)
  907.     - port    = printer port;    0=LPT1, 1=LPT2
  908.     - data    = value to write
  909.  
  910.     - returns status of printer (INT 17, AX reg, AH contains status)
  911.     - Turbo C uses ~biosprint~()
  912.     - see  ~INT 17~
  913. :_bios_serialcom
  914. ^MSC: unsigned _bios_serialcom(unsigned cmd,unsigned port,unsigned fmt)
  915.  
  916.     - prototype in bios.h
  917.  
  918.     - cmd    = _COM_INIT    initialize port  (~INT 14,0~)
  919.         = _COM_SEND    send character  (~INT 14,1~)
  920.         = _COM_RECEIVE    read character from port  (~INT 14,2~)
  921.         = _COM_STATUS    get serial port status  (~INT 14,3~)
  922.  
  923.     - fmt = combination of the following:
  924.         _COM_CHR7    _COM_CHR8
  925.         _COM_STOP1    _COM_STOP2
  926.  
  927.         _COM_NOPARITY    _COM_EVENPARITY       _COM_ODDPARITY
  928.  
  929.         _COM_110    _COM_150       _COM_300
  930.         _COM_600    _COM_1200       _COM_2400
  931.         _COM_4800    _COM_9600
  932.  
  933.     - returns status word (INT 14, AX reg, modem status in AL,
  934.       port status in AH)
  935.     - Turbo C uses ~bioscomm~()
  936.     - see  ~INT 14~
  937. :_bios_timeofday
  938. ^MSC: unsigned _bios_timeofday( unsigned cmd, long *timeval )
  939.  
  940.  
  941.     - prototype in bios.h
  942.  
  943.     - cmd    = _TIME_GETCLOCK    get real time clock  (~INT 1A,0~)
  944.         = _TIME_SETCLOCK    set real time clock  (~INT 1A,1~)
  945.  
  946.     - returns current BIOS clock count
  947.     - Turbo C uses ~biostime~()
  948.     - see  ~INT 1A~
  949. :bioscom
  950. ^TC: int bioscom( int cmd, char byte, int port )
  951.  
  952.     - prototype in bios.h
  953.  
  954.     - RS232 communications
  955.  
  956.     - cmd = 0 to set comm parms to value in byte
  957.         1 to send char in byte out on RS232 line
  958.         2 to receive char
  959.         3 to return current port status
  960.  
  961.     - port = 0 for COM1
  962.          1 for COM2
  963.          2 for COM3
  964.          3 for COM4
  965.  
  966.     - byte = bitwise OR of following bits
  967.          0x02 = 7 data bits    0x00 = 1 stop bit
  968.          0x03 = 8 data bits    0x04 = 2 stop bits
  969.          0x00 == no parity;
  970.          0x08 == odd parity;
  971.          0x18 == even parity
  972.  
  973.          0x00      110 bps    0x20     150 bps
  974.          0x40      300 bps    0x60     600 bps
  975.          0x80      1200 bps    0xa0     2400 bps
  976.          0xc0      4800 bps    0xe0     9600 bps
  977.  
  978.     - returns 16-bit integer, upper 8 bits are status & lower 8 bits
  979.       depending on cmd sent
  980.  
  981.  
  982.     │7│6│5│4│3│2│1│0│  low byte (AL)  modem status
  983.      │ │ │ │ │ │ │ └──── delta clear to send
  984.      │ │ │ │ │ │ └───── delta data set ready
  985.      │ │ │ │ │ └────── trailing edge ring detector
  986.      │ │ │ │ └─────── delta receive line signal detect
  987.      │ │ │ └──────── clear to send
  988.      │ │ └───────── data set ready
  989.      │ └────────── ring indicator
  990.      └─────────── receive line signal detect
  991.  
  992.     │F│E│D│C│B│A│9│8│  high byte (AH)  line status
  993.      │ │ │ │ │ │ │ └──── data ready
  994.      │ │ │ │ │ │ └───── overrun error
  995.      │ │ │ │ │ └────── parity error
  996.      │ │ │ │ └─────── framing error
  997.      │ │ │ └──────── break detect
  998.      │ │ └───────── transmit holding register empty
  999.      │ └────────── transmit shift register empty
  1000.      └─────────── time out
  1001.  
  1002.     - MS C uses ~_bios_serialcomm~()
  1003.     - see  ~INT 14~
  1004.  
  1005. :biosdisk
  1006. %      TC: int biosdisk( int cmd, int drive, int head, int track,
  1007. %                int sector, int nsects, void *buffer )
  1008.  
  1009.     - prototype in bios.h
  1010.  
  1011.     - issues interrupt 0x13 for BIOS disk operations
  1012.     - drive = (0=A:, 1=2nd floppy, 0x80=drive 0, 0x81=drive 1
  1013.     - cmd = 0  reset diskette system (hard disk drive reset)
  1014.         1  return status of last disk operation, ignore parms
  1015.         2  read nsects disk sectors, with starting sector
  1016.            defined by head, track, & sector, reading 512 bytes
  1017.            per sector into buffer
  1018.         3  write nsects disk sectors, with starting sector
  1019.            defined by head, track, & sector, writing 512 bytes
  1020.            per sector from buffer
  1021.         4  verify nsects disk sectors, with starting sector
  1022.            defined by head, track, & sector
  1023.         5  format a track defined by head & track, where buffer
  1024.            points to a table of sector headers to be written
  1025.  
  1026.      For XT or AT only:
  1027.  
  1028.         6 - formats a track & sets bad sector flags
  1029.         7 - formats drive beginning at specific track
  1030.         8 - returns current drive parms in 1rst 4 bytes of buffer
  1031.         9 - initializes drive-pair characteristics
  1032.        10 - long read (4 extra bytes per sector for ECC)
  1033.        11 - long write (4 extra bytes per sector for ECC)
  1034.        12 - disk seek
  1035.        13 - alternate disk reset
  1036.        14 - reads sector buffer
  1037.        15 - writes sector buffer
  1038.        16 - tests if named drive is ready
  1039.        17 - recalibrates drive
  1040.        18 - controller ram diagnostic
  1041.        19 - drive diagnostic
  1042.        20 - controller internal diagnostic
  1043.  
  1044.     - drive numbers represent physical drives (0 = A:, 1 = B:,
  1045.       80h = drive 0, 81h = drive 1
  1046.     - disk reads should be retried at least 3 times
  1047.     - MS C uses ~_bios_disk~()
  1048.     - see  ~INT 13~  for more return codes and more information
  1049. :biosequip
  1050. ^TC: int biosequip( void )
  1051.  
  1052.  
  1053.     - prototype in bios.h
  1054.  
  1055.     - returns integer showing equipment in system
  1056.     - MS C uses ~_bios_equiplist~()
  1057.     - see  ~INT 11~  or  ~EQUIPMENT FLAGS~   for bit meanings
  1058. :bioskey
  1059. ^TC: int bioskey( int cmd )
  1060.  
  1061.  
  1062.     - prototype in bios.h
  1063.  
  1064.     - keyboard operations
  1065.     - cmd    = 0  return next keystroke w/o echo  (~INT 16,0~)
  1066.         = 1  test if key waiting;  0=none  (~INT 16,1~)
  1067.         = 2  return shift key status  (~INT 16,2~)
  1068.  
  1069.  
  1070.     - AND returned value with 0x00FF to get ASCII value
  1071.     - Ctrl-Break causes "while (!bioskey(1))" to loop infinitely in
  1072.       Turbo C 2.0 and earlier since it places a zero in the keyboard queue
  1073.     - MS C uses ~_bios_keybrd~()
  1074.     - see    ~INT 16~
  1075. :biosmemory
  1076. ^TC: int biosmemory( void )
  1077.  
  1078.  
  1079.     - prototype in bios.h
  1080.  
  1081.     - returns BIOS size memory in 1K blocks
  1082.     - MS C uses ~_bios_memsize~()
  1083.     - see  ~INT 12~
  1084. :biosprint
  1085. ^TC: int biosprint( int cmd, int byte, int port )
  1086.  
  1087.     - prototype in bios.h
  1088.  
  1089.     - outputs byte to port
  1090.     - port = 0 (LPT1)
  1091.          1 (LPT2), etc...
  1092.     - cmd = 0 (print byte);
  1093.         1 (init printer port);
  1094.         2 (get LPT status)
  1095.  
  1096.     - returns status of (values are or'd flags):
  1097.       0x01 time out (cmd=0 means output error)
  1098.       0x08 I/O error
  1099.       0x10 selected
  1100.       0x20 out of paper
  1101.       0x40 acknowledge
  1102.       0x80 not busy
  1103.  
  1104.     - MS C uses ~_bios_printer~()
  1105.     - see    ~INT 17~
  1106. :biostime
  1107. ^TC: int biostime( int cmd, long newtime )
  1108.  
  1109.  
  1110.     - prototype in bios.h
  1111.  
  1112.     - reads or sets BIOS timer
  1113.     - cmd = 0  returns current value of timer
  1114.         1  sets timer to value of newtime
  1115.     - MS C uses ~_bios_timeofday~()
  1116.  
  1117. :_bmalloc:_fmalloc:_nmalloc
  1118. %    MSC: void _based(void) *_bmalloc( _segment seg, size_t size )
  1119. %    MSC: void far *_fmalloc( size_t size )
  1120. %    MSC: void near *_nmalloc( size_t size )
  1121.  
  1122.  
  1123.     - prototype in malloc.h
  1124.  
  1125.     - size = number of bytes to allocate
  1126.     - seg = base segment value
  1127.     - malloc() maps to _fmalloc or _nmalloc based on memory model
  1128.     - _fmalloc allocates memory outside the default data segment if
  1129.       possible
  1130.     - returns pointer to allocated block or NULL on error;    _bmalloc()
  1131.       function returns _NULLOFF on error
  1132.     - these functions will allocate a zero length block
  1133.  
  1134. :brk
  1135. ^int brk( void *endds )
  1136.  
  1137.  
  1138.     - prototype in alloc.h (malloc.h for MS C)
  1139.  
  1140.     - dynamically changes the amount of space allocated to the calling
  1141.       programs data segment.  Amount of allocated space increases as
  1142.       the break value increases.
  1143.     - returns 0 if OK
  1144.          -1 with errno set to ENOMEM
  1145.  
  1146. :bsearch
  1147. %    void *bsearch( void *key, void *base, int nelem, int width,
  1148. %            int (*fcmp )())
  1149.  
  1150.     - prototype in stdlib.h
  1151.  
  1152.     - does binary search for items in a table which is
  1153.       ALREADY sorted in ascending order
  1154.     - base points to 0th element of table
  1155.     - nelem contains number of entries in table
  1156.     - width contains number of bytes in each entry
  1157.     - key points to the search key
  1158.  
  1159.     - fcmp() points to comparison routine, where key and elem are
  1160.       passed to it as pointers.  Function fcmp() returns:
  1161.  
  1162.         integer < 0 if search key < elem;
  1163.         integer = 0 if equal;
  1164.         returns > 0 if search key > elem
  1165.  
  1166.     - returns 0 if no match found, else address of first
  1167.       entry that matches
  1168.  
  1169. :cabs
  1170. ^double cabs( struct complex z )
  1171.  
  1172.  
  1173.     - prototype in math.h
  1174.  
  1175.     - returns absolute value of int n
  1176.  
  1177. :calloc
  1178. ^void *calloc( unsigned count, unsigned sizeeach )
  1179.  
  1180.  
  1181.     - prototype in stdlib.h & alloc.h (malloc.h for MS C)
  1182.  
  1183.     - allocates main memory
  1184.     - see    ~malloc~()
  1185. :ceil
  1186. ^double ceil( double x )
  1187.  
  1188.  
  1189.     - prototype in math.h
  1190.  
  1191.     - rounds up x
  1192.  
  1193. :cgets
  1194. ^char *cgets( char *s )
  1195.  
  1196.  
  1197.     - prototype in conio.h
  1198.  
  1199.     - reads string from console
  1200.     - CR/LF combination is replaced by \0
  1201.     - before calling, s[0] should be the max length of string to input
  1202.     - on return, s[1] contains the actual string length
  1203.     - returns pointer to s[2], the actual data input
  1204.  
  1205. :_chain_intr
  1206. ^MSC: void _chain_intr( void (interrupt far *target)() )
  1207.  
  1208.  
  1209.     - prototype in dos.h
  1210.  
  1211.     - chains from one interrupt handler to another;  sets up the
  1212.       stack as if the interrupt was called directly by pushing the
  1213.       flags and the original return address on the stack
  1214.     - this function does not return to caller but returns to the
  1215.       code where the interrupt occurred
  1216.     - no corresponding function in Turbo C since Turbo C allows direct
  1217.       calling of interrupt functions
  1218.  
  1219. :chdir
  1220. ^int chdir( const char *path )
  1221.  
  1222.  
  1223.     - prototype in dir.h
  1224.  
  1225.     - changes current working directory to path.
  1226.     - returns 0 if OK; else -1 with errno set to ENOENT
  1227.  
  1228. :_chmod
  1229. ^TC: int _chmod( const char *filename, int func [,int attrib] )
  1230.  
  1231.  
  1232.     - prototype in io.h, also include dos.h
  1233.  
  1234.     - if func = 0, returns access mode of file
  1235.     - if func = 1, sets access mode of file
  1236.     - attrib can be one of the following:
  1237.  
  1238.             Turbo C        MSC
  1239.            FA_RDONLY     _A_RDONLY
  1240.            FA_HIDDEN     _A_HIDDEN
  1241.            FA_SYSTEM     _A_SYSTEM
  1242.  
  1243.  
  1244.     - if func = 1:
  1245.         returns  0 if OK
  1246.             -1 with errno set to ENOENT or EACCES
  1247.  
  1248.     - if func = 0:
  1249.         returns MSDOS attribute
  1250.  
  1251. :chmod
  1252. ^int chmod( const char *filename, int permiss)
  1253.  
  1254.  
  1255.     - prototype in io.h, also include stat.h
  1256.  
  1257.     - changes access mode of file according to mask given by permiss,
  1258.       where permiss is:
  1259.  
  1260.             S_IWRITE
  1261.             S_IREAD
  1262.             S_IWRITE | S_IREAD
  1263.  
  1264.     - returns 0 if OK
  1265.          -1 with errno set to ENOENT or EACCES
  1266.  
  1267. :_clear87
  1268. ^unsigned int _clear87( void )
  1269.  
  1270.  
  1271.     - prototype in float.h
  1272.  
  1273.     - clears 8087/80287 status word & other exceptions
  1274.     - returns old status word
  1275.     - see    ~_status87~()   ~_control87~()
  1276. :clearerr
  1277. ^void clearerr( FILE *stream )
  1278.  
  1279.  
  1280.     - prototype in stdio.h
  1281.  
  1282.     - resets error indication
  1283.     - see    ~ferror~()
  1284.  
  1285. :_clearscreen
  1286. ^MSC: void far _clearscreen( short target )
  1287.  
  1288.  
  1289.     - prototype in graph.h
  1290.  
  1291.     - target = _GCLEARSCREEN  clears screen
  1292.          = _GVIEWPORT  clears current viewport
  1293.          = _GWINDOW  clears current text window
  1294.     - available in graphics mode only
  1295.     - clears target area by filling with current background color
  1296.  
  1297. :clock
  1298. ^clock_t clock( void )
  1299.  
  1300.  
  1301.     - prototype in time.h
  1302.  
  1303.     - returns elapsed processor time used by the calling process,
  1304.       or -1L on error
  1305.     - C startup code retrieves the clock count as preparation for a 
  1306.       later call to clock()  (Turbo C++ and some versions of MS C)
  1307.     - resolution is limited to 54ms for both MS C and Turbo C due
  1308.       to the dependency on INT 8 clock tics
  1309.     - CLK_TCK is shouldn't be used unless CLOCKS_PER_SEC isn't available
  1310.       since the latter is defined by ANSI.
  1311.     - MS C uses INT 21,2C to get the processor time with 1000 as the
  1312.       value of CLK_TCK
  1313.     - Turbo C uses INT 1A,2 to get the processor time with 18 as the
  1314.       value of CLK_TCK
  1315.  
  1316.     - Example usage:
  1317.  
  1318.       clock_t start, finish, duration;
  1319.        
  1320.       start = clock();
  1321.       delay(2000);
  1322.       finish = clock();
  1323.       duration = finish - start;
  1324.       printf("%ld - %ld = %ld tics\n", start, finish, duration);
  1325. :_close
  1326. ^TC: int _close( int fh )
  1327.  
  1328.  
  1329.     - prototype in io.h
  1330.  
  1331.     - closes file fh where fh is file handle from ~_creat~(), ~creat~(),
  1332.       ~creatnew~(), ~creattemp~(), ~dup~(), ~dup2~(), ~_open~(), or
  1333.       ~open~().
  1334.     - use ~fdopen~() to change file handle to file stream.
  1335.     - does not write a Ctrl-Z to a text file on closing
  1336.     - returns 0 if OK;  -1 & errno=EBADF
  1337.     - MS C uses ~_dos_close~()
  1338.  
  1339.     - see    ~INT 21,3E~
  1340. :close
  1341. ^int close( int fh )
  1342.  
  1343.  
  1344.     - prototype in io.h
  1345.  
  1346.     - closes file fh where fh is file handle from ~_creat~(), ~creat~(),
  1347.       ~creatnew~(), ~creattemp~(), ~dup~(), ~dup2~(), ~_open~(), or
  1348.       ~open~()
  1349.     - use ~fdopen~() to change file handle to file stream
  1350.     - does not write a Ctrl-Z to a text file on closing
  1351.     - returns 0 if OK; else -1 & errno may be set of EBADF
  1352.  
  1353. :_control87
  1354. ^MSC: unsigned _control87( unsigned new, unsigned mask )
  1355.  
  1356.     - prototype in float.h
  1357.  
  1358.     - used to change floating point handling and exception masking
  1359.     - new = contains corresponding bit values for any bit set in "mask"
  1360.         to be moved into the coprocessor control word
  1361.     - mask    = zero; gets floating-point coprocessor control word
  1362.         = non-zero; if any bit is set, the corresponding bit in
  1363.           "new" is moved into the coprocessor control word
  1364.     - returns floating-point coprocessor control word
  1365.     - default control word is the logical OR of: IC_AFFINE, RC_NEAR,
  1366.       PC_64, EM_DENORMAL, EM_UNDERFLOW, EM_INEXACT
  1367.  
  1368.  
  1369. %    Control Word Mask and Bits
  1370.  
  1371.     MCW_EM        interrupt exception control
  1372.     MCW_IC        infinity control
  1373.     MCW_RC        rounding control
  1374.     MCW_PC        precision control
  1375.  
  1376. %    Exception Masks
  1377.  
  1378.     EM_INVALID    invalid
  1379.     EM_DENORMAL    denormal
  1380.     EM_ZERODIVIDE    zero divide
  1381.     EM_OVERFLOW    overflow
  1382.     EM_UNDERFLOW    underflow
  1383.     EM_INEXACT    inexact (precision)
  1384.  
  1385. %    Infinity Control
  1386.  
  1387.     IC_AFFINE    affine
  1388.     IC_PROJECTIVE    projective
  1389.  
  1390. %    Rounding Control
  1391.  
  1392.     RC_CHOP        truncate
  1393.     RC_UP        round up
  1394.     RC_DOWN        round down
  1395.     RC_NEAR        near
  1396.  
  1397. %    Precision Control
  1398.  
  1399.     PC_24        24 bits precision
  1400.     PC_53        53 bits precision
  1401.     PC_64        64 bits precision
  1402.  
  1403. %    User Status Word Bits
  1404.  
  1405.     SW_INVALID    invalid
  1406.     SW_DENORMAL    denormal
  1407.     SW_ZERODIVIDE    zero divide
  1408.     SW_OVERFLOW    overflow
  1409.     SW_UNDERFLOW    underflow
  1410.     SW_INEXACT    inexact precision
  1411.  
  1412. %    Invalid Subconditions (if SW_INVALID)
  1413.  
  1414.     SW_UNEMULATED    unemulated instruction
  1415.     SW_SQRTNEG    square root of a neg number
  1416.     SW_STACKOVERFLOW  FP stack overflow
  1417.     SW_STACKUNDERFLOW FP stack underflow
  1418.  
  1419. %    Floating Point Errors
  1420.  
  1421.     FPE_INVALID
  1422.     FPE_DENORMAL
  1423.     FPE_ZERODIVIDE
  1424.     FPE_OVERFLOW
  1425.     FPE_UNDERFLOW
  1426.     FPE_INEXACT
  1427.     FPE_UNEMULATED
  1428.     FPE_SQRTNEG
  1429.     FPE_STACKOVERFLOW
  1430.     FPE_STACKUNDERFLOW
  1431.     FPE_EXPLICITGEN
  1432.  
  1433.     - see    ~_clear87~()   ~_status87~()
  1434. :coreleft
  1435. %        TC: unsigned coreleft( void )
  1436. %        TC: unsigned long coreleft( void )
  1437.  
  1438.  
  1439.     - prototype in alloc.h
  1440.  
  1441.     - returns a measure of unused memory (see ~malloc~())
  1442.     - return value is int for models tiny, small, medium
  1443.       return value is long for models compact, large, huge
  1444.     - no corresponding function in MS C
  1445. :cos
  1446. ^double cos( double x )
  1447.  
  1448.  
  1449.     - prototype in math.h
  1450.  
  1451.     - returns the cosine of angle x
  1452.     - x must be in radians
  1453.  
  1454. :cosh
  1455. ^double cosh( double x )
  1456.  
  1457.  
  1458.     - prototype in math.h
  1459.  
  1460.     - returns the hyperbolic cosine of angle x
  1461.     - x must be in radians
  1462.  
  1463. :country
  1464. ^TC: struct country *country(int cntrycode,struct country *cntryp)
  1465.  
  1466.  
  1467.     - prototype in dos.h
  1468.  
  1469.     - returns country-dependent information
  1470.  
  1471. :cprintf
  1472. ^int cprintf( char *format [, argument,...] )
  1473.  
  1474.  
  1475.     - prototype in conio.h
  1476.  
  1477.     - sends formatted output to the console
  1478.     - TC use either direct memory writes or BIOS calls depending on the
  1479.       value of the external integer directvideo
  1480.     - see    ~PRINTF SPEC~   for format specifications
  1481. :cputs
  1482. ^void cputs( char *s )
  1483.  
  1484.  
  1485.     - prototype in conio.h
  1486.  
  1487.     - writes string s to console
  1488.     - TC: uses either direct memory writes or BIOS calls depending
  1489.       on the value of the extern directvideo
  1490.  
  1491. :_creat
  1492. ^TC: int _creat( const char *fname, int attr )
  1493.  
  1494.  
  1495.     - prototype in io.h, also include dos.h
  1496.  
  1497.     - creates new file (overwrites existing file) of filename with file
  1498.       attribute attr, for both read/write
  1499.     - attr can be a combination of the following
  1500.  
  1501.       FA_RDONLY   set read only attribute
  1502.       FA_HIDDEN   set hidden attribute
  1503.       FA_SYSTEM   set system attribute
  1504.  
  1505.     - file is created in O_BINARY mode
  1506.     - returns nonnegative integer if OK, else -1
  1507.     - uses DOS function ~INT 21,3C~
  1508.     - MSC uses ~_dos_creat~()
  1509.  
  1510. :creat
  1511. ^int creat( const char *filename, int permis )
  1512.  
  1513.  
  1514.     - prototype in io.h, also include stat.h
  1515.  
  1516.     - creates new file (overwrites existing file) of filename
  1517.       with access permission "permis" which is:
  1518.  
  1519.         S_IWRITE
  1520.         S_IREAD
  1521.         S_IWRITE | S_IREAD
  1522.  
  1523.       for permission to write, read or read/write.
  1524.  
  1525.     - file is created set to _fmode (O_TEXT or O_BINARY)
  1526.  
  1527. :creatnew
  1528. %    TC:  int creatnew( const char *fname, int attr )
  1529. %    MSC: unsigned creatnew( const char *fname, unsigned attr, int fh )
  1530.  
  1531.  
  1532.     - prototype in io.h, also include dos.h
  1533.  
  1534.     - creates new file filename with file attribute attr:
  1535.     - attr consists of a combination of the following:
  1536.  
  1537.       FA_RDONLY   set read only attribute
  1538.       FA_HIDDEN   set hidden attribute
  1539.       FA_SYSTEM   set system attribute
  1540.  
  1541.     - returns nonnegative integer if OK, else -1
  1542.     - file is created set to _fmode (O_TEXT or O_BINARY)
  1543.     - TC: returns nonnegative integer if OK, else -1
  1544.       MSC: return 0 if ok, or DOS error code
  1545.  
  1546. :creattemp
  1547. ^TC: int creattemp( char *filename, int attr )
  1548.  
  1549.  
  1550.     - prototype in io.h, also include dos.h
  1551.  
  1552.     - creates new file (overwrites existing file) of filename with file
  1553.       attribute attrib, for both read/write
  1554.     - attr consists of a combination of the following:
  1555.  
  1556.       FA_RDONLY   set read only attribute
  1557.       FA_HIDDEN   set hidden attribute
  1558.       FA_SYSTEM   set system attribute
  1559.  
  1560.     - filename is a path name ending in a backslash (\); when file is
  1561.       created, filename has a unique path name
  1562.     - file is created set to _fmode (O_TEXT or O_BINARY)
  1563.     - returns nonnegative integer if OK, else -1
  1564. :cscanf
  1565. ^int cscanf( const char *format [,argument,...] )
  1566.  
  1567.  
  1568.     - prototype in conio.h
  1569.  
  1570.     - performs formatted input from console
  1571.  
  1572.  
  1573.     - see    ~SCANF~  and  ~SCANF SPEC~
  1574. :ctime
  1575. ^char *ctime( const long *clock )
  1576.  
  1577.  
  1578.     - prototype in time.h
  1579.  
  1580.     - converts date and time to a string
  1581.     - clock is a long integer (such as that returned by time())
  1582.     - generates a 26-character string for date and time
  1583.     - returns pointer to string
  1584.  
  1585. :ctrlbrk
  1586. ^TC: void ctrlbrk( int (*fptr )(void) )
  1587.  
  1588.  
  1589.     - prototype in dos.h
  1590.  
  1591.     - sets a new control-break handler function pointed to by fptr
  1592.     - if Ctrl-C hit, then function pointed to by fptr is called
  1593.     - use ~longjmp~() to return to a given point in the program
  1594.  
  1595. :dieeetomsbin:dmsbintoieee:fieeetomsbin:fmsbintoieee
  1596. %    MSC: int dieeetomsbin( double *srcdbl, double *dstdbl )
  1597. %    MSC: int dmsbintoieee( double *srcdbl, double *dstdbl )
  1598. %    MSC: int fieeetomsbin( float *srcflt, float *dstflt )
  1599. %    MSC: int fmsbintoieee( float *srcflt, float *dstflt )
  1600.  
  1601.  
  1602.     - prototype in math.h
  1603.  
  1604.     dieeetomsbin() converts IEEE double to Microsoft double
  1605.     dmsbintoieee() converts Microsoft double to IEEE double
  1606.     fieeetomsbin() converts IEEE float to Microsoft float
  1607.     fmsbintoieee() converts Microsoft float to IEEE float
  1608.  
  1609.     - srcdbl and srcflt are pointers to source values
  1610.     - dstdbl and dstflt are pointers to the destination
  1611.     - returns 0 for success; 1 for failure (overflow)
  1612.  
  1613. :difftime
  1614. ^double difftime( time_t time2, time_t time1 )
  1615.  
  1616.  
  1617.     - prototype in time.h
  1618.  
  1619.     - returns (time2-time1) difference in seconds (double)
  1620.  
  1621. :disable:_disable
  1622. %           TC:    void disable( void )
  1623. %           MSC: void _disable( void )
  1624.  
  1625.  
  1626.     - prototype in dos.h
  1627.  
  1628.     - disables all interrupts except NMI via ~CLI~ instruction
  1629.  
  1630. :_displaycursor
  1631. ^MSC: short far _displaycursor( short flag )
  1632.  
  1633.  
  1634.     - prototype in graph.h
  1635.  
  1636.     - flag = _GCURSORON  turn cursor on
  1637.          _GCURSOROFF turn cursor off
  1638.     - cursor is normally turned off while in graphics mode; calling
  1639.       this function determines whether cursor is displayed upon
  1640.       exit from graphics mode
  1641.     - returns previous value of cursor state flag
  1642.  
  1643. :div (c):ldiv
  1644. %        MSC: struct _div_t div( int numer, int denom )
  1645. %        MSC: struct _ldiv_t ldiv( long int numer, long int denom )
  1646.  
  1647.  
  1648.     - prototype in stdlib.h
  1649.  
  1650.     - divides numerator by denominator giving quotient and remainder
  1651.     - returns div_t or ldiv_t structure of the form:
  1652.  
  1653.     struct _div_t        struct _ldiv_t
  1654.         {                {
  1655.         int quot;            long quot;
  1656.         int rem;            long rem;
  1657.         };                 };
  1658.  
  1659.  
  1660. :_dos_allocmem
  1661. ^MSC: unsigned _dos_allocmem( unsigned size, unsigned *seg )
  1662.  
  1663.  
  1664.     - prototype in dos.h
  1665.  
  1666.     - size = number of paragraphs to allocate
  1667.     - seg = pointer to buffer to contain allocated segment value
  1668.     - returns 0 on success or DOS error code on failure
  1669.     - Turbo C uses ~allocmem~()
  1670.     - see    ~INT 21,48~
  1671. :_dos_close
  1672. ^MSC: unsigned _dos_close( int handle )
  1673.  
  1674.  
  1675.     - prototype in dos.h
  1676.  
  1677.     - handle is standard DOS file handle attained through ~_dos_creat~(),
  1678.       ~_dos_creat~(), ~_dos_creatnew~(), ~_dos_open~(), ~dup~(), ~open~()
  1679.     - returns 0 on success or DOS error code on failure
  1680.     - does not write a Ctrl-Z to a text file on closing
  1681.     - see    ~INT 21,3E~
  1682. :_dos_creat:_dos_creatnew
  1683. %    MSC: unsigned _dos_creatnew(char *fname,unsigned attr,int *handle)
  1684. %    MSC: unsigned _dos_creat(char *fname,unsigned attr,int *handle)
  1685.  
  1686.  
  1687.     - prototype in dos.h
  1688.  
  1689.     - fname = a valid DOS file name
  1690.     - attr    = DOS file attribute
  1691.         = _A_RDONLY
  1692.         = _A_HIDDEN
  1693.         = _A_SYSTEM
  1694.         = _A_ARCH
  1695.     - handle = pointer to location to receive handle
  1696.     - returns 0 on success or DOS error code on failure
  1697.     - if file sharing is installed, file is opened in compatibility mode
  1698.     - see    ~INT 21,3C~   ~INT 21,5B~
  1699. :_dos_freemem
  1700. ^MSC: unsigned _dos_freemem( unsigned seg )
  1701.  
  1702.  
  1703.     - prototype in dos.h
  1704.  
  1705.     - frees memory allocated via _dos_allocmem() or INT 21,49
  1706.     - returns 0 on success or DOS error code
  1707.     - Turbo C uses ~freemem~()
  1708.     - see    ~INT 21,49~
  1709. :_dos_getdate
  1710. ^MSC: void _dos_getdate( struct dosdate_t *date )
  1711.  
  1712.  
  1713.     - prototype in dos.h
  1714.  
  1715.     - date = pointer to structure to contain returned data of format:
  1716.  
  1717.     struct dosdate_t
  1718.       {
  1719.       unsigned char day;        - [1-31]
  1720.       unsigned char month;        - [1-12]
  1721.       unsigned int    year;        - [1980-2099]
  1722.       unsigned char dayofweek;    - [0-6] = Sun..Sat
  1723.       };
  1724.  
  1725.     - Turbo C uses ~getdate~()
  1726.     - see    ~INT 21,2A~
  1727. :_dos_getdiskfree
  1728. %    MSC: unsigned _dos_getdiskfree(unsigned drv,struct diskfree_t *spc)
  1729.  
  1730.  
  1731.     - prototype in dos.h
  1732.  
  1733.     - drive =  1 = A:, 2 = B:, 3 = C:, ...
  1734.     - spc = structure to contains disk status information
  1735.     - returns 0 on success or DOS error code on failure
  1736.  
  1737.     struct diskfree_t
  1738.        {
  1739.        unsigned total_clusters;        - count of all disk clusters
  1740.        unsigned avail_clusters;        - free unallocated clusters
  1741.        unsigned sectors_per_cluster;
  1742.        unsigned bytes_per_sector;
  1743.        };
  1744.  
  1745.     - Turbo C uses ~getdfree~()
  1746.     - see    ~INT 21,36~
  1747. :_dos_getdrive
  1748. ^MSC: void _dos_getdrive( unsigned *drive )
  1749.  
  1750.  
  1751.     - prototype in dos.h
  1752.  
  1753.     - drive = pointer to buffer to receive drive number;
  1754.           0 = A:, 1 = B:, ...
  1755.     - Turbo C uses ~getdisk~()
  1756.     - see    ~INT 21,19~
  1757. :_dos_getfileattr
  1758. ^MSC: unsigned _dos_getfileattr( char *path, unsigned *attr )
  1759.  
  1760.  
  1761.     - prototype in dos.h
  1762.  
  1763.     - path = any valid DOS file name
  1764.     - attr = file attribute:
  1765.  
  1766.         _A_NORMAL
  1767.         _A_RDONLY
  1768.         _A_HIDDEN
  1769.         _A_SYSTEM
  1770.         _A_VOLID
  1771.         _A_SUBDIR
  1772.         _A_ARCH
  1773.  
  1774.     - returns zero on success; nonzero on failure
  1775.     - no corresponding function in Turbo C
  1776.     - see    ~INT 21,43~
  1777. :_dos_getftime
  1778. ^MSC: unsigned _dos_getftime(int h,unsigned *date,unsigned *time)
  1779.  
  1780.  
  1781.     - prototype in dos.h
  1782.  
  1783.     - h = open file handle
  1784.     - date = pointer to memory to receive file date
  1785.     - time = pointer to memory to receive file time
  1786.     - returns 0 on success or DOS error code
  1787.     - Turbo C uses ~getftime~()
  1788.     - see    ~INT 21,57~   ~_dos_setftime~()
  1789. :_dos_gettime
  1790. ^MSC: void _dos_gettime( struct dostime_t *time )
  1791.  
  1792.  
  1793.     - prototype in dos.h
  1794.  
  1795.     - returns DOS time into "time"
  1796.  
  1797.     struct dostime_t
  1798.         {
  1799.         unsigned char hour;        - [0-23]
  1800.         unsigned char minute;    - [0-59]
  1801.         unsigned char second;    - [0-59]
  1802.         unsigned char hsecond;    - hundreths of a second 0-99
  1803.         };
  1804.  
  1805.     - Turbo C uses ~gettime~()
  1806.     - see    ~_dos_setttime~()
  1807. :_dos_getvect
  1808. ^MSC: void (interrupt far *_dos_getvect( unsigned intnum ))()
  1809.  
  1810.  
  1811.     - prototype in dos.h
  1812.  
  1813.     - intnum = interrupt to get address of (0..255)
  1814.     - returns far pointer to interrupt handler routine
  1815.  
  1816.     - Turbo C uses ~getvect~()
  1817.     - see    ~INT 21,35~   ~_dos_setvect~()
  1818. :_dos_keep
  1819. ^MSC: void _dos_keep( unsigned rc, unsigned size )
  1820.  
  1821.  
  1822.     - prototype in dos.h
  1823.  
  1824.     - rc = return code to pass to parent process
  1825.     - size = number of paragraphs to remain resident
  1826.  
  1827.     - Turbo C uses ~keep~()
  1828.     - see    ~INT 21,31~
  1829. :_dos_open
  1830. ^MSC: unsigned _dos_open( char *fname, unsigned mode, int *handle )
  1831.  
  1832.     - prototype in dos.h, fcntl.h (also include share.h)
  1833.  
  1834.     - fname = valid DOS file name
  1835.     - mode    = file access permission (a logical or of the following)
  1836.         = O_NOINHERIT    file can't be inherited by child process
  1837.         = O_RDONLY    file is read only
  1838.         = O_RDWR    file is read/write
  1839.         = O_WRONLY    file is write only
  1840.         = SH_COMPAT    file sharing compatibility mode
  1841.         = SH_DENYNONE    file sharing deny neither read nor write
  1842.         = SH_DENYRD    file sharing deny read
  1843.         = SH_DENYRW    file sharing deny read/write
  1844.         = SH_DENYWR    file sharing deny write
  1845.  
  1846.     - handle = pointer to memory to contain handle
  1847.     - does not creat files, they must currently exist (see ~_dos_creat~())
  1848.     - returns 0 on success or DOS error code
  1849.  
  1850.     - Turbo C uses ~_open~()
  1851.     - see    ~INT 21,3D~  ~_dos_close~()  ~_dos_read~()
  1852.         ~_dos_write~()    ~_dos_creat~()
  1853. :_dos_read
  1854. %        MSC: unsigned _dos_read( int handle, void far *buffer,
  1855. %                    unsigned count, unsigned *nread )
  1856.  
  1857.  
  1858.     - prototype in dos.h
  1859.  
  1860.     - handle = opened file handle
  1861.     - buffer = receives data read from file
  1862.     - count = number of bytes to read
  1863.     - nread = receives the number of bytes actually read
  1864.     - returns 0 on success or DOS error code
  1865.  
  1866.     - Turbo C uses ~_open~()
  1867.     - see    ~INT 21,3F~   ~_dos_open~()  ~_dos_write~()  ~_dos_close~()
  1868. :_dos_setblock
  1869. %      MSC: unsigned _dos_setblock( unsigned size, unsigned seg,
  1870. %                    unsigned *maxsize )
  1871.  
  1872.  
  1873.     - prototype in dos.h
  1874.  
  1875.     - size = new block size
  1876.     - seg = segment of DOS memory block to change
  1877.     - maxsize = size of buffer actually allocated if size not available
  1878.  
  1879.     - returns 0 on success or DOS error code on failure
  1880.  
  1881.     - Turbo C uses ~setblock~()
  1882.     - see    ~INT 21,4A~   ~_dos_allocmem~()   ~_dos_freemem~()
  1883. :_dos_setdate
  1884. ^MSC: unsigned _dos_setdate( struct dosdate_t *date )
  1885.  
  1886.  
  1887.     - prototype in dos.h
  1888.  
  1889.     - date = receives date information
  1890.     - returns 0 on success or DOS error code on failure
  1891.     - sets DOS date via INT 21,2B
  1892.     - DOS 3.3+ also sets CMOS clock
  1893.  
  1894.     - MS C uses ~_dos_setdate~()
  1895.     - see ~INT 21,2B~   ~_dos_getdate~()
  1896. :_dos_setdrive
  1897. ^MSC: void _dos_setdrive( unsigned drive, unsigned *count )
  1898.  
  1899.  
  1900.     - prototype in dos.h
  1901.  
  1902.     - drive = drive to set as default;  1 = A:, 2 = B:, ...
  1903.     - count = receives simple count of total drives in system
  1904.     - does not return error if invalid drive is requested, use
  1905.       _dos_getdrive() to see if requested drive was set
  1906.  
  1907.     - Turbo C uses ~setdisk~()
  1908.     - see    ~INT 21,E~   ~_dos_getdrive~()
  1909. :_dos_setfileattr
  1910. ^MSC: unsigned _dos_setfileattr( char *path, unsigned attr )
  1911.  
  1912.  
  1913.     - prototype in dos.h
  1914.  
  1915.     - path = valid DOS file name
  1916.     - attr    = file attribute (logical OR of the following):
  1917.         = _A_ARCH
  1918.         = _A_HIDDEN
  1919.         = _A_NORMAL
  1920.         = _A_RDONLY
  1921.         = _A_SUBDIR
  1922.         = _A_SYSTEM
  1923.         = _A_VOLID
  1924.  
  1925.     - returns 0 on success or DOS error code on failure
  1926.  
  1927.     - see    ~INT 21,43~   ~_dos_getfileattr~()
  1928. :_dos_setftime
  1929. ^MSC: unsigned _dos_setftime(int handle,unsigned date,unsigned time)
  1930.  
  1931.  
  1932.     - prototype in dos.h
  1933.  
  1934.     - handle = opened file handle
  1935.     - date = date to set last file write  (see FILE ATTRIBUTES)
  1936.     - time = time to set last file write  (see FILE ATTRIBUTES)
  1937.     - returns 0 on success or DOS error code on failure
  1938.  
  1939.     - Turbo C uses ~setftime~()
  1940.     - see    ~INT 21,57~   ~_dos_getftime~()   ~FILE ATTRIBUTES~
  1941. :_dos_settime
  1942. ^MSC: unsigned _dos_settime( struct dostime_t *time )
  1943.  
  1944.  
  1945.     - prototype in dos.h
  1946.  
  1947.     - time = structure containing new time values
  1948.     - returns 0 on success or DOS error code on failure
  1949.     - sets MS-DOS time via INT 21,2D
  1950.     - DOS 3.3+ also sets CMOS clock
  1951.  
  1952.     - Turbo C uses ~settime~()
  1953.     - see    ~INT 21,2D~   ~_dos_gettime~()
  1954. :_dos_setvect
  1955. %    MSC: void  _dos_setvect( unsigned intnum,
  1956. %                 void (interrupt far *handler)() )
  1957.  
  1958.  
  1959.     - prototype in dos.h
  1960.  
  1961.     - intnum = interrupt vector to set  (0..255)
  1962.     - handler = new interrupt routine
  1963.  
  1964.     - Turbo C uses ~setvect~()
  1965.     - see  ~INT 21,25~   ~_dos_getvect~()
  1966. :_dos_write
  1967. %       MSC: unsigned _dos_write( int handle, void far *buffer,
  1968. %                    unsigned count, unsigned *nbytes )
  1969.  
  1970.  
  1971.     - prototype in dos.h
  1972.  
  1973.     - handle = opened file handle
  1974.     - buffer = buffer of data to write to file
  1975.     - count = number of bytes to write
  1976.     - nbytes = receives the number of bytes actually written
  1977.     - returns 0 on success or DOS error code on failure
  1978.  
  1979.     - Turbo C uses ~_write~()
  1980.     - see    ~INT 21,40~   ~_dos_open~()  ~_dos_close~()  ~_dos_read~()
  1981. :dosexterr
  1982. %        TC:  int dosexterr( struct DOSERR *errinfo )
  1983. %        MSC: int dosexterr( struct DOSERROR *errinfo )
  1984.  
  1985.  
  1986.     - prototype in dos.h
  1987.  
  1988.     - returns extended error information (unique to MSDOS 3.0+)
  1989.     - errinfo is pointer to DOSERR/DOSERROR structure (defined in dos.h)
  1990.     - if 0 returned, previous DOS call did not result in error
  1991.     - see   perror
  1992. :dostounix
  1993. ^TC: long dostounix( struct date *dateptr, struct time *timeptr )
  1994.  
  1995.  
  1996.     - prototype in dos.h
  1997.  
  1998.     - converts date (as from ~getdate~()) and time (as from ~gettime~())
  1999.       into UNIX format
  2000.  
  2001. :dup
  2002. ^int dup( int handle )
  2003.  
  2004.  
  2005.     - prototype in io.h
  2006.  
  2007.     - returns a new file handle that duplicates the old handle
  2008.     - returns -1 on error
  2009.  
  2010. :dup2
  2011. ^int dup2( int oldhandle, int newhandle )
  2012.  
  2013.  
  2014.     - prototype in io.h
  2015.  
  2016.     - returns a new file handle that duplicates the old handle
  2017.       equal to newhandle.  If newhandle exists, the corresponding
  2018.       file is closed.
  2019.     - returns -1 on error
  2020.  
  2021. :ecvt
  2022. ^char *ecvt( double value, int ndigit, int *decpt, int *sign )
  2023.  
  2024.  
  2025.     - prototype in stdlib.h
  2026.  
  2027.     - converts a floating pt number to a string of ndigit digits,
  2028.       returning pointer to that string
  2029.     - decpt is position of decimal point (negative value means
  2030.       to left of returned digits) and sign is 0 if positive,
  2031.       else negative
  2032.  
  2033. :_ellipse:_ellipse_w:_elipse_wxy
  2034. %    MSC: short _ellipse(short ctl,short x1,short y1,short x2,short y2)
  2035.  
  2036. %    MSC: short _ellipse_w( short ctl, double wx1, double wy1,
  2037. %                double wx2, double wy2 )
  2038.  
  2039. %    MSC: short far _ellipse_wxy(short ctl,struct _wxycoord far *pwxy1,
  2040. %                struct _wxycoord far *pwxy2 )
  2041.  
  2042.     - prototype in graph.h
  2043.  
  2044.     - ctl    = _GFILLINTERIOR    fill ellipse with current fill mask
  2045.         = _GBORDER        don't fill ellipse
  2046.     - returns nonzero value if ellipse is drawn ok, zero otherwise
  2047.     - center of ellipse is center of bounding rectangle specified by
  2048.       supplied coordinates
  2049.  
  2050.     - see    ~_setfillmask~()
  2051. :enable:_enable
  2052. %           TC:    void enable( void )
  2053. %           MSC: void _enable( void )
  2054.  
  2055.  
  2056.     - prototype in dos.h
  2057.  
  2058.     - enables all interrupts via ~STI~ instruction
  2059.  
  2060. :eof
  2061. ^int eof( int handle )
  2062.  
  2063.  
  2064.     - prototype in io.h
  2065.  
  2066.     - returns 1 if end of file for file associated with handle,
  2067.           0 if not end of file
  2068.          -1 if bad file number
  2069.  
  2070. :exec...:exec
  2071. ^Exec Function Call
  2072.  
  2073.     int execl(pathname,arg0,arg1,arg2,...,argN,NULL )
  2074.     int execle(pathname,arg0,arg1,arg2,...,argN,NULL,envp )
  2075.     int execlp(pathname,arg0,arg1,arg2,...,argN,NULL )
  2076.     int execlpe(pathname,arg0,arg1,arg2,....,argN,NULL,envp )
  2077.         char *pathname,*arg0,*arg1,*arg2,....,*argN,*envp[];
  2078.  
  2079.     int execv(pathname,arg,NULL )
  2080.     int execve(pathname,arg,NULL,envp )
  2081.     int execvp(pathname,arg,NULL )
  2082.     int execvpe(pathname,arg,NULL,envp )
  2083.         char *pathname,*arg[],*envp[];
  2084.  
  2085.     - prototype in process.h
  2086.  
  2087.     - loads and runs child processes
  2088.     - pathname search based on MS-DOS search algorithm
  2089.       o if no extension or period - search for exact file name -
  2090.         if not found, add .exe and search again
  2091.       o if extension given, search only for exact file name
  2092.       o if period given, search for file name with no extension
  2093.  
  2094.  
  2095.     - arg0 can be the same as the pathname
  2096.     - at least one argument must be passed
  2097.     - combined argument list cannot exceed 128 bytes
  2098.     - execl..: arg0, arg1,...,argN passed as SEPARATE arguments
  2099.     - execv..: arg[0], arg[1],...,arg[N] passed as argument ARRAY
  2100.     - execlp, execlpe, execvp, execvpe: search for child in PATH
  2101.     - returns no value if OK,
  2102.       returns -1, with  errno set to:
  2103.  
  2104.         E2BIG  (too many args)
  2105.         EACCES (permission denied)
  2106.         EMFILE (too many open files)
  2107.         ENOENT (path or file not found)
  2108.         ENOEXEC (exec format error)
  2109.         ENOMEM (not enough memory).
  2110.  
  2111.     - if successful, there is no return to the caller; the
  2112.       caller is killed off
  2113.  
  2114. :exit
  2115. ^void exit( int completioncode )
  2116.  
  2117.  
  2118.     - prototype in process.h and stdlib.h
  2119.  
  2120.     - terminates program, closes all files, buffered output is written,
  2121.       and any registered exit functions (via ~atexit~()) are called
  2122.  
  2123. :_exit
  2124. ^void _exit( int completioncode )
  2125.  
  2126.  
  2127.     - prototype in process.h
  2128.  
  2129.     - terminates program, BUT doesn't close files or write the buffered
  2130.       output and NO registered exit functions (via ~atexit~()) are called
  2131.  
  2132. :exp
  2133. ^double exp( double x )
  2134.  
  2135.  
  2136.     - prototype in math.h
  2137.  
  2138.     - returns y = e**x or HUGE_VAL on error
  2139.  
  2140. :_expand:_based:_fexpand:_nexpand
  2141. %      MSC: void *_expand( void *block, size_t size )
  2142. %      MSC: void far *_fexpand( void far *block, size_t size )
  2143. %      MSC: void near *_nexpand( void near *block, size_t size )
  2144.  
  2145. %      MSC: void _based(void) *_bexpand( _segment seg,
  2146. %            void _based(void) *block, size_t size )
  2147.  
  2148.  
  2149.     - prototype in malloc.h
  2150.  
  2151.     - block = pointer to previously allocated memory block
  2152.     - size = new size in bytes
  2153.     - seg = based segment value
  2154.     - returns pointer to reallocated memory block on success or NULL
  2155.       if not;  (_bexpand returns -1 on failure)
  2156.  
  2157. :fabs
  2158. ^double fabs( double x )
  2159.  
  2160.  
  2161.     - prototype in math.h
  2162.  
  2163.     - returns absolute value of x
  2164.  
  2165. :farcalloc
  2166. ^TC: void far *farcalloc( unsigned long nunits, unsigned long units )
  2167.  
  2168.  
  2169.     - prototype in alloc.h
  2170.  
  2171.     - allocates memory from the far heap for an array of nunits
  2172.       elements, each units bytes long
  2173.     - returns pointer to allocated block or NULL if not enough memory
  2174.     - can allocate all of memory & chunks bigger than 64K
  2175.     - must use far pointers
  2176.  
  2177. :farcoreleft
  2178. ^TC: unsigned long farcoreleft( void )
  2179.  
  2180.  
  2181.     - prototype in alloc.h
  2182.  
  2183.     - returns unused memory in bytes beyond highest allocated block
  2184.  
  2185. :farfree
  2186. ^TC: void farfree( void far *block )
  2187.  
  2188.  
  2189.     - prototype in alloc.h
  2190.  
  2191.     - frees block of previously allocated far memory (block must be
  2192.       allocated by ~farcalloc~())
  2193.  
  2194. :farrealloc
  2195. ^TC: void far *farrealloc( void far *block, unsigned long newsize )
  2196.  
  2197.  
  2198.     - prototype in alloc.h (malloc.h for MS C)
  2199.  
  2200.     - adjusts size of allocated block to newsize, copying contents
  2201.       to a new location if necessary
  2202.     - returns pointer to reallocated block or NULL on error
  2203.  
  2204. :fcvt
  2205. ^char *fcvt( double value, int ndigit, int *decpt, int *sign )
  2206.  
  2207.  
  2208.     - prototype in stdlib.h
  2209.  
  2210.     - converts a floating pt number to a string of ndigit digits,
  2211.       returning pointer to that string
  2212.     - correct digit is rounded for Fortran-F format output of the
  2213.       number of digits equal to ndigit
  2214.     - decpt is position of decimal point (negative value means to left
  2215.       of returned digits) and sign is 0 if positive, else negative
  2216.  
  2217. :fclose
  2218. ^int fclose( FILE *fp )
  2219.  
  2220.  
  2221.     - prototype in stdio.h
  2222.  
  2223.     - closes a file stream (see ~fdopen~() to convert handle to stream)
  2224.     - generally flushes buffers, too
  2225.     - return code should be checked.  Attempts to delete an open file
  2226.       will damage the file system.
  2227.     - returns 0 on success or EOF on error
  2228.  
  2229. :fcloseall
  2230. ^int fcloseall( void )
  2231.  
  2232.  
  2233.     - prototype in stdio.h
  2234.  
  2235.     - closes all file streams except stdin & stdout
  2236.     - returns 0 on success or EOF on error
  2237.  
  2238. :fdopen
  2239. ^FILE *fdopen( int handle, char *type )
  2240.  
  2241.  
  2242.     - prototype in dos.h
  2243.  
  2244.     - associates a file STREAM with a file HANDLE
  2245.     - handle is returned by ~creat~(), ~dup~(), ~dup2~() or ~open~()
  2246.     - type must match mode of the handle
  2247.     - returns file stream or NULL on error
  2248.     - see    ~fopen~()
  2249. :feof
  2250. ^int feof( FILE *stream )
  2251.  
  2252.  
  2253.     - prototype in stdio.h
  2254.  
  2255.     - detects end of file on a file stream
  2256.     - returns zero if NOT eof, else nonzero
  2257.  
  2258. :ferror
  2259. ^int ferror( FILE *stream )
  2260.  
  2261.  
  2262.     - prototype in stdio.h
  2263.  
  2264.     - tests stream for read/write error, return nonzero if error
  2265.     - error remains set until ~clearerr~() or ~rewind~() is called
  2266. :fflush
  2267. ^int fflush( FILE *fp )
  2268.  
  2269.  
  2270.     - prototype in stdio.h
  2271.  
  2272.     - writes contents of output buffers associated with fp to stream
  2273.       and clears input buffer contents; fp is NOT closed
  2274.     - returns 0 on success or EOF on error
  2275. :fgetc
  2276. ^int fgetc( FILE *fp )
  2277.  
  2278.  
  2279.     - prototype in stdio.h
  2280.  
  2281.     - function (not a macro) which gets character from stream
  2282.     - returns char (converted to an int) or EOF
  2283.     - see    ~getc~()
  2284. :fgetchar
  2285. ^int fgetchar( void )
  2286.  
  2287.  
  2288.     - prototype in stdio.h
  2289.  
  2290.     - gets character from stream
  2291.     - same as ~fgetc~(stdin)
  2292.     - returns char (converted to an int) or EOF
  2293.     - see    ~getc~()
  2294. :fgets
  2295. ^char *fgets( char *s, int size, FILE *fp )
  2296.  
  2297.  
  2298.     - prototype in stdio.h
  2299.  
  2300.     - gets a string from a stream, reading until size - 1 characters
  2301.       have been read or a newline is detected
  2302.     - newline character is retained
  2303.     - returns s argument if OK, else NULL on eof or error
  2304.  
  2305. :filelength
  2306. ^long filelength( int handle )
  2307.  
  2308.  
  2309.     - prototype in io.h
  2310.  
  2311.     - gets file size in bytes for file associated with handle
  2312.     - value returned includes ^Z in ASCII files;  value is the same as
  2313.       displayed in the DOS DIR command
  2314.     - returns -1L on error
  2315.  
  2316. :fileno
  2317. ^int fileno( FILE *stream )
  2318.  
  2319.  
  2320.     - prototype in stdio.h
  2321.  
  2322.     - gets file handle for the given stream
  2323.     - error return undefined
  2324.  
  2325. :findfirst:_dos_findfirst
  2326. %    TC: int findfirst( const char *path, struct ffblk *ffblk, int attr)
  2327.  
  2328. %    MSC unsigned _dos_findfirst( char *path, unsigned attr,
  2329. %                    struct find_t *fileinfo )
  2330.  
  2331.     - prototype in dir.h, also include dos.h (MS C: dos.h only)
  2332.  
  2333.     - gets disk directory via DOS 0x4E, where attr is:
  2334.  
  2335. %            Turbo C        Microsoft C
  2336.  
  2337.             FA_RDONLY    _A_RDONLY
  2338.             FA_HIDDEN    _A_HIDDEN
  2339.             FA_SYSTEM    _A_SYSTEM
  2340.             FA_LABEL    _A_VOLID
  2341.             FA_DIREC    _A_SUBDIR
  2342.             FA_ARCH        _A_ARCH
  2343.  
  2344. %    struct ffblk    (Turbo C)    struct find_t    (MSC)
  2345.         {                    {
  2346.         char     ff_reserved[21];        char     reserved[21];
  2347.         char     ff_attrib;         char     attrib;
  2348.         unsigned ff_ftime;            unsigned wr_time;
  2349.         unsigned ff_fdate;            unsigned wr_date;
  2350.         long     ff_fsize;            long     size;
  2351.         char     ff_name[13];        char     name[13];
  2352.         };                    };
  2353.  
  2354.     - attributes can be logically OR'ed
  2355.     - struct ffblk is defined in Turbo C's dir.h
  2356.     - struct find_t is defined in MS C's dos.h
  2357.     - updates ~DTA~, provisions for saving/setting DTA should be made
  2358.     - normal files are always included along with files that match
  2359.       the requested attributes except when the LABEL attribute is
  2360.       requested.  It's up to the programmer to determine which files
  2361.       actually match the requested attributes.
  2362.     - returns 0 if OK, -1 if no matching files found or on error
  2363.  
  2364.     - see    ~FILE ATTRIBUTES~,  ~FINDNEXT~,  ~GETDTA~  and  ~SETDTA~
  2365. :findnext:_dos_findnext
  2366. %      TC:  int findnext( struct ffblk *ffblk )
  2367. %      MSC: unsigned _dos_findnext( struct find_t *fileinfo )
  2368.  
  2369.     - prototype in dir.h, also include  (MSC: dos.h only)
  2370.  
  2371.     - findnext updates ~DTA~
  2372.     - returns 0 if OK, -1 if no matching files found or on error
  2373.     - gets next disk directory via DOS 0x4F, after calling ~findfirst~()
  2374.     - struct ffblk is defined in dir.h for Turbo C and dos.h for MSC
  2375.  
  2376. %    struct ffblk    (Turbo C)    struct find_t    (MSC)
  2377.         {                    {
  2378.         char     ff_reserved[21];        char     reserved[21];
  2379.         char     ff_attrib;         char     attrib;
  2380.         unsigned ff_ftime;            unsigned wr_time;
  2381.         unsigned ff_fdate;            unsigned wr_date;
  2382.         long     ff_fsize;            long     size;
  2383.         char     ff_name[13];        char     name[13];
  2384.         };                    };
  2385.  
  2386.     - normal files are always included along with files that match
  2387.       the requested attributes except when the LABEL attribute is
  2388.       requested.  It's up to the programmer to determine which
  2389.       actually match the requested attributes.
  2390.     - see    ~FILE ATTRIBUTES~,  ~findfirst~(), ~getdta~(), ~setdta~()
  2391. :_floodfill:_floodfill_w
  2392. %      MSC: short far _floodfill_w( double wx, double wy, short bcolor )
  2393. %      MSC: short far _floodfill( short x, short y, short bcolor )
  2394.  
  2395.  
  2396.     - prototype in graph.h
  2397.  
  2398.     - x, y = coordinates
  2399.     - bcolor = fill boundary color
  2400.     - if (x,y) falls inside a figure, the figure is filled with the
  2401.       with the current fill color;    if it falls outside the figure the
  2402.       background is filled
  2403.  
  2404.     - returns nonzero value on success or 0 on failure
  2405.  
  2406. :floor
  2407. ^double floor( double x )
  2408.  
  2409.  
  2410.     - prototype in math.h
  2411.  
  2412.     - returns largest integer <= x
  2413.  
  2414. :flushall
  2415. ^int flushall( void )
  2416.  
  2417.  
  2418.     - prototype in stdio.h
  2419.  
  2420.     - same as ~fflush~() except ALL open file streams are done
  2421.     - returns integer indicating number of open file streams
  2422.  
  2423. :fmod
  2424. ^double fmod( double x, double y )
  2425.  
  2426.  
  2427.     - prototype in math.h
  2428.  
  2429.     - calculates x modulo y, the remainder of x/y,
  2430.       returning the remainder
  2431.  
  2432. :fnmerge
  2433. %      TC: void fnmerge( char *path, const char *drive,
  2434. %           const char *dir, const char *name, const char *ext)
  2435.  
  2436.  
  2437.     - prototype in dir.h
  2438.  
  2439.     - makes a file name (path) from drive, dir, name, and ext
  2440.     - dir can include subdirectories
  2441.     - maximum sizes for these strings are:
  2442.  
  2443.       MAXPATH  80    path
  2444.       MAXDRIVE  3    drive - includes colon (:)
  2445.       MAXDIR   66    dir - includes leading/trailing backslashes
  2446.       MAXFILE   9    name
  2447.       MAXEXT    5    ext, including leading dot (.)
  2448.  
  2449.     - invertible with ~fnsplit~()
  2450.  
  2451. :fnsplit
  2452. %      TC: void fnsplit( const char *path, char *drive, char *dir,
  2453. %                char *name, char *ext)
  2454.  
  2455.  
  2456.     - prototype in dir.h
  2457.  
  2458.     - splits a file name from path into drive, dir, name, and ext
  2459.     - dir can include subdirectories
  2460.     - maximum sizes for these strings are:
  2461.  
  2462.       MAXPATH  80    path
  2463.       MAXDRIVE  3    drive - includes colon (:)
  2464.       MAXDIR   66    dir - includes leading/traing backslashes
  2465.       MAXFILE   9    name
  2466.       MAXEXT    5    ext, including leading dot (.)
  2467.  
  2468.     - invertible with ~fnmerge~()
  2469.  
  2470. :fopen
  2471. ^FILE *fopen( const char *filename, const char *type )
  2472.  
  2473.     - prototype in stdio.h
  2474.  
  2475.     - type is a combination of the following:
  2476.      
  2477. %        Mode       Description
  2478.         "r"    read text/binary
  2479.         "w"    write text/binary
  2480.         "a"    append text/binary
  2481.         "+"    allow update access
  2482.         "t"    text file
  2483.         "b"    binary file
  2484.  
  2485. %        Read    Write    Append
  2486.         "rt"    "wt"    "at"    (text)
  2487.         "rb"    "wb"    "ab"    (binary)
  2488.         "r+"    "w+"    "a+"    (update)
  2489.         "r+t"    "w+t"    "a+t"    (update text)
  2490.         "r+b"    "w+b"    "a+b"    (update binary)
  2491.  
  2492.     read   - read only (unless "r+")
  2493.     write  - create
  2494.     append - seek to end of file or create file
  2495.  
  2496.     - text mode input, will have CRs discarded
  2497.     - using any of the stdio functions results in a default allocation
  2498.       of 512 bytes for the I/O buffer and the inclusion of the standard
  2499.       memory allocation functions
  2500.     - returns stream or NULL on error
  2501.  
  2502.  
  2503. :fp_off
  2504. ^unsigned FP_OFF( void far *fptr )
  2505.  
  2506.  
  2507.     - prototype in dos.h
  2508.  
  2509.     - gets offset of far pointer fptr
  2510.     - returns unsigned integer value
  2511.     - not available in earlier versions of MS C; use the following:
  2512.  
  2513.       #define FP_OFF(fptr)    ((unsigned)(fptr))
  2514.  
  2515.  
  2516.     - see    ~FP_SEG~()
  2517. :fp_seg
  2518. ^unsigned FP_SEG( void far *fptr )
  2519.  
  2520.  
  2521.     - prototype in dos.h
  2522.  
  2523.     - gets segment of far pointer fptr
  2524.     - returns unsigned integer value
  2525.     - not available in some versions of MS C; use the following:
  2526.  
  2527.       #define FP_SEG(fptr) ((unsigned)((unsigned long)(fptr) >> 16))
  2528.  
  2529.  
  2530.     - see    ~FP_OFF~()
  2531. :_fpreset
  2532. ^void _fpreset( void )
  2533.  
  2534.  
  2535.     - prototype in float.h
  2536.  
  2537.     - resets floating point math package, usually used with ~signal~(),
  2538.       ~system~(), ~exec...~(), ~spawn...~()
  2539.     - should be called before using 8087/80287 after using one of the
  2540.       above functions
  2541.     - define identically for Turbo C and MS C
  2542.  
  2543. :fprintf
  2544. ^int fprintf( FILE *fp, const char *format [, arg1, arg2, ...] )
  2545.  
  2546.  
  2547.     - prototype in stdio.h
  2548.  
  2549.     - returns number of bytes it attempted to write regardless of
  2550.       success.  To check for a successful fprintf call on a buffered
  2551.       stream, use fflush which returns accurate error information.
  2552.     - using printf or any of the stdio functions results in a default
  2553.       allocation of 512 bytes for the I/O buffer and the inclusion of
  2554.       the standard memory allocation functions
  2555.     - see    ~printf~()   and   ~PRINTF SPEC~
  2556. :fputc
  2557. ^int fputc( int c, FILE *fp )
  2558.  
  2559.  
  2560.     - prototype in stdio.h
  2561.  
  2562.     - puts char c to stream fp
  2563.     - using fputc or any of the stdio functions results in a default
  2564.       allocation of 512 bytes for the I/O buffer and the inclusion of
  2565.       the standard memory allocation functions
  2566.     - returns c  or EOF
  2567.  
  2568. :fputs
  2569. ^int fputs( const char *s, FILE *fp )
  2570.  
  2571.  
  2572.     - prototype in stdio.h
  2573.  
  2574.     - writes string "s" to stream
  2575.     - does not add a newline or null character to the stream
  2576.     - using fputs or any of the stdio functions results in a default
  2577.       allocation of 512 bytes for the I/O buffer and the inclusion of
  2578.       the standard memory allocation functions
  2579.     - see    ~puts~()
  2580. :fread
  2581. ^size_t fread( void *buf, size_t size, size_t count, FILE *fp )
  2582.  
  2583.  
  2584.     - prototype in stdio.h
  2585.  
  2586.     - reads  (count * size)  bytes from file stream "fp"
  2587.     - returns the number of blocks actually read
  2588.     - to get better feedback from this function, the parameters "size"
  2589.       and "count" may be swapped.  If count is 1, this method allows
  2590.       fread() to return the actual number of bytes read
  2591.     - using fread or any of the stdio functions results in a default
  2592.       allocation of 512 bytes for the I/O buffer and the inclusion of
  2593.       the standard memory allocation functions
  2594.     - returns 0 (or short count) on eof or error
  2595.  
  2596.     - see  ~fopen~()   ~fread~()   ~setvbuf~()
  2597.  
  2598. :free
  2599. ^void free( void *pseg )
  2600.  
  2601.  
  2602.     - prototype in stdlib.h, alloc.h (malloc.h for MS C)
  2603.  
  2604.     - frees allocated block located at pseg
  2605.     - MS C ignores a NULL parameter (see ~_ffree~())
  2606.  
  2607. :_freect
  2608. ^MSC: unsigned _freect( size_t size )
  2609.  
  2610.  
  2611.     - prototype in malloc.h
  2612.  
  2613.     - size = size of allocation in bytes
  2614.     - returns the count of calls to an allocation function a program
  2615.       can make before failing
  2616.     - test is made in default data segment only
  2617.  
  2618. :freemem
  2619. ^TC: int freemem( unsigned seg )
  2620.  
  2621.  
  2622.     - prototype in dos.h
  2623.  
  2624.     - frees previously allocated DOS block defined by seg
  2625.     - returns 0 on success, -1 on error errno=ENONMEM
  2626.     - MS C uses ~_dos_freemem~()
  2627.     - see    ~INT 21,49~
  2628. :freopen
  2629. ^FILE *freopen( const char *fname, const char *type, FILE *fp )
  2630.  
  2631.  
  2632.     - prototype in stdio.h
  2633.  
  2634.     - substitutes named file in place of open fp and closes original fp
  2635.     - useful for changing file attached to stdin, stdout, or stderr
  2636.     - returns fp on success or NULL on error
  2637.     - see    ~fopen~()
  2638. :frexp
  2639. ^double frexp( double value, int eptr )
  2640.  
  2641.  
  2642.     - prototype in math.h
  2643.  
  2644.     - calculates mantissa x (a double < 1) and n ( integer) such
  2645.       that value = x * 2**n, storing n in word that eptr points
  2646.  
  2647. :fscanf
  2648. ^int fscanf( FILE *fp, const char *format, arg1, arg2, ... )
  2649.  
  2650.  
  2651.     - prototype in stdio.h
  2652.  
  2653.     - gets formatted input from a stream fp
  2654.  
  2655.  
  2656.     - see    ~scanf~()  and   ~SCANF SPECS~
  2657. :fseek
  2658. ^int fseek( FILE *fp, long offset, int mode )
  2659.  
  2660.  
  2661.     - prototype in stdio.h
  2662.  
  2663.     - sets file pointer associated with fp to position which is offset
  2664.       bytes beyond file location given by mode
  2665.  
  2666.     - mode is 0 (beginning of file or SEEK_SET)
  2667.           1 (current position or SEEK_CUR)
  2668.           2 (end of file or SEEK_END
  2669.  
  2670.     - discards any character pushed back by ungetc()
  2671.     - fseek() clears eof indicator but not file error indicator
  2672.     - returns 0 if pointer moved OK, nonzero if file not opened or
  2673.       invalid seek for device.  DOS does not report an error if an
  2674.       attempt to seek past EOF is made
  2675.  
  2676.     - see    ~ftell~()
  2677. :fstat
  2678. ^int fstat( int handle, struct stat *buff )
  2679.  
  2680.  
  2681.     - prototype in stat.h
  2682.  
  2683.     - see    ~stat~()
  2684. :ftell
  2685. ^long ftell( FILE *fp )
  2686.  
  2687.  
  2688.     - prototype in stdio.h
  2689.  
  2690.     - returns current file position in bytes from beginning of file
  2691.       or -1L on error
  2692.  
  2693.     - see    ~fseek~()
  2694. :fwrite
  2695. ^size_t fwrite(const void *buf, size_t size, size_t count, FILE *fp)
  2696.  
  2697.  
  2698.     - prototype in stdio.h
  2699.  
  2700.     - writes  (count * size)  bytes to file stream "fp"
  2701.     - swapping parameters "size" and "count" can often provide more
  2702.       exact feedback (exactly how many bytes were written)
  2703.     - returns number of data blocks actually written or a short count
  2704.       on error
  2705.  
  2706.     - see  ~fopen~()   ~fread~()   ~setvbuf~()
  2707.  
  2708. :gcvt
  2709. ^char *gcvt( double value, int ndigit, char *buf )
  2710.  
  2711.  
  2712.     - prototype in stdlib.h
  2713.  
  2714.     - converts a floating point number to a string of ndigit digits,
  2715.       storing string into buf and returning pointer to that string
  2716.     - outputs in Fortran-F format if possible, else in Fortran-E format
  2717.  
  2718. :geninterrupt
  2719. ^TC: void geninterrupt( int interrupt_num )
  2720.  
  2721.  
  2722.     - prototype in dos.h
  2723.  
  2724.     - generates actual interrupt for "interrupt_num" in code
  2725.     - not a true function, but inline code generation
  2726.  
  2727. :getc
  2728. ^int getc( FILE *fp )
  2729.  
  2730.  
  2731.     - prototype in stdio.h
  2732.  
  2733.     - macro which returns next character in file stream "fp" or EOF
  2734.       on end of file or error
  2735.  
  2736. :getcbrk
  2737. ^TC: int getcbrk( void )
  2738.  
  2739.  
  2740.     - prototype in dos.h
  2741.  
  2742.     - gets control-break setting
  2743.  
  2744.     - return 0  Ctrl-C is off
  2745.          1  Ctrl-C is on
  2746.  
  2747. :getch
  2748. ^int getch( void )
  2749.  
  2750.  
  2751.     - prototype in conio.h
  2752.  
  2753.     - returns next character from console without echoing
  2754.  
  2755. :getchar
  2756. ^int getchar( void )
  2757.  
  2758.  
  2759.     - prototype in stdio.h
  2760.  
  2761.     - returns next character in file stream stdin or EOF on end of
  2762.       file or error
  2763.     - implemented as a macro
  2764.  
  2765. :getche
  2766. ^int getche( void )
  2767.  
  2768.  
  2769.     - prototype in conio.h
  2770.  
  2771.     - function which returns next character from console WITH echoing
  2772.  
  2773. :_getcolor
  2774. ^MSC: short far _getcolor( void )
  2775.  
  2776.     - prototype in graph.h
  2777.  
  2778.     - returns the current color number
  2779.     - default color is the highest valid color in current palette
  2780.  
  2781.  
  2782. :getcolor:putcolor
  2783. %    MSC: flagType GetColor( LINE line, la *colorlist, PFILE pFile )
  2784. %    MSC: void PutColor( LINE line, la *colorlist, PFILE pFile )
  2785.  
  2786.  
  2787.     - prototype in ext.h
  2788.  
  2789.     - GetColor returns nonzero if a color is attached to the line;
  2790.       zero otherwise
  2791.  
  2792. :getcurdir
  2793. ^TC: int getcurdir( int drive, char *direc )
  2794.  
  2795.  
  2796.     - prototype in dir.h
  2797.  
  2798.     - get current directory for specified drive (0=default, 1=A, etc)
  2799.     - direc will contain directory name
  2800.  
  2801.     - returns 0 if OK
  2802.          -1 on error
  2803.  
  2804. :_getcurrentposition
  2805. %    MSC: struct xycoord far _getcurrentposition( void )
  2806. %    MSC: struct _wxycoord far _getcurrentposition_w( void )
  2807.  
  2808.  
  2809.     - prototype in graph.h
  2810.  
  2811.     - returns current position coordinates in struct xycoord format
  2812.  
  2813. :getcwd
  2814. ^char *getcwd( char *buf, int n )
  2815.  
  2816.  
  2817.     - prototype in dir.h
  2818.  
  2819.     - gets full path name of current working directory up to n bytes,
  2820.       placed into buf
  2821.     - returns buf pointer, else NULL
  2822.  
  2823. :getdate
  2824. ^TC: void getdate( struct date *dateblk )
  2825.  
  2826.     - prototype in dos.h
  2827.  
  2828.     - gets DOS date, filling it into the following structures:
  2829.  
  2830.     struct date
  2831.         {
  2832.         int     da_year;        - Year including century
  2833.         char da_day;        - Day of the month
  2834.         char da_mon;        - Month (1 = Jan)
  2835.         };
  2836.  
  2837.     - MS C uses ~_dos_getdate~()
  2838.     - see  ~INT 21,2A~
  2839. :getdfree
  2840. ^TC: void getdfree( unsigned char drive, struct dfree *dfreep )
  2841.  
  2842.  
  2843.     - prototype in dos.h
  2844.  
  2845.     - fills in structure with disk status information.
  2846.  
  2847.     struct dfree
  2848.         {
  2849.         unsigned df_avail;        - available clusters
  2850.         unsigned df_total;        - total clusters
  2851.         unsigned df_bsec;        - bytes per sector
  2852.         unsigned df_sclus;        - sectors per cluster
  2853.         };
  2854.  
  2855.     - drive is specified as A = 1, B = 2, C = 3, etc...
  2856.     - in event of error, df_sclus is set to -1.
  2857.     - MS C uses ~_dos_getdiskfree~()
  2858.     - see    ~INT 21,36~
  2859. :getdisk
  2860. ^TC: int getdisk( void )
  2861.  
  2862.  
  2863.     - prototype in dir.h
  2864.  
  2865.     - returns integer drive number; 0 = A:, 1 = B:, ...
  2866.     - MS C uses ~_dos_getdrive~()
  2867.     - see    ~INT 21,19~
  2868. :getdta
  2869. ^TC: char far *getdta( void )
  2870.  
  2871.  
  2872.     - prototype in dos.h
  2873.  
  2874.     - returns current setting of the ~DTA~ as a far pointer
  2875.     - see    ~INT 21,2F~
  2876. :getenv
  2877. ^char *getenv( const char *envvar )
  2878.  
  2879.  
  2880.     - prototype in stdlib.h
  2881.  
  2882.     - gets string from environment
  2883.     - MSDOS environment consists of strings of form envvar=varvalue,...
  2884.     - returns varvalue or 0 if envvar not found in environment
  2885.  
  2886. :getfat
  2887. ^TC: void getfat( unsigned char drive, struct fatinfo *fatblkp )
  2888.  
  2889.  
  2890.     - prototype in dos.h
  2891.  
  2892.     - returns information from the file allocation table for the
  2893.       specified drive (0=default,1=A, etc) into fatblk
  2894.     - structure fatinfo is defined as:
  2895.  
  2896.     struct fatinfo
  2897.         {
  2898.         char  fi_sclus;          - sectors per cluster
  2899.         char  fi_fatid;        - media descriptor byte  from FAT
  2900.         int   fi_nclus;        - cluster on disk
  2901.         int   fi_bysec;        - bytes per sector
  2902.         };
  2903.  
  2904.     - closest MS C function is ~_dos_getdiskfree~()
  2905.     - see    ~INT 21,1C~
  2906. :getfatd
  2907. ^TC: void getfatd( struct fatinfo *fatblkp )
  2908.  
  2909.  
  2910.     - prototype in dos.h
  2911.  
  2912.     - returns information from the file allocation table for the
  2913.       DEFAULT drive into fatblk
  2914.     - structure fatinfo is defined as:
  2915.  
  2916.     struct fatinfo
  2917.         {
  2918.         char  fi_sclus;        - sectors per cluster
  2919.         char  fi_fatid;        - media descriptor byte  from FAT
  2920.         int   fi_nclus;        - cluster on disk
  2921.         int   fi_bysec;        - bytes per sector
  2922.         };
  2923.  
  2924.     - closest MS C function is ~_dos_getdiskfree~()
  2925.     - see    ~INT 21,1B~   ~getfat~()
  2926. :_getfillmask
  2927. ^MSC: unsigned char far *_getfillmask( unsigned char far *mask )
  2928.  
  2929.  
  2930.     - prototype in graph.h
  2931.  
  2932.     - mask = receives current fill mask or NULL if mask not present
  2933.  
  2934. :getftime
  2935. ^TC: int getftime( int handle, struct ftime *ftimep )
  2936.  
  2937.  
  2938.     - prototype in dos.h
  2939.  
  2940.     - retrieves file time and date for the file associated with
  2941.       handle into ftimep
  2942.     - structure ftime is defined in dos.h
  2943.     - MS C uses ~_dos_getftime~()
  2944.     - see    ~INT 21,57~
  2945. :_getimage:_getimage_w:_getimage_wxy
  2946. %    MSC: void far _getimage( short x1, short y1, short x2, short y2,
  2947. %                 char huge *image )
  2948.  
  2949. %    MSC: void far _getimage_w( double wx1, double wy1, double wx2,
  2950. %                   double wy2, char huge *image )
  2951.  
  2952. %    MSC: void far _getimage_wxy( struct _wxycoord far *pwxy1,
  2953. %                struct _wxycoord far *pwxy2,char huge *image)
  2954.  
  2955.  
  2956.     - prototype in graph.h
  2957.  
  2958.     - (x1, y1) upper left coordinates of rectangle
  2959.     - (x2, y2) lower right coordinates of rectangle
  2960.     - image = buffer to receive screen image
  2961.  
  2962.     - Turbo C uses ~getimage~()
  2963.  
  2964. :getimage
  2965. %      TC: void far getimage( int left, int top, int right,
  2966. %                 int bottom, void far *bitmap )
  2967.  
  2968.  
  2969.     - prototype in graphics.h
  2970.  
  2971.     - copies video data from the screen rectange to buffer "bitmap"
  2972.     - bitmap must be large enough to hold entire buffer plus 4 bytes
  2973.       (2 words) for height and width information.  Function imagesize()
  2974.       should be used to determine the size of the buffer to avoid
  2975.       overwriting adjacent memory.
  2976.  
  2977.     - MS C uses ~_getimage~()
  2978.     - see    ~putimage~()   ~imagesize~()
  2979. :_getlinestyle
  2980. ^MSC: unsigned short far _getlinestyle( void )
  2981.  
  2982.  
  2983.     - prototype in graph.h
  2984.  
  2985.     - returns current line style mask
  2986.     - each 1 bit represents a pixel (in current color) in the line
  2987.       mask;  each 0 represent a pixel that is left alone
  2988.  
  2989.     - see    ~_setlinestyle~()
  2990. :_getlogcoord:_getviewcoord
  2991. ^struct xycoord far _getlogcoord( short x, short y )
  2992.  
  2993.  
  2994.     - prototype in graph.h
  2995.  
  2996.     - translates physical coordinates to logical coordinates returning
  2997.       the result in the format:
  2998.  
  2999.     struct xycoord
  3000.         {
  3001.         short xcoord;
  3002.         short ycoord;
  3003.         };
  3004.  
  3005.     - ~_getviewcoord~() is obsolete; use ~_getlogcoord~()
  3006.     - see    ~_getphyscoord~()
  3007. :getpass
  3008. ^TC: char *getpass( const char *prompt )
  3009.  
  3010.  
  3011.     - prototype in conio.h
  3012.  
  3013.     - reads a password from system console after typing prompt,
  3014.       without echoing
  3015.     - password cannot exceed 8 chars (not counting null terminator)
  3016.  
  3017. :_getphyscoord
  3018. ^MSC: struct xycoord far _getphyscoord( short x, short y )
  3019.  
  3020.  
  3021.     - prototype in graph.h
  3022.  
  3023.     - translates logical coordinates to physical coordinates returning
  3024.       the result in the format:
  3025.  
  3026.     struct xycoord
  3027.         {
  3028.         short xcoord;
  3029.         short ycoord;
  3030.         };
  3031.  
  3032.     - see    ~_getlogcoord~()
  3033. :getpid
  3034. ^MSC: int getpid( void )
  3035.  
  3036.  
  3037.     - prototype in process.h
  3038.  
  3039.     - returns process ID identifying the calling process (~PSP~ segment)
  3040.  
  3041.     - Turbo C uses ~getpsp~()
  3042.  
  3043. :_getpixel:_getpixel_w
  3044. %         MSC: short far _getpixel( short x, short y )
  3045. %         MSC: short far _getpixel_w( double wx, double wy )
  3046.  
  3047.  
  3048.     - prototype in graph.h
  3049.  
  3050.     - returns pixel value on success or -1 on failure
  3051.     - Turbo C uses ~getpixel~()
  3052.  
  3053. :getpsp
  3054. ^TC: unsigned getpsp( void )
  3055.  
  3056.  
  3057.     - prototype in dos.h
  3058.  
  3059.     - returns segment address of the ~PSP~ using DOS ~INT 21,62~
  3060.     - valid only for DOS 3.x
  3061.     - use global variable _psp to get PSP instead for DOS 2.X
  3062.     - MS C uses ~getpid~()
  3063.  
  3064. :gets
  3065. ^char *gets( char *s )
  3066.  
  3067.  
  3068.     - prototype in stdio.h
  3069.  
  3070.     - reads string from stdin until newline character is read
  3071.     - newline character is replaced by \0
  3072.     - returns string or NULL on end-of-file or error
  3073.  
  3074. :_gettextcolor
  3075. ^MSC: short far _gettextcolor( void )
  3076.  
  3077.  
  3078.     - prototype in graph.h
  3079.  
  3080.     - returns current text color value
  3081.  
  3082. :_gettextposition
  3083. ^MSC: struct rccoord far _gettextposition( void )
  3084.  
  3085.  
  3086.     - prototype in graph.h
  3087.  
  3088.     - returns current text position via rccoord structure:
  3089.  
  3090.     struct rccoord
  3091.         {
  3092.         short  row;
  3093.         short col;
  3094.         };
  3095.  
  3096. :gettime
  3097. ^TC: void gettime( struct time *timep )
  3098.  
  3099.  
  3100.     - prototype in dos.h
  3101.  
  3102.     - gets MS-DOS time into the following data structure:
  3103.  
  3104.       struct time
  3105.         {
  3106.         unsigned char  ti_min;
  3107.         unsigned char  ti_hour;
  3108.         unsigned char  ti_hund;
  3109.         unsigned char  ti_sec;
  3110.         };
  3111.  
  3112.     - MS C uses ~_dos_gettime~()
  3113.  
  3114. :getvect
  3115. ^TC: void interrupt (*getvect( int intr_num ))()
  3116.  
  3117.  
  3118.     - prototype in dos.h
  3119.  
  3120.     - returns the value of the interrupt vector named by intr_num
  3121.     - returns 4-byte far pointer to current interrupt service routine
  3122.       stored in interrupt vector table
  3123.     - Example:
  3124.  
  3125.         void interrupt (*old_int_1c)();
  3126.  
  3127.         old_int_1c = getvect( 0x1c );
  3128.  
  3129.     - MS C uses ~_dos_getvect~()
  3130.     - see    ~INT 21,35~
  3131. :getverify
  3132. ^TC: int getverify( void )
  3133.  
  3134.  
  3135.     - prototype in dos.h
  3136.  
  3137.     - returns current state of verify flag (0==off, 1==on)
  3138.     - see    ~INT 21,54~
  3139. :_getvideoconfig
  3140. %        MSC: struct videoconfig far *_getvideoconfig(
  3141. %                    struct videoconfig far *config )
  3142.  
  3143.     - prototype in graph.h
  3144.  
  3145.     - returns video configuration information via struct videoconfig:
  3146.  
  3147.     struct videoconfig
  3148.         {
  3149.         short numxpixels;          - pixels on X axis
  3150.         short numypixels;          - pixels on Y axis
  3151.         short numtextcols;       - text columns available
  3152.         short numtextrows;       - text rows available
  3153.         short numcolors;          - actual colors available
  3154.         short bitsperpixel;      - bits per pixel
  3155.         short numvideopages;     - available video page count
  3156.         short mode;              - current video mode
  3157.         short adapter;          - active display adapter
  3158.         short monitor;          - active display monitor
  3159.         short memory;          - adapter video memory in K
  3160.         };
  3161.  
  3162. :getw
  3163. ^int getw( FILE *fp )
  3164.  
  3165.  
  3166.     - prototype in stdio.h
  3167.  
  3168.     - gets integer from file stream fp
  3169.     - returns EOF (-1) on eof or error
  3170.     - use feof() or ferror() to verify -1 is an integer data word, and
  3171.       not an error return
  3172.  
  3173. :gmtime
  3174. ^struct tm *gmtime( const time_t *clock )
  3175.  
  3176.  
  3177.     - prototype in time.h
  3178.  
  3179.     - clock is a long integer (such as that returned by ~time~())
  3180.     - returns GMT time in struct tm (see time.h) correcting for time
  3181.       zone and any daylight savings time
  3182.     - global variable timezone is difference in seconds between GMT
  3183.       and local standard time
  3184.  
  3185. :gsignal
  3186. ^int gsignal( int sig )
  3187.  
  3188.  
  3189.     - prototype in signal.h
  3190.  
  3191.     - ssignal() and gsignal() implement a software-signaling facility
  3192.       where software signals are integers 1-15
  3193.     - gsignal() raises the signal given by sig and executes the action
  3194.       routine
  3195.     - gsignal() returns value by action or SIG_IGN or SIG_DFL
  3196.     - UNIX based
  3197.     - see    ~ssignal~()
  3198. :halloc
  3199. ^MSC: void huge *halloc( long num, size_t size )
  3200.  
  3201.  
  3202.     - prototype in malloc.h
  3203.  
  3204.     - num = count of elements to allocate
  3205.     - size = size of each element;    each element is set to zero;
  3206.          must be a power of 2 if size is over 128K
  3207.     - alignment assures compatibility with all data types (para)
  3208.     - returns pointer to allocated block on success or NULL on failure
  3209.     - allocates memory directly from DOS
  3210.  
  3211.     - see    ~hfree~()
  3212. :_harderr:_hardresume:_hardretn
  3213. %        MSC: void _hardresume( int result )
  3214. %        MSC: void _hardretn( int error )
  3215. %        MSC: void _harderr( void (far *handler)() )
  3216.  
  3217.     - prototype in dos.h
  3218.  
  3219.     - result = return value from handler
  3220.     - error = number of error
  3221.  
  3222.     - _harderr() registers a user critical error handler with its
  3223.       own error handler which is to be called during a critical error
  3224.  
  3225.     - handler = new ~INT 24~ handler with the format:
  3226.       handler(unsigned deverr,unsigned errcode,unsigned far *devhdr)
  3227.       where: deverr = device error code (AX value DOS passes to INT 24)
  3228.          errcode = error code (DI value DOS passes to ~INT 21~)
  3229.          devhdr = pointer to device header on which error occurred
  3230.     - handler must return via one of three methods:
  3231.         simple return  returns to DOS error handler
  3232.         _hardresume()  returns to DOS error handler
  3233.         _hardretn()  returns to the application
  3234.  
  3235.     - hardresume() returns one of the following:
  3236.       _HARDERR_ABORT  DOS should abort the process via ~INT 23~
  3237.       _HARDERR_FAIL   DOS should fail the call (DOS 3.x+)
  3238.       _HARDERR_IGNORE DOS should ignore the error
  3239.       _HARDERR_RETRY  DOS should retry the operation
  3240.     - due to the complexity of these functions consult the vendor
  3241.       documentation for more specific details
  3242.  
  3243.     - Turbo C uses    ~hardretn~(), ~harderr~() and ~hardresume~()
  3244.     - see    ~INT 24~
  3245. :harderr
  3246. ^TC: void harderr( int (*fptr)())
  3247.  
  3248.     - prototype in dos.h
  3249.  
  3250.     - harderr() establishes a hardware error handler for current
  3251.       program, invoked wherever interrupt 0x24 occurs
  3252.     - function fptr is called when such an interrupt occurs
  3253.     - handler function will be called with the following
  3254.       arguments= handler( int errval, int ax, int bp, int si)
  3255.       where errval is error code in DI register by MS-DOS, and
  3256.       ax, bp, si are values MS-DOS has in AX, BP, and SI regs
  3257.     - ax indicates if disk or other device error occurs;  if ax is
  3258.       not negative, then disk error, else device error.  For disk
  3259.       error, ax ANDed with 0x00ff will give bad drive number
  3260.     - bp and si together point to device driver header
  3261.     - hardresume() may be called with rescode to return
  3262.       to MS-DOS, where rescode is
  3263.  
  3264.         2 - for abort
  3265.         1 - retry
  3266.         0 - ignore
  3267.  
  3268.     - ~hardrtn~() may be called to return directly to the application
  3269.     - handler must return:
  3270.  
  3271.           0 - ignore
  3272.           1 - retry
  3273.           2 - abort
  3274.  
  3275.     - handler may issue DOS calls 1 through 0xC, but no others, and
  3276.       no C standard I/O or UNIX I/O calls may be used
  3277.     - MS C uses _harderr()
  3278.  
  3279.     - see  ~hardresume~()  ~hardretn~()  ~INT 24~
  3280. :hardresume
  3281. ^TC: void hardresume( int rescode )
  3282.  
  3283.  
  3284.     - prototype in dos.h
  3285.  
  3286.     - hardresume() may be called with rescode to return to DOS,
  3287.       where rescode is:
  3288.  
  3289.         2 - abort
  3290.         1 - retry
  3291.         0 - ignore
  3292.  
  3293.     - MS C uses ~_hardresume~()
  3294.     - see    ~harderr~()
  3295. :hardretn
  3296. ^TC: void hardretn( int errcode )
  3297.  
  3298.  
  3299.     - prototype in dos.h
  3300.  
  3301.     - hardretn() may be called to return directly to the application
  3302.     - MS C uses _hardretn
  3303.     - see    ~harderr~()
  3304. :_heapchk:_bheapchk:_fheapchk:_nheapchk
  3305. %        MSC: int _heapchk( void )
  3306. %        MSC: int _bheapchk( _segment seg )
  3307. %        MSC: int _fheapchk( void )
  3308. %        MSC: int _nheapchk( void )
  3309.  
  3310.  
  3311.     - prototype in malloc.h
  3312.  
  3313.     - runs consistency check on different heaps
  3314.     - heapchk maps to the other functions depending on memory model
  3315.  
  3316.     - returns one of the following:
  3317.  
  3318.       _HEAPOK    heap is ok
  3319.       _HEAPBADBEGIN initials allocation header couldn't be found
  3320.       _HEAPBADNODE    heap/node has been damaged
  3321.       _HEAPEMPTY    heap has not been initialized
  3322.  
  3323.     - see    ~heapset~()   ~heapwalk~()
  3324. :_heapset:_bheapset:_fheapset:_nheapset
  3325. %        MSC: int _heapset( unsigned fill )
  3326. %        MSC: int _bheapset( _segment seg, unsigned fill )
  3327. %        MSC: int _fheapset( unsigned fill )
  3328. %        MSC: int _nheapset( unsigned fill )
  3329.  
  3330.  
  3331.     - prototype in malloc.h
  3332.  
  3333.     - heapset maps to the other functions depending on memory model
  3334.     - first check heap consistency via ~heapchk~() then fills memory
  3335.       with value specified in "fill"
  3336.  
  3337.     - returns one of the following:
  3338.  
  3339.       _HEAPOK    heap is ok
  3340.       _HEAPBADBEGIN initials allocation header couldn't be found
  3341.       _HEAPBADNODE    heap/node has been damaged
  3342.       _HEAPEMPTY    heap has not been initialized
  3343.  
  3344.     - see    ~heapchk~()   ~heapwalk~()
  3345. :_heapwalk:_bheapwalk:_fheapwalk:_nheapwalk
  3346. %    MSC: int _heapwalk( struct _heapinfo *entry )
  3347. %    MSC: int _bheapwalk( _segment seg, struct _heapinfo *entry )
  3348. %    MSC: int _fheapwalk( struct _heapinfo *entry )
  3349. %    MSC: int _nheapwalk( struct _heapinfo *entry )
  3350.  
  3351.     - prototype in malloc.h
  3352.  
  3353.     - walks the heap for each entry specified and returns information
  3354.       about the entry via the other fields of the _heapinfo structure
  3355.     - heapwalk maps to the other functions depending on memory model
  3356.     - returns one of the following:
  3357.  
  3358.       _HEAPOK    heap is ok
  3359.       _HEAPBADBEGIN initials allocation header couldn't be found
  3360.       _HEAPBADNODE    heap/node has been damaged
  3361.       _HEAPEMPTY    heap has not been initialized
  3362.       _HEAPBADPTR    parameter does not contain valid pointer to heap
  3363.       _HEAPEND    end of help found w/o problem
  3364.  
  3365.     struct _heapinfo
  3366.        {
  3367.        int      _far *_pentry;       - heap entry pointer
  3368.        size_t _size;           - size of heap entry
  3369.        int      _useflag;           - entry in use return value
  3370.        };
  3371.  
  3372.     - see    ~heapchk~()   ~heapset~()
  3373. :hfree
  3374. ^MSC: void hfree( void huge *block )
  3375.  
  3376.  
  3377.     - prototype in malloc.h
  3378.  
  3379.     - block = pointer to block of allocated memory
  3380.     - memory is returned to DOS
  3381.     - freeing an unallocated block will corrupt the DOS's ~MCB~ chain
  3382.  
  3383.     - see    ~halloc~()
  3384. :hypot
  3385. ^double hypot( double x, double y )
  3386.  
  3387.     - prototype in math.h
  3388.  
  3389.     - returns z where z**2 = x**2 + y**2, or HUGE_VAL on error
  3390.  
  3391. :imagesize
  3392. ^unsigned far imagesize(int left, int top, int right, int bottom)
  3393.  
  3394.  
  3395.     - prototype in graphics.h
  3396.  
  3397.     - returns the size of the buffer required to hold the screen image
  3398.       represented by the coordinates
  3399.     - returns size or 0xFFFF on error (image >= 64K-1)
  3400.  
  3401. :inp:inpw
  3402. %           MSC: int inp( unsigned port )
  3403. %           MSC: unsigned inpw( unsigned port )
  3404.  
  3405.  
  3406.     - prototype in conio.h
  3407.  
  3408.     - port = hardware I/O port 0-3FFh
  3409.     - returns byte or word data read from port
  3410.  
  3411. :inport
  3412. ^TC: int inport( int port )
  3413.  
  3414.  
  3415.     - prototype in dos.h
  3416.  
  3417.     - inport() reads word from input port port
  3418.     - MS C uses ~inpw~()
  3419.     - see    ~inportb~()
  3420. :inportb
  3421. ^TC: unsigned char inportb( int port )
  3422.  
  3423.  
  3424.     - prototype in dos.h
  3425.  
  3426.     - inportb() is macro that reads a byte from hardware port 'port'
  3427.     - MS C uses ~inp~()
  3428.     - see    ~inport~()
  3429. :int86
  3430. ^int int86( int intr_num, union REGS *inregs, union REGS *outregs )
  3431.  
  3432.  
  3433.     - prototype in dos.h
  3434.  
  3435.     - executes 8086 software interrupt specified by intr_num
  3436.     - copies register values from inregs into the registers
  3437.     - if CF is set, an error has occurred
  3438.     - preserves SP register so calls to ~INT 25~ and ~INT 26~ via this
  3439.       function don't require a stack adjustment
  3440.     - unique to DOS
  3441.     - see    ~int86x~()  ~intdos~()   ~intdosx~()   ~intr~()   ~REGS~
  3442. :int86x
  3443. %     int int86x( int intr_num, union REGS *inregs,
  3444. %             union REGS *outregs, struct SREGS *segregs )
  3445.  
  3446.  
  3447.     - prototype in dos.h
  3448.  
  3449.     - Executes 8086 software interrupt specified by intr_num
  3450.     - Copies register values from inregs into the registers
  3451.     - also copies segregs->x.ds and segregs->y.es into DS/ES
  3452.     - if CF is set, an error has occurred
  3453.     - preserves SP register so calls to ~INT 25~ and ~INT 26~ via this
  3454.       function don't require a stack adjustment
  3455.     - unique to DOS
  3456.     - see    ~int86~()  ~intdos~()     ~intdosx~()   ~intr~()  ~REGS~
  3457. :intdos
  3458. ^int intdos(union REGS *inregs, union REGS *outregs )
  3459.  
  3460.  
  3461.     - prototype in dos.h
  3462.  
  3463.     - Executes 8086 software interrupt ~INT 21~
  3464.     - Copies register values from inregs into the registers
  3465.     - if CF is set, an error has occurred
  3466.     - unique to DOS
  3467.     - see    ~intdosx~()   ~int86~()   ~int86x~()   ~intr~()   ~REGS~
  3468. :intdosx
  3469. %      int intdosx( union REGS *inregs, union REGS *outregs,
  3470. %            struct SREGS *segregs )
  3471.  
  3472.  
  3473.     - prototype in dos.h
  3474.  
  3475.     - executes 8086 software interrupt ~INT 21~
  3476.     - copies register values from inregs into the registers
  3477.     - copies segregs->x.ds and segregs->y.es into DS/ES
  3478.     - if CF is set, an error has occurred
  3479.     - unique to DOS
  3480.     - see    ~intdos~()  ~int86~()  ~int86x~()  ~intr~()  ~REGS~
  3481. :intr
  3482. ^TC: void intr( int intr_num, struct REGPACK *preg )
  3483.  
  3484.  
  3485.     - prototype in dos.h
  3486.  
  3487.     - same as ~int86~() except that preg contains registers values
  3488.       both before & after executing interrupt
  3489.     - preserves SP register so calls to ~INT 25~ and ~INT 26~ via this
  3490.       function don't require a stack adjustment
  3491.     - see  ~int86x~()  ~intdos~()  ~intdosx~()   ~REGS~
  3492. :ioctl
  3493. ^TC: int ioctl( int handle, int cmd [, void *argdx, int argcx] )
  3494.  
  3495.     - prototype in io.h
  3496.  
  3497.     - direct interface to  ~INT 21,44~  (IOCTL)
  3498.     - cmd = 0  get device information
  3499.         1  set device information (in argdx)
  3500.         2  read argcx bytes into addr given by argdx
  3501.         3  write argcx bytes from addr given by argdx
  3502.         4  same as 2, but handle treated as drive (0=def.,1=A)
  3503.         5  same as 3, but handle treated as drive (0=def.,1=A)
  3504.         6  get input status
  3505.         7  get output status
  3506.         8  test removability (DOS 3.x)
  3507.         11 set sharing conflict retry count (DOS 3.x)
  3508.     - cmd = 0,1; returns device information (DX of IOCTL call)
  3509.     - cmd = 2-5; returns count of bytes transferred
  3510.     - cmd = 6,7; returns device status
  3511.     - returns -1 on error & errno = EINVAL, EBADF, or EINVDAT
  3512.     - no corresponding function in MS C
  3513. :is...:isalnum:isalpha:isascii:iscntrl:isdigit:isgraph:islower
  3514. ^Character Test Macros
  3515.  
  3516.     int isalnum( int c )    - nonzero if letter or digit
  3517.     int isalpha( int c )    - nonzero if letter
  3518.     int isascii( int c )    - nonzero if in range 0-127
  3519.     int iscntrl( int c )    - nonzero if 0x7F, or 0x00-0x1F
  3520.     int isdigit( int c )    - nonzero if digit
  3521.     int isgraph( int c )    - nonzero if printable 0x21-0x7E excl space
  3522.     int islower( int c )    - nonzero if lowercase
  3523.     int isprint( int c )    - nonzero if printable 0x20-0x7E
  3524.     int ispunct( int c )    - nonzero if punct char (iscntrl | isspace)
  3525.     int isspace( int c )    - nonzero if space,tab, CR, LF, VT or FF
  3526.     int isupper( int c )    - nonzero if uppercase
  3527.     int isxdigit( int c )    - nonzero if hexadecimal digit
  3528.  
  3529.  
  3530.     - prototype in ctype.h
  3531. :isprint:ispunct:isspace:isupper:isxdigit
  3532. ^Character Test Macros
  3533.  
  3534.     int isalnum( int c )    - nonzero if letter or digit
  3535.     int isalpha( int c )    - nonzero if letter
  3536.     int isascii( int c )    - nonzero if in range 0-127
  3537.     int iscntrl( int c )    - nonzero if 0x7F, or 0x00-0x1F
  3538.     int isdigit( int c )    - nonzero if digit
  3539.     int isgraph( int c )    - nonzero if printable 0x21-0x7E excl space
  3540.     int islower( int c )    - nonzero if lowercase
  3541.     int isprint( int c )    - nonzero if printable 0x20-0x7E
  3542.     int ispunct( int c )    - nonzero if punct char (iscntrl | isspace)
  3543.     int isspace( int c )    - nonzero if space,tab, CR, LF, VT or FF
  3544.     int isupper( int c )    - nonzero if uppercase
  3545.     int isxdigit( int c )    - nonzero if hexadecimal digit
  3546.         
  3547.  
  3548.     - prototype in ctype.h
  3549. :isatty
  3550. ^int isatty( int handle )
  3551.  
  3552.  
  3553.     - prototype in io.h
  3554.  
  3555.     - if handle is associated with a character device like tty,
  3556.       console, printer, or serial port returns a non-zero integer
  3557.       otherwise returns zero
  3558.  
  3559. :itoa
  3560. ^char *itoa( int value, char *string, int radix )
  3561.  
  3562.  
  3563.     - prototype in stdlib.h
  3564.  
  3565.     - converts value to string where radix specifies base (2-36)
  3566.  
  3567. :kbhit
  3568. ^int kbhit( void )
  3569.  
  3570.  
  3571.     - prototype in conio.h
  3572.  
  3573.     - returns nonzero if keystroke available else 0
  3574.  
  3575. :keep
  3576. ^TC: void keep( unsigned char status, int size )
  3577.  
  3578.  
  3579.     - prototype in dos.h
  3580.  
  3581.     - keep() returns to MS-DOS with exit status supplied in status,
  3582.       retaining current program resident in memory with size paras and
  3583.       rest of memory freed
  3584.     - MS C uses ~_dos_keep~()
  3585.     - see    ~INT 21,31~
  3586. :labs
  3587. ^long labs( long n )
  3588.  
  3589.  
  3590.     - prototype in stdlib.h
  3591.  
  3592.     - returns absolute long value of n
  3593.  
  3594. :ldexp
  3595. ^double ldexp( double value, int exp )
  3596.  
  3597.  
  3598.     - prototype in math.h
  3599.  
  3600.     - returns value x 2**exp
  3601.  
  3602. :lfind
  3603. ^void *lfind(void *key,void *base,int *nelem,int width,int (*fcmp)())
  3604.  
  3605.  
  3606.     - prototype in stdlib.h
  3607.  
  3608.     - does linear search for items in an unsorted table;
  3609.     - base points to 0th element of table
  3610.     - nelem points to int containing number of entries in table
  3611.     - width contains number of bytes in each entry
  3612.     - key points to the search key
  3613.     - fcmp points to user-written comparison routine, where key and
  3614.       elem are passed to it as pointers.  fcmp returns:
  3615.  
  3616.        integer < 0 if search key < elem
  3617.        integer = 0 if equal
  3618.        integer > 0 if search key > elem
  3619.  
  3620.     - returns 0 if no match found, else address of first matching entry
  3621.  
  3622. :_lineto:_lineto_w
  3623. %        MSC: short far _lineto( short x, short y )
  3624. %        MSC: short far _lineto_w( double wx, double wy )
  3625.  
  3626.  
  3627.     - prototype in graph.h
  3628.  
  3629.     - draws a line from the current graphics position up to and
  3630.       including the point specified
  3631.     - current graphics position is then updated to (x,y)
  3632.     - returns nonzero if success; zero otherwise
  3633.     - Turbo C uses ~lineto~()
  3634.  
  3635. :localtime
  3636. ^struct tm *localtime( const time_t *clock )
  3637.  
  3638.  
  3639.     - prototype in time.h
  3640.  
  3641.  
  3642.     - clock is a long int (such as that returned by time())
  3643.     - returns time in struct tm (see time.h) correcting for time zone
  3644.       and any daylight savings time
  3645.     - global variable timezone is difference in seconds between GMT
  3646.       and local standard time
  3647.  
  3648. :lock (C)
  3649. ^TC: int lock( int handle, long offset, long length )
  3650.  
  3651.  
  3652.     - prototype in io.h
  3653.  
  3654.     - locks arbitrary, non-overlapping regions of any file (DOS 3.X),
  3655.       preventing reads/writes to those regions
  3656.     - returns 0 on success, else -1 on error
  3657.     - all locks must be released before program termination
  3658.     - MS C uses ~locking~()
  3659.     - see    ~unlock~()
  3660. :locking
  3661. ^MSC: int locking( int handle, int mode, long nbytes )
  3662.  
  3663.  
  3664.     - prototype in io.h, sys\locking.h
  3665.  
  3666.     - handle = opened file handle
  3667.     - nbytes = bytes to lock beginning with current file position
  3668.     - mode    = locking mode:
  3669.         = LK_LOCK    lock region; on failure waits 1 sec and
  3670.                 attempts again;  tries 10 times
  3671.         = LK_RLCK    same as LK_LOCK
  3672.         = LK_NBLCK    lock region; returns immediately on error
  3673.         = LK_NBRLCK    lock region; returns immediately on error
  3674.         = LK_UNLCK    unlock previously locked region
  3675.  
  3676.     - multiple locks may occur in a single file
  3677.     - overlapping locked regions are not allowed
  3678.     - returns 0 on success or -1 on failure
  3679.  
  3680.     - Turbo C uses ~lock~() and ~unlock~()
  3681. :log
  3682. ^double log( double x )
  3683.  
  3684.  
  3685.     - prototype in math.h
  3686.  
  3687.     - returns natural logarithm of x, or -HUGE_VAL on error
  3688.  
  3689. :log10
  3690. ^double log10( double x )
  3691.  
  3692.  
  3693.     - prototype in math.h
  3694.  
  3695.     - returns base 10 logarithm of x, or -HUGE_VAL on error
  3696.  
  3697. :longjmp
  3698. ^void longjmp( jmp_buf env, int id )
  3699.  
  3700.  
  3701.     - prototype in setjmp.h
  3702.  
  3703.     - call to longjmp() with env restores task state (set by ~setjmp~()),
  3704.       returning value id
  3705.     - cannot return 0; if id == 0, returns 1
  3706. :_lrotl:_lrotr
  3707. ^MSC: unsigned long _lrotl( unsigned long value, int n )
  3708. ^MSC: unsigned long _lrotr( unsigned long value, int n )
  3709.  
  3710.  
  3711.     - prototype in stdlib.h
  3712.  
  3713.     - rotates long value by 'n' bits left or right
  3714.     - returns rotated value
  3715.  
  3716.     - see   ~_rotl~()  ~_rotr~()
  3717. :lsearch
  3718. ^void *lsearch(void *key,void *base,int *nelem,int width,int (*fcmp)())
  3719.  
  3720.  
  3721.     - prototype in stdlib.h
  3722.  
  3723.     - does linear search in unsorted table for key
  3724.     - base points to 0th element of table
  3725.     - nelem integer pointer to number of entries in table
  3726.     - width contains number of bytes in each entry
  3727.     - key points to the search key
  3728.     - fcmp points to comparison routine, where key and elem are passed
  3729.       to it as pointers.  fcmp returns:
  3730.  
  3731.         integer < 0 if search key < elem
  3732.         integer = 0 if equal;
  3733.         integer > 0 if search key > elem
  3734.  
  3735.     - returns 0 if no match found, else address of first matching entry
  3736.  
  3737. :lseek
  3738. ^long lseek( int handle, long offset, int mode )
  3739.  
  3740.  
  3741.     - prototype in io.h
  3742.  
  3743.     - moves file position of "handle"  to  "offset"  relative to "mode"
  3744.  
  3745.        mode = 0 - SEEK_SET beginning of file
  3746.        mode = 1 - SEEK_CUR current position
  3747.        mode = 2 - SEEK_END or end of file
  3748.  
  3749.     - returns -1L on error
  3750.  
  3751.     - see    ~tell~()
  3752. :ltoa
  3753. ^char *ltoa( long value, char *string, int radix )
  3754.  
  3755.  
  3756.     - prototype in stdlib.h
  3757.  
  3758.     - converts value to string where radix specifies
  3759.       base (2-36) for conversion
  3760.  
  3761. :_makepath
  3762. %       MSC: void _makepath( char *path, char *drive, char *dir,
  3763. %                char *fname, char *ext )
  3764.  
  3765.  
  3766.     - prototype in stdlib.h
  3767.  
  3768.     - creates fully qualified filename from parts
  3769.     - path = receives fully qualified filename created from the parts
  3770.     - drive = drive letter string, with or without the colon
  3771.     - dir = directory name;  both slashes '/' or '\' are allowed;
  3772.       trailing slash is optional
  3773.     - fname = base file name w/o extension (max 8 bytes)
  3774.     - ext = file extension (max 3 bytes)
  3775.  
  3776.     - see    ~_splitpath~()
  3777. :malloc
  3778. ^void *malloc( unsigned size )
  3779.  
  3780.  
  3781.     - prototype in stdlib.h, alloc.h (malloc.h for MS C)
  3782.  
  3783.     - allocates memory of length size in bytes
  3784.     - returns pointer if successful, else NULL
  3785.     - MS C will return a zero length block (allocates header only)
  3786.  
  3787. :_matherr
  3788. %    double _matherr( _mexcep why, char *fun, double *arg1p,
  3789. %             double *arg2p, double retval )
  3790.  
  3791.  
  3792.     - prototype in math.h
  3793.  
  3794.     - used with ~matherr~(), calling matherr() and processes the return
  3795.       value from matherr()
  3796.     - floating point error handling routine
  3797.  
  3798. :matherr
  3799. ^int matherr( struct exception *e )
  3800.  
  3801.  
  3802.     - prototype in math.h
  3803.  
  3804.     - provided as customizable math error-handling routine
  3805.  
  3806. :mem...
  3807. ^Memory Manipulation Functions
  3808.  
  3809.  
  3810.     void  *~memccpy~(void *dest, const void *src, int c, size_t n)
  3811.     void  *~memchr~(const void *s, int c, size_t n)
  3812.     int   ~memcmp~(const void *s1, const void *s2, size_t n)
  3813.     void  *~memcpy~(void *dest, const void *src, size_t n)
  3814.     int   ~memicmp~(const void *s1, const void *s2, size_t n)
  3815.     void  *~memmove~(void *dest, const void *src, size_t n)
  3816.     void  *~memset~(void *s, int c, size_t n)
  3817.     void  ~movedata~(unsigned srcseg, unsigned srcoff,
  3818.             unsigned dstseg, unsigned dstoff, size_t n)
  3819.  
  3820.     - prototypes for the preceding functions are in mem.h, string.h
  3821.     - the following are prototyped in mem.h only (TC):
  3822.  
  3823.     void  ~movmem~(void *src, void *dest, unsigned length)  (mem.h only)
  3824.     void  ~setmem~(void *dest, unsigned length, char value) (mem.h only)
  3825.  
  3826.  
  3827. :_memavl
  3828. ^MSC: size_t _memavl( void )
  3829.  
  3830.  
  3831.     - prototype in malloc.h
  3832.  
  3833.     - returns size in bytes of memory available in the default
  3834.       data segment
  3835.  
  3836. :memccpy
  3837. ^void *memccpy(void *dest, const void *src, int ch, size_t n)
  3838.  
  3839.  
  3840.     - prototype in string.h, mem.h
  3841.  
  3842.     - copies from src to dest until ch is copied or n bytes are copied
  3843.       returning a ptr to byte in dest immediately following ch or NULL
  3844.  
  3845. :memchr
  3846. ^void *memchr( const void *s, int ch, size_t n )
  3847.  
  3848.  
  3849.     - prototype in string.h, mem.h
  3850.  
  3851.     - searches first n bytes in s for ch, returning pointer to first
  3852.       occurrence or NULL if not found
  3853.  
  3854. :memcmp
  3855. ^int memcmp( const void *s1, const void *s2, size_t n )
  3856.  
  3857.  
  3858.     - prototype in string.h, mem.h
  3859.  
  3860.     - compares two strings s1 & s2 for a length of n bytes,
  3861.       returning a value:
  3862.  
  3863.             < 0   if s1 < s2
  3864.             = 0   if s1 = s2
  3865.             > 0   if s1 > s2
  3866.  
  3867. :memcpy
  3868. ^void *memcpy( void *dest, const void *src, size_t n )
  3869.  
  3870.  
  3871.     - prototype in string.h, mem.h
  3872.  
  3873.     - copies n bytes from src to dest; returns dest
  3874.     - if overlap occurs, result is undefined (ANSI)
  3875.  
  3876. :memicmp
  3877. ^int memicmp( const void *s1, const void *s2, size_t n )
  3878.  
  3879.  
  3880.     - prototype in string.h, mem.h
  3881.  
  3882.     - compares first n bytes of s1 & s2, case insensitive
  3883.  
  3884. :memmove
  3885. ^void *memmove( void *dest, const void *src, size_t n )
  3886.  
  3887.  
  3888.     - prototype in string.h, mem.h
  3889.  
  3890.     - copies n bytes from src to dest; returns dest
  3891.     - allows copying overlapped strings (ANSI)
  3892.  
  3893. :memset
  3894. ^void *memset( void *s, int ch, size_t n )
  3895.  
  3896.  
  3897.     - prototype in string.h, mem.h
  3898.  
  3899.     - memset sets all bytes of s to byte ch, with size of s = n;
  3900.       returns value of s
  3901.  
  3902. :mk_fp
  3903. ^void far *MK_FP( unsigned segment, unsigned offset )
  3904.  
  3905.  
  3906.     - prototype in dos.h
  3907.  
  3908.     - returns a far pointer from offset and segment
  3909.  
  3910.  
  3911.  
  3912.     - not available in some Microsoft C versions; use the following:
  3913.  
  3914.  
  3915.     #define MK_FP(seg,off) \
  3916.      ((void far *) (((unsigned long)(seg) << 16) | (unsigned)(off))
  3917.  
  3918.     - see ~FP_OFF~() and ~FP_SEG~()
  3919. :mkdir
  3920. ^int mkdir( const char *pathname )
  3921.  
  3922.  
  3923.     - prototype in dir.h
  3924.  
  3925.     - takes pathname & creates new directory with that name
  3926.     - returns 0 if successful, else -1
  3927.  
  3928. :mktemp
  3929. ^char *mktemp( char *template )
  3930.  
  3931.  
  3932.     - prototype in dir.h
  3933.  
  3934.     - replaces template by unique file name & returns address of
  3935.       template if successful
  3936.     - template should be string with six trailing Xs
  3937.  
  3938. :modf
  3939. ^double modf( double value, double *iptr )
  3940.  
  3941.  
  3942.     - prototype in math.h
  3943.  
  3944.     - splits value in integer and fraction part, storing integer part
  3945.       in area pointed to by iptr, returning the fractional part
  3946.  
  3947. :movedata
  3948. %    void movedata( unsigned segsrc, unsigned offsrc,
  3949. %            unsigned segdest, unsigned offdest, size_t n )
  3950.  
  3951.  
  3952.     - prototype in mem.h, string.h
  3953.  
  3954.     - copies n bytes from segsrc:offsrc to segdest:offdest
  3955.  
  3956. :_moveto:_moveto_w
  3957. %     MSC: struct xycoord far _moveto( short x, short y )
  3958. %     MSC: struct _wxycoord far _moveto_w ( double wx, double wy )
  3959.  
  3960.  
  3961.     - prototype in graph.h
  3962.  
  3963.     - moves current drawing position to specified coordinates
  3964.     - returns previous coordinates in the following structures:
  3965.  
  3966.     struct xycoord        struct _wxycoord
  3967.         {                {
  3968.         short xcoord;        double wx;       - window x coord
  3969.         short ycoord;        double wy;       - window y coord
  3970.         };                };
  3971.  
  3972.     - see    ~_lineto~()
  3973. :movmem
  3974. ^void movmem( void *src, void *dest, unsigned len )
  3975.  
  3976.  
  3977.     - prototype in mem.h
  3978.  
  3979.     - copies len bytes from src to dest
  3980.  
  3981. :_msize:_bmsize:_fmsize:_nmsize
  3982. %    MSC: size_t _msize( void *block )
  3983. %    MSC: size_t _bmsize( _segment seg, void _based( void ) *block )
  3984. %    MSC: size_t _fmsize( void far *block )
  3985. %    MSC: size_t _nmsize( void near *block )
  3986.  
  3987.  
  3988.     - prototype in malloc.h
  3989.  
  3990.     - returns size of memory block in bytes
  3991.     - _msize() maps to other function depending on memory model
  3992.  
  3993. :_open
  3994. ^TC: int _open( const char *path, int access )
  3995.  
  3996.  
  3997.     - prototype in io.h, also include fcntl.h
  3998.  
  3999.     - this function will not create a file, use _creat() if it doesn't
  4000.       currently exist
  4001.     - access is a combination of the following:
  4002.  
  4003. %        DOS 2.0+ Attributes
  4004.         O_RDONLY    open read only
  4005.         O_WRONLY    open write only
  4006.         O_RDWR    open read/write
  4007.  
  4008. %        DOS 3.1+ Attributes
  4009.         O_NOINHERIT    file is not to be passed to child processes
  4010.         O_DENYALL    file is not accessible to others (exclusive)
  4011.         O_DENYWRITE    file is read only to all other opens
  4012.         O_DENYREAD    file is write only to all other opens
  4013.         O_DENYNONE    file is to be shared by all
  4014.  
  4015.     - MS C uses ~_dos_open~()
  4016.     - see    ~INT 21,3D~   ~open~()   ~_creat~()
  4017. :onexit
  4018. ^MSC: onexit_t onexit( onexit_t func )
  4019.  
  4020.  
  4021.     - prototype in stdlib.h
  4022.  
  4023.     - creates a list of functions to execute on normal program exit
  4024.     - on exit functions are executed LIFO
  4025.     - a max of 32 function can be registered
  4026.     - returns pointer to "func" on success;  NULL otherwise
  4027.     - this is a Microsoft/Lattice extension; ANSI uses ~atexit~()
  4028.  
  4029.     - see  ~exit~()  ~abort~()
  4030. :open
  4031. ^int open( const char *path, int access [, unsigned permis] )
  4032.  
  4033.     - prototype in io.h, also include stat.h & fcntl.h
  4034.  
  4035.     - open attribute flags are defined in fcntl.h
  4036.     - opens file "path" with access and optionally permis
  4037.     - access is a combination of the following ("permis" follows):
  4038.  
  4039. %      Read/Write Access Flags (mutually exclusive):
  4040.        O_RDONLY    open read only
  4041.        O_WRONLY    open write only
  4042.        O_RDWR    open read/write
  4043.  
  4044. %      Other Access Mode Flags:
  4045.        O_APPEND    file pointer is placed at EOF before each write
  4046.        O_CREAT    if file doesn't exist, create with "permis" attributes
  4047.        O_TRUNC    if exists, truncate length to zero, but leave file
  4048.             attributes unchanged
  4049.        O_BINARY    binary mode
  4050.        O_TEXT    text mode
  4051.        O_EXCL    used with O_CREAT, error occurs if file already exists
  4052.        O_NDELAY    UNIX only
  4053.  
  4054. %      Permission Attributes (if creating):
  4055.        S_IWRITE    write permission
  4056.        S_IREAD    read permission
  4057.        S_IREAD | S_IWRITE read/write permission
  4058.      
  4059.     - if O_BINARY nor O_TEXT is given, file is opened in translation
  4060.       mode (O_TEXT) given by global variable _fmode
  4061.     - returns nonnegative number as file HANDLE, or -1 on error
  4062.     - see    ~sopen~()
  4063. :outp:outpw
  4064. %        MSC: int outp( unsigned port, int datab )
  4065. %        MSC: unsigned outpw(unsigned port, unsigned dataw )
  4066.  
  4067.  
  4068.     - prototype in conio.h
  4069.  
  4070.     - write data value to port specified in port
  4071.     - port = hardware I/O port
  4072.     - datab = byte value to write
  4073.     - dataw = word value to write
  4074.  
  4075.     - Turbo C uses ~outportb~() and ~outport~()
  4076.  
  4077. :outport
  4078. ^TC: void outport( int port, int word )
  4079.  
  4080.  
  4081.     - prototype in dos.h
  4082.  
  4083.     - outport() writes word to output port port
  4084.     - MS C uses ~outpw~()
  4085.     - see also ~outportb~()
  4086. :outportb
  4087. ^TC: void outportb( int port, unsigned char byte )
  4088.  
  4089.  
  4090.     - prototype in dos.h
  4091.  
  4092.     - outportb() is macro that writes byte to output port port
  4093.     - MS C uses ~outp~()
  4094.     - see also ~outport~()
  4095. :_outtext
  4096. ^MSC: void far _outtext( unsigned char far *text )
  4097.  
  4098.  
  4099.     - prototype in graph.h
  4100.  
  4101.     - writes string in "text' to the graphics display
  4102.  
  4103. :parsfnm
  4104. ^TC: char *parsfnm( const char *cmdline, struct fcb *fcbptr, int option)
  4105.  
  4106.  
  4107.     - prototype in dos.h
  4108.  
  4109.     - parses command line cmdline for a file name, placing it into a
  4110.       FCB as drive/filename/file ext, pointed to by fcbptr
  4111.     - option is same as AL in MS-DOS function call ~INT 21,29~
  4112.     - returns pointer to byte beyond end of filename, 0=error
  4113.  
  4114. :peek
  4115. ^TC: int peek( unsigned seg, unsigned off )
  4116.  
  4117.  
  4118.     - prototype in dos.h
  4119.  
  4120.     - returns word found at seg:off
  4121.  
  4122. :peekb
  4123. ^TC: char peekb( unsigned seg, unsigned off )
  4124.  
  4125.  
  4126.     - prototype in dos.h
  4127.  
  4128.     - returns byte found at seg:off
  4129.  
  4130. :perror
  4131. ^void perror( const char *string )
  4132.  
  4133.  
  4134.     - prototype in stdio.h
  4135.  
  4136.     - prints error message to stderr, describing most recent call
  4137.       found in system call from current program
  4138.  
  4139. :_pie:_pie_wxy
  4140. %    MSC: short _pie( short control, short x1, short y1, short x2,
  4141. %             short y2, short x3, short y3, short x4, short y4 )
  4142.  
  4143. %    MSC: short far _pie_wxy( short ctl,
  4144. %               struct _wxycoord far *pwxy1,
  4145. %               struct _wxycoord far *pwxy2,
  4146. %               struct _wxycoord far *pwxy3,
  4147. %               struct _wxycoord far *pwxy4 )
  4148.  
  4149.     - prototype in graph.h
  4150.  
  4151.     - (x1, y1) upper left rectangle corner
  4152.     - (x2, y2) lower right rectangle corner
  4153.     - (x3, y3) start of vector
  4154.     - (x4, y4) end of vector
  4155.     - ctl = _GFILLINTERIOR    fills region with current color and mask
  4156.         _GBORDER  don't fill region
  4157.  
  4158.     - returns nonzero value on success; zero otherwise
  4159.  
  4160. :poke
  4161. ^TC: void poke( unsigned seg, unsigned off, int value )
  4162.  
  4163.  
  4164.     - prototype in dos.h
  4165.  
  4166.     - writes word value to location seg:off
  4167.  
  4168. :pokeb
  4169. ^TC: void pokeb( unsigned seg, unsigned off, char value )
  4170.  
  4171.  
  4172.     - prototype in dos.h
  4173.  
  4174.     - writes byte value to location seg:off
  4175.  
  4176. :poly
  4177. ^double poly( double x, int n, double coeff[] )
  4178.  
  4179.  
  4180.     - prototype in math.h
  4181.  
  4182.     - generates polynominal in x of degree n, with coefficients coeff,
  4183.       returning the value of this polynominal evaluated for x
  4184.  
  4185. :pow
  4186. ^double pow( double x, double y )
  4187.  
  4188.  
  4189.     - prototype in math.h
  4190.  
  4191.     - returns p where p = x ** y or +/- HUGE_VAL on error
  4192.  
  4193. :pow10
  4194. ^double pow10( double x )
  4195.  
  4196.  
  4197.     - prototype in math.h
  4198.  
  4199.     - returns y where y = 10 ** x or HUGE_VAL on overflow error
  4200.  
  4201. :printf
  4202. ^int printf( const char *format [, arg1, arg2, ...] )
  4203.  
  4204.  
  4205.     - prototype in stdio.h
  4206.  
  4207.     - printf formatted string
  4208.  
  4209.  
  4210.     - see    ~PRINTF SPEC~   for format specifiers
  4211. :printf specifiers
  4212. ^Specifications for printf()
  4213.  
  4214. %    %[-][+][space][#][width][.prec][size]type
  4215.  
  4216. %    Field            Description
  4217.  
  4218.     -    left justify
  4219.     +    prefix positive numbers with '+', overrides blank
  4220.     space   prefix positive numbers with space
  4221.     #    prefix octal or hex with 0, (see manual for Turbo C)
  4222.     width    width of output string in total characters, a 0 before
  4223.         width causes padding with zeros on left.
  4224.     .prec   decimal precision in characters
  4225.     size    F    far pointer
  4226.         N    near pointer
  4227.         h    specifies short
  4228.         l    specifies long
  4229.         L    long double
  4230.     type    c    single character
  4231.         d    signed decimal integer
  4232.         e    signed exponential, 'e' is output in string
  4233.         E    signed exponential, 'E' is output in string
  4234.         f    signed floating point in form of sddd.ddd
  4235.         g    formats e or f (depends on size), e is output
  4236.         G    formats e or f (depends on size), E is output
  4237.         i    signed decimal integer
  4238.         n    integer pointer
  4239.         o    unsigned octal integer
  4240.         p    void pointer;  MS C always uses far pointers, in
  4241.             Turbo C, size is dependent on memory model
  4242.         s    string pointer
  4243.         u    unsigned decimal integer
  4244.         x    unsigned integer in lower case hex format
  4245.         X    unsigned integer in upper case hex format
  4246.  
  4247.     - if width or precision are specified as an asterisk '*', an int
  4248.       from the argument list is used as the width or precision. If the
  4249.       width is too small the field is expanded.  Example:
  4250.  
  4251.         int len = 5;
  4252.         char *string = "This is a string"
  4253.  
  4254.         printf("%*.*s", len, len, "string");
  4255.  
  4256.       is functionally similar to a specification string of "%5.5s"
  4257.       which prints a max of 5 characters of the string.
  4258. :putc
  4259. ^int putc( int c, FILE *fp )
  4260.  
  4261.  
  4262.     - prototype in stdio.h
  4263.  
  4264.     - puts char "c" to stream "fp"
  4265.     - returns c on success, EOF on error
  4266.  
  4267. :putch
  4268. ^int putch( int ch )
  4269.  
  4270.  
  4271.     - prototype in conio.h
  4272.  
  4273.     - puts char ch to console with BEL, BS, TAB, LF and BEL characters
  4274.       are converted similar to DOS I/O
  4275.     - TC uses direct video or BIOS depending on value of external
  4276.       variable directvideo
  4277.     - returns nothing
  4278.  
  4279. :putchar
  4280. ^int putchar( char c )
  4281.  
  4282.  
  4283.     - prototype in stdio.h
  4284.  
  4285.     - same as ~putc~(c,stdout)
  4286.  
  4287. :putenv
  4288. ^int putenv( const char *envvar )
  4289.  
  4290.  
  4291.     - prototype in stdlib.h
  4292.  
  4293.     - adds string to environment
  4294.     - DOS environment consists of strings of form envvar=varvalue,...
  4295.     - returns 0 if OK
  4296.           1 on failure
  4297.  
  4298. :_putimage:_putimage_w
  4299. %    MSC: void _putimage(short x, short y, char huge *image, short action)
  4300.  
  4301. %    MSC: void far _putimage_w( double wx, double wy,
  4302. %                   char huge *image, short action )
  4303.  
  4304.     - prototype in graph.h
  4305.  
  4306.     - restores previously saved screen image to screen
  4307.     - (x, y) upper left corner of image
  4308.     - image = buffer containing previously saved image
  4309.     - action = defines interaction between current screen buffer and
  4310.            the data stored in "image"
  4311.          = _GAND    AND image with current screen
  4312.          = _GOR        OR image with current screen
  4313.          = _GPRESET    overwrite current screen with inverse of image
  4314.          = _GPSET    overwrite current screen with exact image
  4315.          = _GXOR    XOR's image to current screen
  4316.  
  4317.     - Turbo C uses ~putimage~()
  4318.     - see    ~_getimage~()   ~_imagesize~()
  4319. :putimage
  4320. ^void far putimage( int left, int top, void far *bitmap, int option )
  4321.  
  4322.     - prototype in graphics.h
  4323.  
  4324.     - left and top represent the upper left corner of the area the
  4325.       bitmap data will be placed
  4326.  
  4327.     - op may be one of the following:
  4328.         COPY_PUT copy data from bitmap to screen and erasing contents
  4329.         XOR_PUT  xor data in bitmap with current screen
  4330.         OR_PUT   or data in bitmap with current screen
  4331.         AND_PUT  and data in bitmap with current screen
  4332.         NOT_PUT  similar to COPY_PUT, but inverse of data
  4333.  
  4334.     - the ~getimage~()/putimage() buffer has the following format:
  4335.         00    width of image    (WORD)
  4336.         02    height of image  (WORD)
  4337.         04    actual bitmap pixel data, format and size is
  4338.             related to video mode and dimensions
  4339. :puts
  4340. ^int puts( const char *string )
  4341.  
  4342.  
  4343.     - prototype in stdio.h
  4344.  
  4345.     - copies string to stdout and appends a newline
  4346.  
  4347. :putw
  4348. ^int putw( int n, FILE *fp )
  4349.  
  4350.  
  4351.     - prototype in stdio.h
  4352.  
  4353.     - puts integer word n to stream fp
  4354.     - returns n or EOF on error.  Use ferror() to verify
  4355.       if EOF is returned, since -1 is a legitimate integer.
  4356.  
  4357. :qsort
  4358. %    void qsort( void *array, size_t n_elem, size_t elem_size,
  4359. %            int (*fcmp)(const void *, const void *) )
  4360.  
  4361.  
  4362.     - prototype in stdlib.h
  4363.  
  4364.     - sorts the given array using the ACM quick sort routine
  4365.     - fcmp() is the same as for ~bsearch~()
  4366.  
  4367. :raise
  4368. ^MSC: int raise( int sig )
  4369.  
  4370.  
  4371.     - prototype in signal.h
  4372.  
  4373.     - raises signal to program where 'sig' is:
  4374.  
  4375.         SIGABRT    signal abnormal termination
  4376.         SIGILL    signal illegal instruction
  4377.         SIGSEGV    signal illegal storage access
  4378.         SIGFPE    signal floating point error
  4379.         SIGINT    signal Ctrl-Break interrupt
  4380.         SIGTERM    signal program termination (ignored in MS DOS)
  4381.         SIGUSR1    user signal
  4382.         SIGUSR2    user signal
  4383.         SIGUSR3    user signal
  4384.  
  4385.     - returns 0 on success; nonzero otherwise
  4386.  
  4387.     - see    ~signal~()
  4388. :rand
  4389. %        int rand( void )
  4390. %        void srand( unsigned seed )
  4391.  
  4392.  
  4393.     - prototype in stdlib.h
  4394.  
  4395.     - rand() returns pseudorandom numbers
  4396.     - re-initialize generator with ~srand~(1) or set to new starting
  4397.       point with seed set other than to 1
  4398.  
  4399. :randbrd
  4400. ^TC: int randbrd( struct fcb *fcbptr, int reccnt )
  4401.  
  4402.  
  4403.     - prototype in dos.h
  4404.  
  4405.     - randbrd() reads reccnt number of records using the open FCB via
  4406.       fcbptr, as indicated by the disk record field of the FCB (via
  4407.       ~INT 21,27~)
  4408.     - returns:
  4409.       0  all records read(written)
  4410.       1  EOF reached & last record read is complete
  4411.       2  reading records would have wrapped around address 0xffff
  4412.       3  EOF reached & last record is incomplete
  4413.     - see    ~randbrw~()
  4414. :randbrw
  4415. ^TC: int randbrw( struct fcb *fcbptr, int reccnt )
  4416.  
  4417.  
  4418.     - prototype in dos.h
  4419.  
  4420.     - randbrw() returns 1 if there is not enough disk space to write
  4421.       the records (no records are written)
  4422.     - see    ~randbrd~()
  4423. :_read
  4424. ^TC: int _read( int handle, void *buf, int size )
  4425.  
  4426.  
  4427.     - prototype in io.h
  4428.  
  4429.     - reads "size" bytes from file "handle" into "buf"
  4430.     - size must be less than 65534 bytes
  4431.     - is a direct call to MS-DOS read function ~INT 21,3F~
  4432.     - does not translate CR/LF;  all input in binary
  4433.     - returns number of bytes successfully transferred or -1
  4434.     - MS C uses ~_dos_read~()
  4435.  
  4436.     - see   ~read~()  ~_open~()  ~_creat~()  ~_write~()   ~_close~()
  4437. :read
  4438. ^int read( int handle, char *buf, int size )
  4439.  
  4440.  
  4441.     - prototype in io.h
  4442.  
  4443.     - reads "size" bytes from file "handle" into "buf"
  4444.     - removes CR's & reports EOF on a Ctrl-Z for text mode file
  4445.     - returns number of bytes read, 0 on EOF, or -1 on error
  4446.  
  4447. :realloc
  4448. ^void *realloc( void *pseg, unsigned size )
  4449.  
  4450.  
  4451.     - prototype in stdlib.h & alloc.h (malloc.h for MS C)
  4452.  
  4453.     - see    ~malloc~()
  4454. :_rectangle:_rectangle_w:_rectangle_wxy
  4455. %    MSC: short _rectangle( short ctl, short x1, short y1,
  4456. %                short x2, short y2 )
  4457.  
  4458. %    MSC: short far _rectangle_w( short control, double wx1,
  4459. %                    double wy1, double wx2, double wy2 )
  4460.  
  4461. %    MSC: short far _rectangle_wxy( short control,
  4462. %        struct _wxycoord far *pwxy1, struct _wxycoord far *pwxy2 )
  4463.  
  4464.  
  4465.     - prototype in graph.h
  4466.  
  4467.     - (x1,y1) upper left corner of rectangle
  4468.     - (x2,y2) lower right corner of rectangle
  4469.     - ctl    = _GFILLINTERIOR    fill rect. with current color and mask
  4470.         = _GBORDER        don't fill rectangle
  4471.  
  4472.     - returns nonzero on success; zero otherwise
  4473.  
  4474. :_remapallpalette:_remappalette
  4475. %    MSC: short far _remapallpalette( long far *colors )
  4476. %    MSC: long far _remappalette( short pixnum, long color )
  4477.  
  4478.     - prototype in graph.h
  4479.  
  4480.     - colors = color number array containing one color per video
  4481.            mode color
  4482.     - pixnum = pixel to change
  4483.     - color = new color number
  4484.  
  4485. %    Valid colors are:
  4486.  
  4487.     _BLACK        _BLUE        _BRIGHTWHITE    _BROWN
  4488.     _CYAN        _GRAY        _GREEN        _LIGHTBLUE
  4489.     _LIGHTCYAN    _LIGHTGREEN    _LIGHTMAGENTA    _LIGHTRED
  4490.     _YELLOW        _MAGENTA    _RED        _WHITE
  4491.  
  4492.     - _remapallpalette() remaps all pixel values; _remappalette()
  4493.       affects on the pixel specified by pixnum
  4494.     - _remapallpalette() returns -1 on success; zero otherwise
  4495.     - _remappalette() previous color value of "pixnum" on success; -1
  4496.       otherwise
  4497.  
  4498. :remove
  4499. ^int remove( char *filename )
  4500.  
  4501.  
  4502.     - prototype in stdio.h
  4503.  
  4504.     - implemented as a macro of function ~unlink~()
  4505.     - attempts to delete an open file may damage the file system
  4506.  
  4507. :rename
  4508. ^int rename( const char *oldf, const char *newf )
  4509.  
  4510.  
  4511.     - prototype in stdio.h
  4512.  
  4513.     - rename file from oldf to newf
  4514.     - attempts to rename an open file may damage the file system
  4515.     - returns 0 if OK, else -1 on error
  4516.  
  4517. :rewind
  4518. ^void rewind( FILE *fp )
  4519.  
  4520.  
  4521.     - prototype in stdio.h
  4522.  
  4523.     - equivalent to ~fseek~(fp,0L,SEEK_SET), except EOF and
  4524.       error indicators are cleared
  4525.     - returns 0 if pointer moved OK, else nonzero
  4526.  
  4527. :rmdir
  4528. ^int rmdir( const char *path )
  4529.  
  4530.  
  4531.     - prototype in dir.h
  4532.  
  4533.     - takes path & deletes directory with that name
  4534.     - returns 0 if successful, else -1
  4535.  
  4536. :rmtmp
  4537. ^MSC: int rmtmp( void )
  4538.  
  4539.  
  4540.     - prototype in stdio.h
  4541.  
  4542.     - cleans up all temporary files in the current directory created
  4543.       by ~tmpfile~()
  4544.     - should only be used on files in the current directory
  4545.     - returns number of temporary files closed and deleted
  4546.  
  4547. :_rotl:_rotr
  4548. ^MSC: unsigned _rotl( unsigned value, int shift )
  4549. ^MSC: unsigned _rotr( unsigned value, int shift )
  4550.  
  4551.  
  4552.     - prototype in stdlib.h
  4553.  
  4554.     - rotates value by 'n' bits left or right
  4555.     - returns rotated value
  4556.  
  4557.     - see     ~_lrotl~()   ~_lrotr~()
  4558. :sbrk
  4559. ^void *sbrk( int incr )
  4560.  
  4561.  
  4562.     - prototype in alloc.h (malloc.h for MS C)
  4563.  
  4564.     - dynamically changes the amount of space allocated to the calling
  4565.       programs data segment.  Amount of allocated space is increased by
  4566.       amount incr (can be negative).
  4567.  
  4568.     - returns 0 if OK
  4569.          -1 & errno is set to ENOMEM
  4570.  
  4571. :scanf
  4572. ^int scanf( const char *format, arg1, arg2, ... )
  4573.  
  4574.  
  4575.     - prototype in stdio.h
  4576.  
  4577.     - accepts input from stdin and converts to format specs
  4578.  
  4579.  
  4580.     - see    ~SCANF SPEC~
  4581. :scanf specifiers
  4582. ^Specifications for scanf()
  4583.  
  4584. %    %[*][width][size]type
  4585.  
  4586. %    Field              Description
  4587.  
  4588.     *    read next field but suppress assignment
  4589.     width     maximum number of characters to read
  4590.     size    F    far pointer
  4591.         N    near pointer
  4592.         h    specifies short
  4593.         l    specifies long
  4594.     type    %    prints % character
  4595.         c    character data
  4596.         d    signed decimal integer
  4597.         D    signed long int
  4598.         e,E    signed exponential
  4599.         f    signed floating point in form of sddd.ddd
  4600.         g,G    used for e and f formats
  4601.         i    signed decimal, octal or hex integer
  4602.         I    signed decimal, octal, or hex long integer
  4603.         n    integer pointer
  4604.         o    unsigned octal integer
  4605.         O    unsigned octal long integer
  4606.         p    void pointer;  MS C always uses far pointers, in
  4607.             Turbo C, size is dependent on memory model
  4608.         s    string pointer
  4609.         u    unsigned decimal integer
  4610.         U    unsigned decimal long integer
  4611.         x    unsigned hexadecimal integer
  4612.         X    unsigned hexadecimal long integer
  4613.  
  4614.     - The unpredictability of ~scanf~() in the DOS environment precludes
  4615.       its use in a user friendly user interface.
  4616.  
  4617. :_searchenv
  4618. ^MSC: void _searchenv( char *fname, char *var, char *path )
  4619.  
  4620.  
  4621.     - prototype in stdlib.h
  4622.  
  4623.     - searches for "fname" in environment variable "var"
  4624.     - fname = name of file to search for
  4625.     - var = environment variable to use for search
  4626.     - path = receives path if file found
  4627.     - attempts to locate filename using MS-DOS file search strategy
  4628.  
  4629.     - Turbo C uses ~searchpath~()
  4630.  
  4631. :searchpath
  4632. ^TC: char *searchpath( const char *filename )
  4633.  
  4634.  
  4635.     - prototype in dir.h
  4636.  
  4637.     - filename = name of file to search for
  4638.     - attempts to locate filename using MS-DOS path using standard
  4639.       DOS file search strategy
  4640.     - returns pointer to full pathname for filename (in a static
  4641.       array) or NULL if not found
  4642.     - MS C uses ~_searchenv~()
  4643.  
  4644. :segread
  4645. ^void segread( struct SREGS *segregs )
  4646.  
  4647.  
  4648.     - prototype in dos.h
  4649.  
  4650.     - places current values of segment registers (SEGREGS) into segtbl
  4651.     - available in Turbo C and MS C
  4652.     - unique to DOS
  4653.     - see    ~REGS~
  4654. :_selectpalette
  4655. ^MSC: short far _selectpalette( short palette )
  4656.  
  4657.  
  4658.     - prototype in graph.h
  4659.  
  4660.     - palette = palette number
  4661.     - works only in MRES4COLOR and MRESNOCOLOR video modes
  4662.     - returns value of previous palette
  4663.  
  4664. :_setactivepage
  4665. ^MSC: short far _setactivepage( short page )
  4666.  
  4667.  
  4668.     - prototype in graph.h
  4669.  
  4670.     - page = memory page where graphics output will be written
  4671.     - if successful returns page number of former active page or
  4672.       negative value on failure
  4673.     - swapping video pages is a good method of handling animation
  4674.  
  4675. :_setbkcolor
  4676. ^MSC: long far _setbkcolor( long color )
  4677.  
  4678.  
  4679.     - prototype in graph.h
  4680.  
  4681.     - color = new color for background
  4682.     - returns previous background color
  4683.  
  4684. :setblock
  4685. ^TC: int setblock( unsigned seg, unsigned newsize )
  4686.  
  4687.  
  4688.     - prototype in dos.h
  4689.  
  4690.     - modifies size of previously allocated DOS memory segment
  4691.     - MSC uses ~_dos_setblock~()
  4692.     - see    ~INT 21,4A~
  4693. :setbuf
  4694. ^void setbuf( FILE *stream, char *buf )
  4695.  
  4696.  
  4697.     - prototype in stdio.h
  4698.  
  4699.     - causes "buf" to be used for I/O buffering instead of the
  4700.       automatically allocated buffer, and are used after given
  4701.       stream is opened
  4702.     - if "buf" is NULL, I/O is unbuffered
  4703.     - no I/O to the file should occur after opening file until
  4704.       buffering is set
  4705.  
  4706.     - see    ~setvbuf~()
  4707. :setcbrk
  4708. ^TC: int setcbrk( int value )
  4709.  
  4710.  
  4711.     - prototype in dos.h
  4712.  
  4713.     - sets control-break setting (value = 0 sets Ctrl-C checking off
  4714.       except for during console and printer I/O; value = 1 always
  4715.       check during DOS calls)
  4716.  
  4717. :_setcliprgn
  4718. ^MSC: void far _setcliprgn( short x1, short y1, short x2, short y2 )
  4719.  
  4720.  
  4721.     - prototype in graph.h
  4722.  
  4723.     - all graphics output to the screen is limited to the specified
  4724.       region;  output to areas other than this area is clipped
  4725.     - (x1,y1) upper left corner of clipping region
  4726.     - (x1,y1) lower right corner of clipping region
  4727.  
  4728. :_setcolor
  4729. ^MSC: short far _setcolor( short color )
  4730.  
  4731.  
  4732.     - prototype in graph.h
  4733.  
  4734.     - color = new color value
  4735.     - returns previous color index or -1 on error
  4736.     - all subsequent graphics calls will use the specified color
  4737.  
  4738. :setdate
  4739. ^TC: void setdate( struct date *dateblk )
  4740.  
  4741.  
  4742.     - prototype in dos.h
  4743.  
  4744.     - sets DOS date via ~INT 21,2B~
  4745.     - DOS 3.3+ also sets CMOS clock
  4746.  
  4747.     - MS C uses ~_dos_setdate~()
  4748. :setdisk
  4749. ^TC: int setdisk( int drive )
  4750.  
  4751.  
  4752.     - prototype in dir.h
  4753.  
  4754.     - set current drive to set as default;    0 = A:, 1 = B:, ...
  4755.     - returns total number of drives available
  4756.  
  4757.     - MS C uses ~_dos_setdrive~()
  4758.     - see    ~INT 21,E~
  4759. :setdta
  4760. ^TC: void setdta( char far *dta )
  4761.  
  4762.  
  4763.     - prototype in dos.h
  4764.  
  4765.     - changes current setting of the ~DTA~ as given by DTA
  4766.     - no corresponding function in MS C
  4767.  
  4768. :_setfillmask
  4769. ^MSC: void far _setfillmask( unsigned char far *mask )
  4770.  
  4771.  
  4772.     - prototype in graph.h
  4773.  
  4774.     - mask =  8 by 8 bit fill mask array
  4775.     - sets the fill mask used to fill screen regions
  4776.     - any bit set to 1 will have the default color; any bit cleared
  4777.       to zero leaves the pixel unchanged
  4778.     - when no fill mask is set (NULL), the default color only is used
  4779.  
  4780. :_setfont
  4781. ^MSC: short far _setfont( unsigned char far *options )
  4782.  
  4783.  
  4784.     - prototype in graph.h
  4785.  
  4786.     - returns font with matching "options"
  4787.       returns negative value on error
  4788.       -1  Font not registered
  4789.       -4  not enough memory for font
  4790. :setftime
  4791. ^TC: int setftime( int handle, struct ftime *ftimep )
  4792.  
  4793.  
  4794.     - prototype in dos.h
  4795.  
  4796.     - sets file time and date for the file associated with handle as
  4797.       defined by ftimep
  4798.     - structure ftime is defined in dos.h
  4799.     - MS C uses ~_dos_setftime~()
  4800.     - see    ~INT 21,57~
  4801. :setjmp
  4802. ^int setjmp( jmp_buf env )
  4803.  
  4804.  
  4805.     - prototype in setjmp.h
  4806.  
  4807.     - captures callers task state in env and returns 0
  4808.     - see    ~longjmp~()
  4809. :_setlinestyle
  4810. ^MSC: void far _setlinestyle( unsigned short mask )
  4811.  
  4812.  
  4813.     - prototype in graph.h
  4814.  
  4815.     - each 1 bit represents a pixel (in current color) in the line
  4816.       mask;  each 0 represent a pixel that is left alone
  4817.     - default line style is FFFFh
  4818.  
  4819.     - see    ~_getlinestyle~()
  4820. :_setlogorg:_setvieworg
  4821. ^struct xycoord far _setlogorg( short x, short y )
  4822.  
  4823.  
  4824.     - prototype in graph.h
  4825.  
  4826.     - moves the logical origin (0,0) to the physical point (x,y)
  4827.     - returns previous logical origin in physical coordinates to:
  4828.  
  4829.     struct xycoord
  4830.         {
  4831.         short xcoord;
  4832.         short ycoord;
  4833.         };
  4834.  
  4835. :setmem
  4836. ^void setmem( void *addr, int len, char value )
  4837.  
  4838.  
  4839.     - prototype in mem.h
  4840.  
  4841.     - sets len bytes in addr to value
  4842.  
  4843. :setmode
  4844. ^int setmode( int handle, int mode )
  4845.  
  4846.  
  4847.     - prototype in io.h
  4848.  
  4849.     - sets mode of file associated with handle to binary (O_BINARY) or
  4850.       text (O_TEXT) but not both
  4851.     - returns 0 if successful, else -1 on error
  4852.  
  4853. :_setpixel:_setpixel_w
  4854. %        MSC: short far _setpixel( short x, short y )
  4855. %        MSC: short far _setpixel_w( double wx, double wy )
  4856.  
  4857.  
  4858.     - prototype in graph.h
  4859.  
  4860.     - returns previous value of pixel or -1 on error
  4861.  
  4862.     - Turbo C uses ~setpixel~()
  4863.     - see    ~_getpixel~()
  4864. :_settextcolor
  4865. ^MSC: short far _settextcolor( short color )
  4866.  
  4867.  
  4868.     - prototype in graph.h
  4869.  
  4870.     - sets color of graphics text to color
  4871.     - default color is the highest valid color
  4872.     - returns previous color
  4873.  
  4874.     - see    ~_gettextcolor~()
  4875. :_settextposition
  4876. %    MSC: struct rccoord far _settextposition( short row, short column )
  4877.  
  4878.  
  4879.     - prototype in graph.h
  4880.  
  4881.     - sets the current text position to that specified
  4882.     - returns previous text position in rccoord structure
  4883.  
  4884.     - see    ~_gettextposition~()
  4885. :_settextwindow
  4886. ^MSC: void far _settextwindow(short r1,short c1,short r2,short c2)
  4887.  
  4888.  
  4889.     - prototype in graph.h
  4890.  
  4891.     - sets graphics text output window;  text scrolls in window when
  4892.       the window becomes full
  4893.     - (r1,c1) upper left corner of window
  4894.     - (r2,c2) lower right corner of window
  4895.  
  4896.  
  4897. :settime
  4898. ^TC: void settime( struct time *timep )
  4899.  
  4900.  
  4901.     - prototype in dos.h
  4902.  
  4903.     - sets MS-DOS time via INT 21,2D
  4904.     - DOS 3.3+ also sets CMOS clock
  4905.  
  4906.     - MS C uses ~_dos_settime~()
  4907.     - see    ~INT 21,2D~
  4908. :setvbuf
  4909. ^int setvbuf( FILE *stream, char *buf, int type, size_t size )
  4910.  
  4911.  
  4912.     - prototype in stdio.h
  4913.  
  4914.     - causes buf to be used for I/O buffering instead of the auto-
  4915.       matically allocated buffer; used after given stream is opened
  4916.       and before output
  4917.     - in setvbuf, if buf is NULL, a buffer is allocated via malloc()
  4918.     - no I/O to the file should occur until after buffering is set
  4919.  
  4920.     - see    ~setbuf~()
  4921. :setvect
  4922. ^TC: void setvect( int intr_num, void interrupt(*isr)() )
  4923.  
  4924.  
  4925.     - prototype in dos.h
  4926.  
  4927.     - sets the value of interrupt vector named by intr_num
  4928.       (corresponds to 0-255 for MS-DOS) in DOS interrupt vector
  4929.       table to a far pointer to "isr" an interrupt service routine
  4930.     - address of a C routine may be used only if it has been
  4931.       declared to be an interrupt routine.    Ex:
  4932.  
  4933. ^void interrupt func( void );
  4934.  
  4935.     - MS C uses ~_dos_setvect~()
  4936.     - see    ~INT 21,25~
  4937. :setverify
  4938. ^TC: int setverify( int value )
  4939.  
  4940.  
  4941.     - prototype in dos.h
  4942.  
  4943.     - sets state of verify flag (0==off, 1==on) to value
  4944.     - no corresponding MS C function
  4945.     - see    ~INT 21,2E~
  4946. :_setvideomode
  4947. ^MSC: short far _setvideomode( short mode )
  4948.  
  4949.     - prototype in graph.h
  4950.  
  4951.     - sets video mode specified
  4952.     - mode=    _DEFAULTMODE    hardware default
  4953.         _MAXCOLORMODE    graphics mode with most colors
  4954.         _MAXRESMODE    graphics mode with highest resolution
  4955.         _TEXTBW40     40x25      16 color  CGA/Text
  4956.         _TEXTC40     40x25      16 color  CGA/Text
  4957.         _TEXTBW80     80x25      16 shades CGA/Text
  4958.         _TEXTC80     80x25      16 color  CGA/Text
  4959.         _MRES4COLOR    320x200    4 color  CGA/Graphics
  4960.         _MRESNOCOLOR    320x200    4 color  CGA/Graphics
  4961.         _HRESBW        640x200    2 color  CGA/Graphics
  4962.         _TEXTMONO     80x25          mono  MDA/Text
  4963.         _MRES16COLOR    320x200   16 color  EGA/Graphics
  4964.         _HRES16COLOR    640x200   16 color  EGA/Graphics
  4965.         _ERESNOCOLOR    640x350    1 color  EGA/Text
  4966.         _ERESCOLOR    640x350   64 color  EGA/Graphics
  4967.         _VRES2COLOR    640x480    2 color  VGA/Graphics
  4968.         _VRES16COLOR    640x480   16 color  VGA/Graphics
  4969.         _MRES256COLOR    320x200  256 color  VGA/Graphics
  4970.         _ORESCOLOR    640x400   16 color  CGA/Graphics/Olivetti
  4971.         _HERCMONO    720x348    2 color  HGC/Graphics/Hercules
  4972.  
  4973.     - returns non-zero on success; zero on error
  4974.  
  4975. :_setviewport
  4976. ^MSC: void far _setviewport( short x1, short y1, short x2, short y2 )
  4977.  
  4978.  
  4979.     - prototype in graph.h
  4980.  
  4981.     - defines a clipping region like ~_setcliprgn~()
  4982.     - sets the logical origin to the upper left corner coordinates
  4983.       specified as parameters
  4984.     - (x1,y1) upper left corner of window
  4985.     - (x2,y2) lower right corner of window
  4986.  
  4987. :_setvisualpage
  4988. ^MSC: short far _setvisualpage( short page )
  4989.  
  4990.  
  4991.     - prototype in graph.h
  4992.  
  4993.     - sets visual page to that specified
  4994.     - default page is zero
  4995.     - returns previous page number or a negative value on error
  4996.  
  4997. :sin
  4998. ^double sin( double x )
  4999.  
  5000.  
  5001.     - prototype in math.h
  5002.  
  5003.     - returns sine of x
  5004.     - x must be in radians
  5005.  
  5006. :sinh
  5007. ^double sinh( double x )
  5008.  
  5009.  
  5010.     - prototype in math.h
  5011.  
  5012.     - returns hyperbolic sine of x
  5013.     - x must be in radians
  5014.  
  5015. :sleep
  5016. ^TC: void sleep( unsigned seconds )
  5017.  
  5018.  
  5019.     - prototype in dos.h
  5020.  
  5021.     - suspended program for seconds of time
  5022.     - accurate in seconds to limit of MS-DOS clock
  5023.     - no corresponding MS C function
  5024.  
  5025. :sopen
  5026. ^int sopen( const char *path, int access, int shflag, int mode )
  5027.  
  5028.     - prototype in io.h, also include share.h, stat.h & fcntl.h
  5029.  
  5030.     - actually a macro defined:  open( path, (access | shflag), mode )
  5031.     - opens file "path" and prepares it for shared I/O
  5032.     - sharing mode is determined using access, shflag and mode
  5033.     - access is a combination of the following ("permis" follows):
  5034.  
  5035. %    Read/Write Access Flags (mutually exclusive):
  5036.     O_RDONLY    open read only
  5037.     O_WRONLY    open write only
  5038.     O_RDWR        open read/write
  5039.  
  5040. %    Other Access Mode Flags:
  5041.     O_APPEND    file pointer is placed at EOF before each write
  5042.     O_CREAT        if file doesn't exist, create with "permis" attributes
  5043.     O_TRUNC        if exists, truncate length to zero, but leave file
  5044.             attributes unchanged
  5045.     O_BINARY    binary mode
  5046.     O_TEXT        text mode
  5047.     O_EXCL        used with O_CREAT, error occurs if file already exists
  5048.     O_NDELAY    UNIX only
  5049.  
  5050. %    Permission Attributes (if creating):
  5051.     S_IWRITE    write permission
  5052.     S_IREAD        read permission
  5053.     S_IREAD | S_IWRITE read/write permission
  5054.      
  5055.     - if O_BINARY nor O_TEXT is given, file is opened in translation
  5056.       mode (O_TEXT) given by global variable _fmode
  5057.     - returns non-negative number as file handle, or -1 on error
  5058. :spawn:spawn...
  5059. ^Function spawn(), etc...
  5060.  
  5061.     int spawnl( int mode, char *path, char *arg0,
  5062.             char *arg1, ..., NULL )
  5063.     int spawnle( int mode, char *path, char *arg0,
  5064.             char *arg1, ..., NULL, char *envp[] )
  5065.     int spawnlp( int mode, char *path, char *arg0,
  5066.             char *arg1, ..., NULL )
  5067.     int spawnlpe( int mode, char *path, char *arg0,
  5068.             char *arg1, ..., NULL, char *envp[] )
  5069.     int spawnv( int mode, char *path, char *argv )
  5070.     int spawnve( int mode, char *path, char *argv, char *envp[] )
  5071.     int spawnvp( int mode, char *path, char *argv )
  5072.     int spawnvpe( int mode, char *path, char *argv, char *envp[] )
  5073.  
  5074.     - prototype in process.h
  5075.  
  5076.     - creates & runs child processes
  5077.     - mode is P_WAIT which puts parent process "on hold" until child
  5078.       completes execution; P_NOWAIT which continues to run parent
  5079.       while child runs (not supported yet); or P_OVERLAY which overlays
  5080.       child in memory location formerly occupied by parent (same as
  5081.       exec... call)
  5082.     - use P_WAIT to perform a DOS shell
  5083.     - returns 0 for SUCCESS and non-zero for failure based on the
  5084.       errorlevel set by the application
  5085.  
  5086.     - see    ~exec...~
  5087. :_splitpath
  5088. %    MSC: void _splitpath( char *path, char *drive, char *dir,
  5089. %                char *fname, char *ext )
  5090.  
  5091.     - prototype in stdlib.h
  5092.  
  5093.     - dissects the path into components
  5094.     - path = fully qualified file name to dissect
  5095.     - drive = is the drive letter followed by a colon if drive was
  5096.       specified in string
  5097.     - dir = any directories included in "path" plus '\'
  5098.     - fname = base filename w/o extension
  5099.     - ext = file extension
  5100.     - the maximum size of each component is: _MAX_DRIVE, _MAX_DIR,
  5101.       _MAX_FNAME, _MAX_EXT (all include the NULL and are actually
  5102.       much larger than needed, except _MAX_DRIVE is exact fit)
  5103.  
  5104.     - see    ~_makepath~()
  5105. :sprintf
  5106. ^int sprintf( char *s, const char *format [, arg1, arg2, ...] )
  5107.  
  5108.  
  5109.     - prototype in stdio.h
  5110.  
  5111.     - prints formatted data into string s
  5112.  
  5113.  
  5114.     - see    ~PRINTF SPEC~  for format specifiers
  5115. :sqrt
  5116. ^double sqrt( double x )
  5117.  
  5118.  
  5119.     - prototype in math.h
  5120.  
  5121.     - returns square root of x, or 0 on error
  5122.  
  5123. :srand
  5124. ^void srand( unsigned seed )
  5125.  
  5126.  
  5127.     - prototype in stdlib.h
  5128.  
  5129.     - re-initializes the random number generator with seed
  5130.     - see    ~rand~()
  5131. :sscanf
  5132. ^int sscanf( const char *s, const char *format, arg1, arg2, ... )
  5133.  
  5134.  
  5135.     - prototype in stdio.h
  5136.  
  5137.     - see    ~scanf~()  and   ~SCANF SPECS~
  5138. :ssignal
  5139. ^int (*ssignal( int sig, int (*action)))) (void)
  5140.  
  5141.  
  5142.     - prototype in signal.h
  5143.  
  5144.     - ssignal() and ~gsignal~() implement a software-signaling facility
  5145.       where software signals are integers 1-15
  5146.     - ssignal() establishes an action routine for servicing a signal
  5147.       where sig is associated with the action routine
  5148.     - ssignal() returns action previously established for ssignal()
  5149.       or SIG_DFL
  5150.     - UNIX based
  5151.  
  5152. :stackavail
  5153. ^MSC: size_t stackavail( void )
  5154.  
  5155.  
  5156.     - prototype in malloc.h
  5157.  
  5158.     - used to determine approximate memory available on the stack for
  5159.       allocation via ~alloca~()
  5160.     - returns approximate memory available on the stack
  5161. :stat
  5162. %        int stat( char *pathname, struct stat *buff )
  5163. %        int fstat( char *handle, struct stat *buff )
  5164.  
  5165.  
  5166.     - prototype in stat.h
  5167.  
  5168.     - stat() and ~fstat~() store information about a given open file
  5169.       (or directory) in the stat structure (in stat.h)
  5170.     - stat() gets information about the open file or directory, while
  5171.       fstat() gets info about the open file associated with handle
  5172.     - returns 0 if successful, else -1 on error
  5173.  
  5174. :_status87
  5175. ^unsigned int _status87( void )
  5176.  
  5177.  
  5178.     - prototype in float.h
  5179.  
  5180.     - returns floating-point status word & other conditions detected
  5181.       by 8087/80287 exception handler
  5182.     - see    ~_clear87~()   ~_control87~()    (float.h also)
  5183. :stime
  5184. ^int stime( time_t *tp )
  5185.  
  5186.  
  5187.     - prototype in time.h
  5188.  
  5189.     - sets system time & date, where tp to value of time in seconds
  5190.       since 00:00:00 GMT Jan 1, 1970
  5191.  
  5192. :str...:strings
  5193. ^String Manipulation Functions
  5194.  
  5195.     - prototype in string.h (a few also exist in stdlib.h)
  5196.  
  5197. %    Conversion:
  5198.     char  *~strlwr~( char *s )
  5199.     char  *~strrev~( char *s )
  5200.     double ~strtod~( const char *s, char **endptr )
  5201.     long  ~strtol~( const char *s, char **endptr, int radix )
  5202.     unsigned long ~strtoul~( const char *s, char **endptr, int radix )
  5203.     char  *~strupr~( char *s )
  5204.     char  *~strdup~( const char *s )
  5205.  
  5206.  
  5207. %    Search:
  5208.     char  *~strchr~( char *s, int c )
  5209.     size_t ~strcspn~( const char *s1, const char *s2 )
  5210.     char  *~strpbrk~( const char *s1, const char *s2 )
  5211.     char  *~strrchr~( const char *s, int c )
  5212.     size_t ~strspn~( const char *s1, const char *s2 )
  5213.     char  *~strstr~( const char *s1, const char *s2 )
  5214.     char  *~strtok~( char *s1, const char *s2 )
  5215.  
  5216.  
  5217. %    Comparison:
  5218.     int ~strcmp~( const char *s1, const char *s2 )
  5219.     int ~strcmpi~( const char *s1, const char *s2 )
  5220.     int ~stricmp~( const char *s1, const char *s2 )
  5221.     int ~strncmp~( const char *s1, const char *s2, size_t maxlen )
  5222.     int ~strncmpi~( const char *s1, const char *s2, size_t maxlen )
  5223.     int ~strnicmp~( const char *s1, const char *s2, size_t maxlen )
  5224.  
  5225.  
  5226. %    Copy:
  5227.     char *~stpcpy~( char *dest, const char *src )
  5228.     char *~strcpy~( char *dest, const char *src )
  5229.     char *~strcat~( char *dest, const char *src )
  5230.     char *~strncat~( char *dest, const char *src, size_t maxlen )
  5231.     char *~strncpy~( char *dest, const char *src, size_t maxlen )
  5232.  
  5233.  
  5234. %    Miscellaneous:
  5235.     size_t ~strlen~( const char *s )
  5236.     char  *~strnset~( char *s, int ch, size_t n )
  5237.     char  *~strset~( char *s, int ch )
  5238.     char  *~strerror~( int errnum )
  5239.     char  *~_strerror~( const char *s )
  5240.  
  5241. :stpcpy
  5242. ^char *stpcpy( char *dest, const char *src )
  5243.  
  5244.  
  5245.     - prototype in string.h
  5246.  
  5247.     - copies src into dest
  5248.     - returns dest+~strlen~(src)
  5249.  
  5250.     - see   ~str...~
  5251.  
  5252. :strcat
  5253. ^char *strcat( char *dest, const char *src )
  5254.  
  5255.  
  5256.     - prototype in string.h
  5257.  
  5258.     - appends src to dest
  5259.  
  5260.     - see   ~str...~
  5261.  
  5262. :strchr
  5263. ^char *strchr( const char *str, int c )
  5264.  
  5265.  
  5266.     - prototype in string.h
  5267.  
  5268.     - scans str for first occurrence of c
  5269.     - returns pointer to c in str, or NULL if not found
  5270.  
  5271.     - see   ~str...~
  5272.  
  5273. :strcmp
  5274. ^int strcmp( const char *str1, const char *str2 )
  5275.  
  5276.  
  5277.     - prototype in string.h
  5278.  
  5279.     - compares str1 to str2
  5280.     - returns < 0 if str1 < str2, = 0 if str1 = str2, or > 0
  5281.       if str1 > str2, using a signed comparison
  5282.  
  5283.     - see   ~str...~
  5284.  
  5285. :strcpy
  5286. ^char *strcpy( char *dest, const char *src )
  5287.  
  5288.  
  5289.     - prototype in string.h
  5290.  
  5291.     - copies src into dest
  5292.     - returns dest
  5293.  
  5294.     - see   ~str...~
  5295.  
  5296. :strcspn
  5297. ^size_t strcspn( const char *str1, const char *str2 )
  5298.  
  5299.  
  5300.     - prototype in string.h
  5301.  
  5302.     - returns length of initial segment of str1 that consists
  5303.       entirely of characters NOT from str2
  5304.  
  5305.     - see   ~str...~
  5306.  
  5307. :_strdate:_strtime
  5308. %           MSC: char *_strdate( char *date )
  5309. %           MSC: char *_strtime( char *time )
  5310.  
  5311.  
  5312.     - prototype in time.h
  5313.  
  5314.     - date = formatted date string: mm/dd/yy (9 bytes inc NULL)
  5315.     - time = formatted time string: hh:mm:ss (9 bytes inc NULL)
  5316.     - returns pointer to the parameter string
  5317.  
  5318.     - Turbo C uses ~strdate~() and ~strtime~()
  5319.  
  5320. :strdup
  5321. ^char *strdup( const char *str )
  5322.  
  5323.  
  5324.     - prototype in string.h
  5325.  
  5326.     - duplicates str, getting space with a call to ~malloc~()
  5327.     - returns pointer to duplicated string, or NULL if space could not
  5328.       be allocated
  5329.  
  5330.     - see   ~str...~
  5331.  
  5332. :_strerror
  5333. ^MSC: char *_strerror( char *string )
  5334.  
  5335.  
  5336.     - prototype in string.h
  5337.  
  5338.     - creates an error message based on the user supplied string
  5339.       followed by a colon, then the library error message
  5340.     - string = user error message string
  5341.     - returns pointer to the generated string
  5342.     - does not print the string
  5343.  
  5344.     - see   ~str...~
  5345.  
  5346. :strerror
  5347. ^char *strerror( char *str )
  5348.  
  5349.  
  5350.     - prototype in string.h
  5351.  
  5352.     - str should contain your customized error message to which a system
  5353.       error message will be appended
  5354.     - allows you to generate customized error messages, returning a
  5355.       pointer to a null-terminated string containing an error message
  5356.     - if str is NULL, the return value contains the most recently
  5357.       generated system error message; this string is null-terminated
  5358.     - if str is not NULL, the return value contains, a colon, a space,
  5359.       the most recently generated system error message, and a newline;
  5360.       with length of str being 94 characters or less
  5361.     - this function generates the error string but does NOT print it
  5362.     - for accurate error-handling, strerror should be called as soon
  5363.       as a library routine generates an error return
  5364.  
  5365.     - see   ~str...~
  5366.  
  5367. :stricmp:strcmpi
  5368. ^int strcmpi(const char *str1, const char *str2)
  5369. ^int stricmp(const char *str1, const char *str2)
  5370.  
  5371.  
  5372.     - prototype in string.h
  5373.  
  5374.     - unsigned comparision of str1 to str2, case insensitive
  5375.     - stricmp() is implemented as a macro using strcmpi()
  5376.  
  5377.     - returns < 0 if str1 < str2
  5378.           = 0 if str1 = str2
  5379.           > 0 if str1 > str2
  5380.  
  5381.     - see   ~str...~
  5382.  
  5383. :strlen
  5384. ^size_t strlen( const char *str )
  5385.  
  5386.  
  5387.     - prototype in string.h
  5388.  
  5389.     - returns number of characters in str, not counting the null
  5390.       terminating character
  5391.  
  5392.     - see   ~str...~
  5393.  
  5394. :strlwr
  5395. ^char *strlwr( char *str )
  5396.  
  5397.  
  5398.     - prototype in string.h
  5399.  
  5400.     - converts str to all lower case
  5401.  
  5402.     - see   ~str...~
  5403.  
  5404. :strncat
  5405. ^char *strncat( char *dest, const char *src, size_t maxlen )
  5406.  
  5407.  
  5408.     - prototype in string.h
  5409.  
  5410.     - appends up to maxlen characters of src to dest and then
  5411.       appends a null character
  5412.  
  5413.     - see   ~str...~
  5414.  
  5415. :strncmp
  5416. ^int strncmp( const char *str1, const char *str2, size_t maxlen )
  5417.  
  5418.  
  5419.     - prototype in string.h
  5420.  
  5421.     - compares str1 to str2 up to maxlen characters using a
  5422.       signed comparison
  5423.  
  5424.     - returns < 0 if str1 < str2
  5425.           = 0 if str1 = str2
  5426.           > 0 if str1 > str2
  5427.  
  5428.  
  5429. :strncpy
  5430. ^char *strncpy( char *dest, const char *src, size_t maxlen )
  5431.  
  5432.  
  5433.     - prototype in string.h
  5434.  
  5435.     - copies exactly maxlen characters from src to dest, truncating
  5436.       or null-padding dest
  5437.     - dest might NOT be null-terminated if length of src >= maxlen
  5438.  
  5439.     - see   ~str...~
  5440.  
  5441. :strnicmp:strncmpi
  5442. ^int strnicmp( const char *str1, const char *str2, size_t maxlen )
  5443.  
  5444.  
  5445.     - prototype in string.h
  5446.  
  5447.     - compares str1 to str2 up to maxlen chars ignoring case
  5448.       using a signed comparison
  5449.  
  5450.     - returns < 0 if str1 < str2
  5451.           = 0 if str1 = str2
  5452.           > 0 if str1 > str2
  5453.  
  5454.     - see   ~str...~
  5455.  
  5456. :strnset
  5457. ^char *strnset( char *str, int ch, size_t n )
  5458.  
  5459.  
  5460.     - prototype in string.h
  5461.  
  5462.     - sets up to first n bytes of str to ch
  5463.     - if n > ~strlen~(str) then strlen(str) replaces n
  5464.  
  5465.     - see   ~str...~
  5466.  
  5467. :strpbrk
  5468. ^char *strpbrk( const char *str1, const char *str2 )
  5469.  
  5470.  
  5471.     - prototype in string.h
  5472.  
  5473.     - scans str1 for first occurrence of any character appearing in str2
  5474.     - returns pointer to first occurrence; NULL if not found
  5475.  
  5476.     - see   ~str...~
  5477.  
  5478. :strrchr
  5479. ^char *strrchr( const char *str, int c )
  5480.  
  5481.  
  5482.     - prototype in string.h
  5483.  
  5484.     - scans a string in reverse direction for specified character c
  5485.     - strrchr finds the LAST occurrence of c in str
  5486.     - returns pointer to LAST occurrence, or NULL if not found
  5487.  
  5488.     - see   ~str...~
  5489.  
  5490. :strrev
  5491. ^char *strrev( char *str )
  5492.  
  5493.  
  5494.     - prototype in string.h
  5495.  
  5496.     - reverses all characters in str, except null terminator
  5497.  
  5498.     - see   ~str...~
  5499.  
  5500. :strset
  5501. ^char *strset( char *str, int ch )
  5502.  
  5503.  
  5504.     - prototype in string.h
  5505.  
  5506.     - sets all characters in str to ch
  5507.  
  5508.     - see   ~str...~
  5509.  
  5510. :strspn
  5511. ^size_t strspn( const char *str1, const char *str2 )
  5512.  
  5513.  
  5514.     - prototype in string.h
  5515.  
  5516.     - returns length of initial segment of str1 that consists
  5517.       entirely of characters from str2
  5518.  
  5519.     - see   ~str...~
  5520.  
  5521. :strstr
  5522. ^char *strstr( const char *anchor, const char *testpattern )
  5523.  
  5524.  
  5525.     - prototype in string.h
  5526.  
  5527.     - returns a pointer within anchor where testpattern is found,
  5528.       or NULL if testpattern is not found in anchor
  5529.     - may be incompatible with Microsoft C
  5530.  
  5531.     - see   ~str...~
  5532.  
  5533. :strtod
  5534. ^double strtod( const char *str, char **endptr )
  5535.  
  5536.  
  5537.     - prototype in string.h
  5538.  
  5539.     - converts string str to a double value
  5540.     - stops reading at tfirst character that cannot be interpreted
  5541.       as part of a double value, returning in *endptr
  5542.     - str must have format:
  5543.  
  5544.       [ws][sn][ddd][.][ddd][fmt[sn]ddd]
  5545.  
  5546.       where [ws]  = optional whitespace
  5547.         [sn]  = optional sign (+-)
  5548.         [ddd] = optional digits
  5549.         [fmt] = option e or E
  5550.         [.]   = optional decimal point
  5551.  
  5552.     - see   ~str...~
  5553.  
  5554. :strtok
  5555. ^char *strtok( char *str1, const char *str2 )
  5556.  
  5557.  
  5558.     - prototype in string.h
  5559.  
  5560.     - parses str1 for tokens and separators, where separators are
  5561.       defined in str2
  5562.     - first call returns a pointer to the first character of the first
  5563.       token in str1 and writes a null character into str1 immediately
  5564.       following the returned token;   subsequent calls with NULL for
  5565.       the first argument will work through the string str1 in this way
  5566.       until no tokens remain
  5567.     - when tokens are exhausted, returns NULL
  5568.  
  5569.     - see   ~str...~
  5570.  
  5571. :strtol:strtoul
  5572. %    long strtol( const char *str, char **endptr, int base )
  5573. %    unsigned long strtoul( const char *s, char **endptr, int radix )
  5574.  
  5575.     - prototype in string.h
  5576.  
  5577.     - converts string str to long (or unsigned long) value
  5578.     - stops reading at first character that cannot be interpreted
  5579.       as part of a long value, returning in *endptr
  5580.     - str must have format:
  5581.  
  5582.       [ws][sn][0][x][ddd]
  5583.  
  5584.       where [ws]  = optional whitespace
  5585.         [sn]  = optional sign (+-)
  5586.         [0]   = optional zero
  5587.         [x]   = optional x or X
  5588.         [ddd] = optional digits
  5589.  
  5590.      - base is between 2 and 36; if 0, first few characters of str
  5591.        determines base to be used (oct,hex or dec) any other value
  5592.        of base is illegal
  5593.  
  5594.      - see   ~str...~
  5595.  
  5596. :strupr
  5597. ^char *strupr( char *str )
  5598.  
  5599.  
  5600.     - prototype in string.h
  5601.  
  5602.     - converts to all uppercase
  5603.  
  5604.     - see   ~str...~
  5605.  
  5606. :swab
  5607. ^void swab( char *src, char *dest, int nbytes )
  5608.  
  5609.  
  5610.     - prototype in stdlib.h
  5611.  
  5612.     - copies nbytes bytes from src into dest, with adjacent even and
  5613.       odd-byte positions being swapped
  5614.     - nbytes should therefore be an even number
  5615.     - a standard way of performing this is to use the ~XCHG~ instruction
  5616. :system
  5617. ^int system( const char *command )
  5618.  
  5619.  
  5620.     - prototype in stdlib.h
  5621.  
  5622.     - invokes MS-DOS COMMAND.COM to execute "command", returning exit
  5623.       status of COMMAND.COM;  the COMSPEC environment variable is
  5624.       automatically searched if necessary
  5625.     - a CR/LF pair in the command string will result in an error
  5626.     - see    ~exec...~   ~spawn...~
  5627. :tan
  5628. ^double tan( double x )
  5629.  
  5630.  
  5631.     - prototype in math.h
  5632.  
  5633.     - returns tangent of x
  5634.     - x must be in radians
  5635.  
  5636. :tanh
  5637. ^double tanh( double x )
  5638.  
  5639.  
  5640.     - prototype in math.h
  5641.  
  5642.     - returns hyperbolic tangent of x
  5643.     - x must be in radians
  5644.  
  5645. :tell
  5646. ^long tell( int handle )
  5647.  
  5648.  
  5649.     - prototype in io.h
  5650.  
  5651.     - returns offset within file corresponding to handle
  5652.     - returns -1L on error
  5653.  
  5654.     - see    ~lseek~()
  5655. :tempnam:tmpnam
  5656. %        MSC: char *tempnam( char *dir, char *prefix )
  5657. %        MSC: char *tmpnam( char *string )
  5658.  
  5659.  
  5660.     - prototype in stdio.h
  5661.  
  5662.     - string = buffer to receive temporary filename
  5663.     - tempnam() creates a temporary file in the specified directory
  5664.       "dir" using the "prefix" as the beginning of the filename;
  5665.       memory for the resulting filename is allocate via ~malloc~() and
  5666.       must be freed with ~free~()
  5667.     - tmpnam() creates the temporary file in the current directory
  5668.     - return a pointer to the new name or NULL on error
  5669.  
  5670. :time
  5671. ^time_t time( time_t *tloc )
  5672.  
  5673.  
  5674.     - prototype in time.h
  5675.  
  5676.     - gives current time in seconds elapsed since 00:00:00 GMT,
  5677.       January 1, 1970, and stores it into tloc
  5678.  
  5679. :tmpfile
  5680. ^MSC: FILE *tmpfile( void )
  5681.  
  5682.  
  5683.     - prototype in stdio.h
  5684.  
  5685.     - creates and opens a temporary stream file
  5686.     - returns stream pointer or NULL on error
  5687.     - file is automatically deleted when closed or rmtmp() is called
  5688.     - ~rmtmp~() works only if in original directory
  5689.     - file is opened in binary write mode; except MS C version 4.0
  5690.       opened file in write translate mode
  5691.  
  5692. :toascii
  5693. ^int toascii( int c )
  5694.  
  5695.  
  5696.     - prototype in ctype.h
  5697.  
  5698.     - clears all but lower 7 bits in c, converting to ASCII
  5699.  
  5700. :_tolower
  5701. ^int _tolower( int c )
  5702.  
  5703.  
  5704.     - prototype in ctype.h
  5705.  
  5706.     - converts c to lowercase if c is UPPER case
  5707.     - use ~tolower~() preferentially
  5708.  
  5709. :tolower
  5710. ^int tolower( int c )
  5711.  
  5712.  
  5713.     - prototype in ctype.h
  5714.  
  5715.     - converts c to LOWER case only if c is UPPER case
  5716.  
  5717. :_toupper
  5718. ^int _toupper( int c )
  5719.  
  5720.  
  5721.     - prototype in ctype.h
  5722.  
  5723.     - converts c to UPPER case only if c is  LOWER case
  5724.     - use ~toupper~() preferentially
  5725.  
  5726. :toupper
  5727. ^int toupper( int c )
  5728.  
  5729.  
  5730.     - prototype in ctype.h
  5731.  
  5732.     - converts c to UPPER case only if c is  LOWER case
  5733.  
  5734. :tzset
  5735. ^void tzset( void )
  5736.  
  5737.  
  5738.     - prototype in time.h
  5739.  
  5740.     - included for UNIX compatibility but does nothing in DOS
  5741.  
  5742. :ultoa
  5743. ^char *ultoa( unsigned long value, char *string, int radix )
  5744.  
  5745.  
  5746.     - prototype in stdlib.h
  5747.  
  5748.     - converts value to string where radix specifies base
  5749.       (2-36) for conversion
  5750.  
  5751. :umask
  5752. ^MSC: int umask( int permission )
  5753.  
  5754.  
  5755.     - prototype in io.h, sys\types.h, sys\stat.h
  5756.  
  5757.     - changes permision in which a file may be accessed
  5758.     - permission    = S_IWRITE    write is forbidden
  5759.             = S_IREAD    read is forbidden  (ignored by DOS)
  5760.             = S_IWRITE | S_IREAD  no reading or writing
  5761.  
  5762.     - returns previous permission value
  5763.  
  5764. :ungetc
  5765. ^int ungetc( int c, FILE *fp )
  5766.  
  5767.  
  5768.     - prototype in stdio.h
  5769.  
  5770.     - pushes character "c" back into file stream "fp"
  5771.  
  5772. :ungetch
  5773. ^void ungetch( int c )
  5774.  
  5775.  
  5776.     - prototype in conio.h
  5777.  
  5778.     - similar to ~ungetc~() except pushes character back to keyboard buffer
  5779.  
  5780. :unixtodos
  5781. %    TC: void unixtodos( long utime, struct date *dateptr,
  5782. %                struct time *timeptr)
  5783.  
  5784.  
  5785.     - prototype in dos.h
  5786.  
  5787.     - converts date & time to DOS format
  5788.     - no corresponding MS C function
  5789.  
  5790. :unlink
  5791. ^int unlink( const char *filename )
  5792.  
  5793.  
  5794.     - prototype in dos.h or io.h
  5795.  
  5796.     - returns 0 if successful, else -1
  5797.     - attempts to delete an open file may damage the file system
  5798.  
  5799. :unlock
  5800. ^TC: int unlock( int handle, long offset, long length )
  5801.  
  5802.  
  5803.     - prototype in io.h
  5804.  
  5805.     - unlock() removes locks placed on a file region by lock()
  5806.     - returns 0 on success, else -1 on error
  5807.     - all locks must be released before program termination
  5808.     - MS C uses ~locking~()
  5809.     - see    ~lock C~
  5810. :utime
  5811. ^MSC: int utime( char *path, struct utimbuf *times )
  5812.  
  5813.  
  5814.     - prototype in sys\types.h, sys\utime.h
  5815.  
  5816.     - path = any valid DOS filename
  5817.     - times = time values in structure (modtime should be set)
  5818.     - if write access to the file is available the file time is updated
  5819.       from the modtime field
  5820.     - if times is NULL the file date is set to current time
  5821.     - returns 0 on success or -1 on error
  5822.  
  5823.     struct utimbuf
  5824.         {
  5825.         time_t actime;       - access time (not used in DOS)
  5826.         time_t modtime;      - modification time
  5827.         };
  5828.  
  5829. :vfprintf
  5830. ^int vfprintf( FILE *stream, const char *format, va_list param )
  5831.  
  5832.  
  5833.     - prototype in stdio.h
  5834.  
  5835.     - sends formatted output to a stream
  5836.  
  5837. :vfscanf
  5838. ^int vfscanf( FILE *stream, const char *format, va_list argp )
  5839.  
  5840.  
  5841.     - prototype in stdio.h
  5842.  
  5843.     - like ~fscanf~(), except arguments accepted from va_arg array from
  5844.       va_list parm
  5845.  
  5846. :vprintf
  5847. ^int vprintf( const char *format, va_list param )
  5848.  
  5849.  
  5850.     - prototype in stdio.h
  5851.  
  5852.     - sends formatted output to stdout
  5853.  
  5854. :vscanf
  5855. ^int vscanf( const char *format, va_list argp )
  5856.  
  5857.  
  5858.     - prototype in stdio.h
  5859.  
  5860.     - like ~scanf~(), except arguments accepted from va_arg array from
  5861.       va_list parm
  5862.  
  5863. :vsprintf
  5864. ^int vsprintf( char *string, const char *format, va_list param )
  5865.  
  5866.  
  5867.     - prototype in stdio.h
  5868.  
  5869.     - sends formatted output to a string
  5870.  
  5871. :vsscanf
  5872. %    int vsscanf( const char *string, const char *format, va_list argp )
  5873.  
  5874.  
  5875.     - prototype in stdio.h
  5876.  
  5877.     - like ~sscanf~(), except arguments accepted from va_list parm
  5878.  
  5879. :_wrapon
  5880. ^MSC: short far _wrapon( short wrap )
  5881.  
  5882.  
  5883.     - prototype in graph.h
  5884.  
  5885.     - sets wrapping/truncating of text
  5886.     - wrap    = _GWRAPOFF truncates text at window border
  5887.         = _GWRAPON  wraps line at window border
  5888.  
  5889.     - returns previous wrap value
  5890.  
  5891. :_write
  5892. ^TC: int _write( int handle, char *buf, int count )
  5893.  
  5894.  
  5895.     - prototype in io.h
  5896.  
  5897.     - writes "count" bytes from "buf" to file or device at "handle"
  5898.     - count cannot be greater that 65534
  5899.     - is a direct call to MS-DOS write function ~INT 21,40~
  5900.     - does NO conversion of CR/LFs; all output is binary
  5901.     - returns a count of bytes written  or -1 on error
  5902.     - MS C uses ~_dos_write~()
  5903.  
  5904.     - see  ~write~()  ~_open~()  ~_creat~()  ~_read~()
  5905.  
  5906. :write
  5907. ^int write( int handle, char *buf, int count )
  5908.  
  5909.  
  5910.     - prototype in io.h
  5911.  
  5912.     - writes "count" bytes from "buf" to file or device at "handle"
  5913.     - converts LF to CR-LF for text output
  5914.     - returns a count of bytes written (excluding any CRs
  5915.       generated for a text file), or -1 on error
  5916. :stdarg:va_start:va_end:va_list
  5917. ^Example of variable arguments in C
  5918.  
  5919.     void myprintf( char *format, ... )
  5920.        {
  5921.        va_list argptr;
  5922.  
  5923.        va_start ( argptr, format );
  5924.        vsprintf ( text, format, argptr );
  5925.        va_end ( argptr );
  5926.        write (1, text, strlen (text));
  5927.        }
  5928.