summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/rcs/lib
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/rcs/lib')
-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
4 files changed, 61 insertions, 42 deletions
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);
}