pyke/mapping.c, key.c: Make the mapping code more intrusive and complete.
[pyke] / mapping-mLib.c
diff --git a/mapping-mLib.c b/mapping-mLib.c
new file mode 100644 (file)
index 0000000..9b5c37e
--- /dev/null
@@ -0,0 +1,36 @@
+/* -*-c-*-
+ *
+ * Generic mapping support, with 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.
+ */
+
+/*----- Header files ------------------------------------------------------*/
+
+#include "pyke-mLib.h"
+
+/*----- Main code ---------------------------------------------------------*/
+
+Py_ssize_t gmap_pysize_from_sym(sym_table *tab)
+  { return (SYM_LIMIT(tab->t.mask + 1) - tab->load); }
+
+/*----- That's all, folks -------------------------------------------------*/