]> granicus.if.org Git - python/commitdiff
Add _PyUnicode_AsDefaultEncodedString to unicodeobject.h.
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 30 Jul 2001 22:34:24 +0000 (22:34 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 30 Jul 2001 22:34:24 +0000 (22:34 +0000)
And remove all the extern decls in the middle of .c files.
Apparently, it was excluded from the header file because it is
intended for internal use by the interpreter.  It's still intended for
internal use and documented as such in the header file.

Include/unicodeobject.h
Objects/object.c
Objects/stringobject.c
Objects/unicodeobject.c
Python/getargs.c

index 871fbed1d80cf6b77bafc1374e9944f6025e0498..84cd0c17b07547a118131beded918d784b5fb468 100644 (file)
@@ -386,6 +386,23 @@ extern DL_IMPORT(int) PyUnicode_AsWideChar(
 
 /* --- Manage the default encoding ---------------------------------------- */
 
+/* Return a Python string holding the default encoded value of the
+   Unicode object. 
+
+   The resulting string is cached in the Unicode object for subsequent
+   usage by this function. The cached version is needed to implement
+   the character buffer interface and will live (at least) as long as
+   the Unicode object itself.
+
+   The refcount of the string is *not* incremented.
+
+   *** Exported for internal use by the interpreter only !!! ***
+
+*/
+
+extern DL_IMPORT(PyObject *) _PyUnicode_AsDefaultEncodedString(
+    PyObject *, const char *);
+
 /* Returns the currently active default encoding.
 
    The default encoding is currently implemented as run-time settable
index 334907865764b8fd0c34c62e0167c68ddd25acc6..87c8e1a801dc64bca7d1bf0cecf94b19d07d3c57 100644 (file)
@@ -1056,11 +1056,6 @@ PyObject_SetAttrString(PyObject *v, char *name, PyObject *w)
        }
 }
 
-/* Internal API needed by PyObject_GetAttr(): */
-extern 
-PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode,
-                                 const char *errors);
-
 PyObject *
 PyObject_GetAttr(PyObject *v, PyObject *name)
 {
index 9a88d2facc83fb548bae094a1fe3a35afa5509d1..c7f5062a0fb1d191524cbf2838cdc4a35003f101 100644 (file)
@@ -333,11 +333,6 @@ PyString_AsString(register PyObject *op)
        return ((PyStringObject *)op) -> ob_sval;
 }
 
-/* Internal API needed by PyString_AsStringAndSize(): */
-extern
-PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode,
-                                           const char *errors);
-
 int
 PyString_AsStringAndSize(register PyObject *obj,
                         register char **s,
index 08ba0659289867165ccd6c79fd35f01ac43dfa6c..4bdff5a314e77296de2a1ed82ead029c66a0525f 100644 (file)
@@ -566,20 +566,6 @@ PyObject *PyUnicode_AsEncodedString(PyObject *unicode,
     return NULL;
 }
 
-/* Return a Python string holding the default encoded value of the
-   Unicode object. 
-
-   The resulting string is cached in the Unicode object for subsequent
-   usage by this function. The cached version is needed to implement
-   the character buffer interface and will live (at least) as long as
-   the Unicode object itself.
-
-   The refcount of the string is *not* incremented.
-
-   *** Exported for internal use by the interpreter only !!! ***
-
-*/
-
 PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode,
                                            const char *errors)
 {
index 8c00b0ee1a10f2a4b38fe574810891559f855254..c9a5273c845c35ad40e00848910ec4f66829b4dc 100644 (file)
@@ -359,11 +359,6 @@ convertitem(PyObject *arg, char **p_format, va_list *p_va, int *levels,
 
 
 
-/* Internal API needed by convertsimple() and a helper macro. */
-extern 
-PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode,
-                                 const char *errors);
-
 #define UNICODE_DEFAULT_ENCODING(arg) \
         _PyUnicode_AsDefaultEncodedString(arg, NULL)