Last active
January 24, 2018 16:01
-
-
Save jorendorff/2a84471400f5fd020b7a700b8c465a04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[macro_use] extern crate nsswitch_service; | |
| use nsswitch_service::*; | |
| use std::ffi::CStr; | |
| use std::net::IpAddr; | |
| fn my_gethostbyname(name: &CStr) -> Result<Option<HostEntry>> { | |
| ... | |
| } | |
| fn my_gethostbyaddr(addr: IpAddr) -> Result<Option<HostEntry>> { | |
| ... | |
| } | |
| impl_nsswitch_service!(mylibraryname, { | |
| gethostbyname: my_gethostbyname, | |
| gethostbyaddr: my_gethostbyaddr, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment