File: c_lib.h

package info (click to toggle)
python-scipy 0.6.0-12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 32,016 kB
  • ctags: 46,675
  • sloc: cpp: 124,854; ansic: 110,614; python: 108,664; fortran: 76,260; objc: 424; makefile: 384; sh: 10
file content (30 lines) | stat: -rw-r--r-- 845 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef C_LIB_H
#define C_LIB_H

#include <Python.h>
#include <structmember.h>
#include "arrayobject.h"

/* c_lib defines generic functions that aren't inherently time series/date
specific but are needed in various parts of the module. */

#define INT_ERR_CODE -999

#define MEM_CHECK(item) if (item == NULL) { return PyErr_NoMemory(); }
#define ERR_CHECK(item) if (item == NULL) { return NULL; }

char *str_uppercase(char *);
char *str_replace(const char*, const char*, const char*);

PyObject *np_add(PyObject*, PyObject*);
PyObject *np_multiply(PyObject*, PyObject*);
PyObject *np_subtract(PyObject*, PyObject*);
PyObject *np_sqrt(PyObject*);
int np_greater(PyObject*, PyObject*);
int np_greater_equal(PyObject*, PyObject*);

PyObject *set_callback(PyObject*, PyObject**);

void import_c_lib(PyObject*);

#endif