summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorNiall O'Higgins <niallo@cvs.openbsd.org>2006-02-09 08:08:57 +0000
committerNiall O'Higgins <niallo@cvs.openbsd.org>2006-02-09 08:08:57 +0000
commit9927ca1bd80181bc300c7cd273b90f4ff9110f45 (patch)
tree95e42a113900f35d98a270eb0e8698606c03ab9e /usr.bin/cvs
parentd0c8f466e6202fa8692c280b350d825cbd110d54 (diff)
- move rcs_kw-related data into rcs.h and de-static the keyword array. this
allows access from outside rcs.c and will be needed for upcoming features in ci(1). ok joris@ xsa@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/rcs.c51
-rw-r--r--usr.bin/cvs/rcs.h27
2 files changed, 40 insertions, 38 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index 1fee83b01b9..5bfd1ae296e 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.127 2006/02/01 13:52:51 xsa Exp $ */
+/* $OpenBSD: rcs.c,v 1.128 2006/02/09 08:08:56 niallo Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -164,6 +164,19 @@ static const struct rcs_comment {
{ "yr", " * " }, /* yacc-ratfor */
};
+struct rcs_kw rcs_expkw[] = {
+ { "Author", RCS_KW_AUTHOR },
+ { "Date", RCS_KW_DATE },
+ { "Header", RCS_KW_HEADER },
+ { "Id", RCS_KW_ID },
+ { "Log", RCS_KW_LOG },
+ { "Name", RCS_KW_NAME },
+ { "RCSfile", RCS_KW_RCSFILE },
+ { "Revision", RCS_KW_REVISION },
+ { "Source", RCS_KW_SOURCE },
+ { "State", RCS_KW_STATE },
+};
+
#define NB_COMTYPES (sizeof(rcs_comments)/sizeof(rcs_comments[0]))
#ifdef notyet
@@ -205,42 +218,6 @@ static struct rcs_key {
#define RCS_NKEYS (sizeof(rcs_keys)/sizeof(rcs_keys[0]))
-/*
- * Keyword expansion table
- */
-#define RCS_KW_AUTHOR 0x1000
-#define RCS_KW_DATE 0x2000
-#define RCS_KW_LOG 0x4000
-#define RCS_KW_NAME 0x8000
-#define RCS_KW_RCSFILE 0x0100
-#define RCS_KW_REVISION 0x0200
-#define RCS_KW_SOURCE 0x0400
-#define RCS_KW_STATE 0x0800
-#define RCS_KW_FULLPATH 0x0010
-
-#define RCS_KW_ID \
- (RCS_KW_RCSFILE | RCS_KW_REVISION | RCS_KW_DATE \
- | RCS_KW_AUTHOR | RCS_KW_STATE)
-
-#define RCS_KW_HEADER (RCS_KW_ID | RCS_KW_FULLPATH)
-
-static struct rcs_kw {
- char kw_str[16];
- int kw_type;
-} rcs_expkw[] = {
- { "Author", RCS_KW_AUTHOR },
- { "Date", RCS_KW_DATE },
- { "Header", RCS_KW_HEADER },
- { "Id", RCS_KW_ID },
- { "Log", RCS_KW_LOG },
- { "Name", RCS_KW_NAME },
- { "RCSfile", RCS_KW_RCSFILE },
- { "Revision", RCS_KW_REVISION },
- { "Source", RCS_KW_SOURCE },
- { "State", RCS_KW_STATE },
-};
-
-#define RCS_NKWORDS (sizeof(rcs_expkw)/sizeof(rcs_expkw[0]))
static const char *rcs_errstrs[] = {
"No error",
diff --git a/usr.bin/cvs/rcs.h b/usr.bin/cvs/rcs.h
index 4ac5896edfe..e49f3cfd4e8 100644
--- a/usr.bin/cvs/rcs.h
+++ b/usr.bin/cvs/rcs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.h,v 1.45 2006/01/02 09:42:20 xsa Exp $ */
+/* $OpenBSD: rcs.h,v 1.46 2006/02/09 08:08:56 niallo Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -54,6 +54,25 @@
#define RCS_LOCK_STRICT 1
+/*
+ * Keyword expansion table
+ */
+#define RCS_KW_AUTHOR 0x1000
+#define RCS_KW_DATE 0x2000
+#define RCS_KW_LOG 0x4000
+#define RCS_KW_NAME 0x8000
+#define RCS_KW_RCSFILE 0x0100
+#define RCS_KW_REVISION 0x0200
+#define RCS_KW_SOURCE 0x0400
+#define RCS_KW_STATE 0x0800
+#define RCS_KW_FULLPATH 0x0010
+
+#define RCS_KW_ID \
+ (RCS_KW_RCSFILE | RCS_KW_REVISION | RCS_KW_DATE \
+ | RCS_KW_AUTHOR | RCS_KW_STATE)
+
+#define RCS_KW_HEADER (RCS_KW_ID | RCS_KW_FULLPATH)
+
/* RCS keyword expansion modes (kflags) */
#define RCS_KWEXP_NONE 0x00
#define RCS_KWEXP_NAME 0x01 /* include keyword name */
@@ -70,6 +89,12 @@
((k & RCS_KWEXP_OLD) && (RCS_KWEXP_OLD & ~RCS_KWEXP_OLD)))
+struct rcs_kw {
+ char kw_str[16];
+ int kw_type;
+};
+
+#define RCS_NKWORDS (sizeof(rcs_expkw)/sizeof(rcs_expkw[0]))
#define RCSNUM_MAXNUM USHRT_MAX
#define RCSNUM_MAXLEN 64