eccLib 1.1.0
Python library for bioinformatics written in C
Loading...
Searching...
No Matches
Macros | Functions | Variables
eccLib.c File Reference

Main library file. More...

#include <stdlib.h>
#include <Python.h>
#include "classes/FastaBuff.h"
#include "classes/FastaReader.h"
#include "classes/GtfDict.h"
#include "classes/GtfList.h"
#include "classes/GtfReader.h"
#include "formats/fasta.h"
#include "functions.h"
Include dependency graph for eccLib.c:

Macros

#define REQUIRED_MINOR_VERSION   10
 The minor version of the Python ABI that is required.
 
#define REQUIRED_MAJOR_VERSION   3
 The major version of the Python ABI that is required.
 

Functions

static int initObject (PyObject *module, PyTypeObject *type, const char *objName)
 small convenience function that instantiates the object within module
 
static Py_hash_t PyHashString (const char *str, size_t len)
 Hashes a string.
 
int main (int argc, char *argv[])
 Main function that initializes the Python interpreter and imports the eccLib module.
 

Variables

static PyMethodDef eccLibMethods []
 
static struct PyModuleDef eccLibModule
 

Detailed Description

Main library file.

This file initializes all the features according to the Python ABI.

Macro Definition Documentation

◆ REQUIRED_MAJOR_VERSION

#define REQUIRED_MAJOR_VERSION   3

The major version of the Python ABI that is required.

Well it's not like we even want to support Python 2, so this is just a sanity check

◆ REQUIRED_MINOR_VERSION

#define REQUIRED_MINOR_VERSION   10

The minor version of the Python ABI that is required.

This used to be, because of Py_SET_TYPE, now we don't use it. Thus we could theoretically support older versions, but I haven't personally tested it.

Function Documentation

◆ initObject()

static int initObject ( PyObject *  module,
PyTypeObject *  type,
const char *  objName 
)
inlinestatic

small convenience function that instantiates the object within module

Parameters
modulethe module to which the object should be added to
typethe type of the object that should be added
objNamethe name of the object
Returns
-1 on error

◆ main()

int main ( int  argc,
char *  argv[] 
)

Main function that initializes the Python interpreter and imports the eccLib module.

Parameters
argcthe number of arguments
argvthe arguments
Returns
0 on success

◆ PyHashString()

static Py_hash_t PyHashString ( const char *  str,
size_t  len 
)
inlinestatic

Hashes a string.

Parameters
strthe string to hash
lenthe length of the string
Returns
the hash

Variable Documentation

◆ eccLibMethods

PyMethodDef eccLibMethods[]
static
Initial value:
= {
{"parseFASTA", (PyCFunction)parseFasta, METH_KEYWORDS | METH_VARARGS,
parseFASTAdoc},
{"parseGTF", (PyCFunction)parseGTF, METH_KEYWORDS | METH_VARARGS,
parseGTFdoc},
{NULL}
}
PyObject * parseFasta(PyObject *self, PyObject *args, PyObject *restrict kwargs)
Python function that parses provided raw FASTA content.
Definition functions.c:308
PyObject * parseGTF(PyObject *restrict self, PyObject *restrict args, PyObject *restrict kwargs)
Python function for parsing raw GTF file contents.
Definition functions.c:412

◆ eccLibModule

struct PyModuleDef eccLibModule
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
"eccLib",
moduledoc,
-1,
.m_slots = NULL}
static PyMethodDef eccLibMethods[]
Definition eccLib.c:57