CUBRID Engine  latest
cnv.c File Reference
#include "config.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <time.h>
#include <stdarg.h>
#include <wchar.h>
#include "porting.h"
#include "adjustable_array.h"
#include "intl_support.h"
#include "memory_alloc.h"
#include "string_opfunc.h"
#include "object_domain.h"
#include "language_support.h"
#include "object_primitive.h"
#include "cnv.h"
#include "cnvlex.h"
#include "cnverr.h"
#include "tz_support.h"
#include "db_date.h"
#include "dbtype.h"

Go to the source code of this file.

Classes

struct  float_format_s
 
struct  integer_format_s
 
struct  monetary_format_s
 

Macros

#define BITS_IN_BYTE   8
 
#define HEX_IN_BYTE   2
 
#define BITS_IN_HEX   4
 
#define DEC_BUFFER_SIZE   (DB_NUMERIC_BUF_SIZE * 6) + 2
 
#define GET_MIN(a, b)   (a < b) ? a : b
 
#define BYTE_COUNT(bit_cnt)   (((bit_cnt)+BITS_IN_BYTE-1)/BITS_IN_BYTE)
 
#define BYTE_COUNT_HEX(bit_cnt)   (((bit_cnt)+BITS_IN_HEX-1)/BITS_IN_HEX)
 
#define CNV_ERR_BAD_BINARY_DIGIT   -1
 
#define CNV_ERR_BAD_HEX_DIGIT   -2
 
#define CNV_ERR_NO_MEMORY   -3
 
#define FMT_MAX_DIGITS
 
#define FMT_MAX_DATE_STRING   32
 
#define FMT_MAX_TIME_STRING   32
 
#define FMT_MAX_MTIME_STRING   36
 
#define FMT_MAX_TIMESTAMP_STRING   (FMT_MAX_DATE_STRING + FMT_MAX_TIME_STRING + 1)
 
#define FMT_MAX_DATETIME_STRING   (FMT_MAX_DATE_STRING + FMT_MAX_MTIME_STRING + 1)
 
#define mbs_eql(s1, s2)   !strcmp(s1, s2)
 
#define wcs_eql(ws1, ws2)   !wcscmp(ws1, ws2)
 
#define LOCAL_STAR   "*"
 
#define LOCAL_MINUS   "-"
 
#define LOCAL_PLUS   "+"
 
#define LOCAL_SPACE   " "
 
#define LOCAL_0   "0"
 
#define LOCAL_EXP_LENGTH   "E+dd"
 
#define LOCAL_EXP   "E"
 
#define LOCAL_SLASH   "/"
 
#define LOCAL_COLON   ":"
 
#define WCSCAT(buffer, wcs1, wcs2)   (wcscpy( buffer, wcs1), wcscpy( buffer + wcslen( wcs1), wcs2), buffer)
 
#define FMT_SCIENTIFIC()   L"E"
 
#define FMT_THOUSANDS()   L","
 
#define FMT_DECIMAL()   L"."
 
#define FMT_Z()   L"Z"
 
#define FMT_9()   L"9"
 
#define FMT_X()   L"X"
 
#define FMT_STAR()   L"*"
 
#define FMT_PLUS()   L"+"
 
#define FMT_CURRENCY()   L"$"
 
#define FMT_DIGITS()   L"0123456789"
 
#define KOREAN_EUC_YEAR_SYMBOL   "\xb3\xe2" /* nyeon */
 
#define KOREAN_EUC_MONTH_SYMBOL   "\xbf\xf9" /* wol */
 
#define KOREAN_EUC_DAY_SYMBOL   "\xc0\xcf" /* il */
 
#define csect_enter(a, b, c)   NO_ERROR
 
#define csect_exit(a, b)
 

Typedefs

typedef struct float_format_s FLOAT_FORMAT
 
typedef struct integer_format_s INTEGER_FORMAT
 
typedef struct monetary_format_s MONETARY_FORMAT
 
typedef enum bit_string_format_e BIT_STRING_FORMAT
 

Enumerations

enum  FORMAT_DIGIT { DIGIT_Z, DIGIT_9, DIGIT_STAR }
 
enum  FORMAT_CURRENCY { CURRENCY_NONE, CURRENCY_FIRST, CURRENCY_LAST }
 
enum  bit_string_format_e { BIT_STRING_BINARY = 0, BIT_STRING_HEX = 1 }
 

Functions

static const char * us_date_string (int month, int day, int year)
 
static int us_date_value (int *the_month, int *the_day, int *the_year)
 
static const char * us_time_string (const DB_TIME *the_time)
 
static int us_time_value (int *the_hour, int *the_min, int *the_sec)
 
static const char * ko_date_string (int month, int day, int year)
 
static int ko_date_value (int *the_month, int *the_day, int *the_year)
 
static const char * ko_time_string (const DB_TIME *the_time)
 
static int ko_time_value (int *the_hour, int *the_min, int *the_sec)
 
static const char * local_am (void)
 
static const char * local_pm (void)
 
static int fmt_minute_value (const char *, int *)
 
static int fmt_second_value (const char *, int *)
 
static const char * local_am_pm_string (const DB_TIME *the_time)
 
static int local_am_pm_value (bool *)
 
static const char * local_grouping (void)
 
static const char * local_thousands (void)
 
static const char * local_decimal (void)
 
static const char * local_date_string (int month, int day, int year)
 
static int local_date_value (int *, int *, int *)
 
static const char * local_time_string (const DB_TIME *the_time)
 
static int local_time_value (int *, int *, int *)
 
static const wchar_t * cnv_wcs (const char *mbs)
 
static ADJ_ARRAYcnv_get_value_string_buffer (int nchars)
 
static int cnv_bad_char (const char *string, bool unknown)
 
static INTL_ZONE cnv_currency_zone (DB_CURRENCY currency)
 
static bool cnv_valid_currency (DB_CURRENCY currency)
 
static int fmt_integral_digits (FORMAT_DIGIT digit_type, int ndigits, bool sign_required, bool thousands, double *the_value, int *nfound)
 
static int fmt_integral_value (FORMAT_DIGIT type, int ndigits, bool sign_required, bool thousands, double *the_value)
 
static int fmt_fractional_value (FORMAT_DIGIT type, int ndigits, double *the_value)
 
static int fmt_fractional_digits (FORMAT_DIGIT type, int ndigits, double *the_value, int *nfound)
 
static void cnvutil_cleanup (void)
 
static const char * fmt_date_string (const DB_DATE *the_date, const char *descriptor)
 
static int fmt_date_value (const char *descriptor, int *the_month, int *the_day, int *the_year)
 
static const char * fmt_time_string (const DB_TIME *the_time, const char *descriptor)
 
static int fmt_time_value (const char *descriptor, int *the_hour, int *the_min, int *the_sec)
 
static const char * fmt_timestamp_string (const DB_TIMESTAMP *the_timestamp, const char *descriptor)
 
static int fmt_timestamp_value (const char *descriptor, int *the_month, int *the_day, int *the_year, int *the_hour, int *the_min, int *the_sec)
 
static const FMT_TOKENtfmt_new (const char *format)
 
static bool ffmt_valid_char (FMT_TOKEN *token)
 
static void ffmt_new (FLOAT_FORMAT *ffmt, const char *format)
 
static const char * ffmt_value (FLOAT_FORMAT *ffmt, const char *string, double *the_double)
 
static bool mfmt_valid_char (FMT_TOKEN *token)
 
static void mfmt_new (MONETARY_FORMAT *mfmt, const char *format, DB_CURRENCY currency_type)
 
static const char * mfmt_value (MONETARY_FORMAT *mfmt, const char *string, double *the_double)
 
static bool ifmt_valid_char (FMT_TOKEN *token)
 
static void ifmt_new (INTEGER_FORMAT *ifmt, const char *format)
 
static const char * ifmt_value (INTEGER_FORMAT *ifmt, const char *string, int *the_integer)
 
static const char * bifmt_value (INTEGER_FORMAT *bifmt, const char *string, DB_BIGINT *the_bigint)
 
static const char * ifmt_numeric_value (INTEGER_FORMAT *ifmt, const char *string, int *the_integer)
 
static const char * bifmt_numeric_value (INTEGER_FORMAT *ifmt, const char *string, DB_BIGINT *the_bigint)
 
static bool bfmt_valid_char (FMT_TOKEN *token)
 
static void bfmt_new (BIT_STRING_FORMAT *bfmt, const char *format)
 
static const char * bfmt_value (BIT_STRING_FORMAT bfmt, const char *string, DB_VALUE *the_db_bit)
 
static int bfmt_print (BIT_STRING_FORMAT *bfmt, const DB_VALUE *the_db_bit, char *string, int max_size)
 
static int num_fmt_print (FLOAT_FORMAT *ffmt, const DB_VALUE *the_numeric, char *string, int max_size)
 
static int bin_string_to_int (const char *src, int nbits)
 
static int hex_string_to_int (const char *src, int nhex)
 
const char * db_string_value (const char *string, int str_size, const char *format, DB_VALUE *value)
 
const char * db_string_date (const char *date_string, const char *date_format, DB_DATE *the_date)
 
const char * db_string_double (const char *double_string, const char *double_format, double *the_double)
 
int db_numeric_string (const DB_VALUE *the_numeric, const char *numeric_format, char *string, int max_size)
 
const char * db_string_float (const char *float_string, const char *float_format, float *the_float)
 
const char * db_string_integer (const char *integer_string, const char *integer_format, int *the_integer)
 
const char * db_string_bigint (const char *bitint_string, const char *bigint_format, DB_BIGINT *the_bigint)
 
const char * db_string_monetary (const char *monetary_string, const char *monetary_format, DB_MONETARY *the_monetary)
 
const char * db_string_short (const char *short_string, const char *short_format, short *the_short)
 
const char * db_string_time (const char *time_string, const char *time_format, DB_TIME *the_time)
 
int db_time_string (const DB_TIME *the_time, const char *time_format, char *string, int max_size)
 
const char * db_string_timestamp (const char *timestamp_string, const char *timestamp_format, DB_TIMESTAMP *the_timestamp)
 
int db_timestamp_string (const DB_TIMESTAMP *the_timestamp, const char *timestamp_format, char *string, int max_size)
 
const char * db_string_datetime (const char *datetime_string, const char *datetime_format, DB_DATETIME *the_datetime)
 
int db_datetime_string (const DB_DATETIME *the_datetime, const char *datetime_format, char *string, int max_size)
 
const char * db_string_bit (const char *bit_char_string, const char *bit_format, DB_VALUE *the_db_bit)
 
int db_bit_string (const DB_VALUE *the_db_bit, const char *bit_format, char *string, int max_size)
 
void cnv_cleanup (void)
 

Variables

static int fmt_max_digits
 
static ADJ_ARRAYcnv_adj_buffer1 = NULL
 
static ADJ_ARRAYcnv_adj_buffer2 = NULL
 
static ADJ_ARRAYcnv_adj_buffer3 = NULL
 
static const char * kor_weekday_names []
 
static const char * kr_short_month_names []
 
static const char * kr_long_month_names []
 
static const char * eng_short_month_names []
 
static const char * eng_long_month_names []
 
static const char * eng_short_weekday_names []
 
static const char * eng_long_weekday_names []
 

Macro Definition Documentation

#define BITS_IN_BYTE   8

Definition at line 62 of file cnv.c.

Referenced by bfmt_value(), and bin_string_to_int().

#define BITS_IN_HEX   4

Definition at line 64 of file cnv.c.

Referenced by bfmt_print(), bfmt_value(), and hex_string_to_int().

#define BYTE_COUNT (   bit_cnt)    (((bit_cnt)+BITS_IN_BYTE-1)/BITS_IN_BYTE)

Definition at line 74 of file cnv.c.

Referenced by bfmt_print(), and bfmt_value().

#define BYTE_COUNT_HEX (   bit_cnt)    (((bit_cnt)+BITS_IN_HEX-1)/BITS_IN_HEX)

Definition at line 75 of file cnv.c.

Referenced by bfmt_print().

#define CNV_ERR_BAD_BINARY_DIGIT   -1

Definition at line 77 of file cnv.c.

Referenced by bfmt_value().

#define CNV_ERR_BAD_HEX_DIGIT   -2

Definition at line 78 of file cnv.c.

Referenced by bfmt_value().

#define CNV_ERR_NO_MEMORY   -3

Definition at line 79 of file cnv.c.

#define csect_enter (   a,
  b,
 
)    NO_ERROR

Definition at line 138 of file cnv.c.

Referenced by boot_can_compact(), boot_compact_start(), boot_compact_stop(), catcls_convert_class_oid_to_oid(), catcls_delete_catalog_classes(), catcls_finalize_class_oid_to_oid_hash_table(), catcls_initialize_class_oid_to_oid_hash_table(), css_change_ha_server_state(), css_free_user_access_status(), css_notify_ha_log_applier_state(), css_set_user_access_status(), css_transit_ha_server_state(), db_bit_string(), db_datetime_string(), db_numeric_string(), db_string_bigint(), db_string_date(), db_string_double(), db_string_float(), db_string_integer(), db_string_monetary(), db_string_short(), db_string_value(), db_time_string(), db_timestamp_string(), disk_check(), disk_check_volume(), event_log_start(), heap_chnguess_clear(), heap_chnguess_get(), heap_chnguess_put(), heap_classrepr_decache(), heap_mark_class_as_modified(), locator_check_class_names(), locator_drop_transient_class_name_entries(), locator_finalize(), locator_initialize(), locator_permoid_class_name(), locator_savepoint_transient_class_name_entries(), LOG_CS_ENTER(), log_is_log_flush_daemon_available(), partition_cache_finalize(), partition_cache_init(), partition_cache_pruning_context(), partition_decache_class(), qfile_clear_list_cache(), qfile_dump_list_cache_internal(), qfile_end_use_of_list_cache_entry(), qfile_finalize_list_cache(), qfile_initialize_list_cache(), qfile_lookup_list_cache_entry(), qfile_update_list_cache_entry(), qmgr_allocate_tran_entries(), qmgr_finalize(), qmgr_initialize(), xlocator_delete_class_name(), xlocator_rename_class_name(), and xlocator_reserve_class_name().

#define csect_exit (   a,
 
)

Definition at line 139 of file cnv.c.

Referenced by boot_can_compact(), boot_compact_start(), boot_compact_stop(), catcls_convert_class_oid_to_oid(), catcls_delete_catalog_classes(), catcls_finalize_class_oid_to_oid_hash_table(), catcls_initialize_class_oid_to_oid_hash_table(), css_change_ha_server_state(), css_free_user_access_status(), css_get_user_access_status(), css_notify_ha_log_applier_state(), css_set_user_access_status(), css_transit_ha_server_state(), db_bit_string(), db_datetime_string(), db_numeric_string(), db_string_bigint(), db_string_date(), db_string_double(), db_string_float(), db_string_integer(), db_string_monetary(), db_string_short(), db_string_value(), db_time_string(), db_timestamp_string(), disk_add_volume_extension(), disk_check(), disk_check_volume(), disk_reserve_sectors(), disk_rv_reserve_sectors(), disk_rv_unreserve_sectors(), disk_unreserve_ordered_sectors(), event_log_end(), event_log_start(), heap_chnguess_clear(), heap_chnguess_get(), heap_chnguess_put(), heap_classrepr_decache(), heap_mark_class_as_modified(), locator_check_class_names(), locator_drop_transient_class_name_entries(), locator_dump_class_names(), locator_finalize(), locator_initialize(), locator_permoid_class_name(), locator_savepoint_transient_class_name_entries(), LOG_CS_EXIT(), log_is_log_flush_daemon_available(), partition_cache_finalize(), partition_cache_init(), partition_cache_pruning_context(), partition_decache_class(), partition_load_context_from_cache(), qfile_clear_list_cache(), qfile_dump_list_cache_internal(), qfile_end_use_of_list_cache_entry(), qfile_finalize_list_cache(), qfile_initialize_list_cache(), qfile_lookup_list_cache_entry(), qfile_update_list_cache_entry(), qmgr_allocate_tran_entries(), qmgr_finalize(), qmgr_initialize(), xlocator_delete_class_name(), xlocator_find_class_oid(), xlocator_find_lockhint_class_oids(), xlocator_get_reserved_class_name_oid(), xlocator_rename_class_name(), and xlocator_reserve_class_name().

#define DEC_BUFFER_SIZE   (DB_NUMERIC_BUF_SIZE * 6) + 2

Definition at line 72 of file cnv.c.

Referenced by bfmt_print(), and num_fmt_print().

#define FMT_9 ( )    L"9"

Definition at line 124 of file cnv.c.

Referenced by ffmt_new(), ifmt_new(), and mfmt_new().

#define FMT_CURRENCY ( )    L"$"

Definition at line 128 of file cnv.c.

Referenced by mfmt_new().

#define FMT_DECIMAL ( )    L"."

Definition at line 122 of file cnv.c.

Referenced by ffmt_new(), and mfmt_new().

#define FMT_DIGITS ( )    L"0123456789"

Definition at line 129 of file cnv.c.

Referenced by bifmt_numeric_value().

#define FMT_MAX_DATE_STRING   32

Definition at line 88 of file cnv.c.

Referenced by fmt_date_string(), ko_date_string(), and us_date_string().

#define FMT_MAX_DATETIME_STRING   (FMT_MAX_DATE_STRING + FMT_MAX_MTIME_STRING + 1)

Definition at line 101 of file cnv.c.

Referenced by fmt_timestamp_value(), and us_time_value().

#define FMT_MAX_DIGITS
Value:
(fmt_max_digits = (int)ceil(DBL_MAX_EXP * log10( (double) FLT_RADIX))))
static int fmt_max_digits
Definition: cnv.c:373

Definition at line 82 of file cnv.c.

Referenced by bifmt_numeric_value(), ffmt_value(), and mfmt_value().

#define FMT_MAX_MTIME_STRING   36

Definition at line 94 of file cnv.c.

Referenced by ko_time_value(), and us_time_value().

#define FMT_MAX_TIME_STRING   32

Definition at line 91 of file cnv.c.

Referenced by fmt_time_string(), ko_time_string(), and us_time_string().

#define FMT_MAX_TIMESTAMP_STRING   (FMT_MAX_DATE_STRING + FMT_MAX_TIME_STRING + 1)

Definition at line 97 of file cnv.c.

Referenced by cnv_valid_currency(), fmt_timestamp_string(), ko_time_value(), and us_time_value().

#define FMT_PLUS ( )    L"+"

Definition at line 127 of file cnv.c.

Referenced by ffmt_new(), and ifmt_new().

#define FMT_SCIENTIFIC ( )    L"E"

Definition at line 120 of file cnv.c.

Referenced by ffmt_new().

#define FMT_STAR ( )    L"*"

Definition at line 126 of file cnv.c.

Referenced by ffmt_new(), ifmt_new(), and mfmt_new().

#define FMT_THOUSANDS ( )    L","

Definition at line 121 of file cnv.c.

Referenced by ffmt_new(), ifmt_new(), and mfmt_new().

#define FMT_X ( )    L"X"

Definition at line 125 of file cnv.c.

Referenced by ifmt_new().

#define FMT_Z ( )    L"Z"

Definition at line 123 of file cnv.c.

Referenced by ffmt_new(), ifmt_new(), and mfmt_new().

#define GET_MIN (   a,
 
)    (a < b) ? a : b

Definition at line 73 of file cnv.c.

Referenced by bfmt_value().

#define HEX_IN_BYTE   2

Definition at line 63 of file cnv.c.

Referenced by bfmt_value(), and hex_string_to_int().

#define KOREAN_EUC_DAY_SYMBOL   "\xc0\xcf" /* il */

Definition at line 134 of file cnv.c.

Referenced by ko_date_string(), and us_time_value().

#define KOREAN_EUC_MONTH_SYMBOL   "\xbf\xf9" /* wol */

Definition at line 133 of file cnv.c.

Referenced by ko_date_string(), and us_time_value().

#define KOREAN_EUC_YEAR_SYMBOL   "\xb3\xe2" /* nyeon */

Definition at line 132 of file cnv.c.

Referenced by ko_date_string(), and us_time_value().

#define LOCAL_0   "0"
#define LOCAL_COLON   ":"

Definition at line 116 of file cnv.c.

Referenced by fmt_time_string().

#define LOCAL_EXP   "E"

Definition at line 114 of file cnv.c.

#define LOCAL_EXP_LENGTH   "E+dd"

Definition at line 113 of file cnv.c.

Referenced by ffmt_value().

#define LOCAL_MINUS   "-"

Definition at line 109 of file cnv.c.

#define LOCAL_PLUS   "+"

Definition at line 110 of file cnv.c.

#define LOCAL_SLASH   "/"

Definition at line 115 of file cnv.c.

Referenced by fmt_date_string().

#define wcs_eql (   ws1,
  ws2 
)    !wcscmp(ws1, ws2)

Definition at line 105 of file cnv.c.

Referenced by mfmt_new().

#define WCSCAT (   buffer,
  wcs1,
  wcs2 
)    (wcscpy( buffer, wcs1), wcscpy( buffer + wcslen( wcs1), wcs2), buffer)

Definition at line 117 of file cnv.c.

Referenced by ffmt_new(), ifmt_new(), and mfmt_new().

Typedef Documentation

typedef struct float_format_s FLOAT_FORMAT

Definition at line 158 of file cnv.c.

Definition at line 171 of file cnv.c.

Definition at line 181 of file cnv.c.

Enumeration Type Documentation

Enumerator
BIT_STRING_BINARY 
BIT_STRING_HEX 

Definition at line 195 of file cnv.c.

Enumerator
CURRENCY_NONE 
CURRENCY_FIRST 
CURRENCY_LAST 

Definition at line 151 of file cnv.c.

Enumerator
DIGIT_Z 
DIGIT_9 
DIGIT_STAR 

Definition at line 144 of file cnv.c.

Function Documentation

static void bfmt_new ( BIT_STRING_FORMAT bfmt,
const char *  format 
)
static

Definition at line 5744 of file cnv.c.

References BIT_STRING_BINARY, BIT_STRING_HEX, cnv_fmt_analyze(), cnv_fmt_lex(), FL_BIT_STRING_FORMAT, and FT_HEX_DIGITS.

Referenced by db_bit_string(), and db_string_bit().

Here is the caller graph for this function:

static int bfmt_print ( BIT_STRING_FORMAT bfmt,
const DB_VALUE the_db_bit,
char *  string,
int  max_size 
)
static
static bool bfmt_valid_char ( FMT_TOKEN token)
static

Definition at line 5730 of file cnv.c.

References FT_BINARY_DIGITS, FT_HEX_DIGITS, and fmt_token::type.

Referenced by bfmt_value().

Here is the caller graph for this function:

static const char * bifmt_value ( INTEGER_FORMAT bifmt,
const char *  string,
DB_BIGINT the_bigint 
)
static

Definition at line 5321 of file cnv.c.

References bifmt_numeric_value(), and integer_format_s::pattern.

Referenced by db_string_bigint().

Here is the caller graph for this function:

static int bin_string_to_int ( const char *  src,
int  nbits 
)
static

Definition at line 5772 of file cnv.c.

References BITS_IN_BYTE, and parse_int().

Referenced by bfmt_value().

Here is the caller graph for this function:

static int cnv_bad_char ( const char *  string,
bool  unknown 
)
static
void cnv_cleanup ( void  )

Definition at line 8692 of file cnv.c.

References assert, cnv_fmt_exit(), cnvutil_cleanup(), NULL, and thread_get_thread_entry_info().

Referenced by boot_client_all_finalize().

Here is the caller graph for this function:

static ADJ_ARRAY * cnv_get_value_string_buffer ( int  nchars)
static

Definition at line 2632 of file cnv.c.

References ADJ_AR_EOA, adj_ar_new(), adj_ar_replace(), assert, cnv_adj_buffer3, and NULL.

Referenced by bifmt_numeric_value(), db_datetime_string(), db_string_date(), db_time_string(), db_timestamp_string(), and num_fmt_print().

Here is the caller graph for this function:

static const wchar_t * cnv_wcs ( const char *  mbs)
static

Definition at line 2356 of file cnv.c.

References ADJ_AR_EOA, adj_ar_get_buffer(), adj_ar_length(), adj_ar_new(), adj_ar_replace(), assert, cnv_adj_buffer1, NULL, and strlen.

Referenced by ffmt_new(), ifmt_new(), and mfmt_new().

Here is the caller graph for this function:

static void cnvutil_cleanup ( void  )
static

Definition at line 3386 of file cnv.c.

References adj_ar_free(), i, and NULL.

Referenced by cnv_cleanup().

Here is the caller graph for this function:

int db_numeric_string ( const DB_VALUE the_numeric,
const char *  numeric_format,
char *  string,
int  max_size 
)

Definition at line 7317 of file cnv.c.

References assert, CSECT_CNV_FMT_LEXER, csect_enter, csect_exit, ffmt_new(), INF_WAIT, NO_ERROR, NULL, and num_fmt_print().

Referenced by db_string_value().

Here is the caller graph for this function:

const char* db_string_bigint ( const char *  bitint_string,
const char *  bigint_format,
DB_BIGINT the_bigint 
)

Definition at line 7503 of file cnv.c.

References assert, bifmt_value(), CSECT_CNV_FMT_LEXER, csect_enter, csect_exit, ifmt_new(), INF_WAIT, NO_ERROR, and NULL.

Referenced by db_string_value().

Here is the caller graph for this function:

const char* db_string_bit ( const char *  bit_char_string,
const char *  bit_format,
DB_VALUE the_db_bit 
)

Definition at line 8549 of file cnv.c.

References assert, bfmt_new(), bfmt_value(), and NULL.

Referenced by db_string_value().

Here is the caller graph for this function:

const char* db_string_double ( const char *  double_string,
const char *  double_format,
double *  the_double 
)

Definition at line 7223 of file cnv.c.

References assert, CSECT_CNV_FMT_LEXER, csect_enter, csect_exit, db_string_numeric(), float_format_s::decimal, ffmt_new(), ffmt_value(), INF_WAIT, NO_ERROR, and NULL.

Referenced by db_string_value().

Here is the caller graph for this function:

const char* db_string_float ( const char *  float_string,
const char *  float_format,
float *  the_float 
)
const char* db_string_integer ( const char *  integer_string,
const char *  integer_format,
int *  the_integer 
)

Definition at line 7443 of file cnv.c.

References assert, CSECT_CNV_FMT_LEXER, csect_enter, csect_exit, ifmt_new(), ifmt_value(), INF_WAIT, NO_ERROR, and NULL.

Referenced by db_string_value().

Here is the caller graph for this function:

const char* db_string_monetary ( const char *  monetary_string,
const char *  monetary_format,
DB_MONETARY the_monetary 
)

Definition at line 7572 of file cnv.c.

References db_monetary::amount, assert, cnv_valid_currency(), CSECT_CNV_FMT_LEXER, csect_enter, csect_exit, INF_WAIT, mfmt_new(), mfmt_value(), NO_ERROR, NULL, and db_monetary::type.

Referenced by db_string_value().

Here is the caller graph for this function:

const char* db_string_short ( const char *  short_string,
const char *  short_format,
short *  the_short 
)
const char* db_string_value ( const char *  string,
int  str_size,
const char *  format,
DB_VALUE value 
)

Definition at line 6501 of file cnv.c.

References assert, CNV_ER_FMT_BAD_NULL, CNV_ER_FMT_BAD_TYPE, CNV_ER_FMT_STRING_TOO_LONG, CNV_ERR_BAD_NULL, CNV_ERR_BAD_TYPE, CNV_ERR_STRING_TOO_LONG, cnv_valid_currency(), co_signal(), CSECT_CNV_FMT_LEXER, csect_enter, csect_exit, db_bit_string(), DB_CURRENCY_DEFAULT, db_datetime_string(), DB_DEFAULT_PRECISION, DB_DEFAULT_SCALE, db_get_bigint(), db_get_char(), db_get_date(), db_get_datetime(), db_get_double(), db_get_float(), db_get_int(), db_get_monetary(), db_get_nchar(), db_get_short(), db_get_time(), db_get_timestamp(), db_make_bigint(), db_make_char(), db_make_datetime(), db_make_double(), db_make_float(), db_make_int(), db_make_monetary(), db_make_nchar(), db_make_short(), db_make_timestamp(), db_make_varchar(), db_make_varnchar(), db_numeric_string(), db_string_bigint(), db_string_bit(), db_string_double(), db_string_float(), db_string_integer(), db_string_monetary(), db_string_numeric(), db_string_short(), db_string_to_date(), db_string_to_datetime(), db_string_to_time(), db_string_to_timestamp(), db_string_value(), db_time_string(), db_timestamp_string(), DB_TYPE_BIGINT, DB_TYPE_BIT, DB_TYPE_BLOB, DB_TYPE_CHAR, DB_TYPE_CLOB, DB_TYPE_DATE, DB_TYPE_DATETIME, DB_TYPE_DB_VALUE, DB_TYPE_DOUBLE, DB_TYPE_ERROR, DB_TYPE_FLOAT, DB_TYPE_INTEGER, DB_TYPE_MONETARY, DB_TYPE_MULTISET, DB_TYPE_NCHAR, DB_TYPE_NULL, DB_TYPE_NUMERIC, DB_TYPE_OBJECT, DB_TYPE_OID, DB_TYPE_POINTER, DB_TYPE_SEQUENCE, DB_TYPE_SET, DB_TYPE_SHORT, DB_TYPE_SUB, DB_TYPE_TIME, DB_TYPE_TIMESTAMP, DB_TYPE_VARBIT, DB_TYPE_VARCHAR, DB_TYPE_VARIABLE, DB_TYPE_VARNCHAR, DB_TYPE_VOBJ, db_value_domain_init(), DB_VALUE_DOMAIN_TYPE, db_value_get_monetary_currency(), db_value_put_encoded_date(), db_value_put_encoded_time(), DB_VALUE_TYPE, error(), INF_WAIT, intl_char_count(), LANG_SYS_CODESET, LANG_SYS_COLLATION, NO_ERROR, NULL, p, pr_type_name(), and strlen.

Referenced by coerce_char_to_dbvalue(), and db_string_value().

Here is the caller graph for this function:

static bool ffmt_valid_char ( FMT_TOKEN token)
static

Definition at line 4533 of file cnv.c.

References FT_DECIMAL, FT_MINUS, FT_NUMBER, FT_PLUS, FT_STARS, FT_THOUSANDS, FT_ZEROES, local_thousands(), mbs_eql, fmt_token::text, and fmt_token::type.

Referenced by bfmt_print(), and ffmt_value().

Here is the caller graph for this function:

static const char * fmt_date_string ( const DB_DATE the_date,
const char *  descriptor 
)
static

Definition at line 3433 of file cnv.c.

References assert, db_date_decode(), FMT_MAX_DATE_STRING, local_date_string(), LOCAL_SLASH, MB_LEN_MAX, mbs_eql, NULL, and strlen.

Referenced by db_datetime_string(), db_string_date(), db_timestamp_string(), and fmt_timestamp_string().

Here is the caller graph for this function:

static int fmt_fractional_digits ( FORMAT_DIGIT  type,
int  ndigits,
double *  the_value,
int *  nfound 
)
static
static int fmt_integral_digits ( FORMAT_DIGIT  digit_type,
int  ndigits,
bool  sign_required,
bool  thousands,
double *  the_value,
int *  nfound 
)
static
static int fmt_integral_value ( FORMAT_DIGIT  type,
int  ndigits,
bool  sign_required,
bool  thousands,
double *  the_value 
)
static
static int fmt_minute_value ( const char *  descriptor,
int *  the_min 
)
static
static int fmt_second_value ( const char *  descriptor,
int *  the_sec 
)
static
static const char * fmt_time_string ( const DB_TIME the_time,
const char *  descriptor 
)
static

Definition at line 3870 of file cnv.c.

References assert, FMT_MAX_TIME_STRING, local_am_pm_string(), LOCAL_COLON, LOCAL_SPACE, local_time_string(), MB_LEN_MAX, mbs_eql, NULL, and strlen.

Referenced by db_datetime_string(), db_time_string(), db_timestamp_string(), and fmt_timestamp_string().

Here is the caller graph for this function:

static const char * fmt_timestamp_string ( const DB_TIMESTAMP the_timestamp,
const char *  descriptor 
)
static

Definition at line 4291 of file cnv.c.

References assert, db_timestamp_decode_ses(), fmt_date_string(), FMT_MAX_TIMESTAMP_STRING, fmt_time_string(), LOCAL_SPACE, MB_LEN_MAX, mbs_eql, NULL, and strlen.

Referenced by db_datetime_string(), and db_timestamp_string().

Here is the caller graph for this function:

static int fmt_timestamp_value ( const char *  descriptor,
int *  the_month,
int *  the_day,
int *  the_year,
int *  the_hour,
int *  the_min,
int *  the_sec 
)
static
static int hex_string_to_int ( const char *  src,
int  nhex 
)
static

Definition at line 5795 of file cnv.c.

References BITS_IN_HEX, HEX_IN_BYTE, and parse_int().

Referenced by bfmt_value().

Here is the caller graph for this function:

static bool ifmt_valid_char ( FMT_TOKEN token)
static

Definition at line 5213 of file cnv.c.

References FT_MINUS, FT_NUMBER, FT_PLUS, FT_STARS, FT_THOUSANDS, FT_ZEROES, local_thousands(), mbs_eql, fmt_token::text, and fmt_token::type.

Referenced by bifmt_numeric_value(), and ifmt_numeric_value().

Here is the caller graph for this function:

static const char * ifmt_value ( INTEGER_FORMAT ifmt,
const char *  string,
int *  the_integer 
)
static

Definition at line 5301 of file cnv.c.

References ifmt_numeric_value(), and integer_format_s::pattern.

Referenced by db_string_integer(), and db_string_short().

Here is the caller graph for this function:

static const char * ko_date_string ( int  month,
int  day,
int  year 
)
static

Definition at line 1097 of file cnv.c.

References assert, FMT_MAX_DATE_STRING, KOREAN_EUC_DAY_SYMBOL, KOREAN_EUC_MONTH_SYMBOL, KOREAN_EUC_YEAR_SYMBOL, MB_LEN_MAX, and strlen.

Referenced by ko_time_value(), and local_date_string().

Here is the caller graph for this function:

static int ko_date_value ( int *  the_month,
int *  the_day,
int *  the_year 
)
static
static const char * ko_time_string ( const DB_TIME the_time)
static

Definition at line 1335 of file cnv.c.

References assert, db_time_decode(), FMT_MAX_TIME_STRING, local_am_pm_string(), MB_LEN_MAX, min, and strlen.

Referenced by ko_time_value(), and local_time_string().

Here is the caller graph for this function:

static const char * local_am ( void  )
static

Definition at line 1725 of file cnv.c.

References assert, INTL_ZONE_KR, and INTL_ZONE_US.

Referenced by ko_time_value(), local_am_pm_string(), and us_time_value().

Here is the caller graph for this function:

static const char * local_am_pm_string ( const DB_TIME the_time)
static

Definition at line 2162 of file cnv.c.

References db_time_decode(), local_am(), local_pm(), and min.

Referenced by db_datetime_string(), db_time_string(), db_timestamp_string(), fmt_time_string(), ko_time_string(), and us_time_string().

Here is the caller graph for this function:

static int local_am_pm_value ( bool pm)
static
static const char * local_date_string ( int  month,
int  day,
int  year 
)
static

Definition at line 1942 of file cnv.c.

References assert, INTL_ZONE_KR, INTL_ZONE_US, ko_date_string(), and us_date_string().

Referenced by db_string_date(), db_string_datetime(), db_string_timestamp(), and fmt_date_string().

Here is the caller graph for this function:

static int local_date_value ( int *  the_month,
int *  the_day,
int *  the_year 
)
static

Definition at line 1980 of file cnv.c.

References assert, INTL_ZONE_KR, INTL_ZONE_US, ko_date_value(), and us_date_value().

Referenced by fmt_date_value().

Here is the caller graph for this function:

const char * local_decimal ( void  )
static

Definition at line 1711 of file cnv.c.

References strlen.

Referenced by fmt_fractional_value(), and num_fmt_print().

Here is the caller graph for this function:

const char * local_grouping ( void  )
static

Definition at line 1687 of file cnv.c.

References strlen.

Referenced by bfmt_print(), fmt_fractional_value(), and fmt_integral_digits().

Here is the caller graph for this function:

static const char * local_pm ( void  )
static
const char * local_thousands ( void  )
static

Definition at line 1699 of file cnv.c.

References strlen.

Referenced by bfmt_print(), ffmt_valid_char(), fmt_fractional_value(), fmt_integral_digits(), ifmt_valid_char(), and mfmt_valid_char().

Here is the caller graph for this function:

static const char * local_time_string ( const DB_TIME the_time)
static

Definition at line 2090 of file cnv.c.

References assert, INTL_ZONE_KR, INTL_ZONE_US, ko_time_string(), and us_time_string().

Referenced by fmt_time_string().

Here is the caller graph for this function:

static int local_time_value ( int *  the_hour,
int *  the_min,
int *  the_sec 
)
static

Definition at line 2128 of file cnv.c.

References assert, INTL_ZONE_KR, INTL_ZONE_US, ko_time_value(), and us_time_value().

Referenced by fmt_time_value().

Here is the caller graph for this function:

static bool mfmt_valid_char ( FMT_TOKEN token)
static

Definition at line 4838 of file cnv.c.

References FT_CURRENCY, FT_DECIMAL, FT_MINUS, FT_NUMBER, FT_STARS, FT_THOUSANDS, FT_ZEROES, local_thousands(), mbs_eql, fmt_token::text, and fmt_token::type.

Referenced by mfmt_value().

Here is the caller graph for this function:

static const FMT_TOKEN * tfmt_new ( const char *  format)
static
static const char * us_date_string ( int  month,
int  day,
int  year 
)
static

Definition at line 502 of file cnv.c.

References assert, FMT_MAX_DATE_STRING, MB_LEN_MAX, and strlen.

Referenced by local_date_string(), us_date_value(), and us_time_value().

Here is the caller graph for this function:

static int us_date_value ( int *  the_month,
int *  the_day,
int *  the_year 
)
static
static const char * us_time_string ( const DB_TIME the_time)
static

Definition at line 643 of file cnv.c.

References assert, db_time_decode(), FMT_MAX_TIME_STRING, local_am_pm_string(), MB_LEN_MAX, min, and strlen.

Referenced by local_time_string(), and us_time_value().

Here is the caller graph for this function:

Variable Documentation

ADJ_ARRAY* cnv_adj_buffer1 = NULL
static

Definition at line 394 of file cnv.c.

Referenced by cnv_wcs().

ADJ_ARRAY* cnv_adj_buffer2 = NULL
static

Definition at line 397 of file cnv.c.

Referenced by cnv_valid_currency().

ADJ_ARRAY* cnv_adj_buffer3 = NULL
static

Definition at line 400 of file cnv.c.

Referenced by cnv_get_value_string_buffer().

const char* eng_long_month_names[]
static
Initial value:
= {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
}

Definition at line 458 of file cnv.c.

Referenced by local_pm().

const char* eng_long_weekday_names[]
static
Initial value:
= {
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
}

Definition at line 483 of file cnv.c.

Referenced by local_pm().

const char* eng_short_month_names[]
static
Initial value:
= {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
}

Definition at line 443 of file cnv.c.

Referenced by local_pm().

const char* eng_short_weekday_names[]
static
Initial value:
= {
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
}

Definition at line 473 of file cnv.c.

Referenced by local_pm().

int fmt_max_digits
static

Definition at line 373 of file cnv.c.

const char* kor_weekday_names[]
static
Initial value:
= {
"(\xc0\xcf)",
"(\xbf\xf9)",
"(\xc8\xad)",
"(\xbc\xf6)",
"(\xb8\xf1)",
"(\xb1\xdd)",
"(\xc5\xe4)"
}

Definition at line 403 of file cnv.c.

Referenced by local_pm().

const char* kr_long_month_names[]
static
Initial value:
= {
"1\xbf\xf9",
"2\xbf\xf9",
"3\xbf\xf9",
"4\xbf\xf9",
"5\xbf\xf9",
"6\xbf\xf9",
"7\xbf\xf9",
"8\xbf\xf9",
"9\xbf\xf9",
"10\xbf\xf9",
"11\xbf\xf9",
"12\xbf\xf9"
}

Definition at line 428 of file cnv.c.

Referenced by local_pm().

const char* kr_short_month_names[]
static
Initial value:
= {
"1\xbf\xf9",
"2\xbf\xf9",
"3\xbf\xf9",
"4\xbf\xf9",
"5\xbf\xf9",
"6\xbf\xf9",
"7\xbf\xf9",
"8\xbf\xf9",
"9\xbf\xf9",
"10\xbf\xf9",
"11\xbf\xf9",
"12\xbf\xf9"
}

Definition at line 413 of file cnv.c.

Referenced by local_pm().