23 |
/* File handles. */ |
/* File handles. */ |
24 |
|
|
25 |
#include <stddef.h> |
#include <stddef.h> |
26 |
|
#include "file-handle-def.h" |
|
/* File modes. */ |
|
|
enum file_handle_mode |
|
|
{ |
|
|
MODE_TEXT, /* New-line delimited lines. */ |
|
|
MODE_BINARY /* Fixed-length records. */ |
|
|
}; |
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
void fh_init(void); |
void fh_init(void); |
31 |
void fh_done(void); |
void fh_done(void); |
32 |
|
|
33 |
|
|
34 |
/* Parsing handles. */ |
/* Parsing handles. */ |
35 |
struct file_handle *fh_parse (void); |
struct file_handle *fh_parse (void); |
36 |
|
|
39 |
void **fh_open (struct file_handle *, const char *type, const char *mode); |
void **fh_open (struct file_handle *, const char *type, const char *mode); |
40 |
int fh_close (struct file_handle *, const char *type, const char *mode); |
int fh_close (struct file_handle *, const char *type, const char *mode); |
41 |
|
|
|
/* Handle info. */ |
|
|
const char *handle_get_name (const struct file_handle *); |
|
|
const char *handle_get_filename (const struct file_handle *); |
|
|
enum file_handle_mode handle_get_mode (const struct file_handle *); |
|
|
size_t handle_get_record_width (const struct file_handle *); |
|
|
size_t handle_get_tab_width (const struct file_handle *); |
|
42 |
|
|
43 |
#endif /* !file_handle.h */ |
#endif /* !file_handle.h */ |