summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2008-08-07 18:54:33 +0000
committerMarc-André Lemburg <mal@egenix.com>2008-08-07 18:54:33 +0000
commit4cc0f24857c345ba99691b2ae6829c6ce3c0edcd (patch)
treecb4d437c9acb08f213376a499542f2e3bf81b8ad /Objects
parent28bd1a3bd5cf7f8c161bddb1735c4968fb9f6a8f (diff)
downloadcpython-git-4cc0f24857c345ba99691b2ae6829c6ce3c0edcd.tar.gz
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 'Objects')
-rw-r--r--Objects/bytesobject.c2
-rw-r--r--Objects/codeobject.c2
-rw-r--r--Objects/exceptions.c2
-rw-r--r--Objects/floatobject.c4
-rw-r--r--Objects/funcobject.c2
-rw-r--r--Objects/moduleobject.c8
-rw-r--r--Objects/object.c6
-rw-r--r--Objects/setobject.c2
-rw-r--r--Objects/structseq.c2
-rw-r--r--Objects/typeobject.c12
-rw-r--r--Objects/unicodeobject.c6
-rw-r--r--Objects/weakrefobject.c2
12 files changed, 25 insertions, 25 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index eeae0ff589..7c1469c1a9 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -3230,7 +3230,7 @@ _PyBytes_FormatLong(PyObject *val, int flags, int prec, int type,
if (!result)
return NULL;
- buf = PyUnicode_AsString(result);
+ buf = _PyUnicode_AsString(result);
if (!buf) {
Py_DECREF(result);
return NULL;
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index cb8f3e430a..01a637aa6d 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -296,7 +296,7 @@ code_repr(PyCodeObject *co)
if (co->co_firstlineno != 0)
lineno = co->co_firstlineno;
if (co->co_filename && PyUnicode_Check(co->co_filename))
- filename = PyUnicode_AsString(co->co_filename);
+ filename = _PyUnicode_AsString(co->co_filename);
return PyUnicode_FromFormat(
"<code object %.100U at %p, file \"%.300s\", line %d>",
co->co_name, co, filename, lineno);
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 02a55c1254..52869cbb67 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -943,7 +943,7 @@ SyntaxError_str(PySyntaxErrorObject *self)
lineno here */
if (self->filename && PyUnicode_Check(self->filename)) {
- filename = PyUnicode_AsString(self->filename);
+ filename = _PyUnicode_AsString(self->filename);
}
have_lineno = (self->lineno != NULL) && PyLong_CheckExact(self->lineno);
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index efad21250c..4478168a46 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1229,7 +1229,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
* exp+4*ndigits and exp-4*ndigits are within the range of a long.
*/
- s = PyUnicode_AsStringAndSize(arg, &length);
+ s = _PyUnicode_AsStringAndSize(arg, &length);
if (s == NULL)
return NULL;
s_end = s + length;
@@ -1597,7 +1597,7 @@ float_getformat(PyTypeObject *v, PyObject* arg)
Py_TYPE(arg)->tp_name);
return NULL;
}
- s = PyUnicode_AsString(arg);
+ s = _PyUnicode_AsString(arg);
if (s == NULL)
return NULL;
if (strcmp(s, "double") == 0) {
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index fddb120bc7..594e524a81 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -297,7 +297,7 @@ func_set_code(PyFunctionObject *op, PyObject *value)
PyErr_Format(PyExc_ValueError,
"%s() requires a code object with %zd free vars,"
" not %zd",
- PyUnicode_AsString(op->func_name),
+ _PyUnicode_AsString(op->func_name),
nclosure, nfree);
return -1;
}
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 228ffeeae1..ae01651297 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -187,7 +187,7 @@ PyModule_GetName(PyObject *m)
PyErr_SetString(PyExc_SystemError, "nameless module");
return NULL;
}
- return PyUnicode_AsString(nameobj);
+ return _PyUnicode_AsString(nameobj);
}
const char *
@@ -207,7 +207,7 @@ PyModule_GetFilename(PyObject *m)
PyErr_SetString(PyExc_SystemError, "module filename missing");
return NULL;
}
- return PyUnicode_AsString(fileobj);
+ return _PyUnicode_AsString(fileobj);
}
PyModuleDef*
@@ -252,7 +252,7 @@ _PyModule_Clear(PyObject *m)
pos = 0;
while (PyDict_Next(d, &pos, &key, &value)) {
if (value != Py_None && PyUnicode_Check(key)) {
- const char *s = PyUnicode_AsString(key);
+ const char *s = _PyUnicode_AsString(key);
if (s[0] == '_' && s[1] != '_') {
if (Py_VerboseFlag > 1)
PySys_WriteStderr("# clear[1] %s\n", s);
@@ -265,7 +265,7 @@ _PyModule_Clear(PyObject *m)
pos = 0;
while (PyDict_Next(d, &pos, &key, &value)) {
if (value != Py_None && PyUnicode_Check(key)) {
- const char *s = PyUnicode_AsString(key);
+ const char *s = _PyUnicode_AsString(key);
if (s[0] != '_' || strcmp(s, "__builtins__") != 0) {
if (Py_VerboseFlag > 1)
PySys_WriteStderr("# clear[2] %s\n", s);
diff --git a/Objects/object.c b/Objects/object.c
index ff16994e65..79f8288a4f 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -856,7 +856,7 @@ PyObject_GetAttr(PyObject *v, PyObject *name)
if (tp->tp_getattro != NULL)
return (*tp->tp_getattro)(v, name);
if (tp->tp_getattr != NULL)
- return (*tp->tp_getattr)(v, PyUnicode_AsString(name));
+ return (*tp->tp_getattr)(v, _PyUnicode_AsString(name));
PyErr_Format(PyExc_AttributeError,
"'%.50s' object has no attribute '%U'",
tp->tp_name, name);
@@ -896,7 +896,7 @@ PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value)
return err;
}
if (tp->tp_setattr != NULL) {
- err = (*tp->tp_setattr)(v, PyUnicode_AsString(name), value);
+ err = (*tp->tp_setattr)(v, _PyUnicode_AsString(name), value);
Py_DECREF(name);
return err;
}
@@ -1062,7 +1062,7 @@ PyObject_GenericGetAttr(PyObject *obj, PyObject *name)
PyErr_Format(PyExc_AttributeError,
"'%.50s' object has no attribute '%.400s'",
- tp->tp_name, PyUnicode_AsString(name));
+ tp->tp_name, _PyUnicode_AsString(name));
done:
Py_DECREF(name);
return res;
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 771f47efea..10541662b6 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -2390,7 +2390,7 @@ test_c_api(PySetObject *so)
/* Exercise direct iteration */
i = 0, count = 0;
while (_PySet_NextEntry((PyObject *)dup, &i, &x, &hash)) {
- s = PyUnicode_AsString(x);
+ s = _PyUnicode_AsString(x);
assert(s && (s[0] == 'a' || s[0] == 'b' || s[0] == 'c'));
count++;
}
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 56e885c8c3..091370c9ad 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -270,7 +270,7 @@ structseq_repr(PyStructSequence *obj)
Py_DECREF(tup);
return NULL;
}
- crepr = PyUnicode_AsString(repr);
+ crepr = _PyUnicode_AsString(repr);
if (crepr == NULL) {
Py_DECREF(tup);
Py_DECREF(repr);
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 9306552a6a..616164e1ce 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -258,7 +258,7 @@ type_set_name(PyTypeObject *type, PyObject *value, void *context)
}
Py_DECREF(tmp);
- tp_name = PyUnicode_AsString(value);
+ tp_name = _PyUnicode_AsString(value);
if (tp_name == NULL)
return -1;
@@ -1255,7 +1255,7 @@ check_duplicates(PyObject *list)
o = class_name(o);
PyErr_Format(PyExc_TypeError,
"duplicate base class %.400s",
- o ? PyUnicode_AsString(o) : "?");
+ o ? _PyUnicode_AsString(o) : "?");
Py_XDECREF(o);
return -1;
}
@@ -1301,7 +1301,7 @@ consistent method resolution\norder (MRO) for bases");
while (PyDict_Next(set, &i, &k, &v) && (size_t)off < sizeof(buf)) {
PyObject *name = class_name(k);
off += PyOS_snprintf(buf + off, sizeof(buf) - off, " %s",
- name ? PyUnicode_AsString(name) : "?");
+ name ? _PyUnicode_AsString(name) : "?");
Py_XDECREF(name);
if (--n && (size_t)(off+1) < sizeof(buf)) {
buf[off++] = ',';
@@ -2094,7 +2094,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
type->tp_as_sequence = &et->as_sequence;
type->tp_as_mapping = &et->as_mapping;
type->tp_as_buffer = &et->as_buffer;
- type->tp_name = PyUnicode_AsString(name);
+ type->tp_name = _PyUnicode_AsString(name);
if (!type->tp_name) {
Py_DECREF(type);
return NULL;
@@ -2136,7 +2136,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
char *doc_str;
char *tp_doc;
- doc_str = PyUnicode_AsStringAndSize(doc, &len);
+ doc_str = _PyUnicode_AsStringAndSize(doc, &len);
if (doc_str == NULL) {
Py_DECREF(type);
return NULL;
@@ -2175,7 +2175,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
slotoffset = base->tp_basicsize;
if (slots != NULL) {
for (i = 0; i < nslots; i++, mp++) {
- mp->name = PyUnicode_AsString(
+ mp->name = _PyUnicode_AsString(
PyTuple_GET_ITEM(slots, i));
mp->type = T_OBJECT_EX;
mp->offset = slotoffset;
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 5925f8077f..5bf0fa2885 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1452,7 +1452,7 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
}
char*
-PyUnicode_AsStringAndSize(PyObject *unicode, Py_ssize_t *psize)
+_PyUnicode_AsStringAndSize(PyObject *unicode, Py_ssize_t *psize)
{
PyObject *bytes;
if (!PyUnicode_Check(unicode)) {
@@ -1468,9 +1468,9 @@ PyUnicode_AsStringAndSize(PyObject *unicode, Py_ssize_t *psize)
}
char*
-PyUnicode_AsString(PyObject *unicode)
+_PyUnicode_AsString(PyObject *unicode)
{
- return PyUnicode_AsStringAndSize(unicode, NULL);
+ return _PyUnicode_AsStringAndSize(unicode, NULL);
}
Py_UNICODE *PyUnicode_AsUnicode(PyObject *unicode)
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index 6ceed73de9..83e63fc4f5 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -167,7 +167,7 @@ weakref_repr(PyWeakReference *self)
if (nameobj == NULL)
PyErr_Clear();
else if (PyUnicode_Check(nameobj))
- name = PyUnicode_AsString(nameobj);
+ name = _PyUnicode_AsString(nameobj);
PyOS_snprintf(buffer, sizeof(buffer),
name ? "<weakref at %p; to '%.50s' at %p (%s)>"
: "<weakref at %p; to '%.50s' at %p>",