1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-25 05:50:43 +01:00
pkg-utils/include/util/input_file.h
David Oberhollenzer 16f3e4d97c Move utility source code to libuitil.a
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-02-04 15:26:31 +01:00

27 lines
546 B
C

#ifndef INPUT_FILE_H
#define INPUT_FILE_H
#include <stdio.h>
typedef struct {
FILE *f;
char *line;
const char *filename;
size_t linenum;
} input_file_t;
typedef struct {
const char *name;
int (*handle)(input_file_t *f, void *obj);
} keyword_handler_t;
void cleanup_file(input_file_t *f);
int open_file(input_file_t *f, const char *filename);
int process_file(input_file_t *f, const keyword_handler_t *handlers,
size_t count, void *obj);
void input_file_complain(const input_file_t *f, const char *msg);
#endif /* INPUT_FILE_H */