Watcom C Library Reference

Total Page:16

File Type:pdf, Size:1020Kb

Watcom C Library Reference Watcom C Library Reference Version 1.8 Notice of Copyright Copyright 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 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. July, 1997. 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. UNIX is a registered trademark of The Open Group. WATCOM is a trademark of Sybase, Inc. and its subsidiaries. iii iv Table of Contents Watcom C Library Reference ......................................................................................................................... 1 1 C Library Overview .......................................................................................................................... 3 1.1 Classes of Functions ........................................................................................................... 3 1.1.1 Character Manipulation Functions ...................................................................... 5 1.1.2 Wide Character Manipulation Functions ............................................................. 6 1.1.3 Multibyte Character Manipulation Functions ...................................................... 6 1.1.4 Memory Manipulation Functions ........................................................................ 8 1.1.5 String Manipulation Functions ............................................................................ 8 1.1.6 Wide String Manipulation Functions .................................................................. 10 1.1.7 Multibyte String Manipulation Functions ........................................................... 11 1.1.8 Conversion Functions .......................................................................................... 13 1.1.9 Memory Allocation Functions ............................................................................. 14 1.1.10 Heap Functions .................................................................................................. 15 1.1.11 Math Functions .................................................................................................. 15 1.1.12 Searching Functions .......................................................................................... 17 1.1.13 Time Functions .................................................................................................. 17 1.1.14 Variable-length Argument Lists ........................................................................ 17 1.1.15 Stream I/O Functions ......................................................................................... 18 1.1.16 Wide Character Stream I/O Functions ............................................................... 19 1.1.17 Process Primitive Functions .............................................................................. 20 1.1.18 Process Environment ......................................................................................... 22 1.1.19 Directory Functions ........................................................................................... 22 1.1.20 Operating System I/O Functions ....................................................................... 23 1.1.21 File Manipulation Functions .............................................................................. 23 1.1.22 Console I/O Functions ....................................................................................... 24 1.1.23 Default Windowing Functions ........................................................................... 24 1.1.24 BIOS Functions ................................................................................................. 24 1.1.25 DOS-Specific Functions .................................................................................... 25 1.1.26 Intel 80x86 Architecture-Specific Functions ..................................................... 25 1.1.27 Intel Pentium Multimedia Extension Functions ................................................ 26 1.1.28 Miscellaneous Functions ................................................................................... 27 1.2 Header Files ....................................................................................................................... 28 1.2.1 Header Files in /watcom/h ................................................................................... 28 1.2.2 Header Files in /watcom/h/sys ............................................................................. 31 1.3 Global Data ........................................................................................................................ 32 1.4 The TZ Environment Variable ........................................................................................... 36 2 Graphics Library ............................................................................................................................... 39 2.1 Graphics Functions ............................................................................................................ 39 2.2 Graphics Adapters .............................................................................................................. 39 2.3 Classes of Graphics Functions ........................................................................................... 40 2.3.1 Environment Functions ........................................................................................ 40 2.3.2 Coordinate System Functions .............................................................................. 41 2.3.3 Attribute Functions .............................................................................................. 42 2.3.4 Drawing Functions .............................................................................................. 42 2.3.5 Text Functions ..................................................................................................... 43 2.3.6 Graphics Text Functions ...................................................................................... 43 2.3.7 Image Manipulation Functions ............................................................................ 44 2.3.8 Font Manipulation Functions ............................................................................... 44 2.3.9 Presentation Graphics Functions ......................................................................... 45 2.3.9.1 Display Functions .................................................................................. 45 v Table of Contents 2.3.9.2 Analyze Functions ................................................................................. 46 2.3.9.3 Utility Functions .................................................................................... 46 2.4 Graphics Header Files ........................................................................................................ 46 3 DOS Considerations ......................................................................................................................... 47 3.1 DOS Devices ...................................................................................................................... 47 3.2 DOS Directories ................................................................................................................. 47 3.3 DOS File Names ................................................................................................................ 48 3.4 DOS Files ........................................................................................................................... 49 3.5 DOS Commands ................................................................................................................. 50 3.6 DOS Interrupts ................................................................................................................... 50 3.7 DOS Processes ................................................................................................................... 50 4 Library Functions and Macros

  1182
Recommended publications
  • MASM61PROGUIDE.Pdf
    Introduction (C) 1992-1996 Microsoft Corporation. All rights reserved. Programmer's Guide Microsoft® MASM Assembly-Language Development System Version 6.1 For MS-DOS® and Windows™ Operating Systems Microsoft Corporation Information in this document is subject to change without notice. Companies, names, and data used in examples herein are fictitious unless otherwise noted. No part of this document maybe reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation. ©1992 Microsoft Corporation. All rights reserved. Microsoft, MS, MS-DOS, XENIX, CodeView, and QuickC are registered trademarks and Microsoft QuickBasic, QuickPascal, Windows and Windows NT are trademarks of Microsoft Corporation in the USA and other countries. U.S. Patent No. 4,955,066 Hercules is a registered trademark of Hercules Computer Technology. IBM, PS/2, and OS/2 are registered trademarks of International Business Machines Corporation. Intel is a registered trademark of Intel Corporation. NEC and V25 are registered trademarks and V35 is a trademark of NEC Corporation. Document No. DB35747-1292 Printed in the United States of America. Macro Assembler 6.1 (16-bit) - MSDN Archive Edition Page 1 MASM Features New Since Version 5.1 (C) 1992-1996 Microsoft Corporation. All rights reserved. Introduction The Microsoft® Macro Assembler Programmer’s Guide provides the information you need to write and debug assembly-language programs with the Microsoft Macro Assembler (MASM), version 6.1. This book documents enhanced features of the language and the programming environment for MASM 6.1. This Programmer’s Guide is written for experienced programmers who know assembly language and are familiar with an assembler.
    [Show full text]
  • PC Magazine's BASIC Techniques and Utilities by Ethan Winer
    PC Magazine's BASIC Techniques and Utilities by Ethan Winer In memory of my father, Dr. Frank Winer Freeware Book, downloaded from http://www.ethanwiner.com TABLE OF CONTENTS INTRODUCTION Part I: UNDER THE HOOD Chapter 1. An Introduction to Compiled BASIC Chapter 2. Variables and Constant Data Chapter 3. Programming Methods Part II: HANDS-ON PROGRAMMING Chapter 4. Debugging Strategies Chapter 5. Compiling and Linking Chapter 6. File and Device Handling Chapter 7. Database and Network Programming Chapter 8. Sorting and Searching Part II: BEYOND BASIC Chapter 9. Program Optimization Chapter 10. Key Memory Areas in the PC Chapter 11. Accessing DOS and BIOS Services Chapter 12. Assembly Language Programming Ethan Winer: PC Magazine's BASIC Techniques and Utilities Book - 2 - ACKNOWLEDGEMENTS Many people helped me during the preparation of this book. First and foremost I want to thank my publisher, Cindy Hudson, for her outstanding support and encouragement, and for making it all happen. I also want to thank "black belt" editor Deborah Craig for a truly outstanding job. Never had I seen someone reduce a sentence from 24 words to less than half that, and improve the meaning in the process. [Unfortunately, readers of this disk version are unable to benefit from Deborah's excellent work.] Several other people deserve praise as well: Don Malin for his programming advice, and for eliminating all my GOTO statements. Jonathan Zuck for his contribution on database and network programming, including all of the dBASE file access routines. Paul Passarelli for unraveling the mysteries of floating point emulation, and for sharing that expertise with me.
    [Show full text]
  • Sqlways Documentation
    SQLWays Documentation Database and Application Migration Software Version 6.0 Ispirer Systems Ltd. Copyright © 1999-2015 Ispirer Systems Ltd. Ispirer and SQLWays are trademarks of Ispirer Systems Ltd. All other product names may be trademarks of the respective companies. All rights reserved. www.ispirer.com Contents Contents Conventions Used in This Manual Introduction Key Benefits ...................................................................... 13 Supported Databases......................................................... 14 Database Object and Features Support.............................. 16 IBM DB2 for Linux, Unix and Windows Support ............................. 17 IBM DB2 for z/OS and OS/390 Support ....................................... 19 IBM DB2 for iSeries and AS/400 Support ..................................... 21 Oracle Support ......................................................................... 23 Microsoft SQL Server Support .................................................... 25 MySQL Support ........................................................................ 27 PostgreSQL Support .................................................................. 29 Sybase Adaptive Server Enterprise Support .................................. 31 Pervasive.SQL Support .............................................................. 32 What’s New....................................................................... 33 Getting Started Preparing for Installation .................................................. 35 Installing
    [Show full text]
  • Getting Started with .NET, .NET CF, Visual Studio .NET
    Getting Started with .NET, .NET CF, Visual Studio .NET Overview of the .NET Framework ................................................................................. 1 Microsoft and Sun's Confrontation ............................................................................................ 5 Getting Started with Visual Studio .NET and the Microsoft .NET Compact Framework ........................................................................................................................... 19 Getting Started with XML Web Services in Visual Basic.NET and Visual C# .................................................................................................................................................. 44 Overview of the .NET Framework [http://msdn.microsoft.com/library/default.asp?url=/library/en- us/cpguide/html/cpovrintroductiontonetframeworksdk.asp] The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is designed to fulfill the following objectives: • To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. • To provide a code-execution environment that minimizes software deployment and versioning conflicts. • To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party. • To provide a code-execution environment
    [Show full text]
  • Qui Sont Elles, D'où Viennent Elles Et Plus Encore
    Qui sont elles, d'où viennent elles et plus encore... .--- Infos DOS, Localisation : Racine 15/04/1999 - Autochop File Part (partie d'un fichier découpé) .#?? presentation 10/04/1999 - Autochop File Part (partie d'un fichier découpé) .#00 presentation 10/04/1999 - Autochop File Part (partie d'un fichier découpé) .#01 presentation 10/04/1999 - Autochop File Part (partie d'un fichier découpé) .#02 presentation 10/04/1999 .#nombre .#03 presentation 02/03/1999 .$$$ Fichier temporaire (Used by OS/2 to keep track of archived files) 12/04/1999 .??$ Microsoft Archive 29/03/1999 - Fichier d'installation - Microsoft archive .??_ - Novell Archive 03/03/1999 .??~ Fichier temporaire 05/12/1998 .??Z Gzip Unix Archive 03/03/1999 .?Q? SQ (Squeeze) Archive 04/03/1999 .?RS WordPerfect Support File 04/03/1999 .@@@ Codeview for C 13/04/1999 ._a_ Partie sauvegardée de Maniac Mansion 12/02/1998 ._b_ Partie sauvegardée de Maniac mansion 03/08/1997 ._c_ Partie sauvegardée de Maniac mansion 03/08/1997 ._d_ Partie sauvegardée de Maniac mansion 03/08/1997 ._DD what formats they have 12/04/1999 ._e_ Partie sauvegardée de Maniac mansion 03/08/1997 ._f_ Partie sauvegardée de Maniac mansion 03/08/1997 ._g_ Partie sauvegardée de Maniac mansion 03/08/1997 ._ME Fichier Read Me 25/02/1997 exécutable ._MP temporaire, Localisation c:\win95\temp 10/10/1997 .~?? Fichier temporaire 05/03/1999 -Partie sauvegardée de The Seven'th Guest .0 -Scores ( musique ) 16/10/1997 .-0 Hi-Scores 10/03/1997 .0?? Fichier de sauvegarde 02/03/1997 - Kq7cdsg.000 = sauvegarde de jeu King's Quest
    [Show full text]
  • Watcom C Library Reference Volume 1
    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.
    [Show full text]
  • PC-BASIC Documentation
    PC-BASIC documentation Version 2.0.3 1. PC-BASIC 2.0.3 A free, cross-platform emulator for the GW-BASIC family of interpreters. PC-BASIC is a free, cross-platform interpreter for GW-BASIC, Advanced BASIC (BASICA), PCjr Cartridge Basic and Tandy 1000 GWBASIC. It interprets these BASIC dialects with a high degree of accuracy, aiming for bug-for-bug compatibility. PC-BASIC emulates the most common video and audio hardware on which these BASICs used to run. PC-BASIC runs plain-text, tokenised and protected .BAS files. It implements floating-point arithmetic in the Microsoft Binary Format (MBF) and can therefore read and write binary data files created by GW-BASIC. This is the documentation for PC-BASIC 2.0.3, last updated 2020-09-26 19:20:46. It consists of the following documents: • Quick Start Guide, the essentials needed to get started • User's Guide, in-depth guide to using the emulator • Configuration Guide, settings and options • Language Guide, overview of the BASIC language by topic • Language Reference, comprehensive reference to BASIC • Technical Reference, file formats and internals • Developer's Guide, using PC-BASIC as a Python module 2 PC-BASIC Table of Contents PC-BASIC 2.0.3 ...................................................................................................................... 2 Quick Start Guide................................................................................................................. 14 Installation.............................................................................................................................
    [Show full text]
  • Extended Precision - Wikipedia
    3/20/2018 Extended precision - Wikipedia Extended precision Extended precision refers to floating point number formats that provide greater precision than the basic floating point formats.[1] Extended precision formats support a basic format by minimizing roundoff and overflow errors in intermediate values of expressions on the base format. In contrast to extended precision, arbitrary-precision arithmetic refers to implementations of much larger numeric types (with a storage count that usually is not a power of two) using special software (or, rarely, hardware). Contents Extended precision implementations IBM extended precision formats Microsoft MBF extended precision format IEEE 754 extended precision formats x86 extended precision format Introduction to use Working range Need for the 80-bit format Language support See also References Extended precision implementations IBM extended precision formats The IBM 1130 offered two floating point formats: a 32-bit "standard precision" format and a 40-bit "extended precision" format. Standard precision format contained a 24-bit two's complement significand while extended precision utilized a 32-bit two's complement significand. The latter format could make full use of the cpu's 32-bit integer operations. The characteristic in both formats was an 8-bit field containing the power of two biased by 128. Floating-point arithmetic operations were performed by software, and double precision was not supported at all. The extended format occupied three 16-bit words, with the extra space simply ignored.[2] The IBM System/360 supports a 32-bit "short" floating point format and a 64-bit "long" floating point format.[3] The 360/85 and follow-on System/370 added support for a 128-bit "extended" format.[4] These formats are still supported in the current design, where they are now called the "hexadecimal floating point" (HFP) formats.
    [Show full text]
  • QWK Mail Reader
    BBS Archives - Off-Line Mail Readers http://archives.thebbs.org/ra110c.htm Off-Line Mail Readers 1ST-200.ZIP 1620K 07-20-1995 1stReader 2.00 QWK offline mail reader from Sparkware. This archive contains the rest of the basic 2.00 release. It includes manuals, address book, RIP and database support. 1ST-200C.ZIP 485K 07-20-1995 1stReader 2.00 QWK offline mail reader from Sparkware. This archive contains the spelling checker, 1STEDIT text editor and FLI support modules. (File 3 of 6 in 2.00 release) 1ST-200D.ZIP 934K 07-20-1995 1stReader 2.00 QWK offline mail reader from Sparkware. This archive contains the multimedia sound files used by the full 1stReader 2.00 release. You do not need them if you do not have a sound card. (File 4 of 6 in 2.00 release) 1ST-200E.ZIP 238K 07-20-1995 1stReader 2.00 QWK offline mail reader from Sparkware. This archive contains support for third party programmers who are interested in writing utilities for the 2.00 release. Includes full documentation on the 1stReader API interface. (File 5 of 6 in 2.00 release) 1ST-200F.ZIP 368K 07-20-1995 1stReader 2.00 QWK offline mail reader from Sparkware. This archive contains the 80386 (and higher) compiled version of the 1ST.EXE program. Do NOT use if you own a 80286 or 8088 system. (File 6 of 6 in 2.00 release) 1ST-BBS.ZIP 108K 07-20-1995 1stReader 2.00 sysop's kit. This archive tells you, the sysop, how to setup your own {QWKID}.BBS file so 1stReader can be "preconfigured" and ready to work seamlessly with your bulletin board system.
    [Show full text]
  • Labview Database Connectivity Toolkit User Manual
    LabVIEWTM Database Connectivity Toolkit User Manual Database Connectivity Toolkit User Manual June 2008 371525A-01 Support Worldwide Technical Support and Product Information ni.com National Instruments Corporate Headquarters 11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100 Worldwide Offices Australia 1800 300 800, Austria 43 662 457990-0, Belgium 32 (0) 2 757 0020, Brazil 55 11 3262 3599, Canada 800 433 3488, China 86 21 5050 9800, Czech Republic 420 224 235 774, Denmark 45 45 76 26 00, Finland 358 (0) 9 725 72511, France 01 57 66 24 24, Germany 49 89 7413130, India 91 80 41190000, Israel 972 3 6393737, Italy 39 02 41309277, Japan 0120-527196, Korea 82 02 3451 3400, Lebanon 961 (0) 1 33 28 28, Malaysia 1800 887710, Mexico 01 800 010 0793, Netherlands 31 (0) 348 433 466, New Zealand 0800 553 322, Norway 47 (0) 66 90 76 60, Poland 48 22 3390150, Portugal 351 210 311 210, Russia 7 495 783 6851, Singapore 1800 226 5886, Slovenia 386 3 425 42 00, South Africa 27 0 11 805 8197, Spain 34 91 640 0085, Sweden 46 (0) 8 587 895 00, Switzerland 41 56 2005151, Taiwan 886 02 2377 2222, Thailand 662 278 6777, Turkey 90 212 279 3031, United Kingdom 44 (0) 1635 523545 For further support information, refer to the Technical Support and Professional Services appendix. To comment on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter the info code feedback. © 1997–2008 National Instruments Corporation.
    [Show full text]
  • Btrieve® Developer's Journal
    Btrieve ® Winter Developer’s Journal (Jan-March 1994) Vol. II No. 1 THE INDEPENDENT SOURCE OF NEWS AND INFORMATION FOR BTRIEVE DEVELOPERS AND USERS When we began working on the idea of creating In March of 1993, an article called Inside Btrieve Files BTRIEVE DEVELOPER’S JOURNAL last year, we never was published in Dr. Dobb’s Journal by Doug Reilly. In his realized what a large void we would fill by publishing infor- original article, Doug explored the internal structure of Btrieve mation written specifically for people who develop and use files to demonstrate various methods of Btrieve data recovery. Btrieve applications. Since the distribution of our free premier We are pleased that we have been given the opportunity to issue to our list of over 32,000 active Btrieve developers, we show you more of what we have discovered about Btrieve files have had a large number of positive comments about our and possible data recovery methods. actively promoting Btrieve. We also received many subscrip- I can’t begin to tell you how excited we are about what’s tions, including yours, for which I am very grateful. We cannot going on with Btrieve for 1994… There is a lot of information continue to promote Btrieve without your continued support. and activity about Btrieve that you will not find anywhere else With BTRIEVE DEVELOPER’S JOURNAL, we are but in BTRIEVE DEVELOPER’S JOURNAL. We know that working hard to strike an even balance between articles of a you will not want to miss it! technical nature and those articles that focus on products with Btrieve support.
    [Show full text]
  • Labview Database Connectivity Toolkit User Manual
    LabVIEWTM Database Connectivity Toolkit User Manual Database Connectivity Toolkit User Manual June 2008 371525A-01 Support Worldwide Technical Support and Product Information ni.com National Instruments Corporate Headquarters 11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100 Worldwide Offices Australia 1800 300 800, Austria 43 662 457990-0, Belgium 32 (0) 2 757 0020, Brazil 55 11 3262 3599, Canada 800 433 3488, China 86 21 5050 9800, Czech Republic 420 224 235 774, Denmark 45 45 76 26 00, Finland 358 (0) 9 725 72511, France 01 57 66 24 24, Germany 49 89 7413130, India 91 80 41190000, Israel 972 3 6393737, Italy 39 02 41309277, Japan 0120-527196, Korea 82 02 3451 3400, Lebanon 961 (0) 1 33 28 28, Malaysia 1800 887710, Mexico 01 800 010 0793, Netherlands 31 (0) 348 433 466, New Zealand 0800 553 322, Norway 47 (0) 66 90 76 60, Poland 48 22 3390150, Portugal 351 210 311 210, Russia 7 495 783 6851, Singapore 1800 226 5886, Slovenia 386 3 425 42 00, South Africa 27 0 11 805 8197, Spain 34 91 640 0085, Sweden 46 (0) 8 587 895 00, Switzerland 41 56 2005151, Taiwan 886 02 2377 2222, Thailand 662 278 6777, Turkey 90 212 279 3031, United Kingdom 44 (0) 1635 523545 For further support information, refer to the Technical Support and Professional Services appendix. To comment on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter the info code feedback. © 1997–2008 National Instruments Corporation.
    [Show full text]