forked from UnitexGramLab/unitex-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAf_stdio.h
130 lines (87 loc) · 3.65 KB
/
Af_stdio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
* Unitex
*
* Copyright (C) 2001-2017 Université Paris-Est Marne-la-Vallée <unitex@univ-mlv.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
*/
/*
* File created and contributed by Gilles Vollant (Ergonotics SAS)
* as part of an UNITEX optimization and reliability effort
*
* additional information: http://www.ergonotics.com/unitex-contribution/
* contact : unitex-contribution@ergonotics.com
*
*/
#ifndef _ABSTRACT_FILE_STDIO_INCLUDED
#define _ABSTRACT_FILE_STDIO_INCLUDED
#define HAS_LIST_FILE 1
#ifdef __cplusplus
extern "C" {
#endif
struct _ABSTRACTFILE {
void* dummy;
};
typedef struct _ABSTRACTFILE ABSTRACTFILE;
struct _ABSTRACTMAPFILE {
void* dummy;
};
typedef struct _ABSTRACTMAPFILE ABSTRACTMAPFILE;
#define MAPFILE_OPTION_READ ((int)0x00000001)
ABSTRACTMAPFILE* af_open_mapfile(const char*name,int options, size_t value_for_option);
ABSTRACTMAPFILE* af_open_mapfile_unlogged(const char*name,int options, size_t value_for_option);
size_t af_get_mapfile_size(ABSTRACTMAPFILE*);
#ifdef __cplusplus
const void* af_get_mapfile_pointer(ABSTRACTMAPFILE*, size_t pos=0, size_t sizemap=0);
void af_release_mapfile_pointer(ABSTRACTMAPFILE*, const void*,size_t sizemap=0);
#else
const void* af_get_mapfile_pointer(ABSTRACTMAPFILE*, size_t pos, size_t sizemap);
void af_release_mapfile_pointer(ABSTRACTMAPFILE*, const void*,size_t sizemap);
#endif
void af_close_mapfile(ABSTRACTMAPFILE*);
void af_close_mapfile_unlogged(ABSTRACTMAPFILE*);
int is_filename_in_abstract_file_space(const char*name);
size_t af_fread(void *ptr,size_t size,size_t nmemb,ABSTRACTFILE *stream);
size_t af_fwrite(const void *ptr,size_t size,size_t nmemb,ABSTRACTFILE *stream);
char *af_fgets(char * _Buf, int _MaxCount, ABSTRACTFILE * _File);
ABSTRACTFILE* af_fopen(const char* name,const char* MODE);
ABSTRACTFILE* af_fopen_unlogged(const char* name,const char* MODE);
int af_fseek(ABSTRACTFILE* stream, long offset, int whence) ;
long af_ftell(ABSTRACTFILE* stream) ;
int af_feof(ABSTRACTFILE* stream) ;
int af_ungetc(int, ABSTRACTFILE* stream) ;
int af_fclose(ABSTRACTFILE* stream) ;
int af_fclose_unlogged(ABSTRACTFILE* stream) ;
void af_setsizereservation(ABSTRACTFILE* stream, long size_planned);
char** af_get_list_file(const char*name);
void af_release_list_file(const char*name,char**list);
int af_rename(const char * OldFilename, const char * NewFilename);
int af_rename_unlogged(const char * OldFilename, const char * NewFilename);
int af_remove(const char * Filename);
int af_remove_unlogged(const char * Filename);
#define AF_REMOVE_FOLDER_PRESENT_AF_STDIO 1
int af_remove_folder(const char*folderName);
int af_remove_folder_unlogged(const char*folderName);
int af_copy(const char* srcFile, const char* dstFile);
int af_copy_unlogged(const char* srcFile, const char* dstFile);
extern const ABSTRACTFILE* pVF_StdIn ;
extern const ABSTRACTFILE* pVF_StdOut ;
extern const ABSTRACTFILE* pVF_StdErr ;
int IsStdIn(ABSTRACTFILE*);
#ifdef __cplusplus
}
#endif
#endif