An open API service indexing awesome lists of open source software.

https://github.com/james-antill/vstr


https://github.com/james-antill/vstr

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

This is a shared library that does string related stuff. It's designed
for use with vectors (readv()/writev()) but is a generic string handling
library.

It aims to be fast and small, if used properly, but also easy to use.

It is Licensed under the LGPL, see the COPYING file for details.

See the AUTHORS file for authors.

-------------- Adding functions to the library --------------

If you add a function to the library, you need to:

1. Add the function to a source file, altering src/Makefile.am if it's in a new
file.

2. Add the prototype to include/vstr-extern.h.pre, including the @@@@ markers.
If it has an inline part also add the inline definition to
include/vstr-inline.h.pre (and if you have inline helper function add them to
the bottom of vstr-extern.h.pre and indent them by one space.

3. Add the name (without the vstr_ namespace) to
include/vstr-internal.export_symbols (or vstr-internal.inline_export_symbols
if it has an inline version).

4. Add documentation to Documentation/functions.txt

5. Add test cases to tst/

6. Run make check and ./scripts/autovalgrind.sh

7. Run ./scripts/autocheck.sh (this takes a while).

8. Send patch to me :).

You'll then need to run the ./scripts/autogen.sh file, this then generate
the real extern and inline files and do all the symbol stuff.

-------------- Compiling against dietlibc on Linux --------------

Just use the scripts...

./scripts/b/diet-debug.sh
./scripts/b/diet-op.sh

These are warnings produced by dietlibc...

1. memcpy()/memset() aren't defined in dietlibc header files this
produces warnings in debug mode.

2. stdarg produces lots of warnings about using (void *) arithmetric.

3. wchar_t is defined differently by dietlibc that than by gcc, so...

wchar_t *tmp = L"";

...gets a warning.

-------------- Checking the testing coverage --------------

If you do a build with inline'd functions turned off, then you can run the
script ./script/tst_coverage_diff.sh ... this will show all the constants and
functions that are defined in the library but not in the make check test suite.
Note that even if/when this is empty, this doesn't mean that the library is
guaranteed to be bug free. For example there are distinct code paths for some
functions depending on if the Vstr string has a _BUF node at the begining and
deleted some data from the begining.