Allocates a CS_LOCALE structure.
CS_RETCODE cs_loc_alloc(context, loc_pointer) CS_CONTENT *context; CS_LOCALE **loc_pointer;
A pointer to a CS_CONTEXT structure.
The address of a pointer variable. cs_loc_alloc sets *loc_pointer to the address of a newly allocated CS_LOCALE structure.
cs_loc_alloc returns:
Returns |
Indicates |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
The most common reason for a cs_loc_alloc failure is a lack of adequate memory.
An Open Client and Open Server application can use a CS_LOCALE structure to define custom localization values for a context, thread, connection, or data element. To define custom localization values, an application:
Calls cs_loc_alloc to allocate a CS_LOCALE structure.
Calls cs_locale (CS_SET) to load the CS_LOCALE with custom values.
Uses the CS_LOCALE to set the CS_LOC_PROP property for a context or connection; calls srv_thread_props to set the SRV_T_LOCALE property for a thread; uses the CS_LOCALE in a CS_DATAFMT structure that describes a program variable; or uses the CS_LOCALE as a parameter to an Open Client and Open Server routine.
Calls cs_loc_drop to drop the CS_LOCALE.
Localization values define:
The language and character set to use for Open Client and Open Server and Adaptive Server Enterprise messages
How to represent dates and times
The character set to use when converting data to and from character datatypes
The collating sequence used to define the sort order used by cs_strcmp