/* Generated by Pyrex 0.9.3.1 on Sat Apr 15 11:36:30 2006 */

#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#include "const_types.h"
#include "libdspam.h"
#include "storage_driver.h"
#include "stdlib.h"


typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
static int __Pyx_PrintItem(PyObject *); /*proto*/
static int __Pyx_PrintNewline(void); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static void __Pyx_ReRaise(void); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetExcValue(void); /*proto*/
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
static void __Pyx_WriteUnraisable(char *name); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
staticforward char **__pyx_f;

static char __pyx_mdoc[] = "\nlibdspam, version 0.4\n  \n(c) 2004 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk>\n   \n  This program is free software; you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation; either version 2 of the License, or\n  (at your option) any later version.\n";

/* Declarations from pydspam */

staticforward PyTypeObject __pyx_type_7pydspam_dspam;

struct __pyx_obj_7pydspam_dspam {
  PyObject_HEAD
  DSPAM_CTX (*CTX);
  DRIVER_CTX DTX;
  int result;
  int ec;
};

static PyTypeObject *__pyx_ptype_7pydspam_dspam = 0;
static PyObject *__pyx_k17;
static PyObject *__pyx_k18;
static PyObject *__pyx_k20;
static PyObject *__pyx_k22;

/* Implementation of pydspam */


static PyObject *__pyx_n_DSF_CHAINED;
static PyObject *__pyx_n_DSF_SIGNATURE;
static PyObject *__pyx_n_DSF_COPYBACK;
static PyObject *__pyx_n_DSF_NOISE;
static PyObject *__pyx_n_DSF_WHITELIST;
static PyObject *__pyx_n_DSF_MERGED;
static PyObject *__pyx_n_DSM_PROCESS;
static PyObject *__pyx_n_DSM_TOOLS;
static PyObject *__pyx_n_DSM_CLASSIFY;
static PyObject *__pyx_n_DSM;
static PyObject *__pyx_n_DST_TEFT;
static PyObject *__pyx_n_DST_TOE;
static PyObject *__pyx_n_DST_TUM;
static PyObject *__pyx_n_DST_NOTRAIN;
static PyObject *__pyx_n_DST;
static PyObject *__pyx_n_DSR_ISSPAM;
static PyObject *__pyx_n_DSR_ISINNOCENT;
static PyObject *__pyx_n_DSR_NONE;
static PyObject *__pyx_n_DSR;
static PyObject *__pyx_n_DSS_ERROR;
static PyObject *__pyx_n_DSS_CORPUS;
static PyObject *__pyx_n_DSS_INOCULATION;
static PyObject *__pyx_n_DSS_NONE;
static PyObject *__pyx_n_DSS;
static PyObject *__pyx_n_DSpamError;
static PyObject *__pyx_n_PROCESS;
static PyObject *__pyx_n_TOOLS;
static PyObject *__pyx_n_CLASSIFY;
static PyObject *__pyx_n_TEFT;
static PyObject *__pyx_n_TOE;
static PyObject *__pyx_n_TUM;
static PyObject *__pyx_n_NOTRAIN;
static PyObject *__pyx_n_SPAM;
static PyObject *__pyx_n_INNOCENT;
static PyObject *__pyx_n_NONE;
static PyObject *__pyx_n_ERROR;
static PyObject *__pyx_n_CORPUS;
static PyObject *__pyx_n_INNOCULATION;
static PyObject *__pyx_n_Exception;
static PyObject *__pyx_n_root;

static PyObject *__pyx_k23p;

static char (__pyx_k23[]) = "dspam_init failed!";

static int __pyx_f_7pydspam_5dspam___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_7pydspam_5dspam___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_home = 0;
  PyObject *__pyx_v_op = 0;
  PyObject *__pyx_v_flags = 0;
  PyObject *__pyx_v_user = 0;
  PyObject *__pyx_v_group = 0;
  int __pyx_r;
  char (*__pyx_1);
  char (*__pyx_2);
  char (*__pyx_3);
  int __pyx_4;
  u_int32_t __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  static char *__pyx_argnames[] = {"home","op","flags","user","group",0};
  __pyx_v_op = __pyx_k17;
  __pyx_v_flags = __pyx_k18;
  __pyx_v_user = __pyx_k20;
  __pyx_v_group = __pyx_k22;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOOO", __pyx_argnames, &__pyx_v_home, &__pyx_v_op, &__pyx_v_flags, &__pyx_v_user, &__pyx_v_group)) return -1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_home);
  Py_INCREF(__pyx_v_op);
  Py_INCREF(__pyx_v_flags);
  Py_INCREF(__pyx_v_user);
  Py_INCREF(__pyx_v_group);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":118 */
  __pyx_1 = PyString_AsString(__pyx_v_user); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
  __pyx_2 = PyString_AsString(__pyx_v_group); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
  __pyx_3 = PyString_AsString(__pyx_v_home); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
  __pyx_4 = PyInt_AsLong(__pyx_v_op); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
  __pyx_5 = PyInt_AsLong(__pyx_v_flags); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX = dspam_init(__pyx_1,__pyx_2,__pyx_3,__pyx_4,__pyx_5);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":119 */
  __pyx_4 = (((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX == 0);
  if (__pyx_4) {

    /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":120 */
    __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_DSpamError); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
    __pyx_8 = PyTuple_New(2); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_8, 0, __pyx_7);
    Py_INCREF(__pyx_k23p);
    PyTuple_SET_ITEM(__pyx_8, 1, __pyx_k23p);
    __pyx_7 = 0;
    __Pyx_Raise(__pyx_6, __pyx_8, 0);
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  __Pyx_AddTraceback("pydspam.dspam.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_home);
  Py_DECREF(__pyx_v_op);
  Py_DECREF(__pyx_v_flags);
  Py_DECREF(__pyx_v_user);
  Py_DECREF(__pyx_v_group);
  return __pyx_r;
}

static PyObject *__pyx_f_7pydspam_5dspam___del__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam___del__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":122 */
  dspam_destroy(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("pydspam.dspam.__del__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_str;

static PyObject *__pyx_k24p;
static PyObject *__pyx_k25p;

static char (__pyx_k24[]) = " failed (";
static char (__pyx_k25[]) = ")!";

static PyObject *__pyx_f_7pydspam_5dspam_check_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_check_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_es = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {"es",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_es)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_es);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":124 */
  __pyx_1 = (((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec != 0);
  if (__pyx_1) {

    /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":125 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSpamError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    __pyx_3 = PyInt_FromLong(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    __pyx_4 = PyNumber_Add(__pyx_v_es, __pyx_k24p); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    __pyx_6 = PyInt_FromLong(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_7, 0, __pyx_6);
    __pyx_6 = 0;
    __pyx_6 = PyObject_CallObject(__pyx_5, __pyx_7); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_5 = PyNumber_Add(__pyx_4, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_7 = PyNumber_Add(__pyx_5, __pyx_k25p); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_7);
    __pyx_3 = 0;
    __pyx_7 = 0;
    __Pyx_Raise(__pyx_2, __pyx_4, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("pydspam.dspam.check_error");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_es);
  return __pyx_r;
}

static PyObject *__pyx_f_7pydspam_5dspam_training_mode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_training_mode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"mode",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_mode)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_mode);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":127 */
  __pyx_1 = PyInt_AsLong(__pyx_v_mode); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->training_mode = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("pydspam.dspam.training_mode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_mode);
  return __pyx_r;
}

static PyObject *__pyx_f_7pydspam_5dspam_classification(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_classification(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_classification = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"classification",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_classification)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_classification);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":129 */
  __pyx_1 = PyInt_AsLong(__pyx_v_classification); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->classification = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("pydspam.dspam.classification");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_classification);
  return __pyx_r;
}

static PyObject *__pyx_f_7pydspam_5dspam_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  static char *__pyx_argnames[] = {"source",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_source)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_source);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":131 */
  __pyx_1 = PyInt_AsLong(__pyx_v_source); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->source = __pyx_1;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("pydspam.dspam.source");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_source);
  return __pyx_r;
}

static PyObject *__pyx_n_check_error;
static PyObject *__pyx_n_dspam_init_driver;


static PyObject *__pyx_f_7pydspam_5dspam_init_driver(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_init_driver(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":133 */
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = dspam_init_driver((&((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->DTX));

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":134 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_INCREF(__pyx_n_dspam_init_driver);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_dspam_init_driver);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("pydspam.dspam.init_driver");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_dspam_shutdown_driver;


static PyObject *__pyx_f_7pydspam_5dspam_shutdown_driver(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_shutdown_driver(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":136 */
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = dspam_shutdown_driver((&((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->DTX));

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":137 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;}
  Py_INCREF(__pyx_n_dspam_shutdown_driver);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_dspam_shutdown_driver);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("pydspam.dspam.shutdown_driver");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_dspam_attach;


static PyObject *__pyx_f_7pydspam_5dspam_attach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_attach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":139 */
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = dspam_attach(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,(&((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->DTX));

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":140 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
  Py_INCREF(__pyx_n_dspam_attach);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_dspam_attach);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("pydspam.dspam.attach");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_dspam_detach;


static PyObject *__pyx_f_7pydspam_5dspam_detach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_detach(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":142 */
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = dspam_detach(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":143 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}
  Py_INCREF(__pyx_n_dspam_detach);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_dspam_detach);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("pydspam.dspam.detach");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_dspam_process;


static PyObject *__pyx_f_7pydspam_5dspam_process(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_process(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_r;
  char (*__pyx_1);
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"message",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_message)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_message);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":145 */
  __pyx_1 = PyString_AsString(__pyx_v_message); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = dspam_process(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,__pyx_1);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":146 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
  Py_INCREF(__pyx_n_dspam_process);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_dspam_process);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":147 */
  __pyx_2 = PyInt_FromLong(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->probability); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->confidence); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
  PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("pydspam.dspam.process");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_message);
  return __pyx_r;
}

static PyObject *__pyx_n_dspam_getsource;


static PyObject *__pyx_f_7pydspam_5dspam_getsource(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_getsource(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r;
  char (*__pyx_1);
  size_t __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"buf","size",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_buf, &__pyx_v_size)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_buf);
  Py_INCREF(__pyx_v_size);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":149 */
  __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_size); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = dspam_getsource(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,__pyx_1,__pyx_2);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":150 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
  Py_INCREF(__pyx_n_dspam_getsource);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_n_dspam_getsource);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("pydspam.dspam.getsource");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_buf);
  Py_DECREF(__pyx_v_size);
  return __pyx_r;
}

static PyObject *__pyx_n_dspam_addattribute;


static PyObject *__pyx_f_7pydspam_5dspam_addattribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_addattribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  char (*__pyx_1);
  char (*__pyx_2);
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"name","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_name, &__pyx_v_value)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);
  Py_INCREF(__pyx_v_value);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":152 */
  __pyx_1 = PyString_AsString(__pyx_v_name); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
  __pyx_2 = PyString_AsString(__pyx_v_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = dspam_addattribute(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,__pyx_1,__pyx_2);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":153 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
  Py_INCREF(__pyx_n_dspam_addattribute);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_n_dspam_addattribute);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("pydspam.dspam.addattribute");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}

static PyObject *__pyx_n_dspam_clearattributes;


static PyObject *__pyx_f_7pydspam_5dspam_clearattributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_clearattributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":155 */
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = dspam_clearattributes(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":156 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L1;}
  Py_INCREF(__pyx_n_dspam_clearattributes);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_dspam_clearattributes);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("pydspam.dspam.clearattributes");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_True;

static PyObject *__pyx_f_7pydspam_5dspam_create_signature_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_create_signature_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  char (__pyx_v_buf[128]);
  size_t __pyx_v_len;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":160 */
  while (1) {
    __pyx_L2:;
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}
    __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (!__pyx_2) break;

    /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":161 */
    _ds_create_signature_id(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,__pyx_v_buf,(sizeof(__pyx_v_buf)));

    /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":162 */
    __pyx_2 = _ds_verify_signature(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,__pyx_v_buf);
    if (__pyx_2) {

      /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":163 */
      goto __pyx_L3;
      goto __pyx_L4;
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":164 */
  __pyx_1 = PyString_FromString(__pyx_v_buf); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("pydspam.dspam.create_signature_id");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_k34p;

static char (__pyx_k34[]) = "delete_signature('%s')";

static PyObject *__pyx_f_7pydspam_5dspam_delete_signature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_delete_signature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_r;
  char (*__pyx_1);
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"signature",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_signature)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_signature);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":166 */
  __pyx_1 = PyString_AsString(__pyx_v_signature); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = _ds_delete_signature(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,__pyx_1);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":167 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
  __pyx_3 = PyNumber_Remainder(__pyx_k34p, __pyx_v_signature); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pydspam.dspam.delete_signature");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_signature);
  return __pyx_r;
}

static PyObject *__pyx_k35p;

static char (__pyx_k35[]) = "get_signature('%s')";

static PyObject *__pyx_f_7pydspam_5dspam_get_signature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_get_signature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  struct _ds_spam_signature_t (*__pyx_v_SIG);
  PyObject *__pyx_r;
  char (*__pyx_1);
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"signature",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_signature)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_signature);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":170 */
  __pyx_v_SIG = ((struct _ds_spam_signature_t (*))malloc((sizeof(__pyx_v_SIG))));

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":171 */
  __pyx_1 = PyString_AsString(__pyx_v_signature); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = _ds_get_signature(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,__pyx_v_SIG,__pyx_1);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":172 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
  __pyx_3 = PyNumber_Remainder(__pyx_k35p, __pyx_v_signature); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":173 */
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->signature = __pyx_v_SIG;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pydspam.dspam.get_signature");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_signature);
  return __pyx_r;
}

static PyObject *__pyx_k36p;

static char (__pyx_k36[]) = "set_signature('%s')";

static PyObject *__pyx_f_7pydspam_5dspam_set_signature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_set_signature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_r;
  char (*__pyx_1);
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"signature",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_signature)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_signature);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":175 */
  __pyx_1 = PyString_AsString(__pyx_v_signature); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
  ((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->ec = _ds_set_signature(((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX,((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->signature,__pyx_1);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":176 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
  __pyx_3 = PyNumber_Remainder(__pyx_k36p, __pyx_v_signature); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pydspam.dspam.set_signature");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_signature);
  return __pyx_r;
}

static PyObject *__pyx_n_create_signature_id;
static PyObject *__pyx_n_set_signature;

static PyObject *__pyx_k37p;

static char (__pyx_k37[]) = "";

static PyObject *__pyx_f_7pydspam_5dspam_save_signature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7pydspam_5dspam_save_signature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sig;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_sig = Py_None; Py_INCREF(__pyx_v_sig);

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":178 */
  __pyx_1 = (((struct __pyx_obj_7pydspam_dspam *)__pyx_v_self)->CTX->signature != 0);
  if (__pyx_1) {

    /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":179 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_create_signature_id); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_v_sig);
    __pyx_v_sig = __pyx_4;
    __pyx_4 = 0;

    /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":180 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_signature); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
    Py_INCREF(__pyx_v_sig);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_sig);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":181 */
    Py_INCREF(__pyx_v_sig);
    __pyx_r = __pyx_v_sig;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":183 */
    Py_INCREF(__pyx_k37p);
    __pyx_r = __pyx_k37p;
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pydspam.dspam.save_signature");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_sig);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
  {&__pyx_n_CLASSIFY, "CLASSIFY"},
  {&__pyx_n_CORPUS, "CORPUS"},
  {&__pyx_n_DSF_CHAINED, "DSF_CHAINED"},
  {&__pyx_n_DSF_COPYBACK, "DSF_COPYBACK"},
  {&__pyx_n_DSF_MERGED, "DSF_MERGED"},
  {&__pyx_n_DSF_NOISE, "DSF_NOISE"},
  {&__pyx_n_DSF_SIGNATURE, "DSF_SIGNATURE"},
  {&__pyx_n_DSF_WHITELIST, "DSF_WHITELIST"},
  {&__pyx_n_DSM, "DSM"},
  {&__pyx_n_DSM_CLASSIFY, "DSM_CLASSIFY"},
  {&__pyx_n_DSM_PROCESS, "DSM_PROCESS"},
  {&__pyx_n_DSM_TOOLS, "DSM_TOOLS"},
  {&__pyx_n_DSR, "DSR"},
  {&__pyx_n_DSR_ISINNOCENT, "DSR_ISINNOCENT"},
  {&__pyx_n_DSR_ISSPAM, "DSR_ISSPAM"},
  {&__pyx_n_DSR_NONE, "DSR_NONE"},
  {&__pyx_n_DSS, "DSS"},
  {&__pyx_n_DSS_CORPUS, "DSS_CORPUS"},
  {&__pyx_n_DSS_ERROR, "DSS_ERROR"},
  {&__pyx_n_DSS_INOCULATION, "DSS_INOCULATION"},
  {&__pyx_n_DSS_NONE, "DSS_NONE"},
  {&__pyx_n_DST, "DST"},
  {&__pyx_n_DST_NOTRAIN, "DST_NOTRAIN"},
  {&__pyx_n_DST_TEFT, "DST_TEFT"},
  {&__pyx_n_DST_TOE, "DST_TOE"},
  {&__pyx_n_DST_TUM, "DST_TUM"},
  {&__pyx_n_DSpamError, "DSpamError"},
  {&__pyx_n_ERROR, "ERROR"},
  {&__pyx_n_Exception, "Exception"},
  {&__pyx_n_INNOCENT, "INNOCENT"},
  {&__pyx_n_INNOCULATION, "INNOCULATION"},
  {&__pyx_n_NONE, "NONE"},
  {&__pyx_n_NOTRAIN, "NOTRAIN"},
  {&__pyx_n_PROCESS, "PROCESS"},
  {&__pyx_n_SPAM, "SPAM"},
  {&__pyx_n_TEFT, "TEFT"},
  {&__pyx_n_TOE, "TOE"},
  {&__pyx_n_TOOLS, "TOOLS"},
  {&__pyx_n_TUM, "TUM"},
  {&__pyx_n_True, "True"},
  {&__pyx_n_check_error, "check_error"},
  {&__pyx_n_create_signature_id, "create_signature_id"},
  {&__pyx_n_dspam_addattribute, "dspam_addattribute"},
  {&__pyx_n_dspam_attach, "dspam_attach"},
  {&__pyx_n_dspam_clearattributes, "dspam_clearattributes"},
  {&__pyx_n_dspam_detach, "dspam_detach"},
  {&__pyx_n_dspam_getsource, "dspam_getsource"},
  {&__pyx_n_dspam_init_driver, "dspam_init_driver"},
  {&__pyx_n_dspam_process, "dspam_process"},
  {&__pyx_n_dspam_shutdown_driver, "dspam_shutdown_driver"},
  {&__pyx_n_root, "root"},
  {&__pyx_n_set_signature, "set_signature"},
  {&__pyx_n_str, "str"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k23p, __pyx_k23, sizeof(__pyx_k23)},
  {&__pyx_k24p, __pyx_k24, sizeof(__pyx_k24)},
  {&__pyx_k25p, __pyx_k25, sizeof(__pyx_k25)},
  {&__pyx_k34p, __pyx_k34, sizeof(__pyx_k34)},
  {&__pyx_k35p, __pyx_k35, sizeof(__pyx_k35)},
  {&__pyx_k36p, __pyx_k36, sizeof(__pyx_k36)},
  {&__pyx_k37p, __pyx_k37, sizeof(__pyx_k37)},
  {0, 0, 0}
};

static PyObject *__pyx_tp_new_7pydspam_dspam(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_7pydspam_dspam *p = (struct __pyx_obj_7pydspam_dspam *)o;
  return o;
}

static void __pyx_tp_dealloc_7pydspam_dspam(PyObject *o) {
  struct __pyx_obj_7pydspam_dspam *p = (struct __pyx_obj_7pydspam_dspam *)o;
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_7pydspam_dspam(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pydspam_dspam *p = (struct __pyx_obj_7pydspam_dspam *)o;
  return 0;
}

static int __pyx_tp_clear_7pydspam_dspam(PyObject *o) {
  struct __pyx_obj_7pydspam_dspam *p = (struct __pyx_obj_7pydspam_dspam *)o;
  return 0;
}

static struct PyMethodDef __pyx_methods_7pydspam_dspam[] = {
  {"__del__", (PyCFunction)__pyx_f_7pydspam_5dspam___del__, METH_VARARGS|METH_KEYWORDS, 0},
  {"check_error", (PyCFunction)__pyx_f_7pydspam_5dspam_check_error, METH_VARARGS|METH_KEYWORDS, 0},
  {"training_mode", (PyCFunction)__pyx_f_7pydspam_5dspam_training_mode, METH_VARARGS|METH_KEYWORDS, 0},
  {"classification", (PyCFunction)__pyx_f_7pydspam_5dspam_classification, METH_VARARGS|METH_KEYWORDS, 0},
  {"source", (PyCFunction)__pyx_f_7pydspam_5dspam_source, METH_VARARGS|METH_KEYWORDS, 0},
  {"init_driver", (PyCFunction)__pyx_f_7pydspam_5dspam_init_driver, METH_VARARGS|METH_KEYWORDS, 0},
  {"shutdown_driver", (PyCFunction)__pyx_f_7pydspam_5dspam_shutdown_driver, METH_VARARGS|METH_KEYWORDS, 0},
  {"attach", (PyCFunction)__pyx_f_7pydspam_5dspam_attach, METH_VARARGS|METH_KEYWORDS, 0},
  {"detach", (PyCFunction)__pyx_f_7pydspam_5dspam_detach, METH_VARARGS|METH_KEYWORDS, 0},
  {"process", (PyCFunction)__pyx_f_7pydspam_5dspam_process, METH_VARARGS|METH_KEYWORDS, 0},
  {"getsource", (PyCFunction)__pyx_f_7pydspam_5dspam_getsource, METH_VARARGS|METH_KEYWORDS, 0},
  {"addattribute", (PyCFunction)__pyx_f_7pydspam_5dspam_addattribute, METH_VARARGS|METH_KEYWORDS, 0},
  {"clearattributes", (PyCFunction)__pyx_f_7pydspam_5dspam_clearattributes, METH_VARARGS|METH_KEYWORDS, 0},
  {"create_signature_id", (PyCFunction)__pyx_f_7pydspam_5dspam_create_signature_id, METH_VARARGS|METH_KEYWORDS, 0},
  {"delete_signature", (PyCFunction)__pyx_f_7pydspam_5dspam_delete_signature, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_signature", (PyCFunction)__pyx_f_7pydspam_5dspam_get_signature, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_signature", (PyCFunction)__pyx_f_7pydspam_5dspam_set_signature, METH_VARARGS|METH_KEYWORDS, 0},
  {"save_signature", (PyCFunction)__pyx_f_7pydspam_5dspam_save_signature, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_7pydspam_dspam[] = {
  {"result", T_INT, offsetof(struct __pyx_obj_7pydspam_dspam, result), 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_dspam = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
};

static PySequenceMethods __pyx_tp_as_sequence_dspam = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_dspam = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_dspam = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

statichere PyTypeObject __pyx_type_7pydspam_dspam = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "pydspam.dspam", /*tp_name*/
  sizeof(struct __pyx_obj_7pydspam_dspam), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pydspam_dspam, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_dspam, /*tp_as_number*/
  &__pyx_tp_as_sequence_dspam, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_dspam, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_dspam, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pydspam_dspam, /*tp_traverse*/
  __pyx_tp_clear_7pydspam_dspam, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pydspam_dspam, /*tp_methods*/
  __pyx_members_7pydspam_dspam, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_7pydspam_5dspam___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pydspam_dspam, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static struct PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

DL_EXPORT(void) initpydspam(void); /*proto*/
DL_EXPORT(void) initpydspam(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  __pyx_m = Py_InitModule4("pydspam", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  if (PyType_Ready(&__pyx_type_7pydspam_dspam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "dspam", (PyObject *)&__pyx_type_7pydspam_dspam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_ptype_7pydspam_dspam = &__pyx_type_7pydspam_dspam;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":12 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSF_CHAINED, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":13 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSF_SIGNATURE, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":14 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSF_COPYBACK, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":15 */
  __pyx_1 = PyInt_FromLong(8); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSF_NOISE, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":16 */
  __pyx_1 = PyInt_FromLong(16); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSF_WHITELIST, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":17 */
  __pyx_1 = PyInt_FromLong(32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSF_MERGED, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":19 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSM_PROCESS, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":20 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSM_TOOLS, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":21 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSM_CLASSIFY, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":22 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSM_PROCESS); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_n_PROCESS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSM_TOOLS); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_n_TOOLS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSM_CLASSIFY); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_n_CLASSIFY) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSM, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":24 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DST_TEFT, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":25 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DST_TOE, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":26 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DST_TUM, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":27 */
  __pyx_1 = PyInt_FromLong(255); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DST_NOTRAIN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":28 */
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DST_TEFT); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_n_TEFT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DST_TOE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_n_TOE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DST_TUM); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_n_TUM) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DST_NOTRAIN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_n_NOTRAIN) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DST, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":30 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSR_ISSPAM, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":31 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSR_ISINNOCENT, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":32 */
  __pyx_1 = PyInt_FromLong(255); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSR_NONE, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":33 */
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DSR_ISSPAM); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_n_SPAM) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DSR_ISINNOCENT); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_n_INNOCENT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DSR_NONE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_n_NONE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSR, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":35 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSS_ERROR, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":36 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSS_CORPUS, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":37 */
  __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSS_INOCULATION, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":38 */
  __pyx_2 = PyInt_FromLong(15); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSS_NONE, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":39 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSS_ERROR); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_n_ERROR) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSS_CORPUS); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_n_CORPUS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSS_INOCULATION); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_n_INNOCULATION) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSS_NONE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_n_NONE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSS, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":108 */
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
  __pyx_1 = 0;
  if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_n_DSpamError) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
  __pyx_1 = __Pyx_CreateClass(__pyx_3, __pyx_2, __pyx_n_DSpamError, "pydspam"); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":110 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_DSpamError, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":117 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_DSM_PROCESS); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_k17 = __pyx_3;
  __pyx_3 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSF_CHAINED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DSF_SIGNATURE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_4 = PyNumber_Or(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DSF_NOISE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_1 = PyNumber_Or(__pyx_4, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_DSF_COPYBACK); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  __pyx_2 = PyNumber_Or(__pyx_1, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_k18 = __pyx_2;
  __pyx_2 = 0;
  Py_INCREF(__pyx_n_root);
  __pyx_k20 = __pyx_n_root;
  Py_INCREF(__pyx_n_root);
  __pyx_k22 = __pyx_n_root;

  /* "/home/ondrejj/svn/sagator/pydspam/pydspam.pyx":177 */
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pydspam");
}

static char *__pyx_filenames[] = {
  "pydspam.pyx",
};
statichere char **__pyx_f = __pyx_filenames;

/* Runtime support code */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static PyObject *__Pyx_CreateClass(
    PyObject *bases, PyObject *dict, PyObject *name, char *modname)
{
    PyObject *py_modname;
    PyObject *result = 0;
    
    py_modname = PyString_FromString(modname);
    if (!py_modname)
        goto bad;
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
        goto bad;
    result = PyClass_New(bases, dict, name);
bad:
    Py_XDECREF(py_modname);
    return result;
}

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    /* Next, repeatedly, replace a tuple exception with its first item */
    while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
        PyObject *tmp = type;
        type = PyTuple_GET_ITEM(type, 0);
        Py_INCREF(type);
        Py_DECREF(tmp);
    }
    if (PyString_Check(type))
        ;
    else if (PyClass_Check(type))
        ; /*PyErr_NormalizeException(&type, &value, &tb);*/
    else if (PyInstance_Check(type)) {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
              "instance exception may not have a separate value");
            goto raise_error;
        }
        else {
            /* Normalize to raise <class>, <instance> */
            Py_DECREF(value);
            value = type;
            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
            Py_INCREF(type);
        }
    }
    else {
        /* Not something you can raise.  You get an exception
           anyway, just not what you specified :-) */
        PyErr_Format(PyExc_TypeError,
                 "exceptions must be strings, classes, or "
                 "instances, not %s", type->ob_type->tp_name);
        goto raise_error;
    }
    PyErr_Restore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
    while (t->p) {
        *t->p = PyString_InternFromString(t->s);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyObject *empty_tuple = 0;
    PyObject *empty_string = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    
    py_srcfile = PyString_FromString(__pyx_filename);
    if (!py_srcfile) goto bad;
    py_funcname = PyString_FromString(funcname);
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    empty_tuple = PyTuple_New(0);
    if (!empty_tuple) goto bad;
    empty_string = PyString_FromString("");
    if (!empty_string) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        empty_string, /*PyObject *code,*/
        empty_tuple,  /*PyObject *consts,*/
        empty_tuple,  /*PyObject *names,*/
        empty_tuple,  /*PyObject *varnames,*/
        empty_tuple,  /*PyObject *freevars,*/
        empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        empty_string  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_Get(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(empty_tuple);
    Py_XDECREF(empty_string);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
