2019-03-08 18:18:31 +01:00
|
|
|
/* SPDX-License-Identifier: ISC */
|
2019-01-31 17:56:18 +01:00
|
|
|
#ifndef INPUT_FILE_H
|
|
|
|
#define INPUT_FILE_H
|
|
|
|
|
2019-03-08 17:10:47 +01:00
|
|
|
#include <stddef.h>
|
2019-01-31 17:56:18 +01:00
|
|
|
|
2019-01-31 22:09:38 +01:00
|
|
|
typedef struct {
|
|
|
|
const char *name;
|
2019-03-08 17:10:47 +01:00
|
|
|
int (*handle)(char *line, const char *filename,
|
|
|
|
size_t linenum, void *obj);
|
2019-01-31 22:09:38 +01:00
|
|
|
} keyword_handler_t;
|
2019-01-31 17:56:18 +01:00
|
|
|
|
2019-03-08 15:22:35 +01:00
|
|
|
int process_file(const char *filename, const keyword_handler_t *handlers,
|
2019-01-31 22:09:38 +01:00
|
|
|
size_t count, void *obj);
|
|
|
|
|
2019-03-08 17:10:47 +01:00
|
|
|
void input_file_complain(const char *filename, size_t linenum,
|
|
|
|
const char *msg);
|
2019-01-31 22:09:38 +01:00
|
|
|
|
2019-01-31 17:56:18 +01:00
|
|
|
#endif /* INPUT_FILE_H */
|