summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2008-08-07 18:54:33 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2008-08-07 18:54:33 (GMT)
commit4cc0f24857c345ba99691b2ae6829c6ce3c0edcd (patch)
treecb4d437c9acb08f213376a499542f2e3bf81b8ad /Modules/_sqlite
parent28bd1a3bd5cf7f8c161bddb1735c4968fb9f6a8f (diff)
downloadcpython-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/_sqlite')
-rw-r--r--Modules/_sqlite/connection.c8
-rw-r--r--Modules/_sqlite/cursor.c4
-rw-r--r--Modules/_sqlite/row.c4
-rw-r--r--Modules/_sqlite/statement.c6
4 files changed, 11 insertions, 11 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 1e52918..7b931c0 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -434,7 +434,7 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
} else if (PyFloat_Check(py_val)) {
sqlite3_result_double(context, PyFloat_AsDouble(py_val));
} else if (PyUnicode_Check(py_val)) {
- sqlite3_result_text(context, PyUnicode_AsString(py_val), -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(context, _PyUnicode_AsString(py_val), -1, SQLITE_TRANSIENT);
} else if (PyObject_CheckBuffer(py_val)) {
if (PyObject_AsCharBuffer(py_val, &buffer, &buflen) != 0) {
PyErr_SetString(PyExc_ValueError, "could not convert BLOB to buffer");
@@ -901,7 +901,7 @@ static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, Py
return -1;
}
- statement = PyUnicode_AsStringAndSize(begin_statement, &size);
+ statement = _PyUnicode_AsStringAndSize(begin_statement, &size);
if (!statement) {
Py_DECREF(statement);
return -1;
@@ -1194,7 +1194,7 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args)
goto finally;
}
- chk = PyUnicode_AsString(uppercase_name);
+ chk = _PyUnicode_AsString(uppercase_name);
while (*chk) {
if ((*chk >= '0' && *chk <= '9')
|| (*chk >= 'A' && *chk <= 'Z')
@@ -1219,7 +1219,7 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args)
}
rc = sqlite3_create_collation(self->db,
- PyUnicode_AsString(uppercase_name),
+ _PyUnicode_AsString(uppercase_name),
SQLITE_UTF8,
(callable != Py_None) ? callable : NULL,
(callable != Py_None) ? pysqlite_collation_callback : NULL);
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 14dd002..9ac25f5 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -490,7 +490,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
rc = pysqlite_statement_reset(self->statement);
}
- operation_cstr = PyUnicode_AsStringAndSize(operation, &operation_len);
+ operation_cstr = _PyUnicode_AsStringAndSize(operation, &operation_len);
if (operation == NULL)
goto error;
@@ -793,7 +793,7 @@ PyObject* pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
}
if (PyUnicode_Check(script_obj)) {
- script_cstr = PyUnicode_AsString(script_obj);
+ script_cstr = _PyUnicode_AsString(script_obj);
if (!script_cstr) {
return NULL;
}
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index 008f19e..8778af0 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -82,12 +82,12 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
Py_XINCREF(item);
return item;
} else if (PyUnicode_Check(idx)) {
- key = PyUnicode_AsString(idx);
+ key = _PyUnicode_AsString(idx);
nitems = PyTuple_Size(self->description);
for (i = 0; i < nitems; i++) {
- compare_key = PyUnicode_AsString(PyTuple_GET_ITEM(PyTuple_GET_ITEM(self->description, i), 0));
+ compare_key = _PyUnicode_AsString(PyTuple_GET_ITEM(PyTuple_GET_ITEM(self->description, i), 0));
if (!compare_key) {
return NULL;
}
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index fb1eec7..d2f3c1e 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -59,7 +59,7 @@ int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* con
self->st = NULL;
self->in_use = 0;
- sql_cstr = PyUnicode_AsStringAndSize(sql, &sql_cstr_len);
+ sql_cstr = _PyUnicode_AsStringAndSize(sql, &sql_cstr_len);
if (sql_cstr == NULL) {
rc = PYSQLITE_SQL_WRONG_TYPE;
return rc;
@@ -140,7 +140,7 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec
rc = sqlite3_bind_double(self->st, pos, PyFloat_AsDouble(parameter));
break;
case TYPE_UNICODE:
- string = PyUnicode_AsString(parameter);
+ string = _PyUnicode_AsString(parameter);
rc = sqlite3_bind_text(self->st, pos, string, -1, SQLITE_TRANSIENT);
break;
case TYPE_BUFFER:
@@ -296,7 +296,7 @@ int pysqlite_statement_recompile(pysqlite_Statement* self, PyObject* params)
Py_ssize_t sql_len;
sqlite3_stmt* new_st;
- sql_cstr = PyUnicode_AsStringAndSize(self->sql, &sql_len);
+ sql_cstr = _PyUnicode_AsStringAndSize(self->sql, &sql_len);
if (sql_cstr == NULL) {
rc = PYSQLITE_SQL_WRONG_TYPE;
return rc;