src/string.c

changeset 318
348fd9cb7b14
parent 317
ebae0e434898
child 319
0380e438a7ce
     1.1 --- a/src/string.c	Wed May 16 13:13:33 2018 +0200
     1.2 +++ b/src/string.c	Wed May 16 14:02:59 2018 +0200
     1.3 @@ -201,8 +201,8 @@
     1.4      return ret;
     1.5  }
     1.6  
     1.7 -scstr_t scstrsubs(scstr_t s, size_t start) {
     1.8 -    return scstrsubsl (s, start, s.length-start);
     1.9 +scstr_t scstrsubs(scstr_t string, size_t start) {
    1.10 +    return scstrsubsl(string, start, string.length-start);
    1.11  }
    1.12  
    1.13  scstr_t scstrsubsl(scstr_t s, size_t start, size_t length) {
    1.14 @@ -215,9 +215,9 @@
    1.15  }
    1.16  
    1.17  
    1.18 -int ucx_strchr(const char *string, size_t length, int chr, size_t *pos) {
    1.19 +static int ucx_strchr(const char *str, size_t length, int chr, size_t *pos) {
    1.20      for(size_t i=0;i<length;i++) {
    1.21 -        if(string[i] == chr) {
    1.22 +        if(str[i] == chr) {
    1.23              *pos = i;
    1.24              return 1;
    1.25          }
    1.26 @@ -225,10 +225,10 @@
    1.27      return 0;
    1.28  }
    1.29  
    1.30 -int ucx_strrchr(const char *string, size_t length, int chr, size_t *pos) {
    1.31 +static int ucx_strrchr(const char *str, size_t length, int chr, size_t *pos) {
    1.32      if(length > 0) {
    1.33          for(size_t i=length ; i>0 ; i--) {
    1.34 -            if(string[i-1] == chr) {
    1.35 +            if(str[i-1] == chr) {
    1.36                  *pos = i-1;
    1.37                  return 1;
    1.38              }
    1.39 @@ -278,7 +278,7 @@
    1.40      } while (0);
    1.41  
    1.42  
    1.43 -const char* ucx_strstr(
    1.44 +static const char* ucx_strstr(
    1.45          const char *str,
    1.46          size_t length,
    1.47          const char *match,
    1.48 @@ -511,11 +511,11 @@
    1.49      }
    1.50  }
    1.51  
    1.52 -sstr_t scstrdup(scstr_t s) {
    1.53 +sstr_t ucx_strdup(scstr_t s) {
    1.54      return sstrdup_a(ucx_default_allocator(), s);
    1.55  }
    1.56  
    1.57 -sstr_t scstrdup_a(UcxAllocator *allocator, scstr_t s) {
    1.58 +sstr_t ucx_strdup_a(UcxAllocator *allocator, scstr_t s) {
    1.59      sstr_t newstring;
    1.60      newstring.ptr = (char*)almalloc(allocator, s.length + 1);
    1.61      if (newstring.ptr) {
    1.62 @@ -531,7 +531,7 @@
    1.63  }
    1.64  
    1.65  
    1.66 -size_t ucx_strtrim(const char *s, size_t len, size_t *newlen) {
    1.67 +static size_t ucx_strtrim(const char *s, size_t len, size_t *newlen) {
    1.68      const char *newptr = s;
    1.69      size_t length = len;
    1.70      

mercurial