From 2d68f6a3ef54f4c97ecd6e0561726fc5a89b5a04 Mon Sep 17 00:00:00 2001 From: Sean O'Malley Date: Fri, 5 Jan 2007 06:07:37 +0000 Subject: [PATCH] bucoord-protoize-20070104 FIXES 50870 protoize bucoord ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== FIXES 50870 undo redundant include ==================== FIXES 50870 protoize bucoord ==================== FIXES 50870 protoize bucoord --- src/bucoord/bc.p.h | 9 +++++ src/bucoord/bc_status.c | 5 +-- src/bucoord/commands.c | 2 - src/bucoord/config.c | 1 - src/bucoord/dlq.c | 59 +++++++++++++----------------- src/bucoord/dsstub.c | 95 ++++++++++++++++++------------------------------ src/bucoord/dsvs.c | 2 - src/bucoord/dump.c | 1 - src/bucoord/dump_sched.c | 2 - src/bucoord/expire.c | 1 - src/bucoord/main.c | 1 - src/bucoord/restore.c | 1 - src/bucoord/status.c | 2 - src/bucoord/tape_hosts.c | 1 - src/bucoord/ttest.c | 1 - src/bucoord/ubik_db_if.c | 49 ++++++++++--------------- src/bucoord/vol_sets.c | 1 - src/bucoord/volstub.c | 1 - 18 files changed, 90 insertions(+), 144 deletions(-) diff --git a/src/bucoord/bc.p.h b/src/bucoord/bc.p.h index b675fd3..4e385e2 100644 --- a/src/bucoord/bc.p.h +++ b/src/bucoord/bc.p.h @@ -10,6 +10,15 @@ #include #include +#ifdef HAVE_STDIO_H +#include +#endif /* HAVE_STDIO_H */ +#if defined(HAVE_STRING_H) +# include +#elif defined(HAVE_STRINGS_H) +# include +#endif /* HAVE_STRING_H */ + /* * Represents a host in the config database. */ diff --git a/src/bucoord/bc_status.c b/src/bucoord/bc_status.c index 0285f1a..4f6ebfc 100644 --- a/src/bucoord/bc_status.c +++ b/src/bucoord/bc_status.c @@ -8,18 +8,15 @@ */ #include -#include +#include RCSID ("$Header$"); -#include #include -#include #ifdef AFS_NT40_ENV #include #else -#include #include #include #include diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 78c36bb..844f24b 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -28,7 +28,6 @@ RCSID #include #include #include -#include #endif #include #include @@ -41,7 +40,6 @@ RCSID #include /* PA */ #include -#include #include #include #include diff --git a/src/bucoord/config.c b/src/bucoord/config.c index 43883ae..2801d59 100644 --- a/src/bucoord/config.c +++ b/src/bucoord/config.c @@ -21,7 +21,6 @@ RCSID #include #include #endif -#include #include #include "bc.h" diff --git a/src/bucoord/dlq.c b/src/bucoord/dlq.c index cc7c999..04f5a0d 100644 --- a/src/bucoord/dlq.c +++ b/src/bucoord/dlq.c @@ -8,15 +8,27 @@ */ #include -#include +#include #ifdef HAVE_STDLIB_H #include #endif RCSID ("$Header$"); - +#include "bc.h" #include +/* protos */ +int dlqEmpty(dlqlinkP ); +int dlqInit(dlqlinkP headptr); +int dlqLinkf(dlqlinkP, dlqlinkP ); +int dlqLinkb(dlqlinkP, dlqlinkP ); +void dlqUnlink( dlqlinkP ); +int dlqTraverseQueue(dlqlinkP, int *(), int *()); +int dlqCount(dlqlinkP ); +void dlqMoveb( dlqlinkP, dlqlinkP); +dlqlinkP dlqUnlinkb(dlqlinkP ); +dlqlinkP dlqUnlinkf(dlqlinkP ); +dlqlinkP dlqFront(dlqlinkP headptr); #define DLQ_ASSERT_HEAD(headptr) \ if ( (headptr)->dlq_type != DLQ_HEAD ) \ @@ -33,8 +45,7 @@ RCSID * 0 - items on queue */ -dlqEmpty(headptr) - dlqlinkP headptr; +int dlqEmpty(dlqlinkP headptr ) { DLQ_ASSERT_HEAD(headptr); if (headptr->dlq_next == headptr) @@ -42,8 +53,7 @@ dlqEmpty(headptr) return (0); } -dlqInit(headptr) - dlqlinkP headptr; +int dlqInit(dlqlinkP headptr) { headptr->dlq_next = headptr; headptr->dlq_prev = headptr; @@ -55,9 +65,7 @@ dlqInit(headptr) /* dlqLinkf * link item to front of chain */ -dlqLinkf(headptr, entryptr) - dlqlinkP headptr; - dlqlinkP entryptr; +int dlqLinkf(dlqlinkP headptr, dlqlinkP entryptr) { DLQ_ASSERT_HEAD(headptr); /* link in as first item in chain */ @@ -72,9 +80,7 @@ dlqLinkf(headptr, entryptr) * link item to end of chain */ -dlqLinkb(headptr, entryptr) - dlqlinkP headptr; - dlqlinkP entryptr; +int dlqLinkb(dlqlinkP headptr, dlqlinkP entryptr) { DLQ_ASSERT_HEAD(headptr); entryptr->dlq_next = headptr; @@ -89,10 +95,7 @@ dlqLinkb(headptr, entryptr) * move all the items on the fromptr and append to the toptr's list */ -void -dlqMoveb(fromptr, toptr) - dlqlinkP fromptr; - dlqlinkP toptr; +void dlqMoveb( dlqlinkP fromptr, dlqlinkP toptr) { dlqlinkP tailptr; @@ -122,9 +125,7 @@ dlqMoveb(fromptr, toptr) * unlink the last item on the queue */ -dlqlinkP -dlqUnlinkb(headptr) - dlqlinkP headptr; +dlqlinkP dlqUnlinkb(dlqlinkP headptr) { dlqlinkP ptr; DLQ_ASSERT_HEAD(headptr); @@ -145,9 +146,7 @@ dlqUnlinkb(headptr) * unlink the item on the front of the queue */ -dlqlinkP -dlqUnlinkf(headptr) - dlqlinkP headptr; +dlqlinkP dlqUnlinkf(dlqlinkP headptr) { dlqlinkP ptr; DLQ_ASSERT_HEAD(headptr); @@ -169,8 +168,7 @@ dlqUnlinkf(headptr) * unlink the specified item from the queue. */ -dlqUnlink(ptr) - dlqlinkP ptr; +void dlqUnlink( dlqlinkP ptr) { /* must not be the queue head */ if (ptr->dlq_type == DLQ_HEAD) { @@ -189,9 +187,7 @@ dlqUnlink(ptr) * return point to item at front of queuen */ -dlqlinkP -dlqFront(headptr) - dlqlinkP headptr; +dlqlinkP dlqFront(dlqlinkP headptr) { DLQ_ASSERT_HEAD(headptr); @@ -201,9 +197,7 @@ dlqFront(headptr) return (headptr->dlq_next); } -int -dlqCount(headptr) - dlqlinkP headptr; +int dlqCount(dlqlinkP headptr) { dlqlinkP ptr; int count = 0; @@ -218,10 +212,7 @@ dlqCount(headptr) return (count); } -dlqTraverseQueue(headptr, fn1, fn2) - dlqlinkP headptr; - int (*fn1) (); - int (*fn2) (); +int dlqTraverseQueue(dlqlinkP headptr, int (*fn1()), int (*fn2())) { dlqlinkP ptr, oldPtr; diff --git a/src/bucoord/dsstub.c b/src/bucoord/dsstub.c index ade0978..040208d 100644 --- a/src/bucoord/dsstub.c +++ b/src/bucoord/dsstub.c @@ -22,19 +22,35 @@ RCSID #ifdef AFS_NT40_ENV #include #else -#include #include #include #include #endif -#include #include #include #include #include #include +#include "bc.h" + +/* protos */ + +static char * TapeName(register char *); +static char * DumpName(register afs_int32 adumpID); +static FILE * OpenDump(afs_int32 , char * ); +FILE * OpenTape(char * , char * ); +static afs_int32 ScanForChildren(afs_int32 ); +static afs_int32 DeleteDump(afs_int32 ); +static afs_int32 DeleteTape(char * ); +char * tailCompPtr(char *); +afs_int32 ScanDumpHdr(register FILE *, char *, char *, afs_int32 *, afs_int32 *, + afs_int32 *, afs_int32 *); +static afs_int32 ScanTapeHdr(register FILE *, afs_int32 *, afs_int32 *, afs_int32 *); +afs_int32 ScanTapeVolume(FILE *, char *, afs_int32 *, char *, afs_int32 *, afs_int32 *, + afs_int32 *, afs_int32 *); +afs_int32 ScanVolClone(FILE *, char *, afs_int32 *); +static int SeekDump(register FILE *afile, afs_int32 apos); -#define dprintf /* debug */ /* basic format of a tape file is a file, whose name is "T.db", and * which contains the fields @@ -57,9 +73,8 @@ static afs_int32 DeleteDump(); afs_int32 ScanDumpHdr(); /* return the tape file name corresponding to a particular tape */ -static char * -TapeName(atapeName) - register char *atapeName; + +static char * TapeName(register char *atapeName) { static char tbuffer[AFSDIR_PATH_MAX]; @@ -72,9 +87,8 @@ TapeName(atapeName) } /* return the dump file name corresponding to a particular dump ID */ -static char * -DumpName(adumpID) - register afs_int32 adumpID; + +static char * DumpName(register afs_int32 adumpID) { static char tbuffer[AFSDIR_PATH_MAX]; char buf[AFSDIR_PATH_MAX]; @@ -86,10 +100,7 @@ DumpName(adumpID) return tbuffer; } -static FILE * -OpenDump(adumpID, awrite) - char *awrite; - afs_int32 adumpID; +static FILE * OpenDump(afs_int32 adumpID, char * awrite) { register char *tp; register FILE *tfile; @@ -104,10 +115,7 @@ OpenDump(adumpID, awrite) * non-static for recoverDB */ -FILE * -OpenTape(atapeName, awrite) - char *awrite; - char *atapeName; +FILE * OpenTape(char * atapeName, char * awrite) { register char *tp; register FILE *tfile; @@ -117,9 +125,8 @@ OpenTape(atapeName, awrite) } /* scan for, and delete, all dumps whose parent dump ID is aparentID */ -static afs_int32 -ScanForChildren(aparentID) - afs_int32 aparentID; + +static afs_int32 ScanForChildren(afs_int32 aparentID) { DIR *tdir; register struct dirent *tde; @@ -162,9 +169,7 @@ ScanForChildren(aparentID) return 0; } -static afs_int32 -DeleteDump(adumpID) - afs_int32 adumpID; +static afs_int32 DeleteDump(afs_int32 adumpID) { register char *tp; register afs_int32 code; @@ -176,9 +181,7 @@ DeleteDump(adumpID) return code; } -static afs_int32 -DeleteTape(atapeName) - char *atapeName; +static afs_int32 DeleteTape(char * atapeName) { register char *tp; register afs_int32 code; @@ -192,9 +195,7 @@ DeleteTape(atapeName) * pointer to it */ -char * -tailCompPtr(pathNamePtr) - char *pathNamePtr; +char * tailCompPtr(char *pathNamePtr) { char *ptr; ptr = strrchr(pathNamePtr, '/'); @@ -222,14 +223,7 @@ tailCompPtr(pathNamePtr) * alevel - level of dump (0 = full, 1+ are incrementals) */ afs_int32 -ScanDumpHdr(afile, aname, dumpName, aparent, aincTime, acreateTime, alevel) - register FILE *afile; - char *aname; - char *dumpName; - afs_int32 *aparent; - afs_int32 *acreateTime; - afs_int32 *aincTime; - afs_int32 *alevel; +ScanDumpHdr(register FILE *afile, char *aname, char *dumpName, afs_int32 *aparent, afs_int32 *aincTime, afs_int32 *acreateTime, afs_int32 *alevel) { char tbuffer[256]; char *tp; @@ -253,12 +247,7 @@ ScanDumpHdr(afile, aname, dumpName, aparent, aincTime, acreateTime, alevel) } /* scan a tape header out of a tape file, leaving the file ptr positioned just past the header */ -static afs_int32 -ScanTapeHdr(afile, adumpID, aseq, adamage) - register FILE *afile; - afs_int32 *adumpID; - afs_int32 *aseq; - afs_int32 *adamage; +static afs_int32 ScanTapeHdr(register FILE *afile, afs_int32 *adumpID, afs_int32 *aseq, afs_int32 *adamage) { char tbuffer[256]; char *tp; @@ -282,14 +271,7 @@ ScanTapeHdr(afile, adumpID, aseq, adamage) * -1 for error */ -afs_int32 -ScanTapeVolume(afile, avolName, avolID, atapeName, apos, aseq, alastp, - cloneTime) - FILE *afile; - char *avolName; - afs_int32 *avolID; - char *atapeName; - afs_int32 *apos, *aseq, *alastp, *cloneTime; +afs_int32 ScanTapeVolume(FILE *afile, char *avolName, afs_int32 *avolID, char *atapeName, afs_int32 *apos, afs_int32 *aseq, afs_int32 *alastp, afs_int32 *cloneTime) { char tbuffer[256]; register afs_int32 code; @@ -318,11 +300,7 @@ ScanTapeVolume(afile, avolName, avolID, atapeName, apos, aseq, alastp, * -1 - volume with volName not found */ -afs_int32 -ScanVolClone(tdump, volName, cloneTime) - FILE *tdump; - char *volName; - afs_int32 *cloneTime; +afs_int32 ScanVolClone(FILE *tdump, char *volName, afs_int32 *cloneTime) { char avolName[256], atapeName[256]; afs_int32 retval, avolID, apos, aseq, alastp; @@ -341,10 +319,7 @@ ScanVolClone(tdump, volName, cloneTime) } /* seek a dump file (after a header scan has been done) to position apos */ -static -SeekDump(afile, apos) - register FILE *afile; - afs_int32 apos; +static int SeekDump(register FILE *afile, afs_int32 apos) { register afs_int32 i; register char *tp; diff --git a/src/bucoord/dsvs.c b/src/bucoord/dsvs.c index 349eafa..13d464b 100644 --- a/src/bucoord/dsvs.c +++ b/src/bucoord/dsvs.c @@ -26,13 +26,11 @@ RCSID #ifdef AFS_NT40_ENV #include #else -#include #include #include #include #include #endif -#include #include #include diff --git a/src/bucoord/dump.c b/src/bucoord/dump.c index f96384f..350d5cd 100644 --- a/src/bucoord/dump.c +++ b/src/bucoord/dump.c @@ -23,7 +23,6 @@ RCSID #include #else #include -#include #include #include #include diff --git a/src/bucoord/dump_sched.c b/src/bucoord/dump_sched.c index 35fa86b..5fe77ac 100644 --- a/src/bucoord/dump_sched.c +++ b/src/bucoord/dump_sched.c @@ -12,7 +12,6 @@ */ #include -#include #include #include @@ -22,7 +21,6 @@ RCSID #ifdef AFS_NT40_ENV #include #else -#include #include #include #include diff --git a/src/bucoord/expire.c b/src/bucoord/expire.c index 705f703..b7e7c90 100644 --- a/src/bucoord/expire.c +++ b/src/bucoord/expire.c @@ -21,7 +21,6 @@ RCSID #include #include #include "bc.h" -#include #define MAX_YEAR_VALUE 0 diff --git a/src/bucoord/main.c b/src/bucoord/main.c index 069433a..3b9ed95 100644 --- a/src/bucoord/main.c +++ b/src/bucoord/main.c @@ -15,7 +15,6 @@ RCSID #include #include -#include #ifdef AFS_AIX32_ENV #include #endif diff --git a/src/bucoord/restore.c b/src/bucoord/restore.c index 8b1fbb7..b6b6784 100644 --- a/src/bucoord/restore.c +++ b/src/bucoord/restore.c @@ -23,7 +23,6 @@ RCSID #ifdef AFS_NT40_ENV #include #else -#include #include #include #include diff --git a/src/bucoord/status.c b/src/bucoord/status.c index d57e498..d48c145 100644 --- a/src/bucoord/status.c +++ b/src/bucoord/status.c @@ -15,11 +15,9 @@ RCSID #include #include -#include #ifdef AFS_NT40_ENV #include #else -#include #include #include #include diff --git a/src/bucoord/tape_hosts.c b/src/bucoord/tape_hosts.c index 97576a5..479a931 100644 --- a/src/bucoord/tape_hosts.c +++ b/src/bucoord/tape_hosts.c @@ -15,7 +15,6 @@ RCSID #include #include -#include #ifdef AFS_NT40_ENV #include #else diff --git a/src/bucoord/ttest.c b/src/bucoord/ttest.c index e117743..21f1d0f 100644 --- a/src/bucoord/ttest.c +++ b/src/bucoord/ttest.c @@ -8,7 +8,6 @@ */ #include -#include #include #include #include diff --git a/src/bucoord/ubik_db_if.c b/src/bucoord/ubik_db_if.c index 94082c3..121796e 100644 --- a/src/bucoord/ubik_db_if.c +++ b/src/bucoord/ubik_db_if.c @@ -10,12 +10,11 @@ /* Interface and supporting routines for the backup system's ubik database */ #include -#include +#include RCSID ("$Header$"); -#include #include #include #ifdef AFS_NT40_ENV @@ -38,6 +37,17 @@ RCSID #include "bc.h" #include "error_macros.h" +/* protos */ +afs_int32 bcdb_AddVolume(register struct budb_volumeEntry *); +afs_int32 bcdb_AddVolumes(register struct budb_volumeEntry *, afs_int32 ); +afs_int32 bcdb_CreateDump(register struct budb_dumpEntry *) ; +afs_int32 bcdb_deleteDump(afs_int32, afs_int32, afs_int32, budb_dumpsList *); +/*note the pinter to the function comes from ubik/ubikclient ubik_Call function.*/ +afs_int32 bcdb_listDumps (int (), afs_int32,afs_int32,afs_int32, budb_dumpsList *, + budb_dumpsList *); +afs_int32 bcdb_DeleteVDP(char *, char *, afs_int32 ); +afs_int32 bcdb_FindClone(afs_int32, char *, afs_int32 *); + extern char *whoami; /* ------------------------------------- @@ -52,8 +62,7 @@ struct udbHandleS udbHandle; * ------------------------------------- */ -bcdb_AddVolume(veptr) - register struct budb_volumeEntry *veptr; +afs_int32 bcdb_AddVolume(register struct budb_volumeEntry *veptr) { afs_int32 code; @@ -61,9 +70,7 @@ bcdb_AddVolume(veptr) return (code); } -bcdb_AddVolumes(veptr, count) - register struct budb_volumeEntry *veptr; - afs_int32 count; +afs_int32 bcdb_AddVolumes(register struct budb_volumeEntry *veptr, afs_int32 count) { struct budb_volumeList volumeList; afs_int32 code; @@ -75,8 +82,7 @@ bcdb_AddVolumes(veptr, count) } -bcdb_CreateDump(deptr) - register struct budb_dumpEntry *deptr; +afs_int32 bcdb_CreateDump(register struct budb_dumpEntry *deptr) { afs_int32 code; @@ -84,11 +90,8 @@ bcdb_CreateDump(deptr) return (code); } -bcdb_deleteDump(dumpID, fromTime, toTime, dumps) - afs_int32 dumpID; - afs_int32 fromTime; - afs_int32 toTime; - budb_dumpsList *dumps; +afs_int32 bcdb_deleteDump(afs_int32 dumpID, afs_int32 fromTime, afs_int32 toTime, + budb_dumpsList *dumps) { afs_int32 code; budb_dumpsList dumpsList, *dumpsPtr; @@ -105,12 +108,7 @@ bcdb_deleteDump(dumpID, fromTime, toTime, dumps) return (code); } -bcdb_listDumps(sflags, groupId, fromTime, toTime, dumps, flags) - afs_int32 groupId; - afs_int32 fromTime; - afs_int32 toTime; - budb_dumpsList *dumps; - budb_dumpsList *flags; +afs_int32 bcdb_listDumps (int (*sflags) (), afs_int32 groupId,afs_int32 fromTime, afs_int32 toTime,budb_dumpsList *dumps, budb_dumpsList *flags) { afs_int32 code, sflag = 0; budb_dumpsList dumpsList, *dumpsPtr; @@ -136,10 +134,7 @@ bcdb_listDumps(sflags, groupId, fromTime, toTime, dumps, flags) } -bcdb_DeleteVDP(dumpSetName, dumpPath, dumpID) - char *dumpSetName; - char *dumpPath; - afs_int32 dumpID; +afs_int32 bcdb_DeleteVDP(char *dumpSetName, char *dumpPath, afs_int32 dumpID) { afs_int32 code; @@ -163,11 +158,7 @@ bcdb_DeleteVDP(dumpSetName, dumpPath, dumpID) * -2 - no clone times found, clone time set to 0 */ -afs_int32 -bcdb_FindClone(dumpID, volName, clonetime) - afs_int32 dumpID; - char *volName; - afs_int32 *clonetime; +afs_int32 bcdb_FindClone(afs_int32 dumpID, char *volName, afs_int32 *clonetime) { afs_int32 code; code = diff --git a/src/bucoord/vol_sets.c b/src/bucoord/vol_sets.c index 3ae6136..791c4be 100644 --- a/src/bucoord/vol_sets.c +++ b/src/bucoord/vol_sets.c @@ -15,7 +15,6 @@ RCSID #include #include -#include #ifdef AFS_NT40_ENV #include #else diff --git a/src/bucoord/volstub.c b/src/bucoord/volstub.c index d1a4aee..4742671 100644 --- a/src/bucoord/volstub.c +++ b/src/bucoord/volstub.c @@ -14,7 +14,6 @@ RCSID ("$Header$"); #include -#include #ifdef AFS_NT40_ENV #include #else -- 1.9.4