2022-02-03 Thien-Thi Nguyen Release: 5.10.1 2022-01-31 Thien-Thi Nguyen [int] Use ‘ATTRIBUTE_FORMAT’ from gnulib module ‘attribute’ * base.h (printf_string): Use ‘ATTRIBUTE_FORMAT’; define unconditionally. 2022-01-31 Thien-Thi Nguyen [int] Use ‘ATTRIBUTE_NONNULL’ from gnulib module ‘attribute’ * base.h (ARG_NONNULL, ALL_NONNULL): Use ‘ATTRIBUTE_NONNULL’. 2022-01-31 Thien-Thi Nguyen [int] Use ‘MAYBE_UNUSED’ from gnulib module ‘attribute’ * base.h: #include "attribute.h". (RCS_UNUSED): ...here, instead of ‘_GL_UNUSED’. 2022-01-27 Thien-Thi Nguyen rlog: Handle unexpected byte in edit script Reported by Ray Bellis: https://mail.gnu.org/r/bug-rcs/2022-01/msg00000.html * rlog.c (count_a_d): If the edit script stanza does not start w/ the expected 'a' or 'd' dispatch, display error message with diagnostic and abort. 2022-01-27 Thien-Thi Nguyen [int] Move USED_IF_HAVE_MADVISE to beginning of param decl * b-fro.c (fro_trundling): ...here, for arg ‘sequential’. 2021-04-05 Paul Eggert [int] Don’t use SIGSTKSZ in #if Problem reported by Christoph Karl in: https://lists.gnu.org/r/bug-rcs/2021-04/msg00000.html * b-isr.c (ISR_STACK_SIZE): Remove. (isr_init): Don’t assume SIGSTKSZ is a preprocessor constant. 2020-10-24 Thien-Thi Nguyen [int] Use ‘NULL’ instead of '\0'. This addresses a warning reported by clang in Hydra build . * co.c (buildjoin): ...here. * rcs.c (buildeltatext): Likewise. * rcsdiff.c (rcsdiff_main): Likewise. 2020-10-23 Thien-Thi Nguyen [int] Rewrite "conditional literal" as ‘if’ statement. This addresses the error reported by clang in Hydra build . * b-excwho.c (set_uid_to): Rewrite "STRING" + CONDITIONAL-OFFSET construct as arg to ‘PFATAL’, as an ‘if’ statement w/ two separate string literals in two separate ‘PFATAL’ calls. 2020-10-20 Thien-Thi Nguyen Release: 5.10.0 2019-10-28 Thien-Thi Nguyen [int] Declare ‘die’ to be ‘exiting’. * b-complain.c (die): ...here. 2019-10-28 Thien-Thi Nguyen [int] Assume 2nd arg to ‘reap’ is non-NULL. * b-feph.c (reap): Remove NULL check, early return. 2019-10-27 Thien-Thi Nguyen Fix bug: Include trailing slash in default ‘-x’ value. Regression introduced 2010-03-03, "Reduce dependency-transitivity of src/Makefile variables." * rcsutil.c (gnurcs_init): ...here, for ‘BE (pe)’. 2019-10-15 Thien-Thi Nguyen [int] Declare ‘valid_filename_p’ static. Omission from 2018-04-25, "Add abstraction: get_cwd_filenames". * rcsclean.c (valid_filename_p): ...here. 2018-06-27 Thien-Thi Nguyen [int C] Remove ‘ALL_NONNULL’ decl from ‘fro_close’. Oversight from 2018-04-03, "Add {ALL,ARG}_NONNULL to func decls". * b-fro.h (fro_close): ...here. 2018-06-27 Thien-Thi Nguyen [C int] Add cast to ‘size_t’. This avoids a GCC 4.9 warning. * rcsgen.c (putstring): ...here, for computing ‘span’ when ‘delim’ is non-NULL. 2018-06-01 Thien-Thi Nguyen [int] Arrange for ‘FULLDATESIZE’ + 1 to be 32. * base.h (DATESIZE): Bump down year component to 6. 2018-04-29 Thien-Thi Nguyen [C int] Replace some ‘if’..‘else’ assignments w/ ‘?:’. * ci.c (ci_main): ...here, for ‘bud.d.author’, ‘bud.d.state’. * co.c (co_main): Likewise, for ‘author’. * rcs.c (removerevs): Likewise, for ‘dc->cuttail’. * rlog.c (getnumericrev): Likewise, for ‘e.string’. 2018-04-29 Thien-Thi Nguyen [C int] Remove unnecessary ‘else’. * rcsfnms.c (isSLASH): ...here, after ‘return’ in THEN branch. 2018-04-29 Thien-Thi Nguyen [C int] Use ‘strspn’, ‘strtok_r’ more. * co.c (ks_hws): New static string. (SKIP_HWS): New macro. (addjoin): Skip horizontal ws at start of ‘spec’; prior to returning ‘eot’, make it skip horizontal ws. (preparejoin): Rename 1st arg to ‘argv’; use ‘strtok_r’; use ‘SKIP_HWS’. 2018-04-29 Thien-Thi Nguyen [int] Simplify ‘co -j’ common ancestor logic. The change 2010-04-27, "New abstractions: extend, wextend" introduced a small logic optimization unrelated to its primary purpose: Do search then push. In the case where the search fails, the push is not necessary, anyway. However, in that case, we require a ‘goto’. This change (reversion) allows us to eliminate the ‘goto’. As a tiny side benefit, doing the push first (unshadowed by the result of the search) helps the coverage numbers. * co.c (preparejoin): Revert the order of sub-operations to push-search from search-push; on search failure, don't bother w/ ‘goto’ as that is now implicit in the control flow. 2018-04-29 Thien-Thi Nguyen [int] Consolidate identical ‘RFATAL’ calls. * co.c (preparejoin): Add label ‘incomplete’ to second call; use ‘goto’ for first; restructure flow slightly to check error condition earlier. 2018-04-29 Thien-Thi Nguyen [C int] Rewrite func ‘getaccessor’ to use ‘strtok_r’. * rcs.c (ks_ws_comma): New static string. (getaccessor): Rewrite. (rcs_main): Update calls to ‘getaccessor’. 2018-04-29 Thien-Thi Nguyen [int] Add abstraction: tokenize * rlog.c (ks_delims): New static string. (PUSH): Move macro earlier in file; nfc. (tokenize): New static func. (getlocker, getauthor, getstate): Use ‘tokenize’. 2018-04-28 Thien-Thi Nguyen [C int] Rewrite func ‘addjoin’ to use ‘strcspn’. * co.c (addjoin): Rewrite. 2018-04-27 Thien-Thi Nguyen rlog: Fix bug: For ‘-w’, default to user login. Regression introduced 2010-05-03, "Use ‘struct link’ more". * rlog.c (getauthor): Ensure list finalization and outarg update also when no logins are specified. 2018-04-25 Thien-Thi Nguyen [int] Add abstraction: get_cwd_filenames * rcsclean.c (get_directory): Delete func. (valid_filename_p, get_cwd_filenames): New static funcs. (rcsclean_main): Use ‘get_cwd_filenames’. 2018-04-23 Thien-Thi Nguyen [int C] Drop trailing "p" or "_p" from boolean var names. M(NEW,OLD) ≡ "Rename member to NEW from OLD". A(NEW,OLD) ≡ "Rename arg to NEW from OLD". L(NEW,OLD) ≡ "Rename local var to NEW from OLD". * base.h (struct behavior): M (unbuffered, unbufferedp). (struct flow): M (erroneous, erroneousp). * b-excwho.h (lock_memq): A (login, loginp). * b-fro.h (fro_trundling): A (sequential, sequentialp). (atat_display): A (ensure_end_nl, ensure_newline_p). * maketime.h (struct maketimestuff): M (tzset_already_called, tzset_called_p). * b-complain.c (unbuffer_standard_error, vcomplain) (ERRONEOUS_X): Update references. * b-excwho.c (lock_memq): A (login, loginp). * b-fro.c (fro_trundling): A (sequential, sequentialp). (atat_display): A (ensure_end_nl, ensure_newline_p). * b-grok.c (maybe_read_num): A (must_be_delta, must_be_delta_p). (start_atat): A (blank, blankp). (maybe_read_atat): L (newline, newlinep). * ci.c (cleanup, ci_main): Update references. * co.c (cleanup, buildjoin, co_main): Likewise. * ident.c (match): L (subversion_style, svn_p). * maketime.c (local_tm): Update references. * merge.c (main): Likewise. * rcs.c (struct adminstuff): M (headstate_changed, headstate_changed_p). (cleanup, getstates, rcs_main): Update references. * rcsclean.c (cleanup, rcsclean_main): Likewise. * rcsdiff.c (struct unique): M (eqval_ok, eqval_p). (minus_y, minus_D, longopt_maybe_p, cleanup) (rcsdiff_main): Update references. * rcsedit.c (naturalize): A (symbolic, symbolicp). (rcswriteopen): L (symbolic, symbolicp). (donerewrite): Update references. * rcsfnms.c (pairnames): Likewise. * rcsgen.c (getsstdin): L (discard, discardp); L (dot_in_first_column, dot_in_first_column_p). * rcskeep.c (sorry, badly_terminated, get0val) (getval): A (save, savep). (keepid, getoldkeys): Update references. * rcsmerge.c (rcsmerge_main): Likewise. * rlog.c (struct daterange): M (open_end, oep). (cleanup): Update references. (count_a_d): L (add, addp). (extdate): L (open_end, oep); update references. (getdatepair, rlog_main): Update references. 2018-04-22 Thien-Thi Nguyen [int] Use more descriptive local var, ‘NUM_EQ’ more. * rcs.c (removerevs): ...here, to note revs are ‘different’. 2018-04-22 Thien-Thi Nguyen [int] Drop unused enum element in --help/--version processing. * gnu-h-v.c (hv_option_values): Delete ‘hv_unrecognized’. (check_hv): Don't bother handling ‘hv_unrecognized’. 2018-04-20 Thien-Thi Nguyen [int] Make ‘yesorno’ also output '?', answer choices, default answer. * rcsgen.c (yesorno): ...here. * ci.c (getlogmsg): Update call to ‘yesorno’. * co.c (rmworkfile): Likewise. * rcs.c (sendmail, buildtree): Likewise. 2018-04-20 Thien-Thi Nguyen [int] Make ‘exit_diff_trouble’ also output trailing newline. * rcsutil.c (exit_diff_trouble): ...here, after output of all other formatted args. (runv): Update all callers. 2018-04-13 Thien-Thi Nguyen [int] Drop support for tracing allocation provenance. * b-divvy.c (USED_FOR_DEBUG): Delete #define. (alloc, zlloc): Drop 2nd arg ‘what’. * b-divvy.h (alloc, zlloc): Likewise in func decls. (ZLLOC, FALLOC, FZLLOC): Update macros accordingly. * b-esds.c (STRUCTALLOC): Likewise. * b-fro.c (fro_open): Update call to ‘alloc’. * b-grok.c (STRUCTALLOC): Update macro accordingly. (maybe_read_atat, make_hash_table, empty_repo, full): Update calls to ‘alloc’, ‘zlloc’. * b-isr.c (isr_init): Update call to ‘alloc’. * b-kwxout.c (keyreplace): Likewise. * rcsedit.c (naturalize): Likewise. * rcsfnms.c (getfullRCSname): Likewise. * rlog.c (count_a_d): Update call to ‘zlloc’. 2018-04-13 Thien-Thi Nguyen [int C] Add {ALL,ARG}_NONNULL to func decls. * b-complain.h (vcomplain, complain, diagnose, syserror) (generic_warn, generic_error, generic_fatal, fatal_syntax) (fatal_sys): ...here, following arglist. * b-divvy.h (make_space, alloc, zlloc, intern, brush_off) (forget, accf, accumulate_byte, accs, finish_string, pointer_array) (close_space): Likewise. * b-esds.h (extend, wextend, prepend, wprepend): Likewise. * b-excwho.h (stat_mine_p, caller_login_p, lock_memq, lock_on) (lock_drop, addlock_maybe): Likewise. * b-fb.h (testIerror, testOerror, fopen_safer, Ozclose, aflush) (afputc, newline, aputs, aprintf): Likewise. * b-feph.h (keepdirtemp): Likewise. * b-fro.h (fro_open, fro_zclose, fro_close, fro_tello) (fro_move, fro_try_getbyte, fro_must_getbyte, fro_trundling) (fro_spew_partial, fro_spew, string_from_atat, atat_put) (atat_display): Likewise. * b-grok.h (empty_repo, grok_all, grok_resynch): Likewise. * b-isr.h (isr_init, access_page, isr_do): Likewise. * b-kwxout.h (expandline): Likewise. * b-peer.h (one_beyond_last_dir_sep, find_peer_prog): Likewise. * base.h (looking_at, , recognize_kwsub, str2expmode) (recognize_keyword, merge, unmake_editstuff, un_link) (snapshotedit, copystring, enterstring, rcswriteopen) (chnamemod, setmtime, findlock, addsymbol, initdiffcmd) (getdiffcmd, rcsfcmp, basefilename, rcssuffix, rcsreadopen) (pairnames, buildrevision, cleanlogmsg, yesorno, putdesc) (getsstdin, format_assocs, format_locks, puttree, putdtext) (putstring, putdftext, checkid, checksym, checksid, checkssym) (take, cmpnumfld, cmpdate, compartial, genrevs, gr_revno) (delta_from_ref, fully_numeric, namedrev, time2date, str2date) (date2time, zone_set, date2str, gnurcs_init, bad_option) (chk_set_rev, minus_p, parse_revpairs, set_empty_log_message) (str_save, cgetenv, awrite, runv, setRCSversion, getRCSINIT) (file_mtime): Likewise. * gnu-h-v.h (nice_getopt, display_version, check_hv): Likewise. * maketime.h (local_tm, difftm, str2time, tm2time) (adjzone): Likewise. * partime.h (partime, parzone): Likewise. 2018-04-11 Thien-Thi Nguyen Consider subsecond resolution for workfile-changed-during-checkin. * ci.c (ci_main): Don't compare .st_mtime members directly; instead, use ‘get_stat_mtime’, ‘timespec_cmp’. 2018-04-11 Thien-Thi Nguyen Fix bug 52288 part 2: Retain working file subsecond mtime. The first part was incomplete; subsecond resolution mtime was maintained for the RCS file, but not for the working file. * ci.c: #include "stat-time.h". (struct bud): Add member ‘work_mtime’. (ci_main): Save full resolution work mtime in ‘bud.work_mtime’; if given ‘-d’, use that value directly for ‘wtime’. 2018-04-11 Thien-Thi Nguyen Use subsecond resolution for atime given ‘-T’. * base.h (behavior.now): Change type to ‘struct timespec’. * ci.c (getcurdate): Use ‘now.tv_sec’. * rcsedit.c (setmtime): Use ‘BE (now)’ for ‘amtime[0]’. * rcstime.c (str2date): Use ‘now.tv_sec’. * rcsutil.c (gnurcs_init): Use ‘gettime’ to init ‘BE (now)’. 2018-04-09 Thien-Thi Nguyen Fix bug 52288: Make ‘-T’ support subsecond resolution. The ‘donerewrite’ arg rename was an omission from 2018-04-01, "Rename ‘donerewrite’ second arg". * base.h (chnamemod, setmtime): Change type of arg ‘mtime’ to ‘const struct timespec’. (donerewrite): Likewise, renaming second arg from ‘newRCStime’ to ‘mtime’. (file_mtime): Change return type to ‘struct timespec’. * ci.c: #include "timespec.h". (fixwork): Change type of arg ‘mtime’ to ‘const struct timespec’. (ci_main): Change type of local vars ‘mtime’, ‘wtime’, ‘fs_mtime’ to ‘struct timespec’; use ‘make_timespec’, ‘unspecified_timespec’ for ‘wtime’; use ‘unspecified_timespec’, ‘timespec_cmp’ for ‘donerewrite’ second arg; use ‘unspecified_timespec’ for ‘mtime’. * co.c: #include "timespec.h". (co_main): Use ‘make_timespec’ for ‘chnamemod’ 6th arg. * rcsedit.c (chnamemod): Change type of ‘mtime’ arg to ‘const struct timespec’. (setmtime): Likewise; adjust arg to TIME_UNSPECIFIED_P accordingly; assign ‘mtime’ directly to ‘amtime[1]’. (donerewrite): Change type of ‘mtime’ arg to ‘const struct timespec’. * rcsutil.c: #include "stat-time.h". (file_mtime): Change type of return value to ‘struct timespec’; use ‘get_stat_mtime’, ‘unspecified_timespec’. 2018-04-01 Thien-Thi Nguyen [C] Use ‘?:’ expression for local var. * ci.c (ci_main): ...here, for var ‘wtime’. 2018-04-01 Thien-Thi Nguyen [int] Use ‘make_timespec’ more. * rcsedit.c: #include "timespec.h". (setmtime): Use ‘make_timespec’. 2018-04-01 Thien-Thi Nguyen [int] Add abstraction: ZERO_NANOSECONDS * base.h (ZERO_NANOSECONDS): New #define. * rcsutil.c (unspecified_timespec): Use ‘ZERO_NANOSECONDS’. 2018-04-01 Thien-Thi Nguyen [int] Rename ‘donerewrite’ second arg. * rcsedit.c (donerewrite): Rename second arg to ‘mtime’. 2018-03-31 Thien-Thi Nguyen [int] Add abstraction: file_mtime * rcsutil.c (file_mtime): New func. * base.h (file_mtime): New func decl. * ci.c (ci_main): Add local var ‘fs_mtime’; use ‘file_mtime’. * co.c (co_main): Use ‘file_mtime’. * rcs.c (rcs_main): Likewise. * rcsclean.c (rcsclean_main): Likewise. 2018-03-31 Thien-Thi Nguyen [int] Add abstraction: unspecified_timespec * rcsutil.c: #include "timespec.h". (unspecified_timespec): New func. * base.h (unspecified_timespec): New func decl. 2017-10-30 Thien-Thi Nguyen [int] Add abstractions: TIME_UNSPECIFIED, TIME_UNSPECIFIED_P * base.h (TIME_UNSPECIFIED): New #define. (TIME_UNSPECIFIED_P): New macro. * ci.c (ci_main): Use ‘TIME_UNSPECIFIED’. * co.c (co_main): Likewise. * rcs.c (rcs_main): Likewise. * rcsclean.c (rcsclean_main): Likewise. * rcstime.c (date2str): Likewise. * rcsedit.c (setmtime): Use ‘TIME_UNSPECIFIED_P’. 2017-10-29 Thien-Thi Nguyen [int] Use ‘utimens’ instead of ‘utime’. * rcsedit.c: #include "utimens.h". (setmtime): Use ‘utimens’ instead of ‘utime’. 2017-10-28 Thien-Thi Nguyen [build] Use gnulib module ‘utimens’. * Makefile.am (LDADD): Append $(LIB_CLOCK_GETTIME). 2017-10-28 Thien-Thi Nguyen [int] Improve readability of some ‘?:’ expressions. This is mostly done by adding whitespace to either: (a) move the entire expression, in an argument context, onto its own line; or (b) ensure the ‘?’ and ‘:’ are at "code bol". In some cases grouping parens are added to help distinguish nested ‘?:’ expressions. * b-kwxout.c (keyreplace): ...here. * ci.c (fixwork): Likewise. * co.c (co_main): Likewise. * maketime.c (tm2time): Likewise. * partime.c (parse_ranged): Likewise. * rcsgen.c (buildrevision, putadmin, putdelta): Likewise. * rcsmap.c (checkidentifier): Likewise. * rcsmerge.c (rcsmerge_main): Likewise. * rcsrev.c (cmpnumfld, absent, genbranch): Likewise. * rcstime.c (date2str): Likewise. * rcsutil.c (cgetenv, movefd): Likewise. * rlog.c (putadelta, rlog_main): Likewise. 2017-09-28 Thien-Thi Nguyen [int] Rename ‘datesize’ to ‘DATESIZE’; consolidate. * base.h (yearlength): Delete #define, incorporating value into... (datesize): Delete #define. (DATESIZE): ...new #define. (FULLDATESIZE): Use ‘DATESIZE’. (time2date, str2date, date2time, date2str): Likewise. * ci.c (struct bud): Likewise, for member ‘getcurdate_buffer’. (ci_main): Likewise. * co.c (co_main): Likewise. * rcsdiff.c (setup_label, rcsdiff_main): Likewise. * rcsrev.c (cantfindbranch): Likewise. * rcstime.c (time2date, str2date, date2time, date2str): Likewise. * rlog.c (struct daterange): Likewise, for members ‘beg’, ‘end’. (recentdate, getdatepair): Likewise. 2017-09-28 Thien-Thi Nguyen [int] Use ‘strncpy’ less. * rlog.c (getdatepair): Use ‘memcpy’ directly. (ZERODATE): New #define. (KSTRCPY): Delete macro. (rlog_main): Use ‘memcpy’, ‘ZERODATE’. 2017-09-28 Thien-Thi Nguyen [int] Add abstraction: FULLDATESIZE * base.h (zonelenmax): Delete #define, folding value into... (FULLDATESIZE): ...this new #define. (date2str): Use ‘FULLDATESIZE’. * b-kwxout.c (keyreplace): Likewise. * ci.c (getlogmsg, ci_main): Likewise. * rcsdiff.c (setup_label): Likewise. * rcsrev.c (cantfindbranch, genbranch, genrevs): Likewise. * rcstime.c (date2time, date2str): Likewise. * rlog.c (putadelta): Likewise. 2016-10-31 Thien-Thi Nguyen [int] Expand ‘exit_diff_trouble’ to handle ‘complain’ calls. * rcsutil.c (exit_diff_trouble): Take FMT and varargs; call ‘vcomplain’ w/ them immediately before ‘_Exit’. (runv): Fold ‘complain’ calls preceding calls to ‘exit_diff_trouble’ into args to ‘exit_diff_trouble’. 2016-10-31 Thien-Thi Nguyen [int] Add abstraction: chk_set_rev * rcsutil.c (chk_set_rev): New func. * base.h (chk_set_rev): New func decl. * ci.c (ci_main): Use ‘chk_set_rev’. * co.c (co_main): Likewise. * rcsclean.c (rcsclean_main): Likewise. 2016-10-29 Thien-Thi Nguyen rlog: Fix bug: Handle ed script with embedded NUL. Regression introduced 2010-05-24, "Rewrite parsing". * rlog.c (count_a_d): Don't use ‘memchr’ to scan for newline; instead, use ‘memchr’. 2016-10-27 Thien-Thi Nguyen [int] Avoid unnecessary allocation in ‘string_from_atat’. This is a continuation of 2016-10-25, "Fix stack crash and port to non-VLA". * b-fro.c: Don't #include "xalloc.h". (string_from_atat RBEG): New local macro. (string_from_atat): Don't bother constructing an array of ranges; instead, use ‘RBEG’ and ‘atat->holes’ directly. 2016-10-27 Thien-Thi Nguyen Fix bug: Handle time-zone specified sans numeric offset. * partime.c (parzone): When only the name is given, and it is valid, set the output offset var using the value associated with the name in the lookup table. 2016-10-26 Paul Eggert [int] Fix stack crash for long branches This does not fix all recursive calls, just enough to fix likely cases, including the bug report by Haoming Chu at: http://lists.gnu.org/archive/html/bug-rcs/2016-10/msg00002.html * rlog.c (putadelta): Do not check ‘node->selector’; now the caller’s responsibility. Remove arg TRUNK; now inferred from other args. All callers changed. (putadelta, putrunk): Omit ‘register’ as the compiler should figure this stuff out nowadays. * rcsgen.c (putree): * rlog.c (putree, exttree, recentdate, extdate): Avoid recursion in the common case where !root->branches. * rlog.c (putree): Avoid recursion when outputting the last tree in the forest. (putabranch): Do not check whether arg is null; now the caller’s responsibility. Avoid recursion in the common case where !root->selector. (putforest): Return last tree in the forest. (extractdelta): Return bool, not char. (extdate): Return size_t, not int. All callers changed. 2016-10-25 Paul Eggert [int] Fix stack crash and port to non-VLA Crash reported by Michael Watters in: http://lists.gnu.org/archive/html/bug-rcs/2016-10/msg00000.html * b-fro.c: Include xalloc.h. (string_from_atat): Use xnmalloc rather than a variable-length array. VLAs (a) can crash if too big, and (b) are not supported by some C compilers. C11 no longer requires support for VLAs. 2016-10-24 Thien-Thi Nguyen [int] Incorporate ‘normalize_arg’ into unique caller. * merger.c (normalize_arg): Delete func. (merge): Do argument normalization here. 2016-10-24 Thien-Thi Nguyen [int] Incorporate ‘escape_string’ into unique caller. * b-kwxout.c (escape_string): Delete func. (afilename): Do escaping here. 2016-10-24 Thien-Thi Nguyen [int] Make ‘accs’ into a function. * b-divvy.c (accs): New func. * b-divvy.h (accs): Replace macro w/ func decl. 2016-10-21 Thien-Thi Nguyen [int] Declare ‘ignoble’ as ‘exiting’. * b-grok.c (ignoble): ...here. 2016-10-21 Thien-Thi Nguyen [grok] Fix bug: Detect/diagnose missing string correctly. Regression introduced 2010-06-12, "Build atat object incrementally". * b-grok.c (maybe_read_atat): After skipping whitespace, if the next char is not ‘SDELIM’, don't bother constructing a length-zero atat and return ‘false’. (must_read_atat): Change diagnostic to be similar to RCS 5.7. 2016-10-17 Thien-Thi Nguyen [int] Add abstraction: afilename * b-kwxout.c (afilename): New static func. (keyreplace): Use ‘afilename’. 2016-10-16 Thien-Thi Nguyen [int] Make ‘putstring’ more efficient. * rcsgen.c (putstring): Don't loop byte by byte w/ ‘aputc’; instead, loop over ‘SDELIM’-delimited byte ranges w/ ‘awrite’. 2016-10-16 Thien-Thi Nguyen [int] Simplify ‘putstring’. * rcsgen.c (putstring): No longer take 2nd arg DELIM; output initial ‘SDELIM’ unconditionally. (putdesc, putadmin, putdftext): Update ‘putstring’ calls. * base.h (putstring): Update func decl accordingly. * rcs.c (scanlogtext): Update ‘putstring’ call. 2016-10-16 Thien-Thi Nguyen [int] Prepare to simplify ‘putstring’. * rcsgen.c (putdesc): Don't output ‘SDELIM’ here; instead, arrange for ‘putstring’ to do it. 2016-10-15 Thien-Thi Nguyen [int] Add abstraction: put_SDELIM * rcsgen.c (put_SDELIM): New static func. (putstring, putdftext): Use ‘put_SDELIM’. 2016-10-15 Thien-Thi Nguyen [int] Simplify ‘aputc’ + ‘putstring’ sequence. * rcs.c (scanlogtext): Remove ‘aputc’ call; change ‘putstring’ arg DELIM to make it handle the ‘SDELIM’ output. 2016-10-15 Thien-Thi Nguyen [int] Add abstraction: newline * b-fb.c (newline): New func. * b-fb.h (newline): New func decl. * b-fro.c (atat_display): Use ‘newline’. * b-kwxout.c (keyreplace): Likewise. * ci.c (ci_main): Likewise. * rcs.c (scanlogtext): Likewise. * rcsgen.c (putdesc, putstring, putdftext): Likewise. * rlog.c (putadelta, rlog_main): Likewise. 2016-10-13 Thien-Thi Nguyen [doc] Fix bug: Add space between merge option ‘-L’ and its arg. * merge.c (:help comment): ...here. 2016-10-13 Thien-Thi Nguyen [int] Simplify computation of obstack mask alignment. * b-divvy.c (make_space): For ‘width’, replace assignment plus conditional reassignment w/ single ‘?:’ expression. 2015-06-18 Thien-Thi Nguyen [C slog] Move ‘exiting’ to beginning of func decl. Apparently, ‘gcc --std=c11’ does not abide the ‘exiting’ attribute appearing at the end of the func decl. Reported by Romain Francoise. See also . * b-complain.h (generic_fatal, fatal_syntax, fatal_sys) * b-fb.h (Ierror, Oerror) * base.h (unexpected_EOF, thank_you_and_goodnight): Move ‘exiting’ attribute to beginning of func decl. 2015-02-19 Thien-Thi Nguyen [int] Add abstraction: accumulate_nbytes * b-divvy.c (accumulate_nbytes): New func. * b-divvy.h (accumulate_nbytes): New func decl. * b-fro.c (string_from_sym): Use ‘accumulate_nbytes’. * ci.c (ADD): Likewise. * rcsfnms.c (fin2open ACC): Likewise. 2015-02-18 Thien-Thi Nguyen [int] Centralize "possible-endings" defaulting. * rcsutil.c (gnurcs_init): Init ‘BE (pe)’ here. * ci.c (ci_main): Don't init ‘BE (pe)’. * co.c (co_main): Likewise. * rcs.c (rcs_main): Likewise. * rcsclean.c (rcsclean_main): Likewise. * rcsdiff.c (rcsdiff_main): Likewise. * rcsmerge.c (rcsmerge_main): Likewise. * rlog.c (rlog_main): Likewise. * base.h (X_DEFAULT): Delete #define. 2015-02-02 Thien-Thi Nguyen [slog] Consult USER before LOGNAME if latter is configure-time readonly. * b-excwho.c (CONSULT_FIRST, CONSULT_SECOND): New #define:s, bifurcated on ‘USER_OVER_LOGNAME’. (getusername): Use ‘CONSULT_FIRST’, ‘CONSULT_SECOND’. 2015-01-28 Thien-Thi Nguyen [C int] Use local var to avoid gcc warning. * b-isr.c (access_page): Change return type to ‘char’; return ‘t’. * b-isr.h (access_page): Update func decl. 2015-01-27 Thien-Thi Nguyen [build slog] Fix bug: Propagate makefile var ‘LIBTHREAD’. Omission since 5.8, or so. Gnulib module ‘threadlib’ includes configure-script bits to set makefile var ‘LIBTHREAD’. RCS has no concept of threads and does not specify ‘threadlib’ directly; it is a dependency of other Gnulib modules. Reported by Michael Felt: . * Makefile.am (LDADD): Append $(LIBTHREAD), as well. 2015-01-24 Thien-Thi Nguyen [C slog] Add abstraction: BOOLEAN This silences a warning under AIX. Reported by Michael Felt: . * base.h (BOOLEAN): New macro. * b-grok.c (maybe_read_atat): Use it. 2015-01-22 Thien-Thi Nguyen Release: 5.9.4 2015-01-18 Thien-Thi Nguyen [C int] Use a local variable. * b-grok.c (full): ...here, in "revisions"-chaining loop. 2015-01-18 Thien-Thi Nguyen [int] Use ‘MEM_SAME’ more. * b-anchor.c (pool_lookup): ...here. 2014-12-10 Thien-Thi Nguyen [C int] Init local var ‘buf’. This avoids a "may be used uninitialized" warning from GCC. * partime.c (lookup): ...here. 2014-11-26 Thien-Thi Nguyen [C int] Drop redundant ‘const’ declarations. * rcsdiff.c (minus_y, minus_D, longopt_maybe_p): ...here. 2014-11-23 Thien-Thi Nguyen [C int] Drop redundant ‘const’ declarations. * partime.c (month_names, weekday_names, zone_names): ...here. 2014-09-17 Thien-Thi Nguyen Release: 5.9.3 2014-09-13 Achim Gratz (tiny change) Fix bug: Ensure stdio/fd sync around diff(1) invocation. Regression introduced 2010-10-12, "Simplify stream/fd sync; avoid ‘fflush’ on input". * ci.c (ci_main): Don't bother doing ‘fro_bob’ prior to running diff(1); instead, do it afterwards. 2014-09-07 Thien-Thi Nguyen [int] Inline ‘struct obstack’ object in ‘struct divvy’. * b-divvy.h: #include . (struct divvy): Make member ‘space’ into ‘struct obstack’. * b-divvy.c: Don't #include . (make_space): Don't dynamically allocate ‘divvy->space’; update ref to ‘divvy->space’ for ‘obstack_init’, ‘obstack_alignment_mask’ and ‘obstack_next_free’. (alloc, intern, brush_off, forget, accf, accumulate_byte) (accumulate_range, finish_string, pointer_array): Update divvy ‘space’ refs accordingly. (close_space): Likewise; also don't bother ‘free’ing ‘divvy->space’. * b-grok.c: Don't #include . (ignoble, start_atat, finish_atat, maybe_read_atat): Update divvy ‘space’ refs accordingly. 2014-09-07 Thien-Thi Nguyen [int] Use gnulib module ‘xalloc’. * b-divvy.c: #include "xalloc.h". (oom, okalloc, allocate): Delete funcs. (TMALLOC): Use ‘xmalloc’. (TCALLOC): Delete macro. (xmalloc): Delete func. (make_space): Use ‘TMALLOC’; specify ‘xalloc_die’ instead of ‘oom’. * b-divvy.h (okalloc): Delete func decl. * rcsedit.c: #include "xalloc.h". (insertline): Don't use ‘okalloc’, ‘malloc’, ‘realloc’; instead, use ‘xmlloc’, ‘xrealloc’ directly. 2014-09-07 Thien-Thi Nguyen [int] Use gnulib module ‘exitfail’. * b-complain.h: #include "exitfail.h". * ci.c (cleanup): Use ‘exit_failure’. * co.c (cleanup): Likewise. * ident.c (scanfile, main): Likewise. * rcs.c (cleanup): Likewise. * rcsclean.c (cleanup): Likewise. * rcsutil.c (thank_you_and_goodnight): Likewise. * rlog.c (cleanup): Likewise. 2014-08-31 Thien-Thi Nguyen [build int] Use gnulib module to declare non-NULL args. * base.h (ARG_NONNULL): New macro. (ALL_NONNULL): New #define. 2014-08-30 Thien-Thi Nguyen Drop compatibility w/ RCS 2.x file format. * base.h [COMPAT2] (tiny_suffix): Delete decl. * b-anchor.c [COMPAT2] (tiny_suffix): Delete. * b-grok.c (full) [COMPAT2]: Drop ‘suffix’ probe/handling. 2014-08-16 Hannes Küttner (tiny change) Fix bug: Don't ignore ‘bp->ilk’ when pruning. Continuation of 2010-11-14, "Fix bug: For unchanged checkin, invalidate ‘newdelta’". Regression introduced 2010-05-24, "Rewrite parsing". * ci.c (prune): Handle case where ‘wrong’ is ‘bp’ successor. 2014-08-09 Thien-Thi Nguyen [build] Use gnulib module ‘vla’. * base.h: #include "vla.h". (ARSZ_FN_PARM): Delete macro. * b-feph.c (reap): Use ‘VLA_ELEMS’. * b-isr.c (setup_catchsig): Likewise. * ident.c (main): Likewise. * merge.c (main): Likewise. * super.c (main): Likewise. 2014-08-09 Thien-Thi Nguyen [build] Use gnulib module ‘vararrays’. * base.h (ARSZ_FN_PARM): Use ‘__STDC_NO_VLA__’. 2014-08-05 Thien-Thi Nguyen [C] Convert ‘**argv’ to ‘*argv[ARSZ_FN_PARM (argc)]’. * ident.c (main) * merge.c (main) * super.c (main): ...here. 2014-08-05 Thien-Thi Nguyen [C] Use ‘ARSZ_FN_PARM’. * b-feph.c (reap) * b-isr.c (setup_catchsig): ...here, for array arg. 2014-08-05 Thien-Thi Nguyen [C int] Add ‘ARSZ_FN_PARM’. * base.h (ARSZ_FN_PARM): New macro, using ‘ARSZ_FN_PARM_OK’. 2014-08-02 Paul Eggert Port to Solaris 10, which uses GCC 3.4.3. Array problem reported by Nelson H. F. Beebe. * b-feph.c (reap): * b-isr.c (setup_catchsig): Comment out size of array parameter, as GCC 3.4.3 doesn't allow it. * b-isr.c (catchsigaction): Use 'char *' (not 'const char *') for a local variable, to pacify Solaris 10 psiginfo. 2013-11-28 Thien-Thi Nguyen Release: 5.9.2 2013-10-20 Thien-Thi Nguyen [C int] Prefer bit-shift to multiplication. * b-fro.c (fro_open): ...here, when comparing the comma-v size to the memory limit. 2013-10-20 Thien-Thi Nguyen Relax RCS_MEM_LIMIT default; fall back if unspecified. * base.h (MEMORY_UNLIMITED): New #define. * rcsutil.c (gnurcs_init): If unspecified, default ‘BE (mem_limit)’ to ‘MEMORY_UNLIMITED’. * b-fro.c (fro_open): Notice ‘MEMORY_UNLIMITED’ mem limit; in that case, don't check file size, and on ‘RM_MMAP’ or ‘RM_MEM’ failure, retry w/ the "next" method: ‘RM_MEM’ or ‘RM_STDIO’, respectively. 2013-10-17 Thien-Thi Nguyen Fix typo: Spell "compatib..." correctly! Reported by Romain Francoise. * base.h: Do ‘s/compatab/compatib/g’. * super.c: Likewise. 2013-10-04 Thien-Thi Nguyen Release: 5.9.1 2013-09-25 Thien-Thi Nguyen [int] Decruft: Delete some "set but not used" local vars. * b-grok.c (must_semi): Delete var ‘was’. * rcsrev.c (fully_numeric): Delete var ‘have_branch’. 2013-09-25 Thien-Thi Nguyen [build] Fix bug: Avoid ‘$<’ in makefile actions. * Makefile.am ($(subs)): Use ‘$(srcdir)/sub.TEMPLATE’ directly. Reported by Paul Eggert. 2013-09-24 Thien-Thi Nguyen [int] Use ‘DIFF_L’ as C value. * rcsdiff.c (setup_label): Remove surrounding ‘#if DIFF_L’. (rcsdiff_main): Convert ‘#if DIFF_L’..‘#endif’ to ‘if (DIFF_L) { ... }’ and in some cases merge into sub-‘if’. 2013-09-24 Thien-Thi Nguyen [int] Use ‘BAD_CREATE0’ as C value. * rcs.c (rcs_main): Convert ‘#if BAD_CREATE0’..‘#endif’ to ‘if (BAD_CREATE0) { ... } else { ... }’. * rcsgen.c (putadmin): Likewise. * rcsedit.c (dorewrite, donerewrite): Likewise, merging into sub-‘if’ in some instances. 2013-09-24 Thien-Thi Nguyen [int] Use ‘WOE’ as C value. * rcsfnms.c (isSLASH): Convert ‘#if ! WOE’..‘#endif’ to ‘if (! WOE) { ... } else { ... }’. 2013-09-24 Thien-Thi Nguyen [int] Use ‘MMAP_SIGNAL’ as C value. * b-fro.c (mmap_deallocate): Remove surrounding ‘#if MMAP_SIGNAL’. (fro_open): Convert ‘#if MMAP_SIGNAL’..‘#endif’ to ‘if (MMAP_SIGNAL) { ... } else { ... }’. 2013-09-24 Thien-Thi Nguyen [int] Use ‘DIFF3_BIN’ as C value. * merger.c (merge): Convert ‘#if DIFF3_BIN’..‘#endif’ to ‘if (DIFF3_BIN) { ... } else { ... }’. 2013-09-24 Thien-Thi Nguyen [int] Use ‘BAD_B_RENAME’ as C value. * rcsedit.c (chnamemod): Convert ‘#if BAD_B_RENAME’..‘#endif’ to ‘if (BAD_B_RENAME) { ... }’ and merge into the the sub-‘if’. 2013-09-24 Thien-Thi Nguyen [int] Use ‘BAD_WAIT_IF_SIGCHLD_IGNORED’ as C value. * b-isr.c (maybe_reset_sigchld): Convert ‘#if BAD_WAIT_IF_SIGCHLD_IGNORED’..‘#endif’ to ‘if (BAD_WAIT_IF_SIGCHLD_IGNORED) { ... }’. 2013-09-24 Thien-Thi Nguyen [int] Use ‘BAD_A_RENAME’, ‘bad_NFS_rename’ as C values. * rcsedit.c (chnamemod): Convert ‘#if COND’..‘#endif’ to ‘if (COND) { ... }’ where COND includes ‘BAD_A_RENAME’ and/or ‘bad_NFS_rename’. In one instance, merge COND with that of the sub-‘if’. 2013-09-24 Thien-Thi Nguyen Fix bug: Construct diff command-line correctly for non-POSIX. See: . Reported by David Binderman. This is a long-standing bug, first appearing in RCS 5.7, released 1995-06-16. We don't add a test because it affects non-POSIX systems, which are not easily available to the maintainers. * rcs.c (buildeltatext): Change ‘==’ to ‘=’ in the case of appending "--binary" to the command line. 2013-09-23 Thien-Thi Nguyen [int] Use ‘OPEN_O_BINARY’ as a C value. Since base.h takes pains to #define this in all cases, might as well use it in its C-value capacity, instead of only as a CPP value, thus gaining some visibility for the compiler. * b-fro.c (fro_open): Convert gating via ‘OPEN_O_BINARY’ from ‘#if OPEN_O_BINARY’..‘#endif’ to C value. * ci.c (ci_main): Likewise. * rcs.c (buildeltatext): Likewise. * rcsdiff.c (rcsdiff_main): Likewise. 2013-08-06 Thien-Thi Nguyen Add homepage / "gethelp" to ‘--help’ output. * gnu-h-v.c (AB, GNU): New macros. (BUGME): Use ‘AB’ for ‘PACKAGE_BUGREPORT’; add ‘GNU’ entries for homepage and general help URLs. 2013-05-06 Thien-Thi Nguyen Release: 5.9.0 2013-05-04 Thien-Thi Nguyen [build int] Presume availability of ‘ftruncate’. * ci.c: Don't check for ‘HAVE_FTRUNCATE’; don't define always-erroneous replacement. 2013-05-04 Thien-Thi Nguyen [int] Presume ‘SIGCHLD’ defined. * b-isr.c (maybe_reset_sigchld) [BAD_WAIT_IF_SIGCHLD_IGNORED]: Don't bother ensuring a #define for ‘SIGCHLD’. 2013-05-04 Thien-Thi Nguyen Suggest "frob" as the legacy interface command name. * super.c : ...here. 2013-05-04 Thien-Thi Nguyen [int] Add abstraction: string_from_sym * super.c (string_from_sym): New static func. (display_commands, display_aliases): Use it. 2013-05-03 Thien-Thi Nguyen [int] Bump max command name size to 64. * super.c (MAX_COMMAND_SIZE): New #define. (display_commands, display_aliases): Use ‘MAX_COMMAND_SIZE’. 2013-05-03 Thien-Thi Nguyen Warn that option ‘-V’ is obsolete. U (X) ≡ "Pass X to ‘display_version’". V ≡ "Discourage ‘-V’ usage". * gnu-h-v.h (DV_WARN): New #define; update ‘display_version’ comment accordingly. * gnu-h-v.c: #include "b-complain.h". (display_version): If ‘DV_WARN’, emit warning before version info. * ident.c (main): Pass ‘DV_WARN’ to ‘display_version’. * ci.c : V. * co.c : V. * ident.c (main): U (DV_WARN) : V. * merge.c (main): U (DV_WARN). : V. * rcs.c : V. * rcsclean.c : V. * rcsdiff.c : V. * rcsmerge.c : V. * rlog.c : V. * rcsutil.c (setRCSversion): U (DV_WARN | DV_EXIT). 2013-05-03 Thien-Thi Nguyen [int] Add conditional exiting to ‘display_version’. * gnu-h-v.c (display_version): Take 2nd arg ‘flags’. If ‘DV_EXIT’, exit successfully. (check_hv): Update call to ‘display_version’. * gnu-h-v.h (DV_ONLY, DV_EXIT): New #define:s. (display_version): Update func decl. * ident.c (main): Update call to ‘display_version’. * merge.c (main): Likewise. * rcsutil.c (setRCSversion): Likewise. 2013-05-03 Thien-Thi Nguyen Use ‘getopt_long’. * gnu-h-v.h: #include . (nice_getopt): New func decl. (NICE_OPT): New macro. (NO_MORE_OPTIONS): New #define. * gnu-h-v.c: #include "gnu-h-v.h". (nice_getopt): New func. (EXACTLY): Delete macro. (hv_option_values): New enum. (ok): New static array of ‘struct option’. (check_hv): Use ‘nice_getopt’ and ‘switch’ on its rv. * super.c (main): Replace manual string-comparison for ‘--commands’ and ‘--aliases’ recognition with option table, ‘nice_getopt’ call, and a ‘switch’ on the rv. 2013-05-02 Thien-Thi Nguyen Add "rcs --aliases". * super.c (display_commands): Don't display aliases. (display_aliases): New static func. (main): Display aliases if given "--aliases". : Add ‘--aliases’ to options. 2013-05-02 Thien-Thi Nguyen Internalize some RCS commands; make rcs(1) dispatch to them. U (MAIN, AKA) ≡ "(top): Delete var. (MAIN): Rename from ‘main’; take arg ‘cmd’; pass it to ‘CHECK_HV’. (AKA): New static uint8_t array. : Use ‘YET_ANOTHER_COMMAND’". * b-yacmd.h: New file. * sub.TEMPLATE: New file. * super.c: New file. * Makefile.am (subs, bin_SCRIPTS): New vars. ($(subs)): New target. (libparts_a_SOURCES): Add b-yacmd.h. (executables): Remove ci, co, rcsclean, rcsdiff, rcsmerge, rlog. (BUILT_SOURCES): Add $(subs:=.help), super.help. (rcs_SOURCES): New var. (CLEANFILES): Add $(subs). (EXTRA_DIST): Add sub.TEMPLATE. * b-peer.h (peer_super): Rename var decl from ‘peer_co’. (PEER_SUPER): Rename macro from ‘PEER_CO’; use ‘peer_super’. * b-peer.c (peer_super): Raname from ‘peer_co’; use "rcs". * ci.c: U (ci_main, ci_aka). * co.c: U (co_main, co_aka). (VX): Bump to 3. (buildjoin): Use ‘PEER_SUPER’ and command "co". * rcs.c: U (rcs_main, rcs_aka). * rcsclean.c: U (rcsclean_main, rcsclean_aka). * rcsdiff.c: U (rcsdiff_main, rcsdiff_aka). (rcsdiff_main): Use ‘PEER_SUPER’ and command "co". * rcsmerge.c: U (rcsmerge_main, rcsmerge_aka). (rcsmerge_main): Use ‘PEER_SUPER’ and command "co". * rlog.c: U (rlog_main, rlog_aka). 2013-05-02 Thien-Thi Nguyen [int] Move ‘program’ to top-level. * gnu-h-v.h (CHECK_HV): Take arg ‘cmd’; set ‘program.invoke’ and ‘program.name’ prior to ‘check_hv’ call. (DECLARE_PROGRAM): New macro. * ci.c: Use ‘DECLARE_PROGRAM’. (main): Delete local var ‘program’; update call to ‘CHECK_HV’. * co.c: Likewise. * ident.c: Likewise. * merge.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsmerge.c: Likewise. * rlog.c: Likewise. 2013-05-01 Thien-Thi Nguyen Include one-line description in ‘--help’ output. * base.h (struct program): Add member ‘desc’. * ci.c (main): Init ‘program.desc’. * co.c (main): Likewise. * ident.c (main): Likewise. * merge.c (main): Likewise. * rcs.c (main): Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. * rcsmerge.c (main): Likewise. * rlog.c (main): Likewise. * gnu-h-v.c (check_hv): For ‘--help’ output, display the program description between the usage line and the the rest of the rest of the help text. 2013-04-29 Thien-Thi Nguyen merge: Don't accept ‘-V’ with an argument. * merge.c (main): If given ‘-V’ with an argument, display error message and exit failurefully. 2013-04-29 Thien-Thi Nguyen ident: Don't accept ‘-V’ with an argument. * ident.c (main): If given ‘-V’ with an argument, display error message and exit failurefully. 2013-04-11 Thien-Thi Nguyen [build] Add sanity check for .help generation. * Makefile.am (.c.help): After extraction, if the .help file is empty, display error message and exit failurefully. 2013-04-11 Thien-Thi Nguyen co: Add option ‘-S’ to enable "self-same" mode. Suggested by James Olin Oden: . * b-excwho.c (addlock_maybe): Rename from ‘addlock’; take additional arg ‘bool selfsame’; if true, don't distinguish who holds a lock. * b-excwho.h (addlock_maybe): Update func decl. (addlock): New macro. * co.c (main): Add handling for ‘-S’; use ‘addlock_maybe’. : Add ‘-S’ to options. 2013-04-11 Thien-Thi Nguyen ident: Recognize Subversion "fixed-width keyword syntax". Suggested by Carlie J. Coats, Jr. and Jiri Moskovcak: . * ident.c (match): Accept additional colon after the first is found; in that case, also allow hash before final ‘KDELIM’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘rmvlocklst’ from global state of rcs(1). * rcs.c (struct adminstuff): Add member ‘byelocks’. (rmvlocklst): Delete var. (dolocks): Use ‘dc->byelocks’. (main): Use ‘dc.byelocks’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘newlocklst’ from global state of rcs(1). * rcs.c (struct adminstuff): Add member ‘newlocks’. (newlocklst): Delete var. (rmnewlocklst): Take arg ‘dc’; use ‘dc->newlocks’. (dolocks): Use ‘dc->newlocks’. (main): Use ‘dc.newlocks’; update call to ‘rmnewlocklst’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘delrev’ from global state of rcs(1). * rcs.c (struct adminstuff): Add member ‘delrev’. (putdelrev): Interpret arg ‘data’ to be ‘adminstuff *dc’; use ‘dc->delrev’. (removerevs): Use ‘dc->delrev’. (main): Use ‘dc.delrev’; update call to ‘parse_revpairs’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘lockhead’, ‘unlockcaller’ from global state of rcs(1). * rcs.c (struct adminstuff): Add members ‘lockhead’, ‘unlockcaller’. (lockhead, unlockcaller): Delete vars. (dolocks): Use ‘dc->unlockcaller’, ‘dc->lockhead’. (main): Use ‘dc.lockhead’, ‘dc.unlockcaller’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘suppress_mail’ from global state of rcs(1). * rcs.c (struct adminstuff): Add member ‘suppress_mail’. (suppress_mail): Delete var. (sendmail): Take 3rd arg ‘suppress_mail’. (breaklock): Take 2nd arg ‘suppress_mail’; update call to ‘sendmail’. (setlock, dolocks): Update calls to ‘breaklock’. (main): Use ‘dc.suppress_mail’. 2013-04-10 Thien-Thi Nguyen [int] Remove outdate vars from global state of rcs(1). U (X...) ≡ "Take arg ‘dc’; use ‘dc->X’, ..."; U (*) ≡ U (cuthead, cuttail, delstrt). * rcs.c (struct adminstuff): Add members ‘cuthead’, ‘cuttail’, ‘delstrt’. (cuthead, cuttail, delstrt): Delete vars. (scanlogtext): U (cuttail). (searchcutpt): U (cuthead). (removerevs): U (*); update call to ‘searchcutpt’. (buildeltatext): U (cuttail, cuthead); update call to ‘scanlogtext’. (buildtree): U (*). (main): Use ‘dc.cuthead’, ‘dc.cuttail’; update calls to ‘removerevs’, ‘buildtree’, ‘buildeltatext’, ‘scanlogtext’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘messagelst’ from global state of rcs(1). * rcs.c (struct adminstuff): Add members ‘logs’, ‘tp_log’. (messagelst): Delete var. (getmessage): Take ‘dc’, not ‘tp’; use ‘dc->tp_log’. (domessages): Use ‘dc->logs’. (main): Delete auto var ‘tp_log’; update call to ‘getmessage’; use ‘dc.logs’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘assoclst’ from global state of rcs(1). * rcs.c (struct adminstuff): Add members ‘assocs’, ‘tp_assoc’. (assoclst): Delete var. (getassoclst): Take ‘dc’, not ‘tp’; use ‘dc->tp_assoc’. (doassoc): Take arg ‘dc’; use ‘dc->assocs’. (main): Delete auto var ‘tp_assoc’; update calls to ‘getassoclst’, ‘doassoc’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘chaccess’ from global state of rcs(1). * rcs.c (struct adminstuff): Add members ‘accesses’, ‘tp_access’. (chaccess): Delete var. (getchaccess): Take ‘dc’, not ‘tp’; use ‘dc->tp_access’. (getaccessor): Take ‘dc’, not ‘tp’; update calls to ‘getchaccess’. (doaccess): Take arg ‘dc’; use ‘dc->accesses’. (main): Delete auto var ‘tp_chacc’; update calls to ‘getaccessor’, ‘getchaccess’, ‘doaccess’. 2013-04-10 Thien-Thi Nguyen [int] Remove repo-state-change vars from global state of rcs(1). * rcs.c (struct adminstuff): Add members ‘headstate’, ‘headstate_changed_p’, ‘states’, ‘tp_state’. (headstate, chgheadstate, statelst): Delete vars. (getstates): Take ‘dc’, not ‘tp’; use ‘dc->tp_state’, ‘dc->headstate_changed_p’, ‘dc->headstate’. (main): Delete auto var ‘tp_state’; update call to ‘getstates’; use ‘dc.headstate_changed_p’, ‘dc.headstate’, ‘dc.states’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘revnum’ from global state of rcs(1). * rcs.c (revnum): Delete var. (removerevs, doassoc, setlock, dolocks) (domessages, rcs_setstate): Add auto var ‘numrev’. 2013-04-10 Thien-Thi Nguyen [int] Move rcs.c ‘main’ auto var ‘deltas’ into adminstuff. U ≡ "Take ‘dc’, not ‘tp_deltas’"; V ≡ "U; use ‘&dc->deltas’". * rcs.c (struct adminstuff): Add member ‘deltas’. (setlock): V. (dolocks): Likewise; update calls to ‘setlock’. (domessages, rcs_setstate): V. (main): Delete auto var ‘deltas’; update calls to ‘dolocks’, ‘domessages’, ‘rcs_setstate’; use ‘dc.deltas’. 2013-04-10 Thien-Thi Nguyen [int] Move a rcs.c ‘main’ auto var into a structure. * rcs.c (struct adminstuff): New. (main): Replace auto var ‘exitstatus’ with ‘dc’; update calls to ‘cleanup’; use ‘dc.rv’. 2013-04-10 Thien-Thi Nguyen [int] Remove {force,lock,mtime}flag from global state of co(1). * co.c (struct work): Add member ‘force’. (forceflag, lockflag, mtimeflag): Delete vars. (rmworkfile): Use ‘work->force’. (main): Update initialization form for auto var ‘work’; add auto vars ‘lockflag’, ‘mtimeflag’; use ‘work.force’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘targetdelta’ from global state of co(1). * co.c (struct jstuff): Add member ‘d’. (targetdelta): Delete var. (preparejoin, buildjoin): Use ‘js->d’. (main): Use ‘jstuff.d’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘neworkptr’ from global state of co(1). * co.c (neworkptr): Delete var. (cleanup): Take 2nd var ‘neworkptr’. (main): Add auto var ‘neworkptr’; update calls to ‘cleanup’. 2013-04-10 Thien-Thi Nguyen [int] Remove {expand,suffix,version,zone}arg from global state of co(1). * co.c (expandarg, suffixarg, versionarg, zonearg): Delete vars. (struct jstuff): Add members ‘expand’, ‘suffix’, ‘version’, ‘zone’. (buildjoin): Use ‘js->expand’, ‘js->suffix’, ‘js->version’, ‘js->zone’. (main): Use ‘jstuff.suffix’, ‘jstuff.version’, ‘jstuff.zone’, ‘jstuff.expand’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘joinlist’, ‘lastjoin’ from global state of co(1). * co.c (joinlist, lastjoin): Delete vars. (struct jstuff): Add members ‘ls’, ‘lastidx’. (jpush): Use ‘js->lastidx’. (preparejoin): Likewise; use ‘js->ls’. (buildjoin): Use ‘js->lastidx’, ‘js->ls’. 2011-10-14 Thien-Thi Nguyen [int] Remove ‘jstuff’ from global state of co(1). * co.c (jstuff): Delete var. (jpush): Take 2nd arg ‘js’; use ‘js->’. (addjoin): Take 2nd arg ‘js’; update call to ‘jpush’. (preparejoin): Take 2nd arg ‘js’; use ‘js->’; update call to ‘addjoin’, ‘jpush’. (buildjoin): Take 2nd arg ‘js’; use ‘js->’. (main): Add auto var ‘jstuff’; update calls to ‘preparejoin’, ‘buildjoin’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘workstat’ from global state of co(1). * co.c (struct work): New. (workstat): Delete var. (rmworkfile): Take arg ‘work’; use ‘work->st’. (main): Add auto var work; use ‘work.st’; update calls to ‘rmworkfile’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘insDelFormat’ from global state of rlog(1). * rlog.c (insDelFormat): Delete var. (putadelta): Take 4th arg ‘insDelFormat’. (putrunk): Take arg ‘insDelFormat’; update call to ‘putadelta’. (putforest): Update forward func decl. (putree): Take 2nd arg ‘insDelFormat’; update calls to self, ‘putforest’. (putabranch): Take 2nd arg ‘insDelFormat’; update calls to self, ‘putadelta’. (putforest): Take 2nd arg ‘insDelFormat’; update calls to self, ‘putabranch’, ‘putree’. (main): Add auto var ‘insDelFormat’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘Revlst’ from global state of rlog(1). * rlog.c (struct criteria): Add member ‘actual’. (Revlst): Delete var. (extractdelta, getnumericrev): Use ‘criteria->actual’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘statelist’ from global state of rlog(1). * rlog.c (struct criteria): Add member ‘states’. (statelist): Delete var. (extractdelta): Use ‘criteria->states’. (getstate): Take 2nd arg ‘criteria’; use ‘criteria->states’. (main): Update initialization form of auto var ‘criteria’; update call to ‘getstate’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘lockerlist’ from global state of rlog(1). * rlog.c (struct criteria): Add member ‘lockers’. (lockerlist): Delete var. (getlocker): Take 2nd arg ‘criteria’; use ‘criteria->lockers’. (trunclocks): Take arg ‘criteria’; use ‘criteria->lockers’. (main): Update initialization form of auto var ‘criteria’; update calls to ‘getlocker’, ‘trunclocks’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘authorlist’ from global state of rlog(1). * rlog.c (struct criteria): Add member ‘authors’. (extractdelta): Take 3rd arg ‘criteria’; use ‘criteria->authors’. (exttree): Take 3rd arg ‘criteria’; update call to ‘extractdelta’. (getauthor): Take 2nd arg ‘criteria’; use ‘criteria->authors’. (main): Update initialization form of auto var ‘criteria’; update calls to ‘getauthor’, ‘exttree’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘revlist’ from global state of rlog(1). * rlog.c (struct criteria): New. (revlist): Delete var. (getnumericrev): Take 2nd arg ‘criteria’; use ‘criteria->revs’. (putrevpairs): Unmark ‘data’ as ‘RCS_UNUSED’; interpret ‘data’ as ‘criteria’; use ‘criteria->revs’. (main): Add auto var ‘criteria’; update calls to ‘parse_revpairs’, ‘getnumericrev’. 2013-04-10 Thien-Thi Nguyen [int] Make ‘parse_revpairs’ accept/pass-through opaque data. * rcsutil.c (parse_revpairs): Take arg ‘data’; call ‘put’ with it. * base.h (parse_revpairs): Update func decl. * rcs.c (putdelrev): Take 4th arg ‘data’; mark it ‘RCS_UNUSED’. (main): Update call to ‘parse_revpairs’. * rlog.c (putrevpairs): Take 4th arg ‘data’; mark it ‘RCS_UNUSED’. (main): Update call to ‘parse_revpairs’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘datelist’, ‘duelst’ from global state of rlog(1). * rlog.c (struct date_selection): New. (datelist, duelst): Delete vars. (extdate, getdatepair): Take 2nd arg ‘datesel’; use ‘datesel->in’, ‘datesel->by’. (main): Add auto var ‘datesel’; update call to ‘getdatepair’; use ‘datsel.by’; update call to ‘extdate’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘lockflag’ from global state of rlog(1). * rlog.c (lockflag): Delete var. (extractdelta): Add 2nd arg ‘lockflag’. (exttree): Likewise; update call to ‘extractdelta’, self. (main): Add auto var ‘lockflag’; update call to ‘exttree’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘branchflag’ from global state of rlog(1). * rlog.c (branchflag): Delete var. (getnumericrev): Take arg BRANCHFLAG. (main): Add auto var ‘branchflag’; update call to ‘getnumericrev’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘workptr’, ‘workstat’ from global state of rcsdiff(1). * rcsdiff.c (workptr, workstat): Delete vars. (struct work): New. (cleanup): Take 2nd arg WORK; use ‘work->fro’. (main): Add auto var ‘work’; update calls to ‘cleanup’; use ‘work.fro’ and ‘work.st’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘workptr’ from global state of rcsclean(1). * rcsclean.c (workptr): Delete var. (cleanup): Take 2nd arg WORKPTR. (main): Add auto var ‘workptr’; update calls to ‘cleanup’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘getcurdate_buffer’ from global state of ci(1). * ci.c (struct bud): Add member ‘getcurdate_buffer’. (getcurdate_buffer): Delete var. (getcurdate): Take BUD; use ‘bud->getcurdate_buffer’. (getlogmsg): Drop ‘const’ from arg ‘bud’; update call to ‘getcurdate’. (main): Update call to ‘getcurdate’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘logmsg’ from global state of ci(1). * ci.c (struct reason): New. (logmsg): Delete var. (getlogmsg): Dno't take MSG; take REASON; use ‘reason->delayed’. (main): Delete auto var ‘msg’; add auto var ‘reason’; use ‘reason.upfront’; update calls to ‘getlogmsg’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘targetdelta’ from global state of ci(1). * ci.c (targetdelta): Delete var. (struct bud): Add member ‘target’. (addbranch, addelta, getlogmsg): Use ‘bud->target’. (main): Use ‘bud.target’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘keepflag’ from global state of ci(1). * ci.c (keepflag): Delete var. (struct bud): Add member ‘keep’. (getlogmsg): Use ‘bud->keep’. (main): Use ‘bud.keep’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘exfile’ from global state of ci(1). * ci.c (exfile): Delete var. (struct work): Add member ‘ex’. (cleanup): Use ‘work->ex’. (xpandfile): Don't take UNEXFILE; instead, take WORK. (main): Init ‘work.ex’ to NULL; update call to ‘xpandfile’; use ‘work.ex’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘default_state’ from global state of ci(1). * ci.c (default_state): Delete var. (main): Add auto var ‘default_state’. 2013-04-10 Thien-Thi Nguyen [int] Remove new{delnum,delta,branch} from global state of ci(1). * ci.c (newdelnum, newdelta): Delete vars. (struct bud): New. (newbranch): Delete var. (addbranch): Don't take NUM; take BUD, instead; compute ‘num’ internally. (addelta): Move 2nd arg to 3rd position; take 2nd arg BUD; update calls to ‘addbranch’. (getlogmsg): Take 2nd arg BUD. (main): Add auto var ‘bud’; update calls to ‘addelta’, ‘getlogmsg’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘rcsinitflag’ from global state of ci(1). * ci.c (rcsinitflag): Delete var. (addelta): Take 2nd arg RCSINITFLAG. (main): Add auto var ‘rcsinitflag’; update call to ‘addelta’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘forceciflag’, ‘keepworkingfile’ from global state of ci(1). * ci.c (forceciflag, keepworkingfile): Delete var. (main): Add auto var ‘forceciflag’, ‘keepworkingfile’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘workptr’, ‘workstat’ from global state of ci(1). * ci.c (workptr, workstat): Delete vars. (struct work): New. (cleanup): Take 2nd arg WORK; use it instead of ‘workptr’. (fixwork): Take 3rd arg WORK; use it instead of ‘workptr’, ‘workstat’. (main): Add auto var ‘work’; update calls to ‘cleanup’, ‘fixwork’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘assoclst’ from global state of ci(1). * ci.c (assoclst): Delete var. (addsyms): Take 2nd arg LS; walk it directly. (first_meaningful_symbolic_name): Take arg LS; find its last link and use its entry as user symdef. (main): Rename auto var ‘tp_assoc’ to ‘symbolic_names’; push onto that list instead of extending it; update calls to ‘addsyms’ and ‘first_meaningful_symbolic_name’. 2013-04-10 Thien-Thi Nguyen [int] Remove ‘msg’ from global state of ci(1). * ci.c (msg): Delete var. (getlogmsg): Take pointer to ‘msg’. (main): Add auto var ‘msg’; update calls to ‘getlogmsg’. 2013-04-09 Thien-Thi Nguyen [int] Remove ‘exitstatus’ from global state in programs. * ci.c (exitstatus): Delete var. (cleanup): Take pointer to ‘exitstatus’. (main): Add auto var ‘exitstatus’; update call to ‘cleanup’. * co.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. 2013-04-05 Thien-Thi Nguyen [rcsmerge] Fix bug: Include ‘-A’, ‘-E’, ‘-e’ in ‘--help’ output. Reported by Honza Horak. * rcsmerge.c : ...here. 2013-04-05 Thien-Thi Nguyen Mention ineffectual options more prominently. Suggested by Honza Horak. * rcsdiff.c : Add ‘-T’. * rcsmerge.c : Likewise. * rlog.c : Likewise. 2013-04-04 Thien-Thi Nguyen Release: 5.8.2 2013-04-02 Thien-Thi Nguyen Fix bug: Also check terminating nul in symbol deref search. Regression introduced 2010-04-21, "Add abstraction: fully_numeric". * rcsrev.c (rev_from_symbol): ...here. 2013-03-30 Thien-Thi Nguyen Fix bug: Define syntax for ‘integrity’ value. * b-grok.c (full): If ‘integrity’ has a value and that value includes an internal '@' (U+40), signal a syntax error. 2012-06-05 Thien-Thi Nguyen Release: 5.8.1 2012-05-20 Thien-Thi Nguyen [doc] Say "checked in" instead of "commited" (sic). * rlog.c : Say "checked in" in ‘-w’ description. 2012-05-09 Thien-Thi Nguyen [int] Add abstractions: ODDP, EVENP * base.h (ODDP, EVENP): New macros. * b-grok.c (maybe_read_num): Use ‘EVENP’. * ci.c (addbranch): Use ‘ODDP’, ‘EVENP’. (addelta): Use ‘EVENP’. (xpandfile): Use ‘ODDP’. * rcs.c (removerevs): Use ‘ODDP’. (setlock, dolocks, rcs_setstate): Use ‘EVENP’. * rcskeep.c (keeprev): Use ‘ODDP’. * rcsrev.c (accumulate_branchno, absent, fully_numeric): Likewise. * rlog.c (extractdelta): Likewise. 2012-05-08 Thien-Thi Nguyen [int] Add abstraction: SIZEOF_NLINES * rcsedit.c (SIZEOF_NLINES): New macro. (movelines, insertline): Use ‘SIZEOF_NLINES’. 2012-05-08 Thien-Thi Nguyen [int] Incorporate test{re,}alloc into unique caller. * rcsedit.c (testalloc, testrealloc): Delete funcs. (insertline): Use ‘okalloc’, ‘malloc’, ‘realloc’ directly. 2012-05-08 Thien-Thi Nguyen [int] Incorporate ‘exit_failurefully’ into unique caller. * base.h (exit_failurefully): Delete func decl. * rcsutil.c (exit_failurefully): Delete func. 2012-05-08 Thien-Thi Nguyen [int] Make ‘exit_diff_trouble’ static. * base.h (exit_diff_trouble): Delete func decl. * rcsutil.c (exit_diff_trouble): Make static. 2012-05-08 Thien-Thi Nguyen [int] Redo "exit errorfully" specialization/implementation. * rcsutil.c (thank_you_and_goodnight): New func. * base.h (struct program): Add member ‘tyag’; delete member ‘exiterr’. (thank_you_and_goodnight): New func decl. (TYAG_ORCSERROR, TYAG_DIRTMPUNLINK, TYAG_TEMPUNLINK, TYAG_DIFF) (TYAG_IMMEDIATE, BOG_DIFF, BOG_ZONK, BOG_FULL): New #define:s. (BOW_OUT): Rewrite. * ci.c (exiterr): Delete func. (ci_main): Update ‘program’ init form. * co.c (exiterr, co_main): Likewise. * ident.c (exiterr, main): Likewise. * merge.c (exiterr, main): Likewise. * rcs.c (exiterr, rcs_main): Likewise. * rcsclean.c (exiterr, rcsclean_main): Likewise. * rcsdiff.c (exiterr, rcsdiff_main): Likewise. * rcsmerge.c (exiterr, rcsmerge_main): Likewise. * rlog.c (exiterr, rlog_main): Likewise. 2012-05-08 Thien-Thi Nguyen [int] Add abstraction: BOW_OUT * base.h (BOW_OUT): New macro. * b-complain.c (die): Use ‘BOW_OUT’. * b-fb.c (Oerror): Likewise. * b-isr.c (werr, catchsigaction): Likewise. * ident.c (scanfile): Likewise. * merge.c (main): Likewise. * merger.c (merge): Likewise. 2012-05-08 Thien-Thi Nguyen [int] Expose ‘okalloc’ instead of ‘oom’. * rcsedit.c (okalloc): Move func from here... * b-divvy.c (oom): Make static. (okalloc): ...to here; make non-static. * b-divvy.h (oom): Delete func decl. (okalloc): Add func decl. 2012-04-06 Thien-Thi Nguyen [C] Fix bug: Avoid ‘bool’ for temporary ‘int’ values. Regression introduced 2010-03-16, "Use `bool' (and `true' and `false') more". When assigning to a bool from an int, if the int is negative, the bool will be true, losing information when that value is later compared against zero. Reported by Paul Ackersviller. * ci.c (addbranch): Change type of ‘removedlock’ back to ‘int’. 2012-01-20 Thien-Thi Nguyen [build] Add configure option ‘--enable-coverage’. * rcsutil.c [USE_NORMAL_EXIT] (_Exit): New #define. 2012-01-15 Thien-Thi Nguyen ci: Fix bug: Don't discard working file mtime with ‘-T’. Regression introduced 2010-03-13, "Topo-sort top-level; eliminate redundant forward func decls". * ci.c (ci_main): Move incorrectly-placed parens in sub-conditional-expression from "partial condition" to condition; add additional pair of parens around sub-cond-expr. 2012-01-13 Thien-Thi Nguyen Invoke diff(1) with ‘--label’ instead of ‘-L’. * rcsdiff.c (setup_label): Use "--label", not "-L". 2011-12-26 Oliver Billmann (tiny change) Fix bug: Fully init ‘struct tm t’ used for ‘-zLT’ handling. On the i686 machine it was "initialized" with some large negative number which will than lead to tm_yday being initialized in tm2time. But on the x86_64 machine it contained the valid value 0 which than always leads to YYYY-01-01. ttn sez: Regression introduced 2011-01-13, "Fix bug: Don't clobber ‘yday’ unconditionally". To avoid this class of bug in the future, when converting an assignment from unconditional to conditional, be sure to initialize "upstream" of the conversion location, in effect, moving the unconditional assignment earlier. * rcstime.c (date2str): Init also ‘t.tm_yday’. 2011-12-25 Thien-Thi Nguyen rlog: Fix bug: Remove debugging instrumentation. Code introduced 2010-06-01, "Add abstractions: {NUM,DATE}_{LT,EQ,GT}, NUMF_{LT,EQ}". This is a bug fix and not merely "decruft" because in the meantime, RCS 5.8 was released. :-( * rlog.c (extdate): Remove calls to ‘complain’. 2011-10-30 Thien-Thi Nguyen [dist] Decruft: Don't distribute TAGS. * Makefile.am (EXTRA_DIST): Remove TAGS, $(TESTS). 2011-10-29 Thien-Thi Nguyen [int] Make ‘accumulate_range’ faster. * b-divvy.c (accumulate_range): Use ‘obstack_grow’. 2011-10-29 Thien-Thi Nguyen [int] Use ‘COMMAND_LINE_VARYING’ more. Omission from 2011-10-28, "Add abstraction: COMMAND_LINE_VARYING". * rcsdiff.c (main): Use ‘COMMAND_LINE_VARYING’ for "-M". 2011-10-29 Thien-Thi Nguyen [int] Add abstraction: one_beyond_last_dir_sep * b-beer.h (one_beyond_last_dir_sep): New func decl. * b-peer.c (one_beyond_last_dir_sep): New func. (find_peer_prog): Use ‘one_beyond_last_dir_sep’. 2011-10-29 Thien-Thi Nguyen [int] Add abstraction: VX * co.c (VX): New #define. (buildjoin): Use ‘VX’. 2011-10-29 Thien-Thi Nguyen [build] Use portable Makefile subst-ref variable syntax. The syntax $(VAR:%=%SUFFIX) is a GNU Make extension. * Makefile.am (BUILT_SOURCES): Use $(VAR:=SUFFIX). 2011-10-28 Thien-Thi Nguyen [int] Add abstraction: COMMAND_LINE_VARYING * rcsdiff.c (COMMAND_LINE_VARYING): New #define. (main): Use ‘COMMAND_LINE_VARYING’. 2011-10-18 Thien-Thi Nguyen [build int] Use gnulib to implement ‘exiting’ func attribute. * base.h (exiting): Use ‘_Noreturn’ directly. 2011-10-18 Thien-Thi Nguyen [build int] Decruft: Remove obsolete handling for broken ‘printf %.2d’. * rcstime.c (proper_dot_2): Delete macro. (time2date, date2str): Use format string with ".2d" directly. 2011-10-13 Ian Delaney (tiny change) Fix bug: Make sure rcsgen.c sees ‘makedirtemp’ decl. * rcsgen.c: #include "b-feph.h". 2011-10-13 Thien-Thi Nguyen [int] Use program-specific variable name for extracted help. * ci.c (main): Update ‘program’ initialization form. * co.c (main): Likewise. * ident.c (main): Likewise. * merge.c (main): Likewise. * rcs.c (main): Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. * rcsmerge.c (main): Likewise. * rlog.c (main): Likewise. 2011-09-16 Thien-Thi Nguyen [int] Use ‘set_program_name’ from gnulib. * rcsutil.c: #include "progname.h". (gnurcs_init): Use ‘set_program_name’ and ‘program->invoke’. * b-complain.c (program_name): Delete var. * b-complain.h (program_name): Delete var decl. 2011-09-16 Thien-Thi Nguyen [int] Avoid "discards qualifiers" warning from GCC 4.4. This correctly finishes the incomplete lameness of 2011-06-14, "Avoid "discards qualifiers" warning from GCC 3.4". The overall change is to convert from ‘char const *’ to ‘const char *’. * b-isr.c (catchsigaction): Add ‘const’ to local var. 2011-08-30 Thien-Thi Nguyen Release: 5.8 2011-08-08 Thien-Thi Nguyen Use colon in ‘--version’ output instead of semicolon. Reported by Karl Berry. * gnu-h-v.c (COMMAND_VERSION): Use ‘:’ not ‘;’. 2011-07-09 Thien-Thi Nguyen [build] Work around compilers that omit '\0' from tinysym init. Reported by Nelson H. F. Beebe, for SunOS 5.11 cc, c99. * b-anchor.c (EXPLICIT_NUL): New #define. (TINY_INIT): Use ‘EXPLICIT_NUL’. 2011-06-14 Thien-Thi Nguyen [int] Separate ISR scratch and alt sig stack allocations. * b-isr.c: Don't #include or "woe/ucontext.h". (scratch_from_context): Delete func. (catchsigaction): Mark 3rd arg ‘RCS_UNUSED’; use ‘ISR_SCRATCH’. (SCRATCH_SIZE): Delete #define. (isr_init): Use ‘ZLLOC’ for ISR scratch; use separate ‘alloc’ in ‘PLEXUS’ for alternate signal stack. * Makefile.am (EXTRA_DIST): Remove woe. * woe/COPYING.LIB: Delete file. * woe/ucontext.h: Delete file. * woe/ucontext.c: Delete file. 2011-06-14 Thien-Thi Nguyen [int] Avoid "discards qualifiers" warning from GCC 3.4. * b-isr.c (catchsigaction): Drop ‘const’ from local var. 2011-06-13 Thien-Thi Nguyen [int] Use ‘rewind’ directly; drop homegrown replacement. Incidentally, t400, which had started--triggered by changes in gnulib--to fail towards the beginning of 2011-05, now passes. Probably some more investigation is indicated. See bleating at: http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00122.html * ci.c (main): Use ‘rewind’ directly. * merger.c (merge): Likewise. * rcs.c (sendmail, buildeltatext): Likewise. * rcsedit.c (swapeditfiles): Likewise. * b-fb.h (Orewind): Delete func decl. * b-fb.c (Orewind): Delete func. 2011-06-12 Thien-Thi Nguyen [int] Decruft: Don't bother with ‘SSIZE_MAX’ check/#define. * rcsutil.c (SSIZE_MAX): Delete #define and surrounding preprocessor conditional. 2011-06-11 Thien-Thi Nguyen [int] Avoid more signed/unsigned comparison warnings from GCC 4.4. * b-fro.c (fro_spew_partial): Locally #define and #undef ‘MEMBUFSIZ’; use it instead of ‘(off_t) sizeof (buf)’. (string_from_atat): Use ‘SSIZE_MAX’. 2011-06-10 Thien-Thi Nguyen [int] Use ‘off_t’ for ‘behavior.mem_limit’. Incidentally, this eliminates a "comparison between signed and unsigned integer expressions" warning from GCC 4.4. * base.h (struct behavior): Change type of ‘mem_limit’ to ‘off_t’. * b-fro.c (fro_open): Delete cast to ‘off_t’. 2011-02-01 Thien-Thi Nguyen [grok] Fix bug: Make sure error message accumulates cleanly. Omission from 2010-05-24, "Rewrite parsing". * b-grok.c: #include . (ignoble): Take args FMT and varargs; discard work-in-progress cruft on ‘g->systolic’; do accumulate string here, not ... (BUMMER): ...here; update call to ‘ignoble’. 2011-01-31 Thien-Thi Nguyen [int] Include for ‘va_start’ et al. * b-divvy.c: #include . * b-fb.c: Likewise. 2011-01-23 Thien-Thi Nguyen [int] Fix bug: Use "three manifestations" for ‘!DIFF3_BIN’. Reported by Nelson H. F. Beebe. Regression introduced 2010-09-30, "Use ‘struct symdef’ array as "three manifestations" ‘merge’ arg". * merger.c (merge) [!DIFF3_BIN]: Use ‘LABEL’, not ‘label’. 2011-01-22 Thien-Thi Nguyen [dtp] Fix bug: Handle ISO week+day dates. * maketime.c (ISO_day_of_week): New static func. (tm2time): Take additional arg YWEEK; if specified, compute yday, and maybe year, for later ‘yday’ processing. (maketime): Update call to ‘tm2time’. * maketime.h (tm2time): Update func decl. * rcstime.c (date2str): Update call to ‘tm2time’. 2011-01-22 Thien-Thi Nguyen [dtp] Fix bug: Encode weekday number (letter ‘X’) with modulo. * partime.c (parse_pattern_letter ): Use modulo to encode value. 2011-01-14 Thien-Thi Nguyen [int] Decruft: Remove "yet another redolently redundant RCS rap". * Makefile.am (EXTRA_DIST): Remove yarrrr.c. (YALL, YPROGS): Delete vars. ($(YPROGS)): Delete target. (y-all, y-clean): Likewise. * yarrrr.c: Delete file. 2011-01-14 Thien-Thi Nguyen [int] With ‘EXEEXT’, use ‘execvp’ instead of ‘execv’. * rcsutil.c (EXECV): New #define. (runv): Use ‘EXECV’. 2011-01-14 Thien-Thi Nguyen [int] With ‘EXEEXT’, don't absolutize; instead, simply suffix. * b-peer.c (LOSE): Delete macro. (invocation_full_name): Delete func. (find_peer_prog) [!EXEEXT]: Call ‘find_in_path’, ‘PFATAL’ directly; mention directory and env var ‘PATH’ in error message. (find_peer_prog) [EXEEXT]: Compute the underlying filename as simply the concatenation of the meaningful and ‘EXEEXT’. 2011-01-13 Thien-Thi Nguyen [int] Make error message for peer-finding failure more informative. * b-peer.c (LOSE): Use "free var" ‘name’. 2011-01-13 Thien-Thi Nguyen [int] Consider ‘EXEEXT’ when searching for peer programs. * b-peer.c (invocation_full_name) [EXEEXT]: Construct a filename, appending ‘PROGRAM (invoke)’ and ‘EXEEXT’ if necessary. 2011-01-13 Thien-Thi Nguyen [int] Handle failure to find peer programs more gracefully. * b-peer.c: Include "b-complain.h". (LOSE): New macro. (invocation_full_name): New static func. (find_peer_prog): Use ‘invocation_full_name’; if last slash cannot be found, don't abort; instead, display a diagnostic and exit failurefully. 2011-01-13 Thien-Thi Nguyen [dtp] Fix bug: Don't clobber ‘yday’ unconditionally. * maketime.c (tm2time): If ‘yday’ is valid, compute ‘mon’ and ‘mday’ from it; otherwise, compute it from ‘mon’ and ‘mday’. 2011-01-13 Thien-Thi Nguyen Fix bug: Don't confuse day of {week,year} in date parsing. * partime.c (merge_partime): For both conflict detection and actual merging, don't conflate ‘.tm_wday’ and ‘.tm_yday’. 2011-01-11 Thien-Thi Nguyen [build] Use bundled woe/ucontext.h for cygwin. * Makefile.am (executables): New var. (bin_PROGRAMS, BUILT_SOURCES): Use $(executables). (EXTRA_DIST): Add woe. * b-isr.c [!HAVE_UCONTEXT_H && NEED_WOE_UCONTEXT_H]: #include woe/ucontext.h. (SA_ONSTACK): #define, if not already. (ISR_STACK_SIZE): Conditionalize on ‘defined HAVE_SIGALTSTACK && define SIGSTKSZ’; if these elements are not found, default to 0 (zero). * woe: New directory. * woe/COPYING.LIB: New file. * woe/ucontext.c: New file. * woe/ucontext.h: New file. 2011-01-11 Thien-Thi Nguyen rlog: Output trailing newline for midline description. * rlog.c (main ): Ensure trailing newline. 2011-01-11 Thien-Thi Nguyen rlog: Fix bug: Output trailing newline for midline log messages. Ch Regression introduced 2010-05-24, "Rewrite parsing". * b-fro.c (atat_display): Take third arg ENSURE_NEWLINE_P; if ‘true’ and an atat is non-empty and ends without a newline, output a trailing newline. * b-fro.h (atat_display): Update func decl. * rcsedit.c (copystring): Update call to ‘atat_display’. * rlog.c (putadelta): Update call to ‘atat_display’, specifying ENSURE_NEWLINE_P ‘true’. (main ): Update call to ‘atat_display’. 2011-01-10 Thien-Thi Nguyen [int] Add abstractions: semi_lf, SEMI_LF * rcsgen.c (semi_lf): New const string. (SEMI_LF): New macro. (putadmin, putdelta): Use ‘semi_lf’, ‘SEMI_LF’. 2011-01-10 Thien-Thi Nguyen Pass through ‘integrity’ field in RCS file. * base.h (struct repo): Add member ‘integrity’. (tiny_integrity): New var decl, via ‘TINY_DECL’. * b-anchor.c (tiny_integrity): New var, via ‘TINYK’. * b-grok.c (full): Recognize ‘integrity’ prior to ‘comment’. * rcsgen.c (putadmin): Output integrity info, if available. 2011-01-07 Thien-Thi Nguyen [build] Fix bug: Account for $(EXEEXT) in .help filenames. Omission from 2010-03-19, "Use GNU Automake". * Makefile.am (BUILT_SOURCES): Include $(EXEEXT) in source part of ‘$(VAR:SOURCE=TARGET)’ reference. 2010-11-29 Thien-Thi Nguyen [grok] Recognize duplicate delta log; throw error. Omission from 2010-05-24, "Rewrite parsing". * b-grok.c (full ): Signal "duplicate delta log" error if a log already exists for a particular delta. 2010-11-29 Thien-Thi Nguyen [grok] Fix bug: Check all branch forward references for match. * b-grok.c (fwref): New struct. (full): Keep track of line number of branch references, too; after reading tree, check that all refs were indeed matched. 2010-11-29 Thien-Thi Nguyen [grok] Fix bug: Check that new branch was forward referenced. * b-grok.c (full): Keep track of branch references; check that new branches are properly forward-referenced. 2010-11-29 Thien-Thi Nguyen [grok] Fix bug: Check that branches begin w/ branch point. * b-grok.c (full ): Check that branches begin with the branch point revision. 2010-11-19 Thien-Thi Nguyen [int] Fix bug: For unchanged checkin on branch, prune ‘newdelta’. Expansion of 2010-11-14, "Fix bug: For unchanged checkin, invalidate ‘newdelta’". * ci.c (prune): New static func. (main): On unchanged checkin, use ‘prune’; incorporate ‘newdelta’ invalidation into ‘prune’. 2010-11-14 Thien-Thi Nguyen [int] Fix bug: For unchanged checkin, invalidate ‘newdelta’. Regression introduced 2010-05-24, "Rewrite parsing". * ci.c (main): On unchanged checkin, where we have started to build the wrong new RCS file, invalidate ‘newdelta’. 2010-11-13 Thien-Thi Nguyen [build] Define ‘program_name’ for gnulib. * b-complain.c (program_name): New var. * b-complain.h (program_name): New var decl. * rcsutil.c (gnurcs_init): Set ‘program_name’. Reported by Klaus T. Aehlig. 2010-11-13 Thien-Thi Nguyen [int] Fix bug: Use ‘gr_revno’ more. Regression introduced 2010-05-08, "Add abstraction: delta_from_ref". * ci.c (addbranch): Take 4th arg TP_DELTAS; use ‘gr_revno’. (addelta): Update calls to ‘addbranch’. (main): Use ‘gr_revno’ instead of ‘delta_from_ref’. * rcs.c (setlock): Take arg TP_DELTAS; use ‘gr_revno’. (dolocks): Likewise; update calls to ‘setlock’. (domessages, rcs_setstate): Likewise. (main): Update calls to ‘dolocks’, ‘domessages’, ‘rcs_setstate’. 2010-11-12 Thien-Thi Nguyen [int] Incorporate ‘DELNUMFORM’ into unique use. * rcsgen.c (rcsgen.c): Use string directly for revno, "log". * base.h (DELNUMFORM): Delete #define. 2010-11-12 Thien-Thi Nguyen ci, rcs: Make MSG in ‘-m...MSG’ optional. * rcsutil.c (set_empty_log_message): New func. * base.h (set_empty_log_message): New func decl. * ci.c (getlogmsg, main): Use ‘set_empty_log_message’. * rcs.c (getmessage): Likewise. 2010-11-12 Thien-Thi Nguyen [int] Fix bug: Output leading '@' for "rcs -m" log in RCS file. Omission from 2010-05-24, "Rewrite parsing". * rcs.c (scanlogtext): When replacing log text from "rcs -m", output leading '@'. 2010-11-10 Thien-Thi Nguyen [int] Use ‘oom’ more. * b-divvy.c (oom): Make func not static. * b-divvy.h (oom): New func decl. * rcsedit.c (okalloc): Use ‘oom’. 2010-11-09 Thien-Thi Nguyen [doc] Fix typo: Mention rcsdiff ‘-B’ once only. * rcsdiff.c: Mention ‘-B’ once only in help text. Reported by Keith Thompson. 2010-11-04 Thien-Thi Nguyen Include extra \n in RCS file to fully emulate RCS 5.7. * rcsgen.c (putadmin): Output trailing newline. 2010-11-03 Thien-Thi Nguyen Revert symbolic names ordering to be compatible with RCS 5.7. Translation oversight from 2010-04-28, "Replace ‘struct assoc’ with ‘struct wlink’ + ‘struct symdef’". * rcsedit.c (addsymbol): For new symbolic names, add to front of list instead of end. 2010-11-03 Thien-Thi Nguyen [int] Fix bug: Maintain ‘GROK (deltas)’ in proper order. Omission from 2010-05-24, "Rewrite parsing". * b-grok.c (full): Reorder ‘repo->deltas’ to reflect edits order, not index order. 2010-10-29 Thien-Thi Nguyen [int] Reuse backing store in ‘swapeditfiles’. * rcsedit.c (swapeditfiles): Allocate and do basic initialization for ‘es->fedit’ once only. 2010-10-29 Thien-Thi Nguyen [int] Fix bug: For stdio operation, prep ‘finishedit’ properly. Regressions introduced 2010-04-17 and 2010-05-31, in "Overhaul read-only file handling" and "Mark verbatim region; reduce transitional tell/seek", respectively. * rcsedit.c (swapeditfiles): Set the fro ‘.end’ as well. (finishedit_slow): Prior to spewing, set start point. 2010-10-21 Thien-Thi Nguyen [int] Add abstraction: local_tm Omission from 2010-06-12, "Use ‘gmtime_r’, ‘localtime_r’". * maketime.c (local_tm): New func. (time2tm): Use ‘local_tm’. * maketime.h (struct maketimestuff): Add member ‘tzset_called_p’. (local_tm): New func decl. * rcstime.c (date2str): Use ‘local_tm’. 2010-10-17 Thien-Thi Nguyen [int C] Cast less. * b-fro.c (fro_spew_partial): Remove unnecessary cast. * ci.c (BHDELTA): Delete macro. (addbranch): Use local var for temp ‘struct delta *’. * rcs.c (dolocks): Use local var for temp ‘const char *’. 2010-10-17 Thien-Thi Nguyen [int] Use ‘NULL’ more. * b-fro.c (fro_open): In the case of ‘RM_MEM’ on a zero-sized file, use ‘NULL’ for ‘f->base’. 2010-10-17 Thien-Thi Nguyen [int] Add abstraction: nfs_NOENT_p * rcsedit.c (nfs_NOENT_p): New static func. (un_link, chnamemod): Use ‘nfs_NOENT_p’. 2010-10-17 Thien-Thi Nguyen [build] Add configure option: --enable-suid[=setreuid] * b-excwho.c (set_uid_to): Use ‘HAVE_SETREUID’. * base.h (has_setreuid): Delete #define. 2010-10-15 Thien-Thi Nguyen [int] Don't bother with ‘psignal’. * b-isr.c (complain_signal) [HAVE_PSIGNAL]: Delete code and surrounding preprocessor conditional. 2010-10-15 Thien-Thi Nguyen [int] Add abstraction: change_mode * b-fb.c (change_mode): New func. * b-fb.h (change_mode): New func decl. * ci.c (fixwork): Use ‘change_mode’. * rcsedit.c (chnamemod): Likewise. 2010-10-15 Thien-Thi Nguyen [int] Fix bug: Allocate ‘REPO (r)’ also for new repo. Omission from 2010-05-24, "Rewrite parsing". * b-grok.c (empty_repo): New func. (full): Use ‘empty_repo’. * b-grok.h (empty_repo): New func decl. * rcsfnms.c (InitAdmin): Use ‘empty_repo’. * ci.c (addelta): No longer check for NULL ‘REPO (r)’. * rcsgen.c (format_assocs): Likewise. * rcsmerge.c (main): Likewise. * rcs.c (main): Likewise. Also, use ‘GROK (desc)’ directly. Reported by Nelson H. F. Beebe. 2010-10-13 Thien-Thi Nguyen [int] Include program name in autogenerated tmpfile name. * b-feph.c (struct ephemstuff): Drop member ‘tmpdir’; add member ‘standard’. (jam_sff): Include ‘PROGRAM (name)’ in ‘EPH (standard)’. 2010-10-13 Thien-Thi Nguyen [int] Presume availability of ‘strsignal’. * b-isr.c: Don't #include "sig2str.h". (complain_signal) [!HAVE_STRSIGNAL]: Delete code and surrounding preprocessor conditional. 2010-10-13 Thien-Thi Nguyen [int] Presume availability of ‘sigaction’. * b-isr.c (scratch_from_context) [!HAVE_SIGACTION]: Delete code. (catchsigaction): Don't reset the handler. [!HAVE_SIGACTION] (catchsig): Delete func. (setup_catchsig) [!HAVE_SIGACTION]: Delete code. [!HAVE_SIGACTION] (ISR_STACK_SIZE): Delete code, leaving unconditionally #define:d ‘ISR_STACK_SIZE’. 2010-10-13 Thien-Thi Nguyen [int] Use ‘getlogin_r’, not ‘getlogin’. * b-excwho.c (getusername): Use ‘getlogin_r’ instead of ‘getlogin’; share local ‘buf’ with ‘getpwuid_r’. * base.h (getlogin_is_secure): Delete #define. 2010-10-13 Thien-Thi Nguyen [int] Use ‘getpwuid_r’, not ‘getpwuid’. * b-excwho.c (getusername) [HAVE_GETUID && HAVE_GETPWUID]: Delete code; move #else code to... [!HAVE_GETPWUID_R]: ...here. [HAVE_GETPWUID_R]: Use ‘getpwuid_r’ to find user name. 2010-10-13 Thien-Thi Nguyen [build] Use autoconf macro to enable 64-bit file offsets. * base.h (_FILE_OFFSET_BITS): Remove #define. 2010-10-12 Thien-Thi Nguyen [C] Use ‘%zu’ for ‘size_t’ arg in format string. * rlog.c (main): Use ‘%zu’ in format string to output the ‘GROK (deltas_count)’. 2010-10-12 Thien-Thi Nguyen [C] Cast precision expression for ‘%.*s’ to ‘int’. Omission from 2010-05-18, "Don't mutate string in ‘checkidentifier’". * rcsmap.c (checkidentifier): Cast precision expression for ‘%.*s’ to ‘int’. 2010-10-12 Thien-Thi Nguyen [C] Use ‘%zu’ for ‘size_t’ arg in format string. * rcsedit.c (finisheditline): Use ‘%zu’ in format string to output the ‘finctx->script_lno’. 2010-10-12 Thien-Thi Nguyen [int] Simplify stream/fd sync; avoid ‘fflush’ on input. * ci.c (main): For sending ‘workptr’ fd to diff(1), don't save current fd position, ‘fflush’ conditionally, and restore afterwards; instead, seek to beginning only. Also, do all this regardless of ‘STDIO_P (workptr)’. 2010-10-12 Thien-Thi Nguyen [int] Presume availability of ‘waitpid’. * rcsutil.c (runv) [!defined HAVE_WAITPID]: Delete code and surrounding preprocessor conditional. 2010-10-11 Thien-Thi Nguyen [int] Fix typo: group ‘getusername’ cond exprs correctly. Regression introduced 2010-04-11, "Move cached username into `struct behavior'". * b-excwho.c (getusername) [getlogin_is_secure]: Move close-paren back one line, thus promoting ‘&& !JAM (getlogin ())’ to top-level of expression. 2010-10-11 Thien-Thi Nguyen [int] Presume availability of ‘getcwd’. * rcsfnms.c: Don't #include "b-isr.h". [!HAVE_GETCWD] (getcwd): Delete func. 2010-10-11 Thien-Thi Nguyen [int] Find invocation directory only once. * base.h (struct program): Add member ‘invoke’. (struct behavior): Add member ‘invdir’. * ci.c (main): Specify ‘.invoke’ in ‘program’. * co.c (main): Likewise. * ident.c (main): Likewise. * merge.c (main): Likewise. * rcs.c (main): Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. * rcsmerge.c (main): Likewise. * rlog.c (main): Likewise. * yarrrr.c [!PROGRAM_EXITERR] (PROGRAM_EXITERR): New #define. (main): Construct ‘struct program program’ as a local var. [TEST_STR2TIME] (program): Delete var. [TEST_STR2TIME] (PROGRAM_NAME): New #define. [TEST_FCMP] (program): Delete var. [TEST_FCMP] (PROGRAM_NAME): New #define. [TEST_PAIRS] (program): Delete var. [TEST_PAIRS] (PROGRAM_NAME, PROGRAM_EXITERR): New #define:s. [TEST_KEEP] (program): Delete var. [TEST_KEEP] (PROGRAM_NAME): New #define. [TEST_GROK] (program): Delete var. [TEST_GROK] (PROGRAM_NAME, PROGRAM_EXITERR): New #define:s. [TEST_REV] (program): Delete var. [TEST_REV] (PROGRAM_NAME): New #define. * b-peer.c: #include , "b-divvy.h". (find_peer_prog): Find driver's invocation directory; use it to construct the program's underlying filename. 2010-10-11 Thien-Thi Nguyen [C] Propagate ‘const’ in casts. * base.h (TINYS): Add ‘const’ to cast. * rcsgen.c (putadmin): Likewise. 2010-10-11 Thien-Thi Nguyen [C] Reduce need for casting. * b-isr.c (access_page): Change P type to ‘char const *’; change local var type to ‘char volatile’; remove cast. * b-isr.h (access_page): Update func decl. 2010-10-11 Thien-Thi Nguyen [int] If writing to stderr in ISR fails, exit failurefully. * b-isr.c (werr): Don't bother to ‘write’ zero-len strings; also, if ‘write’ rv is unexpected, call ‘PROGRAM (exiterr)’. 2010-10-11 Thien-Thi Nguyen [int] Use literal string for ‘PERR’, ‘MERR’ first arg. * co.c (rmworkfile): Rework ‘PERR (COND-EXPRESSION, ...)’ as ‘if (COND-EXPRESSION) PERR (STR1, ...) else PERR (STR2, ...)’. * rcskeep.c (sorry): Use "%s" for ‘MERR’ first arg. 2010-10-11 Thien-Thi Nguyen [int] Presume availability of ‘mkstemp’. * b-feph.c [!HAVE_MKSTEMP] (homegrown_mkstemp): Delete func. [!HAVE_MKSTEMP] (mkstemp): Delete #define. 2010-10-09 Thien-Thi Nguyen [int] Use ‘fd_safer’ more. * b-feph.c: #include "unistd-safer.h". (jam_sff): Use ‘fd_safer’ for ‘msktemp’ rv. 2010-10-09 Thien-Thi Nguyen [C] Avoid signed/unsigned comparison. * b-divvy.c (make_space): Use ‘size_t’ for "type width". 2010-10-09 Thien-Thi Nguyen [C] Add ‘const’ to ‘struct pool_found’ member ‘sym’. * base.h (struct pool_found): Add ‘const’ to member ‘sym’. * b-anchor.c (pool_lookup): Add ‘const’ to cast. 2010-10-09 Thien-Thi Nguyen [C] Drop redundant local-var declarations. * b-fro.c (string_from_atat): Drop redundant decl for ‘i’. * b-grok.c (full): Likewise for ‘count’. 2010-10-08 Thien-Thi Nguyen [build] Fix bug: Look for and use . Regression introduced 2010-04-03, "Ignore ". * b-isr.c: [HAVE_SIGINFO_H] #include . 2010-10-08 Thien-Thi Nguyen [int] Add abstraction: maybe_reset_sigchld * b-isr.c (maybe_reset_sigchld): New func. * b-isr.h (maybe_reset_sigchld): New func decl. * rcsfnms.c: #include "b-isr.h". [!HAVE_GETCWD] (getcwd): Use ‘maybe_reset_sigchld’. * rcsutil.c (runv): Use ‘maybe_reset_sigchld’. 2010-10-08 Thien-Thi Nguyen [build] Fix bug: Look for and use . Regression introduced 2010-04-03, "Ignore unused ". * b-isr.c: [HAVE_UCONTEXT_H] #include . 2010-10-08 Thien-Thi Nguyen [int] Search ‘PATH’ for co / merge at runtime. * b-peer.h: New file. * b-peer.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-peer.h, b-peer.c. (BUILT_SOURCES): Remove bother.c. (outgoing, bothers): Delete vars. (co_SOURCES, rcsdiff_SOURCES, rcsmerge_SOURCES): Likewise. (dist-hook): Delete target. (clean-local): No longer "rm -rf 0pre". (bother.c, test-prep, FORCE): Delete targets. * co.c: Don't #include "bother.h"; #include "b-peer.h". (struct jstuff): Add member ‘merge’. (preparejoin): Init ‘jstuff.merge’ once. (buildjoin): Use ‘PEER_CO’, ‘find_peer_prog’ * rcsdiff.c: Don't #include "bother.h"; #include "b-peer.h". (main): Use ‘PEER_CO’. * rcsmerge.c: Don't #include "bother.h"; #include "b-peer.h". (main): Usee ‘PEER_CO’. * base.h: Comment munging; nfc. * bother.h: Delete file. 2010-10-08 Thien-Thi Nguyen [int] Delete abstraction: exec_RCS * rcsutil.c (runv): Use ‘execv’ directly. 2010-10-08 Thien-Thi Nguyen [build] Specify "outgoing" programs dependency precisely. * bother.h: New file. * Makefile.am (libparts_a_SOURCES): Remove bother.c. (outgoing, bothers): New vars. (co_SOURCES, rcsdiff_SOURCES, rcsmerge_SOURCES): Likewise. (test-prep): Restrict forced remake to $(outgoing) programs. * base.h (prog_co, prog_merge): Delete var decls. * co.c: #include "bother.h". * rcsdiff.c: Likewise. * rcsmerge.c: Likewise. 2010-10-08 Thien-Thi Nguyen [build] Use $(abs_builddir) more. * Makefile.am (test-prep): Use $(abs_builddir) instead of $$(pwd). 2010-10-08 Thien-Thi Nguyen [build] Make ‘test-prep’ depend on ‘all’. * Makefile.am (test-prep): Add ‘all’ to dependency list. 2010-10-07 Thien-Thi Nguyen [C] Drop redundant ‘const’ declarations. * Makefile.am (bother.c): Drop redundant ‘const’ decl. * b-anchor.c (ks_revno, prog_diff, prog_diff3 (diff_flags, equal_line, kwsub_string): Likewise. * b-divvy.c (make_space): Likewise. * b-divvc.h (make_space): Likewise. * b-isr.c (setup_catchsig, isr_do): Likewise. * base.h (prog_co, prog_merge, prog_diff) (prog_diff3, diff_flags, equal_line): Likewise. (struct program): Likewise for members ‘name’, ‘help’. (ks_revno, kwsub_string, ctab): Likewise. * maketime.c (month_yday): Likewise. * partime.c (patterns): Likewise. * rcsfnms.c (comtable, getcwd): Likewise. * rcsmap.c (ctab): Likewise. 2010-10-07 Thien-Thi Nguyen [int] Use ‘EXIT_SUCCESS’ more. * rcsutil.c (setRCSversion): Use ‘EXIT_SUCCESS’. 2010-10-07 Thien-Thi Nguyen [C] Use ‘strtol’ instead of ‘atoi’, ‘atol’. * rcstime.c (date2str): Use ‘strtol’, not ‘atoi’. * rcsutil.c (gnurcs_init): Use ‘strtol’, not ‘atol’. * yarrrr.c [TEST_STR2TIME] (yarrrr): Likewise. 2010-10-05 Thien-Thi Nguyen [int] Undo bogus workaround. Brain damage artifact introduced 2010-08-21, "Work around x86_64-linux-gnu memory corruption problem". * ci.c (main): Don't ‘getcurdate’ unconditionally, early on. 2010-10-05 Thien-Thi Nguyen [int] Add abstraction: gnurcs_goodbye * rcsutil.c (gnurcs_goodbye): New func. * base.h (gnurcs_goodbye): New func decl. * ci.c (main): Use ‘gnurcs_goodbye’. * co.c (main): Likewise. * ident.c (main): Likewise. * merge.c (main): Likewise. * rcs.c (main): Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. * rcsmerge.c (main): Likewise. * rlog.c (main): Likewise. * yarrrr.c (main): Likewise. 2010-10-05 Thien-Thi Nguyen [int] Use ‘EXIT_SUCCESS’ more. * merge.c: #include . (main): Use ‘EXIT_SUCCESS’. 2010-10-05 Thien-Thi Nguyen [int] Fix bug: Close expansion context scratch space when done. Omission from 2010-04-30, "Move ‘expandline’ scratch to expansion context". * b-kwxout.h (FINISH_EXPCTX): New macro. * ci.c (xpandfile): Use ‘FINISH_EXPCTX’. * rcsedit.c (finishedit_fast, finishedit_slow) (copylines, editstring): Likewise. * rcsgen.c (scandeltatext): Likewise. 2010-10-04 Thien-Thi Nguyen [int] Fix bug: Initialize notyet ‘.branches’ correctly. Original circular-GIGO from 2010-05-24, "Rewrite parsing". * b-grok.c (full): For notyet ‘.branches’, use ‘NULL’ as head of the cdr-copying chain, not the to-be-initialized ‘.branches’! 2010-10-04 Thien-Thi Nguyen [v] Use Automake for building xorlf. * Makefile.am (clean-local): Don't delete ‘xorlf*’. (test-prep): Don't ‘$(MAKE) xorlf’ or move it to 0pre/bin. (xorlf): Delete target. 2010-10-04 Thien-Thi Nguyen [int] Fix bug: Fully initialize delta objects. Omission from 2010-05-24, "Rewrite parsing". * b-grok.c (full): If there is no "commitid" field, explicitly clear ‘d->commitid’. Reported by Paul Eggert. 2010-10-04 Thien-Thi Nguyen [int] Fix bug: Fully initialize notyet objects. Omission from 2010-05-24, "Rewrite parsing". * b-grok.c (full): If there are no more revision numbers to parse, explicitly clear ‘ny->next’. Reported by Paul Eggert. 2010-10-04 Thien-Thi Nguyen [build] Delete unused macro. * b-grok.c (NEWPAIR): Delete macro. 2010-10-04 Thien-Thi Nguyen [int] Fix bug: Save notyet objects in caller space. Memory incoherence introduced 2010-05-24, "Rewrite parsing". * b-grok.c (full): Don't save notyet objects in ‘g->tranquil’; instead, save in caller specified space. Reported by Paul Eggert. 2010-10-04 Thien-Thi Nguyen [int] Avoid identifier ‘SHARED’ (Solaris 8 header conflict). * b-divvy.c: Do s/SHARED/PLEXUS/g; do s/shared/plexus/g. * b-divvy.h: Likewise. * b-feph.c: Likewise. * b-isr.c: Likewise. * ci.c: Likewise. * co.c: Likewise. * merger.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsfnms.c: Likewise. * rcsgen.c: Likewise. * rcsutil.c: Likewise. * rlog.c: Likewise. Reported by Paul Eggert. 2010-10-01 Thien-Thi Nguyen [maint] Let the configure script instantiate rcsfreeze. * Makefile.am (EXTRA_DIST): Remove rcsfreeze.sh. (rcsfreeze): Delete target. * rcsfreeze.sh: Add '@' around ‘PACKAGE_VERSION’. 2010-09-30 Thien-Thi Nguyen [int] Use ‘struct symdef’ array as "three manifestations" ‘merge’ arg. * b-merger.h: New file. * Makefile.am (libparts_a_SOURCES): Add b-merger.h. * merger.c: #include "b-merger.h". (merge): Don't take LABEL and ARGV; instead, take THREE_MANIFESTATIONS; use ‘LABEL’ and ‘FNAME’. * base.h (merge): Update func decl. * merge.c: #include "b-merger.h". (main): Use ‘LABEL’ and ‘FNAME’; update call to ‘merge’. * rcsmerge.c: #include "b-merger.h". (main): Use ‘LABEL’ and ‘FNAME’; update call to ‘merge’. 2010-09-29 Thien-Thi Nguyen [v] Centralize tests; do complicated test last. * Makefile.am (PATHPREFIX, TESTS_ENVIRONMENT, TESTS): Delete vars. (check-TESTS, installcheck): Delete targets. * alive.test: Move to ../tests/t999.test. 2010-09-29 Thien-Thi Nguyen [int] Don't redundantly align atat divvy spaces. * b-grok.c (start_atat): Remove alignment check/enforcement, obsoleted by "[int] Align divvy spaces to the "widest" type width". 2010-09-29 Thien-Thi Nguyen [int] Align divvy spaces to the "widest" type width. * divvy.c (make_space): Initialize the alignment of the newly created divvy space based on the "widest" type. 2010-09-29 Thien-Thi Nguyen [int] Tighten type of struct ‘divvy’ member ‘space’. * b-divvy.h (struct divvy): Declare ‘space’ to be ‘struct obstack *’. * b-divvy.c (make_space): Remove now-redundant cast to ‘struct obstack *’. 2010-09-27 Thien-Thi Nguyen [C] Fix bug: Explicitly cast ‘size_t’ to ‘off_t’ for comparing. * b-fro.c (fro_spew_partial): Use ‘(off_t) sizeof (buf)’ to compare. 2010-08-21 Thien-Thi Nguyen [int] Work around x86_64-linux-gnu memory corruption problem. * ci.c (main): Call ‘getcurdate’ unconditionally, early on. 2010-08-21 Thien-Thi Nguyen [int] Use ‘bad_option’ more. * ident.c (main): Use ‘bad_option’. 2010-08-19 Thien-Thi Nguyen [build] Specify gnulib headers location when srcdir!=builddir. * Makefile.am (AM_CPPFLAGS): New var. 2010-08-15 Thien-Thi Nguyen [int] #define _POSIX_SYMLOOP_MAX if necessary. * rcsedit.c (_POSIX_SYMLOOP_MAX): If not already defined, #define to 8. Reported by Mike Mestnik . 2010-07-13 Thien-Thi Nguyen [int y-GROK] Use ‘exit_failurefully’ more. * yarrrr.c [TEST_GROK] (exiterr): Use ‘exit_failurefully’. 2010-07-12 Thien-Thi Nguyen [int] Add abstractions: exit_failurefully, exit_diff_trouble * rcsutil.c (exit_failurefully, exit_diff_trouble): New funcs. (runv): Use ‘exit_diff_trouble’. * base.h (exit_failurefully, exit_diff_trouble): New func decls. * ci.c (exiterr): Use ‘exit_failurefully’. * co.c (exiterr): Likewise. * ident.c (exiterr): Likewise. * rcs.c (exiterr): Likewise. * rcsclean.c (exiterr): Likewise. * rcsfnms.c (getcwd): Likewise. * rlog.c (exiterr): Likewise. * yarrrr.c (bow_out, scram): Likewise. * merge.c (exiterr): Use ‘exit_diff_trouble’. * rcsdiff.c (exiterr): Likewise. * rcsmerge.c (exiterr): Likewise. 2010-07-06 Thien-Thi Nguyen Fix typo: Say "GPLv3+" in --version output. * gnu-h-v.c (COMMAND_VERSION): Say "GPLv3+". * rcsfreeze.sh (version): Likewise. 2010-06-24 Thien-Thi Nguyen Update license to GPLv3+. * Makefile.am: Update license notice. * alive.test: Likewise. * b-anchor.c: Likewise. * b-complain.c: Likewise. * b-complain.h: Likewise. * b-divvy.c: Likewise. * b-divvy.h: Likewise. * b-esds.c: Likewise. * b-esds.h: Likewise. * b-excwho.c: Likewise. * b-excwho.h: Likewise. * b-fb.c: Likewise. * b-fb.h: Likewise. * b-feph.c: Likewise. * b-feph.h: Likewise. * b-fro.c: Likewise. * b-fro.h: Likewise. * b-grok.c: Likewise. * b-grok.h: Likewise. * b-isr.c: Likewise. * b-isr.h: Likewise. * b-kwxout.c: Likewise. * b-kwxout.h: Likewise. * base.h: Likewise. * ci.c: Likewise. * co.c: Likewise. * gnu-h-v.c: Likewise. * gnu-h-v.h: Likewise. * ident.c: Likewise. * maketime.c: Likewise. * maketime.h: Likewise. * merge.c: Likewise. * merger.c: Likewise. * partime.c: Likewise. * partime.h: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsedit.c: Likewise. * rcsfcmp.c: Likewise. * rcsfnms.c: Likewise. * rcsfreeze.sh: Likewise. * rcsgen.c: Likewise. * rcskeep.c: Likewise. * rcsmap.c: Likewise. * rcsmerge.c: Likewise. * rcsrev.c: Likewise. * rcstime.c: Likewise. * rcsutil.c: Likewise. * rlog.c: Likewise. * yarrrr.c: Likewise. 2010-06-23 Thien-Thi Nguyen Say "RCS file", not "repository file". * b-grok.c (full): Say "RCS file" in error message. * ci.c: Say "RCS file" in help text. * co.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsfreeze.sh: Likewise. * rcsmerge.c: Likewise. * rlog.c: Likewise. 2010-06-22 Thien-Thi Nguyen Say "repository file", not "repository". * b-grok.c (full): Say "repository file" in error message. * base.h: Comment munging; nfc. * ci.c: Say "repository file" in help text. * co.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsfreeze.sh: Likewise. * rcsmerge.c: Likewise. * rlog.c: Likewise. 2010-06-12 Thien-Thi Nguyen [int] Build atat object incrementally. * b-grok.c (alloc_atat): Delete func. (start_atat, finish_atat): New static funcs. (maybe_read_atat): Use ‘start_atat’, ‘finish_atat’; grow atat object onto ‘g->systolic’; copy onto ‘g->to’ when done. 2010-06-12 Thien-Thi Nguyen [int] Use ‘gmtime_r’, ‘localtime_r’. * base.h: Comment munging; nfc. * maketime.h (struct maketimestuff): Add member ‘time2tm_stash’. * maketime.c (time2tm): Use ‘gmtime_r’, ‘localtime_r’. * rcstime.c (date2str): Use ‘localtime_r’. 2010-06-10 Thien-Thi Nguyen [build] Build rcsfreeze with substituted ‘PACKAGE_VERSION’. * Makefile.am (rcsfreeze): New target. 2010-06-10 Thien-Thi Nguyen Make ‘--help’ output say "repository", not "RCS file". * ci.c: In ‘--help’ comment, say "repository", not "RCS file". * co.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsfreeze.sh: Likewise. * rcsmerge.c: Likewise. * rlog.c: Likewise. 2010-06-09 Thien-Thi Nguyen Relax syntax of id, sym to accept string of all digits. * rcsmap.c (checkidentifier): Flag ‘DIGIT’ as identifier, as well. * alive.test: Update to test using state "42". 2010-06-01 Thien-Thi Nguyen [int] Add abstractions: MEM_SAME, MEM_DIFF * base.h (MEM_SAME, MEM_DIFF): New macros. * b-anchor.c (looking_at): Use ‘MEM_SAME’. * rcs.c (main): Use ‘MEM_DIFF’. * rcsfcmp.c (rcsfcmp): Likewise. * rcsfnms.c (rcssuffix, pairnames): Use ‘MEM_SAME’. 2010-06-01 Thien-Thi Nguyen [int] Add abstractions: {NUM,DATE}_{LT,EQ,GT}, NUMF_{LT,EQ} * base.h (GENERIC_COMPARE, GENERIC_LT, GENERIC_EQ) (GENERIC_GT, NUM_LT, NUM_EQ, NUM_GT, DATE_LT, DATE_EQ) (DATE_GT, NUMF_LT, NUMF_EQ): New macros. * ci.c (addbranch, addelta, getlogmsg, main): Use new macros. * co.c (getancestor): Likewise. * rcs.c (removerevs, setlock, dolocks, rcs_setstate, main): Likewise. * rcsrev.c (genbranch, genrevs): Likewise. * rlog.c (recentdate, extdate): Likewise. 2010-06-01 Thien-Thi Nguyen [int] Add abstraction: PROB * base.h (PROB): New macro. * b-excwho.c (set_uid_to): Use ‘PROB’. * b-fb.c (fopen_safer, Orewind, aflush) (oflush, aputs, aprintf): Likewise. * b-feph.c [!HAVE_MKSTEMP] (homegrown_mkstemp): Likewise. (jam_sff): Likewise. * b-fro.c [MMAP_SIGNAL] (mmap_deallocate): Likewise. (fro_open, fro_move): Likewise. * b-grok.c (full, grok_resynch): Likewise. * b-isr.c (complain_signal, MUST, setup_catchsig, isr_init): Likewise. * ci.c (fixwork, main): Likewise. * co.c (main): Likewise. * ident.c (scanfile, main): Likewise. * partime.c (partime): Likewise. * rcs.c (main): Likewise. * rcsclean.c (get_directory, main): Likewise. * rcsedit.c (un_link, fopen_update_truncate, rcswriteopen) (chnamemod, dorewrite, donerewrite, ORCSclose): Likewise. * rcsfnms.c (pairnames, getfullRCSname): Likewise. [!HAVE_GETCWD] (getcwd): Likewise. * rcsgen.c (putdesc): Likewise. * rcsutil.c (gnurcs_init, awrite, runv): Likewise. 2010-06-01 Thien-Thi Nguyen [int] Add abstractions: SHACCR, SHSTR, SHSNIP * b-divvy.h (SHACCR, SHSTR, SHSNIP): New macros. * ci.c (addelta): Use ‘SHSNIP’. * rcs.c (getassoclst, getaccessor, getstates): Likewise. * rlog.c (getnumericrev): Use ‘SHACCR’, ‘SHSTR’, ‘SHSNIP’. 2010-06-01 Thien-Thi Nguyen [int] Delete abstraction: intern0 * co.c (buildjoin): Don't bother re-saving the revno into ‘SINGLE’. * rcsutil.c (str_save): Use ‘intern’ directly. * b-divvy.h (intern0): Delete macro. 2010-05-31 Thien-Thi Nguyen [int] Reposition less, and also less frequently. * b-grok.c (grok_resynch): Don't take ‘struct fro *f’; don't reposition. (grok_all): Update call to ‘grok_resynch’. * b-grok.h (grok_resynch): Update func decl. * ci.c (main): Don't reposition prior to resync; update call to ‘grok_resynch’. * rcs.c (scanlogtext): Do reposition after looping. * rcsfnms.c (pairnames): Don't reposition after grok. * rcsgen.c (scandeltatext): Do reposition after looping. 2010-05-31 Thien-Thi Nguyen [int] Mark verbatim region; reduce transitional tell/seek. * b-fro.h (struct fro): Add member ‘verbatim’. (FIXUP_OLD): Delete macro. (VERBATIM, IGNORE_REST, SAME_AFTER): New macros. * b-fro.c (fro_spew): Use ‘->verbatim’ for region beginning; afterwards, set it to the end position. * base.h: Comment munging; nfc. * ci.c (main): Use ‘IGNORE_REST’, ‘SAME_AFTER’, ‘VERBATIM’. * co.c (main): Use ‘SAME_AFTER’. * rcs.c (scanlogtext): Don't call ‘FIXUP_OLD’. (main): Use ‘IGNORE_REST’, ‘SAME_AFTER’. * rcsclean.c (main): Use ‘SAME_AFTER’. * rcsedit.c (copystring): Don't call ‘FIXUP_OLD’. * rcsgen.c (scandeltatext, write_desc_maybe, putdesc): Likewise. * rlog.c (main): Likewise. * yarrrr.c [TEST_REV] (yarrrr): Likewise. 2010-05-31 Thien-Thi Nguyen [int] Rename ‘struct delta’ member ‘next’ to ‘ilk’. * base.h (struct delta): Rename member ‘next’ to ‘ilk’. * b-grok.c (full): Update references. * ci.c (addbranch, addelta): Likewise. * rcs.c (branchpoint, removerevs, buildtree): Likewise. * rcsgen.c (putdelta, puttree): Likewise. * rcsrev.c (genbranch, genrevs): Likewise. * rlog.c (putrunk, putree, putabranch) (exttree, recentdate, extdate): Likewise. * yarrrr.c [TEST_GROK] (yarrrr): Likewise. 2010-05-31 Thien-Thi Nguyen [int y-GROK] Fix bug: Deref repo ‘locks’ entry correctly. Regression introduced 2010-05-24, "Rewrite parsing". * yarrrr.c [TEST_GROK] (struct lockdef): Delete. [TEST_GROK] (yarrrr): Deref repo ‘locks’ entry as ‘struct rcslock *’. 2010-05-31 Thien-Thi Nguyen [int] Note each delta body's file position. * base.h (struct delta): Add member ‘neck’. * b-grok.c (full): For each delta, note its body's file position. * rcs.c (scanlogtext): Avoid ‘fro_tello’; use saved file position. * rcsgen.c (scandeltatext): Likewise. 2010-05-30 Thien-Thi Nguyen [int] Make "need expansion" support compile-time optional, default off. * base.h (WITH_NEEDEXP): New #define. * b-fro.h (struct atat): Include members only if ‘WITH_NEEDEXP’: ‘needexp_count’, ‘ineedexp’, ‘needexp’. * b-grok.c (atat_ineedexp_many, atat_ineedexp_few): Surround with ‘#if WITH_NEEDEXP’. (maybe_read_atat): Conditionalize "need expansion" support with ‘#if WITH_NEEDEXP’. * yarrrr.c [TEST_GROK] (spew_atat): Likewise. 2010-05-29 Thien-Thi Nguyen [int] Add abstraction: format_locks * base.h (format_locks): New func decl. * rcsgen.c (format_locks): New func. (putadmin): Use ‘format_locks’. * rlog.c (main): Likewise. 2010-05-29 Thien-Thi Nguyen [int org] Move ‘addlock’ to b-excwho.[hc]. * rcsedit.c (addlock): Move func from here... * b-excwho.c: #include "b-divvy.h". (addlock): ...to here. * base.h (addlock): Move func decl from here... * b-excwho.h (addlock): ...to here. 2010-05-29 Thien-Thi Nguyen [int] Add abstraction: lock_on * b-excwho.c (lock_on): New func. * b-excwho.h (lock_on): New func decl. * rcs.c (branchpoint): Use ‘lock_on’. * rcsedit.c (addlock): Likewise. * rlog.c (extractdelta): Likewise. 2010-05-29 Thien-Thi Nguyen [int] Delete abstraction: now * ci.c (getcurdate): Use ‘BE (now)’ directly. * rcsedit.c (setmtime): Likewise. * rcstime.c (str2date): Likewise. * rcsutil.c (gnurcs_init): Init ‘BE (now)’. (now): Delete func. * base.h (now): Delete func decl. 2010-05-29 Thien-Thi Nguyen [int] Factor constant string "revision number". * b-anchor.c (ks_revno): New var. * b-grok.c (struct grok): Add member ‘bor_no’. (ks_revision_number): Delete var. (maybe_read_num, must_read_num, MUST_REVNO): Use ‘ks_revno’. (must_colon_revno): Use ‘g->bor_no’. (full): Init ‘g->bor_no’. * base.h (ks_revno): New var decl. * ci.c (main): Use ‘ks_revno’. * co.c (main): Likewise. * rcs.c (getmessage): Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. * rcskeep.c (keeprev): Likewise. * rcsmerge.c (main): Likewise. * rcsrev.c (genbranch, genrevs, fully_numeric): Likewise. * yarrrr.c [TEST_REV] (yarrrr): Likewise. 2010-05-28 Thien-Thi Nguyen [int] Make b-grok.c macro ‘BUMMER’ variadic. * b-grok.c (ignoble): Don't accept args ‘blurb’, ‘precisely’; don't do initial ‘accf’. (BUMMER): Make macro variadic; call ‘accf’ here. (eof_too_soon): Update call to ‘BUMMER’. (full): Use ‘BUMMER’ more. 2010-05-28 Thien-Thi Nguyen [int] Use local variables more. * b-complain.c (vcomplain): Use local variables more; reduce access via ‘PROGRAM’, ‘BE’, ‘MANI’, ‘PREV’, ‘REPO’, ‘GROK’, ‘FLOW’. * b-fb.c (oflush): Likewise. * b-feph.c (makedirtemp, keepdirtemp): Likewise. * b-kwxout.c (keyreplace): Likewise. * ci.c (addelta, getcurdate, main): Likewise. * co.c (cleanup, rmworkfile, main): Likewise. * merger.c (merge): Likewise. * rcs.c (dolocks, buildeltatext, main): Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. * rcsedit.c (enterstring, rcswriteopen, checkaccesslist) (dorewrite, donerewrite, ORCSerror): Likewise. * rcsfnms.c (pairnames, getfullRCSname): Likewise. * rcsgen.c (scandeltatext, putdesc, putadmin): Likewise. * rcskeep.c (getoldkeys): Likewise. * rcsmerge.c (main): Likewise. * rcsrev.c (fully_numeric, tiprev): Likewise. * rlog.c (getnumericrev, main): Likewise. * yarrrr.c [TEST_PAIRS] (yarrrr): Likewise. 2010-05-28 Thien-Thi Nguyen [int] Replace ‘myself’ with new abstraction ‘stat_mine_p’. * b-excwho.c (stat_mine_p): New func. (myself): Delete func. * b-excwho.h (stat_mine_p): New func decl. (myself): Delete func decl. * ci.c (removelock, addelta, fixwork): Use ‘stat_mine_p’. * co.c (rmworkfile): Likewise. * rcsedit.c (checkaccesslist): Likewise. 2010-05-28 Thien-Thi Nguyen [int org] Move some funcs/macros to b-excwho.c, a subset to b-excwho.h. * b-feph.c: #include "b-excwho.h". * b-isr.c: #include "b-excwho.h". * rcsutil.c (cacheid): Move macro from here... (ruid, myself, euid): Move funcs from here... [HAVE_SETUID] (set_uid_to, nosetid, seteid, setrid): Move funcs from here... * b-excwho.c [HAVE_SETUID && !HAVE_SETEUID] (seteuid): Move #define to here... (PEBKAC): New macro. (cacheid): ...to here. (ruid): ...to here; make static. (myself): ...to here. [HAVE_SETUID] (euid): to here; make static. [HAVE_SETUID] (set_uid_to): ...to here. (nosetid, seteid, setrid): ...to here; surround func body with #if ‘HAVE_SETUID’. * base.h [HAVE_SETUID && !HAVE_SETEUID] (seteuid): ...from here. (ruid): Delete func decl. (myself): Move func decl from here... [HAVE_SETUID] (euid): Delete func decl. [HAVE_SETUID] (nosetid, seteid, setrid): Move func decl from here... [!HAVE_SETUID] (nosetid, seteid, setrid): Delete macros. * b-excwho.h (myself, nosetid, seteid, setrid): ...to here. 2010-05-28 Thien-Thi Nguyen [int org] Move ‘getusername’ to b-excwho.[hc]. * rlog.c: #include "b-excwho.h". * rcsutil.c [HAVE_PWD_H]: Don't #include . (getusername): Move func from here... * b-excwho.c: #include , , "b-complain.h". [HAVE_PWD_H]: #include . (getusername): ...to here. * base.h (getusername): Move func decl from here... * b-excwho.h (getusername): ...to here. 2010-05-27 Thien-Thi Nguyen [int org] Move ‘getcaller’ to b-excwho.[hc]. * rcsedit.c (getcaller): Move func from here... * b-excwho.c: Update copyright notice. (getcaller): ...to here. * base.h (getcaller): Move func decl from here... * b-excwho.h: Update copyright notice. (getcaller): ...to here. 2010-05-27 Thien-Thi Nguyen [int] Use ‘struct wlink’ more. * ci.c (addelta, main): Do s/struct hshentries/struct wlink/g; use ->entry, ->next instead of ->first, ->rest, respectively; use local var of type ‘struct delta *’ to deref ->entry where necessary. * co.c (main): Likewise. * rcs.c (searchcutpt, removerevs, buildeltatext, main): Likewise. * rcsclean.c (main): Likewise. * rcsgen.c (buildrevision): Likewise. * rcsrev.c (store1, genbranch, genrevs, gr_revno): Likewise. * yarrrr.c [TEST_REV]: #include "b-esds.h". [TEST_REV] (yarrrr): Likewise. * base.h (struct hshentries): Delete. (buildrevision, genrevs, gr_revno): Update func decls. 2010-05-27 Thien-Thi Nguyen [int] Rename ‘struct hshentry’ to ‘struct delta’. * b-grok.c: Do s/struct hshentry/struct delta/g. * b-kwxout.c: Likewise. * b-kwxout.h: Likewise. * base.h: Likewise. * ci.c: Likewise. * co.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsedit.c: Likewise. * rcsfcmp.c: Likewise. * rcsgen.c: Likewise. * rcsmerge.c: Likewise. * rcsrev.c: Likewise. * rlog.c: Likewise. * yarrrr.c: Likewise. 2010-05-27 Thien-Thi Nguyen [int] Use ‘str_save’ more. * co.c (getancestor, main): Use ‘str_save’. * merger.c (normalize_arg): Likewise. * rcsclean.c (get_directory): Likewise. * rcsdiff.c (main): Likewise. 2010-05-27 Thien-Thi Nguyen [int] Use ‘SINGLE’ et al more (instead of ‘SHARED’). * b-divvy.h (FZLLOC): New macro. * b-fro.c (fro_open): Use ‘FZLLOC’, ‘SINGLE’. * b-grok.c (full): Use ‘FZLLOC’. * b-kwxout.c (keyreplace): Use ‘SINGLE’. * rcsedit.c (swapeditfiles): Use ‘FZLLOC’. * rcsfnms.c (InitAdmin): Clear ‘REPO (r)’. (pairnames): Use ‘SINGLE’. * rcsrev.c (fully_numeric): Use ‘SINGLE’. 2010-05-26 Thien-Thi Nguyen [int] Move ‘program’ references from global scope into ‘top’. * gnu-h-v.c (display_version, check_hv): Take additional arg ‘struct program *prog’; use it instead of ‘PROGRM (foo)’. * gnu-h-v.h (display_version, check_hv): Update func decls. (CHECK_HV): Update macro. * rcsutil.c (gnurcs_init): Take ‘struct program *’; save into ‘top’. (setRCSversion): Update call to ‘display_version’. * base.h (program): Delete var decl. (struct top): Add member ‘program’. (PROGRAM): Update to look in ‘top->program’. (gnurcs_init): Update func decl. * ci.c (program): Delete var. (main): Add local var ‘struct program *program’; update call to ‘gnurcs_init’. * co.c (program, main): Likewise. * ident.c (program, main): Likewise; also update call to ‘display_version’. * merge.c (program, main): Likewise; also update call to ‘display_version’. * rcs.c (program, main): Likewise. * rcsclean.c (program, main): Likewise. * rcsdiff.c (program, main): Likewise. * rcsmerge.c (program, main): Likewise. * rlog.c (program, main): Likewise. * yarrrr.c [TEST_STR2TIME] (program): Make var static. [TEST_FCMP] (program): Likewise. [TEST_PAIRS] (program): Likewise. [TEST_KEEP] (program): Likewise. [TEST_GROK] (program): Likewise. [TEST_REV] (program): Likewise. (main): Update call to ‘gnurcs_init’. 2010-05-26 Thien-Thi Nguyen [int] Add abstraction: lock_drop * b-excwho.c (lock_drop): New func. * b-excwho.h (lock_drop): New func decl. * ci.c (removelock): Use ‘lock_drop’. * co.c (rmlock): Likewise. * rcs.c (breaklock): Likewise. * rcsclean.c (unlock): Likewise. * rcsedit.c (findlock): Likewise. 2010-05-26 Thien-Thi Nguyen [int] Add abstractions: lock_memq, lock_login_memq, lock_delta_memq * b-excwho.c: #include "b-esds.h". (lock_memq): New func. * b-excwho.h (lock_memq): New func decl. (lock_login_memq, lock_delta_memq): New macros. * ci.c (removelock): Use ‘lock_delta_memq’. * co.c (rmlock): Likewise. * rcs.c (breaklock, branchpoint): Likewise. * rcsclean.c (unlock): Likewise. * rcsedit.c (findlock): Use ‘lock_login_memq’. 2010-05-26 Thien-Thi Nguyen [int] Add abstraction: currently_setuid_p * b-excwho.c (currently_setuid_p): New func. * b-excwho.h (currently_setuid_p): New func decl. * ci.c (main): Use ‘currently_setuid_p’; remove surrounding preproc cond ‘defined HAVE_SETUID && defined HAVE_GETUID’. * rcsedit.c (getcaller): Use ‘currently_setuid_p’; remove preproc cond ‘defined HAVE_SETUID’ and its #else branch. * rcsutil.c: #include "b-excwho.h". (set_uid_to): Use ‘currently_setuid_p’. 2010-05-26 Thien-Thi Nguyen [int] Compare delta objects instead of their revision numbers. * co.c (rmlock): Dont ‘STR_SAME’; instead compare objects (with ‘==’). * rcs.c (breaklock): Likewise. 2010-05-26 Thien-Thi Nguyen [int] Add abstraction: caller_login_p Here, "I" means "#include "b-excwho.h"; "U" means "Use ‘caller_login_p’". * b-excwho.h: New file. * b-excwho.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-excwho.h, b-excwho.c. * ci.c: I. (removelock, addbranch): U. * co.c: I. (rmlock): U. * rcs.c: I. (breaklock): U. * rcsclean.c: I. (unlock): U. * rcsedit.c: I. (findlock, addlock, checkaccesslist): U. 2010-05-25 Thien-Thi Nguyen Consult env var RCS_MEM_LIMIT to set the memory limit. * base.h (struct behavior): Add member ‘mem_limit’. * rcsutil.c (gnurcs_init): Set ‘BE (mem_limit)’. * b-fro.c (REASONABLE_MMAP_SIZE): Delete #define. (fro_open): Use ‘BE (mem_limit)’ to determine read method. 2010-05-25 Thien-Thi Nguyen [int] Fix bug: Output proper range for ‘RM_STDIO’ fro. Regression introduced 2010-04-27, "Add abstraction: fro_spew_partial". * b-fro.c (fro_spew_partial): In the case of ‘RM_STDIO’, compute remaining size using range end, not range beginning. 2010-05-25 Thien-Thi Nguyen [int] Bump mmap limit down to 256 kilobytes. * b-fro.c (REASONABLE_MMAP_SIZE): Bump down to 262144. 2010-05-24 Thien-Thi Nguyen [int] Rewrite parsing. * b-grok.h: New file. * b-grok.c: New file. * b-complain.c (fatal_syntax): Don't output line number if 0. * b-complain.h (SYNTAX_ERROR): Specify 0 for line number. * b-fro.h (struct atat): New. (string_from_atat, atat_put, atat_display): New func decls. (ATAT_END, ATAT_TEXT_END, FIXUP_OLD): New macros. * b-fro.c: #include . (string_from_atat, atat_put, atat_display): New funcs. * b-kwxout.c (expandline): Don't assign to ‘NEXT (c)’, ‘LEX (lno)’. * base.h (struct hshentry): Add members ‘log’, ‘text’; delete members ‘insertlns’, ‘deletelns’. (struct behavior): Delete member ‘receptive_to_next_hash_key’. (struct parse_state): Delete. (struct repo): New. (struct repository): Add member ‘r’; delete members ‘admin’, ‘ndelt’. (struct top): Delete member ‘parse_state’. (LEX, NEXT, ADMIN): Delete macros. (GROK): New macro. (copystring, enterstring, editstring): Update func decls. (write_desc_maybe): New func decl. (Lexinit, nextlex, eoflex, getlex, getkeyopt, getkey, getkeystring) (getid, getnum, must_get_delta_num, readstring, printstring, savestring) (getadmin, gettree, getdesc, free_NEXT_str): Delete func decls. * ci.c: #include "b-grok.h". (removelock): Use ‘GROK (locks)’. (addelta): Use ‘REPO (r)’, ‘GROK (branch)’. (main): No longer call ‘gettree’, ‘Lexinit’, ‘getadmin’. Instead, use ‘grok_resynch’. * co.c (rmlock): Use ‘GROK (locks)’. (main): No longer call ‘gettree’, ‘getdesc’; use ‘GROK (branch)’, ‘write_desc_maybe’. * rcs.c (scanlogtext): Take pointer to list of deltas; rewrite to walk list of deltas instead of scanning input; update calls to ‘editstring’, ‘enterstring’. (doaccess): Use ‘GROK (access)’. (breaklock, branchpoint): Use ‘GROK (locks)’. (doassoc): Use ‘GROK (symbols)’. (dolocks): Use ‘GROK (locks)’, ‘GROK (branch)’. (buildeltatext): Take pointer to list of deltas; update calls to ‘scanlogtext’. (main): Use ‘GROK (access)’, ‘GROK (branch)’, GROK (deltas); no longer call ‘gettree’; update call to ‘buildeltatext’. * rcsclean.c (unlock): Use ‘GROK (locks)’. (main): No longer call ‘gettree’, ‘getdesc’; use ‘GROK (branch)’, ‘write_desc_maybe’. * rcsdiff.c (main): No longer call ‘gettree’; use ‘GROK (branch)’. * rcsedit.c (struct editstuff): Add member ‘script_lno’. (SYNTAX_ERROR): Re-#define macro. (struct finctx): New. (finisheditline): Take ‘struct finctx *’; on error, describe the failed action precisely, with line number. (finishedit_fast): Construct finctx; update calls to ‘finisheditline’. (copystring): Rewrite. (enterstring): Take ‘struct atat *’; update call to ‘copystring’; don't assign to ‘LEX (lno)’, ‘NEXT (c)’. (editstring): Take ‘struct atat *’; keep track of edit script line number; don't assign to ‘LEX (lno)’, ‘NEXT (c)’. (findlock, addlock): Use ‘GROK (locks)’. (addsymbol): Use ‘GROK (symbols)’. (checkaccesslist): Use ‘GROK (access)’. (dorewrite): Use '\n' directly instead of getting it from ‘NEXT (c)’. (getdiffcmd): Don't assign to ‘LEX (lno)’, ‘NEXT (c)’. * rcsfnms.c: #include "b-grok.h". (InitAdmin): Don't init ‘ADMIN (defbr)’, ‘ADMIN (allowed)’, ‘ADMIN (assocs)’, ‘ADMIN (locks)’; don't call ‘Lexinit’. (pairnames): Init ‘FLOW (erroneousp)’, ‘BE (Oerrloop)’; don't call ‘Lexinit’, ‘getadmin’; grok on successful open. * rcsgen.c (scandeltatext): Take pointer to list of deltas; rewrite to walk list of deltas instead of scanning input; update calls to ‘enterstring’, ‘copystring’, ‘editstring’. (buildrevision): Use ‘GROK (deltas)’; update calls to ‘scandeltatext’. (write_desc_maybe): New func. (putdesc): Use ‘write_desc_maybe’, ‘FIXUP_OLD’. (format_assocs): Don't do anything if ‘!REPO (r)’; use ‘GROK (symbols)’. (putadmin); Use ‘REPO (r)’, ‘GROK (branch)’, ‘GROK (access)’, ‘GROK (locks)’. * rcsmap.c (checkidentifier): Fix typo introduced 2010-05-18, "Move some funcs out of rcslex.c to rcsmap.c". * rcsmerge.c (main): No longer call ‘gettree’; use ‘GROK (branch)’. * rcsrev.c (rev_from_symbol): Use ‘GROK (symbols)’. (fully_numeric, tiprev): Use ‘GROK (branch)’. * rcsutil.c (free_NEXT_str): Delete func. * rlog.c: #incude . (read_positive_integer, count_a_d): New static funcs. (putadelta): Use ‘count_a_d’, ‘atat_display’. (getscript, readdeltalog): Delete funcs. (extractdelta, trunclocks): Use ‘GROK (locks)’. (getnumericrev): Use ‘GROK (branch)’. (main): Use ‘GROK (locks)’, ‘GROK (branch)’, ‘GROK (access)’, ‘GROK (deltas_count)’, ‘GROK (desc)’, ‘atat_display’, ‘FIXUP_OLD’; no longer call ‘gettree’. * rcslex.c: Delete file. * rcssyn.c: Delete file. * yarrrr.c [TEST_GROK]: New section. [TEST_LEX]: Delete section. [TEST_SYN]: Delete section. * Makefile.am (libparts_a_SOURCES): Add b-grok.h, b-grok.c; delete rcslex.c, rcssyn.c. (YALL): Add GROK; delete LEX, SYN. 2010-05-24 Thien-Thi Nguyen [int] Rename ‘ADMIN (log_lead)’ to ‘REPO (log_lead)’. * base.h (struct repository): Add member ‘log_lead’; in sub-‘struct admin’, delete member ‘log_lead’. * b-kwxout.c (keyreplace): Update refs. * rcs.c (main): Likewise. * rcsfcmp.c (rcsfcmp): Likewise. * rcsfnms.c (InitAdmin): Likewise. * rcsgen.c (putadmin): Likewise. * rcssyn.c (getadmin): Likewise. * rlog.c (main): Likewise. * yarrrr.c [TEST_FCMP] (yarrrr): Likewise. 2010-05-22 Thien-Thi Nguyen [int] Rename ‘ADMIN (head)’ to ‘REPO (tip)’. * base.h (struct repository): Add member ‘tip’; in sub-‘struct admin’, delete member ‘head’. * ci.c (addelta, main): Update refs. * rcs.c (getstates, breaklock, dolocks, buildtree, main): Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. * rcsedit.c (dorewrite): Likewise. * rcsfnms.c (InitAdmin): Likewise. * rcsgen.c (putadmin): Likewise. * rcsmerge.c (main): Likewise. * rcsrev.c (genrevs, fully_numeric, tiprev): Likewise. * rcssyn.c (getadmin): Likewise. * rlog.c (putrunk, readdeltalog, getnumericrev, main): Likewise. 2010-05-21 Thien-Thi Nguyen [int] In ‘struct hshentry’, rename member ‘log’ to ‘pretty_log’. * base.h (struct hshentry): Rename member ‘log’ to ‘pretty_log’. * b-kwxout.c (keyreplace): Update. * ci.c (main): Likewise. * rcs.c (scanlogtext, domessages): Likewise. * rcsfcmp.c (rcsfcmp): Likewise. * rcsgen.c (scandeltatext, putdtext, putdftext): Likewise. * rcssyn.c (getdelta): Likewise. * rlog.c (putadelta, readdeltalog, exttree): Likewise. * yarrrr.c [TEST_FCMP] (yarrrr): Likewise. 2010-05-20 Thien-Thi Nguyen [int] Use ‘struct link’ for ‘ADMIN (locks)’ list. * base.h (struct repository): Change type of member ‘admin.locks’ to ‘struct link *’. * ci.c (removelock): Use ‘struct link’ for list-walk local vars. * co.c (rmlock): Likewise. * rcs.c (breaklock, branchpoint, dolocks): Likewise. * rcsclean.c (unlock): Likewise. * rcsedit.c (findlock, addlock): Likewise. * rcsgen.c (putadmin): Likewise. * rcssyn.c (getadmin, gettree): Likewise. * rlog.c (extractdelta, trunclocks, main): Likewise. 2010-05-20 Thien-Thi Nguyen [int] Use ‘struct link’ for ‘ADMIN (assocs)’ list. * base.h (struct repository): Change type of member ‘admin.assocs’ to ‘struct link *’. * rcsedit.c (addsymbol): To rebind, cons a new ‘struct symdef’ and splice it into the list position of the original association. * rcs.c (doassoc): Use ‘struct link’ for list-walk local vars. * rcsgen.c (format_assocs): Likewise. * rcsrev.c (rev_from_symbol): Likewise. * rcssyn.c (getadmin): Likewise. 2010-05-20 Thien-Thi Nguyen [int] Incorporate ‘fro_get_prev_byte’ into unique caller. * b-kwxout.c (keyreplace): Use ‘fro_move’, ‘GETCHAR’. * b-fro.c (fro_get_prev_byte): Delete func. * b-fro.h (fro_get_prev_byte): Delete func decl. 2010-05-20 Thien-Thi Nguyen [int] Add abstraction: fro_move * b-fro.c (fro_bob): Delete func. (fro_move): New func. * b-fro.h (fro_bob): Convert from func decl to macro. (fro_move): New func decl. 2010-05-20 Thien-Thi Nguyen [int org] Move some funcs out of rcssyn.c to rcsedit.c. * rcssyn.c (unexpected_EOF, initdiffcmd, badDiffOutput) (diffLineNumberTooLarge, getdiffcmd): Move funcs from here... * rcsedit.c: #include . (unexpected_EOF, initdiffcmd, badDiffOutput) (diffLineNumberTooLarge, getdiffcmd): ...to here. * base.h: Reorder func decls; nfc. 2010-05-19 Thien-Thi Nguyen [int] Use ‘?:’ more. * rlog.c (putadelta): Use ‘?:’ instead of ‘if’ statement. 2010-05-18 Thien-Thi Nguyen [int] Add abstraction: SYNTAX_ERROR * b-complain.c (fatal_syntax): Take line number as first arg. * b-complain.h (fatal_syntax): Update func decl. (SYNTAX_ERROR): New macro. * b-fro.c: Do g/fatal_syntax/SYNTAX_ERROR/g. * rcsedit.c: Likewise. * rcsgen.c: Likewise. * rcslex.c: Likewise. * rcssyn.c: Likewise. * rlog.c: Likewise. * yarrrr.c: Likewise. 2010-05-18 Thien-Thi Nguyen [int org] Move ‘LEX (erroneousp)’ to ‘FLOW (erroneousp)’. * base.h (struct parse_state): Move member ‘erroneousp’ from here... (struct flow): ...to here. * b-complain.c: Do s/LEX (erroneousp)/FLOW (erroneousp)/g. * ci.c: Likewise. * co.c: Likewise. * merge.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsedit.c: Likewise. * rcskeep.c: Likewise. * rcslex.c: Likewise. * rcsmerge.c: Likewise. * rlog.c: Likewise. 2010-05-18 Thien-Thi Nguyen [int org] Move some funcs out of rcslex.c to rcsmap.c. * rcslex.c (checkidentifier, checkid, checksym, checksid) (checkssym): Move funcs from here... * rcsmap.c (checkidentifier, checkid, checksym, checksid) (checkssym): ...to here. * base.h: Reorder func decls; nfc. 2010-05-18 Thien-Thi Nguyen [int] Dose some funcs with ‘const’. * rcslex.c (checkidentifier, checkid, checksym): Return/take ‘char const *’. (checksid, checkssym): Take ‘char const *’. * base.h (checkidentifier, checkid, checksym) (checksid, checkssym): Update func decls. 2010-05-18 Thien-Thi Nguyen [int] Don't mutate string in ‘checkidentifier’. * rcslex.c (checkidentifier): Don't NUL-terminate arg to error message; instead, use ‘%.*s’ in error message format string. 2010-05-18 Thien-Thi Nguyen [int org] Move ‘redefined’ from rcslex.c to rcsutil.c. * base.h (redefined): Move func decl; nfc. * rcslex.c (redefined): Move func from here... * rcsutil.c (redefined): ...to here. 2010-05-18 Thien-Thi Nguyen [int org] Move some funcs out of rcslex.c to b-fb.[hc]. * b-fb.c (Ozclose, Orewind, aflush, oflush, afputc, aputs) (aprintf): Move funcs from rcslex.c to here. * b-fb.h (Ozclose, Orewind, aflush, oflush, afputc, aputs) (aprintf): Move func decls from base.h to here; add ‘extern’. * rcsclean.c: #include "b-fb.h". * rcssyn.c: Likewise. * rlog.c: Likewise. * base.h (Ozclose, Orewind, aflush, oflush, afputc, aputs) (aprintf): Delete func decls. * rcslex.c (Ozclose, Orewind, aflush, oflush, afputc, aputs) (aprintf): Delete funcs. 2010-05-18 Thien-Thi Nguyen [int] Mutate strings in rcs(1) ‘argv’ less. * rcs.c (getassoclst, getaccessor, getstates): Cons a new string in ‘SHARED’ instead of mutating the arg. 2010-05-17 Thien-Thi Nguyen [int] Add abstractions: EDIT_SCRIPT_SHORT, EDIT_SCRIPT_OVERFLOW * rcsedit.c (EDIT_SCRIPT_SHORT, EDIT_SCRIPT_OVERFLOW): New macros. (editEndsPrematurely, editLineNumberOverflow): Delete funcs. (insertline, deletelines, copylines): Use ‘EDIT_SCRIPT_OVERFLOW’. (editstring): Likewise; also, use ‘EDIT_SCRIPT_SHORT’. 2010-05-17 Thien-Thi Nguyen [int] Fix bug: Make ‘take’ handle branch number. Regression introduced 2010-04-21, "Use ‘TAKE’, not ‘partialno’; zonk the latter". * rcsrev.c (take): Stop looping at terminating NUL; in that case, accumulate up to the NUL as well. * base.h (take): Update var name in func decl. 2010-05-13 Thien-Thi Nguyen [int] Centralize ‘COMPAT2’ support. * b-anchor.c [COMPAT2] (tiny_suffix): New ‘struct tinysym’. * base.h [COMPAT2] (tiny_suffix): New ‘struct tinysym’ decl. * rcssyn.c [COMPAT2] (tiny_suffix): Delete. 2010-05-13 Thien-Thi Nguyen [int] Use ‘tmpfile’. * rcs.c (sendmail, buildeltatext): Use ‘tmpfile’. 2010-05-13 Thien-Thi Nguyen rcs: Fix syntax error when ‘--with-mailer=MAILER’. Regression introduced 2010-03-30, "Abstract writes to stderr". * rcs.c (sendmail): Add missing semicolon. 2010-05-09 Thien-Thi Nguyen [int] Use #define for ‘rcsdir’; rename its -len var conventionally. * rcsfnms.c (rcsdir): Convert string var to #define. (rcsdirlen): Rename from ‘rcslen’. (rcssuffix): Use ‘rcsdirlen’. (fin2open): Use ‘rcsdirlen’ directly. 2010-05-08 Thien-Thi Nguyen [int] For collecting deltas, replace file-static var w/ local var. * ci.c (gendeltas): Delete var. (addelta): Take ‘struct hshentries **’; pass it to ‘gr_revno’. (main): Use local var for collecting deltas; update call to ‘addelta’. * co.c (gendeltas): Delete var. (main): Use local var for collecting deltas. * rcs.c (gendeltas): Delete var. (removerevs, main): Use local var for collecting deltas. 2010-05-08 Thien-Thi Nguyen [int] Add abstraction: delta_from_ref * base.h (delta_from_ref): New func decl. * rcsrev.c (delta_from_ref): New func. (branchtip): Use ‘delta_from_ref’. * ci.c (addbranch, main): Likewise. * co.c (addjoin): Likewise. * rcs.c (setlock, dolocks, domessages, rcs_setstate): Likewise. * rcsdiff.c (main): Likewise. * rcsmerge.c (main): Likewise. 2010-05-07 Thien-Thi Nguyen [int] Fix bug: Resolve ‘BRNUM.’ correctly. Regression introduced 2010-04-21, "Add abstraction: fully_numeric". * rcsrev.c (fully_numeric): When expanding "BRNUM."--note trailing dot--append only the non-branch part of the tip revision. 2010-05-07 Thien-Thi Nguyen [int] Make ‘genrevs’, ‘gr_revno’ able to inhibit storing. * rcsrev.c (STORE_MAYBE, CLEAR_MAYBE): New macros. (genbranch, genrevs): Use ‘STORE_MAYBE’, ‘CLEAR_MAYBE’. (branchtip): Update call to ‘gr_revno’ to specify no storage. * co.c (addjoin): Likewise. * rcsdiff.c (main): Likewise. * rcsmerge.c (main): Likewise. 2010-05-06 Thien-Thi Nguyen [int] Avoid ‘next’ as a local variable name. * rcsedit.c (checkaccesslist): Rewrite ‘do-while’ as ‘for’ loop. * rcsrev.c (genbranch, genrevs): Rename local var ‘next’ to ‘d’. (rev_from_symbol): Rename local var ‘next’ to ‘ls’. 2010-05-06 Thien-Thi Nguyen [int] Use ‘struct wlink’ for hash table buckets. * base.h (struct hshentry): Delete member ‘nexthsh’. (struct parse_state): Change type of ‘hshtab’ to ‘struct wlink **’. * rcslex.c: #include "b-esds.h". (lookup): Update to walk ‘struct wlink’ list; for new entries, push -- use ‘wprepend’ -- instead of appending. 2010-05-06 Thien-Thi Nguyen [int] Replace ‘struct branchhead’ with ‘struct wlink’. Here, "U" means "Update to walk ‘struct wlink’ list". * base.h (struct branchhead): Delete. (struct hshentry): Change type of member ‘branches’ to ‘struct wlink *’. * ci.c (newbranch): Change type to ‘struct wlink’. (BHDELTA): New macro. (addbranch): U; use ‘BHDELTA’. * rcs.c (buildtree): U. * rcsgen.c (putdelta, puttree): U. * rcsrev.c (genbranch): U. * rcssyn.c (getdelta): U. * rlog.c (putadelta, putforest, exttree, recentdate, extdate): U. 2010-05-06 Thien-Thi Nguyen [int] Use ‘struct wlink’ for ‘ADMIN (locks)’ list. Here, "U" means "Update to walk ‘struct wlink’ list". * base.h (struct rcslock): Delete member ‘nextlock’. (struct repository): In sub-‘struct admin’, change type of member ‘locks’ to ‘struct wlink *’. * ci.c (removelock): U. * co.c (rmlock): U. * rcs.c (breaklock, branchpoint): U. (dolocks): Update access to ‘ADMIN (locks)’. * rcsclean.c (unlock): U. * rcsedit.c (findlock): U. (addlock): U; use ‘wprepend’. * rcsgen.c (putadmin): U. * rcssyn.c (getadmin): U; use ‘wextend’. (gettree): U. * rlog.c (extractdelta, trunclocks, main): U. 2010-05-06 Thien-Thi Nguyen [int] Add abstraction: wprepend * b-esds.h (wprepend): New func decl. * b-esds.c (PREPEND_BODY): New macro. (prepend): Use ‘PREPEND_BODY’. (wprepend): New func. 2010-05-06 Thien-Thi Nguyen [int] Replace ‘struct Status’ with ‘struct link’ + ‘struct u_state’. * rcs.c (struct u_state): New. (struct Status): Delete. (statelst): Change type to ‘struct link’. (nextstate): Delete var. (getstates): Take ‘struct link **’; use ‘extend’. (main): Update call to ‘getstates’; update ‘statelst’ access to walk ‘struct link’ list. 2010-05-06 Thien-Thi Nguyen [int] Replace ‘struct Datepairs’ with ‘struct link’ + ‘struct daterange’. * rlog.c (struct daterange): New. (struct Datepairs): Delete. (datelist, duelst): Change type to ‘struct link *’. (recentdate): Take ‘struct daterange *’. (extdate): Update to walk ‘struct link’ list. (PUSH): Move prior to ‘getdatepair’; nfc. (getdatepair): Use ‘struct daterange’ object; use ‘PUSH’. (main): Update to walk ‘struct link’ list; also, discard incomplete ‘duelst’ entry, substituting it with a new object. 2010-05-05 Thien-Thi Nguyen [int] Incorporate ‘xpandstring’ into unique caller. * rcsgen.c: #include "b-kwxout.h". (scandeltatext): Incorporate ‘xpandstring’. * rcsedit.c (xpandstring): Delete func. * base.h (xpandstring): Delete func decl. 2010-05-05 Thien-Thi Nguyen [int] Free edit state when done. * rcsedit.c (unmake_editstuff): New func. * base.h (unmake_editstuff): New func decl. * rcs.c (main): Use ‘unmake_editstuff’. * rcsgen.c (buildrevision): Likewise. 2010-05-05 Thien-Thi Nguyen [int] Replace ‘Iptr_type’ with ‘char *’. * b-fro.h (Iptr_type): Delete typedef. (struct fro): Change type to ‘char *’ for members ‘ptr’, ‘lim’, ‘base’. * b-fro.c (fro_open): Use ‘char *’ directly. * rcsedit.c (struct editstuff): Likewise. (movelines, insertline, snapshotline, snapshotedit_fast) (finisheditline, finishedit_fast, enterstring): Likewise. 2010-05-05 Thien-Thi Nguyen [int] Replace ‘struct Message’ with ‘struct link’ + ‘struct u_log’. * rcs.c (struct u_log): New. (struct Message): Delete. (messagelst): Change type to ‘struct link’. (nextmessage): Delete var. (getmessage): Take ‘struct link **’; use ‘extend’. (domessages): Update to walk ‘struct link’ list. (main): Update call to ‘getmessage’; update ‘messagelst’ access. 2010-05-05 Thien-Thi Nguyen [int] Replace ‘struct Revpairs’ with ‘struct link’ + ‘struct revrange’. * rlog.c (struct revrange): New. (struct Revpairs): Delete. (revlist, Revlst): Change type to ‘struct link *’. (extractdelta): Update to walk ‘struct link’ list. (PUSH): New macro. (getnumericrev): Update to walk ‘struct link’ list; use ‘PUSH’. (putrevpairs): Use ‘PUSH’. 2010-05-05 Thien-Thi Nguyen [int] Add abstraction: prepend * b-esds.h (prepend): New func decl. * b-esds.c (prepend): New func. 2010-05-04 Thien-Thi Nguyen [int] Use ‘struct u_symdef’ more. * rcs.c (struct u_symdef): Move from here... * base.h (struct u_symdef): ...to here. * ci.c: #include "b-esds.h". (struct Symrev): Delete. (assoclst): Change type to ‘struct link’. (nextassoc): Delete var. (addsyms): Update to walk ‘struct link’ list. (addassoclst): Delete func. (first_meaningful_symbolic_name): New static func. (main): Combine ‘-n’, ‘-N’ handling; update ‘assoclst’ init and access; use ‘first_meaningful_symbolic_name’. 2010-05-04 Thien-Thi Nguyen [int] Use ‘struct link’ more. * rcs.c (struct chaccess): Delete member ‘nextchaccess’. (chaccess): Change type to ‘struct link’. (nextchaccess): Delete var. (getchaccess): Take ‘struct link **’; use ‘extend’. (getaccessor): Take ‘struct link **’; update call to ‘getchaccess’. (doaccess): Update to walk ‘struct link’ list. (main): Update calls to ‘getaccessor’, ‘getchaccess’. 2010-05-04 Thien-Thi Nguyen rcs: Fix bug: Correctly erase/append access-list entries. Regression introduced 2010-04-28, "Use ‘struct link’ instead of ‘struct access’". * rcs.c (doaccess): Rewrite list walking for both erase/append. 2010-05-04 Thien-Thi Nguyen [int] Replace ‘struct Symrev’ with ‘struct link’ + ‘struct u_symdef’. * rcs.c (struct Symrev): Delete. (struct u_symdef): New. (assoclst): Change type to ‘struct link’. (nextassoc): Delete var. (getassoclst): Don't take ‘flag’; instead, take ‘struct link **’; compute override flag from first char in ‘sp’; add local macro to skip whitespace; create a ‘struct u_symdef’; use ‘extend’. (doassoc): Update to walk ‘struct link’ list. (main): Update call to ‘getassoclst’; combine ‘-n’, ‘-N’ handling. 2010-05-04 Thien-Thi Nguyen rcs: Fix bug: Correctly delete symbolic name. Regression introduced 2010-04-28, "Replace ‘struct assoc’ with ‘struct wlink’ + ‘struct symdef’". * rcs.c (doassoc): Use local variable of type ‘struct symdef *’ to assign from ‘void *’ instead of typecast; also, assign from ‘tp->entry’, not ‘tp’. 2010-05-04 Thien-Thi Nguyen [int] Fix bug: Make ‘keepdate’ actually keep the date. Regression introduced 2010-04-12, "Use spaces for "ci -k" support". * rcskeep.c (keepdate): Use ‘intern’, not ‘finish_string’. 2010-05-03 Thien-Thi Nguyen [int] Add abstraction: parse_revpairs * rcsutil.c (parse_revpairs): New func. * base.h (parse_revpairs): New func decl. * rcs.c (putdelrev): New static func. (getdelrev): Delete func. (main): Use ‘parse_revpairs’. * rlog.c (putrevpairs): New static func. (getrevpairs): Delete func. (main): Use ‘parse_revpairs’. 2010-05-03 Thien-Thi Nguyen ident: Make error message more conventional. * ident.c (reportError): Delete func. (scanfile, main): Use ‘syserror_errno’. 2010-05-03 Thien-Thi Nguyen [int] Use ‘struct link’ more. * rlog.c (struct rcslockers): Delete. (struct stateattri, struct authors): Likewise. (authorlist, lockerlist, statelist): Change type to ‘struct link *’. (getlocker, getauthor, getstate): Use ‘extend’. (extractdelta, trunclocks): Update to walk ‘struct link *’ list. * rcs.c (struct Lockrev): Delete. (newlocklst, rmvlocklst): Change type to ‘struct link *’. (rmnewlocklst): Return ‘struct link *’. (dolocks): Update to walk ‘struct link *’ list. (main): Use ‘extend’. 2010-05-02 Thien-Thi Nguyen [int] Use ‘bool’ more. * base.h (struct hshentry): Change type of member ‘selector’ to bool. 2010-04-30 Thien-Thi Nguyen Freeze RCS file syntax; drop ‘newphrase’ support. * base.h (struct hshentry): Delete members ‘ig’, ‘igtext’. (struct parse_state): Delete member ‘ignore’. (struct repository): Delete member ‘description’. (warnignore, getphrases, ignorephrases): Delete func decls. * ci.c (main): Don't init ‘newdelta.ig’, ‘newdelta.igtext’. * rcs.c (scanlogtext): Expect ‘text’ after ‘log’. * rcsfnms.c (InitAdmin): Don't init ‘ADMIN (description)’. * rcsgen.c (scandeltatext): Expect ‘text’ after ‘log’. (putadmin): Don't bother w/ ‘ADMIN (description)’ output. (putdelta, putdftext): Don't bother w/ "ignored phrases" output. * rcslex.c (warnignore): Delete func. (Lexinit): Don't bother w/ ‘LEX (ignore)’ init. (getphrases): Delete func. * rcssyn.c (getadmin): Don't init ‘ADMIN (description)’. (ignorephrases): Delete func. (getdelta): Don't bother lookng for "ignorable phrases". * rlog.c (readdeltalog): Expect ‘text’ after ‘log’. 2010-04-30 Thien-Thi Nguyen [int] Clean up base.h; nfc. * base.h: Reorder top-level forms; add variable names to func decls. (expand_names): Delete now-unused var decl. 2010-04-30 Thien-Thi Nguyen [int] Add abstraction: format_assocs * base.h (format_assocs): New func decl. * rcsgen.c (format_assocs): New func. (putadmin): Use ‘format_assocs’. * rlog.c (main): Likewise. * alive.test: Update expected rlog(1) output. 2010-04-30 Thien-Thi Nguyen Recognize ‘commitid SYMBOL’ in RCS file delta tree. * base.h (struct hshentry): Add member ‘commitid’. (tiny_commitid): New var decl, via ‘TINY_DECL’. * b-anchor.c (tiny_commitid): New var, via ‘TINYK’. * rcssyn.c (getdelta): Recognize ‘commitid’; validate/save its value. * rcsgen.c (putdelta): Output ‘commitid’ info, if available. * rlog.c (putadelta): Likewise. 2010-04-30 Thien-Thi Nguyen [int] Move ‘expandline’ scratch to expansion context. * b-kwxout.h (struct expctx): Add member ‘lparts’. * b-kwxout.c (LPARTS): Delete #define. (ENSURE_LPARTS): Delete macro. (expandline): Create/use space directly in expansion context. * base.h (struct manifestation): Delete member ‘lparts’. 2010-04-29 Thien-Thi Nguyen [int] For rcsedit.c, use es->foo directly. * rcsedit.c (EDIT): Delete macro. (insertline): Use ‘es->foo’ instead of ‘EDIT (foo)’. (deletelines, snapshotedit_fast, finishedit_fast, swapeditfiles) (finishedit_slow, snapshotedit_slow, copylines, copystring) (enterstring, editstring): Likewise. 2010-04-29 Thien-Thi Nguyen [int] Tighten ‘finishedit_fast’. * rcsedit.c (finisheditline): Take ‘struct expctx *’. (finishedit_fast): Create expansion context, pass to ‘finisheditline’. 2010-04-28 Thien-Thi Nguyen [int] Replace ‘struct assoc’ with ‘struct wlink’ + ‘struct symdef’. Here, "U" means "Update to use ‘struct wlink’ + ‘struct symdef’". * base.h (struct assoc): Delete. (struct symdef): New. (struct repository): Use ‘struct wlink’ for ‘admin.assocs’. * rcs.c (doassoc): U. * rcsedit.c (addsymbol): U. * rcsgen.c (putadmin): U. * rcsrev.c: #include "b-esds.h". (rev_from_symbol): U. (lookupsym): Use ‘rev_from_symbol’. * rcssyn.c (getadmin): U. * rlog.c (main): U. 2010-04-28 Thien-Thi Nguyen [int] Use ‘struct link’ instead of ‘struct access’. Here, "U" means "Update to use ‘struct link’". * base.h (struct access): Delete. (struct repository): Use ‘struct link’ for ‘admin.allowed’. * rcs.c: #include "b-esds.h". (doaccess, main): U. * rcsedit.c: #include "b-esds.h". (checkaccesslist): U. * rcsgen.c: #include "b-esds.h". (putadmin): U. * rcssyn.c: #include "b-esds.h". (getadmin): U. * rlog.c: #include "b-esds.h". (main): U. 2010-04-28 Thien-Thi Nguyen [int] Add abstractions: STR_DIFF, STR_SAME * base.h (STR_DIFF, STR_SAME): New macros. * ci.c (removelock, addbranch, main): Use one or both of them. * co.c (rmlock): Likewise. * rcs.c (rmnewlocklst, doaccess, breaklock, doassoc) (rcs_setstate, main): Likewise. * rcsclean.c (unlock): Likewise. * rcsedit.c (findlock, addlock, addsymbol, checkaccesslist): Likewise. * rcslex.c (lookup): Likewise. * rcsmerge.c (main): Likewise. * rcsrev.c (genbranch, genrevs, lookupsym, namedrev): Likewise. * rlog.c (extractdelta, trunclocks): Likewise. 2010-04-28 Thien-Thi Nguyen [int] Rework remaining function-static variables. * ci.c (newbranch): New file-static var, moved to here... (addbranch): ...from here. (getcurdate_buffer): New file-static var, renamed/moved to here... (getcurdate): ...from ‘buffer’, here. (FIRST): New #define. (logmsg): New file-static var, move to here... (getlogmsg): ...from here; also, construct "empty checkin" and "initial revision" messages dynamically. (default_state): New file-static var, moved to here... (main): ...from here. * rcsmerge.c (quietarg): New #define. (main): Delete func-static var ‘quietarg’. * rlog.c (putdelta): Delete func-static var ‘emptych’; use ‘EMPTYLOG’ directly. 2010-04-27 Thien-Thi Nguyen [int] New abstractions: extend, wextend * b-esds.h: New file. * b-esds.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-esds.h, b-esds.c. * co.c: #include "b-esds.h". (struct link): Delete. (struct jstuff): Delete members ‘prev’, ‘cur’; add ‘head’, ‘tp’. (jpush): Use ‘extend’. (preparejoin): Accumulate ‘joinlist’ components in order. * rcsclean.c: #include "b-esds.h". (struct link): Delete. (get_directory): Use ‘wextend’. 2010-04-27 Thien-Thi Nguyen [int] Add abstraction: fro_spew_partial * b-fro.h (struct range): New. (struct fro): Add member ‘end’. (fro_spew_partial): New func decl. * b-fro.c (fro_open): Save file-end offset. (fro_spew_partial): New func. (fro_spew): Use ‘fro_spew_partial’. 2010-04-26 Thien-Thi Nguyen [int] Make ‘struct maketimestuff’ definition global. * maketime.h (maketimestuff): Move struct def to here... * maketime.c: Don't #include "b-divvy.h". (maketimestuff): ...from here. (init_maketimestuff): Delete func. * rcsutil.c (gnurcs_init): Init ‘BE (maketimestuff)’ directly. 2010-04-26 Thien-Thi Nguyen [int] Allocate edit state lazily. Here, "F" means "Take ‘struct editstuff *’ as first arg". * rcsedit.c (EDIT): Update macro. (make_editstuff): New func. (insertline, deletelines, snapshotedit_fast, finishedit_fast) (swapeditfiles, finishedit_slow, snapshotedit_slow, finishedit) (snapshotedit, copylines): F. (ensure_editstuff): Delete func. (copystring): F; don't call ‘ensure_editstuff’. (enterstring): Likewise. (editstring): F. (rcswriteopen): Don't call ‘ensure_editstuff’. * rcsgen.c (scandeltatext): F. (buildrevision): Create a ‘struct editstuff’ to pass around. * rcs.c (scanlogtext, buildeltatext): F. (main): Create a ‘struct editstuff’ to pass around. * base.h (struct behavior): Remove member ‘editstuff’. (make_editstuff): New func decl. (copystring, enterstring, finishedit) (snapshotedit, editstring): Update func decls. 2010-04-25 Thien-Thi Nguyen [int] Move ‘testalloc’, ‘testrealloc’; make them static. * rcsedit.c: #include . (okalloc, testalloc, testrealloc): New static funcs. * rcsutil.c (okalloc, testalloc, testrealloc): Delete funcs. * base.h (testalloc, testrealloc): Delete func decls. 2010-04-25 Thien-Thi Nguyen [int] Use ‘SHARED’ more. * ci.c (addassoclst): Use ‘ZLLOC’. * rcs.c (getassoclst, getchaccess) (getmessage, getstates, main): Likewise. (rmnewlocklst): Don't ‘tfree’. * rlog.c (getlocker, getauthor, getstate) (getdatepair, getrevpairs): Use ‘ZLLOC’. * base.h (talloc, tfree): Delete macros. 2010-04-25 Thien-Thi Nguyen [int] Bifurcate ‘fro_getbyte’ to fro_{try,must}_getbyte. * b-fro.c (GETBYTE_BODY): New macro. (fro_getbyte): Delete func. (fro_try_getbyte, fro_must_getbyte): New funcs. (fro_get_prev_byte): Use ‘fro_must_getbyte’. * b-fro.h (fro_getbyte): Delete func decl. (fro_try_getbyte, fro_must_getbyte): New func decls. (GETCHAR_OR) Use ‘fro_try_getbyte’. (GETCHAR): Use ‘fro_must_getbyte’. 2010-04-25 Thien-Thi Nguyen [int] Add abstraction: must_get_colon_delta_num * rcssyn.c (must_get_colon_delta_num): New static func. (getadmin): Use it. 2010-04-25 Thien-Thi Nguyen [int] Add abstraction: must_get_delta_num * rcslex.c (must_get_delta_num): New func. * base.h (must_get_delta_num): New func decl. * rcs.c (scanlogtext): Use ‘must_get_delta_num’. * rcsgen.c (scandeltatext): Likewise. * rlog.c (readdeltalog): Likewise. 2010-04-25 Thien-Thi Nguyen [int] Use ‘strlen’ less. * rcs.c (main): Use ‘commsymlen’. * rcsfnms.c (pairnames): Use ‘intern’, ‘maybe.bestfit.size’. * rcslex.c (lookup): Use ‘intern’. * rcstime.c (date2str): Track write count via ‘sprintf’ rv. 2010-04-24 Thien-Thi Nguyen Enable 64-bit file offsets. * base.h (_FILE_OFFSET_BITS): New #define. 2010-04-24 Thien-Thi Nguyen [int] Make ‘tiny_branches’ global. * base.h (tiny_branches): New var decl (via ‘TINY_DECL’). * b-anchor.c (tiny_branches): New var (via ‘TINYK’). * rcssyn.c (tiny_branches): Delete static var. 2010-04-24 Thien-Thi Nguyen [build] Use gnulib module ‘obstack-printf’. * b-divvy.c (accf): New func. (accumulate_nonzero_bytes): Delete func. * b-divvy.h (accf): New func decl. (accumulate_nonzero_bytes): Delete func decl. (accs): New macro. * b-feph.c (jam_sff): Use ‘accf’. * ci.c (ACCB, ACCS): Delete macros. (ACCF): New macro. (JAM, ADD, incnum, getlogmsg): Use ‘ACCF’. * co.c (buildjoin): Use ‘accf’. * merger.c (normalize_arg): Likewise. * rcsdiff.c (setup_label, main): Likewise. * rcsedit.c (naturalize, rcswriteopen): Use ‘accs’. * rcsfnms.c (getfullRCSname): Use ‘accf’. * rcslex.c (getphrases): Use ‘accs’. * rcsrev.c (accumulate_branchno): Likewise. (fully_numeric): Use ‘accf’, ‘accs’. * rcsutil.c (minus_p, accumulate_arg_quoted): Use ‘accf’. (runv): Use ‘accs’, ‘accf’. * rlog.c (getnumericrev): Use ‘accf’. 2010-04-23 Thien-Thi Nguyen [int] Tighten ‘InitAdmin’. * rcsfnms.c (bindex, suffix_matches): Delete func. (InitAdmin): Use ‘strrchr’, ‘strcasecmp’. 2010-04-22 Thien-Thi Nguyen [int] Use tinysym for parsing "RCS file keywords". * b-anchor.c (TINY_INIT, TINYK): New macros. (tiny_ciklog, tiny_access, tiny_author, tiny_branch, tiny_comment) (tiny_date, tiny_desc, tiny_expand, tiny_head, tiny_locks, tiny_log) (tiny_next, tiny_state, tiny_strict, tiny_symbols, tiny_text): New ‘struct tinysym’ objects, via ‘TINY_DECL’, ‘TINYK’. (looking_at): New func. * base.h (KS): Delete macro. (Kaccess, Kauthor, Kbranch, Kcomment, Kdate, Kdesc) (Kexpand, Khead, Klocks, Klog, Knext, Kstate, Kstrict) (Ksymbols, Ktext, ciklog, ciklog_len): Delete #define:s. (TINY, TINY_DECL): New macros. (tiny_ciklog, tiny_access, tiny_author, tiny_branch, tiny_comment) (tiny_date, tiny_desc, tiny_expand, tiny_head, tiny_locks, tiny_log) (tiny_next, tiny_state, tiny_strict, tiny_symbols, tiny_text): New ‘struct tinysym’ object decls, via ‘TINY_DECL’. (looking_at): New func decl. (getkeyopt, getphrases, getkey, getkeystring) (ignorephrases): Update func decls. (TINYS, TINYKS): New macros. * b-kwxout.c (keyreplace): Use ‘looking_at’, ‘TINY (ciklog)’. * rcsfcmp.c (rcsfcmp): Likewise. * ci.c (getlogmsg): Use ‘TINYKS’. * rcsedit.c (dorewrite): Likewise. * rcs.c (scanlogtext): Pass ‘&TINY (foo)’. * rcsgen.c (scandeltatext): Likewise. (putdesc, putadmin, putdelta, putdftext): Use ‘TINYKS’. * rcslex.c (getkeyopt, getkey, getkeystring): Take ‘struct tinysym *’. (getphrases): Likewise; use ‘intern’. * rcssyn.c (Kbranches): Replace #define with ‘TINY_DECL (branches)’. [COMPAT2] (Ksuffix): Replace #define with ‘TINY_DECL (suffix)’. (getsemi): Take ‘struct tinysym *’. (getadmin): Pass ‘&TINY (foo)’. (ignorephrases): Take ‘struct tinysym *’; use ‘looking_at’. (getkeyval): Take ‘struct tinysym *’; use ‘TINYS’. (getdelta, getdesc): Pass ‘&TINY (foo)’. * rlog.c (readdeltalog): Likewise. 2010-04-22 Thien-Thi Nguyen [int] Tighten ‘recognize_kwsub’, ‘str2expmode’. * b-anchor.c (pool_lookup, recognize_kwsub): Don't take START, LEN; instead take a ‘struct cbuf *’. (str2expmode): New func. (recognize_keyword): Update call to ‘pool_lookup’. * rcssyn.c (getadmin): Update call to ‘recognize_kwsub’. * base.h (recognize_kwsub): Update func decl. (str2expmode): Convert from macro to func decl. 2010-04-21 Thien-Thi Nguyen [int] Prune now-obsolete ‘struct buf’. * base.h (buf): Delete struct. 2010-04-21 Thien-Thi Nguyen [int] Replace ‘Ofclose’ with ‘Ozclose’ or plain ‘fclose’. * co.c (main): Use ‘Ozclose’. * merger.c (merge): Likewise. * rcs.c (buildeltatext): Likewise. * rcsclean.c (main): Use ‘fclose’. * rcslex.c (Ofclose): Incorporate into ‘Ozclose’. * rcsmerge.c (main): Use ‘fclose’. * rlog.c (main): Use ‘Ozclose’. * base.h (Ofclose): Delete func decl. 2010-04-21 Thien-Thi Nguyen [int C] Factor func-finish code. * rcsgen.c (buildrevision): Move common finish to end of func. 2010-04-21 Thien-Thi Nguyen [int] Prune some now-obsoleted macros/funcs. * base.h (bufautobegin): Delete macro. (bufalloc, bufautoend, fbuf_save): Delete func decls. * rcsfnms.c (bufalloc, bufautoend): Delete funcs. * rcsutil.c (fbuf_save): Delete func. 2010-04-21 Thien-Thi Nguyen [int] Use ‘SHARED’ more. * b-kwxout.c (keyreplace): Save $Log leader temporarily in ‘SHARED’. * ci.c (getlogmsg): For -k, save log message in ‘SHARED’. * rcsdiff.c [DIFF_L] (setup_label): Don't take ‘struct buf *’; construct label in ‘SHARED’. (main) [DIFF_L]: Update calls to ‘setup_label’. 2010-04-21 Thien-Thi Nguyen [int] Prune some now-obsoleted funcs. * base.h (bufenlarge, bufscat, bufscpy): Delete func decls. * rcsfnms.c (bufrealloc, bufenlarge, bufscat, bufscpy): Delete funcs. 2010-04-21 Thien-Thi Nguyen [int] Replace ‘expandsym’ with ‘fully_numeric_no_k’. * base.h (expandsym): Delete func decl. (fully_numeric_no_k): New macro. * co.c (addjoin, main): Use ‘fully_numeric_no_k’. * rcs.c (numrev): Change var type to ‘struct cbuf’. (removerevs, doassoc, setlock, dolocks, domessages) (rcs_setstate, main): Use ‘fully_numeric_no_k’. * rcsrev.c (expandsym): Delete func. * rlog.c (getnumericrev): Use ‘fully_numeric_no_k’. * yarrrr.c [TEST_REV] (yarrrr): Likewise. 2010-04-21 Thien-Thi Nguyen [int] Use ‘BRANCHNO’, not ‘getbranchno’; zonk the latter. * rcsrev.c (take): If ‘count’ is zero, take it to be the number of fields right for a branch number. (getbranchno): Delete func. * base.h (getbranchno): Delete func decl. (BRANCHNO): New macro. * ci.c (addbranch): Use ‘BRANCHNO’. * rcs.c (removerevs): Likewise. * rlog.c (putadelta): Likewise. 2010-04-21 Thien-Thi Nguyen [int] Use ‘TAKE’, not ‘partialno’; zonk the latter. * base.h (take): New func decl. (partialno): Delete func decl. (TAKE): Move macro to here... * rcsrev.c (TAKE): ... from here. (take): Make non-static. (partialno): Delete func. * co.c (getancestor): Use ‘TAKE’. * rlog.c (getnumericrev): Likewise. 2010-04-21 Thien-Thi Nguyen [int] Add abstraction: take * rcsrev.c (take): New static func. (TAKE): New macro. (getbranchno, absent, partialno, genbranch, genrevs): Use ‘TAKE’. 2010-04-21 Thien-Thi Nguyen [int] Use ‘fully_numeric’, not ‘fexpandsym’; zonk the latter. * ci.c: #include "b-divvy.h". (newdelnum): Change type to ‘struct cbuf’. (ACCB, ACCS, OK, JAM, ADD): New macros. (incnum): Take ‘struct cbuf *’; accumulate into ‘SHARED’. (addbranch): Likewise. (addelta): Accumulate into ‘SHARED’; pass new string to ‘cmpnum’. (main): Use ‘fully_numeric’. * rcsclean.c (main): Use ‘fully_numeric’. * rcsdiff.c (main): Likewise. * rcsmerge.c: #include "b-divvy.h". (main): Use ‘fully_numeric’. * rcsrev.c (fexpandsym): Delete func. (expandsym): Use ‘fully_numeric’. * base.h (fexpandsym): Delete func decl. 2010-04-21 Thien-Thi Nguyen [int] Add abstraction: fully_numeric * base.h (fully_numeric): New func decl. * rcsrev.c (split, accumulate_branchno, rev_from_symbol): New static funcs. (fully_numeric): New func. (fexpandsym): Use ‘fully_numeric’. (expandsym): Move after ‘fexpandsym’; nfc. 2010-04-20 Thien-Thi Nguyen [build] Move conditionally-compiled test programs to yarrrr.c. * yarrrr.c: New file. * Makefile.am (EXTRA_DIST): Add yarrrr.c. (YALL, YPROGS): New vars. (y-STR2TIME, y-FCMP, y-PAIRS, y-KEEP, y-LEX, y-REV, y-SYN) (y-all, y-clean): New targets. * base.h: Comment munging; nfc. * maketime.c [TEST]: Delete #ifdef .. #endif block. * rcsfcmp.c [FCMPTEST]: Likewise. * rcsfnms.c [PAIRTEST]: Likewise. * rcskeep.c [KEEPTEST]: Likewise. * rcslex.c [LEXDB]: Likewise. * rcsrev.c [REVTEST]: Likewise. * rcssyn.c [SYNTEST]: Likewise. 2010-04-19 Thien-Thi Nguyen [int] Add abstraction: minus_p * base.h (minus_p): New func decl. * rcsutil.c (minus_p): New func. * rcsdiff.c (main): Use ‘minus_p’. * rcsmerge.c (main): Likewise. 2010-04-19 Thien-Thi Nguyen [int] For ‘co -j’, save merge(1)-command args in ‘SINGLE’. * co.c (buildjoin): Save arg strings in ‘SINGLE’. 2010-04-19 Thien-Thi Nguyen [int] Encapsulate ‘pairnames’ probe protocol state entirely. * base.h (maybe): New struct. (open_rcsfile_fn): Rename from ‘open_rcsfile_fn_t’; rewrite arglist. (rcswriteopen, rcsreadopen, pairnames): Update func decls. * rcsedit.c (naturalize): Take ‘struct maybe *’; use its space intead of a local one; don't save new filename in ‘SINGLE’. (rcswriteopen): Take ‘struct maybe *’; update call to ‘naturalize’; save not-yet-validated filenames in ‘m->space’; don't save to ‘SINGLE’ until after validation; pass ‘m->status’ to ‘fro_open’. * rcsfnms.c (rcsreadopen): Take ‘struct maybe *’. (maybe): Delete struct. (finopen): Update call to ‘m->open’; update ‘m->bestfit’ assignment. (fin2open): Build the strings in ‘m->space’; point ‘m->tentative’. (pairnames): Update type name of ‘rcsopen’ in arglist; set ‘maybe.status’; make a space for ‘maybe.space’; update ‘maybe.bestfit’ init; update call to ‘rcsopen’; close space before returning. 2010-04-19 Thien-Thi Nguyen [int] Add abstraction: bad_option * base.h (bad_option): New func decl. * rcsutil.c (bad_option): New func. * ci.c (main): Use ‘bad_option’. * co.c (main): Likewise. * merge.c (badoption): Delete func. (main): Use ‘bad_option’. * rcs.c (main): Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. * rcsfnms.c [PAIRTEST] (main): Likewise. * rcsmerge.c (main): Likewise. * rlog.c (main): Likewise. 2010-04-19 Thien-Thi Nguyen rcsclean: On unknown option, don't display usage info. * rcsclean.c (main): Don't display usage info. 2010-04-19 Thien-Thi Nguyen Don't say "path" when referring to file names. Files whose only changes were to comments are omitted. * base.h (ABSFNAME): Rename from ‘ROOTPATH’. (SIZEABLE_FILENAME_LEN): Rename from ‘SIZEABLE_PATH’. * rcs.c (main): Say "filename" in error message. * rcsedit.c (naturalize): Use ‘SIZEABLE_FILENAME_LEN’, ‘ABSFNAME’. (rcswriteopen): Rename local var; say "filename" in error messages. * rcsfnms.c (rcsreadopen): Rename arg; nfc. (getfullRCSname): Use ‘ABSFNAME’. [!HAVE_GETCWD] (getcwd): Rename arg; nfc. [PAIRTEST] (main): Say "filename" in diagnostic. 2010-04-19 Thien-Thi Nguyen [int] Move cached cwd to ‘struct behavior’. * base.h (behavior): Add member ‘cwd’; delete member ‘fnstuff’. (init_fnstuff): Delete func decl. * rcsfnms.c (fnstuff): Delete struct. (FN): Delete macro. (init_fnstuff): Delete func. (getfullRCSname): Use ‘BE (cwd)’ instead of ‘FN (cwd)’. * rcsutil.c (gnurcs_init): Don't init fnstuff. 2010-04-19 Thien-Thi Nguyen [build] Trim some unused #include directives. * rcsfnms.c: Don't #include , , , . 2010-04-19 Thien-Thi Nguyen [build] Revert forced-‘if’ introduced 2010-04-12. * rcsfnms.c (getfullRCSname): Revert ‘if (!0)’. 2010-04-19 Thien-Thi Nguyen [int] Encapsulate parameters for ‘pairnames’ subroutines. * rcsfnms.c (fnstuff): Delete members ‘RCSb’, ‘RCSbuf’, ‘RCSerrno’. (maybe): New struct. (finopen): Take a ‘struct maybe *’; extract ‘filename’, ‘open’ and ‘mustread’ from it; if succesful, modify its ‘bestfit’ and ‘eno’. (fin2open): Use '\0' instead of naked 0; take a ‘struct maybe *’; init its member ‘filename’; pass it to ‘finopen’. (pairnames): Construct a ‘struct maybe’ to pass to ‘fin2open’; if filename found, save its ‘bestfit’ to ‘REPO (filename)’. 2010-04-18 Thien-Thi Nguyen [int C] Use ‘open_rcsfile_fn_t’ more. * rcsfnms.c (finopen, fin2open): Use ‘open_rcsfile_fn_t’ in arglist. 2010-04-18 Thien-Thi Nguyen merge: On bad or incorrect # of options, don't display usage info. * merge.c (usage): Delete var. (badoption, main): Don't display usage info. 2010-04-18 Thien-Thi Nguyen [int] Move temporary filename funcs to b-feph.[hc]. * b-feph.h: New file. * b-feph.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-feph.h, b-feph.c. * base.h (maker): New enum. (sff): New struct. (behavior): Add members ‘sff’, ‘ephemstuff’. (makedirtemp, dirtempunlink, keepdirtemp, set_temporary_file_name) (maketemp, tempunlink): Delete func decls. (SFFI_LOCKDIR, SFFI_NEWDIR): New #define:s. Here, "I" means "#include "b-feph.h""; "B" means "Call ‘makedirtemp’ with boolean value". * ci.c: I. (xpandfile): B. * co.c: I. (main): B. * merge.c: I. * merger.c: I. * rcs.c: I. * rcsclean.c: I. * rcsdiff.c: I. * rcsedit.c: #include "b-feph.h". (maker): Delete enum. (sff): Delete struct. (SFFI_LOCKDIR, SFFI_NEWDIR, SFF_COUNT): Delete #define:s. (editstuff): Convert member ‘sff’ type from array to pointer. (lockname, newRCSname): Use ‘BE (sff)’. (rcswriteopen): Likewise. Also, modify ‘BE (sff)’ directly. (keepdirtemp, makedirtemp, dirtempunlink): Delete funcs. * rcsfnms.c: #include "b-feph.h". (TEMPNAMES): Delete #define. (fnstuff): Delete members ‘tpnames’, ‘tmpdir’. [!HAVE_MKSTEMP] (homegrown_mkstemp): Delete func. [!HAVE_MKSTEMP] (mkstemp): Delete #define. (set_temporary_file_name, maketemp, tempunlink): Delete funcs. * rcsgen.c [BAD_CREAT0] (putadmin): B. * rcsmerge.c: I. * rcsutil.c: I. (gnurcs_init): Init ‘BE (ephemstuff)’. 2010-04-18 Thien-Thi Nguyen [int] When constructing the lockfile name, save directly to ‘SHARED’. * rcsedit.c (rcswriteopen): Use ‘SHARED’ for lockfile name mangling instead of ‘struct buf’. 2010-04-18 Thien-Thi Nguyen [int C] Make ‘bufrealloc’ static. * rcsfnms.c (bufrealloc): Make static. * base.h (bufrealloc): Delete func decl. 2010-04-18 Thien-Thi Nguyen [int] When reading from stdin, save directly to ‘SHARED’. * rcsgen.c (getsstdin): Don't take ‘struct buf *’; save directly to ‘SHARED’; rewrite sole-dot-on-line detection/handling. (putdesc): Update call to ‘getsstdin’. * ci.c (getlogmsg): Update call to ‘getlogmsg’. * base.h (getsstdin): Update func decl. 2010-04-17 Thien-Thi Nguyen [int] Add abstraction: accumulate_range * b-divvy.h (accumulate_range): New func decl. * b-divvy.c (accumulate_range): New func. * rcsedit.c (naturalize): Use ‘accumulate_range’. * rcslex.c (getphrases): Likewise. 2010-04-17 Thien-Thi Nguyen [int C] Use ‘fseeko’ more. * rcslex.c (Orewind): Use ‘fseeko’ instead of ‘fseek’. 2010-04-17 Thien-Thi Nguyen [int C] Use ‘ftello’ more. * ci.c (main): Use ‘ftello’ instead of ‘ftell’. 2010-04-17 Thien-Thi Nguyen [int] Overhaul read-only file handling. * b-fro.h: New file. * b-fro.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-fro.h, b-fro.c. * b-fb.h (Ieof): Delete func decl. * b-fb.c (Ieof): Delete func. * base.h [HAVE_SYS_MMAN_H]: Don't #include . (large_memory, maps_memory): Delete #define:s. (RILE): Delete typedef. (declarecache, setupcache, cache, uncache, Igeteof, cachegeteof, Iget) (cacheget, cacheunget, Ifileno, Ioffset_type, Irewind, Itell, GETC): Delete macros. (Igetmore): Delete func decl. (open_rcsfile_fn_t): Update typedef. (parse_state): Delete member ‘rilebuf’. (flow): Update type of member ‘from’. (rcswriteopen, rcsfcmp, rcsreadopen, putdftext, getoldkeys): Update return value and parameter types and in func decls. (Ifclose, Izclose, hey_trundling, I_open, Iopen, testIeof) (Irewind): Delete func decls. (fexpandsym, getdiffcmd): Update parameter types and in func decls. (fastcopy): Delete func decl. (TEECHAR): New macro. Here, "I" means "#include "b-fro.h""; "U" means "Use ‘struct fro *’ instead of ‘RILE *’; remove caching; use interface provided by b-fro.h and/or ‘TEECHAR’"; "M" means "Merge ‘large_memory’/‘!large_memory’"; "R" means "Rework to operate based on ‘STDIO_P (...)’ at runtime". * b-kwxout.c: I. (keyreplace, expandline): U. * b-kwxout.h (expctx): Update type of member ‘from’. * ci.c: I. (workptr): Update type of static var. (cleanup, fixwork, xpandfile): U. (main): U; rework input snapshot, flushing, rewind based on ‘STDIO_P (workptr)’ at runtime. * co.c: I. (cleanup): U; rework ‘FLOW (res)’ closing based on ‘STDIO_P (FLOW (from))’ at runtime. (main): U. * merger.c: I. (merge): U. * rcs.c: I. (cleanup, main): U. * rcsclean.c: I. (workptr): Update type of static var. (cleanup, main): U. * rcsdiff.c: I. (workptr): Update type of static var. (cleanup, main): U. * rcsedit.c: I; remove all cpp cond directives for ‘large_memory’, ‘maps_memory’, ‘MMAP_SIGNAL’; disambiguate bifurcated funcs by renaming with _fast and _slow suffixes; generally, R. (editstuff): Include unconditionally members ‘fedit’, ‘line’, ‘gap’, ‘gapsize’, ‘lim’. (movelines): Define macro unconditionally. (snapshotedit_fast): U; rename from ‘snapshotedit’ in ‘large_memory’. (snapshotedit_slow): U; rename from ‘snapshotedit’ in ‘!large_memory’. (finishedit_fast): U; rename from ‘finishedit’ in ‘large_memory’. (finishedit_slow): U; rename from ‘finishedit’ in ‘!large_memory’. (fopen_update_truncate): U; M; R. (swapeditfiles): U; on ‘EDIT (fedit)’ jam, specify ‘RM_STDIO’. (copylines): U; M; R. (enterstring): U; R. (UNUSED_IF_LARGE_MEMORY): Delete macro. (editstuff): U; R. (rcswriteopen, donerewrite): U. * rcsfcmp.c: I. (discardkeyval): U. (rcsfcmp): U, R. [FCMPTEST] (main): U. * rcsfnms.c: I. (rcsreadopen, finopen, fin2open): U. [PAIRTEST] (main): U. * rcsgen.c: I. (putdtext, putdftext): U. * rcskeep.c: I. (get0val, keepid, getval, keepdate, keeprev, getoldkeys): U. * rcslex.c: I. (Lexinit, nextlex, eoflex, getphrases) (readstring, printstring, savestring): U. (Iclose, mmap_deallocate, read_deallocate, nothing_to_deallocate) (hey_trundling, fd2_RILE, fd2RILE, Igetmore, I_open, Iopen, Ifclose) (Izclose, testIeof, Irewind): Delete macros/funcs. [LEXDB] (main): U. * rcsmerge.c: I. (main): U. * rcsrev.c (fexpandsym): U. [REVTEST] (main): U. * rcssyn.c: I. (getdiffcmd): U. [SYNTEST] (main): U. * rcsutil.c (fastcopy): Delete func. * rlog.c: I. (cleanup, getscript): U. 2010-04-17 Thien-Thi Nguyen [build] Move some basic file operation funcs to b-fb.[hc]. * b-fb.h: New file. * b-fb.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-fb.h, b-fb.c. * b-kwxout.c: #include "b-fb.h". * base.h (behavior): Move member ‘Oerrloop’ to here ... (parse_state): ... from here. (Ieof, Ierror, testIerror, Oerror, testOerror) (fopenSafer, fdSafer): Delete func decls. * ci.c: #include "b-fb.h". (xpandfile): Use ‘fopen_safer’. * co.c: #include "b-fb.h". (main): Use ‘fopen_safer’. * merger.c: #include "b-fb.h". (merge): Use ‘fopen_safer’. * rcs.c: #include "b-fb.h". (sendmail, buildeltatext): Use ‘fopen_safer’. * rcsedit.c: #include "unistd-safer.h", "b-fb.h". [large_memory] (fopen_update_truncate): Use ‘fopen_safer’. (rcswriteopen): Use ‘fd_safer’. * rcsgen.c: #include "b-fb.h". (putdesc, putadmin): Use ‘fopen_safer’. * rcslex.c: #include "unistd-safer.h", "b-fb.h". (Lexinit): Update ‘Oerrloop’ init. (Iopen): Use ‘fd_safer’. (Ieof, Ierror, testIerror, Oerror, testOerror): Delete funcs. (Ifclose): Update ‘Oerrloop’ ref. * rcssyn.c: #include "b-fb.h". * rcsutil.c: #include "b-fb.h". (dupSafer, fdSafer, fopenSafer): Delete funcs. * rlog.c: #include "b-fb.h". 2010-04-16 Thien-Thi Nguyen [int] Always stash ignored phrases, regardless of ‘large_memory’. * rcslex.c (warnignore): Always make space. (getphrases): Always accumulate into ‘LEX (ignore)’. (Lexinit): Clear ‘LEX (ignore)’ if set. 2010-04-14 Thien-Thi Nguyen [int] Fix bug: Specify proper expansion context in `finishedit'. A translation error was introduced 2010-03-27 by: "Move "expansion + output" to b-kwxout.[hc]; use exp context". * rcsedit.c (finishedit): Specify `delimstuffed' to be false in the expansion context passed to `expandline'. 2010-04-13 Thien-Thi Nguyen [build] Use gnulib module `readlink'. * rcsedit.c (naturalize) [!HAVE_READLINK]: Delete this portion. 2010-04-13 Thien-Thi Nguyen [int] Use a space to stash ignored phrases. * base.h (parse_state): Delete member `ignoredp'; add `ignore'. * rcslex.c (warnignore): Initialize space for ignored phrases, if not `large_memory'. (Lexinit): If there is space for ignored phrases, clear it. (getphrases): Save ignored phrases in `LEX (ignore)'; rename local macro from `savech_' to `SAVECH'; make it a statement; update its callers finish with a semicolon; #undef it at eofunc. 2010-04-13 Thien-Thi Nguyen [int C] Use a space for symlink-resolution scratch. * rcsedit.c (naturalize): Rename from `resolve_symlink'; define unconditionally; bifurcate internals for the case of !HAVE_READLINK; take out-arg `symbolicp'; set to indicate symlink resolution occurred; use space for local allocation. (rcswriteopen): Use `naturalize'; do failed-symlink-check unconditionally. 2010-04-12 Thien-Thi Nguyen [int] Use a space for `expandline' scratch. * base.h (manifestation): Remove member `keyval'; add `lparts'. * b-kwxout.c: #include "b-divvy.h". (LPARTS): New #define. (ENSURE_LPARTS): New macro. (expandline): Create and use space `LPARTS' for scanning scratch. 2010-04-12 Thien-Thi Nguyen [int] Use spaces for "ci -k" support. * rcskeep.c (sorry): New static func. (badly_terminated): Use `sorry'; also, take `savep', if set, finish and then brush off the partially constructed string. (get0val): Save directly to `SINGLE'; return `char *'; don't take `struct buf *'; instead take `bool savep'. (keepid): Return `char *'; don't take `struct buf *'. (getval): Return `char *'; don't take `struct buf *'; instead take `bool savep'. (keepdate): Use `SHARED' temporarily for date and time strings. (checknum): Incorporate into unique caller. (keeprev): Return `char *'; set `PREV (rev)' directly. (getoldkeys): Don't keep local `struct buf' objects; use strings saved in `SINGLE' and `PREV (foo)' directly. 2010-04-12 Thien-Thi Nguyen [int] Re{name,base} abstraction from `ftalloc' to `FALLOC'. * b-divvy.h (FALLOC): New macro. * rcs.c: #include "b-divvy.h". (doaccess): Use `FALLOC'. * rcsedit.c (addlock, addsymbol): Likewise. * rcslex.c (lookup): Likewise. * rcsrev.c: #include "b-divvy.h". (store1): Use `FALLOC'. * rcssyn.c: #include "b-divvy.h". (getadmin, getdelta): Use `FALLOC'. * rcsutil.c (ftestalloc): Delete func. * rlog.c: #include "b-divvy.h". (getnumericrev): Use `FALLOC'. * base.h (ftestalloc): Delete func decl. (ftalloc): Delete macro. 2010-04-12 Thien-Thi Nguyen [int C] Use `obstack_free' more. * b-divvy.c (brush_off) [DEBUG]: Display info to stderr. (forget, close_space): Use `obstack_free' directly. 2010-04-12 Thien-Thi Nguyen [int] Add abstractions: zlloc, ZLLOC * b-divvy.h (zlloc): New func decl. (ZLLOC): New macro. * b-divvy.c (zlloc): New func. * maketime.c: Don't #include . (init_maketimestuff): Use `ZLLOC'. * rcsedit.c (ensure_editstuff): Likewise. * rcsfnms.c (init_fnstuff): Likewise. * rcslex.c (fd2_RILE): Likewise. * rcsutil.c (gnurcs_init): Likewise. 2010-04-12 Thien-Thi Nguyen [int] Move filename state into `struct fnstuff'; use spaces more. * base.h (behavior): Add member `fnstuff'. (init_fnstuff): New func decl. * rcsfnms.c (fnstuff): New struct. (FN): New macro. (init_fnstuff): New func. (RCSbuf, RCSb, RCSerrno, tpnames): Delete vars. (set_temporary_file_name): Use `FN (tmpdir)'. (maketemp, tempunlink): Use `FN (tmpnames)'. (finopen, fin2open): Use `FN (RCSbuf)', `FN (RCSb)', `FN (RCSerrno)'. (pairnames): Use `SINGLE' space for `MANI (filename)' alloc; use `FN (RCSbuf)', `FN (RCSerrno)'. (getfullRCSname): Use `SHARED' for `getcwd' alloc; use `SINGLE' for expanded filename alloc. (getcwd): Remove spurious `static' for local var; add `const'. * rcsutil.c (gnurcs_init): call `init_fnstuff'. 2010-04-12 Thien-Thi Nguyen [int] Move remaining maketime state into `struct maketimestuff'. * base.h (behavior): Add member `maketimestuff'. * maketime.c: #include , "b-divvy.h". (maketimestuff): New struct. (MAKETIMESTUFF): New macro. (init_maketimestuff): New func. (time2tm): Use `MAKETIMESTUFF (TZ)'. (tm2time): Use `MAKETIMESTUFF (t_cache)', `MAKETIMESTUFF (tm_cache)'. * maketime.h (init_maketimestuff): New func decl. * rcsutil.c: #include "maketime.h". (gnurcs_init): Call `init_maketimestuff'. 2010-04-11 Thien-Thi Nguyen [int] Move SIGCHLD-handler manual-reset state to `struct behavior'. * base.h (behavior): Add member `fixed_SIGCHLD'. * rcsutil.c (runv): Use `BE (fixed_SIGCHLD)' to record that the SIGCHLD handler was set to SIG_DFL. 2010-04-11 Thien-Thi Nguyen [int] Move cached "now time" into `struct behavior'. * base.h (behavior): Add member `now'. * rcsutil.c (now): Cache now time in `BE (now)'. 2010-04-11 Thien-Thi Nguyen [int] Use `SHARED' space for `system' command construction. * rcsutil.c [!HAVE_WORKING_FORK] (bufargcat): Delete func. [!HAVE_WORKING_FORK] (accumulate_arg_quoted): New static func. (runv) [!HAVE_WORKING_FORK]: Use `SHARED' space to construct string for `system' call. 2010-04-11 Thien-Thi Nguyen [int] Move cached username into `struct behavior'. * base.h (behavior): Add member `username'. * rcsutil.c (getusername): Cache username in `BE (username)'. 2010-04-11 Thien-Thi Nguyen [int] Move remaining edit state into `struct editstuff'. * base.h (behavior): Add member `editstuff'. * rcsedit.c: #include "b-divvy.h". (editstuff): New struct. (fedit, editname, editline, linecorr, sff) (line, gap, gapsize, linelim): Delete vars. (EDIT): New macro. (lockname, newRCSname): Update. (ensure_editstuff): New static func. (insertline, deletelines, snapshotedit, finishedit, swapeditfiles) (copylines, editstring, keepdirtemp, dirtempunlink): Use `EDIT (foo)' instead of deletes vars. (copystring, enterstring, rcswriteopen, makedirtemp): Likewise. Also, call `ensure_editstuff'. 2010-04-10 Thien-Thi Nguyen [int] Add abstractions: SHARED, SINGLE * b-divvy.h (SHARED, SINGLE): New #define:s. * b-isr.c: Do s/shared/SHARED/g; do s/single/SINGLE/g. * co.c: Likewise. * merger.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsfnms.c: Likewise. * rcsgen.c: Likewise. * rcskeep.c: Likewise. * rcslex.c: Likewise. * rcsutil.c: Likewise. 2010-04-10 Thien-Thi Nguyen [int] Make `putdesc' reentrant. * rcsgen.c: #include "b-divvy.h". (putdesc): Take pointer to `struct cbuf', save description text there; route input from stdin and file to go into `shared' space. * base.h (putdesc): Update func decl. * ci.c (main): Update call to `putdesc'. * rcs.c (main): Likewise. 2010-04-10 Thien-Thi Nguyen [int] Move remaining parse state into `struct parse_state'. * base.h (parse_state.next): Add member `hsh'. (parse_state): Add members `rilebuf', `Oerrloop', `ignoredp', `hshtab'. * rcslex.c (nexthsh, hshtab, ignored_phrases): Delete vars. (warnignore): Use `LEX (ignoredp)'. (lookup): Use `LEX (hshtab)', `NEXT (hsh)'. (Lexinit): Allocate `LEX (hshtab)' if necessary; clear `LEX (Oerrloop)'; use `LEX (ignoredp)'. (getnum): Use `NEXT (hsh)'. (fd2_RILE): Init `LEX (rilebuf)' if necessary. (Oerrloop): Delete var. (Oerror, oflush): Use `LEX (Oerrloop)'. [LEXDB] (main): Use `LEX (hshtab)'. 2010-04-10 Thien-Thi Nguyen [int] Use a space for the token buffer. * base.h (manifestation): Add member `tokbuf'. * rcslex.c (tokbuf): Delete var. (lookup): Take `char *', not `struct buf *'; save to `single' directly. (Lexinit): Init `LEX (tokbuf)' as a space. (nextlex): Accumulate bytes into `LEX (tokbuf)'; avoid realloc. 2010-04-10 Thien-Thi Nguyen [int] Do ISR allocation early on, for all programs. * rcsutil.c (gnurcs_init): Init `ISR_SCRATCH' here. * rcsedit.c (rcswriteopen): Don't init `ISR_SCRATCH'. * rcslex.c (fd2_RILE): Likewise. * b-isr.h (ISR_ENABLE): Delete unused macro. 2010-04-10 Thien-Thi Nguyen [int C] Get rid of `bufremember'. * base.h (bufremember): Delete func decl. * rcsfnms.c (bufremember): Delete func. * rcslex.c (getphrases) [!large_memory]: Use `intern' directly. 2010-04-10 Thien-Thi Nguyen [int C] Add to `single' space directly when keeping a date. * rcskeep.c: #include "b-divvy.h". (keepdate): Don't call `fbuf_save'; add directly to `single'. 2010-04-10 Thien-Thi Nguyen [int] Fix bug: Apply tmpdir `SLASH'-suffixing to all candidates. * rcsfnms.c (set_temporary_file_name): Use `getenv' directly; do `SLASH'-suffixing for any `tmpdir' found, not just `P_tmpdir'. 2010-04-10 Thien-Thi Nguyen [int] Add abstraction: accumulate_nonzero_bytes * b-divvy.h (accumulate_nonzero_bytes): New func decl. * b-divvy.c (accumulate_nonzero_bytes): New func. * merger.c (normalize_arg): Use `accumulate_nonzero_bytes'. * rcsdiff.c (main): Likewise. * rcsfnms.c (set_temporary_file_name): Likewise. 2010-04-10 Thien-Thi Nguyen [int C] Use `shared' space for temporary filename templating. * rcsfnms.c (set_temporary_file_name): Save `tmpdir' in `shared'. Also use `shared' temporarily for template string. 2010-04-09 Thien-Thi Nguyen [int C] Use `shared' space for filename arg normalization. * rcsdiff.c (main): Use `shared' space for prepending "./". 2010-04-09 Thien-Thi Nguyen [int C] Get rid of `trealloc'. * rcsedit.c (insertline): Use `testrealloc' directly. * rcsfnms.c (bufrealloc): Likewise. * base.h (trealloc): Delete macro. 2010-04-09 Thien-Thi Nguyen [int C] Get rid of `tnalloc'. * rcsedit.c (insertline): Use `testalloc' directly. * rcsfnms.c (bufalloc): Likewise. * rcslex.c (fd2_RILE): Likewise. * base.h (talloc): Likewise. (tnalloc): Delete macro. 2010-04-09 Thien-Thi Nguyen [int] Use `shared' space for rcsdiff `diffvstr' construction. * rcsdiff.c: #include "b-divvy.h". (main): Use `shared' space for `diffvstr' construction. 2010-04-09 Thien-Thi Nguyen [int] Use `single' space for log message handling. * rcslex.c (savestring): Don't write to `target'; use `single' space instead. * rcsgen.c (cleanlogmsg): Take first arg as `const'. (scandeltatext): Update calls to `savestring', `cleanlogmsg'. * rcs.c (scanlogtext): Likewise. * rcssyn.c (Commleader): Delete now-unused `struct buf'. (getadmin): Update calls to `savestring'. * rlog.c (readdeltalog): Likewise. * base.h (cleanlogmsg, savestring): Update func decls. (manifestation): Delete now-unused member `log'. 2010-04-09 Thien-Thi Nguyen [int] Use `pointer_array' more. * rcsutil.c (getRCSINIT): Use `pointer_array'. 2010-04-09 Thien-Thi Nguyen [int] Use spaces for `co -j' parsing. * co.c: #include "b-divvy.h". (joinlength): Delete var. (link, jstuff): New structs. (jstuff): New static `struct jstuff'. (jpush): New func. (addjoin): Use `jpush'. (preparejoin): Likewise. Rework `joinlist' init. 2010-04-09 Thien-Thi Nguyen [int] Use `shared' space for `merge' arg normalization. * merger.c: #include "b-divvy.h". (normalize_arg): Rewrite. (merge): Update call to `normalize_arg'; don't `tfree'. 2010-04-09 Thien-Thi Nguyen [int] Use `single' space for file(pair)-related allocation. * base.h (fremember): Delete func decl. (ftalloc): Update. (ftnalloc): Delete macro. (ffree1): Delete func decl. (free_NEXT_str): New func decl. * rcsdiff.c (main): Use `ftestalloc'. * rcslex.c: #include "b-divvy.h". (getkeyopt): Use `free_NEXT_str'. (getphrases): Likewise. Also, use `intern0'. * rcssyn.c: Use `free_NEXT_str'. * rcsutil.c (alloclist): Delete struct. (alloced): Delete pointer to `struct alloclist'. (fremember): Delete func. (ftestalloc): Use `alloc'. (ffree): Use `forget'. (ffree1): Delete func. (free_NEXT_str): New func. (str_save): Use `intern0', into `shared'. (fbuf_save): Use `intern0', into `single'. 2010-04-09 Thien-Thi Nguyen [int] Allocate `tempname' in `shared'. * rcsfnms.c: #include "b-divvy.h". (maketemp): Rewrite. 2010-04-09 Thien-Thi Nguyen [int] Allocate ISR scratch in `shared'. * b-isr.c: #include "b-divvy.h". (isr_init): Allocate "isr scratch" in `shared'. * b-isr.h (ISR_DISABLE): Don't `tfree' isr scratch. 2010-04-09 Thien-Thi Nguyen [int] Use spaces for rcsclean `get_directory'. * rscclean.c: #include "b-divvy.h". (get_directory): Rewrite. 2010-04-09 Thien-Thi Nguyen [int] Consolidate top-level structs; dynamically allocate in `main'. * base.h (behavior): Delete var decl. (manifestation, parse_state, repository, flow): Likewise. (top): New struct. (top): New pointer to `struct top'. (BE, MANI, LEX, REPO, FLOW): Update. (gnurcs_init): New func decl. * b-complain.c (vcomplain): Don't flush if `top' is NULL. * rcsutil.c: #include "b-divvy.h". (gnurcs_init): New func. (behavior): Delete `struct behavior'. (flow): Delete `struct flow'. * rcsfnms.c (manifestation): Delete `struct manifestation'. (repository): Delete `struct repository'. * rcslex.c (parse_state): Delete `struct parse_state'. * ci.c (top): New pointer to `struct top'. (main): Don't call `unbuffer_standard_error'; instead call `gnurcs_init'. * co.c: Likewise. * ident.c: Likewise. * merge.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsmerge.c: Likewise. * rlog.c: Likewise. 2010-04-09 Thien-Thi Nguyen [int] Add abstraction: make_space (et al) * b-divvy.h: New file. * b-divvy.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-divvy.h, b-divvy.c. 2010-04-07 Thien-Thi Nguyen [test] Test rlog with two (working) filenames. * alive.test: Add a simple test with two filenames. 2010-04-07 Thien-Thi Nguyen [int C] Use `fbuf_save' more. * rcsfnms.c (bufremember): Use `fbuf_save'. 2010-04-07 Thien-Thi Nguyen [test] Test multi-line log messages. * alive.test: Make some log messages multi-line. 2010-04-06 Thien-Thi Nguyen [build] Ignore `getwd', `getabsname'. * base.h (needs_getabsname): Delete #define. * rcsfnms.c (getfullRCSname): Remove #if needs_getabsname block. Remove preproc cond block that falls back to `getwd'. [!HAVE_GETCWD] (getcwd): Simplify surrounding preproc cond. 2010-04-06 Thien-Thi Nguyen [build] Use gnulib module `same-inode'. Here, all .c files have implicit "#include "same-inode.h"". * base.h (same_file): Delete macro. * ci.c (main): Use `SAME_INODE'. * co.c (main): Likewise. * rcsclean.c (main): Likewise. * rcsedit.c (chnamemod): Likewise. * rcsfnms.c (getfullRCSname): Likewise. 2010-04-06 Thien-Thi Nguyen [int] Overhaul interrupt handling. Here, "I" means "#include "b-isr.h""; and "U" means "Use `IGNOREINTS', `RESTOREINTS'"; and "E (foo)" means "Use `ISR_ENABLE', `ISR_DO (foo)'". * b-isr.h: New file. * b-isr.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-isr.h, b-isr.c. * base.h (behavior): Add to this struct member `isr'. (catchints, ignoreints, restoreints): Delete func decls. [HAVE_MMAP && large_memory && has_NFS && MMAP_SIGNAL] (catchmmapints, readAccessFilenameBuffer): Likewise. [HAVE_MMAP && large_memory && !(has_NFS && MMAP_SIGNAL)] (catchmmapints): Delete macro. * ci.c: I. (main): U. * co.c: I. (main): U. * rcsedit.c: I. (rcswriteopen): U; E (CATCHINTS). (dorewrite, donerewrite): U. * rcsfnms.c (maketemp): Remove spurious isr-enabling. * rcslex.c: I. (fd2_RILE): E (CATCHMMAPINTS); use `access_page'. * rcsutil.c: I; don't #include , "sig2str.h". (heldsignal, holdlevel, unsupported_SA_SIGINFO, bufsiginfo) (heldsiginfo, accessName, regsigs, mmapsigs): Delete vars. (readAccessFilenameBuffer, complain_signal, catchsig, catchsigaction) (ignoreints, restoreints, check_sig, setup_catchsig, catchints) (catchmmapints): Delete funcs. 2010-04-05 Thien-Thi Nguyen [build] Fix bug: Don't #undef MMAP_SIGNAL. Regression introduced 2010-03-02, "Move mmap-related checks to configure.in". * base.h [!MMAP_SIGNAL]: Don't #undef MMAP_SIGNAL. 2010-04-04 Thien-Thi Nguyen [int] Move some file/function-static state into `struct behavior'. * base.h (behavior): Add to this struct members `unbufferedp', `version_set', `stick_with_euid', `ruid', `euid', `ruid_cached', `euid_cached', `already_setuid'. * b-complain.c (unbufferedp): Delete var. (unbuffer_standard_error, vcomplain): Use `BE (unbufferedp)'. * rcsutil.c (setRCSversion): Delete func-static var `oldversion'; use `BE (version_set)' instead. (cacheid): Rewrite macro. (ruid, euid): Update call to `cacheid'. (set_uid_to): Delete func-static var `looping'; use `BE (already_setuid)', instead. (stick_with_euid): Delete var. (nosetid, seteid, setrid): Use `BE (stick_with_euid)'. 2010-04-04 Thien-Thi Nguyen Fix bug: Notice if the system does not support SA_SIGINFO correctly. * rcsutil.c (catchsigaction): Arrange to ignore siginfo_t info if `unsupported_SA_SIGINFO', not if `!unsupported_SA_SIGINFO'. 2010-04-04 Thien-Thi Nguyen [int] Add abstraction: PROGRAM * base.h (PROGRAM): New macro. * b-complain.c: Throughout, use `PROGRAM (foo)' instead of program.foo. * base.h: Likewise. * gnu-h-v.c: Likewise. * gnu-h-v.h: Likewise. * ident.c: Likewise. * merger.c: Likewise. * rcslex.c: Likewise. * rcsutil.c: Likewise. 2010-04-04 Thien-Thi Nguyen [int C] Use `strlen' less. * gnu-h-v.c (EXACTLY): Look for NUL at end of string instead of comparing its length. 2010-04-04 Thien-Thi Nguyen [int C] Remove unused #define. * base.h (RCSTMPPREFIX): Delete #define. 2010-04-04 Thien-Thi Nguyen [int] Add abstraction: hey_trundling * base.h (hey_trundling): New func decl. (advise_access): Delete func decl / macro (two cppcond branches). (if_advise_access): Delete macro. * rcslex.c (hey_trundling): New func. (advise_access): Delete func and surrounding #if ... #endif. (fd2RILE): Use `hey_trundling'. * co.c (main): Likewise. * rcs.c (main): Likewise. * rcsclean.c (main): Likewise. * rcsedit.c (enterstring): Likewise. 2010-04-04 Thien-Thi Nguyen [build] Use gnulib module `sys_wait'. * base.h: Don't #include . (WEXITSTATUS, WIFEXITED, WTERMSIG, WIFSIGNALED): Delete conditional #define:s. * rcsfnms.c: #include . * rcsutil.c: Likewise. 2010-04-04 Thien-Thi Nguyen [int C] Remove some now-obsolete conditional #define:s. * base.h (P_tmpdir, S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP) (S_IROTH, S_IWOTH, S_ISREG): Delete conditional #define:s. 2010-04-04 Thien-Thi Nguyen [build] Use gnulib module `fcntl'. Here, "U" means "Convert #ifdef F_DUPFD foo #else bar #endif block to expression foo". * base.h (open_can_creat): Delete #define. [!O_CREAT] (O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_TRUNC): Likewise. [!O_EXCL] (O_EXCL): Likewise. * rcsedit.c (create): Define macro unconditionally. * rcsfnms.c: #include unconditionally. [!HAVE_GETCWD && !HAVE_GETWD] (getcwd): U. * rcslex.c: #include unconditionally. * rcsutil.c: Likewise. (dupSafer): U. [F_DUPFD] (dup): Delete macro redefinition. (movefd): U. (fdreopen): Take `open_can_creat' to be 1. (runv): U. 2010-04-03 Thien-Thi Nguyen [build] Ignore . * base.h: Don't #include . 2010-04-03 Thien-Thi Nguyen [build] Ignore unused . * base.h: Don't #include . 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include . * rcsutil.c [HAVE_PWD_H]: #include . 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include . * rcsedit.c [HAVE_FCNTL_H]: #include . * rcslex.c: Likewise. * rcsutil.c: Likewise. 2010-04-03 Thien-Thi Nguyen [build] Use gnulib module `dirent'. * rcsclean.c: #include unconditionally. (get_directory): Define func unconditionally. (main): Call `get_directory' unconditionally. 2010-04-03 Thien-Thi Nguyen [int] Presume provides SIG{HUP,INT,PIPE,QUIT,TERM,XCPU,XFSZ}. * rcsutil.c (regsigs): Remove #ifdef foo and #endif, for foo: SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGXCPU, SIGXFZ. 2010-04-03 Thien-Thi Nguyen [int] Presume provides `SA_SIGINFO'. * rcsutil.c: Throughout, take `defined SA_SIGINFO' to be 1. 2010-04-03 Thien-Thi Nguyen [int] Presume `siginfo_t' has member `si_errno'. * rcsutil.c (catchsigaction): Take `defined HAVE_SI_ERRNO' to be 1. 2010-04-03 Thien-Thi Nguyen [int] Use gnulib module `sig2str'; push `psignal' cppcond down. * rcsutil.c: #include "sig2str.h". (complain_signal): New static func. [!HAVE_PSIGNAL] (psignal): Delete #define. [!HAVE_PSIGNAL] (my_psignal): Delete func. (catchsigaction, runv): Use `complain_signal'. 2010-04-03 Thien-Thi Nguyen [build] Also link against lib/libgnu.a. * Makefile.am (LDADD): Add options to link against ../lib/libgnu.a. 2010-04-03 Thien-Thi Nguyen [build] Use gnulib module `double-slash-root'. * rcsfnms.c (DOUBLE_SLASH_IS_DISTINCT_ROOT): If not #define:d, #define to 0. (dir_useful_len): Use `DOUBLE_SLASH_IS_DISTINCT_ROOT'. 2010-04-03 Thien-Thi Nguyen [build] Move the config header (and template) from src/ to lib/. * base.h: Don't #include "auto-sussed.h"; instead, #include "config.h". * Makefile.am (AM_CPPFLAGS): Delete var. 2010-04-03 Thien-Thi Nguyen [build] Remove now-obsolete support for !HAVE_SIGNAL_H. * base.h [!HAVE_SIGNAL_H] (catchints, ignoreints, restoreints): Delete macros, with surrounding cpp #if block. * rcsutil.c: Remove #if defined HAVE_SIGNAL_H, matching #endif. 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include ; remove surrounding cpp cond #ifdef HAVE_SIGNAL_H ... #endif block. * rcsutil.c: #include . 2010-04-03 Thien-Thi Nguyen [int C] Use GCC attributes individually. * b-complain.h (generic_fatal, fatl_syntax): Use attribute declarations `printf_string' and `exiting' directly. * base.h (printf_string_exiting): Delete macro. 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include ; remove surrounding cpp cond #ifdef HAVE_UTIME_H ... #endif block. * rcsedit.c [HAVE_UTIME_H]: #include . 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include . * maketime.c: #include . * partime.c: Likewise. * rcstime.c: Likewise. * rcsutil.c: Likewise. 2010-04-03 Thien-Thi Nguyen [int] Presume provides STD{IN,OUT,ERR}_FILENO. * base.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Delete #define:s, and surrouding #ifndef STDIN_FILENO cpp cond block. 2010-04-03 Thien-Thi Nguyen [int] Presume provides `getlogin' decl. * base.h (getlogin): Delete func decl. 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include ; remove surrounding cpp cond #ifdef HAVE_UNISTD_H ... #endif block. * ci.c: #include . * rcsedit.c: Likewise. * rcsfnms.c: Likewise. * rcsgen.c: Likewise. * rcslex.c: Likewise. * rcsutil.c: Likewise. 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include . * b-anchor.c: #include . * b-kwxout.c: Likewise. * ci.c: Likewise. * co.c: Likewise. * merger.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsedit.c: Likewise. * rcsfcmp.c: Likewise. * rcsfnms.c: Likewise. * rcsgen.c: Likewise. * rcskeep.c: Likewise. * rcslex.c: Likewise. * rcsmerge.c: Likewise. * rcsrev.c: Likewise. * rcssyn.c: Likewise. * rcstime.c: Likewise. * rcsutil.c: Likewise. * rlog.c: Likewise. 2010-04-03 Thien-Thi Nguyen [int] Presume provides `ELOOP', `ENOTSUP'. * rcsedit.c (resolve_symlink) [!ELOOP]: Remove cpp cond block. * rcsutil.c (setup_catchsig): Assume `defined ENOTSUP' == 1. 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include . * b-complain.c: #include . * rcsgen.c: Likewise. * rcslex.c: Likewise. * rcsutil.c: Likewise. 2010-04-03 Thien-Thi Nguyen [int C] Incorporate `fvfprintf' into unique caller. * rcslex.c (fvfprintf): Incorporate into `aprintf'. * base.h (fvfprintf): Delete func decl. 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include . * ci.c: #include . * co.c: Likewise. * ident.c: Likewise. * merger.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsfnms.c: Likewise. * rcslex.c: Likewise. * rcstime.c: Likewise. * rcsutil.c: Likewise. * rlog.c: Likewise. 2010-04-03 Thien-Thi Nguyen [int C] Move #include to .c files. * base.h: Don't #include . * b-complain.c: #include . * ci.c: Likewise. * co.c: Likewise. * ident.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsedit.c: Likewise. * rcsfnms.c: Likewise. * rcsgen.c: Likewise. * rcskeep.c: Likewise. * rcslex.c: Likewise. * rcsutil.c: Likewise. 2010-04-02 Thien-Thi Nguyen [build] Move GCC attribute configuration into base.h. * base.h (exiting, printf_string): Define these macros based solely on GCC version -- 2.7 or higher. (printf_string_exiting): Define macro unconditionally. 2010-04-01 Thien-Thi Nguyen [build] Use gnulib module `stdbool'. * Makefile.am (AM_CPPFLAGS): New var. 2010-04-01 Thien-Thi Nguyen [build] Use gnulib to define `RCS_UNUSED'. * base.h (RCS_UNUSED): Update. 2010-03-31 Thien-Thi Nguyen [int C] Avoid some function-static vars. * rcsedit.c (setmtime): Make local var `amtime' non-static. * rcsfnms.c [!HAVE_MKSTEMP] (homegrown_mkstemp): Likewise for `xrep'. * rcsrev.c [REVTEST] (main): Likewise for `numricrevno'. Also, do `bufautobegin' and `bufautoend' for it. * rcslex.c (fd2_RILE): Delete static local var `nothing'; use `FROM (to)', instead. 2010-03-31 Thien-Thi Nguyen [int] Move "temporary buf for key value" to `struct manifestation'. * base.h (manifestation): Add member `keyval'. * b-kwxout.c (expandline): Use `MANI (keyval)'. 2010-03-31 Thien-Thi Nguyen [int] Move "`BE (interactive)' valid" into `struct behavior'. * base.h (behavior): Add member `interactive_valid'. * rcsgen.c (ttystdin): Use `BE (interactive_valid)'. 2010-03-30 Thien-Thi Nguyen [int C] Use `bool' more. * rcsutil.c (cacheid): Use boolean for valid bit. 2010-03-30 Thien-Thi Nguyen [int] Move "-z handling state" into `struct behavior'. * base.h (behavior): Add member `zone_offset'. * rcstime.c (zone_offset, use_zone_offset): Delete vars. (str2date, zone_set, date2str): Use `BE (zone_offset.valid)', `BE (zone_offset.seconds)'. 2010-03-30 Thien-Thi Nguyen [int] Use boolean to keep track of lexical error occurance. Here, "U" means "Throughout, use `LEX (erroneousp)'". * base.h (struct parse_state): Replace `nerr' with `erroneousp'. * b-complain.c (ERRONEOUS_X): New macro. (syserror, generic_error, generic_fatal): Use `ERRONEOUS_X'. * ci.c: U. * co.c: U. * merge.c: U. * rcs.c: U. * rcsclean.c: U. * rcsdiff.c: U. * rcsedit.c: U. * rcskeep.c: U. * rcslex.c: U. * rcsmerge.c: U. * rlog.c: U. 2010-03-30 Thien-Thi Nguyen [int] Abstract writes to stderr. Here, "I" means "#include "b-complain.h", "U" means "Throughout, use the funcs and macros from there". * b-complain.c (vcomplain, complain): New funcs. (COMPLAIN_PLUS_NEWLINE): New macro. (diagnose): New func. (whoami): New static func. (syserror, generic_warn, generic_error): New funcs. (die): New static func. (generic_fatal, fatal_syntax, fatal_sys): New funcs. * b-complain.h (vcomplain, complain, diagnose, syserror) (generic_warn, generic_error, generic_fatal, fatal_syntax) (fatal_sys): New func decls. (syserror_errno, PWARN, MWARN, RWARN) (PERR, MERR, RERR, PFATAL, RFATAL): New macros. * b-kwxout.c: I; U. * ci.c: U. * co.c: U. * ident.c: U. * maketime.c: U. * merge.c: U. * merger.c: I; U. * rcs.c: U. * rcsclean.c: U. * rcsdiff.c: U. * rcsedit.c: I; U. * rcsfcmp.c: I; U. * rcsfnms.c: I; U. * rcsgen.c: I; U. * rcskeep.c: I; U. * rcslex.c: I; U. (fatcleanup, startsay, fatsay, errsay, warnsay, eerror) (enerror, efaterror, enfaterror, error, rcserror) (workerror, fatserror, faterror, rcsfaterror, warn) (rcswarn, workwarn, diagnose): Delete funcs. * rcsmerge.c: U. * rcsrev.c: I; U. * rcssyn.c: I; U. * rcstime.c: I; U. * rcsutil.c: I; U. [HAVE_WORKING_FORK] (write_stderr): Delete func. (runv): If the child proc exited due to a signal, mention that it "got a fatal signal" before dying. * rlog.c: U. * base.h (efaterror, enfaterror, fatcleanup, faterror) (fatserror, rcsfaterror, diagnose, eerror, enerror, error) (rcserror, rcswarn, warn, workerror, workwarn): Delete func decls. 2010-03-28 Thien-Thi Nguyen [int] Unbuffer stderr at program start; don't fflush it, later. Here, "I" means "#include "b-complain.h""; and "U" means "(main) Use `unbuffer_standard_error'". * b-complain.h: New file. * b-complain.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-complain.h, b-complain.c. * base.h (eflush): Delete func decl. * rcsgen.c (yesorno, getsstdin): Don't call `eflush'. * rcslex.c (eflush): Delete func. (enerror, error, rcserror, workerror, warn, rcswarn, workwarn) (diagnose): Don't call `eflush'. * rcsutil.c (runv): Likewise. * ci.c: I; U. * co.c: I; U. * ident.c: I; U. * merge.c: I; U. * rcs.c: I; U. (sendmail): Don't call `eflush'. * rcsclean.c: I; U. * rcsdiff.c: I; U. * rcsmerge.c: I; U. * rlog.c: I; U. 2010-03-27 Thien-Thi Nguyen [int C] Drop workaround for SVR4 stdio bug. * rcsgen.c (putadmin): Don't bother using `putc' for first output operation; just use `printf' normally. * rlog.c (main): Likewise. 2010-03-27 Thien-Thi Nguyen [int C] Tighten `homegrown_mkstemp'. * rcsfnms.c: #include . [!HAVE_MKSTEMP] (homegrown_mkstemp): Make static; use curly braces for string constant instead of parens. 2010-03-27 Thien-Thi Nguyen [int] Move "expansion + output" to b-kwxout.[hc]; use exp context. * b-kwxout.h: New file. * b-kwxout.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-kwxout.h, b-kwxout.c. * base.h (expandline): Delete func decl. * ci.c: #include "b-kwxout.h". (xpandfile): Update call to `expandline'. * rcsedit.c: #include "b-kwxout.h". (finisheditline, finishedit, copylines) (xpandstring, editstring): Update call to `expandline'. 2010-03-27 Thien-Thi Nguyen [int] Use #define for `ciklog' et al. * base.h (ciklog): Convert from var decl to #define. (ciklog_len): New #define. (ciklogsize): Delete #define. * ci.c (getlogmsg): Use `ciklog_len'. * rcsedit.c (ciklog): Delete var. (keyreplace): Use `ciklog_len'. * rcsfcmp.c (rcsfcmp): Use `ciklog_len'. 2010-03-26 Thien-Thi Nguyen [int] Use #define for RCS file keywords. * base.h (KS): New macro. (Kaccess): Convert from var decl to #define; use `KS'. (Kauthor, Kbranch, Kcomment, Kdate, Kdesc, Kexpand, Khead, Klocks) (Klog, Knext, Kstate, Kstrict, Ksymbols, Ktext): Likewise. * rcssyn.c (Kaccess): Delete var. (Kauthor, Kbranch, Kcomment, Kdate, Kdesc, Kexpand, Khead, Klocks) (Klog, Knext, Kstate, Kstrict, Ksymbols, Ktext): Likewise. (Kbranches): Rename from `K_branches'; convert from var to #define. [COMPAT2] (Ksuffix): Convert from var to #define. (getdelta): Use `Kbranches'. 2010-03-26 Thien-Thi Nguyen [int] Move some constant data from rcsutil.c to b-anchor.c. * b-anchor.c (prog_diff, prog_diff3, diff_flags, equal_line): New, moved without change from... * rcsutil.c (prog_diff, prog_diff3, diff_flags, equal_line): ...here. 2010-03-26 Thien-Thi Nguyen [int] Overhaul "keyword-substitution mode name" recognition. * b-anchor.c (kwsub_pool): New static `uint8_t' array. (recognize_kwsub, kwsub_string): New funcs. * base.h (recognize_kwsub): New func decl. (str2expmode): New macro. (kwsub_string): New func decl. (str2expmode): Delete func decl. * rcsgen.c (putadmin): Use `kwsub_string'. * rcssyn.c (expand_names): Delete data structure. (strn2expmode, str2expmode): Delete funcs. (getadmin): Use `recognize_kwsub'. * rlog.c (main): Use `kwsub_string'. 2010-03-25 Thien-Thi Nguyen [int] Overhaul (working file) keyword recognition. * b-anchor.c: New file. * Makefile.am (libparts_a_SOURCES): Add b-anchor.c; remove rcskeys.c. * base.h: #include . (AUTHOR, DATE, HEADER, IDH, LOCKER, LOG, NAME, RCSFILE, REVISION) (SOURCE, STATE): Delete #define:s. (tinysym, pool_found): New structs. (markers): From this enum, remove `Nomatch'. (recognize_keyword): New func decl. (Keyword): Delete var decl. (trymatch): Delete func decl. * rcsedit.c (keyreplace): Take `struct pool_found *' for first arg instead of `enum markers'; use `marker->i'. (expandline): Use `recognize_keyword'. * rcsfcmp.c (rcsfcmp): Use `recognize_keyword', `match1.i'. * rcskeep.c (getoldkeys): Use `recognize_keyword'. * rcskeys.c: Delete file. 2010-03-25 Thien-Thi Nguyen [int] Rename rcsbase.h to base.h. * base.h: Rename from rcsbase.h. * Makefile.am (libparts_a_SOURCES): Update. * ci.c: Update #include. * co.c: Likewise. * gnu-h-v.c: Likewise. * ident.c: Likewise. * maketime.c: Likewise. * merge.c: Likewise. * merger.c: Likewise. * partime.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsedit.c: Likewise. * rcsfcmp.c: Likewise. * rcsfnms.c: Likewise. * rcsgen.c: Likewise. * rcskeep.c: Likewise. * rcskeys.c: Likewise. * rcslex.c: Likewise. * rcsmap.c: Likewise. * rcsmerge.c: Likewise. * rcsrev.c: Likewise. * rcssyn.c: Likewise. * rcstime.c: Likewise. * rcsutil.c: Likewise. * rlog.c: Likewise. 2010-03-25 Thien-Thi Nguyen [int C] Remove spurious casts to void for function call. * rcs.c (main): Remove cast to void for `umask' call. * rcskeep.c (getoldkeys): Remove cast to void for `getval' call. 2010-03-25 Thien-Thi Nguyen [int C] Dose data structures with `const'. * maketime.c (month_yday): Add `const' to var definition. * partime.c (month_names): Likewise. (weekday_names, zone_names, patterns): Likewise. * rcsfnms.c (rcsdir, comtable): Likewise. * rcssyn.c [COMPAT2] (Ksuffix): Likewise. (K_branches): Likewise. * rcsutil.c (regsigs, mmapsigs): Likewise. 2010-03-25 Thien-Thi Nguyen [int] Consolidate i/o streams into `struct flow'. Here, "U" means "Throughout, use `FLOW (foo)' instead of the old singular variable names". * rcsbase.h (flow): New struct. (flow): New `struct flow' decl. (FLOW): New macro. (fcopy, resultname, finptr, frewrite, foutptr): Delete var decls. * ci.c: U. * co.c: U. * rcs.c: U. * rcsclean.c: U. * rcsdiff.c: U. * rcsedit.c: U. (fcopy, resultname): Delete var. * rcsfnms.c: U. * rcsgen.c: U. * rcslex.c: U. (finptr, frewrite, foutptr): Delete vars. * rcsrev.c: U. * rcssyn.c: U. * rcsutil.c (flow): New `struct flow'. * rlog.c: U. 2010-03-25 Thien-Thi Nguyen [int] Move "possible endings for RCS file" into `struct behavior'. Here, "U" means "Throughout, use `BE (pe)'". * rcsbase.h (suffixes): Delete var decl. (behavior): Add `pe' to this struct. * ci.c: U. * co.c: U. * rcs.c: U. * rcsclean.c: U. * rcsdiff.c: U. * rcsfnms.c: U. (suffixes): Delete var. * rcsmerge.c: U. * rlog.c: U. 2010-03-25 Thien-Thi Nguyen [int] Move "temporary log buffer" into `struct manifestation'. Here, "U" means "Throughout, use `MANI (log)'". * rcsbase.h (curlogbuf): Delete var decl. (manifestation): Add `log' to this struct. * rcs.c: U. * rcsgen.c: U. (curlogbuf): Delete var. 2010-03-25 Thien-Thi Nguyen [int C] Remove spurious `extern'. * rcsbase.h (isSLASH): Remove `extern' on func decl. 2010-03-25 Thien-Thi Nguyen [int] Move "keyword subtitution mode" into `struct behavior'. Here, "U" means "Throughout, use `BE (kws)'". * rcsbase.h (Expand): Delete var decl. (behavior): Add `kws' to this struct. * ci.c: U. * co.c: U. * rcs.c: U. * rcsclean.c: U. * rcsdiff.c: U. * rcsedit.c: U. * rcsfcmp.c: U. * rcsfnms.c: U. * rcsgen.c: U. * rcsmerge.c: U. * rcssyn.c: U. (Expand): Delete var. * rlog.c: U. 2010-03-25 Thien-Thi Nguyen [int] Move "effective RCS version" into `struct behavior'. Here, "U" means "Throughout, use `BE (version)'". * rcsbase.h (RCSversion): Delete var decl. (behavior): Add `version' to this struct. * rcs.c: U. * rcsedit.c: U. * rcsfcmp.c: U. * rcsgen.c: U. * rcstime.c: U. * rcsutil.c: U. (RCSversion): Delete var. * rlog.c: U. 2010-03-25 Thien-Thi Nguyen [int C] Use `MANI (filename)' and `MANI (standard_output)'. Here, "U" means "Throughout, use `MANI (filename)' and `MANI (standard_output)' instead of singular variable names. * rcsbase.h (workname, workstdout): Delete #define:s. * ci.c: U. * co.c: U. * rcs.c: U. * rcsclean.c: U. * rcsdiff.c: U. * rcsedit.c: U. * rcsfnms.c: U. * rcskeep.c: U. * rcslex.c: U. * rcsmerge.c: U. * rlog.c: U. 2010-03-25 Thien-Thi Nguyen [int] Consolidate RCS file state into `struct repository'. Here, "U" means "Throughout, use `REPO (foo)' and `ADMIN (foo)' instead of the old singular variable names". * rcsbase.h (repository): New struct. (repository): New `struct repository' decl. (REPO, ADMIN): New macros. (RCSname, fdlock, RCSstat, Dbranch, AccessList, Symbols, Comment) (Ignored, Locks, Head, TotalDeltas): Delete var decls. * ci.c: U. * co.c: U. * rcs.c: U. * rcsclean.c: U. * rcsdiff.c: U. * rcsedit.c: U. * rcsfcmp.c: U. * rcsfnms.c: U. (RCSname, fdlock, RCSstat): Delete vars. (repository): New `struct repository'. * rcsgen.c: U. * rcslex.c: U. * rcsmerge.c: U. * rcsrev.c: U. * rcssyn.c: U. (Comment, Ignored, AccessList, Symbols, Locks, Head) (Dbranch, TotalDeltas): Delete vars. * rlog.c: U. 2010-03-24 Thien-Thi Nguyen [int C] Define `ruid', `myself' unconditionally. * rcsutil.c (ruid): Remove surrounding preproc conditional. (ruid) [!HAVE_GETUID]: Abort; programmer error. (myself): New func. * rcsbase.h (ruid): Declare func unconditionally. (myself): New func decl. 2010-03-24 Thien-Thi Nguyen [int C] Push `#if has_NFS || BAD_UNLINK' for `un_link' out of header. * rcsedit.c (un_link): Restructure to use #define:s in code. * rcsbase.h (un_link): Remove surrounding preproc conditional, including sibling `#if ! (has_NFS || BAD_UNLINK)' block. 2010-03-24 Thien-Thi Nguyen [int C] Push `#if large_memory' for `editstring' out of header. * rcsedit.c (UNUSED_IF_LARGE_MEMORY): New #define. (editstring): Use `UNUSED_IF_LARGE_MEMORY' for param `delta'; remove preproc conditional surrounding func header. * rcsbase.h (editstring): Remove surrounding preproc conditional, including sibling block `#if large_memory'. 2010-03-24 Thien-Thi Nguyen [int C] Add braces to disambiguate `else' clause. * rcsedit.c [!large_memory] (copylines): Add braces to disambiguate `else' clause. 2010-03-24 Thien-Thi Nguyen [int C] Define type for `pairnames' "rcsopen" func. * rcsbase.h (open_rcsfile_fn_t): New typedef. (pairnames): Use `open_rcsfile_fn_t' in func decl. * rcsfnms.c (pairnames): Use `open_rcsfile_fn_t' in arglist. 2010-03-24 Thien-Thi Nguyen [int C] Dose data structures with `const'. * rcsbase.h (ciklog, Keyword, ctab, expand_names, Kaccess) (Kauthor, Kbranch, Kcomment, Kdate, Kdesc, Kexpand, Khead) (Klocks, Klog, Knext, Kstate, Kstrict, Ksymbols, Ktext) (equal_line): Add `const' to var decls. * rcsedit.c (ciklog): Add `const' to var definition. * rcskeys.c (Keyword): Likewise. * rcsmap.c (ctab): Likewise. * rcssyn.c (Kaccess, Kauthor, Kbranch, Kcomment, Kdate) (Kdesc, Kexpand, Khead, Klocks, Klog, Knext, Kstate) (Kstrict, Ksymbols, Ktext, expand_names): Likewise. * rcsutil.c (equal_line): Likewise. 2010-03-24 Thien-Thi Nguyen [int] Consolidate parse state into `struct parse_state'. Here, "U" means "Throughout, use `LEX (foo)' and `NEXT (foo)' instead of the old singular variable names". * rcsbase.h (parse_state): New struct. (parse_state): New `struct parse_state' decl. (LEX, NEXT): New macros. (NextString, nexttok, nerror, nextc, rcsline): Delete var decls. * rcslex.c: U. (parse_state): New `struct parse_state'. (nexttok, nextc, rcsline, nerror, NextString): Delete vars. * ci.c: U. * co.c: U. * merge.c: U. * rcs.c: U. * rcsclean.c: U. * rcsdiff.c: U. * rcsedit.c: U. * rcsgen.c: U. * rcskeep.c: U. * rcsmerge.c: U. * rcssyn.c: U. * rlog.c: U. 2010-03-23 Thien-Thi Nguyen [int] Consolidate workfile state into `struct manifestation'. * rcsbase.h (manifestation): New struct. (manifestation): New `struct manifestation' decl. (MANI, workname, workstdout, PREV): New macros. (workname, workstdout, prevkeys, prevauthor, prevdate) (prevname, prevrev, prevstate): Delete var decls. * rcsfnms.c (workname, workstdout): Delete vars. (manifestation): New `struct manifestation'. (pairnames): Use `PREV (valid)'. * rcskeep.c (prevkeys): Delete var. (prevauthor, prevdate, prevname, prevrev, prevstate): Likewise. (keepdate): Set `PREV (date)' directly. (keeprev): Set `PREV (rev)' directly. (getoldkeys): Set `PREV (foo)' state; use `PREV (foo)' directly; add "consider empty string as not given" processing. (main): Use `PREV (rev)', `PREV (date)', `PREV (author)', `PREV (name)', `PREV (state)'. * rcsrev.c (fexpandsym): Use `PREV (rev)'. * ci.c (main): Use `PREV (rev)', `PREV (date)', `PREV (author)', `PREV (state)', `PREV (name)'. 2010-03-23 Thien-Thi Nguyen [int] Add abstraction: fbuf_save * rcsbase.h (fbuf_save): New func decl. (fstr_save): Delete func decl. * rcsutil.c (fbuf_save): New func. (fstr_save): Delete func. * rcs.c (doassoc): Use `fbuf_save'. * rlog.c (getnumericrev): Likewise. * rcslex.c (lookup): Don't take `char *'; instead, take `struct buf *'; use `fbuf_save'; update callers. (nextlex): Use `fbuf_save'. (getphrases): Use `strncpy' for saving `key'. 2010-03-22 Thien-Thi Nguyen [build] Fix cpp conditional regression introduced 2010-02-17. This happened as part of the change: "[build] Move `getcwd', `getwd' check to configure.in". * rcsfnms.c [!GETCWD && !GETWD] (getcwd): Change surrounding cpp conditional to this from nonsensical "!GETWD && !GETWD". 2010-03-22 Thien-Thi Nguyen [build] Make "make test-prep" more robust. * Makefile.am (test-prep): Explicitly delete $(bin_PROGRAMS) to force relink. 2010-03-20 Thien-Thi Nguyen [int] Consolidate some global booleans into `struct behavior'. Here, "BE" means "Use BE (foo) instead of separate var names". * rcsbase.h (behavior): New struct. (behavior): New `struct behavior' decl. (BE): New macro. (locker_expansion, interactiveflag, hshenter) (quietflag, StrictLocks): Delete var decls. * rcsutil.c (behavior): New `struct behavior'. (catchsigaction): Use `BE (quiet)'. * ci.c (removelock, addelta, main): BE. * co.c (rmworkfile, buildjoin, main): BE. * ident.c (scanfile, main): BE. * merge.c (main): BE. * rcs.c (buildtree, main): BE. * rcsclean.c (main): BE. * rcsdiff.c (main): BE. * rcsedit.c (locker_expansion): Delete var. (keyreplace): BE. * rcsfnms.c (InitAdmin, main): BE. * rcsgen.c (interactiveflag): Delete var. (ttystdin, yesorno, putadmin): BE. * rcslex.c (hshenter, quietflag): Delete vars. (Lexinit, nextlex, warn, rcswarn, workwarn, diagnose): BE. [LEXDB] (main): BE. * rcsmerge.c (main): BE. * rcssyn.c (StrictLocks): Delete var. (getadmin, ignorephrases, getdelta): BE. * rlog.c (main): BE. 2010-03-19 Thien-Thi Nguyen [build] Use GNU Automake. * Makefile.am: New file. * ci.c: Do s/-help.c/.help/ for #include file. * co.c: Likewise. * ident.c: Likewise. * merge.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsmerge.c: Likewise. * rlog.c: Likewise. * Makefile.in: Delete file. 2010-03-18 Thien-Thi Nguyen [int C] Use DIFF_{SUCCESS,FAILURE,TROUBLE} directly. Using vars was a temporary measure while fleeing conf.h. Here, "U" means "Throughout, use `DIFF_SUCCESS', `DIFF_FAILURE', `DIFF_TROUBLE' directly". * rcsutil.c: U. (diff_success, diff_failure, diff_trouble): Delete vars. * rcsbase.h (diff_success, diff_failure, diff_trouble): Delete var decls. * ci.c: U. * co.c: U. * merge.c: U. * merger.c: U. * rcs.c: U. * rcsdiff.c: U. * rcsmerge.c: U. 2010-03-17 Thien-Thi Nguyen [int] Consolidate parallel rcsedit.c arrays into `struct sff'. * rcsedit.c (sff): New struct. (SFFI_LOCKDIR, SFFI_NEWDIR, SFF_COUNT): New #define:s. (sff): New static array of `struct sff'. (lockname, newRCSname): Use `sff'. (lockdirtp_index, newRCSdirtp_index, newworkdirtp_index) (DIRTEMPNAMES): Delete #define:s. (dirtpname, dirtpmaker): Delete data structures. (rcswriteopen): Use `sff', `SFFI_LOCKDIR'. (keepdirtemp): Use `sff', `SFF_COUNT'. (makedirtemp): Use `SFFI_NEWDIR', `sff'. (dirtempunlink): Use `SFF_COUNT', `sff'. 2010-03-17 Thien-Thi Nguyen [int C] Use `_Exit', which is C99. * ci.c (exiterr): Use `_Exit'. * co.c (exiterr): Likewise. * ident.c (exiterr): Likewise. * merge.c (exiterr): Likewise. * rcs.c (exiterr): Likewise. * rcsclean.c (exiterr): Likewise. * rcsdiff.c (exiterr): Likewise. * rcsfnms.c [!HAVE_GETWD] (getcwd): Likewise. (exiterr): Likewise. * rcslex.c [LEXDB] (exiterr): Likewise. * rcsmerge.c (exiterr): Likewise. * rcsrev.c [REVTEST] (exiterr): Likewise. * rcssyn.c [SYNTEST] (exiterr): Likewise. * rcsutil.c (write_stderr, runv): Likewise. * rlog.c (exiterr): Likewise. 2010-03-17 Thien-Thi Nguyen [build] Don't do "make distclean" on "make dist"! * Makefile.in (distdir, slow, headers) (infrastructure, EXTRA_DIST): New vars. (dist): New target. 2010-03-17 Thien-Thi Nguyen [int C] Consolidate some program globals into `struct program'. Here, "USUAL" means "(cmdid): Delete var. (exiterr): Make static, declare `exiting'. (program): New struct instance."; and "PARTIAL foo" means "Like USUAL, but with only foo". * rcsbase.h (cmdid): Delete var decl. (exiterr): Delete func decl. (program): New struct. (program): New var decl. * ci.c: USUAL. * co.c: USUAL. * gnu-h-v.c (display_version): Use `program.name'. (check_hv): Likewise; also don't take `help'; use `program.help' instead. * gnu-h-v.h (check_hv): Update func decl. (CHECK_HV): Update call to `check_hv'. * ident.c: USUAL. (reportError, scanfile): Use `program.name'. * merge.c: USUAL. * merger.c (merge): Use `program.exiterr'. * rcs.c: USUAL. * rcsclean.c: USUAL. * rcsdiff.c: USUAL. * rcsfcmp.c [FCMPTEST]: PARTIAL cmdid, program. * rcsfnms.c [PAIRTEST]: USUAL. * rcskeep.c [KEEPTEST]: PARTIAL cmdid, program. * rcslex.c (Oerror): Use `program.exiterr'. (fatcleanup): Use `program.name', `program.exiterr'. (startsay, fatserror): Use `program.name'. [LEXDB]: USUAL. * rcsmerge.c: USUAL. * rcsrev.c [REVTEST]: USUAL. * rcssyn.c [SYNTEST]: USUAL. * rcsutil.c (catchsigaction): Use `program.exiterr'. * rlog.c: USUAL. 2010-03-17 Thien-Thi Nguyen [int C] Avoid `strcpy'. * ci.c (incnum): Use `strncpy'. * rcsclean.c [HAVE_DIRENT_H] (get_directory): Likewise. * rcsdiff.c (main): Likewise. * rcsfnms.c (maketemp, bufscat, bufscpy, getfullRCSname): Likewise. * rcsutil.c (str_save, fstr_save): Likewise. * rlog.c (recentdate, getdatepair): Likewise. (KSTRCPY): New macro. (getnumericrev, main): Use `KSTRCPY'. 2010-03-16 Thien-Thi Nguyen [int C] Use `bool' (and `true' and `false') more. Here, "B: foo" means "Change type of foo from `int' to `bool'". * rcsbase.h: #include . (STRICT_LOCKING): Use `true'. [!maps_memory] (Igetmore): Update func decl. (merge): Update func decl. (locker_expansion): Update var decl. (rcswriteopen, makedirtemp, addlock, addsymbol, checkaccesslist) (dorewrite, expandline, findlock, finishedit, rcsreadopen, pairnames): Update func decl. (interactiveflag): Update var decl. (buildrevision, putdtext, ttystdin, yesorno, putdesc, putdftext): Update func decl. (prevkeys): Update var decl. (getoldkeys): Update func decl. (hshenter, quietflag): Update var decl. (fatcleanup, eoflex, getkeyopt, getlex, expandsym, fexpandsym): Update func decl. (StrictLocks): Update var decl. (getdiffcmd, getdesc, putstring, getusername, isSLASH): Update func decl. * ci.c: Don't #include . (struct Symrev): B: .override. (forceciflag, keepflag, keepworkingfile, rcsinitflag): B: var. (addbranch): B: param `removedlock'. (addsyms): B: rv. (xpandfile): B: param `dolog'. (addassoclst): B: param `flag'. (main): B: local vars `initflag', `mustread', `lockflag', `lockthis', `mtimeflag', `Ttimeflag', `dolog', `newhead', `usestatdate', `bad_truncate'. Also, update interpretation of `ftruncate' rv to be `bool'-friendly. * co.c: Don't #include . (forceflag, mtimeflag): B: var. (rmworkfile, preparejoin, buildjoin): B: rv. (main): B: local vars `tostdout', `Ttimeflag'. * ident.c: Don't #include . * maketime.c (isleap): B: rv. (time2tm, tm2time): B: param `localzone'. (maketime): B: local var `localzone'. * maketime.h (time2tm, tm2time): Update func decls. * merge.c: Don't #include . (main): B: local var `tostdout'. * merger.c (merge): B: param `tostdout'. * rcs.c: Don't #include . (struct Symrev): B: .override. (chgheadstate, lockhead, unlockcaller, suppress_mail): B: var. (getassoclst): B: param `flag'. (scanlogtext): B: param `edit'. (doaccess): B: rv, local var `changed'. (sendmail): B: rv; also, remove spurious parens for `return' "arg". (breaklock, branchpoint): B: rv. (removerevs): B: rv; use `true', `false'. (doassoc): B: rv, local var `changed'. (setlock): B: rv; use `false'. (dolocks, domessage): B: rv, local var `changed'. (rcs_setstate, buildeltatext): B: rv. (main): B: local vars `branchflag', `initflag', `textflag', `strictlock', `strict_selected', `Ttimeflag', `keepRCStime'; use `false'. * rcsclean.c: Don't #include . (unlock): B: rv. (main): B: local vars `dounlock', `perform', `unlocked', `unlockflag', `waslocked', `Ttimeflag'. * rcsdiff.c: Don't #include . (main): B: local var `no_diff_means_no_output'. * rcsedit.c: Don't #include . (locker_expansion): B: var. (finishedit): B: param `done'. (copystring): B: local var `amidline'. (enterstring): B: local vars `amidline', `oamidline'. (keyreplace): B: params `delimstuffed', `dolog'; B: local var `kdelim_found'; use `false'. (expandline): B: params `delimstuffed', `dolog'; B: local var `e'; remove local var `ds'; use `delimstuffed' directly; use `false', `true'. (rcswriteopen): B: param `mustread'; local var `waslocked'. (makedirtemp): B: param `isworkfile'. (findlock): B: param `delete'. (addlock): B: param `verbose'. (addsymbol): B: param `rebind'. (checkaccesslist): B: rv. (dorewrite): B: param `lockflag'. * rcsfcmp.c: Don't #include . (rcsfcmp): B: local vars `eqkeyvals', `xeof', `ueof'. * rcsfnms.c: Don't #include . (suffix_matches): B: rv. (rcsreadopen): B: param `mustread'. (finopen): B: params `rcsopen' 3rd arg, `mustread'; B: local vars `interesting', `preferold'. (fin2open): B: params `rcsopen' 3rd arg, `mustread'. (pairnames): B: params `rcsopen' 3rd arg, `mustread', `quiet'; B: local var `paired'. (isSLASH): B: rv. [!HAVE_GETWD] (getcwd): B: local vars `readerror', `toolong'; use `true'. [PAIRTEST] (main): B: local var `initflag'. * rcsgen.c: Don't #include . (interactiveflag): B: var. (scandeltatext): B: param `needlog'. (buildrevision): B: param `expandflag'. (ttystdin): B: rv, local var `initialized'. (yesorno): B: rv. (putdesc): B: param `textflag'. (getsstdin): B: local var `tty'. (putdtext): B: rv, param `diffmt'. (putstring): B: params `delim', `log'. (putdftext): B: param `diffmt'. * rcskeep.c: Don't #include . (prevkeys): B: var. (badly_terminated): B: rv. (get0val): B: param `optional', local var `got1'. (keepid): B: rv. (getval): B: rv, param `optional'. (checknum, keeprev): B: rv. (getoldkeys): B: rv, local vars `needs_closing', `prevname_found'; use `true'. * rcslex.c: Don't #include . (hshenter, quietflag, ignored_phrases): B: vars. (eoflex, getlex): B: rv. (getkeyopt): B: rv; remove spurious parens around `return' "arg". (checkidentifier): B: param `dotok', local var `isid'. [!maps_memory && large_memory] (Igetmore): B: rv; use `true', `false'. (Oerrloop): B: var. (fatcleanup): B: param `already_newline'. * rcsmerge.c: Don't #include . (main): B: local var `tostdout'. * rcsrev.c: Don't #include . (expandsym): B: rv. (fexpandsym): B: rv, local var `id'. * rcssyn.c: Don't #include . (StrictLocks): B: var. (getkeyval): B: param `optional'. (getdelta): B: rv; remove spurious parens around `return' "arg". (getdesc): B: param `prdesc'. (getdiffcmd): B: param `delimiter'. * rcstime.c (use_zone_offset): B: var. (date2str): Use `false'. * rcsutil.c: Don't #include . (getusername): B: param `suspicious'. (unsupported_SA_SIGINFO): B: var. (setup_catchsig): Use `true'. (catchints): B: local var `catching_ints'. (catchmmapints): B: local var `catching_mmap_ints'. (runv) [BAD_WAIT_IF_SIGCHLD_IGNORED]: B: local var `fixed_SIGCHLD'. (setRCSversion): B: local var `oldversion'. (set_uid_to): B: local var `looping' (stick_with_euid): B: var. * rlog.c: Don't #include . (branchflag, lockflag): B: vars. (putadelta): B: param `trunk', local var `pre5'. (getdatepair): B: local var `switchflag', `eq'. (checkrevpair, getnumericrev): B: rv. (main): B: local var `descflag', `selectflag', `onlylockflag', `onlyRCSflag', `pre5', `shownames'. 2010-03-16 Thien-Thi Nguyen [int C] Use `quietflag' more. * ident.c (scanfile): Drop arg `quiet'; use `quietflag' instead. (main): If given -q, set `quietflag' directly. If given -V, return successfully after displaying version info. 2010-03-16 Thien-Thi Nguyen [int C] Use enum for keyword substitution mode. * rcsbase.h (kwsub): New enum. [O_BINARY] (FOPEN_R_WORK, FOPEN_W_WORK, FOPEN_WPLUS_WORK): Use enum. (KEYVAL_EXPAND, KEYVALLOCK_EXPAND, KEY_EXPAND, VAL_EXPAND) (OLD_EXPAND, BINARY_EXPAND): Delete #define:s. (MIN_UNEXPAND, MIN_UNCHANGED_EXPAND): Use enum. * ci.c (main) [OPEN_O_BINARY]: Use enum. (main): Likewise. * co.c (main) [OPEN_O_BINARY]: Likewise. (main): Likewise. * rcs.c (buildeltatext) [OPEN_O_BINARY]: Likewise. * rcsclean.c (main): Likewise. * rcsdiff.c (main): Likewise. (main) [OPEN_O_BINARY]: Likewise. * rcsedit.c (keyreplace): Likewise. * rcsfnms.c (InitAdmin): Likewise. * rcsgen.c (putadmin): Likewise. * rcsmerge.c (main): Likewise. * rcssyn.c (getadmin): Likewise. * rlog.c (main): Likewise. 2010-03-15 Thien-Thi Nguyen [int C] Don't bother taking unused third arg for `same_file'. * rcsbase.h (same_file): Don't take third arg. * ci.c (main): Call `same_file' w/o third arg. * co.c (main): Likewise. * rcsclean.c (main): Likewise. * rcsedit.c (chnamemod): Likewise. * rcsfnms.c (getfullRCSname): Likewise. 2010-03-15 Thien-Thi Nguyen [int C] Topo-sort top-level; eliminate redundant forward func decls. * maketime.c: Delete forward func decls; reorder top-level; do other whitespace and comment changes. * merger.c: Likewise. * partime.c: Likewise. * rcsedit.c: Likewise. * rcsfcmp.c: Likewise. * rcsfnms.c: Likewise. * rcsgen.c: Likewise. * rcskeep.c: Likewise. * rcskeys.c: Likewise. * rcslex.c: Likewise. * rcsmap.c: Likewise. * rcsrev.c: Likewise. * rcssyn.c: Likewise. * rcstime.c: Likewise. * rcsutil.c: Likewise. 2010-03-15 Thien-Thi Nguyen [int C] Remove spurious debugging output. * rcsfnms.c [!HAVE_MKSTEMP] (homegrown_mkstemp): Remove debugging output. 2010-03-13 Thien-Thi Nguyen [int] Revise output for --help option. * ci.c (:help comment): Remove description blurb; use uppercase letters and a period; flatten/reorg a bit. * co.c (:help comment): Likewise. * ident.c (:help comment): Likewise. * merge.c (:help comment): Likewise. * rcs.c (:help comment): Likewise. * rcsclean.c (:help comment): Likewise. * rcsdiff.c (:help comment): Likewise. * rcsmerge.c (:help comment): Likewise. * rlog.c (:help comment): Likewise. 2010-03-13 Thien-Thi Nguyen [int C] Topo-sort top-level; eliminate redundant forward func decls. * ci.c: Delete forward func decls; reorder top-level; do other whitespace and comment changes. (main): Move to end. * co.c: Likewise. * ident.c: Likewise. * merge.c: Likewise. * rcs.c: Likewise. * rcsclean.c: Likewise. * rcsdiff.c: Likewise. * rcsmerge.c: Likewise. * rlog.c: Likewise. 2010-03-13 Thien-Thi Nguyen [sec] Use mktemp(1) instead of homegrown tmporary file naming. * rcsfreeze.sh (TMPLOG): Use mktemp(1); exit if not successful. 2010-03-11 Thien-Thi Nguyen rcsdiff: Refine "same-revision don't call diff" optimization. * rcsdiff.c (unique): New struct def. (s_unique): New typedef. (minus_y, minus_D): New static `s_unique' objects. (longopt_maybe_p): New static func. (main)