aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 7b7885c1251de81e47284c1c485e78b4c3ac9308 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
dynstr
======

Minimal library that provides dynamic strings using plain C99. Convenience
macros are also provided if GNU C is used.

# Usage

```
#include <stdio.h>
#include "dynstr.h"

int main(const int argc, const char *argv[])
{
    struct dynstr s;

    dynstr_init(&s);
    dynstr_append(&s, "Hello");
    dynstr_append(&s, " from %s:%d\n", __func__, __LINE__);
    dynstr_prepend(&s, "Hey! ");
    printf("%s", s.str);
    dynstr_free(&s);

    return 0;
}
```
Output:

```
Hey! Hello from main:10
```
# License
See LICENSE file.