summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFiles
2017-07-05Fix the nohost MH format functionmhfmtSergey Poznyakoff2
2017-07-05MH: Rewrite the mymbox function.Sergey Poznyakoff2
* mh/mh_init.c (emailcmp): Rewrite. (email_match): New function. (mh_is_my_name): Cache Alternate-Mailboxes and mh_my_email in a static mu_address_t; use email_match to compare. * mh/tests/fmtfunc.at: Test mymbox function.
2017-07-04Add more fmtfunc testsSergey Poznyakoff2
2017-07-04Minor fixesSergey Poznyakoff3
* mh/mh_fmtgram.y (yyerror): Cast * arguments to int * mh/mh_format.h (mh_instr_t)<size>: New member. * mh/tests/fmtfunc.at (FMTFUNC): Enforce Charset:auto.
2017-07-04mu_parse_date_dtl: Minor fixSergey Poznyakoff1
* libmailutils/datetime/parsedate.y (mu_parse_date_dtl): Set tm.tm_gmtoff and tm.tm_zone upon return (if present).
2017-07-04Improve parsedate & related MH formatsSergey Poznyakoff3
* libmailutils/datetime/parsedate.y (spec production): If a non-signed number is given, treat it as a (positive) timezone, unless tz is already set, or as a year number, unless a year is already set, or throw an error otherwise. (mu_parse_date_dtl): Revert sign of the returned utc_offset * mh/mh_format.c (builtin_tzone): Compatibility fix * mh/tests/fmtfunc.at: Test more functions.
2017-07-04Revamp MH datetime format functionsSergey Poznyakoff2
* mh/mh_format.c (_parse_date): Use mu_parse_date_dtl instead of much stricter mu_parse822_date_time. Return more info. All callers changed (builtin_sday,builtin_szone): Implemented * mh/tests/fmtfunc.at: Comment out (temporarly) the tzone test
2017-07-04Move parsedate.y from base to datetime librarySergey Poznyakoff4
2017-07-04Improve parsedate parserSergey Poznyakoff2
* include/mailutils/datetime.h (MU_PD_MASK_*): New defines, taken from parsedate.y (mu_parse_date_dtl): New proto. * libmailutils/base/parsedate.y: Remove obsolete defines. Move PD_MASK_ defines to datetime.h; use functions from cctype.h and cstr.h (pd_date) <tzname>: New member (%union): New member tz (T_ZONE,T_DAYZONE): Change type to <tz> (zone productions): Set tzname. (mu_parse_date_dtl): New function. Returns detailed time information. (mu_parse_date): Rewrite as an entry point to mu_parse_date_dtl
2017-07-03Test mh format date functionsSergey Poznyakoff2
* mh/mh_format.c (builtin_sday, builtin_szone): Mark as not implemented (builtin_zone): Fix output (builtin_tzone): Fix output * mh/tests/fmtfunc.at: Test most date functions.
2017-07-03BugfixSergey Poznyakoff1
* libmailutils/address/parse822.c (mu_parse822_date_time): Set tm_yday
2017-07-03fmtcheck: use symbolic label names by defaultSergey Poznyakoff4
Actual program counters may differ between different architecture, so avoid using them in the testsuite. * mh/fmtcheck.c: New option -pc requires printing program counters. Unless this option is used, -disass prints only labels where needed. * mh/mh.h (mh_format_dump_disass): Change signature. * mh/mh_format.c (mh_format_dump_disass): Take additional flag indicating whether to print program counters. Compute and print program labels, unless this flag is non-zero. * mh/tests/fmtcomp.at: Don't expect program counters in disassembled code.
2017-07-02MH: fix formataddr.Sergey Poznyakoff5
* mh/mh_fmtgram.y (emit_funcall): Emit mhop_movs acc, reg if MHA_ACC flag is set. * mh/mh_format.c (mh_fvm_run): Clear all registers. (builtin_formataddr): Get previously accumulated addresses from R_ACC (builtin_tab): Mark formataddr with MHA_ACC, remove MHA_OPTARG (mh_format_dump_disass): Account for the new register. (mh_fvm_destroy): Free all registers. * mh/mh_format.h: New register R_ACC. It is needed to implement proper formataddr and concataddr functionality. * mh/tests/fmtcomp.at: Update. * mh/tests/fmtfunc.at: Update.
2017-07-02MH: fix the nodate format functionSergey Poznyakoff2
* mh/mh_format.c (builtin_nodate): Call mu_parse822_date_time directly. (mh_format_dump_disass): Escape literal strings on output. * mh/tests/fmtfunc.at: Test nodate.
2017-07-01Minor fixesSergey Poznyakoff3
2017-07-01MH format: fix processing of special functions: putstrf, putnumf, lit, and numSergey Poznyakoff5
* mh/mh_fmtgram.y (node): Replace noprint with printflag. (escape production): Consult printflag to decide whether to amd how to print (funcall production): Rewrite logic (yylex_func): Make a clear distinction between literals and inlined ctls, which require leading whitespace, and funcalls and components, that don't tolerate it. (emit_funcall): Process special functions separately * mh/mh_format.c (builtin_tab): Mark lit, num, putstrf, and putnumf as specials. * mh/mh_format.h: Revamp MHA_ flags * mh/tests/fmtcomp.at: Update. * mh/tests/fmtfunc.at: Add tests for putstrf and putnumf
2017-07-01MH: Fix mh_builtin field misnomerSergey Poznyakoff2
2017-07-01More fixes in MH format parserSergey Poznyakoff5
* mh/mh_fmtgram.y (codegen_node): Generate mhop_printlit instruction for fmtnode_print node with a literal or number argument. * mh/mh_format.c (mh_fvm_run): Handle mhop_printlit * mh/mh_format.h (mhop_printlit): New opcode. * mh/tests/fmtcomp.at: Update. * mh/tests/fmtfunc.at: Add more tests.
2017-06-30Improve MH format parser.Sergey Poznyakoff10
* mh/fmtcheck.c (main): Assume -dump if no input message and no -disass is given. * mh/mh_fmtgram.y: Enable error-verbose mode (funcall production): Use MHA_OPTARG_NIL flag to provide 0 (or "") default argument. (yyerror): Improve location printer (yylex_initial): Correctly handle %% * mh/mh_format.c (mh_string_move): Rename to mh_string_copy (builtin_msg, builtin_cur): Try to obtain message number only if msgno is 0. (builtin_tab): Fix definitions of comp, lit, and num (mh_format_dump_disass): Print width. * mh/mh_format.h (MHA_OPTARG_NIL): New flag. * mh/tests/fmtcomp.at: New file. * mh/tests/fmtfunc.at: New file. * mh/tests/Makefile.am: Add new files. * mh/tests/testsuite.at: Likewise. * mh/tests/atlocal.in (MHETCDIR): New variable. * mh/tests/scan.at: Test external formats.
2017-06-30Introduce explicit data type for MH format virtual machineSergey Poznyakoff9
* mh/mh.h (mh_fvm_t): New typedef. (mh_format): Remove. (mh_fvm_create,mh_fvm_destroy) (mh_fvm_set_output,mh_fvm_set_width) (mh_fvm_set_format,mh_fvm_run): New protos. * mh/mh_format.c: Likewise. * mh/mh_format.h (mh_machine): Rename to mh_fvm * mh/fmtcheck.c: Rewrite using mh_fvm_ functions. * mh/inc.c: Likewise. * mh/mh_list.c (print_header_value): Likewise. * mh/repl.c: Likewise. * mh/scan.c: Likewise. * mh/sortm.c: Likewise.
2017-06-30Restore version output expected by mh-eSergey Poznyakoff1
* mh/mh_getopt.c (mh_version_hook): Print version in format expected by mh-e (process_std_options): Produce usual version output when responding to --version
2017-06-29Add special flag for debugging MH format parserSergey Poznyakoff3
* mh/mh.h (MH_FMT_PARSE_DEBUG): New flag. * mh/fmtcheck.c: Pass the MH_FMT_PARSE_DEBUG flag, if required. * mh/mh_fmtgram.y (mh_format_debug): Remove. (format_parse): Enable debugging if MH_FMT_PARSE_DEBUG flag is set
2017-06-29MH: minor fix in format lexer.Sergey Poznyakoff1
* mh/mh_fmtgram.y (yylex): Don't return empty strings
2017-06-29Improve mhl format parserSergey Poznyakoff1
* mh/mh_list.c: Keep track of input locations
2017-06-29Fix wordsplit MU_WRDSF_INCREMENTAL | MU_WRDSF_NOSPLITSergey Poznyakoff2
* libmailutils/string/wordsplit.c (mu_wordsplit_process_list): Update wsp->ws_endp in nosplit mode * libmailutils/tests/wordsplit.at: Test incremental nosplit
2017-06-29Bugfix in libdatetimeSergey Poznyakoff1
* libmailutils/datetime/utcoff.c (mu_utc_offset): Correct the difference if computed at the break of a day.
2017-06-29Improve format parser APISergey Poznyakoff14
* mh/scanfmt.c: New file. * mh/Makefile.am: Add scanfmt.c * mh/mh.h (mh_list_format): Remove extern (mh_format_parse): Remove proto. (mh_format_string_parse,mh_format_file_parse) (mh_scan_format): New functions. (mh_audit_open, mh_audit_close): Operate on mu_stream_t, instead of FILE*. * mh/mh_fmtgram.y (mh_format_string_parse) (mh_format_file_parse): New functions. * mh/mh_format.c (print_fmt_string): Make sure trailing newline is output, even if it is the Nth character on the line (N=width). * mh/mh_getopt.c (mh_opt_parse_formfile) (mh_opt_parse_format): New functons. * mh/mh_getopt.h (mh_opt_parse_formfile) (mh_opt_parse_format): New protos. * mh/mh_init.c (mh_list_format): Remove. (mh_audit_open, mh_audit_close): Operate on mu_stream_t, instead of FILE*. * mh/fmtcheck.c: Use new format parsing API. * mh/inc.c: Likewise. * mh/mh_list.c: Likewise. * mh/repl.c: Likewise. * mh/scan.c: Likewise. * mh/sortm.c: Likewise.
2017-06-27MH: Fix repl formatsSergey Poznyakoff3
* mh/etc/replcomps: Replace calls to %(concat) * mh/etc/replgroupcomps: Likewise. * mh/repl.c: Fix embedded format.
2017-06-27MH format: fix location tracking and error diagnosticsSergey Poznyakoff4
* mh/mh_fmtgram.y: Use mu_linetrack_t to keep track of input location. Handle %; comments. * mh/mh_format.c (mh_format): Change semantics of mhop_atoi and mhop_itoa. (builtin_tab): Fix returns types of trim, date2local, and date2gmt. * mh/mh_format.h: Document changes. * mh/mh_init.c (mh_read_formfile): Read entire file.
2017-06-27Fix mu_diag_at_locus_range and mu_vdiag_at_locus_range.Sergey Poznyakoff1
* libmailutils/diag/diag.c (mu_vdiag_at_locus_range): Reset stream mode.
2017-06-27Further work on format vmSergey Poznyakoff10
* mh/mh.h (mh_format): Change signature. (MH_FMT_FORCENL): New define. * mh/mh_format.h (MHA_OPT_CLEAR): Remove. (MHA_LITERAL,MHA_VOID): New flags. (mh_machine) <flags>: New member. * mh/mh_fmtgram.y (funcall production): Fix argument interpretation (else_part production): Allow for empty expression. (token_function): Use MU_CTYPE_IDENT instead of the more restrictive MU_CTYPE_ALPHA. * mh/mh_format.c (node_free): Accept NULL as argument (emit_funcall): Assign literal arguments to R_ARG registers (codegen_node): Fix coding the mhop_setn instruction. Clear both str and reg if the ELSE part of a conditional is empty. (mh_string_load): Fix size computation. (mh_string_move): Don't clear the source register. (mh_format): Reorder parameters, pass flags as 6th parameter. Emit final newline if MH_FMT_FORCENL is set, unless the last character output is newline. (mh_format_str): Rewrite function. (builtin_lit): Implement (builtin_friendly): Fix register assignment (builtin_addr): Pass R_ARG to R_REG verbatim, if it cannot be parsed as a RFC822 address. (builtin_decode): Don't clear str reg. (builtin_concat): Remove. The implementation contradcicts the principles of the format VM; besides, the same functionality could be easily achieved by using ctls (builtin_tab): Put additional flags * mh/fmtcheck.c (run): Update call to mh_format * mh/inc.c (list_message): Likewise. Emit warning about not-implemented audit feature. * mh/mh_list.c (_destroy_value): Remove spurious call to free(). * mh/repl.c: Fix calls to mh_format and mh_format_parse. * mh/scan.c: Likewise. * mh/sortm.c: Likewise.
2017-06-27Improve cctype APISergey Poznyakoff2
* include/mailutils/cctype.h (MU_CTYPE_IDENT) (MU_CTYPE_HEADR): New character classes. (mu_isident,mu_isheadr): New macros. * libmailutils/string/muctype.c: Mark valid identifier and header constituents as such.
2017-06-26Start rewriting MH format functions.Sergey Poznyakoff7
* mh/fmtcheck.c: New option -disassemble * mh/mh.h: Move format-related declarations to mh_format.h (mh_format_parse): Change signature. (mh_format): Change signature. (mh_format_dump_code) (mh_format_dump_disass): New protos. (mh_decode_2047): Change signature. * mh/mh_fmtgram.y: Rewrite from scratch. First, build a parse tree, then use it to generate code. * mh/mh_format.c: Rewrite from scratch. * mh/mh_format.h: Move format-related declarations from mh.h * mh/mh_init.c (mh_decode_2047): Text is const. * mh/mh_list.c: Fix calls to mh_format_parse and related objects.
2017-06-21mh: determine output width automaticallySergey Poznyakoff10
* mh/fmtcheck.c: Take file name as optional argument. Run format on it, if supplied * mh/mh.h (mh_width): New proto. * mh/inc.c: Don't initialize width. * mh/mh_format.c (mh_format): Use mh_width, if width is 0. * mh/mh_list.c (mhl_format_run): Use mh_width, if width is 0. * mh/mh_init.c (mh_width): New function. * mh/repl.c: Likewise. * mh/scan.c: Likewise. * mh/sortm.c: Likewise. New option -width
2017-06-20Merge branch 'master' of ssh://git.savannah.gnu.org/srv/git/mailutilsSergey Poznyakoff1
2017-06-20Revert previous commit. Require gettext 0.19Sergey Poznyakoff1
2017-06-20Remove gettext version requirementSergey Poznyakoff1
2017-06-20Version 3.2.93Sergey Poznyakoff2
2017-06-20Rework emitting source locations in sieve codeSergey Poznyakoff4
* include/mailutils/locus.h (mu_locus_point_eq): New function. * libmu_sieve/prog.c (mu_i_sv_code): Emit the _mu_i_sv_instr_locus if locus changed. (mu_i_sv_locus): Raise the changeloc flag and set the locus, instead of immediately emitting location change code. * libmu_sieve/runtime.c (_mu_i_sv_instr_locus): New function. (_mu_i_sv_instr_source,_mu_i_sv_instr_line) (_mu_i_sv_instr_col): Remove. * libmu_sieve/sieve-priv.h (mu_sieve_machine) <changeloc>: New member.
2017-06-20Bugfix in sieve librarySergey Poznyakoff1
* libmu_sieve/sieve-gram.y: Add missing assignment to $$ in testlist production. This fixes improper handling of anyof and allof
2017-06-20Commit missing fileSergey Poznyakoff1
2017-06-20API for formatting message sets on outputSergey Poznyakoff14
* libmailutils/msgset/print.c (mu_msgset_formats): New global. (mu_stream_msgset_format): New function. * include/mailutils/msgset.h (mu_msgset_format): New struct. (mu_msgset_fmt_imap, mu_msgset_fmt_mh): New defines. (MU_MSGSET_IGNORE_TRANSERR): New flag (mu_msgset_copy, mu_msgset_translate): New protos. (mu_stream_msgset_format, mu_msgset_imap_print): New protos. (mu_msgset_print): Deprecate. * libmailutils/imapio/sendmsgset.c: Use mu_msgset_imap_print instead of mu_msgset_print. * mu/libexec/imap.c: Likewise. * libmailutils/msgset/Makefile.am: Add copy.c * libmailutils/msgset/add.c (mu_msgset_add_range): Translate if message set mode doesn't match the requested one. * libmailutils/msgset/sub.c (mu_msgset_sub_range): Likewise. * libmailutils/msgset/trans.c (_mu_msgset_translate_pair): Act according to the mode argument. (mu_msgset_translate): New function. * libmailutils/tests/msgset.c: New option -mh * mh/mh_sequence.c (write_sequence): Rewrite. * testsuite/msgset.c: Optionally translate uids to msgnums and vice-versa.
2017-06-18refile: eliminate refiled messages from all sequencesSergey Poznyakoff5
* mh/Makefile.am: Add seqelim.c * mh/mh.h (mh_sequences_elim): New proto. * mh/seqelim.c: New file. * mh/refile.c (main): Fixup sequences after refiling. * mh/rmm.c: Fixup sequences using mh_sequences_elim
2017-06-18linetrack: handle #line directives without file name.Sergey Poznyakoff4
* include/mailutils/diag.h (mu_vdiag_at_locus_range): New proto. * libmailutils/locus/linetrack.c (mu_linetrack_origin): accept locus point with mu_file==NULL. Reuse current file name in this case. This is to simplify handling of #line directives without file name. * libmailutils/tests/linetrack.c: Implement #line directive. * libmailutils/tests/linetrack.at: Add new test.
2017-06-18Improve line tracker.Sergey Poznyakoff5
The new version is able to hold input history from several source lines, which makes it easier to implement #line directives in lexers. * include/mailutils/locus.h (mu_linetrack_stat): Remove start_line (mu_linetrack_origin): New proto. * libmailutils/locus/linetrack.c: Improve indexing. Keep track of several input files. * libmailutils/tests/linetrack.at: Add new tests. * libmailutils/tests/linetrack.c: Improve command set. * mimeview/grammar.y (make_node): Initialize locus
2017-06-17Minor change in the testsuiteSergey Poznyakoff1
* mh/tests/send.at: Make expected text version-independent
2017-06-16Version 3.2.92Sergey Poznyakoff3
2017-06-16Merge branch 'master' into locusSergey Poznyakoff14
2017-06-15Make sure all loci are properly initialized before first use.Sergey Poznyakoff7
Clean up semantics of initializers. Each locus type can be initialized either statically (by assigning the MU_LOCUS_*_INITIALIZER macro), or dynamically (by calling mu_locus_*_init function). Whatever method is used, it is important that it be initialized prior to using any other mu_locus_* function. * include/mailutils/locus.h (mu_locus_point_init): Takes single argument. Returns nothing. (mu_locus_range_init): New proto. * libmailutils/locus/locus.c (mu_locus_point_init): Rewrite. (mu_locus_range_init): New function. * libmailutils/cfg/parser.y (mu_cfg_alloc_node): Initialize locus. * libmailutils/tests/logstr.c: Fix printf argyment types. * libmu_sieve/extensions/moderator.c (moderator_filter_message): Initialize locus. * libmu_sieve/sieve-gram.y (node_alloc): Likewise. * mu/libexec/logger.c (parse_locus_point, set_locus): Likewise.
2017-06-15Fix id reference countingSergey Poznyakoff8
* include/mailutils/locus.h: Add copyleft. (mu_ident_stat): New proto. * include/mailutils/types.hin (mu_locus_DEPRECATED): Update commit. Include link to the wiki article. * include/mailutils/yyloc.h: Add copyleft. * libmailutils/locus/ident.c (mu_ident_stat): New function. * libmailutils/locus/locus.c (mu_locus_point_init) (mu_locus_point_copy): Don't touch destination unless setting mu_file member succeeds. (mu_locus_range_copy): deinitialize dest before assignment. * libmailutils/stream/logstream.c (_log_write): Use mu_locus_range_copy to save locus. (mu_ioctl_logstream_get_locus_deprecated) (mu_ioctl_logstream_set_locus_deprecated): Include link to the wiki article. * libmailutils/tests/linetrack.c (main): Destroy tracker before exiting. * libmailutils/tests/logstr.c: Make it possible to run selected tests.

Return to:

Send suggestions and report system problems to the System administrator.