]> git.wh0rd.org Git - dump.git/blob - common/indexer.h
SQLlite and QFA overhaul.
[dump.git] / common / indexer.h
1 #include <config.h>
2 #include <protocols/dumprestore.h>
3 #include <compatlfs.h>
4
5 #ifndef _ARCHIVE_H
6 #define _ARCHIVE_H 1
7
8 #ifdef USE_QFA
9 #define QFA_MAGIC       "495115637697"
10 #define QFA_VERSION     "1.0"
11 #endif /* USE_QFA */
12
13 #ifndef __P
14 #include <sys/cdefs.h>
15 #endif
16
17 /* state information when writing QFA file. */
18 typedef struct qfa_state {
19         long long curtapepos;
20         /* long         maxntrecs = 300000000 / (ntrec * 1024);  last tested: 50 000 000 */
21         long            maxntrecs;
22         long            cntntrecs;
23 } QFA_State;
24
25 /* methods used to write 'Indexer' file. */
26 typedef struct indexer {
27         struct indexer *next;
28         int (*open) __P((const char *filename, int mode));
29         int (*close) __P((void));
30         int (*foo) __P((void)); // what does this function do?
31         int (*writerec) __P((const void *dp, int isspcl));
32         int (*addInode) __P((struct dinode *dp, dump_ino_t ino, int metaonly));  // dump entry
33         //int (*addDirEntry) __P((struct ext2_dir_entry *dirent, UNUSED(int offset),  // dump inode
34         //          UNUSED(int blocksize), UNUSED(char *buf), void *private));
35         int (*addDirEntry) __P((struct direct *dp, dump_ino_t parent_ino));
36
37         int (*openQfa) __P(());
38         int (*closeQfa) __P(());
39         int (*openQfaState) __P((QFA_State *state));
40         int (*updateQfa) __P((QFA_State *state));
41         int (*updateQfaState) __P((QFA_State *state));
42 } Indexer;
43
44 extern Indexer *indexer;
45
46 extern Indexer indexer_legacy;
47 extern Indexer indexer_sqlite;
48
49 //extern Indexer *indexer_legacy_factory();
50
51 //#ifdef HAVE_SQLITE3
52 //extern Indexer *indexer_sqlite_factory();
53 //#endif /* HAVE_SQLITE3 */
54 #endif