onig_sys-69.9.1/.cargo_vcs_info.json0000644000000001460000000000100127750ustar { "git": { "sha1": "ed05d7ac1a1a138c6d9c46b451b9d9bea0fbe0b1" }, "path_in_vcs": "onig_sys" }onig_sys-69.9.1/Cargo.lock0000644000000200140000000000100107440ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "bindgen" version = "0.71.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" dependencies = [ "bitflags", "cexpr", "clang-sys", "itertools", "log", "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", "syn", ] [[package]] name = "bitflags" version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "cc" version = "1.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16595d3be041c03b09d08d0858631facccee9221e579704070e6e9e4915d3bc7" dependencies = [ "shlex", ] [[package]] name = "cexpr" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ "nom", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", "libloading", ] [[package]] name = "either" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "itertools" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] [[package]] name = "libc" version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libloading" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" dependencies = [ "cfg-if", "windows-targets", ] [[package]] name = "log" version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "nom" version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", ] [[package]] name = "onig_sys" version = "69.9.1" dependencies = [ "bindgen", "cc", "pkg-config", ] [[package]] name = "pkg-config" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "prettyplease" version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" dependencies = [ "proc-macro2", "syn", ] [[package]] name = "proc-macro2" version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] name = "regex" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-hash" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "syn" version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "unicode-ident" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "windows-targets" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] name = "windows_aarch64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" [[package]] name = "windows_i686_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[package]] name = "windows_i686_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[package]] name = "windows_x86_64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" onig_sys-69.9.1/Cargo.toml0000644000000030770000000000100110010ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70.0" name = "onig_sys" version = "69.9.1" authors = [ "Will Speak ", "Ivan Ivashchenko ", ] build = "build.rs" links = "onig" autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = """ The `onig_sys` crate contains raw rust bindings to the oniguruma library. This crate exposes a set of unsafe functions which can then be used by other crates to create safe wrappers around Oniguruma. You probably don't want to link to this crate directly; instead check out the `onig` crate. """ documentation = "https://rust-onig.github.io/rust-onig/onig_sys/" readme = "README.md" categories = ["external-ffi-bindings"] license = "MIT" repository = "https://github.com/iwillspeak/rust-onig" [features] default = ["generate"] generate = ["bindgen"] posix-api = [] print-debug = [] [lib] name = "onig_sys" path = "src/lib.rs" [build-dependencies.bindgen] version = "0.71" features = ["runtime"] optional = true [build-dependencies.cc] version = "1.0" [build-dependencies.pkg-config] version = "^0.3.16" onig_sys-69.9.1/Cargo.toml.orig0000644000000021170000000000100117320ustar [package] name = "onig_sys" version = "69.9.1" edition = "2021" rust-version = "1.70.0" authors = [ "Will Speak ", "Ivan Ivashchenko " ] build = "build.rs" links = "onig" description = """ The `onig_sys` crate contains raw rust bindings to the oniguruma library. This crate exposes a set of unsafe functions which can then be used by other crates to create safe wrappers around Oniguruma. You probably don't want to link to this crate directly; instead check out the `onig` crate. """ categories = ["external-ffi-bindings"] repository = "https://github.com/iwillspeak/rust-onig" documentation = "https://rust-onig.github.io/rust-onig/onig_sys/" readme = "../README.md" license = "MIT" [build-dependencies] bindgen = { version = "0.71", optional = true, features = [ "runtime" ] } pkg-config = "^0.3.16" cc = "1.0" [features] default = ["generate"] # Make Oniguruma print debug output for parsing/compiling and executing print-debug = [] # include regexec(), which conflicts with libgit2 posix-api = [] # generate bindings with bindgen generate = ["bindgen"] onig_sys-69.9.1/Cargo.toml.orig000064400000000000000000000021171046102023000144540ustar 00000000000000[package] name = "onig_sys" version = "69.9.1" edition = "2021" rust-version = "1.70.0" authors = [ "Will Speak ", "Ivan Ivashchenko " ] build = "build.rs" links = "onig" description = """ The `onig_sys` crate contains raw rust bindings to the oniguruma library. This crate exposes a set of unsafe functions which can then be used by other crates to create safe wrappers around Oniguruma. You probably don't want to link to this crate directly; instead check out the `onig` crate. """ categories = ["external-ffi-bindings"] repository = "https://github.com/iwillspeak/rust-onig" documentation = "https://rust-onig.github.io/rust-onig/onig_sys/" readme = "../README.md" license = "MIT" [build-dependencies] bindgen = { version = "0.71", optional = true, features = [ "runtime" ] } pkg-config = "^0.3.16" cc = "1.0" [features] default = ["generate"] # Make Oniguruma print debug output for parsing/compiling and executing print-debug = [] # include regexec(), which conflicts with libgit2 posix-api = [] # generate bindings with bindgen generate = ["bindgen"] onig_sys-69.9.1/LICENSE.md000064400000000000000000000027471046102023000132020ustar 00000000000000# Rust-Onig is Open Source! All source code in this repository is distributed under the terms of the *MIT License* unless otherwise stated. The Oniguruma source code remains the property of the original authors and is re-distributed under the original license, see [COPYING](oniguruma/COPYING) for more information. > The MIT License (MIT) > > Copyright (c) 2015 Will Speak , Ivan Ivashchenko > , and contributors. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all > copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > SOFTWARE. onig_sys-69.9.1/README.md000064400000000000000000000106421046102023000130460ustar 00000000000000``# Rust Onig [![Cargo](https://img.shields.io/crates/v/onig.svg)]( https://crates.io/crates/onig) [![Documentation](https://docs.rs/onig/badge.svg)]( https://docs.rs/onig) ![CI](https://github.com/rust-onig/rust-onig/workflows/CI/badge.svg) [![Build status](https://ci.appveyor.com/api/projects/status/7qxdb44xpw4bkjfi/branch/main?svg=true)](https://ci.appveyor.com/project/iwillspeak/rust-onig/branch/main) [![dependency status](https://deps.rs/crate/onig/6.4.0/status.svg)](https://deps.rs/crate/onig/6.4.0) Rust bindings for the [Oniguruma regex library][Onig_wiki], a powerful and mature regular expression library with support for a wide range of character sets and language syntaxes. Oniguruma is written in C. This repository provides two crates: `onig-sys` which provides the raw Rust FFI bindings, and `onig`, which provides a safe Rust wrapper around them. ## Documentation Check out the [module documentation][onig_crate_doc] to find out all the features that are available. To see some example usage of this crate take a look a the [examples folder][examples_folder]. The examples can be run from the command line with `cargo run --example `. ## Getting Started Add the following to your `Cargo.toml` file: ```toml [dependencies] onig = "6" ``` Add the following extern to your crate root if you are not using edition 2018: ```rust extern crate onig; ``` You can compile simple regular expressions with [`Regex::new`][regex_new], check if the pattern matches an entire `&str` with [`Regex::is_match`][regex_is_match] and find matches within a `&str` with [`Regex::find`][regex_find]. The `onig` crate also supplies more powerful versions of these methods which expose the wide range of options Oniguruma provides. ```rust use onig::*; let regex = Regex::new("e(l+)").unwrap(); for (i, pos) in regex.captures("hello").unwrap().iter_pos().enumerate() { match pos { Some((beg, end)) => println!("Group {} captured in position {}:{}", i, beg, end), None => println!("Group {} is not captured", i) } } ``` ## Linking If a version of Oniguruma can be found by `pkg-config` then that will be used. If not then Oniguruma will be compiled from source and linked to the `onig-sys` crate. By default `rust-onig` will be statically linked to `libonig`. If you would rather that dynamic linking is used then the environment variables `RUSTONIG_STATIC_LIBONIG` and `RUSTONIG_DYNAMIC_LIBONIG` can be set. On *nix: $ RUSTONIG_DYNAMIC_LIBONIG=1 cargo build Or Windows: > set RUSTONIG_DYNAMIC_LIBONIG=1 > cargo build ## Build errors caused by libclang/llvm By default `onig` uses `bindgen` to generate bindings for libonig. If you plan to only use the bundled version of libonig, you can make compilation faster and more reliable by disabling the default `generate` feature: ```toml [dependencies] onig = { version = "6", default-features = false } ``` ## Debugging Sometimes it's useful to debug how Oniguruma parses, compiles, optimizes or executes a particular pattern. When activating the `print-debug` feature for this crate, Oniguruma is compiled with debugging. Note that it's a compile-time setting, so you also need to make `rust-onig` not use the system Oniguruma by using `RUSTONIG_SYSTEM_LIBONIG`. With all that combined, here's an example command to debug the pattern `a|b`: RUSTONIG_SYSTEM_LIBONIG=0 cargo run --features print-debug --example capturedump 'a|b' ## Supported Rust Versions Rust Onig supports Rust 1.70.0 or later (2021 edition) for Windows, Linux, and macOS. If the minimum supported rust version (MSRV) is changed then the minor version number will be increased. That is v6.5.x should always compile with the same version of the compiler. ## Rust-Onig is Open Source The contents of this repository are distributed under the MIT license. See [LICENSE](LICENSE.md) for more details. If you'd like to contribute take a look at our open [easy issues][easy_issues]. [Onig_wiki]: https://en.wikipedia.org/wiki/Oniguruma [onig_crate_doc]: https://docs.rs/onig/ [examples_folder]: https://github.com/rust-onig/rust-onig/tree/main/onig/examples [regex_new]: https://docs.rs/onig/6.4.0/onig/struct.Regex.html#method.new [regex_is_match]: https://docs.rs/onig/6.4.0/onig/struct.Regex.html#method.is_match [regex_find]: https://docs.rs/onig/6.4.0/onig/struct.Regex.html#method.find [easy_issues]: https://github.com/rust-onig/rust-onig/issues?q=is%3Aopen+is%3Aissue+label%3AE-Easy onig_sys-69.9.1/build.rs000064400000000000000000000174241046102023000132410ustar 00000000000000use pkg_config::Config; use std::env; use std::fmt; use std::fs; use std::path::Path; use std::path::PathBuf; /// # Link Type Enumeration /// /// Holds the different types of linking we support in this /// script. Used to keep track of what the default link type is and /// what override has been specified, if any, in the environment. #[derive(Eq, PartialEq)] enum LinkType { /// Static linking. This corresponds to the `static` type in Cargo. Static, /// Dynamic linking. This corresponds to the `dylib` type in Cargo. Dynamic, } impl fmt::Display for LinkType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "{}", match self { &LinkType::Static => "static", &LinkType::Dynamic => "dylib", } ) } } fn env_var_bool(name: &str) -> Option { if name.starts_with("RUSTONIG") { println!("cargo:rerun-if-env-changed={}", name); } env::var(name) .ok() .map(|s| match &s.to_string().to_lowercase()[..] { "0" | "no" | "false" => false, _ => true, }) } /// # Link Type Override /// /// Retuns the override from the environment, if any is set. fn link_type_override() -> Option { let dynamic_env = env_var_bool("RUSTONIG_DYNAMIC_LIBONIG").map(|b| match b { true => LinkType::Dynamic, false => LinkType::Static, }); let static_env = env_var_bool("RUSTONIG_STATIC_LIBONIG").map(|b| match b { true => LinkType::Static, false => LinkType::Dynamic, }); dynamic_env.or(static_env) } fn compile() { bindgen_headers("oniguruma/src/oniguruma.h"); let mut cc = cc::Build::new(); let out_dir = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR")); let ref src = Path::new("oniguruma").join("src"); let config_h = out_dir.join("config.h"); if env_var_bool("CARGO_FEATURE_PRINT_DEBUG").unwrap_or(false) { cc.define("ONIG_DEBUG_PARSE", Some("1")); cc.define("ONIG_DEBUG_COMPILE", Some("1")); cc.define("ONIG_DEBUG_SEARCH", Some("1")); cc.define("ONIG_DEBUG_MATCH", Some("1")); } if !src.exists() { panic!( "Unable to find source files in {}. Is oniguruma submodule checked out?\n\ Try git submodule init; git submodule update", src.display() ); } let arch = env::var("CARGO_CFG_TARGET_ARCH"); let os = env::var("CARGO_CFG_TARGET_OS"); let bits = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap(); if let Ok("windows") = os.as_ref().map(String::as_str) { fs::copy(src.join(format!("config.h.win{}", bits)), config_h) .expect("Can't copy config.h.win??"); } else { let family = env::var("CARGO_CFG_TARGET_FAMILY"); if let Ok("unix") = family.as_ref().map(String::as_str) { cc.define("HAVE_UNISTD_H", Some("1")); cc.define("HAVE_SYS_TYPES_H", Some("1")); cc.define("HAVE_SYS_TIME_H", Some("1")); } // Can't use size_of::(), because it'd refer to build arch, not target arch. // so instead assume it's a non-exotic target (LP32/LP64). fs::write( config_h, format!( " #define HAVE_PROTOTYPES 1 #define STDC_HEADERS 1 #define HAVE_STRING_H 1 #define HAVE_STDARG_H 1 #define HAVE_STDLIB_H 1 #define HAVE_LIMITS_H 1 #define HAVE_INTTYPES_H 1 #define SIZEOF_INT 4 #define SIZEOF_SHORT 2 #define SIZEOF_LONG {0} #define SIZEOF_VOIDP {0} #define SIZEOF_LONG_LONG 8 ", if bits == "64" { "8" } else { "4" } ), ) .expect("Can't write config.h to OUT_DIR"); } if let Ok("wasm32") = arch.as_ref().map(String::as_str) { cc.define("ONIG_DISABLE_DIRECT_THREADING", Some("1")); if let Ok("unknown") = os.as_ref().map(String::as_str) { cc.define( "ONIG_EXTERN", Some(r#"__attribute__((visibility("default")))"#), ); } } cc.include(out_dir); // Read config.h from there cc.include(src); let files = [ "regexec.c", "regerror.c", "regparse.c", "regext.c", "regcomp.c", "reggnu.c", "regenc.c", "regsyntax.c", "regtrav.c", "regversion.c", "st.c", "onig_init.c", "unicode.c", "ascii.c", "utf8.c", "utf16_be.c", "utf16_le.c", "utf32_be.c", "utf32_le.c", "euc_jp.c", "sjis.c", "iso8859_1.c", "iso8859_2.c", "iso8859_3.c", "iso8859_4.c", "iso8859_5.c", "iso8859_6.c", "iso8859_7.c", "iso8859_8.c", "iso8859_9.c", "iso8859_10.c", "iso8859_11.c", "iso8859_13.c", "iso8859_14.c", "iso8859_15.c", "iso8859_16.c", "euc_tw.c", "euc_kr.c", "big5.c", "gb18030.c", "koi8_r.c", "cp1251.c", "euc_jp_prop.c", "sjis_prop.c", "unicode_unfold_key.c", "unicode_fold1_key.c", "unicode_fold2_key.c", "unicode_fold3_key.c", ]; for file in files.iter() { cc.file(src.join(file)); } if cfg!(feature = "posix-api") { cc.file(src.join("regposix.c")); cc.file(src.join("regposerr.c")); } cc.warnings(false); // not actionable by the end user cc.compile("onig"); } #[cfg(not(feature = "generate"))] fn bindgen_headers(_path: &str) {} #[cfg(feature = "generate")] fn bindgen_headers(path: &str) { let arch = env::var("CARGO_CFG_TARGET_ARCH"); let mut bindgen = bindgen::Builder::default() .header(path) .derive_eq(true) .rust_target("1.70.0".parse().unwrap()) .rust_edition("2021".parse().unwrap()) .layout_tests(false); if let Ok("wasm32") = arch.as_ref().map(String::as_str) { bindgen = bindgen.clang_arg("-fvisibility=default"); } let bindings = bindgen.generate().expect("bindgen"); let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR"); let out_path = Path::new(&out_dir); bindings .write_to_file(out_path.join("bindings.rs")) .expect("Couldn't write bindings!"); } pub fn main() { let link_type = link_type_override(); let require_pkg_config = env_var_bool("RUSTONIG_SYSTEM_LIBONIG").unwrap_or(false); if require_pkg_config || link_type == Some(LinkType::Dynamic) { let mut conf = Config::new(); // dynamically-generated headers can work with an older version // pre-generated headers are for the latest conf.atleast_version(if cfg!(feature = "generate") { "6.8.0" } else { "6.9.3" }); if link_type == Some(LinkType::Static) { conf.statik(true); } match conf.probe("oniguruma") { Ok(lib) => { for path in &lib.include_paths { let header = path.join("oniguruma.h"); if header.exists() { bindgen_headers(&header.display().to_string()); return; } } if require_pkg_config { panic!( "Unable to find oniguruma.h in include paths from pkg-config: {:?}", lib.include_paths ); } } Err(ref err) if require_pkg_config => { panic!("Unable to find oniguruma in pkg-config, and RUSTONIG_SYSTEM_LIBONIG is set: {}", err); } _ => {} } } compile(); } onig_sys-69.9.1/src/bindgened.rs000064400000000000000000000002501046102023000146350ustar 00000000000000#![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(clippy::all)] include!(concat!(env!("OUT_DIR"), "/bindings.rs")); onig_sys-69.9.1/src/ffi.rs000064400000000000000000001405511046102023000134730ustar 00000000000000/* automatically generated by rust-bindgen 0.60.1 */ pub const ONIGURUMA_VERSION_MAJOR: u32 = 6; pub const ONIGURUMA_VERSION_MINOR: u32 = 9; pub const ONIGURUMA_VERSION_TEENY: u32 = 8; pub const ONIGURUMA_VERSION_INT: u32 = 60908; pub const ONIGENC_CASE_FOLD_ASCII_ONLY: u32 = 1; pub const ONIGENC_CASE_FOLD_TURKISH_AZERI: u32 = 1048576; pub const INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR: u32 = 1073741824; pub const ONIGENC_CASE_FOLD_MIN: u32 = 1073741824; pub const ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN: u32 = 3; pub const ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM: u32 = 13; pub const ONIGENC_CODE_TO_MBC_MAXLEN: u32 = 7; pub const ONIGENC_MBC_CASE_FOLD_MAXLEN: u32 = 18; pub const ONIG_NREGION: u32 = 10; pub const ONIG_MAX_CAPTURE_NUM: u32 = 2147483647; pub const ONIG_MAX_BACKREF_NUM: u32 = 1000; pub const ONIG_MAX_REPEAT_NUM: u32 = 100000; pub const ONIG_MAX_MULTI_BYTE_RANGES_NUM: u32 = 10000; pub const ONIG_MAX_ERROR_MESSAGE_LEN: u32 = 90; pub const ONIG_OPTION_NONE: u32 = 0; pub const ONIG_OPTION_IGNORECASE: u32 = 1; pub const ONIG_OPTION_EXTEND: u32 = 2; pub const ONIG_OPTION_MULTILINE: u32 = 4; pub const ONIG_OPTION_SINGLELINE: u32 = 8; pub const ONIG_OPTION_FIND_LONGEST: u32 = 16; pub const ONIG_OPTION_FIND_NOT_EMPTY: u32 = 32; pub const ONIG_OPTION_NEGATE_SINGLELINE: u32 = 64; pub const ONIG_OPTION_DONT_CAPTURE_GROUP: u32 = 128; pub const ONIG_OPTION_CAPTURE_GROUP: u32 = 256; pub const ONIG_OPTION_NOTBOL: u32 = 512; pub const ONIG_OPTION_NOTEOL: u32 = 1024; pub const ONIG_OPTION_POSIX_REGION: u32 = 2048; pub const ONIG_OPTION_CHECK_VALIDITY_OF_STRING: u32 = 4096; pub const ONIG_OPTION_IGNORECASE_IS_ASCII: u32 = 32768; pub const ONIG_OPTION_WORD_IS_ASCII: u32 = 65536; pub const ONIG_OPTION_DIGIT_IS_ASCII: u32 = 131072; pub const ONIG_OPTION_SPACE_IS_ASCII: u32 = 262144; pub const ONIG_OPTION_POSIX_IS_ASCII: u32 = 524288; pub const ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER: u32 = 1048576; pub const ONIG_OPTION_TEXT_SEGMENT_WORD: u32 = 2097152; pub const ONIG_OPTION_NOT_BEGIN_STRING: u32 = 4194304; pub const ONIG_OPTION_NOT_END_STRING: u32 = 8388608; pub const ONIG_OPTION_NOT_BEGIN_POSITION: u32 = 16777216; pub const ONIG_OPTION_CALLBACK_EACH_MATCH: u32 = 33554432; pub const ONIG_OPTION_MATCH_WHOLE_STRING: u32 = 67108864; pub const ONIG_OPTION_MAXBIT: u32 = 67108864; pub const ONIG_SYN_OP_VARIABLE_META_CHARACTERS: u32 = 1; pub const ONIG_SYN_OP_DOT_ANYCHAR: u32 = 2; pub const ONIG_SYN_OP_ASTERISK_ZERO_INF: u32 = 4; pub const ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF: u32 = 8; pub const ONIG_SYN_OP_PLUS_ONE_INF: u32 = 16; pub const ONIG_SYN_OP_ESC_PLUS_ONE_INF: u32 = 32; pub const ONIG_SYN_OP_QMARK_ZERO_ONE: u32 = 64; pub const ONIG_SYN_OP_ESC_QMARK_ZERO_ONE: u32 = 128; pub const ONIG_SYN_OP_BRACE_INTERVAL: u32 = 256; pub const ONIG_SYN_OP_ESC_BRACE_INTERVAL: u32 = 512; pub const ONIG_SYN_OP_VBAR_ALT: u32 = 1024; pub const ONIG_SYN_OP_ESC_VBAR_ALT: u32 = 2048; pub const ONIG_SYN_OP_LPAREN_SUBEXP: u32 = 4096; pub const ONIG_SYN_OP_ESC_LPAREN_SUBEXP: u32 = 8192; pub const ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR: u32 = 16384; pub const ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR: u32 = 32768; pub const ONIG_SYN_OP_DECIMAL_BACKREF: u32 = 65536; pub const ONIG_SYN_OP_BRACKET_CC: u32 = 131072; pub const ONIG_SYN_OP_ESC_W_WORD: u32 = 262144; pub const ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END: u32 = 524288; pub const ONIG_SYN_OP_ESC_B_WORD_BOUND: u32 = 1048576; pub const ONIG_SYN_OP_ESC_S_WHITE_SPACE: u32 = 2097152; pub const ONIG_SYN_OP_ESC_D_DIGIT: u32 = 4194304; pub const ONIG_SYN_OP_LINE_ANCHOR: u32 = 8388608; pub const ONIG_SYN_OP_POSIX_BRACKET: u32 = 16777216; pub const ONIG_SYN_OP_QMARK_NON_GREEDY: u32 = 33554432; pub const ONIG_SYN_OP_ESC_CONTROL_CHARS: u32 = 67108864; pub const ONIG_SYN_OP_ESC_C_CONTROL: u32 = 134217728; pub const ONIG_SYN_OP_ESC_OCTAL3: u32 = 268435456; pub const ONIG_SYN_OP_ESC_X_HEX2: u32 = 536870912; pub const ONIG_SYN_OP_ESC_X_BRACE_HEX8: u32 = 1073741824; pub const ONIG_SYN_OP_ESC_O_BRACE_OCTAL: u32 = 2147483648; pub const ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE: u32 = 1; pub const ONIG_SYN_OP2_QMARK_GROUP_EFFECT: u32 = 2; pub const ONIG_SYN_OP2_OPTION_PERL: u32 = 4; pub const ONIG_SYN_OP2_OPTION_RUBY: u32 = 8; pub const ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT: u32 = 16; pub const ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL: u32 = 32; pub const ONIG_SYN_OP2_CCLASS_SET_OP: u32 = 64; pub const ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP: u32 = 128; pub const ONIG_SYN_OP2_ESC_K_NAMED_BACKREF: u32 = 256; pub const ONIG_SYN_OP2_ESC_G_SUBEXP_CALL: u32 = 512; pub const ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY: u32 = 1024; pub const ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL: u32 = 2048; pub const ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META: u32 = 4096; pub const ONIG_SYN_OP2_ESC_V_VTAB: u32 = 8192; pub const ONIG_SYN_OP2_ESC_U_HEX4: u32 = 16384; pub const ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR: u32 = 32768; pub const ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY: u32 = 65536; pub const ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT: u32 = 131072; pub const ONIG_SYN_OP2_ESC_H_XDIGIT: u32 = 524288; pub const ONIG_SYN_OP2_INEFFECTIVE_ESCAPE: u32 = 1048576; pub const ONIG_SYN_OP2_QMARK_LPAREN_IF_ELSE: u32 = 2097152; pub const ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP: u32 = 4194304; pub const ONIG_SYN_OP2_ESC_CAPITAL_R_GENERAL_NEWLINE: u32 = 8388608; pub const ONIG_SYN_OP2_ESC_CAPITAL_N_O_SUPER_DOT: u32 = 16777216; pub const ONIG_SYN_OP2_QMARK_TILDE_ABSENT_GROUP: u32 = 33554432; pub const ONIG_SYN_OP2_ESC_X_Y_GRAPHEME_CLUSTER: u32 = 67108864; pub const ONIG_SYN_OP2_ESC_X_Y_TEXT_SEGMENT: u32 = 67108864; pub const ONIG_SYN_OP2_QMARK_PERL_SUBEXP_CALL: u32 = 134217728; pub const ONIG_SYN_OP2_QMARK_BRACE_CALLOUT_CONTENTS: u32 = 268435456; pub const ONIG_SYN_OP2_ASTERISK_CALLOUT_NAME: u32 = 536870912; pub const ONIG_SYN_OP2_OPTION_ONIGURUMA: u32 = 1073741824; pub const ONIG_SYN_OP2_QMARK_CAPITAL_P_NAME: u32 = 2147483648; pub const ONIG_SYN_CONTEXT_INDEP_ANCHORS: u32 = 2147483648; pub const ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS: u32 = 1; pub const ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS: u32 = 2; pub const ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP: u32 = 4; pub const ONIG_SYN_ALLOW_INVALID_INTERVAL: u32 = 8; pub const ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV: u32 = 16; pub const ONIG_SYN_STRICT_CHECK_BACKREF: u32 = 32; pub const ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND: u32 = 64; pub const ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP: u32 = 128; pub const ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME: u32 = 256; pub const ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY: u32 = 512; pub const ONIG_SYN_ISOLATED_OPTION_CONTINUE_BRANCH: u32 = 1024; pub const ONIG_SYN_VARIABLE_LEN_LOOK_BEHIND: u32 = 2048; pub const ONIG_SYN_PYTHON: u32 = 4096; pub const ONIG_SYN_WHOLE_OPTIONS: u32 = 8192; pub const ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC: u32 = 1048576; pub const ONIG_SYN_BACKSLASH_ESCAPE_IN_CC: u32 = 2097152; pub const ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC: u32 = 4194304; pub const ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC: u32 = 8388608; pub const ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC: u32 = 67108864; pub const ONIG_SYN_WARN_CC_OP_NOT_ESCAPED: u32 = 16777216; pub const ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT: u32 = 33554432; pub const ONIG_META_CHAR_ESCAPE: u32 = 0; pub const ONIG_META_CHAR_ANYCHAR: u32 = 1; pub const ONIG_META_CHAR_ANYTIME: u32 = 2; pub const ONIG_META_CHAR_ZERO_OR_ONE_TIME: u32 = 3; pub const ONIG_META_CHAR_ONE_OR_MORE_TIME: u32 = 4; pub const ONIG_META_CHAR_ANYCHAR_ANYTIME: u32 = 5; pub const ONIG_INEFFECTIVE_META_CHAR: u32 = 0; pub const ONIG_NORMAL: u32 = 0; pub const ONIG_VALUE_IS_NOT_SET: u32 = 1; pub const ONIG_MISMATCH: i32 = -1; pub const ONIG_NO_SUPPORT_CONFIG: i32 = -2; pub const ONIG_ABORT: i32 = -3; pub const ONIGERR_MEMORY: i32 = -5; pub const ONIGERR_TYPE_BUG: i32 = -6; pub const ONIGERR_PARSER_BUG: i32 = -11; pub const ONIGERR_STACK_BUG: i32 = -12; pub const ONIGERR_UNDEFINED_BYTECODE: i32 = -13; pub const ONIGERR_UNEXPECTED_BYTECODE: i32 = -14; pub const ONIGERR_MATCH_STACK_LIMIT_OVER: i32 = -15; pub const ONIGERR_PARSE_DEPTH_LIMIT_OVER: i32 = -16; pub const ONIGERR_RETRY_LIMIT_IN_MATCH_OVER: i32 = -17; pub const ONIGERR_RETRY_LIMIT_IN_SEARCH_OVER: i32 = -18; pub const ONIGERR_SUBEXP_CALL_LIMIT_IN_SEARCH_OVER: i32 = -19; pub const ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED: i32 = -21; pub const ONIGERR_DEFAULT_ENCODING_IS_NOT_SET: i32 = -21; pub const ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR: i32 = -22; pub const ONIGERR_FAIL_TO_INITIALIZE: i32 = -23; pub const ONIGERR_INVALID_ARGUMENT: i32 = -30; pub const ONIGERR_END_PATTERN_AT_LEFT_BRACE: i32 = -100; pub const ONIGERR_END_PATTERN_AT_LEFT_BRACKET: i32 = -101; pub const ONIGERR_EMPTY_CHAR_CLASS: i32 = -102; pub const ONIGERR_PREMATURE_END_OF_CHAR_CLASS: i32 = -103; pub const ONIGERR_END_PATTERN_AT_ESCAPE: i32 = -104; pub const ONIGERR_END_PATTERN_AT_META: i32 = -105; pub const ONIGERR_END_PATTERN_AT_CONTROL: i32 = -106; pub const ONIGERR_META_CODE_SYNTAX: i32 = -108; pub const ONIGERR_CONTROL_CODE_SYNTAX: i32 = -109; pub const ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE: i32 = -110; pub const ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE: i32 = -111; pub const ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS: i32 = -112; pub const ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED: i32 = -113; pub const ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID: i32 = -114; pub const ONIGERR_NESTED_REPEAT_OPERATOR: i32 = -115; pub const ONIGERR_UNMATCHED_CLOSE_PARENTHESIS: i32 = -116; pub const ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS: i32 = -117; pub const ONIGERR_END_PATTERN_IN_GROUP: i32 = -118; pub const ONIGERR_UNDEFINED_GROUP_OPTION: i32 = -119; pub const ONIGERR_INVALID_GROUP_OPTION: i32 = -120; pub const ONIGERR_INVALID_POSIX_BRACKET_TYPE: i32 = -121; pub const ONIGERR_INVALID_LOOK_BEHIND_PATTERN: i32 = -122; pub const ONIGERR_INVALID_REPEAT_RANGE_PATTERN: i32 = -123; pub const ONIGERR_TOO_BIG_NUMBER: i32 = -200; pub const ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE: i32 = -201; pub const ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE: i32 = -202; pub const ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS: i32 = -203; pub const ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE: i32 = -204; pub const ONIGERR_TOO_MANY_MULTI_BYTE_RANGES: i32 = -205; pub const ONIGERR_TOO_SHORT_MULTI_BYTE_STRING: i32 = -206; pub const ONIGERR_TOO_BIG_BACKREF_NUMBER: i32 = -207; pub const ONIGERR_INVALID_BACKREF: i32 = -208; pub const ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED: i32 = -209; pub const ONIGERR_TOO_MANY_CAPTURES: i32 = -210; pub const ONIGERR_TOO_LONG_WIDE_CHAR_VALUE: i32 = -212; pub const ONIGERR_UNDEFINED_OPERATOR: i32 = -213; pub const ONIGERR_EMPTY_GROUP_NAME: i32 = -214; pub const ONIGERR_INVALID_GROUP_NAME: i32 = -215; pub const ONIGERR_INVALID_CHAR_IN_GROUP_NAME: i32 = -216; pub const ONIGERR_UNDEFINED_NAME_REFERENCE: i32 = -217; pub const ONIGERR_UNDEFINED_GROUP_REFERENCE: i32 = -218; pub const ONIGERR_MULTIPLEX_DEFINED_NAME: i32 = -219; pub const ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL: i32 = -220; pub const ONIGERR_NEVER_ENDING_RECURSION: i32 = -221; pub const ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY: i32 = -222; pub const ONIGERR_INVALID_CHAR_PROPERTY_NAME: i32 = -223; pub const ONIGERR_INVALID_IF_ELSE_SYNTAX: i32 = -224; pub const ONIGERR_INVALID_ABSENT_GROUP_PATTERN: i32 = -225; pub const ONIGERR_INVALID_ABSENT_GROUP_GENERATOR_PATTERN: i32 = -226; pub const ONIGERR_INVALID_CALLOUT_PATTERN: i32 = -227; pub const ONIGERR_INVALID_CALLOUT_NAME: i32 = -228; pub const ONIGERR_UNDEFINED_CALLOUT_NAME: i32 = -229; pub const ONIGERR_INVALID_CALLOUT_BODY: i32 = -230; pub const ONIGERR_INVALID_CALLOUT_TAG_NAME: i32 = -231; pub const ONIGERR_INVALID_CALLOUT_ARG: i32 = -232; pub const ONIGERR_INVALID_CODE_POINT_VALUE: i32 = -400; pub const ONIGERR_INVALID_WIDE_CHAR_VALUE: i32 = -400; pub const ONIGERR_TOO_BIG_WIDE_CHAR_VALUE: i32 = -401; pub const ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION: i32 = -402; pub const ONIGERR_INVALID_COMBINATION_OF_OPTIONS: i32 = -403; pub const ONIGERR_TOO_MANY_USER_DEFINED_OBJECTS: i32 = -404; pub const ONIGERR_TOO_LONG_PROPERTY_NAME: i32 = -405; pub const ONIGERR_VERY_INEFFICIENT_PATTERN: i32 = -406; pub const ONIGERR_LIBRARY_IS_NOT_INITIALIZED: i32 = -500; pub const ONIG_MAX_CAPTURE_HISTORY_GROUP: u32 = 31; pub const ONIG_TRAVERSE_CALLBACK_AT_FIRST: u32 = 1; pub const ONIG_TRAVERSE_CALLBACK_AT_LAST: u32 = 2; pub const ONIG_TRAVERSE_CALLBACK_AT_BOTH: u32 = 3; pub const ONIG_REGION_NOTPOS: i32 = -1; pub const ONIG_CHAR_TABLE_SIZE: u32 = 256; pub const ONIG_NON_NAME_ID: i32 = -1; pub const ONIG_NON_CALLOUT_NUM: u32 = 0; pub const ONIG_CALLOUT_MAX_ARGS_NUM: u32 = 4; pub const ONIG_CALLOUT_DATA_SLOT_NUM: u32 = 5; pub type OnigCodePoint = ::std::os::raw::c_uint; pub type OnigUChar = ::std::os::raw::c_uchar; pub type OnigCtype = ::std::os::raw::c_uint; pub type OnigLen = ::std::os::raw::c_uint; pub type OnigCaseFoldType = ::std::os::raw::c_uint; extern "C" { pub static mut OnigDefaultCaseFoldFlag: OnigCaseFoldType; } #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigCaseFoldCodeItem { pub byte_len: ::std::os::raw::c_int, pub code_len: ::std::os::raw::c_int, pub code: [OnigCodePoint; 3usize], } #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigMetaCharTableType { pub esc: OnigCodePoint, pub anychar: OnigCodePoint, pub anytime: OnigCodePoint, pub zero_or_one_time: OnigCodePoint, pub one_or_more_time: OnigCodePoint, pub anychar_anytime: OnigCodePoint, } pub type OnigApplyAllCaseFoldFunc = ::std::option::Option< unsafe extern "C" fn( from: OnigCodePoint, to: *mut OnigCodePoint, to_len: ::std::os::raw::c_int, arg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigEncodingTypeST { pub mbc_enc_len: ::std::option::Option ::std::os::raw::c_int>, pub name: *const ::std::os::raw::c_char, pub max_enc_len: ::std::os::raw::c_int, pub min_enc_len: ::std::os::raw::c_int, pub is_mbc_newline: ::std::option::Option< unsafe extern "C" fn(p: *const OnigUChar, end: *const OnigUChar) -> ::std::os::raw::c_int, >, pub mbc_to_code: ::std::option::Option< unsafe extern "C" fn(p: *const OnigUChar, end: *const OnigUChar) -> OnigCodePoint, >, pub code_to_mbclen: ::std::option::Option ::std::os::raw::c_int>, pub code_to_mbc: ::std::option::Option< unsafe extern "C" fn(code: OnigCodePoint, buf: *mut OnigUChar) -> ::std::os::raw::c_int, >, pub mbc_case_fold: ::std::option::Option< unsafe extern "C" fn( flag: OnigCaseFoldType, pp: *mut *const OnigUChar, end: *const OnigUChar, to: *mut OnigUChar, ) -> ::std::os::raw::c_int, >, pub apply_all_case_fold: ::std::option::Option< unsafe extern "C" fn( flag: OnigCaseFoldType, f: OnigApplyAllCaseFoldFunc, arg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, pub get_case_fold_codes_by_str: ::std::option::Option< unsafe extern "C" fn( flag: OnigCaseFoldType, p: *const OnigUChar, end: *const OnigUChar, acs: *mut OnigCaseFoldCodeItem, ) -> ::std::os::raw::c_int, >, pub property_name_to_ctype: ::std::option::Option< unsafe extern "C" fn( enc: *mut OnigEncodingTypeST, p: *mut OnigUChar, end: *mut OnigUChar, ) -> ::std::os::raw::c_int, >, pub is_code_ctype: ::std::option::Option< unsafe extern "C" fn(code: OnigCodePoint, ctype: OnigCtype) -> ::std::os::raw::c_int, >, pub get_ctype_code_range: ::std::option::Option< unsafe extern "C" fn( ctype: OnigCtype, sb_out: *mut OnigCodePoint, ranges: *mut *const OnigCodePoint, ) -> ::std::os::raw::c_int, >, pub left_adjust_char_head: ::std::option::Option< unsafe extern "C" fn(start: *const OnigUChar, p: *const OnigUChar) -> *mut OnigUChar, >, pub is_allowed_reverse_match: ::std::option::Option< unsafe extern "C" fn(p: *const OnigUChar, end: *const OnigUChar) -> ::std::os::raw::c_int, >, pub init: ::std::option::Option ::std::os::raw::c_int>, pub is_initialized: ::std::option::Option ::std::os::raw::c_int>, pub is_valid_mbc_string: ::std::option::Option< unsafe extern "C" fn(s: *const OnigUChar, end: *const OnigUChar) -> ::std::os::raw::c_int, >, pub flag: ::std::os::raw::c_uint, pub sb_range: OnigCodePoint, pub index: ::std::os::raw::c_int, } pub type OnigEncodingType = OnigEncodingTypeST; pub type OnigEncoding = *mut OnigEncodingType; extern "C" { pub static mut OnigEncodingASCII: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_1: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_2: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_3: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_4: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_5: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_6: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_7: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_8: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_9: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_10: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_11: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_13: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_14: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_15: OnigEncodingType; } extern "C" { pub static mut OnigEncodingISO_8859_16: OnigEncodingType; } extern "C" { pub static mut OnigEncodingUTF8: OnigEncodingType; } extern "C" { pub static mut OnigEncodingUTF16_BE: OnigEncodingType; } extern "C" { pub static mut OnigEncodingUTF16_LE: OnigEncodingType; } extern "C" { pub static mut OnigEncodingUTF32_BE: OnigEncodingType; } extern "C" { pub static mut OnigEncodingUTF32_LE: OnigEncodingType; } extern "C" { pub static mut OnigEncodingEUC_JP: OnigEncodingType; } extern "C" { pub static mut OnigEncodingEUC_TW: OnigEncodingType; } extern "C" { pub static mut OnigEncodingEUC_KR: OnigEncodingType; } extern "C" { pub static mut OnigEncodingEUC_CN: OnigEncodingType; } extern "C" { pub static mut OnigEncodingSJIS: OnigEncodingType; } extern "C" { pub static mut OnigEncodingKOI8: OnigEncodingType; } extern "C" { pub static mut OnigEncodingKOI8_R: OnigEncodingType; } extern "C" { pub static mut OnigEncodingCP1251: OnigEncodingType; } extern "C" { pub static mut OnigEncodingBIG5: OnigEncodingType; } extern "C" { pub static mut OnigEncodingGB18030: OnigEncodingType; } pub const OnigEncCtype_ONIGENC_CTYPE_NEWLINE: OnigEncCtype = 0; pub const OnigEncCtype_ONIGENC_CTYPE_ALPHA: OnigEncCtype = 1; pub const OnigEncCtype_ONIGENC_CTYPE_BLANK: OnigEncCtype = 2; pub const OnigEncCtype_ONIGENC_CTYPE_CNTRL: OnigEncCtype = 3; pub const OnigEncCtype_ONIGENC_CTYPE_DIGIT: OnigEncCtype = 4; pub const OnigEncCtype_ONIGENC_CTYPE_GRAPH: OnigEncCtype = 5; pub const OnigEncCtype_ONIGENC_CTYPE_LOWER: OnigEncCtype = 6; pub const OnigEncCtype_ONIGENC_CTYPE_PRINT: OnigEncCtype = 7; pub const OnigEncCtype_ONIGENC_CTYPE_PUNCT: OnigEncCtype = 8; pub const OnigEncCtype_ONIGENC_CTYPE_SPACE: OnigEncCtype = 9; pub const OnigEncCtype_ONIGENC_CTYPE_UPPER: OnigEncCtype = 10; pub const OnigEncCtype_ONIGENC_CTYPE_XDIGIT: OnigEncCtype = 11; pub const OnigEncCtype_ONIGENC_CTYPE_WORD: OnigEncCtype = 12; pub const OnigEncCtype_ONIGENC_CTYPE_ALNUM: OnigEncCtype = 13; pub const OnigEncCtype_ONIGENC_CTYPE_ASCII: OnigEncCtype = 14; pub type OnigEncCtype = ::std::os::raw::c_uint; extern "C" { pub fn onigenc_step_back( enc: OnigEncoding, start: *const OnigUChar, s: *const OnigUChar, n: ::std::os::raw::c_int, ) -> *mut OnigUChar; } extern "C" { pub fn onigenc_init() -> ::std::os::raw::c_int; } extern "C" { pub fn onig_initialize_encoding(enc: OnigEncoding) -> ::std::os::raw::c_int; } extern "C" { pub fn onigenc_set_default_encoding(enc: OnigEncoding) -> ::std::os::raw::c_int; } extern "C" { pub fn onigenc_get_default_encoding() -> OnigEncoding; } extern "C" { pub fn onigenc_set_default_caseconv_table(table: *const OnigUChar); } extern "C" { pub fn onigenc_get_right_adjust_char_head_with_prev( enc: OnigEncoding, start: *const OnigUChar, s: *const OnigUChar, prev: *mut *const OnigUChar, ) -> *mut OnigUChar; } extern "C" { pub fn onigenc_get_prev_char_head( enc: OnigEncoding, start: *const OnigUChar, s: *const OnigUChar, ) -> *mut OnigUChar; } extern "C" { pub fn onigenc_get_left_adjust_char_head( enc: OnigEncoding, start: *const OnigUChar, s: *const OnigUChar, ) -> *mut OnigUChar; } extern "C" { pub fn onigenc_get_right_adjust_char_head( enc: OnigEncoding, start: *const OnigUChar, s: *const OnigUChar, ) -> *mut OnigUChar; } extern "C" { pub fn onigenc_strlen( enc: OnigEncoding, p: *const OnigUChar, end: *const OnigUChar, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onigenc_strlen_null(enc: OnigEncoding, p: *const OnigUChar) -> ::std::os::raw::c_int; } extern "C" { pub fn onigenc_str_bytelen_null( enc: OnigEncoding, p: *const OnigUChar, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onigenc_is_valid_mbc_string( enc: OnigEncoding, s: *const OnigUChar, end: *const OnigUChar, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onigenc_strdup( enc: OnigEncoding, s: *const OnigUChar, end: *const OnigUChar, ) -> *mut OnigUChar; } pub type OnigOptionType = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigSyntaxType { pub op: ::std::os::raw::c_uint, pub op2: ::std::os::raw::c_uint, pub behavior: ::std::os::raw::c_uint, pub options: OnigOptionType, pub meta_char_table: OnigMetaCharTableType, } extern "C" { pub static mut OnigSyntaxASIS: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxPosixBasic: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxPosixExtended: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxEmacs: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxGrep: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxGnuRegex: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxJava: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxPerl: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxPerl_NG: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxRuby: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxPython: OnigSyntaxType; } extern "C" { pub static mut OnigSyntaxOniguruma: OnigSyntaxType; } extern "C" { pub static mut OnigDefaultSyntax: *mut OnigSyntaxType; } #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigCaptureTreeNodeStruct { pub group: ::std::os::raw::c_int, pub beg: ::std::os::raw::c_int, pub end: ::std::os::raw::c_int, pub allocated: ::std::os::raw::c_int, pub num_childs: ::std::os::raw::c_int, pub childs: *mut *mut OnigCaptureTreeNodeStruct, } pub type OnigCaptureTreeNode = OnigCaptureTreeNodeStruct; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct re_registers { pub allocated: ::std::os::raw::c_int, pub num_regs: ::std::os::raw::c_int, pub beg: *mut ::std::os::raw::c_int, pub end: *mut ::std::os::raw::c_int, pub history_root: *mut OnigCaptureTreeNode, } pub type OnigRegion = re_registers; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigErrorInfo { pub enc: OnigEncoding, pub par: *mut OnigUChar, pub par_end: *mut OnigUChar, } #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigRepeatRange { pub lower: ::std::os::raw::c_int, pub upper: ::std::os::raw::c_int, } pub type OnigWarnFunc = ::std::option::Option; extern "C" { pub fn onig_null_warn(s: *const ::std::os::raw::c_char); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct re_pattern_buffer { _unused: [u8; 0], } pub type OnigRegexType = re_pattern_buffer; pub type OnigRegex = *mut OnigRegexType; pub type regex_t = OnigRegexType; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct OnigRegSetStruct { _unused: [u8; 0], } pub type OnigRegSet = OnigRegSetStruct; pub const OnigRegSetLead_ONIG_REGSET_POSITION_LEAD: OnigRegSetLead = 0; pub const OnigRegSetLead_ONIG_REGSET_REGEX_LEAD: OnigRegSetLead = 1; pub const OnigRegSetLead_ONIG_REGSET_PRIORITY_TO_REGEX_ORDER: OnigRegSetLead = 2; pub type OnigRegSetLead = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigCompileInfo { pub num_of_elements: ::std::os::raw::c_int, pub pattern_enc: OnigEncoding, pub target_enc: OnigEncoding, pub syntax: *mut OnigSyntaxType, pub option: OnigOptionType, pub case_fold_flag: OnigCaseFoldType, } pub type OnigCallbackEachMatchFunc = ::std::option::Option< unsafe extern "C" fn( str_: *const OnigUChar, end: *const OnigUChar, match_start: *const OnigUChar, region: *mut OnigRegion, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; pub const OnigCalloutIn_ONIG_CALLOUT_IN_PROGRESS: OnigCalloutIn = 1; pub const OnigCalloutIn_ONIG_CALLOUT_IN_RETRACTION: OnigCalloutIn = 2; pub type OnigCalloutIn = ::std::os::raw::c_uint; pub const OnigCalloutOf_ONIG_CALLOUT_OF_CONTENTS: OnigCalloutOf = 0; pub const OnigCalloutOf_ONIG_CALLOUT_OF_NAME: OnigCalloutOf = 1; pub type OnigCalloutOf = ::std::os::raw::c_uint; pub const OnigCalloutType_ONIG_CALLOUT_TYPE_SINGLE: OnigCalloutType = 0; pub const OnigCalloutType_ONIG_CALLOUT_TYPE_START_CALL: OnigCalloutType = 1; pub const OnigCalloutType_ONIG_CALLOUT_TYPE_BOTH_CALL: OnigCalloutType = 2; pub const OnigCalloutType_ONIG_CALLOUT_TYPE_START_MARK_END_CALL: OnigCalloutType = 3; pub type OnigCalloutType = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct OnigCalloutArgsStruct { _unused: [u8; 0], } pub type OnigCalloutArgs = OnigCalloutArgsStruct; pub type OnigCalloutFunc = ::std::option::Option< unsafe extern "C" fn( args: *mut OnigCalloutArgs, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; pub const OnigCalloutResult_ONIG_CALLOUT_FAIL: OnigCalloutResult = 1; pub const OnigCalloutResult_ONIG_CALLOUT_SUCCESS: OnigCalloutResult = 0; pub type OnigCalloutResult = ::std::os::raw::c_uint; pub const OnigType_ONIG_TYPE_VOID: OnigType = 0; pub const OnigType_ONIG_TYPE_LONG: OnigType = 1; pub const OnigType_ONIG_TYPE_CHAR: OnigType = 2; pub const OnigType_ONIG_TYPE_STRING: OnigType = 4; pub const OnigType_ONIG_TYPE_POINTER: OnigType = 8; pub const OnigType_ONIG_TYPE_TAG: OnigType = 16; pub type OnigType = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] pub union OnigValue { pub l: ::std::os::raw::c_long, pub c: OnigCodePoint, pub s: OnigValue__bindgen_ty_1, pub p: *mut ::std::os::raw::c_void, pub tag: ::std::os::raw::c_int, } #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct OnigValue__bindgen_ty_1 { pub start: *mut OnigUChar, pub end: *mut OnigUChar, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct OnigMatchParamStruct { _unused: [u8; 0], } pub type OnigMatchParam = OnigMatchParamStruct; extern "C" { pub fn onig_initialize( encodings: *mut OnigEncoding, number_of_encodings: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_init() -> ::std::os::raw::c_int; } extern "C" { pub fn onig_error_code_to_str( s: *mut OnigUChar, err_code: ::std::os::raw::c_int, ... ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_is_error_code_needs_param(code: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_warn_func(f: OnigWarnFunc); } extern "C" { pub fn onig_set_verb_warn_func(f: OnigWarnFunc); } extern "C" { pub fn onig_new( arg1: *mut OnigRegex, pattern: *const OnigUChar, pattern_end: *const OnigUChar, option: OnigOptionType, enc: OnigEncoding, syntax: *mut OnigSyntaxType, einfo: *mut OnigErrorInfo, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_reg_init( reg: OnigRegex, option: OnigOptionType, case_fold_flag: OnigCaseFoldType, enc: OnigEncoding, syntax: *mut OnigSyntaxType, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_new_without_alloc( arg1: OnigRegex, pattern: *const OnigUChar, pattern_end: *const OnigUChar, option: OnigOptionType, enc: OnigEncoding, syntax: *mut OnigSyntaxType, einfo: *mut OnigErrorInfo, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_new_deluxe( reg: *mut OnigRegex, pattern: *const OnigUChar, pattern_end: *const OnigUChar, ci: *mut OnigCompileInfo, einfo: *mut OnigErrorInfo, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_free(arg1: OnigRegex); } extern "C" { pub fn onig_free_body(arg1: OnigRegex); } extern "C" { pub fn onig_scan( reg: OnigRegex, str_: *const OnigUChar, end: *const OnigUChar, region: *mut OnigRegion, option: OnigOptionType, scan_callback: ::std::option::Option< unsafe extern "C" fn( arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, arg3: *mut OnigRegion, arg4: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, callback_arg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_search( arg1: OnigRegex, str_: *const OnigUChar, end: *const OnigUChar, start: *const OnigUChar, range: *const OnigUChar, region: *mut OnigRegion, option: OnigOptionType, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_search_with_param( arg1: OnigRegex, str_: *const OnigUChar, end: *const OnigUChar, start: *const OnigUChar, range: *const OnigUChar, region: *mut OnigRegion, option: OnigOptionType, mp: *mut OnigMatchParam, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_match( arg1: OnigRegex, str_: *const OnigUChar, end: *const OnigUChar, at: *const OnigUChar, region: *mut OnigRegion, option: OnigOptionType, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_match_with_param( arg1: OnigRegex, str_: *const OnigUChar, end: *const OnigUChar, at: *const OnigUChar, region: *mut OnigRegion, option: OnigOptionType, mp: *mut OnigMatchParam, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_regset_new( rset: *mut *mut OnigRegSet, n: ::std::os::raw::c_int, regs: *mut OnigRegex, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_regset_add(set: *mut OnigRegSet, reg: OnigRegex) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_regset_replace( set: *mut OnigRegSet, at: ::std::os::raw::c_int, reg: OnigRegex, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_regset_free(set: *mut OnigRegSet); } extern "C" { pub fn onig_regset_number_of_regex(set: *mut OnigRegSet) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_regset_get_regex(set: *mut OnigRegSet, at: ::std::os::raw::c_int) -> OnigRegex; } extern "C" { pub fn onig_regset_get_region( set: *mut OnigRegSet, at: ::std::os::raw::c_int, ) -> *mut OnigRegion; } extern "C" { pub fn onig_regset_search( set: *mut OnigRegSet, str_: *const OnigUChar, end: *const OnigUChar, start: *const OnigUChar, range: *const OnigUChar, lead: OnigRegSetLead, option: OnigOptionType, rmatch_pos: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_regset_search_with_param( set: *mut OnigRegSet, str_: *const OnigUChar, end: *const OnigUChar, start: *const OnigUChar, range: *const OnigUChar, lead: OnigRegSetLead, option: OnigOptionType, mps: *mut *mut OnigMatchParam, rmatch_pos: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_region_new() -> *mut OnigRegion; } extern "C" { pub fn onig_region_init(region: *mut OnigRegion); } extern "C" { pub fn onig_region_free(region: *mut OnigRegion, free_self: ::std::os::raw::c_int); } extern "C" { pub fn onig_region_copy(to: *mut OnigRegion, from: *mut OnigRegion); } extern "C" { pub fn onig_region_clear(region: *mut OnigRegion); } extern "C" { pub fn onig_region_resize( region: *mut OnigRegion, n: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_region_set( region: *mut OnigRegion, at: ::std::os::raw::c_int, beg: ::std::os::raw::c_int, end: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_name_to_group_numbers( reg: OnigRegex, name: *const OnigUChar, name_end: *const OnigUChar, nums: *mut *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_name_to_backref_number( reg: OnigRegex, name: *const OnigUChar, name_end: *const OnigUChar, region: *mut OnigRegion, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_foreach_name( reg: OnigRegex, func: ::std::option::Option< unsafe extern "C" fn( arg1: *const OnigUChar, arg2: *const OnigUChar, arg3: ::std::os::raw::c_int, arg4: *mut ::std::os::raw::c_int, arg5: OnigRegex, arg6: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, arg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_number_of_names(reg: OnigRegex) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_number_of_captures(reg: OnigRegex) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_number_of_capture_histories(reg: OnigRegex) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_capture_tree(region: *mut OnigRegion) -> *mut OnigCaptureTreeNode; } extern "C" { pub fn onig_capture_tree_traverse( region: *mut OnigRegion, at: ::std::os::raw::c_int, callback_func: ::std::option::Option< unsafe extern "C" fn( arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, arg3: ::std::os::raw::c_int, arg4: ::std::os::raw::c_int, arg5: ::std::os::raw::c_int, arg6: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, arg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_noname_group_capture_is_active(reg: OnigRegex) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_encoding(reg: OnigRegex) -> OnigEncoding; } extern "C" { pub fn onig_get_options(reg: OnigRegex) -> OnigOptionType; } extern "C" { pub fn onig_get_case_fold_flag(reg: OnigRegex) -> OnigCaseFoldType; } extern "C" { pub fn onig_get_syntax(reg: OnigRegex) -> *mut OnigSyntaxType; } extern "C" { pub fn onig_set_default_syntax(syntax: *mut OnigSyntaxType) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_copy_syntax(to: *mut OnigSyntaxType, from: *mut OnigSyntaxType); } extern "C" { pub fn onig_get_syntax_op(syntax: *mut OnigSyntaxType) -> ::std::os::raw::c_uint; } extern "C" { pub fn onig_get_syntax_op2(syntax: *mut OnigSyntaxType) -> ::std::os::raw::c_uint; } extern "C" { pub fn onig_get_syntax_behavior(syntax: *mut OnigSyntaxType) -> ::std::os::raw::c_uint; } extern "C" { pub fn onig_get_syntax_options(syntax: *mut OnigSyntaxType) -> OnigOptionType; } extern "C" { pub fn onig_set_syntax_op(syntax: *mut OnigSyntaxType, op: ::std::os::raw::c_uint); } extern "C" { pub fn onig_set_syntax_op2(syntax: *mut OnigSyntaxType, op2: ::std::os::raw::c_uint); } extern "C" { pub fn onig_set_syntax_behavior(syntax: *mut OnigSyntaxType, behavior: ::std::os::raw::c_uint); } extern "C" { pub fn onig_set_syntax_options(syntax: *mut OnigSyntaxType, options: OnigOptionType); } extern "C" { pub fn onig_set_meta_char( syntax: *mut OnigSyntaxType, what: ::std::os::raw::c_uint, code: OnigCodePoint, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_copy_encoding(to: OnigEncoding, from: OnigEncoding); } extern "C" { pub fn onig_get_default_case_fold_flag() -> OnigCaseFoldType; } extern "C" { pub fn onig_set_default_case_fold_flag( case_fold_flag: OnigCaseFoldType, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_match_stack_limit_size() -> ::std::os::raw::c_uint; } extern "C" { pub fn onig_set_match_stack_limit_size(size: ::std::os::raw::c_uint) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_retry_limit_in_match() -> ::std::os::raw::c_ulong; } extern "C" { pub fn onig_set_retry_limit_in_match(n: ::std::os::raw::c_ulong) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_retry_limit_in_search() -> ::std::os::raw::c_ulong; } extern "C" { pub fn onig_set_retry_limit_in_search(n: ::std::os::raw::c_ulong) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_parse_depth_limit() -> ::std::os::raw::c_uint; } extern "C" { pub fn onig_set_capture_num_limit(num: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_parse_depth_limit(depth: ::std::os::raw::c_uint) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_subexp_call_limit_in_search() -> ::std::os::raw::c_ulong; } extern "C" { pub fn onig_set_subexp_call_limit_in_search( n: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_subexp_call_max_nest_level() -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_subexp_call_max_nest_level( level: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_unicode_define_user_property( name: *const ::std::os::raw::c_char, ranges: *mut OnigCodePoint, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_end() -> ::std::os::raw::c_int; } extern "C" { pub fn onig_version() -> *const ::std::os::raw::c_char; } extern "C" { pub fn onig_copyright() -> *const ::std::os::raw::c_char; } extern "C" { pub fn onig_get_callback_each_match() -> OnigCallbackEachMatchFunc; } extern "C" { pub fn onig_set_callback_each_match(f: OnigCallbackEachMatchFunc) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_new_match_param() -> *mut OnigMatchParam; } extern "C" { pub fn onig_free_match_param(p: *mut OnigMatchParam); } extern "C" { pub fn onig_free_match_param_content(p: *mut OnigMatchParam); } extern "C" { pub fn onig_initialize_match_param(mp: *mut OnigMatchParam) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_match_stack_limit_size_of_match_param( param: *mut OnigMatchParam, limit: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_retry_limit_in_match_of_match_param( param: *mut OnigMatchParam, limit: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_retry_limit_in_search_of_match_param( param: *mut OnigMatchParam, limit: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_progress_callout_of_match_param( param: *mut OnigMatchParam, f: OnigCalloutFunc, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_retraction_callout_of_match_param( param: *mut OnigMatchParam, f: OnigCalloutFunc, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_callout_user_data_of_match_param( param: *mut OnigMatchParam, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_progress_callout() -> OnigCalloutFunc; } extern "C" { pub fn onig_set_progress_callout(f: OnigCalloutFunc) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_retraction_callout() -> OnigCalloutFunc; } extern "C" { pub fn onig_set_retraction_callout(f: OnigCalloutFunc) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_callout_of_name( enc: OnigEncoding, type_: OnigCalloutType, name: *mut OnigUChar, name_end: *mut OnigUChar, callout_in: ::std::os::raw::c_int, callout: OnigCalloutFunc, end_callout: OnigCalloutFunc, arg_num: ::std::os::raw::c_int, arg_types: *mut ::std::os::raw::c_uint, optional_arg_num: ::std::os::raw::c_int, opt_defaults: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_name_by_name_id(id: ::std::os::raw::c_int) -> *mut OnigUChar; } extern "C" { pub fn onig_get_callout_num_by_tag( reg: OnigRegex, tag: *const OnigUChar, tag_end: *const OnigUChar, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_data_by_tag( reg: OnigRegex, mp: *mut OnigMatchParam, tag: *const OnigUChar, tag_end: *const OnigUChar, slot: ::std::os::raw::c_int, type_: *mut OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_callout_data_by_tag( reg: OnigRegex, mp: *mut OnigMatchParam, tag: *const OnigUChar, tag_end: *const OnigUChar, slot: ::std::os::raw::c_int, type_: OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_data_by_tag_dont_clear_old( reg: OnigRegex, mp: *mut OnigMatchParam, tag: *const OnigUChar, tag_end: *const OnigUChar, slot: ::std::os::raw::c_int, type_: *mut OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_num_by_callout_args( args: *mut OnigCalloutArgs, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_in_by_callout_args(args: *mut OnigCalloutArgs) -> OnigCalloutIn; } extern "C" { pub fn onig_get_name_id_by_callout_args(args: *mut OnigCalloutArgs) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_contents_by_callout_args(args: *mut OnigCalloutArgs) -> *const OnigUChar; } extern "C" { pub fn onig_get_contents_end_by_callout_args(args: *mut OnigCalloutArgs) -> *const OnigUChar; } extern "C" { pub fn onig_get_args_num_by_callout_args(args: *mut OnigCalloutArgs) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_passed_args_num_by_callout_args( args: *mut OnigCalloutArgs, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_arg_by_callout_args( args: *mut OnigCalloutArgs, index: ::std::os::raw::c_int, type_: *mut OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_string_by_callout_args(args: *mut OnigCalloutArgs) -> *const OnigUChar; } extern "C" { pub fn onig_get_string_end_by_callout_args(args: *mut OnigCalloutArgs) -> *const OnigUChar; } extern "C" { pub fn onig_get_start_by_callout_args(args: *mut OnigCalloutArgs) -> *const OnigUChar; } extern "C" { pub fn onig_get_right_range_by_callout_args(args: *mut OnigCalloutArgs) -> *const OnigUChar; } extern "C" { pub fn onig_get_current_by_callout_args(args: *mut OnigCalloutArgs) -> *const OnigUChar; } extern "C" { pub fn onig_get_regex_by_callout_args(args: *mut OnigCalloutArgs) -> OnigRegex; } extern "C" { pub fn onig_get_retry_counter_by_callout_args( args: *mut OnigCalloutArgs, ) -> ::std::os::raw::c_ulong; } extern "C" { pub fn onig_callout_tag_is_exist_at_callout_num( reg: OnigRegex, callout_num: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_tag_start( reg: OnigRegex, callout_num: ::std::os::raw::c_int, ) -> *const OnigUChar; } extern "C" { pub fn onig_get_callout_tag_end( reg: OnigRegex, callout_num: ::std::os::raw::c_int, ) -> *const OnigUChar; } extern "C" { pub fn onig_get_callout_data_dont_clear_old( reg: OnigRegex, mp: *mut OnigMatchParam, callout_num: ::std::os::raw::c_int, slot: ::std::os::raw::c_int, type_: *mut OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_data_by_callout_args_self_dont_clear_old( args: *mut OnigCalloutArgs, slot: ::std::os::raw::c_int, type_: *mut OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_data( reg: OnigRegex, mp: *mut OnigMatchParam, callout_num: ::std::os::raw::c_int, slot: ::std::os::raw::c_int, type_: *mut OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_data_by_callout_args( args: *mut OnigCalloutArgs, callout_num: ::std::os::raw::c_int, slot: ::std::os::raw::c_int, type_: *mut OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_callout_data_by_callout_args_self( args: *mut OnigCalloutArgs, slot: ::std::os::raw::c_int, type_: *mut OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_callout_data( reg: OnigRegex, mp: *mut OnigMatchParam, callout_num: ::std::os::raw::c_int, slot: ::std::os::raw::c_int, type_: OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_callout_data_by_callout_args( args: *mut OnigCalloutArgs, callout_num: ::std::os::raw::c_int, slot: ::std::os::raw::c_int, type_: OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_set_callout_data_by_callout_args_self( args: *mut OnigCalloutArgs, slot: ::std::os::raw::c_int, type_: OnigType, val: *mut OnigValue, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_capture_range_in_callout( args: *mut OnigCalloutArgs, mem_num: ::std::os::raw::c_int, begin: *mut ::std::os::raw::c_int, end: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_get_used_stack_size_in_callout( args: *mut OnigCalloutArgs, used_num: *mut ::std::os::raw::c_int, used_bytes: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_builtin_fail( args: *mut OnigCalloutArgs, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_builtin_mismatch( args: *mut OnigCalloutArgs, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_builtin_error( args: *mut OnigCalloutArgs, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_builtin_count( args: *mut OnigCalloutArgs, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_builtin_total_count( args: *mut OnigCalloutArgs, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_builtin_max( args: *mut OnigCalloutArgs, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_builtin_cmp( args: *mut OnigCalloutArgs, user_data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn onig_setup_builtin_monitors_by_ascii_encoded_name( fp: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } onig_sys-69.9.1/src/lib.rs000064400000000000000000000012301046102023000134630ustar 00000000000000#[cfg(feature = "generate")] mod bindgened; #[cfg(feature = "generate")] pub use crate::bindgened::*; #[cfg(not(feature = "generate"))] #[allow(non_upper_case_globals)] #[allow(non_camel_case_types)] #[allow(non_snake_case)] #[allow(clippy::all)] mod ffi; #[cfg(not(feature = "generate"))] pub use self::ffi::*; // backfill types from the old hand-written bindings: pub type OnigSyntaxBehavior = ::std::os::raw::c_uint; pub type OnigSyntaxOp = ::std::os::raw::c_uint; pub type OnigSyntaxOp2 = ::std::os::raw::c_uint; #[test] fn test_is_linked() { unsafe { assert!(!onig_copyright().is_null()); assert!(!onig_version().is_null()); } }