![]() |
|
The rtypalign() function returns the position of the next proper boundary for a variable of the specified data type.
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.
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.