]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Marc-Andre Lemburg <mal@lemburg.com>:
authorMarc-André Lemburg <mal@egenix.com>
Fri, 30 Jun 2000 09:56:00 +0000 (09:56 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Fri, 30 Jun 2000 09:56:00 +0000 (09:56 +0000)
Include <> -> "". Removed some left over code at the end of the file.
Patch by Bill Tutt.

Tools/perfecthash/perfect_hash.py

index 47f5c53a6ef91868c4b17605acd4d2e0654073d6..bf857398b4dadc0b36781d52803c9714db7526bd 100644 (file)
@@ -291,7 +291,7 @@ class PerfectHash:
 
   def generate_header(self, structName):
     header = """
-#include <Python.h>
+#include "Python.h"
 #include <stdlib.h>
 
 /* --- 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);
-}
-
-"""
-
-
-