aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorXavi Del Campo <xavi.dcr@tutanota.com>2020-03-19 18:39:06 +0100
committerXavi Del Campo <xavi.dcr@tutanota.com>2020-03-19 18:40:31 +0100
commit73dd849484cee9c46c24582fc6537bc68c18fdce (patch)
tree1cf9873fd92713cc47c22f3d24b30b21c3326bd4 /README.md
downloaddynstr-73dd849484cee9c46c24582fc6537bc68c18fdce.tar.gz
First commit
Diffstat (limited to 'README.md')
-rw-r--r--README.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e32369b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,32 @@
+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.