summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org.ua>2009-03-11 10:35:52 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2009-03-11 10:36:26 (GMT)
commit43e8d1ad415cd8af7f56f0346097dd2882e23628 (patch) (side-by-side diff)
tree37626ff7a5eaea3b185c6f98017de1200ce30ea9 /src
parentb597bbb6893be07010e286f6a6195ed3c323a16b (diff)
downloadwydawca-43e8d1ad415cd8af7f56f0346097dd2882e23628.tar.gz
wydawca-43e8d1ad415cd8af7f56f0346097dd2882e23628.tar.bz2
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.
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/directive.c16
-rw-r--r--src/method.c4
-rw-r--r--src/wydawca.h2
3 files changed, 11 insertions, 11 deletions
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, &quote);
+ size = wordsplit_quoted_length (input, 0, &quote);
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

Return to:

Send suggestions and report system problems to the System administrator.