home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / doc / helppc / c.txt < prev    next >
Text File  |  1991-04-14  |  162KB  |  5,857 lines

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