diff -r ae61523bce20 -r 2f71f4ee247a ucx/cx/string.h
--- a/ucx/cx/string.h Thu Oct 03 18:52:51 2024 +0200
+++ b/ucx/cx/string.h Sun Oct 06 18:18:04 2024 +0200
@@ -72,7 +72,7 @@
* \note The string is not necessarily \c NULL terminated.
* Always use the length.
*/
- char const *ptr;
+ const char *ptr;
/** The length of the string */
size_t length;
};
@@ -97,7 +97,7 @@
/**
* Optional array of more delimiters.
*/
- cxstring const *delim_more;
+ const cxstring *delim_more;
/**
* Length of the array containing more delimiters.
*/
@@ -213,7 +213,7 @@
* @see cx_strn()
*/
__attribute__((__warn_unused_result__, __nonnull__))
-cxstring cx_str(char const *cstring);
+cxstring cx_str(const char *cstring);
/**
@@ -234,7 +234,7 @@
*/
__attribute__((__warn_unused_result__))
cxstring cx_strn(
- char const *cstring,
+ const char *cstring,
size_t length
);
@@ -257,8 +257,8 @@
* The pointer in the struct is set to \c NULL and the length is set to zero.
*
* \note There is no implementation for cxstring, because it is unlikely that
- * you ever have a \c char \c const* you are really supposed to free. If you
- * encounter such situation, you should double-check your code.
+ * you ever have a const char*
you are really supposed to free.
+ * If you encounter such situation, you should double-check your code.
*
* @param str the string to free
*/
@@ -271,15 +271,15 @@
* The pointer in the struct is set to \c NULL and the length is set to zero.
*
* \note There is no implementation for cxstring, because it is unlikely that
- * you ever have a \c char \c const* you are really supposed to free. If you
- * encounter such situation, you should double-check your code.
+ * you ever have a const char*
you are really supposed to free.
+ * If you encounter such situation, you should double-check your code.
*
* @param alloc the allocator
* @param str the string to free
*/
__attribute__((__nonnull__))
void cx_strfree_a(
- CxAllocator const *alloc,
+ const CxAllocator *alloc,
cxmutstr *str
);
@@ -319,7 +319,7 @@
*/
__attribute__((__warn_unused_result__, __nonnull__))
cxmutstr cx_strcat_ma(
- CxAllocator const *alloc,
+ const CxAllocator *alloc,
cxmutstr str,
size_t count,
...
@@ -629,7 +629,7 @@
*/
__attribute__((__warn_unused_result__, __nonnull__))
size_t cx_strsplit_a(
- CxAllocator const *allocator,
+ const CxAllocator *allocator,
cxstring string,
cxstring delim,
size_t limit,
@@ -678,7 +678,7 @@
*/
__attribute__((__warn_unused_result__, __nonnull__))
size_t cx_strsplit_ma(
- CxAllocator const *allocator,
+ const CxAllocator *allocator,
cxmutstr string,
cxstring delim,
size_t limit,
@@ -725,8 +725,8 @@
*/
__attribute__((__warn_unused_result__, __nonnull__))
int cx_strcmp_p(
- void const *s1,
- void const *s2
+ const void *s1,
+ const void *s2
);
/**
@@ -741,8 +741,8 @@
*/
__attribute__((__warn_unused_result__, __nonnull__))
int cx_strcasecmp_p(
- void const *s1,
- void const *s2
+ const void *s1,
+ const void *s2
);
@@ -760,7 +760,7 @@
*/
__attribute__((__warn_unused_result__, __nonnull__))
cxmutstr cx_strdup_a(
- CxAllocator const *allocator,
+ const CxAllocator *allocator,
cxstring string
);
@@ -928,7 +928,7 @@
*/
__attribute__((__warn_unused_result__, __nonnull__))
cxmutstr cx_strreplacen_a(
- CxAllocator const *allocator,
+ const CxAllocator *allocator,
cxstring str,
cxstring pattern,
cxstring replacement,
@@ -1070,7 +1070,7 @@
__attribute__((__nonnull__))
void cx_strtok_delim(
CxStrtokCtx *ctx,
- cxstring const *delim,
+ const cxstring *delim,
size_t count
);