You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
519 B

  1. #!/usr/bin/env python3
  2. # A simple test script to confirm the C FFI for the rust library is working
  3. from cffi import FFI
  4. ffi = FFI()
  5. ffi.set_source("_ffi_test_py",
  6. """
  7. #include <dlfcn.h>
  8. """,
  9. libraries=["pihash"],
  10. library_dirs=["."]
  11. )
  12. ffi.cdef("""
  13. void init();
  14. void teardown();
  15. uint64_t ext_get_ahash(const char *);
  16. uint64_t ext_get_dhash(const char *);
  17. uint64_t ext_get_phash(const char *);
  18. """)
  19. if __name__ == "__main__":
  20. ffi.compile()