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

Diff for libplaton/platon/str/strplus.h between version 1.16 and 1.17

version 1.16, 2002/08/16 20:31:43 version 1.17, 2002/08/27 13:12:33
Line 20 
Line 20 
   
 /* TODO: macros should not be in extern "C" { } */  /* TODO: macros should not be in extern "C" { } */
   
   #ifndef PLATON_FUNC
   # define PLATON_FUNC(_name) _name
   #endif
   #ifndef PLATON_FUNC_STR
   # define PLATON_FUNC_STR(_name) #_name
   #endif
   
 #ifdef __cplusplus  #ifdef __cplusplus
 extern "C" {  extern "C" {
 #endif  #endif
Line 41  extern "C" {
Line 48  extern "C" {
   
 #define strendstr(__s1,__s2) (strstr(__s1,__s2) + strlen(__s2))  #define strendstr(__s1,__s2) (strstr(__s1,__s2) + strlen(__s2))
   
 #ifdef PLATON_PREFIX          char *PLATON_FUNC(strestr)(const char *s1, const char *s2);
         char *FUNCTION(strestr)(const char *s1, const char *s2);          char *PLATON_FUNC(stristr)(const char *s1, const char *s2);
         char *FUNCTION(stristr)(const char *s1, const char *s2);  
 #else  
         char *strestr(const char *s1, const char *s2);  
         char *stristr(const char *s1, const char *s2);  
 #endif  
   
 #define strcasestr(__s1, __s2) stristr(__s1, __s2)  #define strcasestr(__s1, __s2) stristr(__s1, __s2)
   
 #ifdef PLATON_PREFIX          char *PLATON_FUNC(str_white_str)(char *str, char *substr, int *size);
         char *FUNCTION(str_white_str)(char *str, char *substr, int *size);  
 #else  
         char *str_white_str(char *str, char *substr, int *size);  
 #endif  
   
 #define strwhitestr(str, substr, size) str_white_str(str, substr, size)  #define strwhitestr(str, substr, size) str_white_str(str, substr, size)
 #define strwstr(str, substr) str_white_str(str, substr, NULL)  #define strwstr(str, substr) str_white_str(str, substr, NULL)
Line 68  extern "C" {
Line 66  extern "C" {
  * strcnt_sepstr() - count number of separate substrings in string   * strcnt_sepstr() - count number of separate substrings in string
  */   */
   
 #ifdef PLATON_PREFIX          int PLATON_FUNC(strcnt)(const char *str, const int c);
         int FUNCTION(strcnt)(const char *str, const int c);          int PLATON_FUNC(strcnt_str)(const char *str, const char *substr);
         int FUNCTION(strcnt_str)(const char *str, const char *substr);          int PLATON_FUNC(strcnt_sepstr)(const char *str, const char *substr);
         int FUNCTION(strcnt_sepstr)(const char *str, const char *substr);  
 #else  
         int strcnt(const char *str, const int c);  
         int strcnt_str(const char *str, const char *substr);  
         int strcnt_sepstr(const char *str, const char *substr);  
 #endif  
   
 /*  /*
  * Removing functions   * Removing functions
Line 94  extern "C" {
Line 86  extern "C" {
  *                         one space character   *                         one space character
  */   */
   
 #ifdef PLATON_PREFIX          char *PLATON_FUNC(strdel)(char *s);
         char *FUNCTION(strdel)(char *s);          char *PLATON_FUNC(strrmlf)(char *s);
         char *FUNCTION(strrmlf)(char *s);          char *PLATON_FUNC(strrmcr)(char *s);
         char *FUNCTION(strrmcr)(char *s);  
 #else  
         char *strdel(char *s);  
         char *strrmlf(char *s);  
         char *strrmcr(char *s);  
 #endif  
   
 #define strrmeol(__s)   strrmcr(strrmlf(__s))  #define strrmeol(__s)   strrmcr(strrmlf(__s))
 #define strrmcrlf(__s)  strrmeol(__s)  #define strrmcrlf(__s)  strrmeol(__s)
 #define strrmlfcr(__s)  strrmeol(__s)  #define strrmlfcr(__s)  strrmeol(__s)
   
 #ifdef PLATON_PREFIX          char *PLATON_FUNC(str_left_trim)(char *s);
         char *FUNCTION(str_left_trim)(char *s);          char *PLATON_FUNC(str_right_trim)(char *s);
         char *FUNCTION(str_right_trim)(char *s);          char *PLATON_FUNC(str_trim_whitechars)(char *s);
         char *FUNCTION(str_trim_whitechars)(char *s);  #  define ltrim(s)      PLATON_FUNC(str_left_trim)(s)
 #  define ltrim(s)      FUNCTION(str_left_trim)(s)  #  define rtrim(s)      PLATON_FUNC(str_right_trim)(s)
 #  define rtrim(s)      FUNCTION(str_right_trim)(s)  
   
 #else  
         char *str_left_trim(char *s);  
         char *str_right_trim(char *s);  
         char *str_trim_whitechars(char *s);  
 #  define ltrim(s)      str_left_trim(s)  
 #  define rtrim(s)      str_right_trim(s)  
   
 #endif  
   
 #define trim(s)         rtrim(ltrim(s))  #define trim(s)         rtrim(ltrim(s))
 #define strtrim(s)      trim(s)  #define strtrim(s)      trim(s)
Line 134  extern "C" {
Line 110  extern "C" {
  * strins() - function inserts string ins at position str;   * strins() - function inserts string ins at position str;
  *            there MUST be enough memory allocated in str   *            there MUST be enough memory allocated in str
  */   */
 #ifdef PLATON_PREFIX          char *PLATON_FUNC(strins)(char *str, char *ins);
         char *FUNCTION(strins)(char *str, char *ins);  
 #else  
         char *strins(char *str, char *ins);  
 #endif  
   
 /*  /*
  * Comparing functions   * Comparing functions
Line 146  extern "C" {
Line 118  extern "C" {
  * strrcmp() - compares two string in reverse order   * strrcmp() - compares two string in reverse order
  */   */
   
 #ifdef PLATON_PREFIX          int PLATON_FUNC(strrcmp)(const char *s1, const char *s2);
         int FUNCTION(strrcmp)(const char *s1, const char *s2);  
 #else  
         int strrcmp(const char *s1, const char *s2);  
 #endif  
   
 #ifdef __cplusplus  #ifdef __cplusplus
 }  }

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

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