#include <afs/budb_client.h>
#include <afs/afsutil.h>
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif /* HAVE_STDIO_H */
+#if defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
/*
* Represents a host in the config database.
*/
*/
#include <afsconfig.h>
-#include <afs/param.h>
+#include <afs/stds.h>
RCSID
("$Header$");
-#include <afs/stds.h>
#include <sys/types.h>
-#include <stdio.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else
-#include <strings.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
-#include <strings.h>
#endif
#include <errno.h>
#include <afs/com_err.h>
#include <afs/ktime.h> /* PA */
#include <time.h>
-#include <string.h>
#include <lock.h>
#include <afs/butc.h>
#include <afs/tcdata.h>
#include <netinet/in.h>
#include <netdb.h>
#endif
-#include <stdio.h>
#include <errno.h>
#include "bc.h"
*/
#include <afsconfig.h>
-#include <afs/param.h>
+#include <afs/stds.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
RCSID
("$Header$");
-
+#include "bc.h"
#include <afs/bubasics.h>
+/* 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 ) \
* 0 - items on queue
*/
-dlqEmpty(headptr)
- dlqlinkP headptr;
+int dlqEmpty(dlqlinkP headptr )
{
DLQ_ASSERT_HEAD(headptr);
if (headptr->dlq_next == headptr)
return (0);
}
-dlqInit(headptr)
- dlqlinkP headptr;
+int dlqInit(dlqlinkP headptr)
{
headptr->dlq_next = headptr;
headptr->dlq_prev = 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 */
* 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;
* 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;
* unlink the last item on the queue
*/
-dlqlinkP
-dlqUnlinkb(headptr)
- dlqlinkP headptr;
+dlqlinkP dlqUnlinkb(dlqlinkP headptr)
{
dlqlinkP ptr;
DLQ_ASSERT_HEAD(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);
* 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) {
* return point to item at front of queuen
*/
-dlqlinkP
-dlqFront(headptr)
- dlqlinkP headptr;
+dlqlinkP dlqFront(dlqlinkP headptr)
{
DLQ_ASSERT_HEAD(headptr);
return (headptr->dlq_next);
}
-int
-dlqCount(headptr)
- dlqlinkP headptr;
+int dlqCount(dlqlinkP headptr)
{
dlqlinkP ptr;
int count = 0;
return (count);
}
-dlqTraverseQueue(headptr, fn1, fn2)
- dlqlinkP headptr;
- int (*fn1) ();
- int (*fn2) ();
+int dlqTraverseQueue(dlqlinkP headptr, int (*fn1()), int (*fn2()))
{
dlqlinkP ptr, oldPtr;
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else
-#include <strings.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#endif
-#include <stdio.h>
#include <dirent.h>
#include <afs/afsutil.h>
#include <afs/budb.h>
#include <afs/bubasics.h>
#include <afs/volser.h>
+#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<tapename>.db", and
* which contains the fields
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];
}
/* 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];
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;
* non-static for recoverDB
*/
-FILE *
-OpenTape(atapeName, awrite)
- char *awrite;
- char *atapeName;
+FILE * OpenTape(char * atapeName, char * awrite)
{
register char *tp;
register FILE *tfile;
}
/* 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;
return 0;
}
-static afs_int32
-DeleteDump(adumpID)
- afs_int32 adumpID;
+static afs_int32 DeleteDump(afs_int32 adumpID)
{
register char *tp;
register afs_int32 code;
return code;
}
-static afs_int32
-DeleteTape(atapeName)
- char *atapeName;
+static afs_int32 DeleteTape(char * atapeName)
{
register char *tp;
register afs_int32 code;
* pointer to it
*/
-char *
-tailCompPtr(pathNamePtr)
- char *pathNamePtr;
+char * tailCompPtr(char *pathNamePtr)
{
char *ptr;
ptr = strrchr(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;
}
/* 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;
* -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;
* -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;
}
/* 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;
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else
-#include <strings.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/param.h>
#endif
-#include <stdio.h>
#include <afs/com_err.h>
#include <afs/bubasics.h>
#include <winsock2.h>
#else
#include <sys/param.h>
-#include <strings.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
*/
#include <sys/types.h>
-#include <stdio.h>
#include <afsconfig.h>
#include <afs/param.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else
-#include <strings.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <afs/cmd.h>
#include <ctype.h>
#include "bc.h"
-#include <strings.h>
#define MAX_YEAR_VALUE 0
#include <afs/stds.h>
#include <sys/types.h>
-#include <stdio.h>
#ifdef AFS_AIX32_ENV
#include <signal.h>
#endif
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else
-#include <strings.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <afs/stds.h>
#include <sys/types.h>
-#include <stdio.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else
-#include <strings.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <afs/stds.h>
#include <sys/types.h>
-#include <stdio.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else
*/
#include <sys/types.h>
-#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
/* Interface and supporting routines for the backup system's ubik database */
#include <afsconfig.h>
-#include <afs/param.h>
+#include <afs/stds.h>
RCSID
("$Header$");
-#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#ifdef AFS_NT40_ENV
#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;
/* -------------------------------------
* -------------------------------------
*/
-bcdb_AddVolume(veptr)
- register struct budb_volumeEntry *veptr;
+afs_int32 bcdb_AddVolume(register struct budb_volumeEntry *veptr)
{
afs_int32 code;
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;
}
-bcdb_CreateDump(deptr)
- register struct budb_dumpEntry *deptr;
+afs_int32 bcdb_CreateDump(register struct budb_dumpEntry *deptr)
{
afs_int32 code;
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;
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;
}
-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;
* -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 =
#include <afs/stds.h>
#include <sys/types.h>
-#include <stdio.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else
("$Header$");
#include <sys/types.h>
-#include <stdio.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#else