diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-10 18:55:06 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-15 20:03:40 +0100 |
commit | 78409a2251e345249316f3fcccb31d7b8ba97ccb (patch) | |
tree | 5ccac8f847b4f259456cb1055cae5afe61c454b7 /parse.c | |
parent | Move trie->dot from trie to graphs. Add value printing. (diff) | |
download | calp-78409a2251e345249316f3fcccb31d7b8ba97ccb.tar.gz calp-78409a2251e345249316f3fcccb31d7b8ba97ccb.tar.xz |
Merge strbuf copy functions.
Diffstat (limited to '')
-rw-r--r-- | parse.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -68,7 +68,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) { exit (2); } - strbuf_copy(cline.vals.cur->value, &ctx.str); + DEEP_COPY(strbuf)(cline.vals.cur->value, &ctx.str); strbuf_cap(cline.vals.cur->value); strbuf_soft_reset(&ctx.str); @@ -85,7 +85,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) { * Border between param {key, value} */ } else if (p_ctx == p_param_name && c == '=') { - strbuf_copy(&kv.key, &ctx.str); + DEEP_COPY(strbuf)(&kv.key, &ctx.str); strbuf_cap(&kv.key); strbuf_soft_reset(&ctx.str); @@ -103,7 +103,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) { if (p_ctx == p_key) dest = &cline.key; else if (p_ctx == p_param_value) dest = &kv.val; - strbuf_copy(dest, &ctx.str); + DEEP_COPY(strbuf)(dest, &ctx.str); strbuf_cap(dest); strbuf_soft_reset(&ctx.str); @@ -132,7 +132,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) { * the end here. */ - strbuf_copy(cline.vals.cur->value, &ctx.str); + DEEP_COPY(strbuf)(cline.vals.cur->value, &ctx.str); strbuf_cap(cline.vals.cur->value); handle_kv(&cline, &ctx); @@ -163,7 +163,7 @@ int handle_kv ( */ NEW(strbuf, s); - strbuf_copy(s, cline->vals.cur->value); + DEEP_COPY(strbuf)(s, cline->vals.cur->value); PUSH(LLIST(strbuf))(&ctx->key_stack, s); NEW(vcomponent, e, |