From: mickey Date: Fri, 19 Apr 1996 12:39:59 +0000 (+0000) Subject: -L option added to support LOCALID behaviour. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=afa09f108e769cb766aa5033f7e4884c3b82eb60;p=openbsd -L option added to support LOCALID behaviour. maybe set up in RCSINIT environment variable. --- diff --git a/gnu/usr.bin/rcs/ci/ci.1 b/gnu/usr.bin/rcs/ci/ci.1 index d03f311995d..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.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 88de3a9b5b7..de203d0978d 100644 --- a/gnu/usr.bin/rcs/ci/ci.c +++ b/gnu/usr.bin/rcs/ci/ci.c @@ -28,6 +28,10 @@ Report problems and direct all questions to: /* * $Log: ci.c,v $ + * Revision 1.2 1996/04/19 12:40:00 mickey + * -L 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 * @@ -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.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.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 fa44d31f252..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.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 224b18cc1fb..5b80764cbb4 100644 --- a/gnu/usr.bin/rcs/co/co.c +++ b/gnu/usr.bin/rcs/co/co.c @@ -28,6 +28,10 @@ Report problems and direct all questions to: /* * $Log: co.c,v $ + * Revision 1.2 1996/04/19 12:40:04 mickey + * -L 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 * @@ -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.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.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 035f023db91..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.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,6 +30,10 @@ Report problems and direct all questions to: /* * $Log: rcsbase.h,v $ + * Revision 1.2 1996/04/19 12:40:06 mickey + * -L 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 * @@ -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 1114d9134b5..306c46fe37b 100644 --- a/gnu/usr.bin/rcs/lib/rcsedit.c +++ b/gnu/usr.bin/rcs/lib/rcsedit.c @@ -35,6 +35,10 @@ Report problems and direct all questions to: /* * $Log: rcsedit.c,v $ + * Revision 1.2 1996/04/19 12:40:07 mickey + * -L 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 * @@ -182,7 +186,7 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(editId, "$Id: rcsedit.c,v 1.1.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 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 * @@ -98,7 +102,7 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(keepId, "$Id: rcskeep.c,v 1.1.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 30a086b5757..e43546c765a 100644 --- a/gnu/usr.bin/rcs/lib/rcskeys.c +++ b/gnu/usr.bin/rcs/lib/rcskeys.c @@ -27,6 +27,10 @@ Report problems and direct all questions to: */ /* $Log: rcskeys.c,v $ +/* Revision 1.2 1996/04/19 12:40:09 mickey +/* -L 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 /* @@ -65,20 +69,27 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(keysId, "$Id: rcskeys.c,v 1.1.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); }