psqlodbc.git / summary / log / commit / refs

commit    81e2a2d034b93e4f8338db9e7e266ffd0bb78fcc
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Tue Jun 24 07:27:46 2014 +0000

    Remove unused function.
    
    Previous commit added a void return to a function with char * return value,
    which generated a warning. On further inspection, the whole function is
    used nowhere, so just remove it rather than try fixing the warning.


dlg_specific.c | 124 --------------------------------------------------------- dlg_specific.h | 1 - 2 files changed, 125 deletions(-) diff --git a/dlg_specific.c b/dlg_specific.c index 46387441..c4e2fb2b 100644 --- a/dlg_specific.c +++ b/dlg_specific.c @@ -1611,130 +1611,6 @@ decode_or_remove_braces(const char *in) return decode(in); } -char *extract_attribute_setting(const char *str, const char *attr, BOOL ref_comment) -{ - const char *cptr, *sptr = NULL; - char *rptr; - BOOL allowed_cmd = TRUE, in_quote = FALSE, in_comment = FALSE; - int step = 0, skiplen; - size_t len = 0, attrlen = strlen(attr); - - if (!str) return; /* for safety */ - for (cptr = str; *cptr; cptr++) - { - if (in_quote) - { - if (LITERAL_QUOTE == *cptr) - { - if (4 == step) - { - len = cptr - sptr; - step++; - } - in_quote = FALSE; - } - continue; - } - else if (in_comment) - { - if ('*' == *cptr && - '/' == cptr[1]) - { - if (4 == step) - { - len = cptr - sptr; - step++; - } - in_comment = FALSE; - cptr++; - continue; - } - if (!ref_comment) - continue; - } - else if ('/' == *cptr && - '*' == cptr[1]) - { - in_comment = TRUE; - cptr++; - continue; - } - if (';' == *cptr) - { - if (4 == step) - { - len = cptr - sptr; - } - allowed_cmd = TRUE; - step = 0; - continue; - } - if (!allowed_cmd) - continue; - if (isspace((unsigned char) *cptr)) - { - if (4 == step) - { - len = cptr - sptr; - step++; - } - continue; - } - switch (step) - { - case 0: - if (0 != strnicmp(cptr, "set", 3)) - { - allowed_cmd = FALSE; - continue; - } - step++; - cptr += 3; - break; - case 1: - if (0 != strnicmp(cptr, attr, attrlen)) - { - allowed_cmd = FALSE; - continue; - } - step++; - cptr += (attrlen - 1); - break; - case 2: - skiplen = 0; - if (0 != strnicmp(cptr, "=", 1)) - { - skiplen = (int) strlen("to"); - if (0 != strnicmp(cptr, "to", 2)) - { - allowed_cmd = FALSE; - continue; - } - } - step++; - cptr += skiplen; - break; - case 3: - if (LITERAL_QUOTE == *cptr) - { - cptr++; - sptr = cptr; - } - else - sptr = cptr; - step++; - break; - } - } - if (!sptr) - return NULL; - rptr = malloc(len + 1); - memcpy(rptr, sptr, len); - rptr[len] = '\0'; - mylog("extracted a %s '%s' from %s\n", attr, rptr, str); - return rptr; -} - /* * extract the specified attribute from the comment part. * attribute=[']value['] diff --git a/dlg_specific.h b/dlg_specific.h index c73bb647..db10742b 100644 --- a/dlg_specific.h +++ b/dlg_specific.h @@ -296,7 +296,6 @@ int setLogDir(const char *dir); int changeDriverNameOfaDSN(const char *dsn, const char *driver_name, DWORD *errcode); UInt4 getExtraOptions(const ConnInfo *); BOOL setExtraOptions(ConnInfo *, const char *str, const char *format); -char *extract_attribute_setting(const char *str, const char *attr, BOOL ref_comment); char *extract_extra_attribute_setting(const pgNAME setting, const char *attr); #ifdef __cplusplus [parent: 41993dbed130]