src/ucx/string.h

branch
constsstr
changeset 288
6af5798342e8
parent 276
f1b2146d4805
child 300
d1f814633049
     1.1 --- a/src/ucx/string.h	Sun Apr 01 09:51:01 2018 +0200
     1.2 +++ b/src/ucx/string.h	Tue May 08 12:49:56 2018 +0200
     1.3 @@ -76,6 +76,7 @@
     1.4      const char *ptr;
     1.5      size_t     length;
     1.6  } scstr_t;
     1.7 +
     1.8  #ifdef	__cplusplus
     1.9  }
    1.10  #endif
    1.11 @@ -168,7 +169,9 @@
    1.12   * @param ...      all other strings
    1.13   * @return the cumulated length of all strings
    1.14   */
    1.15 -size_t sstrnlen(size_t count, sstr_t string, ...);
    1.16 +size_t ucx_strnlen(size_t count, ...);
    1.17 +
    1.18 +#define sstrnlen(count, ...) ucx_strnlen(count, __VA_ARGS__)
    1.19  
    1.20  /**
    1.21   * Concatenates two or more strings.
    1.22 @@ -185,7 +188,9 @@
    1.23   * @param ...     all remaining strings
    1.24   * @return the concatenated string
    1.25   */
    1.26 -sstr_t sstrcat(size_t count, sstr_t s1, sstr_t s2, ...);
    1.27 +sstr_t ucx_strcat(size_t count, scstr_t s1, ...);
    1.28 +
    1.29 +#define sstrcat(count, s1, ...) ucx_strcat(count, SCSTR(s1), __VA_ARGS__)
    1.30  
    1.31  /**
    1.32   * Concatenates two or more strings using a UcxAllocator.
    1.33 @@ -199,8 +204,9 @@
    1.34   * @param ...     all remaining strings
    1.35   * @return the concatenated string
    1.36   */
    1.37 -sstr_t sstrcat_a(UcxAllocator *a, size_t count, sstr_t s1, sstr_t s2, ...);
    1.38 +sstr_t ucx_strcat_a(UcxAllocator *a, size_t count, scstr_t s1, ...);
    1.39  
    1.40 +#define sstrcat_a(count, s1, ...) ucx_strcat_a(count, SCSTR(s1), __VA_ARGS__)
    1.41  
    1.42  /**
    1.43   * Returns a substring starting at the specified location.

mercurial