From e3f257e6819327e40544315cae2ad838de8ff2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lemburg?= Date: Fri, 30 Jun 2000 09:56:00 +0000 Subject: Marc-Andre Lemburg : Include <> -> "". Removed some left over code at the end of the file. Patch by Bill Tutt. --- Tools/perfecthash/perfect_hash.py | 61 +-------------------------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/Tools/perfecthash/perfect_hash.py b/Tools/perfecthash/perfect_hash.py index 47f5c53..bf85739 100644 --- a/Tools/perfecthash/perfect_hash.py +++ b/Tools/perfecthash/perfect_hash.py @@ -291,7 +291,7 @@ class PerfectHash: def generate_header(self, structName): header = """ -#include +#include "Python.h" #include /* --- C API ----------------------------------------------------*/ @@ -603,62 +603,3 @@ def generate_hash(keys, caseInsensitive=0, sys.stderr.write('initial multipler: %s\n' % c) return PerfectHash(cchMaxKey, f1, f2, G, N, len(keys), maxHashValue) - -""" -static -PyObject *codec_tuple(PyObject *unicode, - int len) -{ - PyObject *v,*w; - - if (unicode == NULL) - return NULL; - v = PyTuple_New(2); - if (v == NULL) { - Py_DECREF(unicode); - return NULL; - } - PyTuple_SET_ITEM(v,0,unicode); - w = PyInt_FromLong(len); - if (w == NULL) { - Py_DECREF(v); - return NULL; - } - PyTuple_SET_ITEM(v,1,w); - return v; -} - -static PyObject * -ucn_decode(PyObject *self, - PyObject *args) -{ - const char *data; - int size; - const char *errors = NULL; - PyObject *mapping = NULL; - - if (!PyArg_ParseTuple(args, "t#|z:ucn_decode", - &data, &size, &errors)) - return NULL; - if (mapping == Py_None) - mapping = NULL; - - return codec_tuple(PyUnicode_DecodeNamedUnicodeEscape(data, size, errors), - size); -} - - -static PyMethodDef _codecs_functions[] = { - { "ucn_decode", ucn_decode, 1 }, -}; - -DL_EXPORT(void) -init_ucn() -{ - Py_InitModule("_ucn", _codecs_functions); -} - -""" - - - -- cgit v0.12