| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #ifndef FILE_H |
| #define FILE_H |
| #include <stdio.h> |
| #include "attributes.h" |
| #include "stdbool.h" |
| #include "inttypes.h" |
| #include "avl.h" |
|
|
| typedef enum Encoding_types { |
| E_UNKNOWN, E_UTF8, E_UTF16LE, E_UTF16BE, E_ISO |
| } Encoding_types; |
|
|
| struct file_s { |
| const char *name; |
| const char *realname; |
| const char *base; |
| size_t *line; |
| line_t lines; |
| uint8_t *data; |
| size_t len; |
| uint16_t open; |
| uint16_t uid; |
| int type; |
| int err_no; |
| bool read_error; |
| bool portable; |
| Encoding_types encoding; |
| struct avltree star; |
| struct avltree_node node; |
| }; |
|
|
| struct star_s { |
| line_t line; |
| address_t addr; |
| struct avltree tree; |
| struct avltree_node node; |
| }; |
|
|
| static inline bool dash_name(const char *name) { |
| return (name[0] == '-' && name[1] == 0); |
| } |
|
|
| struct str_t; |
|
|
| extern struct file_s *openfile(const char *, const char *, int, const struct str_t *, linepos_t); |
| extern void closefile(struct file_s*); |
| extern struct star_s *new_star(line_t, bool *); |
| extern void destroy_file(void); |
| extern void init_file(void); |
| extern FILE *file_open(const char *, const char *); |
| extern void include_list_add(const char *); |
| extern char *get_path(const struct str_t *, const char *); |
| extern void makefile(int, char *[]); |
|
|
| #endif |
|
|