Programming ILE C/C++ Runtime Library Functions
Total Page:16
File Type:pdf, Size:1020Kb
IBM i 7.3 Programming ILE C/C++ Runtime Library Functions IBM SC41-5607-06 Note Before using this information and the product it supports, read the information in “Notices” on page 623. This edition applies to version IBM i 7.2 (product number 5770-SS1) and to all subsequent releases and modifications until otherwise indicated in new editions. This version does not run on all reduced instruction set computer (RISC) models nor does it run on CISC models. This document may contain references to Licensed Internal Code. Licensed Internal Code is Machine Code and is licensed to you under the terms of the IBM License Agreement for Machine Code. © Copyright International Business Machines Corporation 1998, 2015. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. About ILE C/C++ Runtime Library Functions This information provides an overview of the C runtime behavior. The information is intended for programmers who are familiar with the C/C++ programming language and who want to write or maintain ILE C/C++ applications. You must have experience in using applicable IBM® i menus, displays, or control language (CL) commands. You also need knowledge of Integrated Language Environment® as explained in the ILE Concepts manual. This information does not describe how to program in the C or C++ programming languages, nor does it explain the concepts of ILE. Companion publications for this reference are: • C/C++ Legacy Class Libraries Reference, SC09-7652-00 • ILE Concepts • ILE C/C++ for AS/400 MI Library Reference, SC09-2418-00 • Standard C/C++ Library Reference, SC09-4949-01 • ILE C/C++ Compiler Reference • ILE C/C++ Language Reference • ILE C/C++ Programmer's Guide For other prerequisite and related information, see “Related information” on page 621. A note about examples The examples in this information that illustrate the use of library functions are written in a simple style. The examples do not demonstrate all possible uses of C/C++ language constructs. Some examples are only code fragments and do not compile without additional code. The examples all assume that the C locale is used. All complete runnable examples for library functions and machine interface instructions are in library QCPPLE, in source file QACSRC. Each example name is the same as the function name or instruction name. For example, the source code for the example illustrating the use of the _Rcommit() function in this information is in library QCPPLE, file QACSRC, member RCOMMIT. The QSYSINC library must be installed. © Copyright IBM Corp. 1998, 2015 iii iv IBM i: ILE C/C++ Runtime Library Functions Contents About ILE C/C++ Runtime Library Functions.......................................................... iii What's new.........................................................................................................xiii Include Files......................................................................................................... 1 <assert.h>.................................................................................................................................................... 1 <ctype.h>..................................................................................................................................................... 1 <decimal.h>................................................................................................................................................. 1 <errno.h>......................................................................................................................................................1 <except.h>....................................................................................................................................................2 <float.h>....................................................................................................................................................... 4 <inttypes.h>................................................................................................................................................. 4 <langinfo.h>................................................................................................................................................. 5 <limits.h>..................................................................................................................................................... 5 <locale.h>.....................................................................................................................................................5 <math.h>...................................................................................................................................................... 6 <mallocinfo.h>............................................................................................................................................. 6 <monetary.h>...............................................................................................................................................6 <nl_types.h>................................................................................................................................................ 6 <pointer.h>...................................................................................................................................................6 <recio.h>...................................................................................................................................................... 7 <regex.h>................................................................................................................................................... 10 <setjmp.h>................................................................................................................................................. 11 <signal.h>...................................................................................................................................................11 <stdarg.h>..................................................................................................................................................11 <stddef.h>..................................................................................................................................................11 <stdbool.h>................................................................................................................................................11 <stdint.h>...................................................................................................................................................12 <stdio.h>.................................................................................................................................................... 13 <stdlib.h>................................................................................................................................................... 14 <string.h>...................................................................................................................................................15 <strings.h> ................................................................................................................................................ 15 <time.h>.....................................................................................................................................................15 <wchar.h>...................................................................................................................................................16 <wctype.h>................................................................................................................................................ 16 <xxcvt.h>....................................................................................................................................................17 <xxdtaa.h>................................................................................................................................................. 17 <xxenv.h>...................................................................................................................................................17 <xxfdbk.h>................................................................................................................................................. 17 Machine Interface (MI) Include Files........................................................................................................17 Library Functions.................................................................................................19 The C/C++ Library...................................................................................................................................... 19 Error Handling...................................................................................................................................... 19 Searching and Sorting.......................................................................................................................... 20 Mathematical........................................................................................................................................20 Time Manipulation................................................................................................................................26 Type Conversion..................................................................................................................................