CUBRID Engine  latest
es_common.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  * es_common.h - header for external storage API supports (at client and server)
21  */
22 
23 #ifndef _ES_COMMON_H_
24 #define _ES_COMMON_H_
25 
26 #include "system.h"
27 
28 typedef enum
29 {
30  ES_NONE = -1,
31  ES_OWFS = 0,
32  ES_POSIX = 1,
34 } ES_TYPE;
35 
36 #define ES_OWFS_PATH_PREFIX "owfs:"
37 #define ES_POSIX_PATH_PREFIX "file:"
38 #define ES_LOCAL_PATH_PREFIX "local:"
39 
40 #define ES_OWFS_PATH_POS(uri) ((uri) + sizeof(ES_OWFS_PATH_PREFIX) - 1)
41 #define ES_POSIX_PATH_POS(uri) ((uri) + sizeof(ES_POSIX_PATH_PREFIX) - 1)
42 #define ES_LOCAL_PATH_POS(uri) ((uri) + sizeof(ES_LOCAL_PATH_PREFIX) - 1)
43 
44 // note - to use, one must include error_manager.h & system_parameter.h
45 #define es_log(...) if (prm_get_bool_value (PRM_ID_DEBUG_ES)) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)
46 
47 extern ES_TYPE es_get_type (const char *uri);
48 extern const char *es_get_type_string (ES_TYPE type);
49 extern unsigned int es_name_hash_func (int size, const char *name);
50 extern UINT64 es_get_unique_num (void);
51 
52 #endif /* _ES_COMMON_H_ */
const char * es_get_type_string(ES_TYPE type)
Definition: es_common.c:67
ES_TYPE
Definition: es_common.h:28
UINT64 es_get_unique_num(void)
Definition: es_common.c:102
unsigned int es_name_hash_func(int size, const char *name)
Definition: es_common.c:92
ES_TYPE es_get_type(const char *uri)
Definition: es_common.c:43