-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsansiWrapper.c
42 lines (34 loc) · 924 Bytes
/
sansiWrapper.c
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
31
32
33
34
35
36
37
38
39
40
41
42
//http://owa.as.wakwak.ne.jp/zope/docs/Python/BindingC/
#include "Python.h"
extern void version();
extern int confirm(char *substitutebid, char *secretstring, char *safekeepedkey);
PyObject* sansi_version(PyObject* self, PyObject* args)
{
/*
int x, y, g;
if (!PyArg_ParseTuple(args, "ii", &x, &y))
return NULL;
*/
version();
return Py_BuildValue("");
}
PyObject* sansi_confirm(PyObject* self, PyObject* args)
{
int result;
char* substitutebid = NULL;
char* secretstring = NULL;
char* safekeepedkey = NULL;
if (!PyArg_ParseTuple(args, "sss", &substitutebid, &secretstring, &safekeepedkey))
return NULL;
result = confirm(substitutebid, secretstring, safekeepedkey);
return Py_BuildValue("i", result);
}
static PyMethodDef sansimethods[] = {
{"version", sansi_version, METH_VARARGS},
{"confirm", sansi_confirm, METH_VARARGS},
{NULL},
};
void initsansi()
{
Py_InitModule("sansi", sansimethods);
}