diff options
author | peter <peter@FreeBSD.org> | 1995-10-29 19:31:11 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-10-29 19:31:11 +0000 |
commit | cd0669e5850fa92d1173b7b7d13a375bd7d7ec76 (patch) | |
tree | aa4cd4749538da32af87cd6c7c2697adfbb57748 /gnu/usr.bin/rcs/lib | |
parent | 11acdf92714d7de830e2ab930cd33a914053d047 (diff) | |
download | FreeBSD-src-cd0669e5850fa92d1173b7b7d13a375bd7d7ec76.zip FreeBSD-src-cd0669e5850fa92d1173b7b7d13a375bd7d7ec76.tar.gz |
Recover the -K option to co, for handling selective keyword expansion.
Diffstat (limited to 'gnu/usr.bin/rcs/lib')
-rw-r--r-- | gnu/usr.bin/rcs/lib/rcsbase.h | 15 | ||||
-rw-r--r-- | gnu/usr.bin/rcs/lib/rcsedit.c | 15 | ||||
-rw-r--r-- | gnu/usr.bin/rcs/lib/rcskeys.c | 54 |
3 files changed, 78 insertions, 6 deletions
diff --git a/gnu/usr.bin/rcs/lib/rcsbase.h b/gnu/usr.bin/rcs/lib/rcsbase.h index 36ef8ab..d3ad276 100644 --- a/gnu/usr.bin/rcs/lib/rcsbase.h +++ b/gnu/usr.bin/rcs/lib/rcsbase.h @@ -1,6 +1,6 @@ /* RCS common definitions and data structures */ -#define RCSBASE "$Id: rcsbase.h,v 5.20 1995/06/16 06:19:24 eggert Exp $" +#define RCSBASE "$Id: rcsbase.h,v 1.4 1995/10/28 21:49:34 peter Exp $" /* Copyright 1982, 1988, 1989 Walter Tichy Copyright 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert @@ -31,6 +31,16 @@ Report problems and direct all questions to: /* * $Log: rcsbase.h,v $ + * Revision 1.4 1995/10/28 21:49:34 peter + * First part of import conflict merge from rcs-5.7 import. + * + * All those $Log$ entries, combined with the whitespace changes are a real + * pain. + * + * I'm committing this now, before it's completely finished to get it compiling + * and working again ASAP. Some of the FreeBSD specific features are not working + * in this commit yet (mainly rlog stuff and $FreeBSD$ support) + * * Revision 5.20 1995/06/16 06:19:24 eggert * Update FSF address. * @@ -427,10 +437,11 @@ struct assoc { #define REVISION "Revision" #define SOURCE "Source" #define STATE "State" +#define FREEBSD "FreeBSD" #define keylength 8 /* max length of any of the above keywords */ enum markers { Nomatch, Author, Date, Header, Id, - Locker, Log, Name, RCSfile, Revision, Source, State }; + Locker, Log, Name, RCSfile, Revision, Source, State, FreeBSD }; /* This must be in the same order as rcskeys.c's Keyword[] array. */ #define DELNUMFORM "\n\n%s\n%s\n" diff --git a/gnu/usr.bin/rcs/lib/rcsedit.c b/gnu/usr.bin/rcs/lib/rcsedit.c index 79408f3..ce8b1d0 100644 --- a/gnu/usr.bin/rcs/lib/rcsedit.c +++ b/gnu/usr.bin/rcs/lib/rcsedit.c @@ -36,6 +36,16 @@ Report problems and direct all questions to: /* * $Log: rcsedit.c,v $ + * Revision 1.4 1995/10/28 21:49:36 peter + * First part of import conflict merge from rcs-5.7 import. + * + * All those $Log$ entries, combined with the whitespace changes are a real + * pain. + * + * I'm committing this now, before it's completely finished to get it compiling + * and working again ASAP. Some of the FreeBSD specific features are not working + * in this commit yet (mainly rlog stuff and $FreeBSD$ support) + * * Revision 5.19 1995/06/16 06:19:24 eggert * Update FSF address. * @@ -202,7 +212,7 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(editId, "$Id: rcsedit.c,v 5.19 1995/06/16 06:19:24 eggert Exp $") +libId(editId, "$Id: rcsedit.c,v 1.4 1995/10/28 21:49:36 peter Exp $") static void editEndsPrematurely P((void)) exiting; static void editLineNumberOverflow P((void)) exiting; @@ -1049,10 +1059,11 @@ keyreplace(marker, delta, delimstuffed, infile, out, dolog) case Date: aputs(date2str(date,datebuf), out); break; + case FreeBSD: case Id: case Header: escape_string(out, - marker==Id || RCSv<VERSION(4) + marker==Id || marker==FreeBSD || RCSv<VERSION(4) ? basefilename(RCSname) : getfullRCSname() ); diff --git a/gnu/usr.bin/rcs/lib/rcskeys.c b/gnu/usr.bin/rcs/lib/rcskeys.c index 9ef0adf..6b9d690 100644 --- a/gnu/usr.bin/rcs/lib/rcskeys.c +++ b/gnu/usr.bin/rcs/lib/rcskeys.c @@ -29,6 +29,16 @@ Report problems and direct all questions to: /* * $Log: rcskeys.c,v $ + * Revision 1.6 1995/10/28 21:49:45 peter + * First part of import conflict merge from rcs-5.7 import. + * + * All those $Log$ entries, combined with the whitespace changes are a real + * pain. + * + * I'm committing this now, before it's completely finished to get it compiling + * and working again ASAP. Some of the FreeBSD specific features are not working + * in this commit yet (mainly rlog stuff and $FreeBSD$ support) + * * Revision 5.4 1995/06/16 06:19:24 eggert * Update FSF address. * @@ -64,17 +74,25 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(keysId, "$Id: rcskeys.c,v 5.4 1995/06/16 06:19:24 eggert Exp $") +libId(keysId, "$Id: rcskeys.c,v 1.6 1995/10/28 21:49:45 peter Exp $") char const *const Keyword[] = { /* This must be in the same order as rcsbase.h's enum markers type. */ 0, AUTHOR, DATE, HEADER, IDH, - LOCKER, LOG, NAME, RCSFILE, REVISION, SOURCE, STATE + LOCKER, LOG, NAME, RCSFILE, REVISION, SOURCE, STATE, + FREEBSD }; +/* Expand all keywords by default */ +static int ExpandKeyword[] = { + false, + true, true, true, true, + true, true, true, true, true, true, true, + false +}; enum markers trymatch(string) @@ -87,6 +105,8 @@ trymatch(string) register int j; register char const *p, *s; for (j = sizeof(Keyword)/sizeof(*Keyword); (--j); ) { + if (!ExpandKeyword[j]) + continue; /* try next keyword */ p = Keyword[j]; s = string; @@ -104,3 +124,33 @@ trymatch(string) return(Nomatch); } +setIncExc(arg) + char *arg; +/* Sets up the ExpandKeyword table according to command-line flags */ +{ + char *key; + int include = 0, j; + + arg += 2; + switch (*arg++) { + case 'e': + include = false; + break; + case 'i': + include = true; + break; + default: + return(false); + } + if (include) + for (j = sizeof(Keyword)/sizeof(*Keyword); (--j); ) + ExpandKeyword[j] = false; + key = strtok(arg, ","); + while (key) { + for (j = sizeof(Keyword)/sizeof(*Keyword); (--j); ) + if (!strcmp(key, Keyword[j])) + ExpandKeyword[j] = include; + key = strtok(NULL, ","); + } + return(true); +} |