implement saving and restoring input, at least for string (file not tested)
This commit is contained in:
+7
-5
@@ -15,17 +15,19 @@ typedef bool (*fh_input_refill_t)(struct fh_thread_s *fh, struct fh_input_spec_s
|
||||
/** Spec free func */
|
||||
typedef void (*fh_input_free_t)(void *spec);
|
||||
|
||||
typedef void (*fh_input_start_t)(struct fh_thread_s *fh, struct fh_input_spec_s *spec);
|
||||
typedef void (*fh_input_void_method_t)(struct fh_thread_s *fh, struct fh_input_spec_s *spec);
|
||||
|
||||
typedef void (*fh_input_pushpop_t)(struct fh_thread_s *fh, struct fh_input_spec_s *spec);
|
||||
typedef enum fh_error (*fh_input_error_method_t)(struct fh_thread_s *fh, struct fh_input_spec_s *spec);
|
||||
|
||||
struct fh_input_spec_s {
|
||||
struct fh_input_spec_s *previous;
|
||||
fh_input_refill_t refill_input_buffer;
|
||||
fh_input_start_t start;
|
||||
fh_input_void_method_t start;
|
||||
fh_input_free_t free_self;
|
||||
fh_input_pushpop_t push_prepare;
|
||||
fh_input_pushpop_t pop_restore;
|
||||
fh_input_void_method_t push_prepare;
|
||||
fh_input_void_method_t pop_restore;
|
||||
fh_input_error_method_t save_input;
|
||||
fh_input_error_method_t restore_input;
|
||||
uint32_t linenum;
|
||||
char *cwd; // CWD of the input, used for relative includes. malloc'd (strdup)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user