summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-03 14:48:03 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-03 14:48:03 +0000
commit889cbc2c47b11af7cd369ba8fcb92c384a8f81e1 (patch)
tree904de9c99ddf375b09b61bd8dac1c3a84940c8dd
parent2ef2ef8277ff8fa75fecc3bf1c9a6eb7fd3e697d (diff)
Implement cvs_ent_remove()
-rw-r--r--usr.bin/cvs/entries.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index 8e7efd1e4e9..698f7409bda 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.8 2004/07/30 17:37:13 jfb Exp $ */
+/* $OpenBSD: entries.c,v 1.9 2004/08/03 14:48:02 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -232,6 +232,31 @@ cvs_ent_addln(CVSENTRIES *ef, const char *line)
/*
+ * cvs_ent_remove()
+ *
+ * Remove an entry from the Entries file <ef>. The entry's name is given
+ * by <name>.
+ */
+
+int
+cvs_ent_remove(CVSENTRIES *ef, const char *name)
+{
+ struct cvs_ent *ent;
+
+ ent = cvs_ent_get(ef, name);
+ if (ent == NULL)
+ return (-1);
+
+ TAILQ_REMOVE(&(ef->cef_ent), ent, ce_list);
+ cvs_ent_free(ent);
+
+ ef->cef_flags &= ~CVS_ENTF_SYNC;
+
+ return (0);
+}
+
+
+/*
* cvs_ent_get()
*
* Get the CVS entry from the Entries file <ef> whose 'name' portion matches