budb-prototypes-20090316
[openafs.git] / src / budb / db_text.c
index ab21aea..860a8ea 100644 (file)
@@ -29,6 +29,7 @@ RCSID
 #include "budb_errs.h"
 #include "database.h"
 #include "error_macros.h"
+#include "budb_prototypes.h"
 #include "afs/audit.h"
 #include <afs/afsutil.h>
 
@@ -43,18 +44,16 @@ RCSID
  *     routine mallocs storage for charListPtr, freed by stub
  */
 
-afs_int32 GetText(), GetTextVersion(), SaveText();
+afs_int32 GetText(struct rx_call *, afs_uint32, afs_int32, afs_int32, 
+                 afs_int32, afs_int32 *, charListT *);
+afs_int32 GetTextVersion(struct rx_call *, afs_int32, afs_uint32 *);
+afs_int32 SaveText(struct rx_call *, afs_uint32, afs_int32, afs_int32,
+                  afs_int32, charListT *);
 
 afs_int32
-SBUDB_GetText(call, lockHandle, textType, maxLength, offset, nextOffset,
-             charListPtr)
-     struct rx_call *call;
-     afs_uint32 lockHandle;
-     afs_int32 textType;
-     afs_int32 maxLength;
-     afs_int32 offset;
-     afs_int32 *nextOffset;
-     charListT *charListPtr;
+SBUDB_GetText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType,
+             afs_int32 maxLength, afs_int32 offset, afs_int32 *nextOffset,
+             charListT *charListPtr)
 {
     afs_int32 code;
 
@@ -66,15 +65,9 @@ SBUDB_GetText(call, lockHandle, textType, maxLength, offset, nextOffset,
 }
 
 afs_int32
-GetText(call, lockHandle, textType, maxLength, offset, nextOffset,
-       charListPtr)
-     struct rx_call *call;
-     afs_uint32 lockHandle;
-     afs_int32 textType;
-     afs_int32 maxLength;
-     afs_int32 offset;
-     afs_int32 *nextOffset;
-     charListT *charListPtr;
+GetText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType, 
+       afs_int32 maxLength, afs_int32 offset, afs_int32 *nextOffset,
+       charListT *charListPtr)
 {
     struct ubik_trans *ut = 0;
     struct block block;
@@ -188,7 +181,7 @@ GetText(call, lockHandle, textType, maxLength, offset, nextOffset,
        *nextOffset = -1;
     }
 
-  error_exit:
+  /* error_exit: */
     code = ubik_EndTrans(ut);
 /*  printf("in error exit, code=%ld\n", code); */
     return (code);
@@ -204,13 +197,12 @@ GetText(call, lockHandle, textType, maxLength, offset, nextOffset,
     return (code);
 }
 
-freeOldBlockChain(ut, diskAddr)
-     struct ubik_trans *ut;
-     dbadr diskAddr;
+int
+freeOldBlockChain(struct ubik_trans *ut, dbadr diskAddr)
 {
     struct blockHeader blockHeader;
     dbadr nextDiskAddr;
-    afs_int32 code;
+    afs_int32 code = 0;
 
     while (diskAddr != 0) {
        /* read in the header */
@@ -233,10 +225,8 @@ freeOldBlockChain(ut, diskAddr)
  */
 
 afs_int32
-SBUDB_GetTextVersion(call, textType, tversion)
-     struct rx_call *call;
-     afs_int32 textType;
-     afs_uint32 *tversion;
+SBUDB_GetTextVersion(struct rx_call *call, afs_int32 textType, 
+                    afs_uint32 *tversion)
 {
     afs_int32 code;
 
@@ -246,10 +236,8 @@ SBUDB_GetTextVersion(call, textType, tversion)
 }
 
 afs_int32
-GetTextVersion(call, textType, tversion)
-     struct rx_call *call;
-     afs_int32 textType;
-     afs_uint32 *tversion;
+GetTextVersion(struct rx_call *call, afs_int32 textType, 
+              afs_uint32 *tversion)
 {
     afs_int32 code;
     struct ubik_trans *ut;
@@ -280,13 +268,9 @@ GetTextVersion(call, textType, tversion)
  */
 
 afs_int32
-SBUDB_SaveText(call, lockHandle, textType, offset, flags, charListPtr)
-     struct rx_call *call;
-     afs_uint32 lockHandle;
-     afs_int32 textType;
-     afs_int32 offset;
-     afs_int32 flags;
-     charListT *charListPtr;
+SBUDB_SaveText(struct rx_call *call, afs_uint32 lockHandle, 
+              afs_int32 textType, afs_int32 offset, afs_int32 flags,
+              charListT *charListPtr)
 {
     afs_int32 code;
 
@@ -296,13 +280,8 @@ SBUDB_SaveText(call, lockHandle, textType, offset, flags, charListPtr)
 }
 
 afs_int32
-SaveText(call, lockHandle, textType, offset, flags, charListPtr)
-     struct rx_call *call;
-     afs_uint32 lockHandle;
-     afs_int32 textType;
-     afs_int32 offset;
-     afs_int32 flags;
-     charListT *charListPtr;
+SaveText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType, 
+        afs_int32 offset, afs_int32 flags, charListT *charListPtr)
 {
     struct ubik_trans *ut;
     struct block diskBlock;
@@ -473,7 +452,7 @@ SaveText(call, lockHandle, textType, offset, flags, charListPtr)
     if (code)
        ABORT(code);
 
-  error_exit:
+/*error_exit: */
     code = ubik_EndTrans(ut);
     return (code);
 
@@ -484,10 +463,7 @@ SaveText(call, lockHandle, textType, offset, flags, charListPtr)
 
 /* debug support */
 void
-saveTextToFile(ut, tbPtr)
-     struct ubik_trans *ut;
-     struct textBlock *tbPtr;
-
+saveTextToFile(struct ubik_trans *ut, struct textBlock *tbPtr)
 {
     afs_int32 blockAddr;
     struct block block;
@@ -526,8 +502,7 @@ saveTextToFile(ut, tbPtr)
  */
 
 int
-mkstemp(st)
-     char *st;
+mkstemp(char *st)
 {
     int retval = -1;