Freeciv-3.2
|
Go to the source code of this file.
Macros | |
#define | INF_TOK_FIRST INF_TOK_SECTION_NAME |
Typedefs | |
typedef const char *(* | datafilename_fn_t) (const char *filename) |
Enumerations | |
enum | inf_token_type { INF_TOK_SECTION_NAME , INF_TOK_ENTRY_NAME , INF_TOK_EOL , INF_TOK_TABLE_START , INF_TOK_TABLE_END , INF_TOK_COMMA , INF_TOK_VALUE , INF_TOK_LAST } |
Functions | |
struct inputfile * | inf_from_file (const char *filename, datafilename_fn_t datafn) |
struct inputfile * | inf_from_stream (fz_FILE *stream, datafilename_fn_t datafn) |
void | inf_close (struct inputfile *inf) |
bool | inf_at_eof (struct inputfile *inf) |
const char * | inf_token (struct inputfile *inf, enum inf_token_type type) |
int | inf_discard_tokens (struct inputfile *inf, enum inf_token_type type) |
char * | inf_log_str (struct inputfile *inf, const char *message,...) fc__attribute((__format__(__printf__ |
#define INF_TOK_FIRST INF_TOK_SECTION_NAME |
Definition at line 52 of file inputfile.h.
Definition at line 33 of file inputfile.h.
Enumerator | |
---|---|
INF_TOK_SECTION_NAME | |
INF_TOK_ENTRY_NAME | |
INF_TOK_EOL | |
INF_TOK_TABLE_START | |
INF_TOK_TABLE_END | |
INF_TOK_COMMA | |
INF_TOK_VALUE | |
INF_TOK_LAST |
Definition at line 42 of file inputfile.h.
Return TRUE if current pos is at end of file.
Definition at line 346 of file inputfile.c.
Referenced by secfile_from_input_file().
Close the file and free associated memory, included any partially recursed included files, and the memory allocated for 'inf' itself. Should only be used on an actually open inputfile. After this, the pointer should not be used.
Definition at line 300 of file inputfile.c.
Referenced by inf_close(), and secfile_from_input_file().
int inf_discard_tokens | ( | struct inputfile * | inf, |
enum inf_token_type | type | ||
) |
Read as many tokens of specified type as possible, discarding the results; returns number of such tokens read and discarded.
Definition at line 645 of file inputfile.c.
Referenced by secfile_from_input_file().
struct inputfile * inf_from_file | ( | const char * | filename, |
datafilename_fn_t | datafn | ||
) |
Open the file, and return an allocated, initialized structure. Returns NULL if the file could not be opened.
Definition at line 219 of file inputfile.c.
Referenced by check_include(), and secfile_load_section().
struct inputfile * inf_from_stream | ( | fz_FILE * | stream, |
datafilename_fn_t | datafn | ||
) |
Open the stream, and return an allocated, initialized structure. Returns NULL if the file could not be opened.
Definition at line 241 of file inputfile.c.
Referenced by inf_from_file(), and secfile_from_stream().
Returns token of given type from given inputfile.
Definition at line 607 of file inputfile.c.
Referenced by inf_discard_tokens(), and secfile_from_input_file().