Pull includes into a common file, since there will be a bunch of them.
authorEvan Broder <broder@mit.edu>
Sun, 21 Dec 2008 09:15:23 +0000 (03:15 -0600)
committerEvan Broder <broder@mit.edu>
Sun, 21 Dec 2008 10:13:52 +0000 (04:13 -0600)
Signed-off-by: Evan Broder <broder@mit.edu>

.gitignore
afs/_pts.pyx
afs/afs.pxd [new file with mode: 0644]
setup.py

index 26041b4..e5dd526 100644 (file)
@@ -1,4 +1,6 @@
 afs/_pts.c
+afs/_pts.dep
+
 *.so
 build
 dist
index 49ee9b6..6678418 100644 (file)
@@ -1,24 +1,13 @@
-cdef extern from "afs/stds.h":
-    ctypedef long afs_int32
-
-cdef extern from "ubik.h":
-    enum:
-        MAXSERVERS
-    
-    struct ubik_client:
-        pass
-
-cdef extern from "rx/rx.h":
-    int rx_Init(int port)
+cimport afs as a
 
 cdef class PTS:
-    cdef ubik_client * client
+    cdef a.ubik_client * client
     
     def __cinit__(self):
-        cdef afs_int32 code
+        cdef a.afs_int32 code
         
         self.client = NULL
         
-        code = rx_Init(0)
+        code = a.rx_Init(0)
         if code != 0:
             raise Exception(str(code))
diff --git a/afs/afs.pxd b/afs/afs.pxd
new file mode 100644 (file)
index 0000000..5fb03e7
--- /dev/null
@@ -0,0 +1,12 @@
+cdef extern from "afs/stds.h":
+    ctypedef long afs_int32
+
+cdef extern from "ubik.h":
+    enum:
+        MAXSERVERS
+    
+    struct ubik_client:
+        pass
+
+cdef extern from "rx/rx.h":
+    int rx_Init(int port)
index 6dc758c..1e7b770 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,8 @@ for root in ['/Library/OpenAFS/Tools',
     if os.path.exists('%s/include/afs/afs.h' % root):
         break
 
-include_dirs = ['%s/include' % root]
+include_dirs = [os.path.join(os.path.dirname(__file__), 'afs'),
+                '%s/include' % root]
 library_dirs = ['%s/lib' % root,
                 '%s/lib/afs' % root]