Back to index

python-biopython  1.60
Functions | Variables
MMCIFlexmodule.c File Reference
#include <Python.h>
#include "lex.yy.h"

Go to the source code of this file.

Functions

static PyObject * MMCIFlex_open_file (PyObject *self, PyObject *args)
static PyObject * MMCIFlex_close_file (PyObject *self, PyObject *args)
static PyObject * MMCIFlex_get_token (PyObject *self, PyObject *args)
void initMMCIFlex (void)

Variables

FILE * fp
static PyMethodDef MMCIFlexMethods []

Function Documentation

void initMMCIFlex ( void  )

Definition at line 66 of file MMCIFlexmodule.c.

{
       (void) Py_InitModule("MMCIFlex", MMCIFlexMethods);
}
static PyObject* MMCIFlex_close_file ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 24 of file MMCIFlexmodule.c.

{
       /* verify no arguments */
       if (!PyArg_ParseTuple(args, ""))
              return NULL;

       fclose(fp);

       Py_INCREF(Py_None);

       return Py_None;
}      
static PyObject* MMCIFlex_get_token ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 38 of file MMCIFlexmodule.c.

{
       int flag;
       char *value="";

       /* get token number */
       flag=mmcif_get_token();

       /* if flag==0 we are EOF */
       if(flag)
       {
              value=mmcif_get_string();
       }      

       /* return the (tokennumber, string) tuple */
       return Py_BuildValue("(is)", flag, value);
}

Here is the call graph for this function:

static PyObject* MMCIFlex_open_file ( PyObject *  self,
PyObject *  args 
) [static]

Definition at line 7 of file MMCIFlexmodule.c.

{
       char *filename;

       if (!PyArg_ParseTuple(args, "s", &filename))
              return NULL;

       fp=fopen(filename, "r");    

       mmcif_set_file(fp);

       Py_INCREF(Py_None);

       return Py_None;
}      

Here is the call graph for this function:


Variable Documentation

FILE* fp

Definition at line 5 of file MMCIFlexmodule.c.

Initial value:
{
       {"open_file", MMCIFlex_open_file,  METH_VARARGS},
       {"close_file",       MMCIFlex_close_file, METH_VARARGS},
       {"get_token",        MMCIFlex_get_token,  METH_VARARGS},
       {NULL,        NULL}                       
}

Definition at line 57 of file MMCIFlexmodule.c.