/* * Licensed Materials - Property of IBM and/or HCL * * IBM Informix Dynamic Server * Copyright IBM Corporation 1996, 2011 * (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved. * *************************************************************************** * * Title: ifxgls.h * Description: UDS interface to GLS API * ***************************************************************************/ #ifndef _IFXGLS_API_HEADER_INCLUDED #define _IFXGLS_API_HEADER_INCLUDED #include "ifxtypes.h" #include "gls.h" #include "datetime.h" #ifdef __cplusplus extern "C" { #endif /* * The following defines determine whether gl_locale implies a session * locale or a db_locale/client_locale combination depending on server/client * initialisation. */ #ifdef NT_MI_SAPI /* NT Server/Blade */ #ifdef MI_SERVBUILD #ifdef NT_SERVER /* NT Server */ #else /* NT Blade */ __declspec(dllimport) gl_lc_t ** mi_get_locale(); #define gl_locale ** mi_get_locale() #endif /* NT_SERVER */ #endif /* MI_SERVBUILD */ #else /* UNIX/Win32 Client - Default */ #ifdef MI_SERVBUILD MI_EXT_DECL gl_lc_t *scb; #define gl_locale (*scb) #else MI_EXT_DECL gl_lc_t gls_env; #define gl_locale (gls_env) #endif /* MI_SERVBUILD */ #endif /* NT_MI_SAPI */ /* * Locale initialisation function. */ MI_EXT_DECL mint ifx_gl_init(void); /* * Codeset conversion functions. */ /* * The four functions ifx_gl_cv_mconv(), ifx_gl_cv_outbuflen(), * ifx_gl_conv_needed() and ifx_gl_cv_sb2sb_table() are declared * in both ifxgls.h and gcvsrv.h (and defined in gcvsrv.c). */ MI_EXT_DECL mint ifx_gl_cv_mconv(gl_cv_state_t *state, gl_mchar_t **dst, mint *dstbytes, char *dst_codeset, gl_mchar_t **src, mint *srcbytes, char *src_codeset); MI_EXT_DECL mint ifx_gl_cv_outbuflen(char *dst_codeset, char *src_codeset, mint srcbytes); MI_EXT_DECL mint ifx_gl_conv_needed(char *dst_codeset, char *src_codeset); MI_EXT_DECL mint ifx_gl_cv_sb2sb_table(char *dstcs, char *srccs, unsigned char **array); /* * Built-in Data Type Conversion. */ MI_EXT_DECL mint ifx_gl_convert_date(int4 *date, char *datestr, char *format); MI_EXT_DECL mint ifx_gl_format_date(char *datestr, mint len, int4 *date, char *format); MI_EXT_DECL mint ifx_gl_convert_datetime(dtime_t *dt, char *datetimestr, char *format); MI_EXT_DECL mint ifx_gl_format_datetime(char *datetimestr, mint len, dtime_t *dt, char *format); MI_EXT_DECL mint ifx_gl_convert_double(double *d, char *dstr, char *format); MI_EXT_DECL mint ifx_gl_format_double(char *dstr, mint len, double d, char *format); MI_EXT_DECL mint ifx_gl_convert_money(dec_t *mon, char *monstr, char *format); MI_EXT_DECL mint ifx_gl_format_money(char *monstr, mint len, dec_t *mon, char *format); MI_EXT_DECL mint ifx_gl_convert_number(dec_t *dec, char *decstr, char *format); MI_EXT_DECL mint ifx_gl_format_number(char *decstr, mint len, dec_t *dec, char *format); #ifdef __cplusplus } #endif #endif /* _IFXGLS_API_HEADER_INCLUDED */