1 #define FB_FILE_MODE_BINARY 0
2 #define FB_FILE_MODE_RANDOM 1
3 #define FB_FILE_MODE_INPUT 2
4 #define FB_FILE_MODE_OUTPUT 3
5 #define FB_FILE_MODE_APPEND 4
7 #define FB_FILE_ACCESS_ANY 0
8 #define FB_FILE_ACCESS_READ 1
9 #define FB_FILE_ACCESS_WRITE 2
10 #define FB_FILE_ACCESS_READWRITE 3
12 #define FB_FILE_LOCK_SHARED 0
13 #define FB_FILE_LOCK_READ 1
14 #define FB_FILE_LOCK_WRITE 2
15 #define FB_FILE_LOCK_READWRITE 3
17 #define FB_FILE_TYPE_NORMAL 0
18 #define FB_FILE_TYPE_CONSOLE 1
19 #define FB_FILE_TYPE_ERR 2
20 #define FB_FILE_TYPE_PIPE 3
21 #define FB_FILE_TYPE_VFS 4
22 #define FB_FILE_TYPE_PRINTER 5
23 #define FB_FILE_TYPE_SERIAL 6
32 #define FB_FILE_ENCOD_DEFAULT FB_FILE_ENCOD_ASCII
35 #define FB_FILE_FROM_HANDLE(handle) \
36 (((handle) - __fb_ctx.fileTB) + 1 - FB_RESERVED_FILES)
37 #define FB_FILE_INDEX_VALID(index) \
38 ((index)>=1 && ((index)<=(FB_MAX_FILES-FB_RESERVED_FILES)))
40 #define FB_INDEX_IS_SPECIAL(index) \
41 (((index) < 1) && (((index) > (-FB_RESERVED_FILES))
43 #define FB_HANDLE_IS_SCREEN(handle) \
44 ((handle)!=NULL && FB_HANDLE_DEREF(handle)==FB_HANDLE_SCREEN)
46 #define FB_HANDLE_USED(handle) \
47 ((handle)!=NULL && ((handle)->hooks!=NULL))
49 #define FB_HANDLE_SCREEN __fb_ctx.fileTB
50 #define FB_HANDLE_PRINTER (__fb_ctx.fileTB+1)
56 size_t filename_len );
58 size_t filename_len );
126 #define FB_FILE_TO_HANDLE_VALID( index ) \
127 ((FB_FILE *)(__fb_ctx.fileTB + (index) - 1 + FB_RESERVED_FILES))
129 #define FB_FILE_TO_HANDLE( index ) \
131 ((FB_FILE *)FB_HANDLE_SCREEN) : \
133 ((FB_FILE *)FB_HANDLE_PRINTER) : \
134 ( FB_FILE_INDEX_VALID( (index) )? \
135 FB_FILE_TO_HANDLE_VALID( (index) ) : \
136 ((FB_FILE *)(NULL)) \
143 if( handle !=
NULL ) {
154 size_t length,
int adjust_rec_pos,
157 size_t length,
int adjust_rec_pos,
158 int checknewline,
int isunicode );
160 size_t length,
int adjust_rec_pos );
162 size_t length,
size_t *bytesread,
163 int adjust_rec_pos,
int isunicode );
166 size_t filename_length,
167 unsigned int mode,
unsigned int access,
171 unsigned int mode,
unsigned int access,
175 unsigned int access,
unsigned int lock,
176 int fnum,
int len,
const char *encoding );
178 unsigned int access,
unsigned int lock,
179 int fnum,
int len,
const char *encoding );
181 unsigned int access,
unsigned int lock,
182 int fnum,
int len,
const char *encoding );
184 unsigned int access,
unsigned int lock,
185 int fnum,
int len,
const char *encoding );
188 unsigned int access,
unsigned int lock,
189 int fnum,
int len,
const char *encoding );
192 unsigned int access,
unsigned int lock,
193 int fnum,
int len,
const char *encoding );
207 unsigned int access,
unsigned int lock,
210 unsigned int access,
unsigned int lock,
211 int fnum,
int len,
const char *encoding );
213 unsigned int mode,
unsigned int access,
214 unsigned int lock,
int len );
234 FBCALL int fb_FileGetIOB (
int fnum,
int pos,
void *dst,
size_t chars,
size_t *bytesread );
313 #define FB_INPUT_MAXINTLEN 9
316 #define FB_INPUT_MAXLONGLEN 18
319 #define FB_INPUT_MAXDBLLEN (1 + 17 + 1 + 1 + 3)
322 #define FB_INPUT_MAXLONGBINLEN (2 + 64)
325 #define FB_INPUT_MAXNUMERICLEN (FB_INPUT_MAXLONGBINLEN+1)
328 #define FB_INPUT_MAXSTRINGLEN 4096
337 void fb_hCharToUTF8 (
const char *src, ssize_t chars,
char *dst, ssize_t *bytes );
347 #define FB_FILE_ATTR_MODE_INPUT 1
348 #define FB_FILE_ATTR_MODE_OUTPUT 2
349 #define FB_FILE_ATTR_MODE_RANDOM 4
350 #define FB_FILE_ATTR_MODE_APPEND 8
351 #define FB_FILE_ATTR_MODE_BINARY 32
353 #define FB_FILE_ATTR_MODE 1
354 #define FB_FILE_ATTR_HANDLE 2
355 #define FB_FILE_ATTR_ENCODING 3