Remove some dead code

This commit is contained in:
Oleksandr Shulgin 2016-03-08 18:35:55 +01:00
parent 1d52f34e60
commit 2de2ed7c63
3 changed files with 1 additions and 47 deletions

View File

@ -125,8 +125,6 @@ RAISES HIDDEN PyObject *psyco_set_error(PyObject *exc, cursorObject *curs, const
HIDDEN char *psycopg_escape_string(connectionObject *conn, HIDDEN char *psycopg_escape_string(connectionObject *conn,
const char *from, Py_ssize_t len, char *to, Py_ssize_t *tolen); const char *from, Py_ssize_t len, char *to, Py_ssize_t *tolen);
HIDDEN char *psycopg_escape_identifier_easy(const char *from, Py_ssize_t len); HIDDEN char *psycopg_escape_identifier_easy(const char *from, Py_ssize_t len);
HIDDEN char *psycopg_escape_conninfo(const char *from, Py_ssize_t len);
HIDDEN int psycopg_strdup(char **to, const char *from, Py_ssize_t len); HIDDEN int psycopg_strdup(char **to, const char *from, Py_ssize_t len);
HIDDEN int psycopg_is_text_file(PyObject *f); HIDDEN int psycopg_is_text_file(PyObject *f);

View File

@ -73,7 +73,6 @@ HIDDEN PyObject *psyco_null = NULL;
/* The type of the cursor.description items */ /* The type of the cursor.description items */
HIDDEN PyObject *psyco_DescriptionType = NULL; HIDDEN PyObject *psyco_DescriptionType = NULL;
/** connect module-level function **/ /** connect module-level function **/
#define psyco_connect_doc \ #define psyco_connect_doc \
"_connect(dsn, [connection_factory], [async]) -- New database connection.\n\n" "_connect(dsn, [connection_factory], [async]) -- New database connection.\n\n"
@ -87,6 +86,7 @@ psyco_connect(PyObject *self, PyObject *args, PyObject *keywds)
int async = 0; int async = 0;
static char *kwlist[] = {"dsn", "connection_factory", "async", NULL}; static char *kwlist[] = {"dsn", "connection_factory", "async", NULL};
if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|Oi", kwlist, if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|Oi", kwlist,
&dsn, &factory, &async)) { &dsn, &factory, &async)) {
return NULL; return NULL;

View File

@ -124,50 +124,6 @@ psycopg_escape_identifier_easy(const char *from, Py_ssize_t len)
return rv; return rv;
} }
char *
psycopg_escape_conninfo(const char *from, Py_ssize_t len)
{
char *rv = NULL;
const char *src;
const char *end;
char *dst;
int space = 0;
if (!len) { len = strlen(from); }
end = from + len;
if (!(rv = PyMem_Malloc(3 + 2 * len))) {
PyErr_NoMemory();
return NULL;
}
/* check for any whitespace or empty string */
if (from < end && *from) {
for (src = from; src < end && *src; ++src) {
if (isspace(*src)) {
space = 1;
break;
}
}
} else {
/* empty string: we should produce '' */
space = 1;
}
dst = rv;
if (space) { *(dst++) = '\''; }
/* scan and copy */
for (src = from; src < end && *src; ++src, ++dst) {
if (*src == '\'' || *src == '\\')
*(dst++) = '\\';
*dst = *src;
}
if (space) { *(dst++) = '\''; }
*dst = '\0';
return rv;
}
/* Duplicate a string. /* Duplicate a string.
* *
* Allocate a new buffer on the Python heap containing the new string. * Allocate a new buffer on the Python heap containing the new string.