From 43e8d1ad415cd8af7f56f0346097dd2882e23628 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Wed, 11 Mar 2009 12:35:52 +0200 Subject: Start writing wordsplit. * doc/wydawca.texi: Update. * gconf/argcv.h, gconf/argcv.c: Remove. * gconf/wordsplit.c, gconf/wordsplit.h: New files. * gconf/Makefile.am (libgconf_a_SOURCES): Remove argcv, add wordsplit * gconf/gconf-lex.l, gconf/gconf-preproc.c: Use wordsplit, instead of argcv_get * src/directive.c, src/method.c: Likewise. * src/wydawca.h: Likewise. * tests/wordsplit.at: New file. * tests/wstest.c, tests/wsbatch.c: New files. * tests/Makefile.am (TESTSUITE_AT): Add wordsplit.at Build wstest and wsbatch. * tests/testsuite.at: Add wordsplit.at. --- src/directive.c | 16 ++++++++-------- src/method.c | 4 ++-- src/wydawca.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/directive.c b/src/directive.c index 416095f..afb9fe0 100644 --- a/src/directive.c +++ b/src/directive.c @@ -363,18 +363,17 @@ process_directives (struct file_triplet *trp, const struct spool *spool) case symlink_dir: { - int argc; - char **argv; int rc = 0; + struct wordsplit ws; - if ((rc = argcv_get (val, NULL, NULL, &argc, &argv))) + if (wordsplit (val, &ws, WRDSF_DEFFLAGS)) { - logmsg (LOG_ERR, _("cannot parse symlink value `%s': %s"), - val, strerror (rc)); + logmsg (LOG_ERR, _("cannot parse symlink value `%s'"), + val); return 1; } - if (argc != 2) + if (ws.ws_wordc != 2) { rc = 1; logmsg (LOG_ERR, @@ -382,9 +381,10 @@ process_directives (struct file_triplet *trp, const struct spool *spool) key, val); } else - rc = symlink_file (trp, spool, relative_dir, argv[0], argv[1]); + rc = symlink_file (trp, spool, relative_dir, + ws.ws_wordv[0], ws.ws_wordv[1]); - argcv_free (argc, argv); + wordsplit_free (&ws); if (rc) return 1; } diff --git a/src/method.c b/src/method.c index ec8e01c..d5ad0b4 100644 --- a/src/method.c +++ b/src/method.c @@ -213,9 +213,9 @@ method_quote_string (struct access_method *method, void *handle, if (mp->quote) return mp->quote (method, handle, input, poutput, psize); - size = argcv_quoted_length (input, "e); + size = wordsplit_quoted_length (input, 0, "e); output = xmalloc (size + 1); - argcv_quote_copy (output, input); + wordsplit_quote_copy (output, input, 0); output[size] = 0; *poutput = output; diff --git a/src/wydawca.h b/src/wydawca.h index f6d6674..fe6f91b 100644 --- a/src/wydawca.h +++ b/src/wydawca.h @@ -56,7 +56,7 @@ #include "inttostr.h" #include "gconf.h" #include "gl_list.h" -#include "argcv.h" +#include "wordsplit.h" #define gettext(s) s #define _(s) s -- cgit v1.2.1