Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, October 17, 2026

Diff for libcfg+/src/platon/str/strdyn.c between version 1.8 and 1.9

version 1.8, 2001/11/30 02:10:27 version 1.9, 2001/12/01 01:21:06
Line 207  char **strdyn_explode_str(char *str, cha
Line 207  char **strdyn_explode_str(char *str, cha
   
 char **strdyn_explode2_str(char *str, char *sep)  char **strdyn_explode2_str(char *str, char *sep)
 {  {
   
         return strdyn_remove_empty(strdyn_explode_str(str, sep));          return strdyn_remove_empty(strdyn_explode_str(str, sep));
 }  }
   
   char **strdyn_explode_ar(char *str, char **sep)
   {
           /* WARNING: Unefective recursion used! */
           /* TODO: Various code optimalizations. */
   
           char **ar, **ar1;
   
           if ((ar1 = strdyn_explode_str(str, sep[0])) == NULL)
                   return NULL;
   
           if (sep[1] != NULL) {
                   char **ar2;
                   register int i;
   
                   if ((ar = strdyn_create()) == NULL) {
                           strdyn_free(ar1);
                           return NULL;
                   }
   
                   for (i = 0; i < strdyn_count(ar1); i++) {
                           if ((ar2 = strdyn_explode_ar(ar1[i], sep + 1)) == NULL) {
                                   strdyn_free(ar1);
                                   strdyn_free(ar);
                                   return NULL;
                           }
   
                           if ((ar = strdyn_add_ar(ar, ar2)) == NULL) {
                                   strdyn_free(ar1);
                                   strdyn_free(ar);
                                   strdyn_free(ar2);
                                   return NULL;
                           }
   
                           strdyn_free(ar2);
                   }
   
                   strdyn_free(ar1);
           }
           else
                   ar = ar1;
   
           return ar;
   }
   
   char **strdyn_explode2_ar(char *str, char **sep)
   {
           return strdyn_remove_empty(strdyn_explode2_ar(str, sep));
   }
   
 char *strdyn_implode_chr(char **ar, char sep)  char *strdyn_implode_chr(char **ar, char sep)
 {  {
         char sep_str[2];          char sep_str[2];
Line 322  int strdyn_search(char **ar, char *s)
Line 370  int strdyn_search(char **ar, char *s)
         register int i;          register int i;
   
         for (i = 0; ar[i] != NULL; i++)          for (i = 0; ar[i] != NULL; i++)
                 /* printf("COMPARING '%s' vs. '%s'\n", ar[i], s); */  
                 if (! strcmp(ar[i], s))                  if (! strcmp(ar[i], s))
                         return i;                          return i;
   

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top