diff --git a/psycopg/adapter_asis.c b/psycopg/adapter_asis.c index d3171228..07644cc4 100644 --- a/psycopg/adapter_asis.c +++ b/psycopg/adapter_asis.c @@ -60,7 +60,7 @@ asis_getquoted(asisObject *self, PyObject *args) static PyObject * asis_str(asisObject *self) { - return psycopg_ensure_text(asis_getquoted(self, NULL)); + return psyco_ensure_text(asis_getquoted(self, NULL)); } static PyObject * diff --git a/psycopg/adapter_binary.c b/psycopg/adapter_binary.c index f0a6738e..e4c1b241 100644 --- a/psycopg/adapter_binary.c +++ b/psycopg/adapter_binary.c @@ -132,7 +132,7 @@ binary_getquoted(binaryObject *self, PyObject *args) static PyObject * binary_str(binaryObject *self) { - return psycopg_ensure_text(binary_getquoted(self, NULL)); + return psyco_ensure_text(binary_getquoted(self, NULL)); } static PyObject * diff --git a/psycopg/adapter_datetime.c b/psycopg/adapter_datetime.c index 663338f3..01b12d11 100644 --- a/psycopg/adapter_datetime.c +++ b/psycopg/adapter_datetime.c @@ -76,7 +76,7 @@ _pydatetime_string_date_time(pydatetimeObject *self) break; } - if (!(iso = psycopg_ensure_bytes( + if (!(iso = psyco_ensure_bytes( PyObject_CallMethod(self->wrapped, "isoformat", NULL)))) { goto error; } @@ -126,7 +126,7 @@ pydatetime_getquoted(pydatetimeObject *self, PyObject *args) static PyObject * pydatetime_str(pydatetimeObject *self) { - return psycopg_ensure_text(pydatetime_getquoted(self, NULL)); + return psyco_ensure_text(pydatetime_getquoted(self, NULL)); } static PyObject * diff --git a/psycopg/adapter_list.c b/psycopg/adapter_list.c index 7b93d636..f8c16040 100644 --- a/psycopg/adapter_list.c +++ b/psycopg/adapter_list.c @@ -165,7 +165,7 @@ exit: static PyObject * list_str(listObject *self) { - return psycopg_ensure_text(list_quote(self)); + return psyco_ensure_text(list_quote(self)); } static PyObject * diff --git a/psycopg/adapter_pboolean.c b/psycopg/adapter_pboolean.c index 9e3ea7d4..2d6c4f51 100644 --- a/psycopg/adapter_pboolean.c +++ b/psycopg/adapter_pboolean.c @@ -48,7 +48,7 @@ pboolean_getquoted(pbooleanObject *self, PyObject *args) static PyObject * pboolean_str(pbooleanObject *self) { - return psycopg_ensure_text(pboolean_getquoted(self, NULL)); + return psyco_ensure_text(pboolean_getquoted(self, NULL)); } static PyObject * diff --git a/psycopg/adapter_pdecimal.c b/psycopg/adapter_pdecimal.c index efd72a8f..2712964e 100644 --- a/psycopg/adapter_pdecimal.c +++ b/psycopg/adapter_pdecimal.c @@ -113,7 +113,7 @@ end: static PyObject * pdecimal_str(pdecimalObject *self) { - return psycopg_ensure_text(pdecimal_getquoted(self, NULL)); + return psyco_ensure_text(pdecimal_getquoted(self, NULL)); } static PyObject * diff --git a/psycopg/adapter_pfloat.c b/psycopg/adapter_pfloat.c index 5ddbe3f4..44bf5f7f 100644 --- a/psycopg/adapter_pfloat.c +++ b/psycopg/adapter_pfloat.c @@ -86,7 +86,7 @@ exit: static PyObject * pfloat_str(pfloatObject *self) { - return psycopg_ensure_text(pfloat_getquoted(self, NULL)); + return psyco_ensure_text(pfloat_getquoted(self, NULL)); } static PyObject * diff --git a/psycopg/adapter_pint.c b/psycopg/adapter_pint.c index 950b6557..6023ae05 100644 --- a/psycopg/adapter_pint.c +++ b/psycopg/adapter_pint.c @@ -91,7 +91,7 @@ exit: static PyObject * pint_str(pintObject *self) { - return psycopg_ensure_text(pint_getquoted(self, NULL)); + return psyco_ensure_text(pint_getquoted(self, NULL)); } static PyObject * diff --git a/psycopg/adapter_qstring.c b/psycopg/adapter_qstring.c index 9b067046..302e5156 100644 --- a/psycopg/adapter_qstring.c +++ b/psycopg/adapter_qstring.c @@ -73,7 +73,7 @@ qstring_quote(qstringObject *self) /* encode the string into buffer */ Bytes_AsStringAndSize(str, &s, &len); - if (!(buffer = psycopg_escape_string(self->conn, s, len, NULL, &qlen))) { + if (!(buffer = psyco_escape_string(self->conn, s, len, NULL, &qlen))) { goto exit; } @@ -107,7 +107,7 @@ qstring_getquoted(qstringObject *self, PyObject *args) static PyObject * qstring_str(qstringObject *self) { - return psycopg_ensure_text(qstring_getquoted(self, NULL)); + return psyco_ensure_text(qstring_getquoted(self, NULL)); } static PyObject * @@ -161,9 +161,9 @@ qstring_set_encoding(qstringObject *self, PyObject *pyenc) /* get a C copy of the encoding (which may come from unicode) */ Py_INCREF(pyenc); - if (!(pyenc = psycopg_ensure_bytes(pyenc))) { goto exit; } + if (!(pyenc = psyco_ensure_bytes(pyenc))) { goto exit; } if (!(tmp = Bytes_AsString(pyenc))) { goto exit; } - if (0 > psycopg_strdup(&cenc, tmp, -1)) { goto exit; } + if (0 > psyco_strdup(&cenc, tmp, -1)) { goto exit; } Dprintf("qstring_set_encoding: encoding set to %s", cenc); PyMem_Free((void *)self->encoding); diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c index ad17e450..1f4115dd 100644 --- a/psycopg/connection_int.c +++ b/psycopg/connection_int.c @@ -79,7 +79,7 @@ const int SRV_STATE_UNCHANGED = -1; PyObject * conn_text_from_chars(connectionObject *self, const char *str) { - return psycopg_text_from_chars_safe(str, -1, self ? self->pydecoder : NULL); + return psyco_text_from_chars_safe(str, -1, self ? self->pydecoder : NULL); } @@ -478,7 +478,7 @@ conn_get_python_codec(const char *encoding, /* get the Python name of the encoding as a C string */ if (!(encname = conn_pgenc_to_pyenc(encoding, &pgenc))) { goto exit; } - if (!(encname = psycopg_ensure_bytes(encname))) { goto exit; } + if (!(encname = psyco_ensure_bytes(encname))) { goto exit; } /* Look up the codec functions */ if (!(enc_tmp = PyCodec_Encoder(Bytes_AS_STRING(encname)))) { goto exit; } @@ -1424,7 +1424,7 @@ conn_tpc_command(connectionObject *self, const char *cmd, xidObject *xid) Dprintf("conn_tpc_command: %s", cmd); /* convert the xid into PostgreSQL transaction id while keeping the GIL */ - if (!(tid = psycopg_ensure_bytes(xid_get_tid(xid)))) { goto exit; } + if (!(tid = psyco_ensure_bytes(xid_get_tid(xid)))) { goto exit; } if (!(ctid = Bytes_AsString(tid))) { goto exit; } Py_BEGIN_ALLOW_THREADS; diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index 18ddb66c..bffa8fba 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -478,7 +478,7 @@ _psyco_conn_parse_isolevel(PyObject *pyval) /* parse from the string -- this includes "default" */ else { - if (!(pyval = psycopg_ensure_bytes(pyval))) { + if (!(pyval = psyco_ensure_bytes(pyval))) { goto exit; } for (level = 1; level <= 4; level++) { @@ -516,7 +516,7 @@ _psyco_conn_parse_onoff(PyObject *pyval) rv = STATE_DEFAULT; } else if (PyUnicode_CheckExact(pyval) || Bytes_CheckExact(pyval)) { - if (!(pyval = psycopg_ensure_bytes(pyval))) { + if (!(pyval = psyco_ensure_bytes(pyval))) { goto exit; } if (0 == strcasecmp("default", Bytes_AS_STRING(pyval))) { @@ -918,7 +918,7 @@ psyco_conn_get_dsn_parameters(connectionObject *self, PyObject *dummy) goto exit; } - res = psycopg_dict_from_conninfo_options(options, /* include_password = */ 0); + res = psyco_dict_from_conninfo_options(options, /* include_password = */ 0); exit: PQconninfoFree(options); @@ -1314,7 +1314,7 @@ obscure_password(connectionObject *conn) return 0; } - if (!(d = psycopg_dict_from_conninfo_options( + if (!(d = psyco_dict_from_conninfo_options( options, /* include_password = */ 1))) { goto exit; } @@ -1327,12 +1327,12 @@ obscure_password(connectionObject *conn) /* scrub the password and put back the connection string together */ if (!(v = Text_FromUTF8("xxx"))) { goto exit; } if (0 > PyDict_SetItemString(d, "password", v)) { goto exit; } - if (!(dsn = psycopg_make_dsn(Py_None, d))) { goto exit; } - if (!(dsn = psycopg_ensure_bytes(dsn))) { goto exit; } + if (!(dsn = psyco_make_dsn(Py_None, d))) { goto exit; } + if (!(dsn = psyco_ensure_bytes(dsn))) { goto exit; } /* Replace the connection string on the connection object */ tmp = conn->dsn; - psycopg_strdup(&conn->dsn, Bytes_AS_STRING(dsn), -1); + psyco_strdup(&conn->dsn, Bytes_AS_STRING(dsn), -1); PyMem_Free(tmp); rv = 0; @@ -1356,7 +1356,7 @@ connection_setup(connectionObject *self, const char *dsn, long int async) self, async, Py_REFCNT(self) ); - if (0 > psycopg_strdup(&self->dsn, dsn, -1)) { goto exit; } + if (0 > psyco_strdup(&self->dsn, dsn, -1)) { goto exit; } if (!(self->notice_list = PyList_New(0))) { goto exit; } if (!(self->notifies = PyList_New(0))) { goto exit; } self->async = async; diff --git a/psycopg/conninfo_type.c b/psycopg/conninfo_type.c index a74e7922..0e847bef 100644 --- a/psycopg/conninfo_type.c +++ b/psycopg/conninfo_type.c @@ -193,7 +193,7 @@ dsn_parameters_get(connInfoObject *self) goto exit; } - res = psycopg_dict_from_conninfo_options(options, /* include_password = */ 0); + res = psyco_dict_from_conninfo_options(options, /* include_password = */ 0); exit: PQconninfoFree(options); diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index c9b49800..99486a1c 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -86,7 +86,7 @@ curs_close(cursorObject *self, PyObject *dummy) * closing it (the view exists since PG 8.2 according to docs). */ if (!self->query && self->conn->server_version >= 80200) { - if (!(lname = psycopg_escape_string( + if (!(lname = psyco_escape_string( self->conn, self->name, -1, NULL, NULL))) { goto exit; } @@ -1059,10 +1059,10 @@ curs_callproc(cursorObject *self, PyObject *args) Py_INCREF(pname); /* was borrowed */ /* this also makes a check for keys being strings */ - if (!(pname = psycopg_ensure_bytes(pname))) { goto exit; } + if (!(pname = psyco_ensure_bytes(pname))) { goto exit; } if (!(cpname = Bytes_AsString(pname))) { goto exit; } - if (!(scpnames[i] = psycopg_escape_identifier( + if (!(scpnames[i] = psyco_escape_identifier( self->conn, cpname, -1))) { Py_CLEAR(pname); goto exit; @@ -1332,7 +1332,7 @@ static char *_psyco_curs_copy_columns(PyObject *columns) columnlist[0] = '('; while ((col = PyIter_Next(coliter)) != NULL) { - if (!(col = psycopg_ensure_bytes(col))) { + if (!(col = psyco_ensure_bytes(col))) { Py_DECREF(coliter); goto error; } @@ -1423,12 +1423,12 @@ curs_copy_from(cursorObject *self, PyObject *args, PyObject *kwargs) if (NULL == (columnlist = _psyco_curs_copy_columns(columns))) goto exit; - if (!(quoted_delimiter = psycopg_escape_string( + if (!(quoted_delimiter = psyco_escape_string( self->conn, sep, -1, NULL, NULL))) { goto exit; } - if (!(quoted_null = psycopg_escape_string( + if (!(quoted_null = psyco_escape_string( self->conn, null, -1, NULL, NULL))) { goto exit; } @@ -1515,12 +1515,12 @@ curs_copy_to(cursorObject *self, PyObject *args, PyObject *kwargs) if (NULL == (columnlist = _psyco_curs_copy_columns(columns))) goto exit; - if (!(quoted_delimiter = psycopg_escape_string( + if (!(quoted_delimiter = psyco_escape_string( self->conn, sep, -1, NULL, NULL))) { goto exit; } - if (!(quoted_null = psycopg_escape_string( + if (!(quoted_null = psyco_escape_string( self->conn, null, -1, NULL, NULL))) { goto exit; } @@ -1874,10 +1874,10 @@ cursor_setup(cursorObject *self, connectionObject *conn, const char *name) Dprintf("cursor_setup: parameters: name = %s, conn = %p", name, conn); if (name) { - if (0 > psycopg_strdup(&self->name, name, -1)) { + if (0 > psyco_strdup(&self->name, name, -1)) { return -1; } - if (!(self->qname = psycopg_escape_identifier(conn, name, -1))) { + if (!(self->qname = psyco_escape_identifier(conn, name, -1))) { return -1; } } @@ -1982,7 +1982,7 @@ cursor_init(PyObject *obj, PyObject *args, PyObject *kwargs) if (name != Py_None) { Py_INCREF(name); /* for ensure_bytes */ - if (!(bname = psycopg_ensure_bytes(name))) { + if (!(bname = psyco_ensure_bytes(name))) { /* name has had a ref stolen */ goto exit; } diff --git a/psycopg/error_type.c b/psycopg/error_type.c index 226ba18e..bf5894ca 100644 --- a/psycopg/error_type.c +++ b/psycopg/error_type.c @@ -34,7 +34,7 @@ PyObject * error_text_from_chars(errorObject *self, const char *str) { - return psycopg_text_from_chars_safe(str, -1, self->pydecoder); + return psyco_text_from_chars_safe(str, -1, self->pydecoder); } diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 843b57df..3aca0ed9 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -657,7 +657,7 @@ pq_tpc_command_locked( PyEval_RestoreThread(*tstate); /* convert the xid into the postgres transaction_id and quote it. */ - if (!(etid = psycopg_escape_string(conn, tid, -1, NULL, NULL))) + if (!(etid = psyco_escape_string(conn, tid, -1, NULL, NULL))) { goto exit; } /* prepare the command to the server */ @@ -1298,7 +1298,7 @@ _pq_copy_in_v3(cursorObject *curs) if (ex) { PyObject *str; str = PyObject_Str(ex); - str = psycopg_ensure_bytes(str); + str = psyco_ensure_bytes(str); if (str) { PyOS_snprintf(buf, sizeof(buf), "error in .read() call: %s %s", @@ -1374,7 +1374,7 @@ _pq_copy_out_v3(cursorObject *curs) } /* if the file is text we must pass it unicode. */ - if (-1 == (is_text = psycopg_is_text_file(curs->copyfile))) { + if (-1 == (is_text = psyco_is_text_file(curs->copyfile))) { goto exit; } diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c index b66d8078..0dde27ce 100644 --- a/psycopg/psycopgmodule.c +++ b/psycopg/psycopgmodule.c @@ -136,7 +136,7 @@ parse_dsn(PyObject *self, PyObject *args, PyObject *kwargs) } Py_INCREF(dsn); /* for ensure_bytes */ - if (!(dsn = psycopg_ensure_bytes(dsn))) { goto exit; } + if (!(dsn = psyco_ensure_bytes(dsn))) { goto exit; } options = PQconninfoParse(Bytes_AS_STRING(dsn), &err); if (options == NULL) { @@ -149,7 +149,7 @@ parse_dsn(PyObject *self, PyObject *args, PyObject *kwargs) goto exit; } - res = psycopg_dict_from_conninfo_options(options, /* include_password = */ 1); + res = psyco_dict_from_conninfo_options(options, /* include_password = */ 1); exit: PQconninfoFree(options); /* safe on null */ @@ -190,9 +190,9 @@ quote_ident(PyObject *self, PyObject *args, PyObject *kwargs) } Py_INCREF(ident); /* for ensure_bytes */ - if (!(ident = psycopg_ensure_bytes(ident))) { goto exit; } + if (!(ident = psyco_ensure_bytes(ident))) { goto exit; } - if (!(quoted = psycopg_escape_identifier(conn, + if (!(quoted = psyco_escape_identifier(conn, Bytes_AS_STRING(ident), Bytes_GET_SIZE(ident)))) { goto exit; } result = conn_text_from_chars(conn, quoted); @@ -453,10 +453,10 @@ encrypt_password(PyObject *self, PyObject *args, PyObject *kwargs) } } - if (!(user = psycopg_ensure_bytes(user))) { goto exit; } - if (!(password = psycopg_ensure_bytes(password))) { goto exit; } + if (!(user = psyco_ensure_bytes(user))) { goto exit; } + if (!(password = psyco_ensure_bytes(password))) { goto exit; } if (algorithm != Py_None) { - if (!(algorithm = psycopg_ensure_bytes(algorithm))) { + if (!(algorithm = psyco_ensure_bytes(algorithm))) { goto exit; } } diff --git a/psycopg/replication_connection_type.c b/psycopg/replication_connection_type.c index 686a6a27..0a836a9a 100644 --- a/psycopg/replication_connection_type.c +++ b/psycopg/replication_connection_type.c @@ -97,7 +97,7 @@ replicationConnection_init(replicationConnectionObject *self, goto exit; } - if (!(newdsn = psycopg_make_dsn(dsn, dsnopts))) { goto exit; } + if (!(newdsn = psyco_make_dsn(dsn, dsnopts))) { goto exit; } if (!(newargs = PyTuple_Pack(2, newdsn, async))) { goto exit; } /* only attempt the connection once we've handled all possible errors */ diff --git a/psycopg/typecast.c b/psycopg/typecast.c index 11ad5b63..1aab80f0 100644 --- a/psycopg/typecast.c +++ b/psycopg/typecast.c @@ -435,7 +435,7 @@ typecast_repr(PyObject *self) PyObject *rv; Py_INCREF(name); - if (!(name = psycopg_ensure_bytes(name))) { + if (!(name = psyco_ensure_bytes(name))) { return NULL; } diff --git a/psycopg/typecast_basic.c b/psycopg/typecast_basic.c index 6179b1f7..0f0fb929 100644 --- a/psycopg/typecast_basic.c +++ b/psycopg/typecast_basic.c @@ -141,7 +141,7 @@ typecast_DECIMAL_cast(const char *s, Py_ssize_t len, PyObject *curs) if ((buffer = PyMem_Malloc(len+1)) == NULL) return PyErr_NoMemory(); strncpy(buffer, s, (size_t) len); buffer[len] = '\0'; - decimalType = psyco_GetDecimalType(); + decimalType = psyco_get_decimal_type(); /* Fall back on float if decimal is not available */ if (decimalType != NULL) { res = PyObject_CallFunction(decimalType, "s", buffer); diff --git a/psycopg/utils.c b/psycopg/utils.c index d91283ec..eb24358e 100644 --- a/psycopg/utils.c +++ b/psycopg/utils.c @@ -48,7 +48,7 @@ * including quotes. */ char * -psycopg_escape_string(connectionObject *conn, const char *from, Py_ssize_t len, +psyco_escape_string(connectionObject *conn, const char *from, Py_ssize_t len, char *to, Py_ssize_t *tolen) { Py_ssize_t ql; @@ -102,7 +102,7 @@ psycopg_escape_string(connectionObject *conn, const char *from, Py_ssize_t len, * In case of error set a Python exception. */ char * -psycopg_escape_identifier(connectionObject *conn, const char *str, Py_ssize_t len) +psyco_escape_identifier(connectionObject *conn, const char *str, Py_ssize_t len) { char *rv = NULL; @@ -139,7 +139,7 @@ exit: * If from is null, store null into to. */ RAISES_NEG int -psycopg_strdup(char **to, const char *from, Py_ssize_t len) +psyco_strdup(char **to, const char *from, Py_ssize_t len) { if (!from) { *to = NULL; @@ -165,7 +165,7 @@ psycopg_strdup(char **to, const char *from, Py_ssize_t len) * It is safe to call the function on NULL. */ STEALS(1) PyObject * -psycopg_ensure_bytes(PyObject *obj) +psyco_ensure_bytes(PyObject *obj) { PyObject *rv = NULL; if (!obj) { return NULL; } @@ -195,7 +195,7 @@ psycopg_ensure_bytes(PyObject *obj) * return value. It is safe to call it on NULL. */ STEALS(1) PyObject * -psycopg_ensure_text(PyObject *obj) +psyco_ensure_text(PyObject *obj) { #if PY_2 return obj; @@ -217,7 +217,7 @@ psycopg_ensure_text(PyObject *obj) * Return 1 if it does, else 0, -1 on errors. */ int -psycopg_is_text_file(PyObject *f) +psyco_is_text_file(PyObject *f) { /* NULL before any call. * then io.TextIOBase if exists, else None. */ @@ -226,16 +226,16 @@ psycopg_is_text_file(PyObject *f) /* Try to import os.TextIOBase */ if (NULL == base) { PyObject *m; - Dprintf("psycopg_is_text_file: importing io.TextIOBase"); + Dprintf("psyco_is_text_file: importing io.TextIOBase"); if (!(m = PyImport_ImportModule("io"))) { - Dprintf("psycopg_is_text_file: io module not found"); + Dprintf("psyco_is_text_file: io module not found"); PyErr_Clear(); Py_INCREF(Py_None); base = Py_None; } else { if (!(base = PyObject_GetAttrString(m, "TextIOBase"))) { - Dprintf("psycopg_is_text_file: io.TextIOBase not found"); + Dprintf("psyco_is_text_file: io.TextIOBase not found"); PyErr_Clear(); Py_INCREF(Py_None); base = Py_None; @@ -253,7 +253,7 @@ psycopg_is_text_file(PyObject *f) /* Make a dict out of PQconninfoOption array */ PyObject * -psycopg_dict_from_conninfo_options(PQconninfoOption *options, int include_password) +psyco_dict_from_conninfo_options(PQconninfoOption *options, int include_password) { PyObject *dict, *res = NULL; PQconninfoOption *o; @@ -287,7 +287,7 @@ exit: * Helper to call psycopg2.extensions.make_dsn() */ PyObject * -psycopg_make_dsn(PyObject *dsn, PyObject *kwargs) +psyco_make_dsn(PyObject *dsn, PyObject *kwargs) { PyObject *ext = NULL, *make_dsn = NULL; PyObject *args = NULL, *rv = NULL; @@ -314,7 +314,7 @@ exit: * len is optional: use -1 to have it calculated by the function. */ PyObject * -psycopg_text_from_chars_safe(const char *str, Py_ssize_t len, PyObject *decoder) +psyco_text_from_chars_safe(const char *str, Py_ssize_t len, PyObject *decoder) { #if PY_2 @@ -430,7 +430,7 @@ psyco_is_main_interp(void) #endif } -/* psyco_GetDecimalType +/* psyco_get_decimal_type Return a new reference to the decimal type. @@ -439,7 +439,7 @@ psyco_is_main_interp(void) */ PyObject * -psyco_GetDecimalType(void) +psyco_get_decimal_type(void) { static PyObject *cachedType = NULL; PyObject *decimalType = NULL; diff --git a/psycopg/utils.h b/psycopg/utils.h index ab4aacdc..72658de4 100644 --- a/psycopg/utils.h +++ b/psycopg/utils.h @@ -31,32 +31,32 @@ typedef struct cursorObject cursorObject; typedef struct connectionObject connectionObject; typedef struct replicationMessageObject replicationMessageObject; -HIDDEN char *psycopg_escape_string( +HIDDEN char *psyco_escape_string( connectionObject *conn, const char *from, Py_ssize_t len, char *to, Py_ssize_t *tolen); -HIDDEN char *psycopg_escape_identifier( +HIDDEN char *psyco_escape_identifier( connectionObject *conn, const char *str, Py_ssize_t len); -HIDDEN int psycopg_strdup(char **to, const char *from, Py_ssize_t len); +HIDDEN int psyco_strdup(char **to, const char *from, Py_ssize_t len); -STEALS(1) HIDDEN PyObject * psycopg_ensure_bytes(PyObject *obj); -STEALS(1) HIDDEN PyObject * psycopg_ensure_text(PyObject *obj); +STEALS(1) HIDDEN PyObject * psyco_ensure_bytes(PyObject *obj); +STEALS(1) HIDDEN PyObject * psyco_ensure_text(PyObject *obj); -HIDDEN int psycopg_is_text_file(PyObject *f); +HIDDEN int psyco_is_text_file(PyObject *f); -HIDDEN PyObject *psycopg_dict_from_conninfo_options( +HIDDEN PyObject *psyco_dict_from_conninfo_options( PQconninfoOption *options, int include_password); -HIDDEN PyObject *psycopg_make_dsn(PyObject *dsn, PyObject *kwargs); +HIDDEN PyObject *psyco_make_dsn(PyObject *dsn, PyObject *kwargs); -HIDDEN PyObject *psycopg_text_from_chars_safe( +HIDDEN PyObject *psyco_text_from_chars_safe( const char *str, Py_ssize_t len, PyObject *decoder); HIDDEN RAISES BORROWED PyObject *psyco_set_error( PyObject *exc, cursorObject *curs, const char *msg); -HIDDEN PyObject *psyco_GetDecimalType(void); +HIDDEN PyObject *psyco_get_decimal_type(void); HIDDEN PyObject *Bytes_Format(PyObject *format, PyObject *args); diff --git a/psycopg/xid_type.c b/psycopg/xid_type.c index bf940dce..dfa3539e 100644 --- a/psycopg/xid_type.c +++ b/psycopg/xid_type.c @@ -343,8 +343,8 @@ _xid_base64_enc_dec(const char *funcname, PyObject *s) if (!(func = PyObject_GetAttrString(base64, funcname))) { goto exit; } Py_INCREF(s); - if (!(s = psycopg_ensure_bytes(s))) { goto exit; } - rv = psycopg_ensure_text(PyObject_CallFunctionObjArgs(func, s, NULL)); + if (!(s = psyco_ensure_bytes(s))) { goto exit; } + rv = psyco_ensure_text(PyObject_CallFunctionObjArgs(func, s, NULL)); Py_DECREF(s); exit: