summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--NEWS2
-rw-r--r--configure.ac4
-rw-r--r--include/mailutils/sys/Makefile.am3
l---------include/mailutils/sys/wordsplit.h1
-rw-r--r--include/mailutils/wordsplit.h358
-rw-r--r--libmailutils/Makefile.am6
-rw-r--r--libmailutils/string/Makefile.am6
-rw-r--r--libmailutils/string/wordsplit.c2382
-rw-r--r--libmailutils/tests/.gitignore1
-rw-r--r--libmailutils/tests/Makefile.am35
-rw-r--r--libmailutils/tests/wordsplit.at787
-rw-r--r--libmailutils/tests/wsp.c654
m---------libmailutils/wordsplit0
14 files changed, 164 insertions, 4078 deletions
<
diff --git a/.gitmodules b/.gitmodules
index bdc2cb048..142e50cfd 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -7,3 +7,6 @@
7[submodule "gnulib"] 7[submodule "gnulib"]
8 path = gnulib 8 path = gnulib
9 url = git://git.sv.gnu.org/gnulib.git 9 url = git://git.sv.gnu.org/gnulib.git
10[submodule "libmailutils/wordsplit"]
11 path = libmailutils/wordsplit
12 url = git://git.gnu.org.ua/wordsplit.git
diff --git a/NEWS b/NEWS
index 6928a7d48..6b16f1706 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ See the end of file for copying conditions.
4 4
5Please send mailutils bug reports to <bug-mailutils@gnu.org>. 5Please send mailutils bug reports to <bug-mailutils@gnu.org>.
6 6
7Version 3.7.90 (git)
8
7Version 3.7 - 2019-06-21 9Version 3.7 - 2019-06-21
8 10
9* Support for the new mailbox format - dotmail 11* Support for the new mailbox format - dotmail
diff --git a/configure.ac b/configure.ac
index eb1436173..c841acfbf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License along
16dnl with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. 16dnl with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
17 17
18AC_PREREQ(2.63) 18AC_PREREQ(2.63)
19AC_INIT([GNU Mailutils], [3.7], [bug-mailutils@gnu.org], [mailutils], 19AC_INIT([GNU Mailutils], [3.7.90], [bug-mailutils@gnu.org], [mailutils],
20 [http://mailutils.org]) 20 [http://mailutils.org])
21AC_CONFIG_SRCDIR([libmailutils/mailbox/mailbox.c]) 21AC_CONFIG_SRCDIR([libmailutils/mailbox/mailbox.c])
22AC_CONFIG_AUX_DIR([build-aux]) 22AC_CONFIG_AUX_DIR([build-aux])
@@ -115,6 +115,8 @@ AC_CHECK_TYPE(iconv_t,:,
115# 115#
116AC_CONFIG_LINKS(include/gettext.h:lib/gnu/gettext.h) 116AC_CONFIG_LINKS(include/gettext.h:lib/gnu/gettext.h)
117 117
118AC_CONFIG_LINKS(include/mailutils/sys/wordsplit.h:libmailutils/wordsplit/wordsplit.h)
119
118AH_BOTTOM([ 120AH_BOTTOM([
119#define DEFAULT_TEXT_DOMAIN PACKAGE 121#define DEFAULT_TEXT_DOMAIN PACKAGE
120]) 122])
diff --git a/include/mailutils/sys/Makefile.am b/include/mailutils/sys/Makefile.am
index 7f31291a2..321c5f134 100644
--- a/include/mailutils/sys/Makefile.am
+++ b/include/mailutils/sys/Makefile.am
@@ -62,7 +62,8 @@ sysinclude_HEADERS = \
62 temp_file_stream.h\ 62 temp_file_stream.h\
63 tls-stream.h\ 63 tls-stream.h\
64 url.h\ 64 url.h\
65 xscript-stream.h 65 xscript-stream.h\
66 $(top_srcdir)/libmailutils/wordsplit/wordsplit.h
66 67
67BUILT_SOURCES = debcat.h 68BUILT_SOURCES = debcat.h
68 69
diff --git a/include/mailutils/sys/wordsplit.h b/include/mailutils/sys/wordsplit.h
new file mode 120000
index 000000000..5c46e03d2
--- /dev/null
+++ b/include/mailutils/sys/wordsplit.h
@@ -0,0 +1 @@
../../../libmailutils/wordsplit/wordsplit.h \ No newline at end of file
diff --git a/include/mailutils/wordsplit.h b/include/mailutils/wordsplit.h
index d5631ddba..203d92458 100644
--- a/include/mailutils/wordsplit.h
+++ b/include/mailutils/wordsplit.h
@@ -1,261 +1,121 @@
1/* wordsplit - a word splitter 1/* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2009-2018 Sergey Poznyakoff 2 Copyright (C) 1999-2019 Free Software Foundation, Inc.
3 3
4 This program is free software; you can redistribute it and/or modify it 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 under the terms of the GNU General Public License as published by the 5 it under the terms of the GNU General Public License as published by
6 Free Software Foundation; either version 3 of the License, or (at your 6 the Free Software Foundation; either version 3, or (at your option)
7 option) any later version. 7 any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 GNU Mailutils is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License
15 with this program. If not, see <http://www.gnu.org/licenses/>. */ 15 along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. */
16
17/* This header converts wordsplit to mailutils namespace by prefixing each
18 exported identifier with mu_ (or MU_, for macros).
19 The canonical wordsplit.h header is located in mailutils/sys.
20*/
16 21
17#ifndef __MAILUTILS_WORDSPLIT_H 22#ifndef __MAILUTILS_WORDSPLIT_H
18#define __MAILUTILS_WORDSPLIT_H 23#define __MAILUTILS_WORDSPLIT_H
19 24
20#include <stddef.h> 25# define wordsplit mu_wordsplit
21 26
22#ifdef __cplusplus 27# define wordsplit_t mu_wordsplit_t
23extern "C" { 28
24#endif 29# define wordsplit_len mu_wordsplit_len
25 30# define wordsplit_free mu_wordsplit_free
26typedef struct mu_wordsplit mu_wordsplit_t; 31# define wordsplit_free_words mu_wordsplit_free_words
27 32# define wordsplit_free_envbuf mu_wordsplit_free_envbuf
28/* Structure used to direct the splitting. Members marked with [Input] 33# define wordsplit_free_parambuf mu_wordsplit_free_parambuf
29 can be defined before calling mu_wordsplit(), those marked with [Output] 34# define wordsplit_getwords mu_wordsplit_getwords
30 provide return values when the function returns. If neither mark is 35# define wordsplit_get_words mu_wordsplit_get_words
31 used, the member is internal and must not be used by the caller. 36# define wordsplit_append mu_wordsplit_append
32 37# define wordsplit_c_unquote_char mu_wordsplit_c_unquote_char
33 In the comments below, the 38# define wordsplit_c_quote_char mu_wordsplit_c_quote_char
34 identifiers in parentheses indicate bits that must be set (or unset, if 39# define wordsplit_c_quoted_length mu_wordsplit_c_quoted_length
35 starting with !) in the ws_flags to initialize or use the given member. 40# define wordsplit_c_quote_copy mu_wordsplit_c_quote_copy
36 If not redefined explicitly, most of them are set to some reasonable 41# define wordsplit_perror mu_wordsplit_perror
37 default value upon entry to mu_wordsplit(). */ 42# define wordsplit_strerror mu_wordsplit_strerror
38struct mu_wordsplit 43# define wordsplit_clearerr mu_wordsplit_clearerr
39{ 44
40 size_t ws_wordc; /* [Output] Number of words in ws_wordv. */ 45# include <mailutils/sys/wordsplit.h>
41 char **ws_wordv; /* [Output] Array of parsed out words. */ 46
42 size_t ws_offs; /* [Input] (MU_WRDSF_DOOFFS) Number of initial 47# define MU_WORDSPLIT_ENV_INIT WORDSPLIT_ENV_INIT
43 elements in ws_wordv to fill with NULLs. */ 48# define MU_WRDSF_APPEND WRDSF_APPEND
44 size_t ws_wordn; /* Number of elements ws_wordv can accomodate. */ 49# define MU_WRDSF_DOOFFS WRDSF_DOOFFS
45 int ws_flags; /* [Input] Flags passed to mu_wordsplit. */ 50# define MU_WRDSF_NOCMD WRDSF_NOCMD
46 int ws_options; /* [Input] (MU_WRDSF_PATHEXPAND) 51# define MU_WRDSF_REUSE WRDSF_REUSE
47 Additional options. */ 52# define MU_WRDSF_SHOWERR WRDSF_SHOWERR
48 const char *ws_delim; /* [Input] (MU_WRDSF_DELIM) Word delimiters. */ 53# define MU_WRDSF_UNDEF WRDSF_UNDEF
49 const char *ws_comment; /* [Input] (MU_WRDSF_COMMENT) Comment characters. */ 54# define MU_WRDSF_NOVAR WRDSF_NOVAR
50 const char *ws_escape[2]; /* [Input] (MU_WRDSF_ESCAPE) Characters to be escaped 55# define MU_WRDSF_ENOMEMABRT WRDSF_ENOMEMABRT
51 with backslash. */ 56# define MU_WRDSF_WS WRDSF_WS
52 void (*ws_alloc_die) (mu_wordsplit_t *wsp); 57# define MU_WRDSF_SQUOTE WRDSF_SQUOTE
53 /* [Input] (MU_WRDSF_ALLOC_DIE) Function called when 58# define MU_WRDSF_DQUOTE WRDSF_DQUOTE
54 out of memory. Must not return. */ 59# define MU_WRDSF_QUOTE WRDSF_QUOTE
55 void (*ws_error) (const char *, ...) 60# define MU_WRDSF_SQUEEZE_DELIMS WRDSF_SQUEEZE_DELIMS
56 __attribute__ ((__format__ (__printf__, 1, 2))); 61# define MU_WRDSF_RETURN_DELIMS WRDSF_RETURN_DELIMS
57 /* [Input] (MU_WRDSF_ERROR) Function used for error 62# define MU_WRDSF_SED_EXPR WRDSF_SED_EXPR
58 reporting */ 63# define MU_WRDSF_DELIM WRDSF_DELIM
59 void (*ws_debug) (const char *, ...) 64# define MU_WRDSF_COMMENT WRDSF_COMMENT
60 __attribute__ ((__format__ (__printf__, 1, 2))); 65# define MU_WRDSF_ALLOC_DIE WRDSF_ALLOC_DIE
61 /* [Input] (MU_WRDSF_DEBUG) Function used for debug 66# define MU_WRDSF_ERROR WRDSF_ERROR
62 output. */ 67# define MU_WRDSF_DEBUG WRDSF_DEBUG
63 const char **ws_env; /* [Input] (MU_WRDSF_ENV, !MU_WRDSF_NOVAR) Array of 68# define MU_WRDSF_ENV WRDSF_ENV
64 environment variables. */ 69# define MU_WRDSF_GETVAR WRDSF_GETVAR
70# define MU_WRDSF_SHOWDBG WRDSF_SHOWDBG
71# define MU_WRDSF_NOSPLIT WRDSF_NOSPLIT
72# define MU_WRDSF_KEEPUNDEF WRDSF_KEEPUNDEF
73# define MU_WRDSF_WARNUNDEF WRDSF_WARNUNDEF
74# define MU_WRDSF_CESCAPES WRDSF_CESCAPES
75# define MU_WRDSF_CLOSURE WRDSF_CLOSURE
76# define MU_WRDSF_ENV_KV WRDSF_ENV_KV
77# define MU_WRDSF_ESCAPE WRDSF_ESCAPE
78# define MU_WRDSF_INCREMENTAL WRDSF_INCREMENTAL
79# define MU_WRDSF_PATHEXPAND WRDSF_PATHEXPAND
80# define MU_WRDSF_OPTIONS WRDSF_OPTIONS
81# define MU_WRDSF_DEFFLAGS WRDSF_DEFFLAGS
82
83# define MU_WRDSO_NULLGLOB WRDSO_NULLGLOB
84# define MU_WRDSO_FAILGLOB WRDSO_FAILGLOB
85# define MU_WRDSO_DOTGLOB WRDSO_DOTGLOB
86# define MU_WRDSO_GETVARPREF WRDSO_GETVARPREF
87# define MU_WRDSO_BSKEEP_WORD WRDSO_BSKEEP_WORD
88# define MU_WRDSO_OESC_WORD WRDSO_OESC_WORD
89# define MU_WRDSO_XESC_WORD WRDSO_XESC_WORD
90# define MU_WRDSO_MAXWORDS WRDSO_MAXWORDS
91# define MU_WRDSO_BSKEEP_QUOTE WRDSO_BSKEEP_QUOTE
92# define MU_WRDSO_OESC_QUOTE WRDSO_OESC_QUOTE
93# define MU_WRDSO_XESC_QUOTE WRDSO_XESC_QUOTE
94# define MU_WRDSO_NOVARSPLIT WRDSO_NOVARSPLIT