summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcsprog.h
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-04-12 08:23:31 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-04-12 08:23:31 +0000
commitd168187781096ebce8875465a1ac0d8ef42bdef8 (patch)
tree16ed20858dec9d8349da6c6d839bb2bb8526fc6e /usr.bin/rcs/rcsprog.h
parentd9349acd8c7813ac3bc17ef771803b40fdf1bcbc (diff)
Clean up <rev> handling. Whenever a revision is specified after a
flag, it calls one of two new functions: rcs_setrevstr() or rcs_setrevstr2(). rcs_setrevstr() sets a string to another string, and complains if it was set more than once. rcs_setrevstr2() takes two strings, sets one after the other, and fatal()s if more than two strings were given. All <rev> handling is now done in the loop that goes through each argv. This is necessary for parsing symbols, which will be much easier after this. Along the way a lot of memory leaks were cleaned up. There is one area where rcs_set_rev() is called, which allocates a RCSNUM and stores it in pb.newrev, but it segfaults whenever I try to rcsnum_free() it. I put an /* XXX */ comment there for now. Passes regression tests and the code is less complicated in some ways (to me). Suggestions and OK xsa@
Diffstat (limited to 'usr.bin/rcs/rcsprog.h')
-rw-r--r--usr.bin/rcs/rcsprog.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/rcs/rcsprog.h b/usr.bin/rcs/rcsprog.h
index 2e99a90f8e0..1810c6bf085 100644
--- a/usr.bin/rcs/rcsprog.h
+++ b/usr.bin/rcs/rcsprog.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.h,v 1.43 2006/04/09 19:22:23 niallo Exp $ */
+/* $OpenBSD: rcsprog.h,v 1.44 2006/04/12 08:23:30 ray Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -113,6 +113,8 @@ char *rcs_choosefile(const char *);
int rcs_statfile(char *, char *, size_t);
time_t rcs_get_mtime(const char *);
void rcs_set_rev(const char *, RCSNUM **);
+void rcs_setrevstr(char **, char *);
+void rcs_setrevstr2(char **, char **, char *);
void rcs_usage(void);
void (*usage)(void);