Remove unused function.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 24 Jun 2014 07:27:46 +0000 (10:27 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 24 Jun 2014 07:27:46 +0000 (10:27 +0300)
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
dlg_specific.h

index 46387441c78e2f62f03fdd89cfe1b5f3e1e49475..c4e2fb2b783a1e24a888cf2305da0bfe723d871a 100644 (file)
@@ -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[']
index c73bb64745fba6bb91aeb8cf1a2d7a56d0907710..db10742ba440ee0d04da05828fd4a6173e389670 100644 (file)
@@ -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