Lines Matching +full:use +full:- +full:pty
1 // SPDX-License-Identifier: Apache-2.0
13 fn $name:ident($($pname:ident: $pty:ty), *) $(-> $ret:ty)*
31 fn $name:ident($($pname:ident: $pty:ty), *) $(-> $ret:ty)*
33 link!(@LOAD: #[cfg(feature = "runtime")] fn $name($($pname: $pty), *) $(-> $ret)*);
39 pub fn $name:ident($($pname:ident: $pty:ty), *) $(-> $ret:ty)*;
42 use std::cell::{RefCell};
43 use std::sync::{Arc};
44 use std::path::{Path, PathBuf};
68 pub $name: Option<unsafe extern fn($($pname: $pty), *) $(-> $ret)*>,
81 fn new(library: libloading::Library, path: PathBuf) -> Self {
86 pub fn path(&self) -> &Path {
97 pub fn version(&self) -> Option<Version> {
127 pub fn is_loaded() -> bool {
131 fn with_library<T, F>(f: F) -> Option<T> where F: FnOnce(&SharedLibrary) -> T {
141 #[cfg_attr(feature="cargo-clippy", allow(clippy::missing_safety_doc))]
142 #[cfg_attr(feature="cargo-clippy", allow(clippy::too_many_arguments))]
144 pub unsafe fn $name($($pname: $pty), *) $(-> $ret)* {
151 … "https://rust-lang.github.io/rust-bindgen/requirements.html#installing-clang-39"))
158 pub fn is_loaded() -> bool {
165 $(link!(@LOAD: $(#[cfg($cfg)])* fn $name($($pname: $pty), *) $(-> $ret)*);)+
177 pub fn load_manually() -> Result<SharedLibrary, String> {
201 /// Loads a `libclang` shared library for use in the current thread.
213 pub fn load() -> Result<(), String> {
219 /// Unloads the `libclang` shared library in use in the current thread.
223 /// * a `libclang` shared library is not in use in the current thread
224 pub fn unload() -> Result<(), String> {
229 Err("a `libclang` shared library is not in use in the current thread".into())
236 pub fn get_library() -> Option<Arc<SharedLibrary>> {
243 pub fn set_library(library: Option<Arc<SharedLibrary>>) -> Option<Arc<SharedLibrary>> {
254 pub fn $name:ident($($pname:ident: $pty:ty), *) $(-> $ret:ty)*;
260 pub fn $name($($pname: $pty), *) $(-> $ret)*;
267 pub fn is_loaded() -> bool { true }