CUBRID Engine  latest
es.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  * esi.h - header for external storage API (at client and server)
21  */
22 
23 #ifndef _ES_H_
24 #define _ES_H_
25 
26 #include <sys/types.h>
27 
28 #include "porting.h"
29 #include "es_common.h"
30 #include "recovery.h"
31 
32 #define ES_URI_PREFIX_MAX 8
33 #define ES_MAX_URI_LEN (PATH_MAX + ES_URI_PREFIX_MAX)
34 
35 typedef char ES_URI[ES_MAX_URI_LEN];
36 
37 /* APIs */
38 extern int es_init (const char *uri);
39 extern void es_final (void);
40 extern int es_create_file (char *out_uri);
41 extern ssize_t es_write_file (const char *uri, const void *buf, size_t count, off_t offset);
42 extern ssize_t es_read_file (const char *uri, void *buf, size_t count, off_t offset);
43 extern int es_delete_file (const char *uri);
44 extern int es_copy_file (const char *in_uri, const char *metaname, char *out_uri);
45 extern int es_rename_file (const char *in_uri, const char *metaname, char *out_uri);
46 extern off_t es_get_file_size (const char *uri);
47 
48 
49 
50 
51 #endif /* _ES_H_ */
int es_init(const char *uri)
Definition: es.c:53
off_t es_get_file_size(const char *uri)
Definition: es.c:479
int es_create_file(char *out_uri)
Definition: es.c:140
#define ES_MAX_URI_LEN
Definition: es.h:33
void es_final(void)
Definition: es.c:116
ssize_t es_read_file(const char *uri, void *buf, size_t count, off_t offset)
Definition: es.c:243
ssize_t es_write_file(const char *uri, const void *buf, size_t count, off_t offset)
Definition: es.c:187
int count(int &result, const cub_regex_object &reg, const std::string &src, const int position, const INTL_CODESET codeset)
int es_delete_file(const char *uri)
Definition: es.c:301
int es_copy_file(const char *in_uri, const char *metaname, char *out_uri)
Definition: es.c:353
char ES_URI[ES_MAX_URI_LEN]
Definition: es.h:35
int es_rename_file(const char *in_uri, const char *metaname, char *out_uri)
Definition: es.c:417