102PyObject *
file_exit(
struct file *self, PyObject *args, PyObject *kwds);
107#define BUFFSIZE (1024)
150 bool (*valid)(
const char *,
size_t));
Contains common functions and structs used by the other modules.
void free_reader(struct reader *self)
Free the reader object.
Definition reader.c:41
line_out next_line(struct reader *restrict self, bool(*valid)(const char *, size_t))
Fetches the next line from the reader object.
Definition reader.c:83
PyObject * file_enter(struct file *self, PyObject *args)
enter method for file objects
Definition reader.c:11
PyObject * file_exit(struct file *self, PyObject *args, PyObject *kwds)
exit method for file objects
Definition reader.c:26
bool initialize_reader(const struct file *self, struct reader *reader)
Initialize the reader object based on the file object.
Definition reader.c:50
File base struct.
Definition reader.h:71
FILE * file
The FILE object.
Definition reader.h:82
const char * filename
The name of the file.
Definition reader.h:76
A simple that hold a string, and potentially it's Python parent object.
Definition reader.h:125
PyObject * obj
The Python object owning the token buffer.
Definition reader.h:136
occurrence_t line
The string token.
Definition reader.h:131
An occurrence of a token in a string.
Definition common.h:30
Reader base struct.
Definition reader.h:33
PyObject * fileObj
The file object that is being read using PyFile_GetLine.
Definition reader.h:47
FILE * file
The FILE that is being read.
Definition reader.h:42
char * buff
The buffer for getline to write to.
Definition reader.h:53
size_t buffSize
The size of the buff, garbage if buff is NULL.
Definition reader.h:57