• Home
  • Raw
  • Download

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::fmt;
44 use std::sync::{Arc};
45 use std::path::{Path, PathBuf};
69 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
70 use Version::*;
82 V9_0 => write!(f, "9.0.x - 10.0.x"),
84 V12_0 => write!(f, "12.0.x - 15.0.x"),
96 pub $name: Option<unsafe extern fn($($pname: $pty), *) $(-> $ret)*>,
109 fn new(library: libloading::Library, path: PathBuf) -> Self {
114 pub fn path(&self) -> &Path {
125 pub fn version(&self) -> Option<Version> {
159 pub fn is_loaded() -> bool {
163 fn with_library<T, F>(f: F) -> Option<T> where F: FnOnce(&SharedLibrary) -> T {
173 #[cfg_attr(feature="cargo-clippy", allow(clippy::missing_safety_doc))]
174 #[cfg_attr(feature="cargo-clippy", allow(clippy::too_many_arguments))]
176 pub unsafe fn $name($($pname: $pty), *) $(-> $ret)* {
189 https://docs.rs/clang-sys/latest/clang_sys/{0}/index.html
192 https://rust-lang.github.io/rust-bindgen/requirements.html
207 pub fn is_loaded() -> bool {
214 $(link!(@LOAD: $(#[cfg($cfg)])* fn $name($($pname: $pty), *) $(-> $ret)*);)+
226 pub fn load_manually() -> Result<SharedLibrary, String> {
252 /// Loads a `libclang` shared library for use in the current thread.
264 pub fn load() -> Result<(), String> {
270 /// Unloads the `libclang` shared library in use in the current thread.
274 /// * a `libclang` shared library is not in use in the current thread
275 pub fn unload() -> Result<(), String> {
280 Err("a `libclang` shared library is not in use in the current thread".into())
287 pub fn get_library() -> Option<Arc<SharedLibrary>> {
294 pub fn set_library(library: Option<Arc<SharedLibrary>>) -> Option<Arc<SharedLibrary>> {
305 pub fn $name:ident($($pname:ident: $pty:ty), *) $(-> $ret:ty)*;
311 pub fn $name($($pname: $pty), *) $(-> $ret)*;
318 pub fn is_loaded() -> bool { true }