pyke/, ...: Extract utilities into a sort-of reusable library.
[pyke] / pyke-mLib.h
diff --git a/pyke-mLib.h b/pyke-mLib.h
new file mode 100644 (file)
index 0000000..f1e8cd2
--- /dev/null
@@ -0,0 +1,62 @@
+/* -*-c-*-
+ *
+ * Pyke: the Python Kit for Extensions, mLib integration
+ *
+ * (c) 2019 Straylight/Edgeware
+ */
+
+/*----- Licensing notice --------------------------------------------------*
+ *
+ * This file is part of Pyke: the Python Kit for Extensions.
+ *
+ * Pyke 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.
+ *
+ * Pyke 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 Pyke.  If not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef PYKE_MLIB_H
+#define PYKE_MLIB_H
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+
+/*----- Header files ------------------------------------------------------*/
+
+#ifndef PYKE_H
+#  include "pyke.h"
+#endif
+
+PUBLIC_SYMBOLS;
+#include <mLib/bits.h>
+PRIVATE_SYMBOLS;
+
+/*----- Conversions -------------------------------------------------------*/
+
+#define DECL_CONVU_(n) extern int convu##n(PyObject *, void *);
+DOUINTSZ(DECL_CONVU_)
+  /* Define an `O&' input conversion `convuN' for each mLib type `uintN'. */
+
+extern int convk64(PyObject *, void *);
+  /* Input conversion for `kludge64'. */
+
+extern PyObject *getk64(kludge64);
+  /* Output conversion for `kludge64'. */
+
+/*----- That's all, folks -------------------------------------------------*/
+
+#ifdef __cplusplus
+  }
+#endif
+
+#endif