- 22 Dec, 2011 1 commit
-
-
* libmailutils/string/wordsplit.c (alloc_space): Fix reallocation calculations. * imap4d/fetch.c (bodystructure): Output number of lines for any TEXT part, not only TEXT/PLAIN. * include/mailutils/header.h (MU_HEADER_CONTENT_LOCATION): New define. * include/mailutils/imap.h (mu_imap_fetch_bodystructure): Implement. (mu_imap_fetch_envelope): Replace data fields with a single pointer to struct mu_imapenvelope. * include/mailutils/message.h: Include datetime.h (mu_imapenvelope, mu_bodystructure): New structs. (mu_message_type): New type. (mu_message_get_imapenvelope,mu_message_imapenvelope_free) (mu_message_set_imapenvelope) (mu_bodystructure_free,mu_list_free_bodystructure) (mu_message_get_bodystructure) (mu_message_set_bodystructure): New protos. * include/mailutils/mime.h (mu_mime_param_assoc_create) (mu_mime_param_assoc_add): New protos. * include/mailutils/sys/message.h (_mu_message)<_imapenvelope> <_bodystructure>: New methods. * libmailutils/mailbox/bodystruct.c: New file. * libmailutils/mailbox/imapenv.c: New file. * libmailutils/mailbox/Makefile.am (libmailbox_la_SOURCES): Add new sources. * libproto/imap/fetch.c: Implement bodystructure. * mu/imap.c: Likewise. * testsuite/bs.c: New file. * testsuite/Makefile.am (noinst_PROGRAMS): Add bs.
Sergey Poznyakoff authored
-
- 24 Nov, 2011 2 commits
-
-
* libmailutils/string/wordsplit.c (scan_word): Return only one delimiter if MU_WRDSF_RETURN_DELIMS is on * libmailutils/tests/wordsplit.at: Reflect that.
Sergey Poznyakoff authored -
* include/mailutils/wordsplit.h (MU_WRDSF_INCREMENTAL): New flag. (MU_WRDSE_NOINPUT): New error code. * libmailutils/string/wordsplit.c (mu_wordsplit_init0): New function. (mu_wordsplit_init): Call mu_wordsplit_init0. (expvar): Use MU_WRDSF_WS instead of MU_WRDSF_SQUEEZE_DELIMS in call to subordinate mu_wordsplit. (skip_delim): If both MU_WRDSF_RETURN_DELIMS and MU_WRDSF_SQUEEZE_DELIMS are given, squeeze only the same delimiter characters. * libmailutils/tests/wordsplit.at: Add tests for incremental mode. * libmailutils/tests/wsp.c: Support incremental mode.
Sergey Poznyakoff authored
-
- 20 Nov, 2011 1 commit
-
-
* include/mailutils/wordsplit.h (MU_WRDSF_SQUOTE,MU_WRDSF_DQUOTE): New flags. (MU_WRDSF_QUOTE): Redefine as an OR of the above two. * libmailutils/string/wordsplit.c (scan_word): Treat '\'' and '"' separately, depending on the flags. * libmailutils/tests/wsp.c: Add squote and dquote options. * libmailutils/tests/wordsplit.at: Test separate quoting support.
Sergey Poznyakoff authored
-
- 17 Nov, 2011 1 commit
-
-
* include/mailutils/wordsplit.h (mu_wordsplit) <ws_escape>: New member. (MU_WRDSF_ESCAPE): New flag. (mu_wordsplit_general_unquote_copy): New function. * libmailutils/string/wordsplit.c: Remove empty nodes after whitespace trimming. If MU_WRDSF_ESCAPE is set, remove only backslashes appearing in front of a character in ws_escape. * libmailutils/tests/wordsplit.at: Test new features.
Sergey Poznyakoff authored
-
- 17 Mar, 2011 1 commit
-
-
* examples/mblconv.c (main): Return 0. * examples/murun.c (main): Fix iteration body. * imap4d/append.c: Do not pass constructed string as format argument to io_completion_response, use %s instead. * imap4d/close.c: Likewise. * imap4d/create.c: Likewise. * imap4d/delete.c: Likewise. * imap4d/rename.c: Likewise. * imap4d/status.c: Likewise. * libmailutils/base/mutil.c (mutil_parse_field_map): Fix return code in case of wordsplit failure. * libmailutils/cfg/parser.y (GETSNUM): Initialize sign. * libmailutils/stream/streamref.c (_streamref_ctl) <MU_IOCTL_SEEK_LIMITS>: Initialize lim. * libmailutils/string/wordsplit.c: Typecast format width arguments to int. * libmu_sieve/extensions/vacation.c (check_db): Initialize days. Pass correct time value to test_and_update_prop. * libproto/pop/mbox.c (pop_create_pop3_message): Fix return code. * mail/mail.c (do_and_quit): Pass the command to util_do_command via the %s format. * mail/unset.c (mail_unset): Likewise. * mh/mh_fmtgram.y (function production): LIkewise for mu_error. * mu/logger.c (mutool_logger): Fix return code in case of mu_stdstream_strerr_create failure.
Sergey Poznyakoff authored
-
- 24 Nov, 2010 1 commit
-
-
* libmailutils/string/wordsplit.c (mu_wordsplit_trimws): Do not touch quoted nodes. * libmailutils/tests/wordsplit.at: Test the above change.
Sergey Poznyakoff authored
-
- 11 Nov, 2010 1 commit
-
-
Mhl now accepts the traditional use of "ignores=", i.e. as a single statement on a line and without double-quotes around the argument. Additional quotes around variable values are not needed in most cases. The name of a component is not printed if that component is not present. The offset variable works as in MH and nmh. * mh/mh_list.c (parse_variable): Accept traditional use of "ignores=", as a single statement on a line, without double-quotes around the argument. (mhl_format_compile): Use mu_streams instead of FILE. Fix line counting. (header_is_printed, want_header): Last argument is const char *. (ovf_print): Move to the specified offset no matter what the value of prefix is. (print_component_name): New function. (eval_component): Call print_component_name and newline, if necessary (eval_body): Likewise. (eval_extras): Likewise. (eval_comp): Do not print component name, leave that to the called function. Ditto for the trailing newline. * mh/mhl.c: Ignore empty moreproc value. * mh/mhl.format: Remove extra double-quotes. * mh/tests/mhl.at: New testcase. * mh/tests/Makefile.am (TESTSUITE_AT): Add mhl.at * mh/tests/testsuite.at: Include mhl.at * libmailutils/string/wordsplit.c (scan_qstring): Force _WSNF_EMPTYOK. (mu_wordsplit_len): Make sure the tail element is not joinable * libmailutils/tests/wordsplit.at: Test these changes. * doc/texinfo/mu-mh.texi: Update the description of mhl.
Sergey Poznyakoff authored
-
- 30 Oct, 2010 1 commit
-
-
* libmailutils/string/wordsplit.c (mu_wordsplit_init): Call mu_wordsplit_free_words to reclaim the memory. (mu_wordsplit_free_words): New function. (mu_wordsplit_free): Use mu_wordsplit_free_words. * imap4d/imap4d.c (imap4d_session_setup0): Use wordsplit instead of vartab. * imap4d/imap4d.h: Don't include vartab.h. * imap4d/preauth.c (do_preauth_ident): Use mu_str_stripws instead of the static trimcrlf, which is removed. (do_preauth_program): Use wordsplit instead of vartab and mu_prog_stream_create instead of popen. * libmailutils/mailbox/mbx_default.c: Include nls.h Don't include vartab.h (mu_construct_user_mailbox_url): Use wordsplit instead of vartab. * libmailutils/server/acl.c (expand_arg): Use wordsplit instead of vartab. * libmu_auth/ldap.c (_mu_ldap_search):L Likewise. * libmu_auth/radius.c (_expand_query): Likewise. * libmu_auth/sql.c (mu_sql_expand_query): Likewise. * libproto/mailer/prog.c (_expand_sender, _expand_rcpt): Rewrite. (url_to_argv): : Use wordsplit instead of vartab. * po/POTFILES.in: Add more files.
Sergey Poznyakoff authored
-
- 29 Oct, 2010 2 commits
-
-
K/V is a new type of environment where variable names (keys) and values are stored separately in adjacent environment elements. This should simplify wordsplit initialization in many cases. * include/mailutils/wordsplit.h (MU_WRDSF_ENV_KV): New flag. * libmailutils/string/wordsplit.c (mu_wordsplit_find_env): Implement search in a K/V environment. * libmailutils/tests/wordsplit.at: Test K/V environments. * libmailutils/tests/wsp.c (bool_keytab): Implement env_kv. (make_env_kv): New function. (main): Convert environment if env_kv is given.
Sergey Poznyakoff authored -
Eventually this will lead to vartab fading out until it is removed in some point in the future. Wordsplit provides a much better variable substitution mechanism. * include/mailutils/wordsplit.h (mu_wordsplit) <ws_getvar>: Change signature. <ws_closure>: New member. (MU_WRDSF_CLOSURE): New flag. * libmailutils/string/wordsplit.c (mu_wordsplit_init): Initialize ws_closure to NULL, unless MU_WRDSF_CLOSURE is set. Do not modify ws_wordn if MU_WRDSF_DOOFFS is set. (wsnode_remove): Clear _WSNF_JOIN on the previous node if the node being deleted is the last one in chain. (expvar): Pass ws_closure as 3rd argument to ws_getvar. Insert a NULL node if the variable is not defined. * movemail/movemail.c: Use wordsplit instead of vartab. Note a side effect: the "source:*" and "dest:*" variables are now written as "source_*" and "dest_*", correspondingly. (movemail_getvar_closure): New structure. (DCL_VTX): Remove macro and its uses. (get_url_part, movemail_getvar): New functions. (set_program_id): Rewrite using wordsplit.
Sergey Poznyakoff authored
-
- 28 Oct, 2010 1 commit
-
-
The wordsplit module (borrowed from another project of mine, called 'grecs') provides a flexible and powerful mechanism for parsing input in a way similar to posix-shell. In particular, the POSIX function wordexp is a subset of the wordsplit functionality. The argcv module is now deprecated. * include/mailutils/wordsplit.h: New file. * include/mailutils/Makefile.am (pkginclude_HEADERS): Add wordsplit.h * libmailutils/string/wordsplit.c: New file. * libmailutils/string/Makefile.am (libstring_la_SOURCES): Add wordsplit.c. * include/mailutils/argcv.h (mu_argcv_join): New proto. (mu_argcv_get, mu_argcv_get_n, mu_argcv_get_np) (mu_argcv_unquote_char, mu_argcv_quote_char) (mu_argcv_quoted_length, mu_argcv_unquote_copy) (mu_argcv_quote_copy): Mark as deprecated. * include/mailutils/mailutils.h: Include wordsplit.h. * libmailutils/tests/wsp.c: New file. * libmailutils/tests/.gitignore: List wsp. * libmailutils/tests/wordsplit.at: New file. * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add wsp (TESTSUITE_AT): Add wordsplit.at. * libmailutils/tests/argcv.c: Define MU_ARCGV_DEPRECATED to avoid deprecation warnings. * libmailutils/tests/testsuite.at: Include wordsplit.at. * libmailutils/base/argcvfree.c: New file. * libmailutils/base/argcvjoin.c: New file. * libmailutils/base/argcvrem.c: New file. * libmailutils/base/Makefile.am (libbase_la_SOURCES): Add new files. * libmailutils/base/argcv.c: Define MU_ARCGV_DEPRECATED to avoid deprecation warnings. (argcv_string, argcv_free, argv_free) (mu_argcv_remove): Rewrite in separate modules. * comsat/comsat.h: Include wordsplit.h. * imap4d/imap4d.h: Likewise. * mail/mail.h: Likewise. * mh/mh.h: Likewise. * readmsg/readmsg.h: Likewise. * comsat/action.c: Use wordsplit. * imap4d/fetch.c: Likewise. * lib/mailcap.c: Likewise. * libmailutils/auth/mu_auth.c: Likewise. * libmailutils/base/mutil.c: Likewise. * libmailutils/cfg/format.c: Likewise. * libmailutils/cfg/lexer.l: Likewise. * libmailutils/cfg/parser.y: Likewise. * libmailutils/diag/gdebug.c: Likewise. * libmailutils/mailer/mailer.c: Likewise. * libmailutils/server/acl.c: Likewise. * libmailutils/stream/prog_stream.c: Likewise. * libmailutils/tests/listop.c: Likewise. * libmailutils/url/create.c: Likewise. * libmu_auth/ldap.c: Likewise. * libmu_auth/radius.c: Likewise. * libmu_sieve/sieve.l: Likewise. * libproto/mailer/mbox.c: Likewise. * libproto/mailer/smtp.c: Likewise. * libproto/mailer/smtp_gsasl.c: Likewise. * mail/mailline.c: Likewise. * mail/mailvar.c: Likewise. * mail/send.c: Likewise. * mail/util.c: Likewise. * mh/folder.c: Likewise. * mh/mh_alias.y: Likewise. * mh/mh_argp.c: Likewise. * mh/mh_init.c: Likewise. * mh/mh_list.c: Likewise. * mh/mh_msgset.c: Likewise. * mh/mh_sequence.c: Likewise. * mh/mh_whatnow.c: Likewise. * mh/mh_sequence.c: Likewise. * mh/mh_whatnow.c: Likewise. * mh/mhn.c: Likewise. * mh/send.c: Likewise. * movemail/movemail.c: Likewise. * mu/shell.c: Likewise. * readmsg/readmsg.c: Likewise. * testsuite/smtpsend.c: Likewise. * pop3d/popauth.c: Use wordsplit. Use simplified input format (username and password delimited by any amount of whitespace). Read/produce old format if invoked with the --compatibility option. * examples/aclck.c: Use wordsplit instead of argcv. * examples/header.c: Likewise. * examples/mta.c: Likewise. * examples/.gitignore: Remove pop3client. * examples/Makefile.am: Remove pop3client. * po/POTFILES.in: Add new files.
Sergey Poznyakoff authored
-