diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2010-07-23 08:31:20 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2010-07-23 08:31:20 +0000 |
commit | 114cf9476ebb86dcd4bd420266b9055ff9918c2e (patch) | |
tree | 31a73dd5949d81e3f8869aaee2bda7b2c5e02f14 /usr.bin | |
parent | bdce6a57594ade4892765a7f2a617b93b6f688bb (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')
-rw-r--r-- | usr.bin/cvs/buf.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.h | 4 | ||||
-rw-r--r-- | usr.bin/cvs/diff.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/diff3.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/logmsg.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/rcs.c | 15 | ||||
-rw-r--r-- | usr.bin/cvs/repository.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/repository.h | 2 | ||||
-rw-r--r-- | usr.bin/cvs/util.h | 6 | ||||
-rw-r--r-- | usr.bin/cvs/worklist.c | 22 | ||||
-rw-r--r-- | usr.bin/cvs/worklist.h | 18 | ||||
-rw-r--r-- | usr.bin/rcs/buf.c | 4 | ||||
-rw-r--r-- | usr.bin/rcs/diff3.c | 6 | ||||
-rw-r--r-- | usr.bin/rcs/rcs.c | 10 | ||||
-rw-r--r-- | usr.bin/rcs/rcsprog.c | 10 | ||||
-rw-r--r-- | usr.bin/rcs/rcsprog.h | 4 | ||||
-rw-r--r-- | usr.bin/rcs/rcsutil.h | 6 | ||||
-rw-r--r-- | usr.bin/rcs/worklist.c | 22 | ||||
-rw-r--r-- | usr.bin/rcs/worklist.h | 20 |
20 files changed, 92 insertions, 93 deletions
diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c index 1c402c47cca..baf9baa2c6d 100644 --- a/usr.bin/cvs/buf.c +++ b/usr.bin/cvs/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.74 2009/03/25 21:19:20 joris Exp $ */ +/* $OpenBSD: buf.c,v 1.75 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -218,7 +218,7 @@ cvs_buf_write_stmp(BUF *b, char *template, struct timeval *tv) fatal("cvs_buf_write_stmp: futimes failed"); } - cvs_worklist_add(template, &temp_files); + worklist_add(template, &temp_files); if (lseek(fd, 0, SEEK_SET) < 0) fatal("cvs_buf_write_stmp: lseek: %s", strerror(errno)); diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index 25d2d6efe62..82b22ab5c72 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.150 2008/06/21 15:39:15 joris Exp $ */ +/* $OpenBSD: cvs.c,v 1.151 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2006, 2007 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -73,7 +73,7 @@ int cvs_getopt(int, char **); __dead void usage(void); static void cvs_read_rcfile(void); -struct cvs_wklhead temp_files; +struct wklhead temp_files; void sighandler(int); volatile sig_atomic_t cvs_quit = 0; @@ -104,10 +104,10 @@ void cvs_cleanup(void) { cvs_log(LP_TRACE, "cvs_cleanup: removing locks"); - cvs_worklist_run(&repo_locks, cvs_worklist_unlink); + worklist_run(&repo_locks, worklist_unlink); cvs_log(LP_TRACE, "cvs_cleanup: removing temp files"); - cvs_worklist_run(&temp_files, cvs_worklist_unlink); + worklist_run(&temp_files, worklist_unlink); if (cvs_server_path != NULL) { if (cvs_rmdir(cvs_server_path) == -1) diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index b45fd8220a3..f0edcf20380 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.176 2009/03/25 21:19:20 joris Exp $ */ +/* $OpenBSD: cvs.h,v 1.177 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -279,7 +279,7 @@ extern struct module_checkout *current_module; extern char *module_repo_root; extern struct ignore_head checkout_ign_pats; -extern struct cvs_wklhead temp_files; +extern struct wklhead temp_files; extern volatile sig_atomic_t sig_received; extern volatile sig_atomic_t cvs_quit; extern struct cvsroot *current_cvsroot; diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index 956aa0470a1..0fd878d7ad6 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.155 2009/06/07 08:39:13 ray Exp $ */ +/* $OpenBSD: diff.c,v 1.156 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2008 Tobias Stoeckmann <tobias@openbsd.org> * Copyright (c) 2006 Joris Vink <joris@openbsd.org> @@ -574,7 +574,7 @@ cvs_diff_local(struct cvs_file *cf) close(fd1); close(fd2); - cvs_worklist_run(&temp_files, cvs_worklist_unlink); + worklist_run(&temp_files, worklist_unlink); if (p1 != NULL) xfree(p1); diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c index 3a9339aaf54..7bbc01da0b2 100644 --- a/usr.bin/cvs/diff3.c +++ b/usr.bin/cvs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.51 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: diff3.c,v 1.52 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -264,7 +264,7 @@ cvs_merge_file(struct cvs_file *cf, int verbose) for (i = 0; i < 3; i++) fclose(fp[i]); - cvs_worklist_run(&temp_files, cvs_worklist_unlink); + worklist_run(&temp_files, worklist_unlink); xfree(path1); xfree(path2); @@ -375,7 +375,7 @@ ed_patch_lines(struct cvs_lines *dlines, struct cvs_lines *plines) if (dlp->l_lineno == start) break; if (dlp->l_lineno > start) { - dlp = TAILQ_PREV(dlp, cvs_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) @@ -389,7 +389,7 @@ ed_patch_lines(struct cvs_lines *dlines, struct cvs_lines *plines) if (op == 'c') { - insert_after = TAILQ_PREV(dlp, cvs_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/cvs/logmsg.c b/usr.bin/cvs/logmsg.c index 90aeaa816e4..f817f729342 100644 --- a/usr.bin/cvs/logmsg.c +++ b/usr.bin/cvs/logmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: logmsg.c,v 1.52 2009/03/25 21:50:33 joris Exp $ */ +/* $OpenBSD: logmsg.c,v 1.53 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2007 Joris Vink <joris@openbsd.org> * @@ -114,7 +114,7 @@ cvs_logmsg_create(char *dir, struct cvs_flisthead *added, if ((fd = mkstemp(fpath)) == -1) fatal("cvs_logmsg_create: mkstemp %s", strerror(errno)); - cvs_worklist_add(fpath, &temp_files); + worklist_add(fpath, &temp_files); if ((fp = fdopen(fd, "w")) == NULL) { saved_errno = errno; diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 41281ffb423..d14cceed78c 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.295 2010/07/21 09:22:17 ray Exp $ */ +/* $OpenBSD: rcs.c,v 1.296 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -399,7 +399,7 @@ rcs_write(RCSFILE *rfp) fatal("fdopen %s: %s", fn, strerror(saved_errno)); } - cvs_worklist_add(fn, &temp_files); + worklist_add(fn, &temp_files); if (rfp->rf_head != NULL) rcsnum_tostr(rfp->rf_head, numbuf, sizeof(numbuf)); @@ -496,9 +496,8 @@ rcs_write(RCSFILE *rfp) fputc('\n', fp); } fputs("@\ntext\n@", fp); - if (rdp->rd_text != NULL) { + if (rdp->rd_text != NULL) rcs_strprint(rdp->rd_text, rdp->rd_tlen, fp); - } fputs("@\n", fp); } @@ -1065,7 +1064,7 @@ rcs_patch_lines(struct cvs_lines *dlines, struct cvs_lines *plines, if (dlp->l_lineno == lineno) break; if (dlp->l_lineno > lineno) { - dlp = TAILQ_PREV(dlp, cvs_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) @@ -1090,7 +1089,7 @@ rcs_patch_lines(struct cvs_lines *dlines, struct cvs_lines *plines, /* last line is gone - reset dlp */ if (dlp == NULL) { ndlp = TAILQ_LAST(&(dlines->l_lines), - cvs_tqh); + tqh); dlp = ndlp; } } @@ -1333,7 +1332,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, cvs_tqh, rd_list); + nextrdp = (struct rcs_delta *)TAILQ_PREV(rdp, tqh, rd_list); newdeltatext = NULL; prevbuf = NULL; @@ -3148,7 +3147,7 @@ rcs_rev_write_stmp(RCSFILE *rfp, RCSNUM *rev, char *template, int mode) if ((fd = mkstemp(template)) == -1) fatal("mkstemp: `%s': %s", template, strerror(errno)); - cvs_worklist_add(template, &temp_files); + worklist_add(template, &temp_files); rcs_rev_write_fd(rfp, rev, fd, mode); if (lseek(fd, 0, SEEK_SET) < 0) diff --git a/usr.bin/cvs/repository.c b/usr.bin/cvs/repository.c index ebe88c0d3b2..c2df4be05e6 100644 --- a/usr.bin/cvs/repository.c +++ b/usr.bin/cvs/repository.c @@ -1,4 +1,4 @@ -/* $OpenBSD: repository.c,v 1.22 2009/03/26 22:54:37 joris Exp $ */ +/* $OpenBSD: repository.c,v 1.23 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -25,7 +25,7 @@ #include "cvs.h" -struct cvs_wklhead repo_locks; +struct wklhead repo_locks; void cvs_repository_unlock(const char *repo) @@ -37,7 +37,7 @@ cvs_repository_unlock(const char *repo) (void)xsnprintf(fpath, sizeof(fpath), "%s/%s", repo, CVS_LOCK); /* XXX - this ok? */ - cvs_worklist_run(&repo_locks, cvs_worklist_unlink); + worklist_run(&repo_locks, worklist_unlink); } void @@ -91,7 +91,7 @@ cvs_repository_lock(const char *repo, int wantlock) } (void)close(i); - cvs_worklist_add(fpath, &repo_locks); + worklist_add(fpath, &repo_locks); } void diff --git a/usr.bin/cvs/repository.h b/usr.bin/cvs/repository.h index bcf47e043fe..152ab07fbd0 100644 --- a/usr.bin/cvs/repository.h +++ b/usr.bin/cvs/repository.h @@ -25,7 +25,7 @@ #define REPOSITORY_DODIRS 0x01 #define REPOSITORY_IS_ATTIC 0x02 -extern struct cvs_wklhead repo_locks; +extern struct wklhead repo_locks; void cvs_repository_unlock(const char *); void cvs_repository_lock(const char *, int); diff --git a/usr.bin/cvs/util.h b/usr.bin/cvs/util.h index 867f5f98177..2ead529e144 100644 --- a/usr.bin/cvs/util.h +++ b/usr.bin/cvs/util.h @@ -1,4 +1,4 @@ -/* $OpenBSD: util.h,v 1.26 2008/06/12 07:16:14 joris Exp $ */ +/* $OpenBSD: util.h,v 1.27 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2006 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -54,11 +54,11 @@ struct cvs_line { TAILQ_ENTRY(cvs_line) l_list; }; -TAILQ_HEAD(cvs_tqh, cvs_line); +TAILQ_HEAD(tqh, cvs_line); struct cvs_lines { int l_nblines; - struct cvs_tqh l_lines; + struct tqh l_lines; }; struct cvs_argvector { diff --git a/usr.bin/cvs/worklist.c b/usr.bin/cvs/worklist.c index 0491b054f3a..492bea99a95 100644 --- a/usr.bin/cvs/worklist.c +++ b/usr.bin/cvs/worklist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: worklist.c,v 1.6 2007/02/22 06:42:10 otto Exp $ */ +/* $OpenBSD: worklist.c,v 1.7 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -33,17 +33,17 @@ * adds a path to a worklist. */ void -cvs_worklist_add(const char *path, struct cvs_wklhead *worklist) +worklist_add(const char *path, struct wklhead *worklist) { size_t len; - struct cvs_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)) - fatal("path truncation in cvs_worklist_add"); + fatal("path truncation in worklist_add"); sigfillset(&new); sigprocmask(SIG_BLOCK, &new, &old); @@ -53,18 +53,18 @@ cvs_worklist_add(const char *path, struct cvs_wklhead *worklist) /* * run over the given worklist, calling cb for each element. - * this is just like cvs_worklist_clean(), except we block signals first. + * this is just like worklist_clean(), except we block signals first. */ void -cvs_worklist_run(struct cvs_wklhead *list, void (*cb)(struct cvs_worklist *)) +worklist_run(struct wklhead *list, void (*cb)(struct worklist *)) { sigset_t old, new; - struct cvs_worklist *wkl; + struct worklist *wkl; sigfillset(&new); sigprocmask(SIG_BLOCK, &new, &old); - cvs_worklist_clean(list, cb); + worklist_clean(list, cb); while ((wkl = SLIST_FIRST(list)) != NULL) { SLIST_REMOVE_HEAD(list, wkl_list); @@ -78,16 +78,16 @@ cvs_worklist_run(struct cvs_wklhead *list, void (*cb)(struct cvs_worklist *)) * pass elements to the specified callback, which has to be signal safe. */ void -cvs_worklist_clean(struct cvs_wklhead *list, void (*cb)(struct cvs_worklist *)) +worklist_clean(struct wklhead *list, void (*cb)(struct worklist *)) { - struct cvs_worklist *wkl; + struct worklist *wkl; SLIST_FOREACH(wkl, list, wkl_list) cb(wkl); } void -cvs_worklist_unlink(struct cvs_worklist *wkl) +worklist_unlink(struct worklist *wkl) { (void)unlink(wkl->wkl_path); } diff --git a/usr.bin/cvs/worklist.h b/usr.bin/cvs/worklist.h index bba8d9f0d86..d2eaa533d21 100644 --- a/usr.bin/cvs/worklist.h +++ b/usr.bin/cvs/worklist.h @@ -1,4 +1,4 @@ -/* $OpenBSD: worklist.h,v 1.6 2007/02/22 06:42:10 otto Exp $ */ +/* $OpenBSD: worklist.h,v 1.7 2010/07/23 08:31:19 ray Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -29,17 +29,17 @@ #include <sys/param.h> -struct cvs_worklist { - char wkl_path[MAXPATHLEN]; - volatile SLIST_ENTRY(cvs_worklist) wkl_list; +struct worklist { + char wkl_path[MAXPATHLEN]; + volatile SLIST_ENTRY(worklist) wkl_list; }; -SLIST_HEAD(cvs_wklhead, cvs_worklist); +SLIST_HEAD(wklhead, worklist); -void cvs_worklist_add(const char *, struct cvs_wklhead *); -void cvs_worklist_run(struct cvs_wklhead *, void (*cb)(struct cvs_worklist *)); -void cvs_worklist_clean(struct cvs_wklhead *, void (*cb)(struct cvs_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 cvs_worklist_unlink(struct cvs_worklist *); +void worklist_unlink(struct worklist *); #endif 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 |