summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-04-19 12:40:10 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-04-19 12:40:10 +0000
commitd17b9a921a16fd6c521bf274142ef4ed0eab1e46 (patch)
treefb3011ba887793177d80d70e1dfe03b189f90a81 /gnu
parent6a6f0367b7974e7532bca32ed0b90549bc38ce7c (diff)
-L<string> option added to support LOCALID behaviour.
maybe set up in RCSINIT environment variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/rcs/ci/ci.17
-rw-r--r--gnu/usr.bin/rcs/ci/ci.c14
-rw-r--r--gnu/usr.bin/rcs/co/co.17
-rw-r--r--gnu/usr.bin/rcs/co/co.c14
-rw-r--r--gnu/usr.bin/rcs/lib/rcsbase.h19
-rw-r--r--gnu/usr.bin/rcs/lib/rcsedit.c12
-rw-r--r--gnu/usr.bin/rcs/lib/rcskeep.c12
-rw-r--r--gnu/usr.bin/rcs/lib/rcskeys.c60
8 files changed, 95 insertions, 50 deletions
diff --git a/gnu/usr.bin/rcs/ci/ci.1 b/gnu/usr.bin/rcs/ci/ci.1
index 9cfff2de70a..a0ca84e4a18 100644
--- a/gnu/usr.bin/rcs/ci/ci.1
+++ b/gnu/usr.bin/rcs/ci/ci.1
@@ -2,7 +2,7 @@
.ds Rv \\$3
.ds Dt \\$4
..
-.Id $Id: ci.1,v 1.1 1995/10/18 08:40:59 deraadt Exp $
+.Id $Id: ci.1,v 1.2 1996/04/19 12:39:59 mickey Exp $
.ds i \&\s-1ISO\s0
.ds r \&\s-1RCS\s0
.ds u \&\s-1UTC\s0
@@ -256,6 +256,11 @@ overrides
forces a deposit; the new revision is deposited even it is not different
from the preceding one.
.TP
+.BR \-L
+adds a synonym for the
+.B Id
+keyword.
+.TP
.BR \-k [\f2rev\fP]
searches the working file for keyword values to determine its revision number,
creation date, state, and author (see
diff --git a/gnu/usr.bin/rcs/ci/ci.c b/gnu/usr.bin/rcs/ci/ci.c
index 9b5bfdb79e7..de203d0978d 100644
--- a/gnu/usr.bin/rcs/ci/ci.c
+++ b/gnu/usr.bin/rcs/ci/ci.c
@@ -28,8 +28,12 @@ Report problems and direct all questions to:
/*
* $Log: ci.c,v $
- * Revision 1.1 1995/10/18 08:40:59 deraadt
- * Initial revision
+ * Revision 1.2 1996/04/19 12:40:00 mickey
+ * -L<string> option added to support LOCALID behaviour.
+ * maybe set up in RCSINIT environment variable.
+ *
+ * Revision 1.1.1.1 1995/10/18 08:40:59 deraadt
+ * initial import of NetBSD tree
*
* Revision 1.3 1995/02/24 02:07:46 mycroft
* RCS 5.6.7.4
@@ -267,7 +271,7 @@ static struct hshentry newdelta; /* new delta to be inserted */
static struct stat workstat;
static struct Symrev *assoclst, **nextassoc;
-mainProg(ciId, "ci", "$Id: ci.c,v 1.1 1995/10/18 08:40:59 deraadt Exp $")
+mainProg(ciId, "ci", "$Id: ci.c,v 1.2 1996/04/19 12:40:00 mickey Exp $")
{
static char const cmdusage[] =
"\nci usage: ci -{fIklMqru}[rev] -d[date] -mmsg -{nN}name -sstate -ttext -T -Vn -wwho -xsuff -zzone file ...";
@@ -349,6 +353,10 @@ mainProg(ciId, "ci", "$Id: ci.c,v 1.1 1995/10/18 08:40:59 deraadt Exp $")
keepflag=true;
goto revno;
+ case 'L':
+ setRCSlocalId(*argv+2);
+ break;
+
case 'm':
if (msg.size) redefined('m');
msg = cleanlogmsg(a, strlen(a));
diff --git a/gnu/usr.bin/rcs/co/co.1 b/gnu/usr.bin/rcs/co/co.1
index efa4705a626..1138ac56212 100644
--- a/gnu/usr.bin/rcs/co/co.1
+++ b/gnu/usr.bin/rcs/co/co.1
@@ -2,7 +2,7 @@
.ds Rv \\$3
.ds Dt \\$4
..
-.Id $Id: co.1,v 1.1 1995/10/18 08:40:59 deraadt Exp $
+.Id $Id: co.1,v 1.2 1996/04/19 12:40:02 mickey Exp $
.ds i \&\s-1ISO\s0
.ds r \&\s-1RCS\s0
.ds u \&\s-1UTC\s0
@@ -151,6 +151,11 @@ See also
.SM "FILE MODES"
below.
.TP
+.B \-L
+adds the synonym for the
+.BR Id
+keyword.
+.TP
.B \-kkv
Generate keyword strings using the default form, e.g.\&
.B "$\&Revision: \*(Rv $"
diff --git a/gnu/usr.bin/rcs/co/co.c b/gnu/usr.bin/rcs/co/co.c
index 75d81effc62..5b80764cbb4 100644
--- a/gnu/usr.bin/rcs/co/co.c
+++ b/gnu/usr.bin/rcs/co/co.c
@@ -28,8 +28,12 @@ Report problems and direct all questions to:
/*
* $Log: co.c,v $
- * Revision 1.1 1995/10/18 08:41:00 deraadt
- * Initial revision
+ * Revision 1.2 1996/04/19 12:40:04 mickey
+ * -L<string> option added to support LOCALID behaviour.
+ * maybe set up in RCSINIT environment variable.
+ *
+ * Revision 1.1.1.1 1995/10/18 08:41:00 deraadt
+ * initial import of NetBSD tree
*
* Revision 1.3 1995/02/24 02:07:49 mycroft
* RCS 5.6.7.4
@@ -191,7 +195,7 @@ static struct hshentries *gendeltas; /* deltas to be generated */
static struct hshentry *targetdelta; /* final delta to be generated */
static struct stat workstat;
-mainProg(coId, "co", "$Id: co.c,v 1.1 1995/10/18 08:41:00 deraadt Exp $")
+mainProg(coId, "co", "$Id: co.c,v 1.2 1996/04/19 12:40:04 mickey Exp $")
{
static char const cmdusage[] =
"\nco usage: co -{fIlMpqru}[rev] -ddate -jjoins -ksubst -sstate -T -w[who] -Vn -xsuff -zzone file ...";
@@ -310,6 +314,10 @@ mainProg(coId, "co", "$Id: co.c,v 1.1 1995/10/18 08:41:00 deraadt Exp $")
zone_set(a);
break;
+ case 'L': /* add local $Id: co.c,v 1.2 1996/04/19 12:40:04 mickey Exp $ keyword string */
+ setRCSlocalId(*argv+2);
+ break;
+
case 'k': /* set keyword expand mode */
expandarg = *argv;
if (0 <= expmode) redefined('k');
diff --git a/gnu/usr.bin/rcs/lib/rcsbase.h b/gnu/usr.bin/rcs/lib/rcsbase.h
index 6d460436fa6..07816d80120 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 1.1 1995/10/18 08:41:01 deraadt Exp $"
+#define RCSBASE "$Id: rcsbase.h,v 1.2 1996/04/19 12:40:06 mickey Exp $"
/* Copyright 1982, 1988, 1989 Walter Tichy
Copyright 1990, 1991, 1992, 1993, 1994 Paul Eggert
@@ -30,8 +30,12 @@ Report problems and direct all questions to:
/*
* $Log: rcsbase.h,v $
- * Revision 1.1 1995/10/18 08:41:01 deraadt
- * Initial revision
+ * Revision 1.2 1996/04/19 12:40:06 mickey
+ * -L<string> option added to support LOCALID behaviour.
+ * maybe set up in RCSINIT environment variable.
+ *
+ * Revision 1.1.1.1 1995/10/18 08:41:01 deraadt
+ * initial import of NetBSD tree
*
* Revision 1.6 1995/02/24 02:24:59 mycroft
* RCS 5.6.7.4
@@ -411,10 +415,8 @@ struct assoc {
#define keylength 8 /* max length of any of the above keywords */
enum markers { Nomatch, Author, Date, Header, Id,
-#ifdef LOCALID
- LocalId,
-#endif
- Locker, Log, Name, RCSfile, Revision, Source, State };
+ Locker, Log, Name, RCSfile, Revision, Source, State,
+ LocalId };
/* This must be in the same order as rcskeys.c's Keyword[] array. */
#define DELNUMFORM "\n\n%s\n%s\n"
@@ -518,7 +520,8 @@ extern struct buf prevauthor, prevdate, prevname, prevrev, prevstate;
int getoldkeys P((RILE*));
/* rcskeys */
-extern char const *const Keyword[];
+extern char const *Keyword[];
+void setRCSlocalId(char const *);
enum markers trymatch P((char const*));
/* rcslex */
diff --git a/gnu/usr.bin/rcs/lib/rcsedit.c b/gnu/usr.bin/rcs/lib/rcsedit.c
index ee8494aef97..306c46fe37b 100644
--- a/gnu/usr.bin/rcs/lib/rcsedit.c
+++ b/gnu/usr.bin/rcs/lib/rcsedit.c
@@ -35,8 +35,12 @@ Report problems and direct all questions to:
/*
* $Log: rcsedit.c,v $
- * Revision 1.1 1995/10/18 08:41:01 deraadt
- * Initial revision
+ * Revision 1.2 1996/04/19 12:40:07 mickey
+ * -L<string> option added to support LOCALID behaviour.
+ * maybe set up in RCSINIT environment variable.
+ *
+ * Revision 1.1.1.1 1995/10/18 08:41:01 deraadt
+ * initial import of NetBSD tree
*
* Revision 1.5 1995/02/24 02:25:01 mycroft
* RCS 5.6.7.4
@@ -182,7 +186,7 @@ Report problems and direct all questions to:
#include "rcsbase.h"
-libId(editId, "$Id: rcsedit.c,v 1.1 1995/10/18 08:41:01 deraadt Exp $")
+libId(editId, "$Id: rcsedit.c,v 1.2 1996/04/19 12:40:07 mickey Exp $")
static void editEndsPrematurely P((void)) exiting;
static void editLineNumberOverflow P((void)) exiting;
@@ -1034,9 +1038,7 @@ keyreplace(marker, delta, delimstuffed, infile, out, dolog)
break;
case Header:
case Id:
-#ifdef LOCALID
case LocalId:
-#endif
escape_string(out,
marker!=Header || RCSv<VERSION(4)
? basename(RCSname)
diff --git a/gnu/usr.bin/rcs/lib/rcskeep.c b/gnu/usr.bin/rcs/lib/rcskeep.c
index 94c4a8da73d..e9aa7bb42c9 100644
--- a/gnu/usr.bin/rcs/lib/rcskeep.c
+++ b/gnu/usr.bin/rcs/lib/rcskeep.c
@@ -28,8 +28,12 @@ Report problems and direct all questions to:
/*
* $Log: rcskeep.c,v $
- * Revision 1.1 1995/10/18 08:41:02 deraadt
- * Initial revision
+ * Revision 1.2 1996/04/19 12:40:08 mickey
+ * -L<string> option added to support LOCALID behaviour.
+ * maybe set up in RCSINIT environment variable.
+ *
+ * Revision 1.1.1.1 1995/10/18 08:41:02 deraadt
+ * initial import of NetBSD tree
*
* Revision 1.5 1995/02/24 02:25:07 mycroft
* RCS 5.6.7.4
@@ -98,7 +102,7 @@ Report problems and direct all questions to:
#include "rcsbase.h"
-libId(keepId, "$Id: rcskeep.c,v 1.1 1995/10/18 08:41:02 deraadt Exp $")
+libId(keepId, "$Id: rcskeep.c,v 1.2 1996/04/19 12:40:08 mickey Exp $")
static int badly_terminated P((void));
static int checknum P((char const*));
@@ -191,9 +195,7 @@ getoldkeys(fp)
break;
case Header:
case Id:
-#ifdef LOCALID
case LocalId:
-#endif
if (!(
getval(fp, (struct buf*)0, false) &&
keeprev(fp) &&
diff --git a/gnu/usr.bin/rcs/lib/rcskeys.c b/gnu/usr.bin/rcs/lib/rcskeys.c
index 6bbb55acb62..e43546c765a 100644
--- a/gnu/usr.bin/rcs/lib/rcskeys.c
+++ b/gnu/usr.bin/rcs/lib/rcskeys.c
@@ -27,8 +27,12 @@ Report problems and direct all questions to:
*/
/* $Log: rcskeys.c,v $
-/* Revision 1.1 1995/10/18 08:41:02 deraadt
-/* Initial revision
+/* Revision 1.2 1996/04/19 12:40:09 mickey
+/* -L<string> option added to support LOCALID behaviour.
+/* maybe set up in RCSINIT environment variable.
+/*
+/* Revision 1.1.1.1 1995/10/18 08:41:02 deraadt
+/* initial import of NetBSD tree
/*
/* Revision 1.6 1995/02/24 02:25:08 mycroft
/* RCS 5.6.7.4
@@ -65,20 +69,27 @@ Report problems and direct all questions to:
#include "rcsbase.h"
-libId(keysId, "$Id: rcskeys.c,v 1.1 1995/10/18 08:41:02 deraadt Exp $")
-
+libId(keysId, "$Id: rcskeys.c,v 1.2 1996/04/19 12:40:09 mickey Exp $")
-char const *const Keyword[] = {
+char local_id[keylength+1];
+char const *Keyword[] = {
/* This must be in the same order as rcsbase.h's enum markers type. */
0,
AUTHOR, DATE, HEADER, IDH,
-#ifdef LOCALID
- LOCALID,
-#endif
- LOCKER, LOG, NAME, RCSFILE, REVISION, SOURCE, STATE
+ LOCKER, LOG, NAME, RCSFILE, REVISION, SOURCE, STATE,
+ NULL,
};
+ void
+setRCSlocalId(string)
+ char const *string;
+{
+ if (strlen(string) > keylength)
+ error("LocalId is too long");
+ strcpy(local_id, string);
+ Keyword[LocalId] = local_id;
+}
enum markers
trymatch(string)
@@ -90,21 +101,22 @@ trymatch(string)
{
register int j;
register char const *p, *s;
- for (j = sizeof(Keyword)/sizeof(*Keyword); (--j); ) {
- /* try next keyword */
- p = Keyword[j];
- s = string;
- while (*p++ == *s++) {
- if (!*p)
- switch (*s) {
- case KDELIM:
- case VDELIM:
- return (enum markers)j;
- default:
- return Nomatch;
- }
- }
- }
+ for (j = sizeof(Keyword)/sizeof(*Keyword); (--j); )
+ if (Keyword[j]) {
+ /* try next keyword */
+ p = Keyword[j];
+ s = string;
+ while (*p++ == *s++) {
+ if (!*p)
+ switch (*s) {
+ case KDELIM:
+ case VDELIM:
+ return (enum markers)j;
+ default:
+ return Nomatch;
+ }
+ }
+ }
return(Nomatch);
}