diff options
author | Marc-André Lemburg <mal@egenix.com> | 2008-08-07 18:54:33 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2008-08-07 18:54:33 (GMT) |
commit | 4cc0f24857c345ba99691b2ae6829c6ce3c0edcd (patch) | |
tree | cb4d437c9acb08f213376a499542f2e3bf81b8ad /Modules/_ctypes | |
parent | 28bd1a3bd5cf7f8c161bddb1735c4968fb9f6a8f (diff) | |
download | cpython-4cc0f24857c345ba99691b2ae6829c6ce3c0edcd.zip cpython-4cc0f24857c345ba99691b2ae6829c6ce3c0edcd.tar.gz cpython-4cc0f24857c345ba99691b2ae6829c6ce3c0edcd.tar.bz2 |
Rename PyUnicode_AsString -> _PyUnicode_AsString and
PyUnicode_AsStringAndSize -> _PyUnicode_AsStringAndSize to mark
them for interpreter internal use only.
We'll have to rework these APIs or create new ones for the
purpose of accessing the UTF-8 representation of Unicode objects
for 3.1.
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 18 | ||||
-rw-r--r-- | Modules/_ctypes/callproc.c | 2 | ||||
-rw-r--r-- | Modules/_ctypes/stgdict.c | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 48fe772..02a08a4 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -683,8 +683,8 @@ StructType_setattro(PyObject *self, PyObject *key, PyObject *value) return -1; if (value && PyUnicode_Check(key) && - /* XXX struni PyUnicode_AsString can fail (also in other places)! */ - 0 == strcmp(PyUnicode_AsString(key), "_fields_")) + /* XXX struni _PyUnicode_AsString can fail (also in other places)! */ + 0 == strcmp(_PyUnicode_AsString(key), "_fields_")) return StructUnionType_update_stgdict(self, value, 1); return 0; } @@ -698,7 +698,7 @@ UnionType_setattro(PyObject *self, PyObject *key, PyObject *value) return -1; if (PyUnicode_Check(key) && - 0 == strcmp(PyUnicode_AsString(key), "_fields_")) + 0 == strcmp(_PyUnicode_AsString(key), "_fields_")) return StructUnionType_update_stgdict(self, value, 0); return 0; } @@ -1681,7 +1681,7 @@ c_void_p_from_param(PyObject *type, PyObject *value) if (stgd && CDataObject_Check(value) && stgd->proto && PyUnicode_Check(stgd->proto)) { PyCArgObject *parg; - switch (PyUnicode_AsString(stgd->proto)[0]) { + switch (_PyUnicode_AsString(stgd->proto)[0]) { case 'z': /* c_char_p */ case 'Z': /* c_wchar_p */ parg = new_CArgObject(); @@ -1791,7 +1791,7 @@ SimpleType_paramfunc(CDataObject *self) dict = PyObject_stgdict((PyObject *)self); assert(dict); /* Cannot be NULL for CDataObject instances */ - fmt = PyUnicode_AsString(dict->proto); + fmt = _PyUnicode_AsString(dict->proto); assert(fmt); fd = getentry(fmt); @@ -2012,7 +2012,7 @@ SimpleType_from_param(PyObject *type, PyObject *value) assert(dict); /* I think we can rely on this being a one-character string */ - fmt = PyUnicode_AsString(dict->proto); + fmt = _PyUnicode_AsString(dict->proto); assert(fmt); fd = getentry(fmt); @@ -3058,7 +3058,7 @@ _check_outarg_type(PyObject *arg, Py_ssize_t index) /* simple pointer types, c_void_p, c_wchar_p, BSTR, ... */ && PyUnicode_Check(dict->proto) /* We only allow c_void_p, c_char_p and c_wchar_p as a simple output parameter type */ - && (strchr("PzZ", PyUnicode_AsString(dict->proto)[0]))) { + && (strchr("PzZ", _PyUnicode_AsString(dict->proto)[0]))) { return 1; } @@ -3148,7 +3148,7 @@ _get_name(PyObject *obj, char **pname) return *pname ? 1 : 0; } if (PyUnicode_Check(obj)) { - *pname = PyUnicode_AsString(obj); + *pname = _PyUnicode_AsString(obj); return *pname ? 1 : 0; } PyErr_SetString(PyExc_TypeError, @@ -5127,7 +5127,7 @@ cast_check_pointertype(PyObject *arg) dict = PyType_stgdict(arg); if (dict) { if (PyUnicode_Check(dict->proto) - && (strchr("sPzUZXO", PyUnicode_AsString(dict->proto)[0]))) { + && (strchr("sPzUZXO", _PyUnicode_AsString(dict->proto)[0]))) { /* simple pointer types, c_void_p, c_wchar_p, BSTR, ... */ return 1; } diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index d452785..6dced06 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1750,7 +1750,7 @@ POINTER(PyObject *self, PyObject *cls) return result; } if (PyUnicode_CheckExact(cls)) { - char *name = PyUnicode_AsString(cls); + char *name = _PyUnicode_AsString(cls); buf = alloca(strlen(name) + 3 + 1); sprintf(buf, "LP_%s", name); result = PyObject_CallFunction((PyObject *)Py_TYPE(&Pointer_Type), diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c index 085b19f..aac073f 100644 --- a/Modules/_ctypes/stgdict.c +++ b/Modules/_ctypes/stgdict.c @@ -479,7 +479,7 @@ StructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct) bitsize = 0; if (isStruct && !isPacked) { char *fieldfmt = dict->format ? dict->format : "B"; - char *fieldname = PyUnicode_AsString(name); + char *fieldname = _PyUnicode_AsString(name); char *ptr; Py_ssize_t len = strlen(fieldname) + strlen(fieldfmt); char *buf = alloca(len + 2 + 1); |