prefixes to reduce differences between cvs and rcs files.
"yes!" nicm
-/* $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.
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));
-/* $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>
__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;
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)
-/* $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.
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;
-/* $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>
close(fd1);
close(fd2);
- cvs_worklist_run(&temp_files, cvs_worklist_unlink);
+ worklist_run(&temp_files, worklist_unlink);
if (p1 != NULL)
xfree(p1);
-/* $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.
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);
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)
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);
-/* $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>
*
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;
-/* $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.
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));
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);
}
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)
/* last line is gone - reset dlp */
if (dlp == NULL) {
ndlp = TAILQ_LAST(&(dlines->l_lines),
- cvs_tqh);
+ tqh);
dlp = ndlp;
}
}
* 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;
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)
-/* $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>
*
#include "cvs.h"
-struct cvs_wklhead repo_locks;
+struct wklhead repo_locks;
void
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
}
(void)close(i);
- cvs_worklist_add(fpath, &repo_locks);
+ worklist_add(fpath, &repo_locks);
}
void
#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);
-/* $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.
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 {
-/* $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.
* 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);
/*
* 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);
* 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);
}
-/* $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.
#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
-/* $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.
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);
-/* $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.
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)
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);
-/* $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.
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));
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)
/* last line is gone - reset dlp */
if (dlp == NULL) {
ndlp = TAILQ_LAST(&(dlines->l_lines),
- rcs_tqh);
+ tqh);
dlp = ndlp;
}
}
* 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;
-/* $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.
{ "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 *);
void
sighdlr(int sig)
{
- rcs_worklist_clean(&rcs_temp_files, rcs_worklist_unlink);
+ worklist_clean(&temp_files, worklist_unlink);
_exit(1);
}
ret = -1;
rcs_optind = 1;
- SLIST_INIT(&rcs_temp_files);
+ SLIST_INIT(&temp_files);
cmd_argc = build_cmd(&cmd_argv, argv, argc);
}
/* clean up temporary files */
- rcs_worklist_run(&rcs_temp_files, rcs_worklist_unlink);
+ worklist_run(&temp_files, worklist_unlink);
exit(ret);
}
-/* $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.
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 *);
-/* $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.
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 {
-/* $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.
* 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);
/*
* 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);
* 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);
}
-/* $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.
#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