2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #ifndef _BUDB_PROTOTYPES_H
11 #define _BUDB_PROTOTYPES_H
14 afs_int32 InitDBalloc(void);
15 afs_int32 AllocStructure(struct ubik_trans *ut, char type, dbadr related,
17 afs_int32 FreeStructure(struct ubik_trans *ut, char type, dbadr sa);
18 afs_int32 AllocBlock(struct ubik_trans *, struct block *, dbadr *);
19 afs_int32 FreeBlock(struct ubik_trans *, struct blockHeader *, dbadr);
22 afs_int32 writeDatabase(struct ubik_trans *, int);
26 afs_int32 InitDBhash(void);
28 afs_int32 ht_HashOut(struct ubik_trans *ut, struct memoryHashTable *mht,
30 afs_int32 RemoveFromList(struct ubik_trans *ut, dbadr ea, void *e,
31 dbadr *head, dbadr ta, void *t, dbadr *thread);
32 afs_int32 ht_LookupEntry(struct ubik_trans *ut, struct memoryHashTable *mht,
33 void *key, dbadr *eaP, void *e);
34 afs_int32 ht_HashIn(struct ubik_trans *ut, struct memoryHashTable *mht,
36 afs_int32 scanHashTable(struct ubik_trans *ut, struct memoryHashTable *mhtPtr,
37 int (*selectFn) (dbadr, void *, void *),
38 int (*operationFn) (dbadr, void *, void *),
42 int checkLockHandle(struct ubik_trans *, afs_uint32);
45 afs_int32 badEntry(afs_uint32 dbAddr);
48 afs_int32 checkDiskAddress(unsigned long, int, int *, int *);
51 afs_int32 InitProcs(void);
52 int callPermitted(struct rx_call *);
53 afs_int32 InitRPC(struct ubik_trans **, int lock, int this_op);
57 void Log(char *fmt, ... );
58 void LogError(long code, char *fmt, ... );
59 void LogDebug(int level, char *fmt, ... );
63 void tape_ntoh(struct tape *, struct tape *);
64 void principal_hton(struct budb_principal *, struct budb_principal *);
65 void principal_ntoh(struct budb_principal *, struct budb_principal *);
66 void structDumpHeader_hton(struct structDumpHeader *,
67 struct structDumpHeader *);
68 int tapeSet_ntoh(struct budb_tapeSet *, struct budb_tapeSet *);
69 int tapeSet_hton(struct budb_tapeSet *, struct budb_tapeSet *);
70 void volInfo_ntoh(struct volInfo *, struct volInfo *);
71 void volFragment_ntoh(struct volFragment *, struct volFragment *);
72 void dump_ntoh(struct dump *, struct dump *);
73 int dumpToBudbDump(dbDumpP, struct budb_dumpEntry *);
74 int tapeToBudbTape(struct tape *r, struct budb_tapeEntry *);
75 int volsToBudbVol(struct volFragment *, struct volInfo *,
76 struct budb_volumeEntry *);
77 void printDump(FILE *, struct dump *);
78 int printPrincipal(struct budb_principal *ptr);
79 int printTape(FILE *, struct tape *);
80 int printTapeSet(struct budb_tapeSet *, afs_int32);
81 int printVolInfo(FILE *, struct volInfo *);
82 int printVolFragment(FILE *, struct volFragment *);
83 int printMemoryHashTable(FILE *, struct memoryHashTable *);
86 afs_int32 CheckInit(struct ubik_trans *, int (*db_init) (struct ubik_trans *));
87 afs_int32 InitDB(void);