Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/llafuente/string.c
c string (struct) with multiple encodings (ascii, utf8, utf32)
https://github.com/llafuente/string.c
Last synced: 1 day ago
JSON representation
c string (struct) with multiple encodings (ascii, utf8, utf32)
- Host: GitHub
- URL: https://github.com/llafuente/string.c
- Owner: llafuente
- License: mit
- Created: 2015-03-26T11:05:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-18T11:30:55.000Z (over 8 years ago)
- Last Synced: 2024-11-07T06:43:07.395Z (about 2 months ago)
- Language: C
- Homepage:
- Size: 219 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# string.c
Single allocation string implementation (with struct) c99 at least,
more convenient and performance that common null terminated char*,
100% compatible with them :) and accept multiple encodings.It's not yet ready to be a shared library, use static instead. It's not stable
enough.## Encodings
* UTF8
* UTF32be
* UTF32le
* ascii
* binaryUsed for unknown or user data. Internally is handled as ascii (byte to byte)
## Usage
include a single header
```c
#include "stringc.h"
```include .libs/ and link against libstringc.la
After usage you need to
[st_memfree](https://github.com/llafuente/string.c/blob/master/doc.md#st_memfree)
some cache variable:```c
// cleaning caches
st_memfree();
```## API
[stringc api](https://github.com/llafuente/string.c/blob/master/doc.md)
## Compilation
autoconf is required.
RHEL
```bash
sudo yum install autoconf
sudo yum install libtool
``````bash
sh autogen.sh
./configure
make
```## Tests
```bash
sh test.sh
```## Contibution
Just send a PR.
### Style / format
We use clang-format
to keep an uniform coding style, before PR **always** use:```bash
sh format.sh
```### Documentation
We use cldoc + our formatter to output markdown.
```bash
sh doc.sh
```## Code-coverage
```bash
sh code-coverage.sh
```## Benchmarks
TODO
* Use a variable in makefile.am?
* new Phony target?meanwhile... edit makefile.am
* comment: test_run_tests_SOURCES = test/run-tests.c
* uncomment: test_run_tests_SOURCES = test/run-benchmarks.c```bash
sh benchmarks.sh oldversion
# do your changes and recompile
sh benchmarks.sh newversion
node compare.js oldversion newversion
# open with your browser bench_data/comparison.html
```### install pip & gcovr
install phyton...
```bash
cd /tmp
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install gcovr
```