CUBRID Engine  latest
cas_dbms_util.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  * cas_dbms_util.h -
22  */
23 
24 #ifndef _CAS_DBMS_UTIL_H_
25 #define _CAS_DBMS_UTIL_H_
26 
27 #ident "$Id$"
28 
29 #define free_and_init(ptr) \
30  do { \
31  if ((ptr)) { \
32  free ((ptr)); \
33  (ptr) = NULL; \
34  } \
35  } while (0)
36 #define MAX_DIAG_DATA_VALUE 0xfffffffffffffLL
37 
38 #define DBINFO_MAX_LENGTH 8192
39 
40 typedef enum
41 {
90 
96 
99 
100 typedef struct database_info DB_INFO;
101 
102 struct database_info
103 {
104  char *alias;
105  char *dbinfo; /* tnsname in Oracle, addr:port in MySQL */
106  DB_INFO *next;
108 };
109 
110 typedef struct cache_time CACHE_TIME;
112 {
113  int sec;
114  int usec;
115 };
116 
117 extern int cfg_get_dbinfo (char *alias, char *dbinfo);
118 extern void cfg_free_dbinfo_all (DB_INFO * databases);
119 extern int cfg_read_dbinfo (DB_INFO ** db_info_p);
120 extern DB_INFO *cfg_find_db_list (DB_INFO * db_info_list_p, const char *name);
121 extern int char_is_delim (int c, int delim);
122 extern char *char_get_next (char *str_p);
123 
124 extern UINT64 ntohi64 (UINT64 from);
125 
126 extern int char_islower (int c);
127 extern int char_isupper (int c);
128 extern int char_isalpha (int c);
129 extern int char_tolower (int c);
130 
131 #endif /* _CAS_DBMS_UTIL_H_ */
int char_tolower(int c)
Definition: chartype.c:146
int cfg_get_dbinfo(char *alias, char *dbinfo)
Definition: cas_dbms_util.c:72
int char_isupper(int c)
Definition: chartype.c:49
int char_is_delim(int c, int delim)
void cfg_free_dbinfo_all(DB_INFO *databases)
Definition: cas_dbms_util.c:51
int char_isalpha(int c)
Definition: chartype.c:61
UINT64 ntohi64(UINT64 from)
int char_islower(int c)
Definition: chartype.c:37
CUBRID_STMT_TYPE
Definition: cas_dbms_util.h:40
int cfg_read_dbinfo(DB_INFO **db_info_p)
DB_INFO * next
DB_INFO * cfg_find_db_list(DB_INFO *db_info_list_p, const char *name)
char * char_get_next(char *str_p)