MPSolve 3.2.2
Loading...
Searching...
No Matches
input-buffer.h
Go to the documentation of this file.
1/*
2 * This file is part of MPSolve 3.2.2
3 *
4 * Copyright (C) 2001-2020, Dipartimento di Matematica "L. Tonelli", Pisa.
5 * License: http://www.gnu.org/licenses/gpl.html GPL version 3 or higher
6 *
7 * Authors:
8 * Leonardo Robol <leonardo.robol@unipi.it>
9 */
10
11#ifndef MPS_INPUT_BUFFER_H_
12#define MPS_INPUT_BUFFER_H_
13
15
20
21MPS_BEGIN_DECLS
22
27#define MPS_INPUT_BUFFER_HISTORY_DEFAULT_SIZE 2
28
39
45 char *line;
46
51 long int line_number;
52
61 char **history;
62
70
77 int last;
78
89 char * last_token;
90};
91
92/* Function prototypes */
93mps_input_buffer *mps_input_buffer_new (mps_abstract_input_stream * stream);
94int mps_input_buffer_readline (mps_input_buffer * buf);
95void mps_input_buffer_free (mps_input_buffer * buf);
96void mps_input_buffer_set_history_size (mps_input_buffer * buf, size_t size);
97mps_boolean mps_input_buffer_eof (mps_input_buffer * buf);
98char * mps_input_buffer_next_token (mps_input_buffer * buf);
99
100MPS_END_DECLS
101
102#endif /* ifndef MPS_INPUT_BUFFER_H */
Abstract input stream used to parse files.
struct mps_abstract_input_stream mps_abstract_input_stream
C wrapper around AbstractInputStream.
Definition abstract-input-stream.h:32
Buffer used to parse input files in MPSolve. It can read a stream line by line.
Definition input-buffer.h:33
size_t history_size
Size of the history that is been kept in memory.
Definition input-buffer.h:69
char * line
Pointer the last line read in the buffer. Another line can be read with mps_input_buffer_readline().
Definition input-buffer.h:45
mps_abstract_input_stream * stream
Stream associated with the mps_input_buffer.
Definition input-buffer.h:38
int last
Index of the last line inserted in history.
Definition input-buffer.h:77
long int line_number
Number of the last read line, the one that is stored in line field.
Definition input-buffer.h:51
char ** history
Lines that have been read before this.
Definition input-buffer.h:61
char * last_token
This is a pointer to the last parsed char in the buffer->line string.
Definition input-buffer.h:89