{"id":22450185,"url":"https://github.com/aldaronlau/dl_api","last_synced_at":"2025-08-01T23:31:21.931Z","repository":{"id":52393388,"uuid":"135670903","full_name":"AldaronLau/dl_api","owner":"AldaronLau","description":"The easiest, simplest and safest way to load dynamic (shared object) libraries from Rust!","archived":false,"fork":false,"pushed_at":"2021-04-30T02:42:00.000Z","size":124,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-02T00:43:46.511Z","etag":null,"topics":["abi","dl-api","dynamic-linking","ffi","macros","rust","shared-library","shared-object"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AldaronLau.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-01T05:20:47.000Z","updated_at":"2024-09-21T10:31:01.000Z","dependencies_parsed_at":"2022-09-16T19:23:20.652Z","dependency_job_id":null,"html_url":"https://github.com/AldaronLau/dl_api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AldaronLau%2Fdl_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AldaronLau%2Fdl_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AldaronLau%2Fdl_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AldaronLau%2Fdl_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AldaronLau","download_url":"https://codeload.github.com/AldaronLau/dl_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228413956,"owners_count":17915927,"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":["abi","dl-api","dynamic-linking","ffi","macros","rust","shared-library","shared-object"],"created_at":"2024-12-06T05:13:36.608Z","updated_at":"2024-12-06T05:13:41.348Z","avatar_url":"https://github.com/AldaronLau.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![DL API](https://raw.githubusercontent.com/AldaronLau/dl_api/master/res/icon.svg)\n\n#### The easiest, simplest and safest way to load dynamic (shared object) libraries from Rust!\n\n[![Build Status](https://api.travis-ci.org/AldaronLau/dl_api.svg?branch=master)](https://travis-ci.org/AldaronLau/dl_api)\n[![Docs](https://docs.rs/dl_api/badge.svg)](https://docs.rs/dl_api)\n[![crates.io](https://img.shields.io/crates/v/dl_api.svg)](https://crates.io/crates/dl_api)\n\n- Macro to create a structure that dynamically loads a C API\n- Works on Linux (and probably other unix) and Windows\n\n### Roadmap to 1.0 (Future Features)\n- Make it easier to load parts of API at any time (modular loading from same .so\n  file).\n- Support some other obscure OS's.\n- Different loading macro for Rust ABI / other ABIS (possible ABI parameter to\n  the macro?)\n- Make sure it's perfect.\n\n## Table of Contents\n- [Getting Started](#getting-started)\n   - [Example](#example)\n   - [API](#api)\n   - [Features](#features)\n- [Upgrade](#upgrade)\n- [License](#license)\n   - [Contribution](#contribution)\n\n\n## Getting Started\nAdd the following to your `Cargo.toml`.\n\n```toml\n[dependencies]\ndl_api = \"0.4\"\n```\n\n### Example\nThe code inside of the curly braces for `link!()` matches exactly with code\ninside of the curly braces for `extern \"C\"`.  This makes it easy for you to turn\nyour `extern \"C\"`s into `link!()`s.\n\n```rust\n// Shared object: either \"libmylibrary.so.1\", \"mylibrary-1.dll\" or \"libMyLibrary.dylib\"\ndl_api::link!(MyApi, \"libmylibrary.so.1\", {\n    fn cFunction(param_name: ParamType) -\u003e ReturnType;\n});\n\nfn main() {\n    let api = MyApi::new().unwrap(); // unwrap the `Result`.\n\n    let rtn: ReturnType = unsafe {\n        (api.cFunction)(0);\n    };\n}\n```\n\n### API\nAPI documentation can be found on [docs.rs](https://docs.rs/dl_api).\n\n### Features\nThere are no optional features.\n\n## Upgrade\nYou can use the\n[changelog](https://github.com/AldaronLau/dl_api/blob/master/CHANGELOG.md)\nto facilitate upgrading this crate as a dependency.\n\n## License\nLicensed under either of\n - Apache License, Version 2.0,\n   ([LICENSE-APACHE](https://github.com/AldaronLau/dl_api/blob/master/LICENSE-APACHE) or\n   [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0))\n - Zlib License,\n   ([LICENSE-ZLIB](https://github.com/AldaronLau/dl_api/blob/master/LICENSE-ZLIB) or\n   [https://opensource.org/licenses/Zlib](https://opensource.org/licenses/Zlib))\n\nat your option.\n\n### Contribution\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\nContributors are always welcome (thank you for being interested!), whether it\nbe a bug report, bug fix, feature request, feature implementation or whatever.\nDon't be shy about getting involved.  I always make time to fix bugs, so usually\na patched version of the library will be out a few days after a report.\nFeatures requests will not complete as fast.  If you have any questions, design\ncritques, or want me to find you something to work on based on your skill level,\nyou can email me at [jeronlau@plopgrizzly.com](mailto:jeronlau@plopgrizzly.com).\nOtherwise,\n[here's a link to the issues on GitHub](https://github.com/AldaronLau/dl_api/issues).\nBefore contributing, check out the\n[contribution guidelines](https://github.com/AldaronLau/dl_api/blob/master/CONTRIBUTING.md),\nand, as always, make sure to follow the\n[code of conduct](https://github.com/AldaronLau/dl_api/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldaronlau%2Fdl_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldaronlau%2Fdl_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldaronlau%2Fdl_api/lists"}