CUBRID Engine  latest
cnv.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * cnv.h - String conversion function header
22  */
23 
24 #ifndef _CNV_H_
25 #define _CNV_H_
26 
27 #ident "$Id$"
28 
29 #include "dbtype_def.h"
30 #include "condition_handler.h"
31 
32 extern const char *db_string_value (const char *string, int str_size, const char *format, DB_VALUE * value);
33 #if defined(ENABLE_UNUSED_FUNCTION)
34 extern DB_VALUE *db_string_to_value (const char *string, const char *format, DB_TYPE type, ...);
35 
36 extern int db_value_string (const DB_VALUE * value, const char *format, char *string, int max_size);
37 
38 extern const char *db_value_to_string (const DB_VALUE * value, const char *format);
39 extern int db_date_string (const DB_DATE * the_date, const char *date_format, char *string, int max_size);
40 extern int db_double_string (double the_double, const char *double_format, char *string, int max_size);
41 extern int db_float_string (float the_float, const char *float_format, char *string, int max_size);
42 extern int db_integer_string (int the_integer, const char *integer_format, char *string, int max_size);
43 extern int db_bigint_string (DB_BIGINT the_bigint, const char *bigint_format, char *string, int max_size);
44 extern int db_monetary_string (const DB_MONETARY * the_monetary, const char *monetary_format, char *string,
45  int max_size);
46 extern int db_short_string (short the_short, const char *short_format, char *string, int max_size);
47 extern int db_validate_format (const char *format, DB_TYPE type);
48 #endif
49 
50 extern const char *db_string_date (const char *date_string, const char *date_format, DB_DATE * the_date);
51 extern const char *db_string_double (const char *double_string, const char *double_format, double *the_double);
52 extern const char *db_string_float (const char *float_string, const char *float_format, float *the_float);
53 extern const char *db_string_integer (const char *integer_string, const char *integer_format, int *the_integer);
54 extern const char *db_string_bigint (const char *bitint_string, const char *bigint_format, DB_BIGINT * the_bigint);
55 extern const char *db_string_monetary (const char *monetary_string, const char *monetary_format,
56  DB_MONETARY * the_monetary);
57 extern const char *db_string_short (const char *short_string, const char *short_format, short *the_short);
58 extern const char *db_string_time (const char *time_string, const char *time_format, DB_TIME * the_time);
59 extern int db_time_string (const DB_TIME * the_time, const char *time_format, char *string, int max_size);
60 extern const char *db_string_timestamp (const char *timestamp_string, const char *timestamp_format,
61  DB_TIMESTAMP * the_time);
62 extern int db_timestamp_string (const DB_TIMESTAMP * the_timestamp, const char *timestamp_format, char *string,
63  int max_size);
64 extern const char *db_string_datetime (const char *datetime_string, const char *datetime_format,
65  DB_DATETIME * the_datetime);
66 extern int db_datetime_string (const DB_DATETIME * the_datetime, const char *datetime_format, char *string,
67  int max_size);
68 extern const char *db_string_bit (const char *string, const char *bit_format, DB_VALUE * the_db_bit);
69 extern int db_bit_string (const DB_VALUE * the_db_bit, const char *bit_format, char *string, int max_size);
70 extern const char *db_string_numeric (const char *string, const char *numeric_format, DB_VALUE * the_numeric);
71 extern int db_numeric_string (const DB_VALUE * the_numeric, const char *numeric_format, char *string, int max_size);
72 
73 /* cleanup function, should only be called by bo_shutdown */
74 extern void cnv_cleanup (void);
75 
76 #endif /* _CNV_H_ */
const char * db_string_value(const char *string, int str_size, const char *format, DB_VALUE *value)
Definition: cnv.c:6501
void cnv_cleanup(void)
Definition: cnv.c:8692
DB_TYPE
Definition: dbtype_def.h:670
const char * db_string_monetary(const char *monetary_string, const char *monetary_format, DB_MONETARY *the_monetary)
Definition: cnv.c:7572
int db_time_string(const DB_TIME *the_time, const char *time_format, char *string, int max_size)
Definition: cnv.c:7847
int db_bit_string(const DB_VALUE *the_db_bit, const char *bit_format, char *string, int max_size)
Definition: cnv.c:8575
int db_timestamp_string(const DB_TIMESTAMP *the_timestamp, const char *timestamp_format, char *string, int max_size)
Definition: cnv.c:8138
unsigned int DB_TIMESTAMP
Definition: dbtype_def.h:759
const char * db_string_time(const char *time_string, const char *time_format, DB_TIME *the_time)
Definition: cnv.c:7730
const char * db_string_bit(const char *string, const char *bit_format, DB_VALUE *the_db_bit)
Definition: cnv.c:8549
const char * db_string_datetime(const char *datetime_string, const char *datetime_format, DB_DATETIME *the_datetime)
Definition: cnv.c:8273
const char * db_string_bigint(const char *bitint_string, const char *bigint_format, DB_BIGINT *the_bigint)
Definition: cnv.c:7503
int64_t DB_BIGINT
Definition: dbtype_def.h:751
int db_numeric_string(const DB_VALUE *the_numeric, const char *numeric_format, char *string, int max_size)
Definition: cnv.c:7317
unsigned int DB_TIME
Definition: dbtype_def.h:754
unsigned int DB_DATE
Definition: dbtype_def.h:771
const char * db_string_timestamp(const char *timestamp_string, const char *timestamp_format, DB_TIMESTAMP *the_time)
Definition: cnv.c:7950
const char * db_string_numeric(const char *string, const char *numeric_format, DB_VALUE *the_numeric)
const char * db_string_short(const char *short_string, const char *short_format, short *the_short)
Definition: cnv.c:7641
int db_datetime_string(const DB_DATETIME *the_datetime, const char *datetime_format, char *string, int max_size)
Definition: cnv.c:8425
const char * db_string_float(const char *float_string, const char *float_format, float *the_float)
Definition: cnv.c:7357
const char * db_string_double(const char *double_string, const char *double_format, double *the_double)
Definition: cnv.c:7223
const char * db_string_integer(const char *integer_string, const char *integer_format, int *the_integer)
Definition: cnv.c:7443
const char * db_string_date(const char *date_string, const char *date_format, DB_DATE *the_date)
Definition: cnv.c:7019