1182
Watcom C Library Reference Version 1.8

Watcom C Library Reference - LUpriede.bf.lu.lv/ftp/pub/Programmeeshana/C/... · Preface This manual describes the Watcom C Library. It includes the Standard C Library (as defined

  • Upload
    others

  • View
    23

  • Download
    0

Embed Size (px)

Citation preview

  • Watcom C Library Reference

    Version 1.8

  • Notice of CopyrightCopyright 2002-2008 the Open Watcom Contributors. Portions Copyright 1984-2002 Sybase, Inc.and its subsidiaries. All rights reserved.

    Any part of this publication may be reproduced, transmitted, or translated in any form or by any means,electronic, mechanical, manual, optical, or otherwise, without the prior written permission of anyone.

    For more information please visit http://www.openwatcom.org/

    ii

  • PrefaceThis manual describes the Watcom C Library. It includes the Standard C Library (as defined in the ANSIC Standard) plus many additional library routines which make application development for personalcomputers much easier.

    AcknowledgementsThis book was produced with the Watcom GML electronic publishing system, a software tool developed byWATCOM. In this system, writers use an ASCII text editor to create source files containing text annotatedwith tags. These tags label the structural elements of the document, such as chapters, sections, paragraphs,and lists. The Watcom GML software, which runs on a variety of operating systems, interprets the tags toformat the text into a form such as you see here. Writers can produce output for a variety of printers,including laser printers, using separately specified layout directives for such things as font selection,column width and height, number of columns, etc. The result is type-set quality copy containing integratedtext and graphics.

    July, 1997.

    Trademarks Used in this ManualIBM is a registered trademark of International Business Machines Corp.

    Intel is a registered trademark of Intel Corp.

    Microsoft, MS, MS-DOS, Windows, Win32, Win32s, Windows NT and Windows 2000 are eitherregistered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

    NetWare, NetWare 386, and Novell are registered trademarks of Novell, Inc.

    UNIX is a registered trademark of The Open Group.

    WATCOM is a trademark of Sybase, Inc. and its subsidiaries.

    iii

  • iv

  • Table of ContentsWatcom C Library Reference ......................................................................................................................... 1

    1 C Library Overview .......................................................................................................................... 31.1 Classes of Functions ........................................................................................................... 3

    1.1.1 Character Manipulation Functions ...................................................................... 51.1.2 Wide Character Manipulation Functions ............................................................. 61.1.3 Multibyte Character Manipulation Functions ...................................................... 61.1.4 Memory Manipulation Functions ........................................................................ 81.1.5 String Manipulation Functions ............................................................................ 81.1.6 Wide String Manipulation Functions .................................................................. 101.1.7 Multibyte String Manipulation Functions ........................................................... 111.1.8 Conversion Functions .......................................................................................... 131.1.9 Memory Allocation Functions ............................................................................. 141.1.10 Heap Functions .................................................................................................. 151.1.11 Math Functions .................................................................................................. 151.1.12 Searching Functions .......................................................................................... 171.1.13 Time Functions .................................................................................................. 171.1.14 Variable-length Argument Lists ........................................................................ 171.1.15 Stream I/O Functions ......................................................................................... 181.1.16 Wide Character Stream I/O Functions ............................................................... 191.1.17 Process Primitive Functions .............................................................................. 201.1.18 Process Environment ......................................................................................... 221.1.19 Directory Functions ........................................................................................... 221.1.20 Operating System I/O Functions ....................................................................... 231.1.21 File Manipulation Functions .............................................................................. 231.1.22 Console I/O Functions ....................................................................................... 241.1.23 Default Windowing Functions ........................................................................... 241.1.24 BIOS Functions ................................................................................................. 241.1.25 DOS-Specific Functions .................................................................................... 251.1.26 Intel 80x86 Architecture-Specific Functions ..................................................... 251.1.27 Intel Pentium Multimedia Extension Functions ................................................ 261.1.28 Miscellaneous Functions ................................................................................... 27

    1.2 Header Files ....................................................................................................................... 281.2.1 Header Files in /watcom/h ................................................................................... 281.2.2 Header Files in /watcom/h/sys ............................................................................. 31

    1.3 Global Data ........................................................................................................................ 321.4 The TZ Environment Variable ........................................................................................... 36

    2 Graphics Library ............................................................................................................................... 392.1 Graphics Functions ............................................................................................................ 392.2 Graphics Adapters .............................................................................................................. 392.3 Classes of Graphics Functions ........................................................................................... 40

    2.3.1 Environment Functions ........................................................................................ 402.3.2 Coordinate System Functions .............................................................................. 412.3.3 Attribute Functions .............................................................................................. 422.3.4 Drawing Functions .............................................................................................. 422.3.5 Text Functions ..................................................................................................... 432.3.6 Graphics Text Functions ...................................................................................... 432.3.7 Image Manipulation Functions ............................................................................ 442.3.8 Font Manipulation Functions ............................................................................... 442.3.9 Presentation Graphics Functions ......................................................................... 45

    2.3.9.1 Display Functions .................................................................................. 45

    v

  • Table of Contents2.3.9.2 Analyze Functions ................................................................................. 462.3.9.3 Utility Functions .................................................................................... 46

    2.4 Graphics Header Files ........................................................................................................ 46

    3 DOS Considerations ......................................................................................................................... 473.1 DOS Devices ...................................................................................................................... 473.2 DOS Directories ................................................................................................................. 473.3 DOS File Names ................................................................................................................ 483.4 DOS Files ........................................................................................................................... 493.5 DOS Commands ................................................................................................................. 503.6 DOS Interrupts ................................................................................................................... 503.7 DOS Processes ................................................................................................................... 50

    4 Library Functions and Macros .......................................................................................................... 51abort ................................................................................................................... 54abort_handler_s ................................................................................................. 55abs ..................................................................................................................... 56access, _access, _waccess ................................................................................. 57acos .................................................................................................................... 59acosh .................................................................................................................. 60alloca ................................................................................................................. 61_arc, _arc_w, _arc_wxy .................................................................................... 62asctime Functions .............................................................................................. 64asctime_s, _wasctime_s .................................................................................... 66asin .................................................................................................................... 69asinh .................................................................................................................. 70assert .................................................................................................................. 71atan .................................................................................................................... 72atan2 .................................................................................................................. 73atanh .................................................................................................................. 74atexit .................................................................................................................. 75atof, _wtof ......................................................................................................... 76atoi, _wtoi .......................................................................................................... 77atol, _wtol .......................................................................................................... 78atoll, _wtoll ....................................................................................................... 79_atouni ............................................................................................................... 80basename ........................................................................................................... 81bdos ................................................................................................................... 82_beginthread, _beginthreadex ........................................................................... 83bessel Functions ................................................................................................ 87bcmp .................................................................................................................. 88bcopy ................................................................................................................. 89_bfreeseg ........................................................................................................... 90_bgetcmd ........................................................................................................... 92_bheapseg .......................................................................................................... 93_bios_disk ......................................................................................................... 95_bios_equiplist .................................................................................................. 97_bios_keybrd ..................................................................................................... 98_bios_memsize .................................................................................................. 100_bios_printer ..................................................................................................... 101_bios_serialcom ................................................................................................. 102_bios_timeofday ................................................................................................ 104

    vi

  • Table of Contents_bprintf, _bwprintf ............................................................................................ 105break... Functions .............................................................................................. 106bsearch ............................................................................................................... 107bsearch_s ........................................................................................................... 109btowc ................................................................................................................. 111bzero .................................................................................................................. 112cabs .................................................................................................................... 113calloc Functions ................................................................................................ 114ceil ..................................................................................................................... 116cgets ................................................................................................................... 117_chain_intr ......................................................................................................... 118chdir, _chdir, _wchdir ....................................................................................... 119_chdrive ............................................................................................................. 121chmod, _chmod, _wchmod ............................................................................... 122chsize, _chsize ................................................................................................... 124_clear87 ............................................................................................................. 125clearenv ............................................................................................................. 126clearerr ............................................................................................................... 127_clearscreen ....................................................................................................... 128clock .................................................................................................................. 129close, _close ...................................................................................................... 130closedir, _wclosedir ........................................................................................... 131_cmdname ......................................................................................................... 133_control87 ......................................................................................................... 134_controlfp .......................................................................................................... 136cos ..................................................................................................................... 138cosh ................................................................................................................... 139cprintf ................................................................................................................ 140cputs .................................................................................................................. 141creat, _creat, _wcreat ......................................................................................... 142cscanf ................................................................................................................. 144ctime Functions ................................................................................................. 145ctime_s, _wctime_s ........................................................................................... 147cwait .................................................................................................................. 149delay .................................................................................................................. 152_dieeetomsbin .................................................................................................... 153difftime .............................................................................................................. 154dirname .............................................................................................................. 155_disable ............................................................................................................. 156_displaycursor ................................................................................................... 157div ...................................................................................................................... 158_dmsbintoieee .................................................................................................... 159_dos_allocmem .................................................................................................. 160_dos_close ......................................................................................................... 161_dos_commit ..................................................................................................... 162_dos_creat ......................................................................................................... 163_dos_creatnew ................................................................................................... 164dosexterr ............................................................................................................ 166_dos_find... Functions ....................................................................................... 168_dos_freemem ................................................................................................... 171_dos_getdate ...................................................................................................... 172_dos_getdiskfree ............................................................................................... 173

    vii

  • Table of Contents_dos_getdrive .................................................................................................... 174_dos_getfileattr .................................................................................................. 175_dos_getftime .................................................................................................... 177_dos_gettime ..................................................................................................... 179_dos_getvect ...................................................................................................... 180_dos_keep .......................................................................................................... 181_dos_open ......................................................................................................... 182_dos_read .......................................................................................................... 184_dos_setblock .................................................................................................... 185_dos_setdate ...................................................................................................... 187_dos_setdrive ..................................................................................................... 189_dos_setfileattr .................................................................................................. 190_dos_setftime .................................................................................................... 192_dos_settime ...................................................................................................... 194_dos_setvect ...................................................................................................... 196_dos_write ......................................................................................................... 197dup, _dup ........................................................................................................... 198dup2, _dup2 ....................................................................................................... 200_dwDeleteOnClose ............................................................................................ 202_dwSetAboutDlg ............................................................................................... 203_dwSetAppTitle ................................................................................................ 204_dwSetConTitle ................................................................................................. 205_dwShutDown ................................................................................................... 206_dwYield ........................................................................................................... 207ecvt, _ecvt, _wecvt ............................................................................................ 208_ellipse, _ellipse_w, _ellipse_wxy .................................................................... 210_enable .............................................................................................................. 212_endthread, _endthreadex ................................................................................. 213eof, _eof ............................................................................................................. 215exec... Functions ................................................................................................ 216_exit, _Exit ........................................................................................................ 220exit ..................................................................................................................... 221exp ..................................................................................................................... 222_expand Functions ............................................................................................ 223fabs .................................................................................................................... 225fclose ................................................................................................................. 226fcloseall ............................................................................................................. 227fcvt, _fcvt, _wfcvt ............................................................................................. 228fdopen, _fdopen, _wfdopen ............................................................................... 230feclearexcept ..................................................................................................... 231__fedisableexcept .............................................................................................. 232__feenableexcept ............................................................................................... 233fegetenv ............................................................................................................. 234fegetexceptflag .................................................................................................. 235fegetround ......................................................................................................... 236feholdexcept ...................................................................................................... 237feof .................................................................................................................... 238feraiseexcept ...................................................................................................... 239ferror .................................................................................................................. 240fesetenv ............................................................................................................. 241fesetexceptflag ................................................................................................... 242fesetround .......................................................................................................... 243

    viii

  • Table of Contentsfetestexcept ........................................................................................................ 244feupdateenv ....................................................................................................... 245fflush ................................................................................................................. 246ffs ....................................................................................................................... 247fgetc, fgetwc ...................................................................................................... 248fgetchar, _fgetchar, _fgetwchar ......................................................................... 249fgetpos ............................................................................................................... 250fgets, fgetws ...................................................................................................... 251_fieeetomsbin .................................................................................................... 252filelength, _filelength, _filelengthi64 ................................................................ 253FILENAME_MAX ........................................................................................... 254fileno ................................................................................................................. 255_findclose .......................................................................................................... 256_findfirst, _findfirsti64, _wfindfirst, _wfindfirsti64 ......................................... 257_findnext, _findnexti64, _wfindnext, _wfindnexti64 ....................................... 259_finite ................................................................................................................ 261_floodfill, _floodfill_w ...................................................................................... 262floor ................................................................................................................... 263flushall ............................................................................................................... 264fmod .................................................................................................................. 265_fmsbintoieee .................................................................................................... 266fnmatch .............................................................................................................. 267fopen, _wfopen .................................................................................................. 269fopen_s, _wfopen_s ........................................................................................... 271FP_OFF ............................................................................................................. 274FP_SEG ............................................................................................................. 275fpclassify ........................................................................................................... 276_fpreset .............................................................................................................. 277fprintf, fwprintf ................................................................................................. 278fprintf_s, fwprintf_s .......................................................................................... 279fputc, fputwc ..................................................................................................... 281fputchar, _fputchar, _fputwchar ........................................................................ 282fputs, fputws ...................................................................................................... 283fread ................................................................................................................... 284free Functions .................................................................................................... 285_freect ................................................................................................................ 287freopen, _wfreopen ........................................................................................... 288freopen_s, _wfreopen_s .................................................................................... 289frexp .................................................................................................................. 291fscanf, fwscanf .................................................................................................. 292fscanf_s, fwscanf_s ........................................................................................... 293fseek .................................................................................................................. 295fsetpos ............................................................................................................... 297_fsopen, _wfsopen ............................................................................................. 298fstat, _fstat, _fstati64, _wfstat, _wfstati64 ........................................................ 301fsync .................................................................................................................. 305ftell .................................................................................................................... 307ftime .................................................................................................................. 308_fullpath, _wfullpath ......................................................................................... 309fwide .................................................................................................................. 311fwrite ................................................................................................................. 312gcvt, _gcvt, _wgcvt ........................................................................................... 313

    ix

  • Table of Contents_getactivepage ................................................................................................... 314_getarcinfo ......................................................................................................... 315_getbkcolor ........................................................................................................ 317getc, getwc ......................................................................................................... 318getch .................................................................................................................. 319getchar, getwchar .............................................................................................. 320getche ................................................................................................................ 321_getcliprgn ......................................................................................................... 322getcmd ............................................................................................................... 323_getcolor ............................................................................................................ 324_getcurrentposition, _getcurrentposition_w ...................................................... 325getcwd, _wgetcwd ............................................................................................. 326_getdcwd, _wgetdcwd ....................................................................................... 328_getdiskfree ....................................................................................................... 330_getdrive ............................................................................................................ 331getenv, _wgetenv ............................................................................................... 332getenv_s ............................................................................................................. 333_getfillmask ....................................................................................................... 335_getfontinfo ....................................................................................................... 336_getgtextextent .................................................................................................. 337_getgtextvector .................................................................................................. 338_getimage, _getimage_w, _getimage_wxy ....................................................... 339_getlinestyle ...................................................................................................... 341_getmbcp ........................................................................................................... 342getopt ................................................................................................................. 343_get_osfhandle .................................................................................................. 346_getphyscoord ................................................................................................... 348getpid ................................................................................................................. 349_getpixel, _getpixel_w ...................................................................................... 350_getplotaction .................................................................................................... 351gets, _getws ....................................................................................................... 352gets_s ................................................................................................................. 353_gettextcolor ...................................................................................................... 354_gettextcursor .................................................................................................... 355_gettextextent .................................................................................................... 356_gettextposition ................................................................................................. 358_gettextsettings .................................................................................................. 359_gettextwindow ................................................................................................. 360_getvideoconfig ................................................................................................. 361_getviewcoord, _getviewcoord_w, _getviewcoord_wxy .................................. 364_getvisualpage ................................................................................................... 365_getw ................................................................................................................. 366_getwindowcoord .............................................................................................. 367gmtime Functions .............................................................................................. 368gmtime_s ........................................................................................................... 370_grow_handles .................................................................................................. 372_grstatus ............................................................................................................ 374_grtext, _grtext_w ............................................................................................. 375halloc ................................................................................................................. 377_harderr, _hardresume, _hardretn ..................................................................... 378_hdopen ............................................................................................................. 381_heapchk Functions ........................................................................................... 382

    x

  • Table of Contents_heapenable ....................................................................................................... 384_heapgrow Functions ........................................................................................ 385_heapmin Functions .......................................................................................... 386_heapset Functions ............................................................................................ 387_heapshrink Functions ...................................................................................... 389_heapwalk Functions ......................................................................................... 390hfree ................................................................................................................... 393hypot .................................................................................................................. 394ignore_handler_s ............................................................................................... 395_imagesize, _imagesize_w, _imagesize_wxy ................................................... 396imaxabs .............................................................................................................. 397imaxdiv .............................................................................................................. 398inp ...................................................................................................................... 399inpd .................................................................................................................... 400inpw ................................................................................................................... 401int386 ................................................................................................................. 402int386x ............................................................................................................... 403int86 ................................................................................................................... 405int86x ................................................................................................................. 406intdos ................................................................................................................. 407intdosx ............................................................................................................... 408intr ..................................................................................................................... 410isalnum, iswalnum ............................................................................................. 411isalpha, iswalpha ............................................................................................... 412isascii, __isascii, iswascii .................................................................................. 413isatty, _isatty ..................................................................................................... 415isblank, iswblank ............................................................................................... 416iscntrl, iswcntrl .................................................................................................. 418iscsym, __iscsym, __iswcsym ........................................................................... 419iscsymf, __iscsymf, __iswcsymf ....................................................................... 421isdigit, iswdigit .................................................................................................. 423isfinite ................................................................................................................ 424isgraph, iswgraph .............................................................................................. 425isinf .................................................................................................................... 426isleadbyte ........................................................................................................... 427islower, iswlower .............................................................................................. 429_ismbbalnum ..................................................................................................... 430_ismbbalpha ...................................................................................................... 432_ismbbgraph ...................................................................................................... 434_ismbbkalnum ................................................................................................... 436_ismbbkana ........................................................................................................ 438_ismbbkalpha .................................................................................................... 440_ismbbkprint ..................................................................................................... 442_ismbbkpunct .................................................................................................... 444_ismbblead ........................................................................................................ 446_ismbbprint ....................................................................................................... 448_ismbbpunct ...................................................................................................... 450_ismbbtrail ......................................................................................................... 452_ismbcalnum ..................................................................................................... 454_ismbcalpha ....................................................................................................... 456_ismbccntrl ........................................................................................................ 458_ismbcdigit ........................................................................................................ 460

    xi

  • Table of Contents_ismbcgraph ...................................................................................................... 462_ismbchira ......................................................................................................... 464_ismbckata ......................................................................................................... 466_ismbcl0 ............................................................................................................ 468_ismbcl1 ............................................................................................................ 470_ismbcl2 ............................................................................................................ 472_ismbclegal ........................................................................................................ 474_ismbclower ...................................................................................................... 476_ismbcprint ........................................................................................................ 478_ismbcpunct ...................................................................................................... 480_ismbcspace ...................................................................................................... 482_ismbcsymbol .................................................................................................... 484_ismbcupper ...................................................................................................... 486_ismbcxdigit ...................................................................................................... 488isnan .................................................................................................................. 490isnormal ............................................................................................................. 491isprint, iswprint ................................................................................................. 492ispunct, iswpunct ............................................................................................... 493isspace, iswspace ............................................................................................... 495isupper, iswupper .............................................................................................. 497iswctype ............................................................................................................. 498isxdigit, iswxdigit .............................................................................................. 500itoa, _itoa, _itow ................................................................................................ 501kbhit, _kbhit ...................................................................................................... 503labs .................................................................................................................... 504ldexp .................................................................................................................. 505ldiv ..................................................................................................................... 506lfind ................................................................................................................... 507_lineto, _lineto_w .............................................................................................. 509llabs ................................................................................................................... 511lldiv ................................................................................................................... 512localeconv ......................................................................................................... 513localtime Functions ........................................................................................... 516localtime_s ........................................................................................................ 518lock .................................................................................................................... 520locking, _locking ............................................................................................... 521log ...................................................................................................................... 523log10 .................................................................................................................. 524log2 .................................................................................................................... 525longjmp ............................................................................................................. 526_lrotl .................................................................................................................. 527_lrotr .................................................................................................................. 528lsearch ............................................................................................................... 529lseek, _lseek, _lseeki64 ..................................................................................... 531lltoa, _lltoa, _lltow ............................................................................................ 534ltoa, _ltoa, _ltow ................................................................................................ 536main, wmain, WinMain, wWinMain ................................................................ 538_makepath, _wmakepath ................................................................................... 542malloc Functions ............................................................................................... 544matherr .............................................................................................................. 546max .................................................................................................................... 548_mbbtombc ........................................................................................................ 549

    xii

  • Table of Contents_mbbtype ........................................................................................................... 550_mbccmp, _fmbccmp ........................................................................................ 553_mbccpy, _fmbccpy .......................................................................................... 555_mbcicmp, _fmbcicmp ...................................................................................... 556_mbcjistojms ..................................................................................................... 558_mbcjmstojis ..................................................................................................... 559_mbclen, _fmbclen ............................................................................................ 560_mbctolower ...................................................................................................... 562_mbctoupper ...................................................................................................... 564_mbctohira ......................................................................................................... 566_mbctokata ........................................................................................................ 568_mbctombb ........................................................................................................ 570_mbgetcode, _fmbgetcode ................................................................................ 571mblen, _fmblen .................................................................................................. 572_mbputchar, _fmbputchar ................................................................................. 575mbrlen, _fmbrlen ............................................................................................... 576mbrtowc, _fmbrtowc ......................................................................................... 579_mbsbtype, _fmbsbtype .................................................................................... 582_mbsnbcat, _fmbsnbcat ..................................................................................... 585_mbsnbcmp, _fmbsnbcmp ................................................................................ 587_mbsnbcnt, _fmbsnbcnt, _strncnt, _wcsncnt .................................................... 588_mbsnbcpy, _fmbsnbcpy ................................................................................... 590_mbsnbicmp, _fmbsnbicmp .............................................................................. 592_mbsnbset, _fmbsnbset ..................................................................................... 593_mbsnccnt, _fmbsnccnt, _strncnt, _wcsncnt ..................................................... 594_mbsnextc, _fmbsnextc, _strnextc, _wcsnextc ................................................. 596mbsrtowcs, _fmbsrtowcs ................................................................................... 598mbsrtowcs_s, _fmbsrtowcs_s ............................................................................ 601mbstowcs, _fmbstowcs ...................................................................................... 604mbstowcs_s, _fmbstowcs_s .............................................................................. 605_mbterm, _fmbterm ........................................................................................... 607mbtowc, _fmbtowc ............................................................................................ 609_mbvtop, _fmbvtop ........................................................................................... 611_memavl ............................................................................................................ 613memccpy, _fmemccpy ...................................................................................... 614memchr, _fmemchr, wmemchr ......................................................................... 615memcmp, _fmemcmp, wmemcmp .................................................................... 616memcpy, _fmemcpy, wmemcpy ....................................................................... 617memcpy_s, wmemcpy_s ................................................................................... 618memicmp, _memicmp, _fmemicmp .................................................................. 619_memmax .......................................................................................................... 620memmove, _fmemmove, wmemmove .............................................................. 621memmove_s, wmemmove_s ............................................................................. 622_m_empty .......................................................................................................... 624memset, _fmemset, wmemset ........................................................................... 626_m_from_int ...................................................................................................... 627min ..................................................................................................................... 628mkdir, _mkdir, _wmkdir ................................................................................... 629MK_FP .............................................................................................................. 630mkstemp ............................................................................................................ 631_mktemp, _wmktemp ........................................................................................ 633mktime ............................................................................................................... 635

    xiii

  • Table of Contentsmodf .................................................................................................................. 637movedata ........................................................................................................... 638_moveto, _moveto_w ........................................................................................ 639_m_packssdw .................................................................................................... 640_m_packsswb .................................................................................................... 642_m_packuswb .................................................................................................... 644_m_paddb .......................................................................................................... 646_m_paddd .......................................................................................................... 647_m_paddsb ........................................................................................................ 648_m_paddsw ........................................................................................................ 649_m_paddusb ...................................................................................................... 650_m_paddusw ...................................................................................................... 651_m_paddw ......................................................................................................... 652_m_pand ............................................................................................................ 653_m_pandn .......................................................................................................... 654_m_pcmpeqb ..................................................................................................... 655_m_pcmpeqd ..................................................................................................... 656_m_pcmpeqw .................................................................................................... 657_m_pcmpgtb ...................................................................................................... 658_m_pcmpgtd ...................................................................................................... 659_m_pcmpgtw ..................................................................................................... 660_m_pmaddwd .................................................................................................... 661_m_pmulhw ....................................................................................................... 662_m_pmullw ........................................................................................................ 663_m_por .............................................................................................................. 664_m_pslld ............................................................................................................ 665_m_pslldi ........................................................................................................... 666_m_psllq ............................................................................................................ 667_m_psllqi ........................................................................................................... 668_m_psllw ........................................................................................................... 669_m_psllwi .......................................................................................................... 670_m_psrad ........................................................................................................... 671_m_psradi .......................................................................................................... 672_m_psraw .......................................................................................................... 673_m_psrawi ......................................................................................................... 674_m_psrld ............................................................................................................ 675_m_psrldi ........................................................................................................... 676_m_psrlq ............................................................................................................ 677_m_psrlqi ........................................................................................................... 678_m_psrlw ........................................................................................................... 679_m_psrlwi .......................................................................................................... 680_m_psubb .......................................................................................................... 681_m_psubd .......................................................................................................... 682_m_psubsb ......................................................................................................... 683_m_psubsw ........................................................................................................ 684_m_psubusb ....................................................................................................... 685_m_psubusw ...................................................................................................... 686_m_psubw ......................................................................................................... 687_m_punpckhbw ................................................................................................. 688_m_punpckhdq .................................................................................................. 690_m_punpckhwd ................................................................................................. 691_m_punpcklbw .................................................................................................. 692

    xiv

  • Table of Contents_m_punpckldq ................................................................................................... 694_m_punpcklwd .................................................................................................. 695_m_pxor ............................................................................................................ 696_msize Functions ............................................................................................... 697_m_to_int .......................................................................................................... 698nosound ............................................................................................................. 699offsetof .............................................................................................................. 700onexit ................................................................................................................. 701open, _open, _wopen ......................................................................................... 702opendir, _wopendir ........................................................................................... 705_open_osfhandle ............................................................................................... 708_os_handle ......................................................................................................... 711_outgtext ............................................................................................................ 712_outmem ............................................................................................................ 714outp .................................................................................................................... 715outpd .................................................................................................................. 716outpw ................................................................................................................. 717_outtext .............................................................................................................. 718_pclose ............................................................................................................... 719perror, _wperror ................................................................................................ 720_pg_analyzechart, _pg_analyzechartms ............................................................ 721_pg_analyzepie .................................................................................................. 723_pg_analyzescatter, _pg_analyzescatterms ....................................................... 725_pg_chart, _pg_chartms .................................................................................... 727_pg_chartpie ...................................................................................................... 730_pg_chartscatter, _pg_chartscatterms ............................................................... 733_pg_defaultchart ................................................................................................ 736_pg_getchardef .................................................................................................. 738_pg_getpalette ................................................................................................... 739_pg_getstyleset .................................................................................................. 741_pg_hlabelchart ................................................................................................. 743_pg_initchart ..................................................................................................... 744_pg_resetpalette ................................................................................................. 746_pg_resetstyleset ............................................................................................... 748_pg_setchardef .................................................................................................. 750_pg_setpalette .................................................................................................... 751_pg_setstyleset .................................................................................................. 753_pg_vlabelchart ................................................................................................. 755_pie, _pie_w, _pie_wxy .................................................................................... 756_pipe .................................................................................................................. 759_polygon, _polygon_w, _polygon_wxy ............................................................ 762_popen, _wpopen .............................................................................................. 764pow .................................................................................................................... 766printf, wprintf .................................................................................................... 767printf_s, wprintf_s ............................................................................................. 773putc, putwc ........................................................................................................ 775putch .................................................................................................................. 776putchar, putwchar .............................................................................................. 777putenv, _putenv, _wputenv ............................................................................... 778_putimage, _putimage_w .................................................................................. 780puts, _putws ....................................................................................................... 782_putw ................................................................................................................. 783

    xv

  • Table of Contentsqsort ................................................................................................................... 784qsort_s ............................................................................................................... 785raise ................................................................................................................... 787rand .................................................................................................................... 789read, _read ......................................................................................................... 790readdir, _wreaddir ............................................................................................. 792realloc Functions ............................................................................................... 795_rectangle, _rectangle_w, _rectangle_wxy ....................................................... 797_registerfonts ..................................................................................................... 799_remapallpalette ................................................................................................ 800_remappalette .................................................................................................... 801remove, _wremove ............................................................................................ 802rename, _wrename ............................................................................................ 803rewind ................................................................................................................ 804rewinddir, _wrewinddir ..................................................................................... 805rmdir, _rmdir, _wrmdir ..................................................................................... 807_rotl ................................................................................................................... 808_rotr ................................................................................................................... 809sbrk .................................................................................................................... 810scanf, wscanf ..................................................................................................... 812scanf_s, wscanf_s .............................................................................................. 818_scrolltextwindow ............................................................................................. 819_searchenv, _wsearchenv .................................................................................. 820segread ............................................................................................................... 821_selectpalette ..................................................................................................... 822set_constraint_handler_s ................................................................................... 823_setactivepage ................................................................................................... 825_setbkcolor ........................................................................................................ 826setbuf ................................................................................................................. 827_setcharsize, _setcharsize_w ............................................................................. 828_setcharspacing, _setcharspacing_w ................................................................. 830_setcliprgn ......................................................................................................... 832_setcolor ............................................................................................................ 833setenv, _setenv, _wsetenv ................................................................................. 834_setfillmask ....................................................................................................... 836_setfont .............................................................................................................. 838_setgtextvector .................................................................................................. 840setjmp ................................................................................................................ 841_setlinestyle ....................................................................................................... 842setlocale, _wsetlocale ........................................................................................ 844_set_matherr ...................................................................................................... 846_setmbcp ............................................................................................................ 848setmode, _setmode ............................................................................................ 849set_new_handler, _set_new_handler ................................................................. 850_setpixel, _setpixel_w ....................................................................................... 852_setplotaction .................................................................................................... 853_settextalign ...................................................................................................... 854_settextcolor ...................................................................................................... 856_settextcursor .................................................................................................... 857_settextorient ..................................................................................................... 858_settextpath ....................................................................................................... 859_settextposition ................................................................................................. 861

    xvi

  • Table of Contents_settextrows ....................................................................................................... 862_settextwindow ................................................................................................. 863setvbuf ............................................................................................................... 864_setvideomode ................................................................................................... 865_setvideomoderows ........................................................................................... 868_setvieworg ....................................................................................................... 869_setviewport ...................................................................................................... 870_setvisualpage ................................................................................................... 871_setwindow ....................................................................................................... 872signal ................................................................................................................. 874signbit ................................................................................................................ 877sin ...................................................................................................................... 878sinh .................................................................................................................... 879mbsinit, sisinit ................................................................................................... 880sleep ................................................................................................................... 883_snprintf, _snwprintf ......................................................................................... 884snprintf, snwprintf ............................................................................................. 886snprintf_s, snwprintf_s ...................................................................................... 888sopen, _sopen, _wsopen .................................................................................... 890sound ................................................................................................................. 894spawn... Functions ............................................................................................. 896_splitpath, _wsplitpath ...................................................................................... 902_splitpath2, _wsplitpath2 .................................................................................. 904sprintf, swprintf ................................................................................................. 906sprintf_s, swprintf_s .......................................................................................... 908sqrt ..................................................................................................................... 910srand .................................................................................................................. 911sscanf, swscanf .................................................................................................. 912sscanf_s, swscanf_s ........................................................................................... 913stackavail, _stackavail ....................................................................................... 915stat, _stat, _stati64, _wstat, _wstati64, lstat ...................................................... 916_status87 ............................................................................................................ 919strcasecmp ......................................................................................................... 920strcat, _fstrcat, wcscat, _mbscat, _fmbscat ....................................................... 921strcat_s, wcscat_s .............................................................................................. 923strchr, _fstrchr, wcschr, _mbschr, _fmbschr ..................................................... 925strcmp, _fstrcmp, wcscmp, _mbscmp, _fmbscmp ............................................ 926strcmpi, wcscmpi ............................................................................................... 928strcoll, wcscoll, _mbscoll .................................................................................. 929strcpy, _fstrcpy, wcscpy, _mbscpy, _fmbscpy .................................................. 930strcpy_s, wcscpy_s ............................................................................................ 932strcspn, _fstrcspn, wcscspn, _mbscspn, _fmbscspn .......................................... 934_strdate, _wstrdate ............................................................................................. 936_strdec, _wcsdec, _mbsdec, _fmbsdec .............................................................. 937strdup, _strdup, _fstrdup, _wcsdup, _mbsdup, _fmbsdup ................................. 939strerror, wcserror ............................................................................................... 940strerror_s, wcserror_s ........................................................................................ 941strerrorlen_s, wcserrorlen_s .............................................................................. 943strftime, wcsftime, _wstrftime_ms .................................................................... 944stricmp, _stricmp, _fstricmp, _wcsicmp, _mbsicmp, _fmbsicmp ..................... 948_stricoll, _wcsicoll, _mbsicoll ........................................................................... 950_strinc, _wcsinc, _mbsinc, _fmbsinc ................................................................ 951

    xvii

  • Table of Contentsstrlcat, wcslcat ................................................................................................... 954strlcpy, wcslcpy ................................................................................................. 955strlen, _fstrlen, wcslen, _mbslen, _fmbslen ...................................................... 956strnlen_s, wcsnlen_s .......................................................................................... 958strlwr, _strlwr, _fstrlwr, _wcslwr, _mbslwr, _fmbslwr ..................................... 959strncasecmp ....................................................................................................... 961strncat, _fstrncat, wcsncat, _mbsncat, _fmbsncat ............................................. 962strncat_s, wcsncat_s .......................................................................................... 964strncmp, _fstrncmp, wcsncmp, _mbsncmp, _fmbsncmp .................................. 966_strncoll, _wcsncoll, _mbsncoll ........................................................................ 968strncpy, _fstrncpy, wcsncpy, _mbsncpy, _fmbsncpy ........................................ 969strncpy_s, wcsncpy_s ........................................................................................ 971strnicmp, _strnicmp, _fstrnicmp, _wcsnicmp, _mbsnicmp, _fmbsnicmp ......... 973_strnicoll, _wcsnicoll, _mbsnicoll ..................................................................... 975_strninc, _wcsninc, _mbsninc, _fmbsninc ........................................................ 976strnset, _strnset, _fstrnset, _wcsnset, _mbsnset, _fmbsnset .............................. 979strpbrk, _fstrpbrk, wcspbrk, _mbspbrk, _fmbspbrk .......................................... 981strrchr, _fstrrchr, wcsrchr, _mbsrchr, _fmbsrchr .............................................. 983strrev, _strrev, _fstrrev, _wcsrev, _mbsrev, _fmbsrev ...................................... 985strset, _strset, _fstrset, _wcsset, _mbsset, _fmbsset .......................................... 987strspn, _fstrspn, wcsspn, _mbsspn, _fmbsspn ................................................... 989strspnp, _strspnp, _fstrspnp, _wcsspnp, _mbsspnp, _fmbsspnp ....................... 991strstr, _fstrstr, wcsstr, _mbsstr, _fmbsstr ........................................................... 993_strtime, _wstrtime ............................................................................................ 995strtod, wcstod .................................................................................................... 996strtok, _fstrtok, wcstok, _mbstok, _fmbstok ..................................................... 998strtok_s, wcstok_s ............................................................................................. 1000strtol, wcstol ...................................................................................................... 1002strtoll, wcstoll .................................................................................................... 1003strtoimax, wcstoimax ........................................................................................ 1004strtoul, wcstoul .................................................................................................. 1005strtoull, wcstoull ................................................................................................ 1006strtoumax, wcstoumax ....................................................................................... 1007strupr, _strupr, _fstrupr, _wcsupr, _mbsupr, _fmbsupr ..................................... 1008strxfrm, wcsxfrm ............................................................................................... 1010swab ................................................................................................................... 1011system, _wsystem .............................................................................................. 1012tan ...................................................................................................................... 1013tanh .................................................................................................................... 1014tell, _tell, _telli64 .............................................................................................. 1015_tempnam, _wtempnam .................................................................................... 1017time .................................................................................................................... 1019tmpfile ............................................................................................................... 1020tmpfile_s ............................................................................................................ 1021tmpnam_s, _wtmpnam_s ................................................................................... 1022tmpnam, _wtmpnam .......................................................................................... 1024tolower, _tolower, towlower ............................................................................. 1025toupper, _toupper, towupper ............................................................................. 1027towctrans ........................................................................................................... 1029tzset ................................................................................................................... 1030ulltoa, _ulltoa, _ulltow ...................................................................................... 1032ultoa, _ultoa, _ultow .......................................................................................... 1034

    xviii

  • Table of Contentsumask, _umask .................................................................................................. 1036ungetc, ungetwc ................................................................................................. 1038ungetch .............................................................................................................. 1039unlink, _unlink, _wunlink ................................................................................. 1040unlock ................................................................................................................ 1041_unregisterfonts ................................................................................................. 1042utime, _utime, _wutime ..................................................................................... 1043utoa, _utoa, _utow ............................................................................................. 1045va_arg ................................................................................................................ 1047va_end ............................................................................................................... 1049va_start .............................................................................................................. 1050_vbprintf, _vbwprintf ........................................................................................ 1051vcprintf .............................................................................................................. 1052vcscanf ............................................................................................................... 1053vfprintf, vfwprintf ............................................................................................. 1054vfprintf_s, vfwprintf_s ...................................................................................... 1056vfscanf, vfwscanf ......................................................................