Initial version: obviously trivial module with no functionality.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jul 2017 10:44:07 +0000 (11:44 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jul 2017 12:18:19 +0000 (13:18 +0100)
.gitignore [new file with mode: 0644]
.links [new file with mode: 0644]
Makefile [new file with mode: 0644]
kalyna-python.c [new file with mode: 0644]
setup.py [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1523603
--- /dev/null
@@ -0,0 +1,5 @@
+/RELEASE
+/auto-version
+/mdwsetup.py
+/mdwsetup.pyc
+/pysetup.mk
diff --git a/.links b/.links
new file mode 100644 (file)
index 0000000..b11dcde
--- /dev/null
+++ b/.links
@@ -0,0 +1,3 @@
+auto-version
+mdwsetup.py
+pysetup.mk
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..b9f9347
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+### -*-makefile-*-
+include pysetup.mk
diff --git a/kalyna-python.c b/kalyna-python.c
new file mode 100644 (file)
index 0000000..3de4bfe
--- /dev/null
@@ -0,0 +1,47 @@
+/* -*-c-*-
+ *
+ * Python binding to Kalyna reference implementation
+ *
+ * (c) 2017 Mark Wooding
+ */
+
+/*----- Licensing notice --------------------------------------------------*
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*----- Header files ------------------------------------------------------*/
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+
+/*----- Utilities ---------------------------------------------------------*/
+
+#define INSERT(name, ob) do {                                          \
+  PyObject *_o = (PyObject *)(ob);                                     \
+  Py_INCREF(_o);                                                       \
+  PyModule_AddObject(mod, name, _o);                                   \
+} while (0)
+
+/*----- Main code ---------------------------------------------------------*/
+
+void initkalyna(void)
+{
+  PyObject *mod = Py_InitModule("kalyna", 0);
+  INSERT("version", PyString_FromString(VERSION));
+}
+
+/*----- That's all, folks -------------------------------------------------*/
diff --git a/setup.py b/setup.py
new file mode 100755 (executable)
index 0000000..a315063
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,16 @@
+#! /usr/bin/python
+
+import distutils.core as DC
+import mdwsetup as MS
+
+cat = DC.Extension('kalyna', ['kalyna-python.c'],
+                   extra_compile_args = ['-DVERSION="%s"' %
+                                         MS.auto_version()])
+
+MS.setup(name = 'kalyna-python',
+         description = 'Python binding to Kalyna reference implementation',
+         url = 'https://git.distorted.org.uk/~mdw/kalyna-python/',
+         author = 'Mark Wooding',
+         author_email = 'mdw@distorted.org.uk',
+         license = 'Alas unclear',
+         ext_modules = [cat])