Watcom C Library Reference Volume 1
Total Page:16
File Type:pdf, Size:1020Kb
Watcom C Library Reference Volume 1 Edition 11.0c Notice of Copyright Copyright 2000 Sybase, Inc. and its subsidiaries. All rights reserved. No 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 Sybase, Inc. and its subsidiaries. Printed in U.S.A. ii Preface This manual describes the Watcom C Library. It includes the Standard C Library (as defined in the ANSI C Standard) plus many additional library routines which make application development for personal computers much easier. Acknowledgements This book was produced with the Watcom GML electronic publishing system, a software tool developed by WATCOM. In this system, writers use an ASCII text editor to create source files containing text annotated with 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 to format 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 integrated text and graphics. September, 2000. Trademarks Used in this Manual IBM 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 either registered 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. QNX is a registered trademark of QNX Software Systems Ltd. WATCOM is a trademark of Sybase, Inc. and its subsidiaries. iii iv Table of Contents Watcom C Library Reference Volume 1 ................................................................................... 1 1 C Library Overview .................................................................................................... 3 1.1 Classes of Functions ..................................................................................... 3 1.1.1 Character Manipulation Functions ................................................. 6 1.1.2 Wide Character Manipulation Functions ....................................... 7 1.1.3 Multibyte Character Manipulation Functions ................................ 7 1.1.4 Memory Manipulation Functions ................................................... 9 1.1.5 String Manipulation Functions ....................................................... 10 1.1.6 Wide String Manipulation Functions ............................................. 11 1.1.7 Multibyte String Manipulation Functions ...................................... 13 1.1.8 Conversion Functions ..................................................................... 15 1.1.9 Memory Allocation Functions ....................................................... 16 1.1.10 Heap Functions ............................................................................. 17 1.1.11 Math Functions ............................................................................. 18 1.1.12 Searching Functions ..................................................................... 20 1.1.13 Time Functions ............................................................................. 20 1.1.14 Variable-length Argument Lists ................................................... 21 1.1.15 Stream I/O Functions ................................................................... 21 1.1.16 Wide Character Stream I/O Functions ......................................... 23 1.1.17 Process Primitive Functions ......................................................... 24 1.1.18 Process Environment .................................................................... 26 1.1.19 Directory Functions ...................................................................... 26 1.1.20 Operating System I/O Functions .................................................. 27 1.1.21 File Manipulation Functions ........................................................ 28 1.1.22 Console I/O Functions .................................................................. 28 1.1.23 Default Windowing Functions ..................................................... 29 1.1.24 BIOS Functions ............................................................................ 29 1.1.25 DOS-Specific Functions ............................................................... 29 1.1.26 Intel 80x86 Architecture-Specific Functions ............................... 30 1.1.27 Intel Pentium Multimedia Extension Functions ........................... 31 1.1.28 Miscellaneous Functions .............................................................. 33 1.2 Header Files .................................................................................................. 34 1.2.1 Header Files in /watcom/h .............................................................. 34 1.2.2 Header Files in /watcom/h/sys ....................................................... 38 1.3 Global Data ................................................................................................... 38 1.4 The TZ Environment Variable ...................................................................... 44 2 Graphics Library ......................................................................................................... 49 2.1 Graphics Functions ....................................................................................... 49 2.2 Graphics Adapters ........................................................................................ 50 2.3 Classes of Graphics Functions ...................................................................... 50 v Table of Contents 2.3.1 Environment Functions .................................................................. 51 2.3.2 Coordinate System Functions ......................................................... 52 2.3.3 Attribute Functions ......................................................................... 53 2.3.4 Drawing Functions ......................................................................... 53 2.3.5 Text Functions ................................................................................ 54 2.3.6 Graphics Text Functions ................................................................ 55 2.3.7 Image Manipulation Functions ....................................................... 56 2.3.8 Font Manipulation Functions ......................................................... 56 2.3.9 Presentation Graphics Functions .................................................... 57 2.3.9.1 Display Functions ............................................................ 57 2.3.9.2 Analyze Functions ........................................................... 58 2.3.9.3 Utility Functions .............................................................. 58 2.4 Graphics Header Files .................................................................................. 59 3 DOS Considerations .................................................................................................... 61 3.1 DOS Devices ................................................................................................ 61 3.2 DOS Directories ........................................................................................... 62 3.3 DOS File Names ........................................................................................... 63 3.4 DOS Files ..................................................................................................... 64 3.5 DOS Commands ........................................................................................... 65 3.6 DOS Interrupts .............................................................................................. 65 3.7 DOS Processes .............................................................................................. 65 4 Library Functions and Macros .................................................................................... 67 abort ............................................................................................. 70 abs ................................................................................................ 71 access, _access, _waccess ............................................................ 72 acos .............................................................................................. 74 acosh ............................................................................................ 75 alloca ............................................................................................ 76 _arc, _arc_w, _arc_wxy ............................................................... 77 asctime Functions ........................................................................ 80 asin ............................................................................................... 82 asinh ............................................................................................. 83 assert ............................................................................................ 84 atan ............................................................................................... 85 atan2 ............................................................................................