{"id":15873801,"url":"https://github.com/phronmophobic/clj-libffi","last_synced_at":"2025-03-16T04:30:45.196Z","repository":{"id":143868440,"uuid":"405780735","full_name":"phronmophobic/clj-libffi","owner":"phronmophobic","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-08T23:00:03.000Z","size":62,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T05:02:41.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phronmophobic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-13T00:00:57.000Z","updated_at":"2024-11-09T10:47:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"0cd1a5da-b38a-40fe-88fd-bb6501508f93","html_url":"https://github.com/phronmophobic/clj-libffi","commit_stats":{"total_commits":40,"total_committers":1,"mean_commits":40.0,"dds":0.0,"last_synced_commit":"9fa0f20082000c0d4773155e5a76fcc560593961"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phronmophobic%2Fclj-libffi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phronmophobic%2Fclj-libffi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phronmophobic%2Fclj-libffi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phronmophobic%2Fclj-libffi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phronmophobic","download_url":"https://codeload.github.com/phronmophobic/clj-libffi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243802943,"owners_count":20350316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T01:06:51.038Z","updated_at":"2025-03-16T04:30:45.192Z","avatar_url":"https://github.com/phronmophobic.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clj-libffi\n\nA wrapper for libffi.\n\n## Rationale\n\nOn the jvm, using clj-libffi is worse than other similar options like jna and jdk16's ffi. However, when compiling to native using graalvm, only static calls to c libraries are possible (afaik). Using libffi, loading and calling arbitrary functions from arbitrary shared libraries can be achieved.\n\n## Deps\n\nLeiningen/Boot\n\n`[com.phronemophobic/clj-lbbffi \"1.5\"]`\n\nClojure CLI/deps.edn\n\n`com.phronemophobic/clj-libffi {:mvn/version \"1.5\"}`\n\n## Usage\n\n```clojure\n\n(require '[com.phronemophobic.clj-libffi :as ffi])\n\n(ffi/call \"cos\" :float64 :float64 Math/PI)\n;; -1.0\n\n(ffi/load-library \"libmy.dylib\")\n\n(ffi/call \"myfn\" :void\n          :int64 42\n          :int8 -1)\n\n```\n\n### Graalvm\n\nTo compile for graalvm, you must link against libffi. See [examples/ffitest/scripts/compile-test.sh](examples/ffitest/scripts/compile-test.sh).\n\n### Limitations\n\n* Currently only runs on Mac OSX. If you'd like to see support for other platforms, please comment or upvote the issues for [linux](https://github.com/phronmophobic/clj-libffi/issues/1) and [windows](https://github.com/phronmophobic/clj-libffi/issues/2).\n\n## License\n\nCopyright © 2021 Adrian Smith\n\nDistributed under the Eclipse Public License version 1.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphronmophobic%2Fclj-libffi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphronmophobic%2Fclj-libffi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphronmophobic%2Fclj-libffi/lists"}