]> arthur.barton.de Git - netatalk.git/blob - libatalk/cnid/hash/cnid_hash.h
a3f8e4b87c04fbfe6b0afffe9222f765f974b352
[netatalk.git] / libatalk / cnid / hash / cnid_hash.h
1 /* 
2  * interface for database access to cnids. i do it this way to abstract
3  * things a bit in case we want to change the underlying implementation.
4  */
5
6 #ifndef _ATALK_CNID_HASH__H
7 #define _ATALK_CNID_HASH__H 1
8
9 #include <sys/cdefs.h>
10 #include <sys/stat.h>
11 #include <unistd.h>
12 #include <string.h>
13
14 #include <netatalk/endian.h>
15 #include <atalk/cnid.h>
16 #define STANDALONE 1
17
18 #include <stdlib.h>
19 #include <stdio.h>
20 #include <fcntl.h>
21 #include <unistd.h>
22 #include <string.h>
23 #include <fcntl.h>
24 #include <errno.h>
25 #include <sys/mman.h>
26 #include <sys/stat.h>
27 #include <signal.h>
28 #include <atalk/tdb.h>
29
30 #define HASH_ERROR_LINK  1
31 #define HASH_ERROR_DEV   2
32 #define HASH_ERROR_INODE 4
33
34 struct _cnid_hash_private {
35     dev_t  st_dev;
36     int    st_set;
37     int    error;
38     TDB_CONTEXT *tdb;  
39 };
40
41 /* cnid_open.c */
42 extern struct _cnid_module cnid_hash_module;
43 extern struct _cnid_db *cnid_hash_open (const char *, mode_t);
44
45 /* cnid_close.c */
46 extern void cnid_hash_close (struct _cnid_db *);
47
48 /* cnid_add.c */
49 extern cnid_t cnid_hash_add (struct _cnid_db *, const struct stat *, const cnid_t,
50                                  char *, const int, cnid_t);
51
52 /* cnid_get.c */
53 extern cnid_t cnid_hash_get (struct _cnid_db *, const cnid_t, char *, const int);
54 extern char *cnid_hash_resolve (struct _cnid_db *, cnid_t *, void *, u_int32_t);
55 extern cnid_t cnid_hash_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const int);
56
57 /* cnid_update.c */
58 extern int cnid_hash_update (struct _cnid_db *, const cnid_t, const struct stat *,
59                                  const cnid_t, char *, int);
60
61 /* cnid_delete.c */
62 extern int cnid_hash_delete (struct _cnid_db *, const cnid_t);
63
64 /* cnid_nextid.c */
65 extern cnid_t cnid_hash_nextid (struct _cnid_db *);
66
67 #endif /* include/atalk/cnid_hash.h */