Home
Download
Change log
Introduction
String handling in standard C is an errorprone thing. To avoid
this I implemented this little C string wrapper on top of the
standard C string functions for a safe usage of strings. It is
written in standard C. Instead of the cryptic naming of the
standard C string functions proper names are used (see
cstrings.h).
Features
• standard C strings as char*
• functions to set, concat, split, format, search strings
Compile
Sorry, there is no makefile, but compilation is simple:
gcc -I. -c common/cstrings.c -D_GNU_SOURCE -DHAVE_LONG_LONG
gcc -I. -c common/lists.c -D_GNU_SOURCE
gcc -I. -c common/global.c -D_GNU_SOURCE
gcc -I. -c errors.c -D_GNU_SOURCE
gcc -I. -c cstrings_demo.c -D_GNU_SOURCE
gcc -o cstrings_demo cstrings_demo.o cstrings.o lists.o global.o errors.o
Please note:
• If no long long type is available, long long format
cannot be done. Usually long long is checked in a configure script
which set HAVE_LONG_LONG.
• Lists library is required for debug functions in strings
and is included here, too.
License
String library is currently under GPL version 2.
Download
cstrings-4.tar.bz2
ChangeLog
2024-02-18 4
* fixed stringReplace(): string bounds
* fixed stringCompare(): handle NULL as an empty string
2024-01-20 3
* renamed stringIsValidUTF8Codepointn -> stringIsValidUTF8CodepointN
* renamed stringNextUTF8n -> stringNextUTF8N
* renamed stringAtUTF8n -> stringAtUTF8N
* fixed stringFill
* fixed UTF8 iterator
* fixed stringAppend
2023-11-05 2
* replaced ulong -> size_t
2023-06-18 1
* initial public release
Back to top