diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-12-16 17:16:19 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-12-16 17:16:19 +0000 |
commit | 13c1cb9b7af96bbfafa2bd70425a37d0114c9e70 (patch) | |
tree | 997943494dce4641e92f63d26877bc0b4fc57dad /usr.bin/cvs | |
parent | 45c14a0e694701b6ce1d3f6522651196bdef9297 (diff) |
Add rcs_gethead() to easily retrieve the head revision of an RCS
file.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/rcs.c | 14 | ||||
-rw-r--r-- | usr.bin/cvs/rcs.h | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 230f6b09cab..7dc2ddcf7f8 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.15 2004/12/07 17:10:56 tedu Exp $ */ +/* $OpenBSD: rcs.c,v 1.16 2004/12/16 17:16:18 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -624,6 +624,18 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *rev) /* + * rcs_gethead() + * + * Get the head revision for the RCS file <rf>. + */ +BUF* +rcs_gethead(RCSFILE *rf) +{ + return rcs_getrev(rf, rf->rf_head); +} + + +/* * rcs_getrevbydate() * * Get an RCS revision by a specific date. diff --git a/usr.bin/cvs/rcs.h b/usr.bin/cvs/rcs.h index d6ace23f5bd..2a1c17c3574 100644 --- a/usr.bin/cvs/rcs.h +++ b/usr.bin/cvs/rcs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.h,v 1.3 2004/12/15 05:09:06 jfb Exp $ */ +/* $OpenBSD: rcs.h,v 1.4 2004/12/16 17:16:18 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -131,6 +131,7 @@ int rcs_write (RCSFILE *); int rcs_addsym (RCSFILE *, const char *, RCSNUM *); int rcs_rmsym (RCSFILE *, const char *); BUF* rcs_getrev (RCSFILE *, RCSNUM *); +BUF* rcs_gethead (RCSFILE *); RCSNUM* rcs_getrevbydate (RCSFILE *, struct tm *); BUF* rcs_patch (const char *, const char *); |