5d50e09c51f822e12be2aade3dc257d235d32860
[invirt/packages/python-afs.git] / afs / afs.pxd
1 cdef extern from "errno.h":
2     int errno
3
4 cdef extern from "string.h":
5     char * strerror(int errnum)
6
7 cdef extern from "netinet/in.h":
8     struct in_addr:
9         int s_addr
10     struct sockaddr_in:
11         short sin_family
12         unsigned short sin_port
13         in_addr sin_addr
14         char sin_zero[8]
15
16 cdef extern from "afs/stds.h":
17     ctypedef long afs_int32
18
19 cdef extern from "afs/dirpath.h":
20     char * AFSDIR_CLIENT_ETC_DIRPATH
21
22 cdef extern from "afs/cellconfig.h":
23     enum:
24         MAXCELLCHARS
25         MAXHOSTSPERCELL
26         MAXHOSTCHARS
27     
28     # We just pass afsconf_dir structs around to other AFS functions,
29     # so this can be treated as opaque
30     struct afsconf_dir:
31         pass
32     
33     # For afsconf_cell, on the other hand, we care about everything
34     struct afsconf_cell:
35         char name[MAXCELLCHARS]
36         short numServers
37         short flags
38         sockaddr_in hostAddr[MAXHOSTSPERCELL]
39         char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS]
40         char *linkedCell
41         int timeout
42      
43     afsconf_dir *afsconf_Open(char *adir)
44     int afsconf_GetCellInfo(afsconf_dir *adir,
45                             char *acellName,
46                             char *aservice,
47                             afsconf_cell *acellInfo)
48
49 cdef extern from "ubik.h":
50     enum:
51         MAXSERVERS
52     
53     # ubik_client is an opaque struct, so we don't care about its members
54     struct ubik_client:
55         pass
56
57 cdef extern from "rx/rx.h":
58     int rx_Init(int port)
59     void rx_Finalize()
60
61 cdef extern from "afs/com_err.h":
62     char * error_message(int)