informix
INFORMIX-ESQL/C Programmer's Manual
Programming with INFORMIX-ESQL/C

Using ESQL/C Header Files

When you install INFORMIX-ESQL/C, the installation script stores the header files in the $INFORMIXDIR/incl/esql directory on a UNIX operating system and in the %INFORMIXDIR%\incl\esql directory in a Windows environment.

Figure 1-17 shows the header files provided with the ESQL/C product.

Figure 1-17
ESQL/C Header Files

Header File Contains Additional Information
datetime.h Definitions of the ESQL/C datetime and interval structures, which are the host variables for DATETIME and INTERVAL columns Chapter 6
decimal.h Definition of the ESQL/C decimal data type, which is the host variable for DECIMAL and MONEY data types Chapter 5
gls.h Function prototypes and data structures for the GLS functionality Informix Guide to GLS Functionality
ifxtypes.h Correctly maps the Informix data types int1, int2, int4, mint, mlong, MSHORT, and MCHAR for 32-bit and 64-bit platforms. The Integer Host Variable Types
locator.h Definition of the ESQL/C locator structure (loc_t), which is the host variable for byte and text columns Chapter 7
sqlca.h Definition of the structure that ESQL/C uses to store error-status codes. The esql preprocessor automatically includes this file when it preprocesses your program. Chapter 11
sqlda.h Structure definition for value pointers and descriptions of dynamically defined variables Chapter 15
sqlhdr.h This file includes the sqlda.h header file, other header files, and function prototypes. The preprocessor automatically includes this file when it preprocesses your program. Including Header Files
sqliapi.h Function prototypes for internal library APIs. For internal ESQL/C use only. None
sqlstype.h Definitions of constants for SQL statements. The DESCRIbE statement uses these constants to describe a dynamically prepared SQL statement. Chapter 15
sqltypes.h Defines constants that correspond to ESQL/C and SQL data types. ESQL/C uses these constants when your program contains a DESCRIBE statement. Data Type Constants
sqlxtype.h Defines constants that correspond to ESQL/C and SQL data types when you are in X/Open mode ESQL/C uses these constants when your program contains a DESCRIBE statement. X/Open Data Type Constants
value.h Value structures that ESQL/C uses For internal ESQL/C use only. None
varchar.h Macros that you can use with the VARCHAR data type Chapter 4
xa.h Function prototypes and data structures for TP/XA applications TP/XA Programmer's Manual

Figure 1-18 on page 1-40 shows the ESQL/C header files specific to Dynamic Server with UD Option.

Figure 1-18
ESQL/C Header Files for Dynamic Server with UD Option

Header File Contents Additional Information
collct.h Definitions of data structures for complex types in ESQL/C Chapter 9
ifxgls.h Function prototypes for the GLS Application Programming Interface For internal ESQL/C use only. None
int8.h Definition of the structure that stores the INT8 data type The int8 Data Type

Figure 1-19 shows the ESQL/C header files specific to Windows environments.

Figure 1-19
ESQL/C Header Files for Windows Environments

Header File Contents Additional Information
sqlproto.h Function prototypes of all ESQL/C library functions for use with source that is not fully ANSI C compliant Declaring Function Prototypes
ifxcexp.c Contains the C code to export the addresses of all C runtime routines that the ESQL client-interface DLL uses Using the Same Runtime Routines for Version Independence
login.h The definition of the InetLogin and HostInfoStruct structures, which enable you to customize configuration information for the application Because this file does not contain ESQL statements, you do not need to include it with the ESQL include directive. Use instead the C #include preprocessor directive. Fields of the InetLogin Structure

Declaring Function Prototypes

ESQL/C provides the sqlproto.h header file to declare function prototypes for all ESQL/C library functions. These function prototypes are required in an ESQL/C source file that you compile with an ANSI C compiler. By default, the esql command processor does not include function-prototype declarations. Having the processor include the ANSI-compliant function prototypes for the ESQL/C functions prevents an ANSI C compiler from generating warnings.

Warning: Although you can use an ANSI C compiler, the ESQL/C preprocessor does not fully support ANSI C, so you might not be able to preprocess all programs that follow the ANSI C standards.

Because the sqlproto.h file does not contain any ESQL/C statements, you can include this file in either of the following ways:

Including Header Files

The ESQL/C preprocessor automatically includes the following ESQL/C header files in your program:

To include any of the other header files in your ESQL/C program, you must use the include preprocessor directive. However, you only need to include an ESQL/C header file if your program refers to the structures or the definitions that the header file defines. For example, if your program accesses datetime data, you must include the datetime.h header file, as follows:

Make sure to terminate the line of code with a semicolon. Some additional examples follow:

Tip: You do not have to enter the .h file extension for an ESQL/C header file; the esql preprocessor assumes a .h extension.

For information on the include directive, see The include Directive.


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved