summaryrefslogtreecommitdiff
path: root/src/SWIG/_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/SWIG/_lib.h')
-rw-r--r--src/SWIG/_lib.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/SWIG/_lib.h b/src/SWIG/_lib.h
new file mode 100644
index 0000000..f1973b4
--- /dev/null
+++ b/src/SWIG/_lib.h
@@ -0,0 +1,31 @@
+/* Copyright (c) 1999 Ng Pheng Siong. All rights reserved. */
+/* $Id$ */
+
+#include <openssl/bn.h>
+
+typedef struct _blob {
+ unsigned char *data;
+ int len;
+} Blob;
+
+Blob *blob_new(int len, const char *errmsg);
+Blob *blob_copy(Blob *from, const char *errmsg);
+void blob_free(Blob *blob);
+
+static int m2_PyObject_AsReadBuffer(PyObject *obj, const void **buffer,
+ Py_ssize_t *buffer_len);
+static int m2_PyObject_AsReadBufferInt(PyObject *obj, const void **buffer,
+ int *buffer_len);
+static int m2_PyString_AsStringAndSizeInt(PyObject *obj, char **s, int *len);
+
+static BIGNUM* m2_PyObject_AsBIGNUM(PyObject* value, PyObject* _py_exc) ;
+
+/* Always use these two together, to correctly handle non-memoryview objects. */
+static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags);
+static void m2_PyBuffer_Release(PyObject *obj, Py_buffer *view);
+
+int bn_gencb_callback(int p, int n, BN_GENCB *gencb);
+int passphrase_callback(char *buf, int num, int v, void *userdata);
+
+void lib_init(void);
+