summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2010-07-23 08:31:20 +0000
committerRay Lai <ray@cvs.openbsd.org>2010-07-23 08:31:20 +0000
commit114cf9476ebb86dcd4bd420266b9055ff9918c2e (patch)
tree31a73dd5949d81e3f8869aaee2bda7b2c5e02f14 /usr.bin/rcs
parentbdce6a57594ade4892765a7f2a617b93b6f688bb (diff)
Rename a bunch of variables and functions, removing the cvs_/rcs_
prefixes to reduce differences between cvs and rcs files. "yes!" nicm
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/buf.c4
-rw-r--r--usr.bin/rcs/diff3.c6
-rw-r--r--usr.bin/rcs/rcs.c10
-rw-r--r--usr.bin/rcs/rcsprog.c10
-rw-r--r--usr.bin/rcs/rcsprog.h4
-rw-r--r--usr.bin/rcs/rcsutil.h6
-rw-r--r--usr.bin/rcs/worklist.c22
-rw-r--r--usr.bin/rcs/worklist.h20
8 files changed, 41 insertions, 41 deletions
diff --git a/usr.bin/rcs/buf.c b/usr.bin/rcs/buf.c
index 6e8b36c0808..7849f66c1ee 100644
--- a/usr.bin/rcs/buf.c
+++ b/usr.bin/rcs/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.13 2007/05/29 00:19:10 ray Exp $ */
+/* $OpenBSD: buf.c,v 1.14 2010/07/23 08:31:19 ray Exp $ */
/*
* Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -374,7 +374,7 @@ rcs_buf_write_stmp(BUF *b, char *template)
if ((fd = mkstemp(template)) == -1)
err(1, "%s", template);
- rcs_worklist_add(template, &rcs_temp_files);
+ worklist_add(template, &temp_files);
if (rcs_buf_write_fd(b, fd) == -1) {
(void)unlink(template);
diff --git a/usr.bin/rcs/diff3.c b/usr.bin/rcs/diff3.c
index 4d0ab1549aa..0cd51a12583 100644
--- a/usr.bin/rcs/diff3.c
+++ b/usr.bin/rcs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.28 2009/10/27 23:59:42 deraadt Exp $ */
+/* $OpenBSD: diff3.c,v 1.29 2010/07/23 08:31:19 ray Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -483,7 +483,7 @@ ed_patch_lines(struct rcs_lines *dlines, struct rcs_lines *plines)
if (dlp->l_lineno == start)
break;
if (dlp->l_lineno > start) {
- dlp = TAILQ_PREV(dlp, rcs_tqh, l_list);
+ dlp = TAILQ_PREV(dlp, tqh, l_list);
} else if (dlp->l_lineno < start) {
ndlp = TAILQ_NEXT(dlp, l_list);
if (ndlp->l_lineno > start)
@@ -497,7 +497,7 @@ ed_patch_lines(struct rcs_lines *dlines, struct rcs_lines *plines)
if (op == 'c') {
- insert_after = TAILQ_PREV(dlp, rcs_tqh, l_list);
+ insert_after = TAILQ_PREV(dlp, tqh, l_list);
for (i = 0; i <= (end - start); i++) {
ndlp = TAILQ_NEXT(dlp, l_list);
TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list);
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index f62a9418c9b..e8d034972ac 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.57 2010/07/21 09:22:19 ray Exp $ */
+/* $OpenBSD: rcs.c,v 1.58 2010/07/23 08:31:19 ray Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -404,7 +404,7 @@ rcs_write(RCSFILE *rfp)
err(1, "%s", fn);
}
- rcs_worklist_add(fn, &rcs_temp_files);
+ worklist_add(fn, &temp_files);
if (rfp->rf_head != NULL)
rcsnum_tostr(rfp->rf_head, numbuf, sizeof(numbuf));
@@ -1083,7 +1083,7 @@ rcs_patch_lines(struct rcs_lines *dlines, struct rcs_lines *plines)
if (dlp->l_lineno == lineno)
break;
if (dlp->l_lineno > lineno) {
- dlp = TAILQ_PREV(dlp, rcs_tqh, l_list);
+ dlp = TAILQ_PREV(dlp, tqh, l_list);
} else if (dlp->l_lineno < lineno) {
if (((ndlp = TAILQ_NEXT(dlp, l_list)) == NULL) ||
ndlp->l_lineno > lineno)
@@ -1103,7 +1103,7 @@ rcs_patch_lines(struct rcs_lines *dlines, struct rcs_lines *plines)
/* last line is gone - reset dlp */
if (dlp == NULL) {
ndlp = TAILQ_LAST(&(dlines->l_lines),
- rcs_tqh);
+ tqh);
dlp = ndlp;
}
}
@@ -1442,7 +1442,7 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev)
* When the first revision got specified, prevrdp will be NULL.
*/
prevrdp = (struct rcs_delta *)TAILQ_NEXT(rdp, rd_list);
- nextrdp = (struct rcs_delta *)TAILQ_PREV(rdp, rcs_tqh, rd_list);
+ nextrdp = (struct rcs_delta *)TAILQ_PREV(rdp, tqh, rd_list);
newdeltatext = prevbuf = nextbuf = NULL;
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index 0488f39e260..db844f81608 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.147 2009/02/15 12:58:01 joris Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.148 2010/07/23 08:31:19 ray Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -60,7 +60,7 @@ struct rcs_prog {
{ "merge", merge_main, merge_usage },
};
-struct rcs_wklhead rcs_temp_files;
+struct wklhead temp_files;
void sighdlr(int);
static void rcs_attach_symbol(RCSFILE *, const char *);
@@ -69,7 +69,7 @@ static void rcs_attach_symbol(RCSFILE *, const char *);
void
sighdlr(int sig)
{
- rcs_worklist_clean(&rcs_temp_files, rcs_worklist_unlink);
+ worklist_clean(&temp_files, worklist_unlink);
_exit(1);
}
@@ -129,7 +129,7 @@ main(int argc, char **argv)
ret = -1;
rcs_optind = 1;
- SLIST_INIT(&rcs_temp_files);
+ SLIST_INIT(&temp_files);
cmd_argc = build_cmd(&cmd_argv, argv, argc);
@@ -151,7 +151,7 @@ main(int argc, char **argv)
}
/* clean up temporary files */
- rcs_worklist_run(&rcs_temp_files, rcs_worklist_unlink);
+ worklist_run(&temp_files, worklist_unlink);
exit(ret);
}
diff --git a/usr.bin/rcs/rcsprog.h b/usr.bin/rcs/rcsprog.h
index 94ccc1aa44e..dc9b720d40c 100644
--- a/usr.bin/rcs/rcsprog.h
+++ b/usr.bin/rcs/rcsprog.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.h,v 1.61 2008/05/10 19:54:58 tobias Exp $ */
+/* $OpenBSD: rcsprog.h,v 1.62 2010/07/23 08:31:19 ray Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -80,7 +80,7 @@ extern int rcs_optind;
extern char *rcs_optarg;
extern char *rcs_suffixes;
extern char *rcs_tmpdir;
-extern struct rcs_wklhead rcs_temp_files;
+extern struct wklhead temp_files;
/* date.y */
time_t rcs_date_parse(const char *);
diff --git a/usr.bin/rcs/rcsutil.h b/usr.bin/rcs/rcsutil.h
index 62fe09fba7f..b9dbeb09dd4 100644
--- a/usr.bin/rcs/rcsutil.h
+++ b/usr.bin/rcs/rcsutil.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsutil.h,v 1.13 2008/01/04 13:45:24 chl Exp $ */
+/* $OpenBSD: rcsutil.h,v 1.14 2010/07/23 08:31:19 ray Exp $ */
/*
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
* All rights reserved.
@@ -36,11 +36,11 @@ struct rcs_line {
TAILQ_ENTRY(rcs_line) l_list;
};
-TAILQ_HEAD(rcs_tqh, rcs_line);
+TAILQ_HEAD(tqh, rcs_line);
struct rcs_lines {
int l_nblines;
- struct rcs_tqh l_lines;
+ struct tqh l_lines;
};
struct rcs_argvector {
diff --git a/usr.bin/rcs/worklist.c b/usr.bin/rcs/worklist.c
index 9f5fa6f86fe..5a843b236f4 100644
--- a/usr.bin/rcs/worklist.c
+++ b/usr.bin/rcs/worklist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: worklist.c,v 1.2 2007/02/27 07:59:13 xsa Exp $ */
+/* $OpenBSD: worklist.c,v 1.3 2010/07/23 08:31:19 ray Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -38,17 +38,17 @@
* adds a path to a worklist.
*/
void
-rcs_worklist_add(const char *path, struct rcs_wklhead *worklist)
+worklist_add(const char *path, struct wklhead *worklist)
{
size_t len;
- struct rcs_worklist *wkl;
+ struct worklist *wkl;
sigset_t old, new;
wkl = xcalloc(1, sizeof(*wkl));
len = strlcpy(wkl->wkl_path, path, sizeof(wkl->wkl_path));
if (len >= sizeof(wkl->wkl_path))
- errx(1, "path truncation in rcs_worklist_add");
+ errx(1, "path truncation in worklist_add");
sigfillset(&new);
sigprocmask(SIG_BLOCK, &new, &old);
@@ -58,18 +58,18 @@ rcs_worklist_add(const char *path, struct rcs_wklhead *worklist)
/*
* run over the given worklist, calling cb for each element.
- * this is just like rcs_worklist_clean(), except we block signals first.
+ * this is just like worklist_clean(), except we block signals first.
*/
void
-rcs_worklist_run(struct rcs_wklhead *list, void (*cb)(struct rcs_worklist *))
+worklist_run(struct wklhead *list, void (*cb)(struct worklist *))
{
sigset_t old, new;
- struct rcs_worklist *wkl;
+ struct worklist *wkl;
sigfillset(&new);
sigprocmask(SIG_BLOCK, &new, &old);
- rcs_worklist_clean(list, cb);
+ worklist_clean(list, cb);
while ((wkl = SLIST_FIRST(list)) != NULL) {
SLIST_REMOVE_HEAD(list, wkl_list);
@@ -83,16 +83,16 @@ rcs_worklist_run(struct rcs_wklhead *list, void (*cb)(struct rcs_worklist *))
* pass elements to the specified callback, which has to be signal safe.
*/
void
-rcs_worklist_clean(struct rcs_wklhead *list, void (*cb)(struct rcs_worklist *))
+worklist_clean(struct wklhead *list, void (*cb)(struct worklist *))
{
- struct rcs_worklist *wkl;
+ struct worklist *wkl;
SLIST_FOREACH(wkl, list, wkl_list)
cb(wkl);
}
void
-rcs_worklist_unlink(struct rcs_worklist *wkl)
+worklist_unlink(struct worklist *wkl)
{
(void)unlink(wkl->wkl_path);
}
diff --git a/usr.bin/rcs/worklist.h b/usr.bin/rcs/worklist.h
index a3ff34b8487..40a9b125019 100644
--- a/usr.bin/rcs/worklist.h
+++ b/usr.bin/rcs/worklist.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: worklist.h,v 1.2 2007/02/27 07:59:13 xsa Exp $ */
+/* $OpenBSD: worklist.h,v 1.3 2010/07/23 08:31:19 ray Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -29,19 +29,19 @@
#include <sys/param.h>
-struct rcs_worklist {
- char wkl_path[MAXPATHLEN];
- volatile SLIST_ENTRY(rcs_worklist) wkl_list;
+struct worklist {
+ char wkl_path[MAXPATHLEN];
+ volatile SLIST_ENTRY(worklist) wkl_list;
};
-SLIST_HEAD(rcs_wklhead, rcs_worklist);
+SLIST_HEAD(wklhead, worklist);
-void rcs_worklist_add(const char *, struct rcs_wklhead *);
-void rcs_worklist_run(struct rcs_wklhead *, void (*cb)(struct rcs_worklist *));
-void rcs_worklist_clean(struct rcs_wklhead *, void (*cb)(struct rcs_worklist *));
+void worklist_add(const char *, struct wklhead *);
+void worklist_run(struct wklhead *, void (*cb)(struct worklist *));
+void worklist_clean(struct wklhead *, void (*cb)(struct worklist *));
-void rcs_worklist_unlink(struct rcs_worklist *);
+void worklist_unlink(struct worklist *);
-extern struct rcs_wklhead rcs_temp_files;
+extern struct wklhead temp_files;
#endif