CUBRID Engine  latest
es_posix.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_posix.h - header for posix fs supports (at server)
21  */
22 
23 #ifndef _ES_POSIX_H_
24 #define _ES_POSIX_H_
25 
26 #include <sys/types.h>
27 
28 #include "es_common.h"
29 
30 #if defined (WINDOWS)
31 #define ES_PATH_SEPARATOR "\\"
32 #else
33 #define ES_PATH_SEPARATOR "/"
34 #endif
35 
36 #define ES_POSIX_HASH1 (769)
37 #define ES_POSIX_HASH2 (381)
38 
39 extern int es_posix_init (const char *base_path);
40 extern void es_posix_final (void);
41 
42 #if defined (SA_MODE) || defined (SERVER_MODE)
43 extern int xes_posix_create_file (char *new_path);
44 extern ssize_t xes_posix_write_file (const char *path, const void *buf, size_t count, off_t offset);
45 extern ssize_t xes_posix_read_file (const char *path, void *buf, size_t count, off_t offset);
46 extern int xes_posix_delete_file (const char *path);
47 extern int xes_posix_copy_file (const char *src_path, char *metaname, char *new_path);
48 extern int xes_posix_rename_file (const char *src_path, const char *metaname, char *new_path);
49 extern off_t xes_posix_get_file_size (const char *path);
50 #endif /* SA_MODE || SERVER_MODE */
51 
52 extern int es_local_read_file (const char *path, void *buf, size_t count, off_t offset);
53 extern off_t es_local_get_file_size (const char *path);
54 
55 #endif /* _ES_POSIX_H_ */
void es_posix_final(void)
Definition: es_posix.c:232
int es_local_read_file(const char *path, void *buf, size_t count, off_t offset)
Definition: es_posix.c:647
int count(int &result, const cub_regex_object &reg, const std::string &src, const int position, const INTL_CODESET codeset)
int es_posix_init(const char *base_path)
Definition: es_posix.c:204
off_t es_local_get_file_size(const char *path)
Definition: es_posix.c:713