Minimal library that provides dynamic strings using plain C99. Convenience macros are also provided if GNU C is used.
Go to file
XaviDCR92 35497efab9 Merge branch 'master' of https://github.com/XaviDCR92/dynstr 2020-03-21 09:54:04 +01:00
include Added compile-time error when C99 is not present 2020-03-21 09:53:45 +01:00
.gitignore First commit 2020-03-19 18:40:31 +01:00
CMakeLists.txt Build files for esp-idf 2020-03-20 16:22:36 +01:00
LICENSE First commit 2020-03-19 18:40:31 +01:00
README.md First commit 2020-03-19 18:40:31 +01:00
component.mk Build files for esp-idf 2020-03-20 16:22:36 +01:00
dynstr.c Solved compiler error by adding scope block 2020-03-21 01:09:43 +01:00

README.md

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__);
    printf("%s", s.str);
    dynstr_free(&s);

    return 0;
}

Output:

Hello from main:10

License

See LICENSE file.