eccLib 1.1.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
Data Fields
reader Struct Reference

Reader base struct. More...

#include <reader.h>

Data Fields

union { 
 
   FILE *   file 
 The FILE that is being read. More...
 
   PyObject *   fileObj 
 The file object that is being read using PyFile_GetLine. More...
 
};  
 
char * buff
 The buffer for getline to write to.
 
size_t buffSize
 The size of the buff, garbage if buff is NULL.
 

Detailed Description

Reader base struct.

This struct holds either a Python file object, or a C FILE pointer. Which is actually used depends on whether buff is NULL. Regardless of that, both use cases allow for iterative line-by-line reading.

See also
reader_next_line

Field Documentation

◆ [union]

union { ... } reader

◆ buff

char* reader::buff

The buffer for getline to write to.

Note
if NULL, indicates fileObj should be used

◆ buffSize

size_t reader::buffSize

The size of the buff, garbage if buff is NULL.

◆ file

FILE* reader::file

The FILE that is being read.

During iteration this object is used to access file contents via fgets(). buff is used to store the line read, and buffSize is used to store the size of the buffer.

Note
This is used if buff is NULL

◆ fileObj

PyObject* reader::fileObj

The file object that is being read using PyFile_GetLine.

Note
This is used if buff is not NULL

The documentation for this struct was generated from the following file: