MPSolve 3.2.1
Loading...
Searching...
No Matches
input-buffer.h File Reference

Implementation of a buffer for parsing input file for MPSolve. More...

Go to the source code of this file.

Classes

struct  mps_input_buffer
 Buffer used to parse input files in MPSolve. It can read a stream line by line. More...
 

Macros

#define MPS_INPUT_BUFFER_HISTORY_DEFAULT_SIZE   2
 Default size of the buffer of old lines in the input buffer instances.
 

Functions

mps_input_buffermps_input_buffer_new (mps_abstract_input_stream *stream)
 Create a new input buffer associated with the given input stream.
 
int mps_input_buffer_readline (mps_input_buffer *buf)
 Read a new line in the buffer, replacing the one present now.
 
void mps_input_buffer_free (mps_input_buffer *buf)
 Free the buffer and internal data contained in it. Unread lines may be lost.
 
void mps_input_buffer_set_history_size (mps_input_buffer *buf, size_t size)
 
mps_boolean mps_input_buffer_eof (mps_input_buffer *buf)
 Check if the whole stream has been read. This does not mean that there is nothing more to read, since the line buffer could be non-empty.
 
char * mps_input_buffer_next_token (mps_input_buffer *buf)
 This function returns the next token that is in the buffer but hasn't been read yet. More...
 

Detailed Description

Implementation of a buffer for parsing input file for MPSolve.

Function Documentation

◆ mps_input_buffer_next_token()

char * mps_input_buffer_next_token ( mps_input_buffer buf)

This function returns the next token that is in the buffer but hasn't been read yet.

It will automagically read new lines if the one in the buffer does not contains anything useful, and return NULL if the stream finish.

The returned token shall be freed by the caller.