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/strplus.c between version 1.17 and 1.18

version 1.17, 2002/04/04 17:10:59 version 1.18, 2002/08/16 20:31:43
Line 1 
Line 1 
   #ifdef HAVE_CONFIG_H
   #  include "config.h"
   #endif
   
 #include <stdio.h>  #include <stdio.h>
 #include <string.h>  #include <string.h>
 #include <ctype.h>  #include <ctype.h>
Line 6 
Line 10 
 #include "strplus.h"  #include "strplus.h"
 #include "strctype.h"  #include "strctype.h"
   
   #ifndef FUNCTION
   #  define FUNCTION_NAME(_unused, _name) _unused##_name
   #  define FUNCTION(_name) FUNCTION_NAME(, ## _name)
   #endif
   
         char *          char *
 strestr(s1, s2)  FUNCTION(strestr)(s1, s2)
         const char *s1;          const char *s1;
         const char *s2;          const char *s2;
 {  {
Line 23  strestr(s1, s2)
Line 32  strestr(s1, s2)
  */   */
   
         char *          char *
 stristr(s1, s2)  FUNCTION(stristr)(s1, s2)
         const char *s1;          const char *s1;
         const char *s2;          const char *s2;
 {  {
Line 43  stristr(s1, s2)
Line 52  stristr(s1, s2)
                 return NULL;                  return NULL;
         }          }
   
         if ((ret = strstr(strtolower(a_s1), strtoupper(a_s2))) != NULL)          if ((ret = strstr(FUNCTION(strtolower)(a_s1), FUNCTION(strtoupper)(a_s2))) != NULL)
                 ret = (char *) s1 + (ret - a_s1);                  ret = (char *) s1 + (ret - a_s1);
   
         free(a_s1);          free(a_s1);
Line 55  stristr(s1, s2)
Line 64  stristr(s1, s2)
 #endif  #endif
   
         char *          char *
 str_white_str(str, substr, size)  FUNCTION(str_white_str)(str, substr, size)
         char *str;          char *str;
         char *substr;          char *substr;
         int  *size;          int  *size;
Line 140  str_white_str(str, substr, size)
Line 149  str_white_str(str, substr, size)
   
   
         int          int
 strcnt(str, c)  FUNCTION(strcnt)(str, c)
         const char *str;          const char *str;
         const int c;          const int c;
 {  {
Line 155  strcnt(str, c)
Line 164  strcnt(str, c)
 }  }
   
         int          int
 strcnt_str(str, substr)  FUNCTION(strcnt_str)(str, substr)
         const char *str;          const char *str;
         const char *substr;          const char *substr;
 {  {
Line 173  strcnt_str(str, substr)
Line 182  strcnt_str(str, substr)
 }  }
   
         int          int
 strcnt_sepstr(str, substr)  FUNCTION(strcnt_sepstr)(str, substr)
         const char *str;          const char *str;
         const char *substr;          const char *substr;
 {  {
Line 193  strcnt_sepstr(str, substr)
Line 202  strcnt_sepstr(str, substr)
 }  }
   
         char *          char *
 strdel(s)  FUNCTION(strdel)(s)
         char *s;          char *s;
 {  {
         register int i;          register int i;
Line 206  strdel(s)
Line 215  strdel(s)
 }  }
   
         char *          char *
 strrmlf(s)  FUNCTION(strrmlf)(s)
         char *s;          char *s;
 {  {
         register char *p_lf;          register char *p_lf;
   
         while ((p_lf = strchr(s, '\n')) != NULL)          while ((p_lf = strchr(s, '\n')) != NULL)
                 strdel(p_lf);                  FUNCTION(strdel)(p_lf);
   
         return s;          return s;
 }  }
   
         char *          char *
 strrmcr(s)  FUNCTION(strrmcr)(s)
         char *s;          char *s;
 {  {
         register char *p_cr;          register char *p_cr;
   
         while ((p_cr = strchr(s, '\r')) != NULL)          while ((p_cr = strchr(s, '\r')) != NULL)
                 strdel(p_cr);                  FUNCTION(strdel)(p_cr);
   
         return s;          return s;
 }  }
   
         char *          char *
 str_left_trim(s)  FUNCTION(str_left_trim)(s)
         char *s;          char *s;
 {  {
         register char *pos;          register char *pos;
Line 244  str_left_trim(s)
Line 253  str_left_trim(s)
 }  }
   
         char *          char *
 str_right_trim(s)  FUNCTION(str_right_trim)(s)
         char *s;          char *s;
 {  {
         register char *pos;          register char *pos;
Line 257  str_right_trim(s)
Line 266  str_right_trim(s)
 }  }
   
         char *          char *
 str_trim_whitechars(s)  FUNCTION(str_trim_whitechars)(s)
         char *s;          char *s;
 {  {
         register char *pos, *start;          register char *pos, *start;
Line 285  str_trim_whitechars(s)
Line 294  str_trim_whitechars(s)
 }  }
   
         char *          char *
 strins(str, ins)  FUNCTION(strins)(str, ins)
         char *str;          char *str;
         char *ins;          char *ins;
 {  {
Line 298  strins(str, ins)
Line 307  strins(str, ins)
 }  }
   
         int          int
 strrcmp(s1, s2)  FUNCTION(strrcmp)(s1, s2)
         const char *s1;          const char *s1;
         const char *s2;          const char *s2;
 {  {

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

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