summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-05-20 19:21:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-05-20 19:21:11 +0000
commitaff333a19fa881f52475c7f352eb57ea44dd7e52 (patch)
tree5dff54f03cd702649908c1a843dcacda3e1a3b60
parent32dbf68cc6dcbdd07ed1076c10c5c5e7f32039bd (diff)
Remove a bunch of unused functions, from Michael W Bombardieri.
ok ray
-rw-r--r--usr.bin/rcs/rcs.c195
-rw-r--r--usr.bin/rcs/rcs.h10
-rw-r--r--usr.bin/rcs/rcsnum.c19
3 files changed, 3 insertions, 221 deletions
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index f818fd8c65c..98f519a9241 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.75 2011/04/20 19:34:16 nicm Exp $ */
+/* $OpenBSD: rcs.c,v 1.76 2011/05/20 19:21:10 nicm Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -50,75 +50,6 @@ static const char rcs_state_invch[] = RCS_STATE_INVALCHAR;
/* invalid characters in RCS symbol names */
static const char rcs_sym_invch[] = RCS_SYM_INVALCHAR;
-/* comment leaders, depending on the file's suffix */
-static const struct rcs_comment {
- const char *rc_suffix;
- const char *rc_cstr;
-} rcs_comments[] = {
- { "1", ".\\\" " },
- { "2", ".\\\" " },
- { "3", ".\\\" " },
- { "4", ".\\\" " },
- { "5", ".\\\" " },
- { "6", ".\\\" " },
- { "7", ".\\\" " },
- { "8", ".\\\" " },
- { "9", ".\\\" " },
- { "a", "-- " }, /* Ada */
- { "ada", "-- " },
- { "adb", "-- " },
- { "asm", ";; " }, /* assembler (MS-DOS) */
- { "ads", "-- " }, /* Ada */
- { "bat", ":: " }, /* batch (MS-DOS) */
- { "body", "-- " }, /* Ada */
- { "c", " * " }, /* C */
- { "c++", "// " }, /* C++ */
- { "cc", "// " },
- { "cpp", "// " },
- { "cxx", "// " },
- { "m", "// " }, /* Objective-C */
- { "cl", ";;; " }, /* Common Lisp */
- { "cmd", ":: " }, /* command (OS/2) */
- { "cmf", "c " }, /* CM Fortran */
- { "csh", "# " }, /* shell */
- { "e", "# " }, /* efl */
- { "epsf", "% " }, /* encapsulated postscript */
- { "epsi", "% " }, /* encapsulated postscript */
- { "el", "; " }, /* Emacs Lisp */
- { "f", "c " }, /* Fortran */
- { "for", "c " },
- { "h", " * " }, /* C-header */
- { "hh", "// " }, /* C++ header */
- { "hpp", "// " },
- { "hxx", "// " },
- { "in", "# " }, /* for Makefile.in */
- { "l", " * " }, /* lex */
- { "mac", ";; " }, /* macro (DEC-10, MS-DOS, PDP-11, VMS, etc) */
- { "mak", "# " }, /* makefile, e.g. Visual C++ */
- { "me", ".\\\" " }, /* me-macros t/nroff */
- { "ml", "; " }, /* mocklisp */
- { "mm", ".\\\" " }, /* mm-macros t/nroff */
- { "ms", ".\\\" " }, /* ms-macros t/nroff */
- { "man", ".\\\" " }, /* man-macros t/nroff */
- { "p", " * " }, /* pascal */
- { "pas", " * " },
- { "pl", "# " }, /* Perl (conflict with Prolog) */
- { "pm", "# " }, /* Perl module */
- { "ps", "% " }, /* postscript */
- { "psw", "% " }, /* postscript wrap */
- { "pswm", "% " }, /* postscript wrap */
- { "r", "# " }, /* ratfor */
- { "rc", " * " }, /* Microsoft Windows resource file */
- { "red", "% " }, /* psl/rlisp */
- { "sh", "# " }, /* shell */
- { "sl", "% " }, /* psl */
- { "spec", "-- " }, /* Ada */
- { "tex", "% " }, /* tex */
- { "y", " * " }, /* yacc */
- { "ye", " * " }, /* yacc-efl */
- { "yr", " * " }, /* yacc-ratfor */
-};
-
struct rcs_kw rcs_expkw[] = {
{ "Author", RCS_KW_AUTHOR },
{ "Date", RCS_KW_DATE },
@@ -133,19 +64,6 @@ struct rcs_kw rcs_expkw[] = {
{ "State", RCS_KW_STATE },
};
-#define NB_COMTYPES (sizeof(rcs_comments)/sizeof(rcs_comments[0]))
-
-static const char *rcs_errstrs[] = {
- "No error",
- "No such entry",
- "Duplicate entry found",
- "Bad RCS number",
- "Invalid RCS symbol",
- "Parse error",
-};
-
-#define RCS_NERR (sizeof(rcs_errstrs)/sizeof(rcs_errstrs[0]))
-
int rcs_errno = RCS_ERR_NOERR;
char *timezone_flag = NULL;
@@ -510,17 +428,6 @@ out:
}
/*
- * rcs_head_get()
- *
- * Retrieve the revision number of the head revision for the RCS file <file>.
- */
-const RCSNUM *
-rcs_head_get(RCSFILE *file)
-{
- return (file->rf_head);
-}
-
-/*
* rcs_head_set()
*
* Set the revision number of the head revision for the RCS file <file> to
@@ -555,23 +462,6 @@ rcs_branch_get(RCSFILE *file)
}
/*
- * rcs_branch_set()
- *
- * Set the default branch for the RCS file <file> to <bnum>.
- * Returns 0 on success, -1 on failure.
- */
-int
-rcs_branch_set(RCSFILE *file, const RCSNUM *bnum)
-{
- if (file->rf_branch == NULL)
- file->rf_branch = rcsnum_alloc();
-
- rcsnum_cpy(bnum, file->rf_branch, 0);
- file->rf_flags &= ~RCS_SYNCED;
- return (0);
-}
-
-/*
* rcs_access_add()
*
* Add the login name <login> to the access list for the RCS file <file>.
@@ -864,17 +754,6 @@ rcs_lock_remove(RCSFILE *file, const char *user, RCSNUM *rev)
}
/*
- * rcs_desc_get()
- *
- * Retrieve the description for the RCS file <file>.
- */
-const char *
-rcs_desc_get(RCSFILE *file)
-{
- return (file->rf_desc);
-}
-
-/*
* rcs_desc_set()
*
* Set the description for the RCS file <file>.
@@ -892,41 +771,6 @@ rcs_desc_set(RCSFILE *file, const char *desc)
}
/*
- * rcs_comment_lookup()
- *
- * Lookup the assumed comment leader based on a file's suffix.
- * Returns a pointer to the string on success, or NULL on failure.
- */
-const char *
-rcs_comment_lookup(const char *filename)
-{
- int i;
- const char *sp;
-
- if ((sp = strrchr(filename, '.')) == NULL) {
- rcs_errno = RCS_ERR_NOENT;
- return (NULL);
- }
- sp++;
-
- for (i = 0; i < (int)NB_COMTYPES; i++)
- if (strcmp(rcs_comments[i].rc_suffix, sp) == 0)
- return (rcs_comments[i].rc_cstr);
- return (NULL);
-}
-
-/*
- * rcs_comment_get()
- *
- * Retrieve the comment leader for the RCS file <file>.
- */
-const char *
-rcs_comment_get(RCSFILE *file)
-{
- return (file->rf_comment);
-}
-
-/*
* rcs_comment_set()
*
* Set the comment leader for the RCS file <file>.
@@ -1564,25 +1408,6 @@ rcs_kflag_get(const char *flags)
}
/*
- * rcs_errstr()
- *
- * Get the error string matching the RCS error code <code>.
- */
-const char *
-rcs_errstr(int code)
-{
- const char *esp;
-
- if (code < 0 || (code >= (int)RCS_NERR && code != RCS_ERR_ERRNO))
- esp = NULL;
- else if (code == RCS_ERR_ERRNO)
- esp = strerror(errno);
- else
- esp = rcs_errstrs[code];
- return (esp);
-}
-
-/*
* rcs_freedelta()
*
* Free the contents of a delta structure.
@@ -2004,24 +1829,6 @@ rcs_state_check(const char *state)
}
/*
- * rcs_state_get()
- *
- * Get the state for a given revision of a specified RCSFILE.
- *
- * Returns NULL on failure.
- */
-const char *
-rcs_state_get(RCSFILE *rfp, RCSNUM *rev)
-{
- struct rcs_delta *rdp;
-
- if ((rdp = rcs_findrev(rfp, rev)) == NULL)
- return (NULL);
-
- return (rdp->rd_state);
-}
-
-/*
* rcs_kwexp_buf()
*
* Do keyword expansion on a buffer if necessary
diff --git a/usr.bin/rcs/rcs.h b/usr.bin/rcs/rcs.h
index 1af66b21c8b..0d3197daae2 100644
--- a/usr.bin/rcs/rcs.h
+++ b/usr.bin/rcs/rcs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.h,v 1.13 2010/10/20 19:53:53 tobias Exp $ */
+/* $OpenBSD: rcs.h,v 1.14 2011/05/20 19:21:10 nicm Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -213,10 +213,8 @@ extern int rcs_errno;
RCSFILE *rcs_open(const char *, int, int, ...);
void rcs_close(RCSFILE *);
-const RCSNUM *rcs_head_get(RCSFILE *);
int rcs_head_set(RCSFILE *, RCSNUM *);
const RCSNUM *rcs_branch_get(RCSFILE *);
-int rcs_branch_set(RCSFILE *, const RCSNUM *);
int rcs_access_add(RCSFILE *, const char *);
int rcs_access_remove(RCSFILE *, const char *);
int rcs_access_check(RCSFILE *, const char *);
@@ -231,10 +229,7 @@ int rcs_lock_add(RCSFILE *, const char *, RCSNUM *);
int rcs_lock_remove(RCSFILE *, const char *, RCSNUM *);
BUF *rcs_getrev(RCSFILE *, RCSNUM *);
int rcs_deltatext_set(RCSFILE *, RCSNUM *, BUF *);
-const char *rcs_desc_get(RCSFILE *);
void rcs_desc_set(RCSFILE *, const char *);
-const char *rcs_comment_lookup(const char *);
-const char *rcs_comment_get(RCSFILE *);
void rcs_comment_set(RCSFILE *, const char *);
BUF *rcs_kwexp_buf(BUF *, RCSFILE *, RCSNUM *);
void rcs_kwexp_set(RCSFILE *, int);
@@ -245,9 +240,7 @@ time_t rcs_rev_getdate(RCSFILE *, RCSNUM *);
int rcs_rev_setlog(RCSFILE *, RCSNUM *, const char *);
int rcs_rev_remove(RCSFILE *, RCSNUM *);
int rcs_state_set(RCSFILE *, RCSNUM *, const char *);
-const char *rcs_state_get(RCSFILE *, RCSNUM *);
int rcs_state_check(const char *);
-const char *rcs_errstr(int);
void rcs_write(RCSFILE *);
void rcs_delta_stats(struct rcs_delta *, int *, int *);
@@ -260,7 +253,6 @@ RCSNUM *rcsnum_parse(const char *);
RCSNUM *rcsnum_brtorev(const RCSNUM *);
RCSNUM *rcsnum_revtobr(const RCSNUM *);
RCSNUM *rcsnum_inc(RCSNUM *);
-RCSNUM *rcsnum_dec(RCSNUM *);
void rcsnum_free(RCSNUM *);
int rcsnum_addmagic(RCSNUM *);
int rcsnum_aton(const char *, char **, RCSNUM *);
diff --git a/usr.bin/rcs/rcsnum.c b/usr.bin/rcs/rcsnum.c
index dc44ca2a769..cd599e80cae 100644
--- a/usr.bin/rcs/rcsnum.c
+++ b/usr.bin/rcs/rcsnum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsnum.c,v 1.12 2010/07/23 21:46:05 ray Exp $ */
+/* $OpenBSD: rcsnum.c,v 1.13 2011/05/20 19:21:10 nicm Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -351,23 +351,6 @@ rcsnum_inc(RCSNUM *num)
}
/*
- * rcsnum_dec()
- *
- * Decreases the revision number specified in <num>, if doing so will not
- * result in an ending value below 1. E.g. 4.2 will go to 4.1 but 4.1 will
- * be returned as 4.1.
- */
-RCSNUM *
-rcsnum_dec(RCSNUM *num)
-{
- /* XXX - Is it an error for the number to be 0? */
- if (num->rn_id[num->rn_len - 1] <= 1)
- return (num);
- num->rn_id[num->rn_len - 1]--;
- return (num);
-}
-
-/*
* rcsnum_revtobr()
*
* Retrieve the branch number associated with the revision number <num>.