informix
INFORMIX-ESQL/C Programmer's Manual
ESQL/C Function Library

rtypalign()

The rtypalign() function returns the position of the next proper boundary for a variable of the specified data type.

Syntax

32 Bit

64 Bit

Usage

The rtypalign() and rtypmsize() functions are useful when you use an sqlda structure to dynamically fetch data into a buffer. On many hardware platforms, integer and other numeric data types must begin on a work boundary. The C language memory allocation routines allocate memory that is suitably aligned for any data type, including structures. However, these routines do not perform alignment for the constituent components of the structure. The programmer is responsible for performing that alignment with functions such as rtypalign() and rtypmsize(). These functions provide machine independence for storing column data.

After a DESCRIBE statement determines column information, ESQL/C stores the value of type in sqlda.sqlvar->sqltype.

You can see an application of the rtypalign() function in the unload.ec demonstration program.

Return Code

>0 The return value is the offset of the next proper boundary for a variable of type data type.

Example

This sample program is in the rtypalign.ec file in the demo directory.

For a complete listing of the exp_chk() function, see Guide to the exp_chk.ec File or refer to the exp_chk.ec file for a listing of this exception-handling function.

Output


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