[pypy-commit] cffi default: missing files

fijal noreply at buildbot.pypy.org
Sat Sep 22 13:28:42 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r962:9bb6eb229269
Date: 2012-09-22 13:28 +0200
http://bitbucket.org/cffi/cffi/changeset/9bb6eb229269/

Log:	missing files

diff --git a/testing/snippets/basic_verify/setup.py b/testing/snippets/basic_verify/setup.py
new file mode 100644
--- /dev/null
+++ b/testing/snippets/basic_verify/setup.py
@@ -0,0 +1,7 @@
+
+from distutils.core import setup
+import snip_basic_verify
+
+setup(
+    packages=['snip_basic_verify'],
+    ext_modules=[snip_basic_verify.ffi.verifier.get_extension()])
diff --git a/testing/snippets/basic_verify/snip_basic_verify/__init__.py b/testing/snippets/basic_verify/snip_basic_verify/__init__.py
new file mode 100644
--- /dev/null
+++ b/testing/snippets/basic_verify/snip_basic_verify/__init__.py
@@ -0,0 +1,15 @@
+
+from cffi import FFI
+
+ffi = FFI()
+ffi.cdef("""     // some declarations from the man page
+    struct passwd {
+        char *pw_name;
+        ...;
+    };
+    struct passwd *getpwuid(int uid);
+""")
+C = ffi.verify("""   // passed to the real C compiler
+#include <sys/types.h>
+#include <pwd.h>
+""", libraries=[])   # or a list of libraries to link with


More information about the pypy-commit mailing list