summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/entries.c
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2008-02-09 20:04:01 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2008-02-09 20:04:01 +0000
commit8c24de380c7a47ce74567986a655e7fee381faee (patch)
tree2f0105446f420d2847ad1ae397acd324585ab699 /usr.bin/cvs/entries.c
parent06719c8f8958c753fac5525b73b73c502d342480 (diff)
Introduce cvs_ent_line_str() - formats CVS/Entries lines.
OK tobias@.
Diffstat (limited to 'usr.bin/cvs/entries.c')
-rw-r--r--usr.bin/cvs/entries.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index 1b6153a9d63..27f6af771cc 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.89 2008/02/09 17:01:43 tobias Exp $ */
+/* $OpenBSD: entries.c,v 1.90 2008/02/09 20:04:00 xsa Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -317,6 +317,25 @@ cvs_ent_remove(CVSENTRIES *ep, const char *name)
xfree(l);
}
+/*
+ * cvs_ent_line_str()
+ *
+ * Build CVS/Entries line.
+ *
+ */
+void
+cvs_ent_line_str(const char *name, char *rev, char *tstamp, char *opts,
+ char *sticky, int isdir, int isremoved, char *buf, size_t len)
+{
+ if (isdir == 1) {
+ (void)xsnprintf(buf, len, "D/%s////", name);
+ return;
+ }
+
+ (void)xsnprintf(buf, len, "/%s/%s%s/%s/%s/%s",
+ name, isremoved == 1 ? "-" : "", rev, tstamp, opts, sticky);
+}
+
void
cvs_ent_free(struct cvs_ent *ent)
{