补上遗漏的文件
This commit is contained in:
parent
ad350b4d66
commit
2ce6e41ceb
201
external/cldr/tools/cldr-code/src/main/java/org/unicode/cldr/draft/keyboard/out/KeyboardToXml.java
vendored
Normal file
201
external/cldr/tools/cldr-code/src/main/java/org/unicode/cldr/draft/keyboard/out/KeyboardToXml.java
vendored
Normal file
|
@ -0,0 +1,201 @@
|
|||
package org.unicode.cldr.draft.keyboard.out;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import org.unicode.cldr.draft.keyboard.CharacterMap;
|
||||
import org.unicode.cldr.draft.keyboard.IsoLayoutPosition;
|
||||
import org.unicode.cldr.draft.keyboard.KeyMap;
|
||||
import org.unicode.cldr.draft.keyboard.Keyboard;
|
||||
import org.unicode.cldr.draft.keyboard.KeyboardId.Platform;
|
||||
import org.unicode.cldr.draft.keyboard.KeyboardSettings.FallbackSetting;
|
||||
import org.unicode.cldr.draft.keyboard.KeyboardSettings.TransformFailureSetting;
|
||||
import org.unicode.cldr.draft.keyboard.KeyboardSettings.TransformPartialSetting;
|
||||
import org.unicode.cldr.draft.keyboard.ModifierKeyCombinationSet;
|
||||
import org.unicode.cldr.draft.keyboard.Transform;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.ibm.icu.lang.UCharacter;
|
||||
import com.ibm.icu.text.DecimalFormat;
|
||||
import com.ibm.icu.text.UCharacterIterator;
|
||||
import com.ibm.icu.text.UnicodeSet;
|
||||
|
||||
public final class KeyboardToXml {
|
||||
private final Keyboard keyboard;
|
||||
private final XmlWriter xmlWriter;
|
||||
|
||||
private KeyboardToXml(Keyboard keyboard, XmlWriter xmlWriter) {
|
||||
this.keyboard = checkNotNull(keyboard);
|
||||
this.xmlWriter = checkNotNull(xmlWriter);
|
||||
}
|
||||
|
||||
/** Writes the given keyboard map in XML format to the provided writer. */
|
||||
public static void writeToXml(Keyboard keyboard, Writer writer) {
|
||||
XmlWriter xmlWriter = XmlWriter.newXmlWriter(writer);
|
||||
KeyboardToXml keyboardToXml = new KeyboardToXml(keyboard, xmlWriter);
|
||||
keyboardToXml.toXml();
|
||||
}
|
||||
|
||||
private void toXml() {
|
||||
xmlWriter.startDocument("keyboard", "../dtd/ldmlKeyboard.dtd");
|
||||
xmlWriter.startElement("keyboard", ImmutableMap.of("locale", keyboard.keyboardId()));
|
||||
addMetadata();
|
||||
addKeyMaps();
|
||||
addTransforms();
|
||||
xmlWriter.endElement();
|
||||
xmlWriter.endDocument();
|
||||
}
|
||||
|
||||
private static DecimalFormat VERSION_FORMAT = new DecimalFormat("#.#");
|
||||
|
||||
private void addMetadata() {
|
||||
Platform platform = keyboard.keyboardId().platform();
|
||||
ImmutableMap<String, String> versionAttributes = ImmutableMap.of(
|
||||
"platform", VERSION_FORMAT.format(platform.version()),
|
||||
"number", "$Revision$");
|
||||
xmlWriter.addElement("version", versionAttributes);
|
||||
// xmlWriter.addElement("generation", ImmutableMap.of("date", "$Date$"));
|
||||
xmlWriter.startElement("names");
|
||||
for (String name : keyboard.names()) {
|
||||
xmlWriter.addElement("name", ImmutableMap.of("value", name));
|
||||
}
|
||||
xmlWriter.endElement();
|
||||
// Settings.
|
||||
ImmutableMap.Builder<String, String> settingsBuilder = ImmutableMap.builder();
|
||||
if (platform.settings().fallbackSetting() == FallbackSetting.OMIT) {
|
||||
FallbackSetting fallbackSetting = platform.settings().fallbackSetting();
|
||||
settingsBuilder.put("fallback", fallbackSetting.toString().toLowerCase());
|
||||
}
|
||||
boolean hasTransform = keyboard.transforms().size() > 0;
|
||||
if (hasTransform
|
||||
&& platform.settings().transformFailureSetting() == TransformFailureSetting.OMIT) {
|
||||
TransformFailureSetting transformFailure = platform.settings().transformFailureSetting();
|
||||
settingsBuilder.put("transformFailure", transformFailure.toString());
|
||||
}
|
||||
if (hasTransform
|
||||
&& platform.settings().transformPartialSetting() == TransformPartialSetting.HIDE) {
|
||||
TransformPartialSetting transformPartial = platform.settings().transformPartialSetting();
|
||||
settingsBuilder.put("transformPartial", transformPartial.toString());
|
||||
}
|
||||
ImmutableMap<String, String> settingsAttributes = settingsBuilder.build();
|
||||
if (!settingsAttributes.isEmpty()) {
|
||||
xmlWriter.addElement("settings", settingsAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Joiner COMMA_JOINER = Joiner.on(",");
|
||||
|
||||
private void addKeyMaps() {
|
||||
for (KeyMap keyMap : keyboard.keyMaps()) {
|
||||
ImmutableMap.Builder<String, String> keyMapAttributes = ImmutableMap.builder();
|
||||
ModifierKeyCombinationSet modifiers = keyMap.modifierKeyCombinationSet();
|
||||
if (!modifiers.isBase()) {
|
||||
keyMapAttributes.put("modifiers", modifiers.toString());
|
||||
}
|
||||
xmlWriter.startElement("keyMap", keyMapAttributes.build());
|
||||
for (CharacterMap characterMap : keyMap.isoLayoutToCharacterMap().values()) {
|
||||
String output = characterMap.output();
|
||||
ImmutableMap.Builder<String, String> mapAttributes = ImmutableMap.builder();
|
||||
mapAttributes.put("iso", "" + characterMap.position());
|
||||
String escapedOutput = escapeOutput(output);
|
||||
mapAttributes.put("to", escapedOutput);
|
||||
if (!characterMap.longPressKeys().isEmpty()) {
|
||||
mapAttributes.put("longPress", COMMA_JOINER.join(characterMap.longPressKeys()));
|
||||
}
|
||||
if (characterMap.isTransformNo()) {
|
||||
mapAttributes.put("transform", "no");
|
||||
}
|
||||
String comment = buildReadabilityComment(characterMap, escapedOutput);
|
||||
xmlWriter.addElement("map", mapAttributes.build(), comment);
|
||||
}
|
||||
xmlWriter.endElement();
|
||||
}
|
||||
}
|
||||
|
||||
private static final UnicodeSet ESCAPED_CHARACTERS_NO_SPACE = new UnicodeSet("[[:di:][:c:][:M:][:whitespace:][\"]-[\\u0020]]").freeze();
|
||||
|
||||
private String escapeOutput(String output) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
UCharacterIterator it = UCharacterIterator.getInstance(output);
|
||||
int character;
|
||||
while ((character = it.nextCodePoint()) != UCharacterIterator.DONE) {
|
||||
if (ESCAPED_CHARACTERS_NO_SPACE.contains(character)) {
|
||||
stringBuilder.append(String.format("\\u{%X}", character));
|
||||
} else {
|
||||
stringBuilder.append(UCharacter.toString(character));
|
||||
}
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
private static final UnicodeSet ILLEGAL_COMMENT_CHARACTERS = new UnicodeSet("[[:di:][:c:][:whitespace:]]").freeze();
|
||||
|
||||
private String buildReadabilityComment(CharacterMap characterMap, String escapedOutput) {
|
||||
StringBuilder comment = new StringBuilder();
|
||||
String output = characterMap.output();
|
||||
IsoLayoutPosition position = characterMap.position();
|
||||
// English Key Name (Only if it is non-trivial)
|
||||
if (!output.toUpperCase().equals(position.englishKeyName())) {
|
||||
comment.append(position.englishKeyName());
|
||||
}
|
||||
// Base (Only if it is different than the english key and non-trivial).
|
||||
KeyMap baseMap = keyboard.baseMap();
|
||||
CharacterMap baseKey = baseMap.isoLayoutToCharacterMap().get(position);
|
||||
if (baseKey != null && !baseKey.output().toUpperCase().equals(output.toUpperCase())
|
||||
&& !baseKey.output().toUpperCase().equals(position.englishKeyName())) {
|
||||
comment.append(" base=");
|
||||
comment.append(baseKey.output());
|
||||
}
|
||||
// Output (Only if the output is safe for comment)
|
||||
if (escapedOutput.contains("\\u{") && !ILLEGAL_COMMENT_CHARACTERS.contains(output)) {
|
||||
comment.append(" to= " + output + " ");
|
||||
}
|
||||
/*
|
||||
// Long press
|
||||
if (longPressString.contains("\\u{")) {
|
||||
StringBuilder longPressBuilder = new StringBuilder();
|
||||
for (String longPress : longPressKeys) {
|
||||
if (!CommonUtil.ILLEGAL_COMMENT_CHARACTERS.contains(longPress)) {
|
||||
longPressBuilder.append(longPress);
|
||||
longPressBuilder.append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
if (longPressBuilder.length() > 0) {
|
||||
comment.append(" long=");
|
||||
comment.append(longPressBuilder.toString());
|
||||
}
|
||||
}
|
||||
*/
|
||||
return comment.toString();
|
||||
}
|
||||
|
||||
private void addTransforms() {
|
||||
if (keyboard.transforms().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
xmlWriter.startElement("transforms", ImmutableMap.of("type", "simple"));
|
||||
for (Transform transform : keyboard.transforms()) {
|
||||
String escapedSequence = escapeOutput(transform.sequence());
|
||||
String escapedOutput = escapeOutput(transform.output());
|
||||
String comment = buildTransformReadabilityComment(transform, escapedSequence, escapedOutput);
|
||||
xmlWriter.addElement("transform",
|
||||
ImmutableMap.of("from", escapedSequence, "to", escapedOutput),
|
||||
comment);
|
||||
}
|
||||
xmlWriter.endElement();
|
||||
|
||||
}
|
||||
|
||||
private String buildTransformReadabilityComment(Transform transform, String escapedSequence,
|
||||
String escapedOutput) {
|
||||
if ((escapedSequence.contains("\\u{") || escapedOutput.contains("\\u{"))
|
||||
&& !ILLEGAL_COMMENT_CHARACTERS.containsSome(transform.sequence())
|
||||
&& !ILLEGAL_COMMENT_CHARACTERS.contains(transform.output())) {
|
||||
return transform.sequence() + " → " + transform.output();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package org.unicode.cldr.draft.keyboard.out;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.unicode.cldr.draft.keyboard.IsoLayoutPosition;
|
||||
import org.unicode.cldr.draft.keyboard.KeyboardId.Platform;
|
||||
import org.unicode.cldr.draft.keyboard.KeycodeMap;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
/** Utility class that writes the given key code map into the LDML XML format. */
|
||||
public final class KeycodeMapToXml {
|
||||
private final KeycodeMap keycodeMap;
|
||||
private final Platform platform;
|
||||
private final XmlWriter xmlWriter;
|
||||
|
||||
private KeycodeMapToXml(KeycodeMap keycodeMap, Platform platform, XmlWriter xmlWriter) {
|
||||
this.keycodeMap = checkNotNull(keycodeMap);
|
||||
this.platform = checkNotNull(platform);
|
||||
this.xmlWriter = checkNotNull(xmlWriter);
|
||||
}
|
||||
|
||||
/** Writes the given key code map in XML format to the provided writer. */
|
||||
public static void writeToXml(KeycodeMap keycodeMap, Platform platform, Writer writer) {
|
||||
XmlWriter xmlWriter = XmlWriter.newXmlWriter(writer);
|
||||
KeycodeMapToXml keycodeMapToXml = new KeycodeMapToXml(keycodeMap, platform, xmlWriter);
|
||||
keycodeMapToXml.toXml();
|
||||
}
|
||||
|
||||
private void toXml() {
|
||||
xmlWriter.startDocument("platform", "../dtd/ldmlPlatform.dtd");
|
||||
xmlWriter.startElement("platform", ImmutableMap.of("id", platform));
|
||||
xmlWriter.startElement("hardwareMap");
|
||||
for (Entry<Integer, IsoLayoutPosition> entry : keycodeMap.keycodeToIsoLayout().entrySet()) {
|
||||
xmlWriter.addElement("map", ImmutableMap.of("keycode", entry.getKey(), "iso", entry.getValue()));
|
||||
}
|
||||
xmlWriter.endElement();
|
||||
xmlWriter.endElement();
|
||||
xmlWriter.endDocument();
|
||||
}
|
||||
}
|
124
external/cldr/tools/cldr-code/src/main/java/org/unicode/cldr/draft/keyboard/out/XmlWriter.java
vendored
Normal file
124
external/cldr/tools/cldr-code/src/main/java/org/unicode/cldr/draft/keyboard/out/XmlWriter.java
vendored
Normal file
|
@ -0,0 +1,124 @@
|
|||
package org.unicode.cldr.draft.keyboard.out;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.xml.stream.XMLOutputFactory;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamWriter;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
/**
|
||||
* Object which wraps around an XML stream writer. Automatically adds proper formatting
|
||||
* (indentation and line breaks) to the written XML elements.
|
||||
*/
|
||||
final class XmlWriter {
|
||||
private final XMLStreamWriter writer;
|
||||
private int depth = 0;
|
||||
|
||||
private XmlWriter(XMLStreamWriter writer) {
|
||||
this.writer = checkNotNull(writer);
|
||||
}
|
||||
|
||||
static XmlWriter newXmlWriter(Writer writer) {
|
||||
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
|
||||
XMLStreamWriter xmlStreamWriter;
|
||||
try {
|
||||
xmlStreamWriter = outputFactory.createXMLStreamWriter(writer);
|
||||
} catch (XMLStreamException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return new XmlWriter(xmlStreamWriter);
|
||||
}
|
||||
|
||||
XmlWriter startDocument(String doctype, String dtdLocation) {
|
||||
try {
|
||||
writer.writeStartDocument("UTF-8", "1.0");
|
||||
writer.writeCharacters("\n");
|
||||
writer.writeDTD("<!DOCTYPE " + doctype + " SYSTEM \"" + dtdLocation + "\">");
|
||||
writer.writeCharacters("\n");
|
||||
} catch (XMLStreamException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
XmlWriter endDocument() {
|
||||
checkState(depth == 0, "Cannot close document with unclosed elements");
|
||||
try {
|
||||
writer.writeEndDocument();
|
||||
writer.close();
|
||||
} catch (XMLStreamException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
XmlWriter startElement(String name) {
|
||||
return startElement(name, ImmutableMap.<String, Object> of());
|
||||
}
|
||||
|
||||
XmlWriter startElement(String name, Map<String, ?> attributeToValue) {
|
||||
addIndent();
|
||||
try {
|
||||
writer.writeStartElement(name);
|
||||
for (Entry<String, ?> entry : attributeToValue.entrySet()) {
|
||||
writer.writeAttribute(entry.getKey(), "" + entry.getValue());
|
||||
}
|
||||
writer.writeCharacters("\n");
|
||||
} catch (XMLStreamException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
depth++;
|
||||
return this;
|
||||
}
|
||||
|
||||
XmlWriter endElement() {
|
||||
depth--;
|
||||
addIndent();
|
||||
try {
|
||||
writer.writeEndElement();
|
||||
writer.writeCharacters("\n");
|
||||
} catch (XMLStreamException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
XmlWriter addElement(String name, Map<String, ?> attributeToValue) {
|
||||
return addElement(name, attributeToValue, "");
|
||||
}
|
||||
|
||||
XmlWriter addElement(String name, Map<String, ?> attributeToValue, String comment) {
|
||||
addIndent();
|
||||
try {
|
||||
writer.writeEmptyElement(name);
|
||||
for (Entry<String, ?> entry : attributeToValue.entrySet()) {
|
||||
writer.writeAttribute(entry.getKey(), "" + entry.getValue());
|
||||
}
|
||||
if (!comment.isEmpty()) {
|
||||
writer.writeCharacters(" ");
|
||||
writer.writeComment(" " + comment + " ");
|
||||
}
|
||||
writer.writeCharacters("\n");
|
||||
} catch (XMLStreamException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private void addIndent() {
|
||||
for (int i = 0; i < depth; i++) {
|
||||
try {
|
||||
writer.writeCharacters("\t");
|
||||
} catch (XMLStreamException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
x86_64-unknown-linux-gnu
|
|
@ -0,0 +1,311 @@
|
|||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
extern crate glob;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
|
||||
use glob::{MatchOptions, Pattern};
|
||||
|
||||
//================================================
|
||||
// Commands
|
||||
//================================================
|
||||
|
||||
thread_local! {
|
||||
/// The errors encountered by the build script while executing commands.
|
||||
static COMMAND_ERRORS: RefCell<HashMap<String, Vec<String>>> = RefCell::default();
|
||||
}
|
||||
|
||||
/// Adds an error encountered by the build script while executing a command.
|
||||
fn add_command_error(name: &str, path: &str, arguments: &[&str], message: String) {
|
||||
COMMAND_ERRORS.with(|e| {
|
||||
e.borrow_mut()
|
||||
.entry(name.into())
|
||||
.or_insert_with(Vec::new)
|
||||
.push(format!(
|
||||
"couldn't execute `{} {}` (path={}) ({})",
|
||||
name,
|
||||
arguments.join(" "),
|
||||
path,
|
||||
message,
|
||||
))
|
||||
});
|
||||
}
|
||||
|
||||
/// A struct that prints the errors encountered by the build script while
|
||||
/// executing commands when dropped (unless explictly discarded).
|
||||
///
|
||||
/// This is handy because we only want to print these errors when the build
|
||||
/// script fails to link to an instance of `libclang`. For example, if
|
||||
/// `llvm-config` couldn't be executed but an instance of `libclang` was found
|
||||
/// anyway we don't want to pollute the build output with irrelevant errors.
|
||||
#[derive(Default)]
|
||||
pub struct CommandErrorPrinter {
|
||||
discard: bool,
|
||||
}
|
||||
|
||||
impl CommandErrorPrinter {
|
||||
pub fn discard(mut self) {
|
||||
self.discard = true;
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for CommandErrorPrinter {
|
||||
fn drop(&mut self) {
|
||||
if self.discard {
|
||||
return;
|
||||
}
|
||||
|
||||
let errors = COMMAND_ERRORS.with(|e| e.borrow().clone());
|
||||
|
||||
if let Some(errors) = errors.get("llvm-config") {
|
||||
println!(
|
||||
"cargo:warning=could not execute `llvm-config` one or more \
|
||||
times, if the LLVM_CONFIG_PATH environment variable is set to \
|
||||
a full path to valid `llvm-config` executable it will be used \
|
||||
to try to find an instance of `libclang` on your system: {}",
|
||||
errors
|
||||
.iter()
|
||||
.map(|e| format!("\"{}\"", e))
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n "),
|
||||
)
|
||||
}
|
||||
|
||||
if let Some(errors) = errors.get("xcode-select") {
|
||||
println!(
|
||||
"cargo:warning=could not execute `xcode-select` one or more \
|
||||
times, if a valid instance of this executable is on your PATH \
|
||||
it will be used to try to find an instance of `libclang` on \
|
||||
your system: {}",
|
||||
errors
|
||||
.iter()
|
||||
.map(|e| format!("\"{}\"", e))
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n "),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Executes a command and returns the `stdout` output if the command was
|
||||
/// successfully executed (errors are added to `COMMAND_ERRORS`).
|
||||
fn run_command(name: &str, path: &str, arguments: &[&str]) -> Option<String> {
|
||||
let output = match Command::new(path).args(arguments).output() {
|
||||
Ok(output) => output,
|
||||
Err(error) => {
|
||||
let message = format!("error: {}", error);
|
||||
add_command_error(name, path, arguments, message);
|
||||
return None;
|
||||
}
|
||||
};
|
||||
|
||||
if output.status.success() {
|
||||
Some(String::from_utf8_lossy(&output.stdout).into_owned())
|
||||
} else {
|
||||
let message = format!("exit code: {}", output.status);
|
||||
add_command_error(name, path, arguments, message);
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Executes the `llvm-config` command and returns the `stdout` output if the
|
||||
/// command was successfully executed (errors are added to `COMMAND_ERRORS`).
|
||||
pub fn run_llvm_config(arguments: &[&str]) -> Option<String> {
|
||||
let path = env::var("LLVM_CONFIG_PATH").unwrap_or_else(|_| "llvm-config".into());
|
||||
run_command("llvm-config", &path, arguments)
|
||||
}
|
||||
|
||||
/// Executes the `xcode-select` command and returns the `stdout` output if the
|
||||
/// command was successfully executed (errors are added to `COMMAND_ERRORS`).
|
||||
pub fn run_xcode_select(arguments: &[&str]) -> Option<String> {
|
||||
run_command("xcode-select", "xcode-select", arguments)
|
||||
}
|
||||
|
||||
//================================================
|
||||
// Search Directories
|
||||
//================================================
|
||||
|
||||
/// `libclang` directory patterns for Haiku.
|
||||
const DIRECTORIES_HAIKU: &[&str] = &[
|
||||
"/boot/system/lib",
|
||||
"/boot/system/develop/lib",
|
||||
"/boot/system/non-packaged/lib",
|
||||
"/boot/system/non-packaged/develop/lib",
|
||||
"/boot/home/config/non-packaged/lib",
|
||||
"/boot/home/config/non-packaged/develop/lib",
|
||||
];
|
||||
|
||||
/// `libclang` directory patterns for Linux (and FreeBSD).
|
||||
const DIRECTORIES_LINUX: &[&str] = &[
|
||||
"/usr/lib*",
|
||||
"/usr/lib*/*",
|
||||
"/usr/lib*/*/*",
|
||||
"/usr/local/lib*",
|
||||
"/usr/local/lib*/*",
|
||||
"/usr/local/lib*/*/*",
|
||||
"/usr/local/llvm*/lib*",
|
||||
];
|
||||
|
||||
/// `libclang` directory patterns for macOS.
|
||||
const DIRECTORIES_MACOS: &[&str] = &[
|
||||
"/usr/local/opt/llvm*/lib",
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib",
|
||||
"/Library/Developer/CommandLineTools/usr/lib",
|
||||
"/usr/local/opt/llvm*/lib/llvm*/lib",
|
||||
];
|
||||
|
||||
/// `libclang` directory patterns for Windows.
|
||||
const DIRECTORIES_WINDOWS: &[&str] = &[
|
||||
"C:\\LLVM\\lib",
|
||||
"C:\\Program Files*\\LLVM\\lib",
|
||||
"C:\\MSYS*\\MinGW*\\lib",
|
||||
// LLVM + Clang can be installed as a component of Visual Studio.
|
||||
// https://github.com/KyleMayes/clang-sys/issues/121
|
||||
"C:\\Program Files*\\Microsoft Visual Studio\\*\\BuildTools\\VC\\Tools\\Llvm\\**\\bin",
|
||||
// LLVM + Clang can be installed using Scoop (https://scoop.sh).
|
||||
// Other Windows package managers install LLVM + Clang to previously listed
|
||||
// system-wide directories.
|
||||
"C:\\Users\\*\\scoop\\apps\\llvm\\current\\bin",
|
||||
];
|
||||
|
||||
//================================================
|
||||
// Searching
|
||||
//================================================
|
||||
|
||||
/// Finds the files in a directory that match one or more filename glob patterns
|
||||
/// and returns the paths to and filenames of those files.
|
||||
fn search_directory(directory: &Path, filenames: &[String]) -> Vec<(PathBuf, String)> {
|
||||
// Escape the specified directory in case it contains characters that have
|
||||
// special meaning in glob patterns (e.g., `[` or `]`).
|
||||
let directory = Pattern::escape(directory.to_str().unwrap());
|
||||
let directory = Path::new(&directory);
|
||||
|
||||
// Join the escaped directory to the filename glob patterns to obtain
|
||||
// complete glob patterns for the files being searched for.
|
||||
let paths = filenames
|
||||
.iter()
|
||||
.map(|f| directory.join(f).to_str().unwrap().to_owned());
|
||||
|
||||
// Prevent wildcards from matching path separators to ensure that the search
|
||||
// is limited to the specified directory.
|
||||
let mut options = MatchOptions::new();
|
||||
options.require_literal_separator = true;
|
||||
|
||||
paths
|
||||
.map(|p| glob::glob_with(&p, options))
|
||||
.filter_map(Result::ok)
|
||||
.flatten()
|
||||
.filter_map(|p| {
|
||||
let path = p.ok()?;
|
||||
let filename = path.file_name()?.to_str().unwrap();
|
||||
|
||||
// The `libclang_shared` library has been renamed to `libclang-cpp`
|
||||
// in Clang 10. This can cause instances of this library (e.g.,
|
||||
// `libclang-cpp.so.10`) to be matched by patterns looking for
|
||||
// instances of `libclang`.
|
||||
if filename.contains("-cpp.") {
|
||||
return None;
|
||||
}
|
||||
|
||||
Some((directory.to_owned(), filename.into()))
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
|
||||
/// Finds the files in a directory (and any relevant sibling directories) that
|
||||
/// match one or more filename glob patterns and returns the paths to and
|
||||
/// filenames of those files.
|
||||
fn search_directories(directory: &Path, filenames: &[String]) -> Vec<(PathBuf, String)> {
|
||||
let mut results = search_directory(directory, filenames);
|
||||
|
||||
// On Windows, `libclang.dll` is usually found in the LLVM `bin` directory
|
||||
// while `libclang.lib` is usually found in the LLVM `lib` directory. To
|
||||
// keep things consistent with other platforms, only LLVM `lib` directories
|
||||
// are included in the backup search directory globs so we need to search
|
||||
// the LLVM `bin` directory here.
|
||||
if cfg!(target_os = "windows") && directory.ends_with("lib") {
|
||||
let sibling = directory.parent().unwrap().join("bin");
|
||||
results.extend(search_directory(&sibling, filenames).into_iter());
|
||||
}
|
||||
|
||||
results
|
||||
}
|
||||
|
||||
/// Finds the `libclang` static or dynamic libraries matching one or more
|
||||
/// filename glob patterns and returns the paths to and filenames of those files.
|
||||
pub fn search_libclang_directories(filenames: &[String], variable: &str) -> Vec<(PathBuf, String)> {
|
||||
// Search only the path indicated by the relevant environment variable
|
||||
// (e.g., `LIBCLANG_PATH`) if it is set.
|
||||
if let Ok(path) = env::var(variable).map(|d| Path::new(&d).to_path_buf()) {
|
||||
// Check if the path is a matching file.
|
||||
if let Some(parent) = path.parent() {
|
||||
let filename = path.file_name().unwrap().to_str().unwrap();
|
||||
let libraries = search_directories(parent, filenames);
|
||||
if libraries.iter().any(|(_, f)| f == filename) {
|
||||
return vec![(parent.into(), filename.into())];
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the path is directory containing a matching file.
|
||||
return search_directories(&path, filenames);
|
||||
}
|
||||
|
||||
let mut found = vec![];
|
||||
|
||||
// Search the `bin` and `lib` directories in the directory returned by
|
||||
// `llvm-config --prefix`.
|
||||
if let Some(output) = run_llvm_config(&["--prefix"]) {
|
||||
let directory = Path::new(output.lines().next().unwrap()).to_path_buf();
|
||||
found.extend(search_directories(&directory.join("bin"), filenames));
|
||||
found.extend(search_directories(&directory.join("lib"), filenames));
|
||||
found.extend(search_directories(&directory.join("lib64"), filenames));
|
||||
}
|
||||
|
||||
// Search the toolchain directory in the directory returned by
|
||||
// `xcode-select --print-path`.
|
||||
if cfg!(target_os = "macos") {
|
||||
if let Some(output) = run_xcode_select(&["--print-path"]) {
|
||||
let directory = Path::new(output.lines().next().unwrap()).to_path_buf();
|
||||
let directory = directory.join("Toolchains/XcodeDefault.xctoolchain/usr/lib");
|
||||
found.extend(search_directories(&directory, filenames));
|
||||
}
|
||||
}
|
||||
|
||||
// Search the directories in the `LD_LIBRARY_PATH` environment variable.
|
||||
if let Ok(path) = env::var("LD_LIBRARY_PATH") {
|
||||
for directory in env::split_paths(&path) {
|
||||
found.extend(search_directories(&directory, filenames));
|
||||
}
|
||||
}
|
||||
|
||||
// Determine the `libclang` directory patterns.
|
||||
let directories = if cfg!(target_os = "haiku") {
|
||||
DIRECTORIES_HAIKU
|
||||
} else if cfg!(any(target_os = "linux", target_os = "freebsd")) {
|
||||
DIRECTORIES_LINUX
|
||||
} else if cfg!(target_os = "macos") {
|
||||
DIRECTORIES_MACOS
|
||||
} else if cfg!(target_os = "windows") {
|
||||
DIRECTORIES_WINDOWS
|
||||
} else {
|
||||
&[]
|
||||
};
|
||||
|
||||
// Search the directories provided by the `libclang` directory patterns.
|
||||
let mut options = MatchOptions::new();
|
||||
options.case_sensitive = false;
|
||||
options.require_literal_separator = true;
|
||||
for directory in directories.iter().rev() {
|
||||
if let Ok(directories) = glob::glob_with(directory, options) {
|
||||
for directory in directories.filter_map(Result::ok).filter(|p| p.is_dir()) {
|
||||
found.extend(search_directories(&directory, filenames));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
found
|
||||
}
|
|
@ -0,0 +1,262 @@
|
|||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::{self, Error, ErrorKind, Read, Seek, SeekFrom};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use super::common;
|
||||
|
||||
//================================================
|
||||
// Validation
|
||||
//================================================
|
||||
|
||||
/// Extracts the ELF class from the ELF header in a shared library.
|
||||
fn parse_elf_header(path: &Path) -> io::Result<u8> {
|
||||
let mut file = File::open(path)?;
|
||||
let mut buffer = [0; 5];
|
||||
file.read_exact(&mut buffer)?;
|
||||
if buffer[..4] == [127, 69, 76, 70] {
|
||||
Ok(buffer[4])
|
||||
} else {
|
||||
Err(Error::new(ErrorKind::InvalidData, "invalid ELF header"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Extracts the magic number from the PE header in a shared library.
|
||||
fn parse_pe_header(path: &Path) -> io::Result<u16> {
|
||||
let mut file = File::open(path)?;
|
||||
|
||||
// Extract the header offset.
|
||||
let mut buffer = [0; 4];
|
||||
let start = SeekFrom::Start(0x3C);
|
||||
file.seek(start)?;
|
||||
file.read_exact(&mut buffer)?;
|
||||
let offset = i32::from_le_bytes(buffer);
|
||||
|
||||
// Check the validity of the header.
|
||||
file.seek(SeekFrom::Start(offset as u64))?;
|
||||
file.read_exact(&mut buffer)?;
|
||||
if buffer != [80, 69, 0, 0] {
|
||||
return Err(Error::new(ErrorKind::InvalidData, "invalid PE header"));
|
||||
}
|
||||
|
||||
// Extract the magic number.
|
||||
let mut buffer = [0; 2];
|
||||
file.seek(SeekFrom::Current(20))?;
|
||||
file.read_exact(&mut buffer)?;
|
||||
Ok(u16::from_le_bytes(buffer))
|
||||
}
|
||||
|
||||
/// Checks that a `libclang` shared library matches the target platform.
|
||||
fn validate_library(path: &Path) -> Result<(), String> {
|
||||
if cfg!(any(target_os = "linux", target_os = "freebsd")) {
|
||||
let class = parse_elf_header(path).map_err(|e| e.to_string())?;
|
||||
|
||||
if cfg!(target_pointer_width = "32") && class != 1 {
|
||||
return Err("invalid ELF class (64-bit)".into());
|
||||
}
|
||||
|
||||
if cfg!(target_pointer_width = "64") && class != 2 {
|
||||
return Err("invalid ELF class (32-bit)".into());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
} else if cfg!(target_os = "windows") {
|
||||
let magic = parse_pe_header(path).map_err(|e| e.to_string())?;
|
||||
|
||||
if cfg!(target_pointer_width = "32") && magic != 267 {
|
||||
return Err("invalid DLL (64-bit)".into());
|
||||
}
|
||||
|
||||
if cfg!(target_pointer_width = "64") && magic != 523 {
|
||||
return Err("invalid DLL (32-bit)".into());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
//================================================
|
||||
// Searching
|
||||
//================================================
|
||||
|
||||
/// Extracts the version components in a `libclang` shared library filename.
|
||||
fn parse_version(filename: &str) -> Vec<u32> {
|
||||
let version = if let Some(version) = filename.strip_prefix("libclang.so.") {
|
||||
version
|
||||
} else if filename.starts_with("libclang-") {
|
||||
&filename[9..filename.len() - 3]
|
||||
} else {
|
||||
return vec![];
|
||||
};
|
||||
|
||||
version.split('.').map(|s| s.parse().unwrap_or(0)).collect()
|
||||
}
|
||||
|
||||
/// Finds `libclang` shared libraries and returns the paths to, filenames of,
|
||||
/// and versions of those shared libraries.
|
||||
fn search_libclang_directories(runtime: bool) -> Result<Vec<(PathBuf, String, Vec<u32>)>, String> {
|
||||
let mut files = vec![format!(
|
||||
"{}clang{}",
|
||||
env::consts::DLL_PREFIX,
|
||||
env::consts::DLL_SUFFIX
|
||||
)];
|
||||
|
||||
if cfg!(target_os = "linux") {
|
||||
// Some Linux distributions don't create a `libclang.so` symlink, so we
|
||||
// need to look for versioned files (e.g., `libclang-3.9.so`).
|
||||
files.push("libclang-*.so".into());
|
||||
|
||||
// Some Linux distributions don't create a `libclang.so` symlink and
|
||||
// don't have versioned files as described above, so we need to look for
|
||||
// suffix versioned files (e.g., `libclang.so.1`). However, `ld` cannot
|
||||
// link to these files, so this will only be included when linking at
|
||||
// runtime.
|
||||
if runtime {
|
||||
files.push("libclang.so.*".into());
|
||||
files.push("libclang-*.so.*".into());
|
||||
}
|
||||
}
|
||||
|
||||
if cfg!(any(
|
||||
target_os = "freebsd",
|
||||
target_os = "haiku",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
)) {
|
||||
// Some BSD distributions don't create a `libclang.so` symlink either,
|
||||
// but use a different naming scheme for versioned files (e.g.,
|
||||
// `libclang.so.7.0`).
|
||||
files.push("libclang.so.*".into());
|
||||
}
|
||||
|
||||
if cfg!(target_os = "windows") {
|
||||
// The official LLVM build uses `libclang.dll` on Windows instead of
|
||||
// `clang.dll`. However, unofficial builds such as MinGW use `clang.dll`.
|
||||
files.push("libclang.dll".into());
|
||||
}
|
||||
|
||||
// Find and validate `libclang` shared libraries and collect the versions.
|
||||
let mut valid = vec![];
|
||||
let mut invalid = vec![];
|
||||
for (directory, filename) in common::search_libclang_directories(&files, "LIBCLANG_PATH") {
|
||||
let path = directory.join(&filename);
|
||||
match validate_library(&path) {
|
||||
Ok(()) => {
|
||||
let version = parse_version(&filename);
|
||||
valid.push((directory, filename, version))
|
||||
}
|
||||
Err(message) => invalid.push(format!("({}: {})", path.display(), message)),
|
||||
}
|
||||
}
|
||||
|
||||
if !valid.is_empty() {
|
||||
return Ok(valid);
|
||||
}
|
||||
|
||||
let message = format!(
|
||||
"couldn't find any valid shared libraries matching: [{}], set the \
|
||||
`LIBCLANG_PATH` environment variable to a path where one of these files \
|
||||
can be found (invalid: [{}])",
|
||||
files
|
||||
.iter()
|
||||
.map(|f| format!("'{}'", f))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "),
|
||||
invalid.join(", "),
|
||||
);
|
||||
|
||||
Err(message)
|
||||
}
|
||||
|
||||
/// Finds the "best" `libclang` shared library and returns the directory and
|
||||
/// filename of that library.
|
||||
pub fn find(runtime: bool) -> Result<(PathBuf, String), String> {
|
||||
search_libclang_directories(runtime)?
|
||||
.iter()
|
||||
// We want to find the `libclang` shared library with the highest
|
||||
// version number, hence `max_by_key` below.
|
||||
//
|
||||
// However, in the case where there are multiple such `libclang` shared
|
||||
// libraries, we want to use the order in which they appeared in the
|
||||
// list returned by `search_libclang_directories` as a tiebreaker since
|
||||
// that function returns `libclang` shared libraries in descending order
|
||||
// of preference by how they were found.
|
||||
//
|
||||
// `max_by_key`, perhaps surprisingly, returns the *last* item with the
|
||||
// maximum key rather than the first which results in the opposite of
|
||||
// the tiebreaking behavior we want. This is easily fixed by reversing
|
||||
// the list first.
|
||||
.rev()
|
||||
.max_by_key(|f| &f.2)
|
||||
.cloned()
|
||||
.map(|(path, filename, _)| (path, filename))
|
||||
.ok_or_else(|| "unreachable".into())
|
||||
}
|
||||
|
||||
//================================================
|
||||
// Linking
|
||||
//================================================
|
||||
|
||||
/// Finds and links to a `libclang` shared library.
|
||||
#[cfg(not(feature = "runtime"))]
|
||||
pub fn link() {
|
||||
let cep = common::CommandErrorPrinter::default();
|
||||
|
||||
use std::fs;
|
||||
|
||||
let (directory, filename) = find(false).unwrap();
|
||||
println!("cargo:rustc-link-search={}", directory.display());
|
||||
|
||||
if cfg!(all(target_os = "windows", target_env = "msvc")) {
|
||||
// Find the `libclang` stub static library required for the MSVC
|
||||
// toolchain.
|
||||
let lib = if !directory.ends_with("bin") {
|
||||
directory
|
||||
} else {
|
||||
directory.parent().unwrap().join("lib")
|
||||
};
|
||||
|
||||
if lib.join("libclang.lib").exists() {
|
||||
println!("cargo:rustc-link-search={}", lib.display());
|
||||
} else if lib.join("libclang.dll.a").exists() {
|
||||
// MSYS and MinGW use `libclang.dll.a` instead of `libclang.lib`.
|
||||
// It is linkable with the MSVC linker, but Rust doesn't recognize
|
||||
// the `.a` suffix, so we need to copy it with a different name.
|
||||
//
|
||||
// FIXME: Maybe we can just hardlink or symlink it?
|
||||
let out = env::var("OUT_DIR").unwrap();
|
||||
fs::copy(
|
||||
lib.join("libclang.dll.a"),
|
||||
Path::new(&out).join("libclang.lib"),
|
||||
)
|
||||
.unwrap();
|
||||
println!("cargo:rustc-link-search=native={}", out);
|
||||
} else {
|
||||
panic!(
|
||||
"using '{}', so 'libclang.lib' or 'libclang.dll.a' must be \
|
||||
available in {}",
|
||||
filename,
|
||||
lib.display(),
|
||||
);
|
||||
}
|
||||
|
||||
println!("cargo:rustc-link-lib=dylib=libclang");
|
||||
} else {
|
||||
let name = filename.trim_start_matches("lib");
|
||||
|
||||
// Strip extensions and trailing version numbers (e.g., the `.so.7.0` in
|
||||
// `libclang.so.7.0`).
|
||||
let name = match name.find(".dylib").or_else(|| name.find(".so")) {
|
||||
Some(index) => &name[0..index],
|
||||
None => name,
|
||||
};
|
||||
|
||||
println!("cargo:rustc-link-lib=dylib={}", name);
|
||||
}
|
||||
|
||||
cep.discard();
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
; ModuleID = 'probe0.990c8f4d-cgu.0'
|
||||
source_filename = "probe0.990c8f4d-cgu.0"
|
||||
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
!llvm.module.flags = !{!0, !1}
|
||||
|
||||
!0 = !{i32 7, !"PIC Level", i32 2}
|
||||
!1 = !{i32 2, !"RtLibUseGOT", i32 1}
|
|
@ -0,0 +1,9 @@
|
|||
; ModuleID = 'probe1.84fcdf3f-cgu.0'
|
||||
source_filename = "probe1.84fcdf3f-cgu.0"
|
||||
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
!llvm.module.flags = !{!0, !1}
|
||||
|
||||
!0 = !{i32 7, !"PIC Level", i32 2}
|
||||
!1 = !{i32 2, !"RtLibUseGOT", i32 1}
|
|
@ -0,0 +1,9 @@
|
|||
; ModuleID = 'probe2.c1d38c83-cgu.0'
|
||||
source_filename = "probe2.c1d38c83-cgu.0"
|
||||
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
!llvm.module.flags = !{!0, !1}
|
||||
|
||||
!0 = !{i32 7, !"PIC Level", i32 2}
|
||||
!1 = !{i32 2, !"RtLibUseGOT", i32 1}
|
|
@ -0,0 +1,9 @@
|
|||
; ModuleID = 'probe3.4a60c962-cgu.0'
|
||||
source_filename = "probe3.4a60c962-cgu.0"
|
||||
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
!llvm.module.flags = !{!0, !1}
|
||||
|
||||
!0 = !{i32 7, !"PIC Level", i32 2}
|
||||
!1 = !{i32 2, !"RtLibUseGOT", i32 1}
|
|
@ -0,0 +1,780 @@
|
|||
#[deny(overflowing_literals)]
|
||||
pub(crate) static BASES_16: [(u16, usize); 257] = [
|
||||
(0, 0), // 0
|
||||
(0, 0), // 1
|
||||
(0, 0), // 2
|
||||
(59049, 10), // 3
|
||||
(0, 0), // 4
|
||||
(15625, 6), // 5
|
||||
(46656, 6), // 6
|
||||
(16807, 5), // 7
|
||||
(0, 0), // 8
|
||||
(59049, 5), // 9
|
||||
(10000, 4), // 10
|
||||
(14641, 4), // 11
|
||||
(20736, 4), // 12
|
||||
(28561, 4), // 13
|
||||
(38416, 4), // 14
|
||||
(50625, 4), // 15
|
||||
(0, 0), // 16
|
||||
(4913, 3), // 17
|
||||
(5832, 3), // 18
|
||||
(6859, 3), // 19
|
||||
(8000, 3), // 20
|
||||
(9261, 3), // 21
|
||||
(10648, 3), // 22
|
||||
(12167, 3), // 23
|
||||
(13824, 3), // 24
|
||||
(15625, 3), // 25
|
||||
(17576, 3), // 26
|
||||
(19683, 3), // 27
|
||||
(21952, 3), // 28
|
||||
(24389, 3), // 29
|
||||
(27000, 3), // 30
|
||||
(29791, 3), // 31
|
||||
(0, 0), // 32
|
||||
(35937, 3), // 33
|
||||
(39304, 3), // 34
|
||||
(42875, 3), // 35
|
||||
(46656, 3), // 36
|
||||
(50653, 3), // 37
|
||||
(54872, 3), // 38
|
||||
(59319, 3), // 39
|
||||
(64000, 3), // 40
|
||||
(1681, 2), // 41
|
||||
(1764, 2), // 42
|
||||
(1849, 2), // 43
|
||||
(1936, 2), // 44
|
||||
(2025, 2), // 45
|
||||
(2116, 2), // 46
|
||||
(2209, 2), // 47
|
||||
(2304, 2), // 48
|
||||
(2401, 2), // 49
|
||||
(2500, 2), // 50
|
||||
(2601, 2), // 51
|
||||
(2704, 2), // 52
|
||||
(2809, 2), // 53
|
||||
(2916, 2), // 54
|
||||
(3025, 2), // 55
|
||||
(3136, 2), // 56
|
||||
(3249, 2), // 57
|
||||
(3364, 2), // 58
|
||||
(3481, 2), // 59
|
||||
(3600, 2), // 60
|
||||
(3721, 2), // 61
|
||||
(3844, 2), // 62
|
||||
(3969, 2), // 63
|
||||
(0, 0), // 64
|
||||
(4225, 2), // 65
|
||||
(4356, 2), // 66
|
||||
(4489, 2), // 67
|
||||
(4624, 2), // 68
|
||||
(4761, 2), // 69
|
||||
(4900, 2), // 70
|
||||
(5041, 2), // 71
|
||||
(5184, 2), // 72
|
||||
(5329, 2), // 73
|
||||
(5476, 2), // 74
|
||||
(5625, 2), // 75
|
||||
(5776, 2), // 76
|
||||
(5929, 2), // 77
|
||||
(6084, 2), // 78
|
||||
(6241, 2), // 79
|
||||
(6400, 2), // 80
|
||||
(6561, 2), // 81
|
||||
(6724, 2), // 82
|
||||
(6889, 2), // 83
|
||||
(7056, 2), // 84
|
||||
(7225, 2), // 85
|
||||
(7396, 2), // 86
|
||||
(7569, 2), // 87
|
||||
(7744, 2), // 88
|
||||
(7921, 2), // 89
|
||||
(8100, 2), // 90
|
||||
(8281, 2), // 91
|
||||
(8464, 2), // 92
|
||||
(8649, 2), // 93
|
||||
(8836, 2), // 94
|
||||
(9025, 2), // 95
|
||||
(9216, 2), // 96
|
||||
(9409, 2), // 97
|
||||
(9604, 2), // 98
|
||||
(9801, 2), // 99
|
||||
(10000, 2), // 100
|
||||
(10201, 2), // 101
|
||||
(10404, 2), // 102
|
||||
(10609, 2), // 103
|
||||
(10816, 2), // 104
|
||||
(11025, 2), // 105
|
||||
(11236, 2), // 106
|
||||
(11449, 2), // 107
|
||||
(11664, 2), // 108
|
||||
(11881, 2), // 109
|
||||
(12100, 2), // 110
|
||||
(12321, 2), // 111
|
||||
(12544, 2), // 112
|
||||
(12769, 2), // 113
|
||||
(12996, 2), // 114
|
||||
(13225, 2), // 115
|
||||
(13456, 2), // 116
|
||||
(13689, 2), // 117
|
||||
(13924, 2), // 118
|
||||
(14161, 2), // 119
|
||||
(14400, 2), // 120
|
||||
(14641, 2), // 121
|
||||
(14884, 2), // 122
|
||||
(15129, 2), // 123
|
||||
(15376, 2), // 124
|
||||
(15625, 2), // 125
|
||||
(15876, 2), // 126
|
||||
(16129, 2), // 127
|
||||
(0, 0), // 128
|
||||
(16641, 2), // 129
|
||||
(16900, 2), // 130
|
||||
(17161, 2), // 131
|
||||
(17424, 2), // 132
|
||||
(17689, 2), // 133
|
||||
(17956, 2), // 134
|
||||
(18225, 2), // 135
|
||||
(18496, 2), // 136
|
||||
(18769, 2), // 137
|
||||
(19044, 2), // 138
|
||||
(19321, 2), // 139
|
||||
(19600, 2), // 140
|
||||
(19881, 2), // 141
|
||||
(20164, 2), // 142
|
||||
(20449, 2), // 143
|
||||
(20736, 2), // 144
|
||||
(21025, 2), // 145
|
||||
(21316, 2), // 146
|
||||
(21609, 2), // 147
|
||||
(21904, 2), // 148
|
||||
(22201, 2), // 149
|
||||
(22500, 2), // 150
|
||||
(22801, 2), // 151
|
||||
(23104, 2), // 152
|
||||
(23409, 2), // 153
|
||||
(23716, 2), // 154
|
||||
(24025, 2), // 155
|
||||
(24336, 2), // 156
|
||||
(24649, 2), // 157
|
||||
(24964, 2), // 158
|
||||
(25281, 2), // 159
|
||||
(25600, 2), // 160
|
||||
(25921, 2), // 161
|
||||
(26244, 2), // 162
|
||||
(26569, 2), // 163
|
||||
(26896, 2), // 164
|
||||
(27225, 2), // 165
|
||||
(27556, 2), // 166
|
||||
(27889, 2), // 167
|
||||
(28224, 2), // 168
|
||||
(28561, 2), // 169
|
||||
(28900, 2), // 170
|
||||
(29241, 2), // 171
|
||||
(29584, 2), // 172
|
||||
(29929, 2), // 173
|
||||
(30276, 2), // 174
|
||||
(30625, 2), // 175
|
||||
(30976, 2), // 176
|
||||
(31329, 2), // 177
|
||||
(31684, 2), // 178
|
||||
(32041, 2), // 179
|
||||
(32400, 2), // 180
|
||||
(32761, 2), // 181
|
||||
(33124, 2), // 182
|
||||
(33489, 2), // 183
|
||||
(33856, 2), // 184
|
||||
(34225, 2), // 185
|
||||
(34596, 2), // 186
|
||||
(34969, 2), // 187
|
||||
(35344, 2), // 188
|
||||
(35721, 2), // 189
|
||||
(36100, 2), // 190
|
||||
(36481, 2), // 191
|
||||
(36864, 2), // 192
|
||||
(37249, 2), // 193
|
||||
(37636, 2), // 194
|
||||
(38025, 2), // 195
|
||||
(38416, 2), // 196
|
||||
(38809, 2), // 197
|
||||
(39204, 2), // 198
|
||||
(39601, 2), // 199
|
||||
(40000, 2), // 200
|
||||
(40401, 2), // 201
|
||||
(40804, 2), // 202
|
||||
(41209, 2), // 203
|
||||
(41616, 2), // 204
|
||||
(42025, 2), // 205
|
||||
(42436, 2), // 206
|
||||
(42849, 2), // 207
|
||||
(43264, 2), // 208
|
||||
(43681, 2), // 209
|
||||
(44100, 2), // 210
|
||||
(44521, 2), // 211
|
||||
(44944, 2), // 212
|
||||
(45369, 2), // 213
|
||||
(45796, 2), // 214
|
||||
(46225, 2), // 215
|
||||
(46656, 2), // 216
|
||||
(47089, 2), // 217
|
||||
(47524, 2), // 218
|
||||
(47961, 2), // 219
|
||||
(48400, 2), // 220
|
||||
(48841, 2), // 221
|
||||
(49284, 2), // 222
|
||||
(49729, 2), // 223
|
||||
(50176, 2), // 224
|
||||
(50625, 2), // 225
|
||||
(51076, 2), // 226
|
||||
(51529, 2), // 227
|
||||
(51984, 2), // 228
|
||||
(52441, 2), // 229
|
||||
(52900, 2), // 230
|
||||
(53361, 2), // 231
|
||||
(53824, 2), // 232
|
||||
(54289, 2), // 233
|
||||
(54756, 2), // 234
|
||||
(55225, 2), // 235
|
||||
(55696, 2), // 236
|
||||
(56169, 2), // 237
|
||||
(56644, 2), // 238
|
||||
(57121, 2), // 239
|
||||
(57600, 2), // 240
|
||||
(58081, 2), // 241
|
||||
(58564, 2), // 242
|
||||
(59049, 2), // 243
|
||||
(59536, 2), // 244
|
||||
(60025, 2), // 245
|
||||
(60516, 2), // 246
|
||||
(61009, 2), // 247
|
||||
(61504, 2), // 248
|
||||
(62001, 2), // 249
|
||||
(62500, 2), // 250
|
||||
(63001, 2), // 251
|
||||
(63504, 2), // 252
|
||||
(64009, 2), // 253
|
||||
(64516, 2), // 254
|
||||
(65025, 2), // 255
|
||||
(0, 0), // 256
|
||||
];
|
||||
#[deny(overflowing_literals)]
|
||||
pub(crate) static BASES_32: [(u32, usize); 257] = [
|
||||
(0, 0), // 0
|
||||
(0, 0), // 1
|
||||
(0, 0), // 2
|
||||
(3486784401, 20), // 3
|
||||
(0, 0), // 4
|
||||
(1220703125, 13), // 5
|
||||
(2176782336, 12), // 6
|
||||
(1977326743, 11), // 7
|
||||
(0, 0), // 8
|
||||
(3486784401, 10), // 9
|
||||
(1000000000, 9), // 10
|
||||
(2357947691, 9), // 11
|
||||
(429981696, 8), // 12
|
||||
(815730721, 8), // 13
|
||||
(1475789056, 8), // 14
|
||||
(2562890625, 8), // 15
|
||||
(0, 0), // 16
|
||||
(410338673, 7), // 17
|
||||
(612220032, 7), // 18
|
||||
(893871739, 7), // 19
|
||||
(1280000000, 7), // 20
|
||||
(1801088541, 7), // 21
|
||||
(2494357888, 7), // 22
|
||||
(3404825447, 7), // 23
|
||||
(191102976, 6), // 24
|
||||
(244140625, 6), // 25
|
||||
(308915776, 6), // 26
|
||||
(387420489, 6), // 27
|
||||
(481890304, 6), // 28
|
||||
(594823321, 6), // 29
|
||||
(729000000, 6), // 30
|
||||
(887503681, 6), // 31
|
||||
(0, 0), // 32
|
||||
(1291467969, 6), // 33
|
||||
(1544804416, 6), // 34
|
||||
(1838265625, 6), // 35
|
||||
(2176782336, 6), // 36
|
||||
(2565726409, 6), // 37
|
||||
(3010936384, 6), // 38
|
||||
(3518743761, 6), // 39
|
||||
(4096000000, 6), // 40
|
||||
(115856201, 5), // 41
|
||||
(130691232, 5), // 42
|
||||
(147008443, 5), // 43
|
||||
(164916224, 5), // 44
|
||||
(184528125, 5), // 45
|
||||
(205962976, 5), // 46
|
||||
(229345007, 5), // 47
|
||||
(254803968, 5), // 48
|
||||
(282475249, 5), // 49
|
||||
(312500000, 5), // 50
|
||||
(345025251, 5), // 51
|
||||
(380204032, 5), // 52
|
||||
(418195493, 5), // 53
|
||||
(459165024, 5), // 54
|
||||
(503284375, 5), // 55
|
||||
(550731776, 5), // 56
|
||||
(601692057, 5), // 57
|
||||
(656356768, 5), // 58
|
||||
(714924299, 5), // 59
|
||||
(777600000, 5), // 60
|
||||
(844596301, 5), // 61
|
||||
(916132832, 5), // 62
|
||||
(992436543, 5), // 63
|
||||
(0, 0), // 64
|
||||
(1160290625, 5), // 65
|
||||
(1252332576, 5), // 66
|
||||
(1350125107, 5), // 67
|
||||
(1453933568, 5), // 68
|
||||
(1564031349, 5), // 69
|
||||
(1680700000, 5), // 70
|
||||
(1804229351, 5), // 71
|
||||
(1934917632, 5), // 72
|
||||
(2073071593, 5), // 73
|
||||
(2219006624, 5), // 74
|
||||
(2373046875, 5), // 75
|
||||
(2535525376, 5), // 76
|
||||
(2706784157, 5), // 77
|
||||
(2887174368, 5), // 78
|
||||
(3077056399, 5), // 79
|
||||
(3276800000, 5), // 80
|
||||
(3486784401, 5), // 81
|
||||
(3707398432, 5), // 82
|
||||
(3939040643, 5), // 83
|
||||
(4182119424, 5), // 84
|
||||
(52200625, 4), // 85
|
||||
(54700816, 4), // 86
|
||||
(57289761, 4), // 87
|
||||
(59969536, 4), // 88
|
||||
(62742241, 4), // 89
|
||||
(65610000, 4), // 90
|
||||
(68574961, 4), // 91
|
||||
(71639296, 4), // 92
|
||||
(74805201, 4), // 93
|
||||
(78074896, 4), // 94
|
||||
(81450625, 4), // 95
|
||||
(84934656, 4), // 96
|
||||
(88529281, 4), // 97
|
||||
(92236816, 4), // 98
|
||||
(96059601, 4), // 99
|
||||
(100000000, 4), // 100
|
||||
(104060401, 4), // 101
|
||||
(108243216, 4), // 102
|
||||
(112550881, 4), // 103
|
||||
(116985856, 4), // 104
|
||||
(121550625, 4), // 105
|
||||
(126247696, 4), // 106
|
||||
(131079601, 4), // 107
|
||||
(136048896, 4), // 108
|
||||
(141158161, 4), // 109
|
||||
(146410000, 4), // 110
|
||||
(151807041, 4), // 111
|
||||
(157351936, 4), // 112
|
||||
(163047361, 4), // 113
|
||||
(168896016, 4), // 114
|
||||
(174900625, 4), // 115
|
||||
(181063936, 4), // 116
|
||||
(187388721, 4), // 117
|
||||
(193877776, 4), // 118
|
||||
(200533921, 4), // 119
|
||||
(207360000, 4), // 120
|
||||
(214358881, 4), // 121
|
||||
(221533456, 4), // 122
|
||||
(228886641, 4), // 123
|
||||
(236421376, 4), // 124
|
||||
(244140625, 4), // 125
|
||||
(252047376, 4), // 126
|
||||
(260144641, 4), // 127
|
||||
(0, 0), // 128
|
||||
(276922881, 4), // 129
|
||||
(285610000, 4), // 130
|
||||
(294499921, 4), // 131
|
||||
(303595776, 4), // 132
|
||||
(312900721, 4), // 133
|
||||
(322417936, 4), // 134
|
||||
(332150625, 4), // 135
|
||||
(342102016, 4), // 136
|
||||
(352275361, 4), // 137
|
||||
(362673936, 4), // 138
|
||||
(373301041, 4), // 139
|
||||
(384160000, 4), // 140
|
||||
(395254161, 4), // 141
|
||||
(406586896, 4), // 142
|
||||
(418161601, 4), // 143
|
||||
(429981696, 4), // 144
|
||||
(442050625, 4), // 145
|
||||
(454371856, 4), // 146
|
||||
(466948881, 4), // 147
|
||||
(479785216, 4), // 148
|
||||
(492884401, 4), // 149
|
||||
(506250000, 4), // 150
|
||||
(519885601, 4), // 151
|
||||
(533794816, 4), // 152
|
||||
(547981281, 4), // 153
|
||||
(562448656, 4), // 154
|
||||
(577200625, 4), // 155
|
||||
(592240896, 4), // 156
|
||||
(607573201, 4), // 157
|
||||
(623201296, 4), // 158
|
||||
(639128961, 4), // 159
|
||||
(655360000, 4), // 160
|
||||
(671898241, 4), // 161
|
||||
(688747536, 4), // 162
|
||||
(705911761, 4), // 163
|
||||
(723394816, 4), // 164
|
||||
(741200625, 4), // 165
|
||||
(759333136, 4), // 166
|
||||
(777796321, 4), // 167
|
||||
(796594176, 4), // 168
|
||||
(815730721, 4), // 169
|
||||
(835210000, 4), // 170
|
||||
(855036081, 4), // 171
|
||||
(875213056, 4), // 172
|
||||
(895745041, 4), // 173
|
||||
(916636176, 4), // 174
|
||||
(937890625, 4), // 175
|
||||
(959512576, 4), // 176
|
||||
(981506241, 4), // 177
|
||||
(1003875856, 4), // 178
|
||||
(1026625681, 4), // 179
|
||||
(1049760000, 4), // 180
|
||||
(1073283121, 4), // 181
|
||||
(1097199376, 4), // 182
|
||||
(1121513121, 4), // 183
|
||||
(1146228736, 4), // 184
|
||||
(1171350625, 4), // 185
|
||||
(1196883216, 4), // 186
|
||||
(1222830961, 4), // 187
|
||||
(1249198336, 4), // 188
|
||||
(1275989841, 4), // 189
|
||||
(1303210000, 4), // 190
|
||||
(1330863361, 4), // 191
|
||||
(1358954496, 4), // 192
|
||||
(1387488001, 4), // 193
|
||||
(1416468496, 4), // 194
|
||||
(1445900625, 4), // 195
|
||||
(1475789056, 4), // 196
|
||||
(1506138481, 4), // 197
|
||||
(1536953616, 4), // 198
|
||||
(1568239201, 4), // 199
|
||||
(1600000000, 4), // 200
|
||||
(1632240801, 4), // 201
|
||||
(1664966416, 4), // 202
|
||||
(1698181681, 4), // 203
|
||||
(1731891456, 4), // 204
|
||||
(1766100625, 4), // 205
|
||||
(1800814096, 4), // 206
|
||||
(1836036801, 4), // 207
|
||||
(1871773696, 4), // 208
|
||||
(1908029761, 4), // 209
|
||||
(1944810000, 4), // 210
|
||||
(1982119441, 4), // 211
|
||||
(2019963136, 4), // 212
|
||||
(2058346161, 4), // 213
|
||||
(2097273616, 4), // 214
|
||||
(2136750625, 4), // 215
|
||||
(2176782336, 4), // 216
|
||||
(2217373921, 4), // 217
|
||||
(2258530576, 4), // 218
|
||||
(2300257521, 4), // 219
|
||||
(2342560000, 4), // 220
|
||||
(2385443281, 4), // 221
|
||||
(2428912656, 4), // 222
|
||||
(2472973441, 4), // 223
|
||||
(2517630976, 4), // 224
|
||||
(2562890625, 4), // 225
|
||||
(2608757776, 4), // 226
|
||||
(2655237841, 4), // 227
|
||||
(2702336256, 4), // 228
|
||||
(2750058481, 4), // 229
|
||||
(2798410000, 4), // 230
|
||||
(2847396321, 4), // 231
|
||||
(2897022976, 4), // 232
|
||||
(2947295521, 4), // 233
|
||||
(2998219536, 4), // 234
|
||||
(3049800625, 4), // 235
|
||||
(3102044416, 4), // 236
|
||||
(3154956561, 4), // 237
|
||||
(3208542736, 4), // 238
|
||||
(3262808641, 4), // 239
|
||||
(3317760000, 4), // 240
|
||||
(3373402561, 4), // 241
|
||||
(3429742096, 4), // 242
|
||||
(3486784401, 4), // 243
|
||||
(3544535296, 4), // 244
|
||||
(3603000625, 4), // 245
|
||||
(3662186256, 4), // 246
|
||||
(3722098081, 4), // 247
|
||||
(3782742016, 4), // 248
|
||||
(3844124001, 4), // 249
|
||||
(3906250000, 4), // 250
|
||||
(3969126001, 4), // 251
|
||||
(4032758016, 4), // 252
|
||||
(4097152081, 4), // 253
|
||||
(4162314256, 4), // 254
|
||||
(4228250625, 4), // 255
|
||||
(0, 0), // 256
|
||||
];
|
||||
#[deny(overflowing_literals)]
|
||||
pub(crate) static BASES_64: [(u64, usize); 257] = [
|
||||
(0, 0), // 0
|
||||
(0, 0), // 1
|
||||
(0, 0), // 2
|
||||
(12157665459056928801, 40), // 3
|
||||
(0, 0), // 4
|
||||
(7450580596923828125, 27), // 5
|
||||
(4738381338321616896, 24), // 6
|
||||
(3909821048582988049, 22), // 7
|
||||
(0, 0), // 8
|
||||
(12157665459056928801, 20), // 9
|
||||
(10000000000000000000, 19), // 10
|
||||
(5559917313492231481, 18), // 11
|
||||
(2218611106740436992, 17), // 12
|
||||
(8650415919381337933, 17), // 13
|
||||
(2177953337809371136, 16), // 14
|
||||
(6568408355712890625, 16), // 15
|
||||
(0, 0), // 16
|
||||
(2862423051509815793, 15), // 17
|
||||
(6746640616477458432, 15), // 18
|
||||
(15181127029874798299, 15), // 19
|
||||
(1638400000000000000, 14), // 20
|
||||
(3243919932521508681, 14), // 21
|
||||
(6221821273427820544, 14), // 22
|
||||
(11592836324538749809, 14), // 23
|
||||
(876488338465357824, 13), // 24
|
||||
(1490116119384765625, 13), // 25
|
||||
(2481152873203736576, 13), // 26
|
||||
(4052555153018976267, 13), // 27
|
||||
(6502111422497947648, 13), // 28
|
||||
(10260628712958602189, 13), // 29
|
||||
(15943230000000000000, 13), // 30
|
||||
(787662783788549761, 12), // 31
|
||||
(0, 0), // 32
|
||||
(1667889514952984961, 12), // 33
|
||||
(2386420683693101056, 12), // 34
|
||||
(3379220508056640625, 12), // 35
|
||||
(4738381338321616896, 12), // 36
|
||||
(6582952005840035281, 12), // 37
|
||||
(9065737908494995456, 12), // 38
|
||||
(12381557655576425121, 12), // 39
|
||||
(16777216000000000000, 12), // 40
|
||||
(550329031716248441, 11), // 41
|
||||
(717368321110468608, 11), // 42
|
||||
(929293739471222707, 11), // 43
|
||||
(1196683881290399744, 11), // 44
|
||||
(1532278301220703125, 11), // 45
|
||||
(1951354384207722496, 11), // 46
|
||||
(2472159215084012303, 11), // 47
|
||||
(3116402981210161152, 11), // 48
|
||||
(3909821048582988049, 11), // 49
|
||||
(4882812500000000000, 11), // 50
|
||||
(6071163615208263051, 11), // 51
|
||||
(7516865509350965248, 11), // 52
|
||||
(9269035929372191597, 11), // 53
|
||||
(11384956040305711104, 11), // 54
|
||||
(13931233916552734375, 11), // 55
|
||||
(16985107389382393856, 11), // 56
|
||||
(362033331456891249, 10), // 57
|
||||
(430804206899405824, 10), // 58
|
||||
(511116753300641401, 10), // 59
|
||||
(604661760000000000, 10), // 60
|
||||
(713342911662882601, 10), // 61
|
||||
(839299365868340224, 10), // 62
|
||||
(984930291881790849, 10), // 63
|
||||
(0, 0), // 64
|
||||
(1346274334462890625, 10), // 65
|
||||
(1568336880910795776, 10), // 66
|
||||
(1822837804551761449, 10), // 67
|
||||
(2113922820157210624, 10), // 68
|
||||
(2446194060654759801, 10), // 69
|
||||
(2824752490000000000, 10), // 70
|
||||
(3255243551009881201, 10), // 71
|
||||
(3743906242624487424, 10), // 72
|
||||
(4297625829703557649, 10), // 73
|
||||
(4923990397355877376, 10), // 74
|
||||
(5631351470947265625, 10), // 75
|
||||
(6428888932339941376, 10), // 76
|
||||
(7326680472586200649, 10), // 77
|
||||
(8335775831236199424, 10), // 78
|
||||
(9468276082626847201, 10), // 79
|
||||
(10737418240000000000, 10), // 80
|
||||
(12157665459056928801, 10), // 81
|
||||
(13744803133596058624, 10), // 82
|
||||
(15516041187205853449, 10), // 83
|
||||
(17490122876598091776, 10), // 84
|
||||
(231616946283203125, 9), // 85
|
||||
(257327417311663616, 9), // 86
|
||||
(285544154243029527, 9), // 87
|
||||
(316478381828866048, 9), // 88
|
||||
(350356403707485209, 9), // 89
|
||||
(387420489000000000, 9), // 90
|
||||
(427929800129788411, 9), // 91
|
||||
(472161363286556672, 9), // 92
|
||||
(520411082988487293, 9), // 93
|
||||
(572994802228616704, 9), // 94
|
||||
(630249409724609375, 9), // 95
|
||||
(692533995824480256, 9), // 96
|
||||
(760231058654565217, 9), // 97
|
||||
(833747762130149888, 9), // 98
|
||||
(913517247483640899, 9), // 99
|
||||
(1000000000000000000, 9), // 100
|
||||
(1093685272684360901, 9), // 101
|
||||
(1195092568622310912, 9), // 102
|
||||
(1304773183829244583, 9), // 103
|
||||
(1423311812421484544, 9), // 104
|
||||
(1551328215978515625, 9), // 105
|
||||
(1689478959002692096, 9), // 106
|
||||
(1838459212420154507, 9), // 107
|
||||
(1999004627104432128, 9), // 108
|
||||
(2171893279442309389, 9), // 109
|
||||
(2357947691000000000, 9), // 110
|
||||
(2558036924386500591, 9), // 111
|
||||
(2773078757450186752, 9), // 112
|
||||
(3004041937984268273, 9), // 113
|
||||
(3251948521156637184, 9), // 114
|
||||
(3517876291919921875, 9), // 115
|
||||
(3802961274698203136, 9), // 116
|
||||
(4108400332687853397, 9), // 117
|
||||
(4435453859151328768, 9), // 118
|
||||
(4785448563124474679, 9), // 119
|
||||
(5159780352000000000, 9), // 120
|
||||
(5559917313492231481, 9), // 121
|
||||
(5987402799531080192, 9), // 122
|
||||
(6443858614676334363, 9), // 123
|
||||
(6930988311686938624, 9), // 124
|
||||
(7450580596923828125, 9), // 125
|
||||
(8004512848309157376, 9), // 126
|
||||
(8594754748609397887, 9), // 127
|
||||
(0, 0), // 128
|
||||
(9892530380752880769, 9), // 129
|
||||
(10604499373000000000, 9), // 130
|
||||
(11361656654439817571, 9), // 131
|
||||
(12166492167065567232, 9), // 132
|
||||
(13021612539908538853, 9), // 133
|
||||
(13929745610903012864, 9), // 134
|
||||
(14893745087865234375, 9), // 135
|
||||
(15916595351771938816, 9), // 136
|
||||
(17001416405572203977, 9), // 137
|
||||
(18151468971815029248, 9), // 138
|
||||
(139353667211683681, 8), // 139
|
||||
(147578905600000000, 8), // 140
|
||||
(156225851787813921, 8), // 141
|
||||
(165312903998914816, 8), // 142
|
||||
(174859124550883201, 8), // 143
|
||||
(184884258895036416, 8), // 144
|
||||
(195408755062890625, 8), // 145
|
||||
(206453783524884736, 8), // 146
|
||||
(218041257467152161, 8), // 147
|
||||
(230193853492166656, 8), // 148
|
||||
(242935032749128801, 8), // 149
|
||||
(256289062500000000, 8), // 150
|
||||
(270281038127131201, 8), // 151
|
||||
(284936905588473856, 8), // 152
|
||||
(300283484326400961, 8), // 153
|
||||
(316348490636206336, 8), // 154
|
||||
(333160561500390625, 8), // 155
|
||||
(350749278894882816, 8), // 156
|
||||
(369145194573386401, 8), // 157
|
||||
(388379855336079616, 8), // 158
|
||||
(408485828788939521, 8), // 159
|
||||
(429496729600000000, 8), // 160
|
||||
(451447246258894081, 8), // 161
|
||||
(474373168346071296, 8), // 162
|
||||
(498311414318121121, 8), // 163
|
||||
(523300059815673856, 8), // 164
|
||||
(549378366500390625, 8), // 165
|
||||
(576586811427594496, 8), // 166
|
||||
(604967116961135041, 8), // 167
|
||||
(634562281237118976, 8), // 168
|
||||
(665416609183179841, 8), // 169
|
||||
(697575744100000000, 8), // 170
|
||||
(731086699811838561, 8), // 171
|
||||
(765997893392859136, 8), // 172
|
||||
(802359178476091681, 8), // 173
|
||||
(840221879151902976, 8), // 174
|
||||
(879638824462890625, 8), // 175
|
||||
(920664383502155776, 8), // 176
|
||||
(963354501121950081, 8), // 177
|
||||
(1007766734259732736, 8), // 178
|
||||
(1053960288888713761, 8), // 179
|
||||
(1101996057600000000, 8), // 180
|
||||
(1151936657823500641, 8), // 181
|
||||
(1203846470694789376, 8), // 182
|
||||
(1257791680575160641, 8), // 183
|
||||
(1313840315232157696, 8), // 184
|
||||
(1372062286687890625, 8), // 185
|
||||
(1432529432742502656, 8), // 186
|
||||
(1495315559180183521, 8), // 187
|
||||
(1560496482665168896, 8), // 188
|
||||
(1628150074335205281, 8), // 189
|
||||
(1698356304100000000, 8), // 190
|
||||
(1771197285652216321, 8), // 191
|
||||
(1846757322198614016, 8), // 192
|
||||
(1925122952918976001, 8), // 193
|
||||
(2006383000160502016, 8), // 194
|
||||
(2090628617375390625, 8), // 195
|
||||
(2177953337809371136, 8), // 196
|
||||
(2268453123948987361, 8), // 197
|
||||
(2362226417735475456, 8), // 198
|
||||
(2459374191553118401, 8), // 199
|
||||
(2560000000000000000, 8), // 200
|
||||
(2664210032449121601, 8), // 201
|
||||
(2772113166407885056, 8), // 202
|
||||
(2883821021683985761, 8), // 203
|
||||
(2999448015365799936, 8), // 204
|
||||
(3119111417625390625, 8), // 205
|
||||
(3242931408352297216, 8), // 206
|
||||
(3371031134626313601, 8), // 207
|
||||
(3503536769037500416, 8), // 208
|
||||
(3640577568861717121, 8), // 209
|
||||
(3782285936100000000, 8), // 210
|
||||
(3928797478390152481, 8), // 211
|
||||
(4080251070798954496, 8), // 212
|
||||
(4236788918503437921, 8), // 213
|
||||
(4398556620369715456, 8), // 214
|
||||
(4565703233437890625, 8), // 215
|
||||
(4738381338321616896, 8), // 216
|
||||
(4916747105530914241, 8), // 217
|
||||
(5100960362726891776, 8), // 218
|
||||
(5291184662917065441, 8), // 219
|
||||
(5487587353600000000, 8), // 220
|
||||
(5690339646868044961, 8), // 221
|
||||
(5899616690476974336, 8), // 222
|
||||
(6115597639891380481, 8), // 223
|
||||
(6338465731314712576, 8), // 224
|
||||
(6568408355712890625, 8), // 225
|
||||
(6805617133840466176, 8), // 226
|
||||
(7050287992278341281, 8), // 227
|
||||
(7302621240492097536, 8), // 228
|
||||
(7562821648920027361, 8), // 229
|
||||
(7831098528100000000, 8), // 230
|
||||
(8107665808844335041, 8), // 231
|
||||
(8392742123471896576, 8), // 232
|
||||
(8686550888106661441, 8), // 233
|
||||
(8989320386052055296, 8), // 234
|
||||
(9301283852250390625, 8), // 235
|
||||
(9622679558836781056, 8), // 236
|
||||
(9953750901796946721, 8), // 237
|
||||
(10294746488738365696, 8), // 238
|
||||
(10645920227784266881, 8), // 239
|
||||
(11007531417600000000, 8), // 240
|
||||
(11379844838561358721, 8), // 241
|
||||
(11763130845074473216, 8), // 242
|
||||
(12157665459056928801, 8), // 243
|
||||
(12563730464589807616, 8), // 244
|
||||
(12981613503750390625, 8), // 245
|
||||
(13411608173635297536, 8), // 246
|
||||
(13854014124583882561, 8), // 247
|
||||
(14309137159611744256, 8), // 248
|
||||
(14777289335064248001, 8), // 249
|
||||
(15258789062500000000, 8), // 250
|
||||
(15753961211814252001, 8), // 251
|
||||
(16263137215612256256, 8), // 252
|
||||
(16786655174842630561, 8), // 253
|
||||
(17324859965700833536, 8), // 254
|
||||
(17878103347812890625, 8), // 255
|
||||
(0, 0), // 256
|
||||
];
|
|
@ -0,0 +1,415 @@
|
|||
/// 1.3.133.16.840.63.0.2
|
||||
pub const OID_KDF_SHA1_SINGLE: Oid<'static> = oid!(1.3.133.16.840.63.0.2);
|
||||
/// 1.3.6.1.4.1.311.2.1.4
|
||||
pub const SPC_INDIRECT_DATA_OBJID: Oid<'static> = oid!(1.3.6.1.4.1.311.2.1.4);
|
||||
/// 1.3.6.1.4.1.311.2.1.11
|
||||
pub const SPC_STATEMENT_TYPE_OBJID: Oid<'static> = oid!(1.3.6.1.4.1.311.2.1.11);
|
||||
/// 1.3.6.1.4.1.311.2.1.12
|
||||
pub const SPC_SP_OPUS_INFO_OBJID: Oid<'static> = oid!(1.3.6.1.4.1.311.2.1.12);
|
||||
/// 1.3.6.1.4.1.311.2.1.15
|
||||
pub const SPC_PE_IMAGE_DATA: Oid<'static> = oid!(1.3.6.1.4.1.311.2.1.15);
|
||||
/// 1.3.6.1.4.1.311.2.1.21
|
||||
pub const SPC_INDIVIDUAL_SP_KEY_PURPOSE_OBJID : Oid<'static> = oid!(1.3.6.1.4.1.311.2.1.21);
|
||||
/// 1.3.6.1.4.1.311.10.1
|
||||
pub const MS_CTL: Oid<'static> = oid!(1.3.6.1.4.1.311.10.1);
|
||||
/// 1.3.132.0.34
|
||||
pub const OID_NIST_EC_P384: Oid<'static> = oid!(1.3.132.0.34);
|
||||
/// 1.3.132.0.35
|
||||
pub const OID_NIST_EC_P521: Oid<'static> = oid!(1.3.132.0.35);
|
||||
/// 1.3.14.3.2.26
|
||||
pub const OID_HASH_SHA1: Oid<'static> = oid!(1.3.14.3.2.26);
|
||||
/// 2.16.840.1.101.3.4.1.42
|
||||
pub const OID_NIST_ENC_AES256_CBC: Oid<'static> = oid!(2.16.840.1.101.3.4.1.42);
|
||||
/// 2.16.840.1.101.3.4.2.1
|
||||
pub const OID_NIST_HASH_SHA256: Oid<'static> = oid!(2.16.840.1.101.3.4.2.1);
|
||||
/// 2.16.840.1.101.3.4.2.2
|
||||
pub const OID_NIST_HASH_SHA384: Oid<'static> = oid!(2.16.840.1.101.3.4.2.2);
|
||||
/// 2.16.840.1.101.3.4.2.3
|
||||
pub const OID_NIST_HASH_SHA512: Oid<'static> = oid!(2.16.840.1.101.3.4.2.3);
|
||||
/// 1.2.840.113549.1.1.1
|
||||
pub const OID_PKCS1_RSAENCRYPTION: Oid<'static> = oid!(1.2.840.113549.1.1.1);
|
||||
/// 1.2.840.113549.1.1.2
|
||||
pub const OID_PKCS1_MD2WITHRSAENC: Oid<'static> = oid!(1.2.840.113549.1.1.2);
|
||||
/// 1.2.840.113549.1.1.3
|
||||
pub const OID_PKCS1_MD4WITHRSAENC: Oid<'static> = oid!(1.2.840.113549.1.1.3);
|
||||
/// 1.2.840.113549.1.1.4
|
||||
pub const OID_PKCS1_MD5WITHRSAENC: Oid<'static> = oid!(1.2.840.113549.1.1.4);
|
||||
/// 1.2.840.113549.1.1.5
|
||||
pub const OID_PKCS1_SHA1WITHRSA: Oid<'static> = oid!(1.2.840.113549.1.1.5);
|
||||
/// 1.2.840.113549.1.1.10
|
||||
pub const OID_PKCS1_RSASSAPSS: Oid<'static> = oid!(1.2.840.113549.1.1.10);
|
||||
/// 1.2.840.113549.1.1.11
|
||||
pub const OID_PKCS1_SHA256WITHRSA: Oid<'static> = oid!(1.2.840.113549.1.1.11);
|
||||
/// 1.2.840.113549.1.1.12
|
||||
pub const OID_PKCS1_SHA384WITHRSA: Oid<'static> = oid!(1.2.840.113549.1.1.12);
|
||||
/// 1.2.840.113549.1.1.13
|
||||
pub const OID_PKCS1_SHA512WITHRSA: Oid<'static> = oid!(1.2.840.113549.1.1.13);
|
||||
/// 1.2.840.113549.1.1.14
|
||||
pub const OID_PKCS1_SHA224WITHRSA: Oid<'static> = oid!(1.2.840.113549.1.1.14);
|
||||
/// 1.2.840.113549.1.12
|
||||
pub const OID_PKCS12: Oid<'static> = oid!(1.2.840.113549.1.12);
|
||||
/// 1.2.840.113549.1.12.1
|
||||
pub const OID_PKCS12_PBEIDS: Oid<'static> = oid!(1.2.840.113549.1.12.1);
|
||||
/// 1.2.840.113549.1.12.1.1
|
||||
pub const OID_PKCS12_PBE_SHA1_128RC4: Oid<'static> = oid!(1.2.840.113549.1.12.1.1);
|
||||
/// 1.2.840.113549.1.12.1.2
|
||||
pub const OID_PKCS12_PBE_SHA1_40RC4: Oid<'static> = oid!(1.2.840.113549.1.12.1.2);
|
||||
/// 1.2.840.113549.1.12.1.3
|
||||
pub const OID_PKCS12_PBE_SHA1_3K_3DES_CBC: Oid<'static> = oid!(1.2.840.113549.1.12.1.3);
|
||||
/// 1.2.840.113549.1.12.1.4
|
||||
pub const OID_PKCS12_PBE_SHA1_2K_3DES_CBC: Oid<'static> = oid!(1.2.840.113549.1.12.1.4);
|
||||
/// 1.2.840.113549.1.12.1.5
|
||||
pub const OID_PKCS12_PBE_SHA1_128RC2_CBC: Oid<'static> = oid!(1.2.840.113549.1.12.1.5);
|
||||
/// 1.2.840.113549.1.12.1.6
|
||||
pub const OID_PKCS12_PBE_SHA1_40RC2_CBC: Oid<'static> = oid!(1.2.840.113549.1.12.1.6);
|
||||
/// 1.2.840.113549.1.7.1
|
||||
pub const OID_PKCS7_ID_DATA: Oid<'static> = oid!(1.2.840.113549.1.7.1);
|
||||
/// 1.2.840.113549.1.7.2
|
||||
pub const OID_PKCS7_ID_SIGNED_DATA: Oid<'static> = oid!(1.2.840.113549.1.7.2);
|
||||
/// 1.2.840.113549.1.7.3
|
||||
pub const OID_PKCS7_ID_ENVELOPED_DATA: Oid<'static> = oid!(1.2.840.113549.1.7.3);
|
||||
/// 1.2.840.113549.1.7.4
|
||||
pub const OID_PKCS7_ID_SIGNED_ENVELOPED_DATA: Oid<'static> = oid!(1.2.840.113549.1.7.4);
|
||||
/// 1.2.840.113549.1.7.5
|
||||
pub const OID_PKCS7_ID_DIGESTED_DATA: Oid<'static> = oid!(1.2.840.113549.1.7.5);
|
||||
/// 1.2.840.113549.1.7.6
|
||||
pub const OID_PKCS7_ID_ENCRYPTED_DATA: Oid<'static> = oid!(1.2.840.113549.1.7.6);
|
||||
/// 1.2.840.113549.1.9.1
|
||||
pub const OID_PKCS9_EMAIL_ADDRESS: Oid<'static> = oid!(1.2.840.113549.1.9.1);
|
||||
/// 1.2.840.113549.1.9.2
|
||||
pub const OID_PKCS9_UNSTRUCTURED_NAME: Oid<'static> = oid!(1.2.840.113549.1.9.2);
|
||||
/// 1.2.840.113549.1.9.3
|
||||
pub const OID_PKCS9_CONTENT_TYPE: Oid<'static> = oid!(1.2.840.113549.1.9.3);
|
||||
/// 1.2.840.113549.1.9.4
|
||||
pub const OID_PKCS9_ID_MESSAGE_DIGEST: Oid<'static> = oid!(1.2.840.113549.1.9.4);
|
||||
/// 1.2.840.113549.1.9.5
|
||||
pub const OID_PKCS9_SIGNING_TIME: Oid<'static> = oid!(1.2.840.113549.1.9.5);
|
||||
/// 1.2.840.113549.1.9.14
|
||||
pub const OID_PKCS9_EXTENSION_REQUEST: Oid<'static> = oid!(1.2.840.113549.1.9.14);
|
||||
/// 1.2.840.113549.1.9.15
|
||||
pub const OID_PKCS9_SMIME_CAPABILITIES: Oid<'static> = oid!(1.2.840.113549.1.9.15);
|
||||
/// 2.5
|
||||
pub const OID_X500: Oid<'static> = oid!(2.5);
|
||||
/// 0.9.2342.19200300.100.1.25
|
||||
pub const OID_DOMAIN_COMPONENT: Oid<'static> = oid!(0.9.2342.19200300.100.1.25);
|
||||
/// 1.3.101.112
|
||||
pub const OID_SIG_ED25519: Oid<'static> = oid!(1.3.101.112);
|
||||
/// 1.3.101.113
|
||||
pub const OID_SIG_ED448: Oid<'static> = oid!(1.3.101.113);
|
||||
/// 1.3.6.1.4.1.11129.2.4.2
|
||||
pub const OID_CT_LIST_SCT: Oid<'static> = oid!(1.3.6.1.4.1.11129.2.4.2);
|
||||
/// 1.3.6.1.5.5.7.1.1
|
||||
pub const OID_PKIX_AUTHORITY_INFO_ACCESS: Oid<'static> = oid!(1.3.6.1.5.5.7.1.1);
|
||||
/// 1.3.6.1.5.5.7.48.1
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_OCSP: Oid<'static> = oid!(1.3.6.1.5.5.7.48.1);
|
||||
/// 1.3.6.1.5.5.7.48.2
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_CA_ISSUERS: Oid<'static> = oid!(1.3.6.1.5.5.7.48.2);
|
||||
/// 1.3.6.1.5.5.7.48.3
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_TIMESTAMPING: Oid<'static> = oid!(1.3.6.1.5.5.7.48.3);
|
||||
/// 1.3.6.1.5.5.7.48.4
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_DVCS: Oid<'static> = oid!(1.3.6.1.5.5.7.48.4);
|
||||
/// 1.3.6.1.5.5.7.48.5
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_CA_REPOSITORY: Oid<'static> = oid!(1.3.6.1.5.5.7.48.5);
|
||||
/// 1.3.6.1.5.5.7.48.6
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_HTTP_CERTS: Oid<'static> = oid!(1.3.6.1.5.5.7.48.6);
|
||||
/// 1.3.6.1.5.5.7.48.7
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_HTTP_CRLS: Oid<'static> = oid!(1.3.6.1.5.5.7.48.7);
|
||||
/// 1.3.6.1.5.5.7.48.10
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_RPKI_MANIFEST: Oid<'static> = oid!(1.3.6.1.5.5.7.48.10);
|
||||
/// 1.3.6.1.5.5.7.48.11
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_SIGNED_OBJECT: Oid<'static> = oid!(1.3.6.1.5.5.7.48.11);
|
||||
/// 1.3.6.1.5.5.7.48.12
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_CMC: Oid<'static> = oid!(1.3.6.1.5.5.7.48.12);
|
||||
/// 1.3.6.1.5.5.7.48.13
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_RPKI_NOTIFY: Oid<'static> = oid!(1.3.6.1.5.5.7.48.13);
|
||||
/// 1.3.6.1.5.5.7.48.14
|
||||
pub const OID_PKIX_ACCESS_DESCRIPTOR_STIRTNLIST: Oid<'static> = oid!(1.3.6.1.5.5.7.48.14);
|
||||
/// 2.5.4
|
||||
pub const OID_X509: Oid<'static> = oid!(2.5.4);
|
||||
/// 2.5.4.0
|
||||
pub const OID_X509_OBJECT_CLASS: Oid<'static> = oid!(2.5.4.0);
|
||||
/// 2.5.4.1
|
||||
pub const OID_X509_ALIASED_ENTRY_NAME: Oid<'static> = oid!(2.5.4.1);
|
||||
/// 2.5.4.2
|
||||
pub const OID_X509_KNOWLEDGE_INFORMATION: Oid<'static> = oid!(2.5.4.2);
|
||||
/// 2.5.4.3
|
||||
pub const OID_X509_COMMON_NAME: Oid<'static> = oid!(2.5.4.3);
|
||||
/// 2.5.4.4
|
||||
pub const OID_X509_SURNAME: Oid<'static> = oid!(2.5.4.4);
|
||||
/// 2.5.4.5
|
||||
pub const OID_X509_SERIALNUMBER: Oid<'static> = oid!(2.5.4.5);
|
||||
/// 2.5.4.6
|
||||
pub const OID_X509_COUNTRY_NAME: Oid<'static> = oid!(2.5.4.6);
|
||||
/// 2.5.4.7
|
||||
pub const OID_X509_LOCALITY_NAME: Oid<'static> = oid!(2.5.4.7);
|
||||
/// 2.5.4.8
|
||||
pub const OID_X509_STATE_OR_PROVINCE_NAME: Oid<'static> = oid!(2.5.4.8);
|
||||
/// 2.5.4.9
|
||||
pub const OID_X509_STREET_ADDRESS: Oid<'static> = oid!(2.5.4.9);
|
||||
/// 2.5.4.10
|
||||
pub const OID_X509_ORGANIZATION_NAME: Oid<'static> = oid!(2.5.4.10);
|
||||
/// 2.5.4.11
|
||||
pub const OID_X509_ORGANIZATIONAL_UNIT: Oid<'static> = oid!(2.5.4.11);
|
||||
/// 2.5.4.12
|
||||
pub const OID_X509_TITLE: Oid<'static> = oid!(2.5.4.12);
|
||||
/// 2.5.4.13
|
||||
pub const OID_X509_DESCRIPTION: Oid<'static> = oid!(2.5.4.13);
|
||||
/// 2.5.4.14
|
||||
pub const OID_X509_SEARCH_GUIDE: Oid<'static> = oid!(2.5.4.14);
|
||||
/// 2.5.4.15
|
||||
pub const OID_X509_BUSINESS_CATEGORY: Oid<'static> = oid!(2.5.4.15);
|
||||
/// 2.5.4.16
|
||||
pub const OID_X509_POSTAL_ADDRESS: Oid<'static> = oid!(2.5.4.16);
|
||||
/// 2.5.4.17
|
||||
pub const OID_X509_POSTAL_CODE: Oid<'static> = oid!(2.5.4.17);
|
||||
/// 2.5.4.41
|
||||
pub const OID_X509_NAME: Oid<'static> = oid!(2.5.4.41);
|
||||
/// 2.5.4.42
|
||||
pub const OID_X509_GIVEN_NAME: Oid<'static> = oid!(2.5.4.42);
|
||||
/// 2.5.4.45
|
||||
pub const OID_X509_UNIQUE_IDENTIFIER: Oid<'static> = oid!(2.5.4.45);
|
||||
/// 2.5.29.14
|
||||
pub const OID_X509_EXT_SUBJECT_KEY_IDENTIFIER: Oid<'static> = oid!(2.5.29.14);
|
||||
/// 2.5.29.15
|
||||
pub const OID_X509_EXT_KEY_USAGE: Oid<'static> = oid!(2.5.29.15);
|
||||
/// 2.5.29.16
|
||||
pub const OID_X509_EXT_PRIVATE_KEY_USAGE_PERIOD: Oid<'static> = oid!(2.5.29.16);
|
||||
/// 2.5.29.17
|
||||
pub const OID_X509_EXT_SUBJECT_ALT_NAME: Oid<'static> = oid!(2.5.29.17);
|
||||
/// 2.5.29.18
|
||||
pub const OID_X509_EXT_ISSUER_ALT_NAME: Oid<'static> = oid!(2.5.29.18);
|
||||
/// 2.5.29.19
|
||||
pub const OID_X509_EXT_BASIC_CONSTRAINTS: Oid<'static> = oid!(2.5.29.19);
|
||||
/// 2.5.29.20
|
||||
pub const OID_X509_EXT_CRL_NUMBER: Oid<'static> = oid!(2.5.29.20);
|
||||
/// 2.5.29.21
|
||||
pub const OID_X509_EXT_REASON_CODE: Oid<'static> = oid!(2.5.29.21);
|
||||
/// 2.5.29.23
|
||||
pub const OID_X509_EXT_HOLD_INSTRUCTION_CODE: Oid<'static> = oid!(2.5.29.23);
|
||||
/// 2.5.29.24
|
||||
pub const OID_X509_EXT_INVALIDITY_DATE: Oid<'static> = oid!(2.5.29.24);
|
||||
/// 2.5.29.27
|
||||
pub const OID_X509_EXT_DELTA_CRL_INDICATOR: Oid<'static> = oid!(2.5.29.27);
|
||||
/// 2.5.29.28
|
||||
pub const OID_X509_EXT_ISSUER_DISTRIBUTION_POINT: Oid<'static> = oid!(2.5.29.28);
|
||||
/// 2.5.29.29
|
||||
pub const OID_X509_EXT_ISSUER: Oid<'static> = oid!(2.5.29.29);
|
||||
/// 2.5.29.30
|
||||
pub const OID_X509_EXT_NAME_CONSTRAINTS: Oid<'static> = oid!(2.5.29.30);
|
||||
/// 2.5.29.31
|
||||
pub const OID_X509_EXT_CRL_DISTRIBUTION_POINTS: Oid<'static> = oid!(2.5.29.31);
|
||||
/// 2.5.29.32
|
||||
pub const OID_X509_EXT_CERTIFICATE_POLICIES: Oid<'static> = oid!(2.5.29.32);
|
||||
/// 2.5.29.33
|
||||
pub const OID_X509_EXT_POLICY_MAPPINGS: Oid<'static> = oid!(2.5.29.33);
|
||||
/// 2.5.29.35
|
||||
pub const OID_X509_EXT_AUTHORITY_KEY_IDENTIFIER: Oid<'static> = oid!(2.5.29.35);
|
||||
/// 2.5.29.36
|
||||
pub const OID_X509_EXT_POLICY_CONSTRAINTS: Oid<'static> = oid!(2.5.29.36);
|
||||
/// 2.5.29.37
|
||||
pub const OID_X509_EXT_EXTENDED_KEY_USAGE: Oid<'static> = oid!(2.5.29.37);
|
||||
/// 2.5.29.46
|
||||
pub const OID_X509_EXT_FRESHEST_CRL: Oid<'static> = oid!(2.5.29.46);
|
||||
/// 2.5.29.54
|
||||
pub const OID_X509_EXT_INHIBITANT_ANY_POLICY: Oid<'static> = oid!(2.5.29.54);
|
||||
/// 2.16.840.1.113730.1.1
|
||||
pub const OID_X509_EXT_CERT_TYPE: Oid<'static> = oid!(2.16.840.1.113730.1.1);
|
||||
/// 1.2.840.10045.2.1
|
||||
pub const OID_KEY_TYPE_EC_PUBLIC_KEY: Oid<'static> = oid!(1.2.840.10045.2.1);
|
||||
/// 1.2.840.10045.4.3.1
|
||||
pub const OID_SIG_ECDSA_WITH_SHA224: Oid<'static> = oid!(1.2.840.10045.4.3.1);
|
||||
/// 1.2.840.10045.4.3.2
|
||||
pub const OID_SIG_ECDSA_WITH_SHA256: Oid<'static> = oid!(1.2.840.10045.4.3.2);
|
||||
/// 1.2.840.10045.4.3.3
|
||||
pub const OID_SIG_ECDSA_WITH_SHA384: Oid<'static> = oid!(1.2.840.10045.4.3.3);
|
||||
/// 1.2.840.10045.4.3.4
|
||||
pub const OID_SIG_ECDSA_WITH_SHA512: Oid<'static> = oid!(1.2.840.10045.4.3.4);
|
||||
/// 1.2.840.10045.3.1.7
|
||||
pub const OID_EC_P256: Oid<'static> = oid!(1.2.840.10045.3.1.7);
|
||||
|
||||
impl<'a> OidRegistry<'a> {
|
||||
#[cfg(feature = "kdf")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "kdf")))]
|
||||
#[doc = "Load all known OIDs for feature `kdf` in the registry."]
|
||||
pub fn with_kdf(mut self) -> Self {
|
||||
self.insert(oid!(1.3.133.16.840.63.0.2), OidEntry::new("dhSinglePass-stdDH-sha1kdf-scheme", "Single pass Secure Hash Algorithm 1 (SHA1) key derivation"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "ms_spc")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "ms_spc")))]
|
||||
#[doc = "Load all known OIDs for feature `ms_spc` in the registry."]
|
||||
pub fn with_ms_spc(mut self) -> Self {
|
||||
self.insert(oid!(1.3.6.1.4.1.311.2.1.4), OidEntry::new("spcIndirectData", "The SPC_INDIRECT_DATA_CONTENT structure is used in Authenticode signatures to store the digest and other attributes of the signed file"));
|
||||
self.insert(oid!(1.3.6.1.4.1.311.2.1.11), OidEntry::new("spcStatementType", "spcStatementType"));
|
||||
self.insert(oid!(1.3.6.1.4.1.311.2.1.12), OidEntry::new("spcSpOpusInfo", "SpcSpOpusInfo"));
|
||||
self.insert(oid!(1.3.6.1.4.1.311.2.1.15), OidEntry::new("spcPEImageData", "spcPEImageData"));
|
||||
self.insert(oid!(1.3.6.1.4.1.311.2.1.21), OidEntry::new("msCodeInd", "MsCodeInd (SPC_INDIVIDUAL_SP_KEY_PURPOSE_OBJID) is a ExtendedKeyUsage for Certificate Extensions which indicates Microsoft Individual Code Signing (authenticode)"));
|
||||
self.insert(oid!(1.3.6.1.4.1.311.10.1), OidEntry::new("szOID_CTL", "MS_CTL"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "nist_algs")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "nist_algs")))]
|
||||
#[doc = "Load all known OIDs for feature `nist_algs` in the registry."]
|
||||
pub fn with_nist_algs(mut self) -> Self {
|
||||
self.insert(oid!(1.3.132.0.34), OidEntry::new("secp384r1", "P-384 elliptic curve parameter"));
|
||||
self.insert(oid!(1.3.132.0.35), OidEntry::new("secp521r1", "P-521 elliptic curve parameter"));
|
||||
self.insert(oid!(1.3.14.3.2.26), OidEntry::new("id-SHA1", "SHA-1 hash algorithm"));
|
||||
self.insert(oid!(2.16.840.1.101.3.4.1.42), OidEntry::new("aes-256-cbc", "256-bit Advanced Encryption Standard (AES) algorithm with Cipher-Block Chaining (CBC) mode of operation"));
|
||||
self.insert(oid!(2.16.840.1.101.3.4.2.1), OidEntry::new("sha256", "Secure Hash Algorithm that uses a 256 bit key (SHA256)"));
|
||||
self.insert(oid!(2.16.840.1.101.3.4.2.2), OidEntry::new("sha384", "Secure Hash Algorithm that uses a 384 bit key (SHA384)"));
|
||||
self.insert(oid!(2.16.840.1.101.3.4.2.3), OidEntry::new("sha512", "Secure Hash Algorithm that uses a 512 bit key (SHA512)"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "pkcs1")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "pkcs1")))]
|
||||
#[doc = "Load all known OIDs for feature `pkcs1` in the registry."]
|
||||
pub fn with_pkcs1(mut self) -> Self {
|
||||
self.insert(oid!(1.2.840.113549.1.1.1), OidEntry::new("rsaEncryption", "RSAES-PKCS1-v1_5 encryption scheme"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.2), OidEntry::new("md2WithRSAEncryption", "MD2 with RSA encryption"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.3), OidEntry::new("md4WithRSAEncryption", "MD4 with RSA encryption"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.4), OidEntry::new("md5WithRSAEncryption", "MD5 with RSA encryption"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.5), OidEntry::new("sha1WithRSAEncryption", "SHA1 with RSA encryption"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.10), OidEntry::new("rsassa-pss", "RSA Signature Scheme with Probabilistic Signature Scheme (RSASSA-PSS)"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.11), OidEntry::new("sha256WithRSAEncryption", "SHA256 with RSA encryption"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.12), OidEntry::new("sha384WithRSAEncryption", "SHA384 with RSA encryption"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.13), OidEntry::new("sha512WithRSAEncryption", "SHA512 with RSA encryption"));
|
||||
self.insert(oid!(1.2.840.113549.1.1.14), OidEntry::new("sha224WithRSAEncryption", "SHA224 with RSA encryption"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "pkcs12")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "pkcs12")))]
|
||||
#[doc = "Load all known OIDs for feature `pkcs12` in the registry."]
|
||||
pub fn with_pkcs12(mut self) -> Self {
|
||||
self.insert(oid!(1.2.840.113549.1.12), OidEntry::new("pkcs-12", "Public-Key Cryptography Standard (PKCS) #12"));
|
||||
self.insert(oid!(1.2.840.113549.1.12.1), OidEntry::new("pkcs-12PbeIds", "PKCS #12 Password Based Encryption IDs"));
|
||||
self.insert(oid!(1.2.840.113549.1.12.1.1), OidEntry::new("pbeWithSHAAnd128BitRC4", "PKCS #12 Password Based Encryption With SHA-1 and 128-bit RC4"));
|
||||
self.insert(oid!(1.2.840.113549.1.12.1.2), OidEntry::new("pbeWithSHAAnd40BitRC4", "PKCS #12 Password Based Encryption With SHA-1 and 40-bit RC4"));
|
||||
self.insert(oid!(1.2.840.113549.1.12.1.3), OidEntry::new("pbeWithSHAAnd3-KeyTripleDES-CBC", "PKCS #12 Password Based Encryption With SHA-1 and 3-key Triple DES in CBC mode"));
|
||||
self.insert(oid!(1.2.840.113549.1.12.1.4), OidEntry::new("pbeWithSHAAnd2-KeyTripleDES-CBC", "PKCS #12 Password Based Encryption With SHA-1 and 2-key Triple DES in CBC mode"));
|
||||
self.insert(oid!(1.2.840.113549.1.12.1.5), OidEntry::new("pbeWithSHAAnd128BitRC2-CBC", "PKCS #12 Password Based Encryption With SHA-1 and 128-bit RC2-CBC"));
|
||||
self.insert(oid!(1.2.840.113549.1.12.1.6), OidEntry::new("pbeWithSHAAnd40BitRC2-CBC", "PKCS #12 Password Based Encryption With SHA-1 and 40-bit RC2-CBC"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "pkcs7")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "pkcs7")))]
|
||||
#[doc = "Load all known OIDs for feature `pkcs7` in the registry."]
|
||||
pub fn with_pkcs7(mut self) -> Self {
|
||||
self.insert(oid!(1.2.840.113549.1.7.1), OidEntry::new("pkcs7-data", "pkcs7-data"));
|
||||
self.insert(oid!(1.2.840.113549.1.7.2), OidEntry::new("pkcs7-signedData", "PKCS#7 Signed Data"));
|
||||
self.insert(oid!(1.2.840.113549.1.7.3), OidEntry::new("pkcs7-envelopedData", "PKCS#7 Enveloped Data"));
|
||||
self.insert(oid!(1.2.840.113549.1.7.4), OidEntry::new("pkcs7-signedAndEnvelopedData", "PKCS#7 Signed and Enveloped Data"));
|
||||
self.insert(oid!(1.2.840.113549.1.7.5), OidEntry::new("pkcs7-digestedData", "PKCS#7 Digested Data"));
|
||||
self.insert(oid!(1.2.840.113549.1.7.6), OidEntry::new("pkcs7-encryptedData", "PKCS#7 Encrypted Data"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "pkcs9")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "pkcs9")))]
|
||||
#[doc = "Load all known OIDs for feature `pkcs9` in the registry."]
|
||||
pub fn with_pkcs9(mut self) -> Self {
|
||||
self.insert(oid!(1.2.840.113549.1.9.1), OidEntry::new("emailAddress", "Email Address attribute for use in signatures"));
|
||||
self.insert(oid!(1.2.840.113549.1.9.2), OidEntry::new("unstructuredName", "PKCS#9 unstructuredName"));
|
||||
self.insert(oid!(1.2.840.113549.1.9.3), OidEntry::new("contentType", "id-contentType"));
|
||||
self.insert(oid!(1.2.840.113549.1.9.4), OidEntry::new("id-messageDigest", "id-messageDigest"));
|
||||
self.insert(oid!(1.2.840.113549.1.9.5), OidEntry::new("signing-time", "id-signingTime"));
|
||||
self.insert(oid!(1.2.840.113549.1.9.14), OidEntry::new("extensionRequest", "Extension list for Certification Requests"));
|
||||
self.insert(oid!(1.2.840.113549.1.9.15), OidEntry::new("smimeCapabilities", "aa-smimeCapabilities"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "x500")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "x500")))]
|
||||
#[doc = "Load all known OIDs for feature `x500` in the registry."]
|
||||
pub fn with_x500(mut self) -> Self {
|
||||
self.insert(oid!(2.5), OidEntry::new("x500", "X.500"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "x509")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "x509")))]
|
||||
#[doc = "Load all known OIDs for feature `x509` in the registry."]
|
||||
pub fn with_x509(mut self) -> Self {
|
||||
self.insert(oid!(0.9.2342.19200300.100.1.25), OidEntry::new("domainComponent", "Domain component"));
|
||||
self.insert(oid!(1.3.101.112), OidEntry::new("ed25519", "Edwards-curve Digital Signature Algorithm (EdDSA) Ed25519"));
|
||||
self.insert(oid!(1.3.101.113), OidEntry::new("ed448", "Edwards-curve Digital Signature Algorithm (EdDSA) Ed448"));
|
||||
self.insert(oid!(1.3.6.1.4.1.11129.2.4.2), OidEntry::new("ctSCTList", "Certificate Transparency Signed Certificate Timestamp List"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.1.1), OidEntry::new("authorityInfoAccess", "Certificate Authority Information Access"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.1), OidEntry::new("id-ad-ocsp", "PKIX Access Descriptor OCSP"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.2), OidEntry::new("id-ad-caIssuers", "PKIX Access Descriptor CA Issuers"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.3), OidEntry::new("id-ad-timestamping", "PKIX Access Descriptor Timestamping"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.4), OidEntry::new("id-ad-dvcs", "PKIX Access Descriptor DVCS"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.5), OidEntry::new("id-ad-caRepository", "PKIX Access Descriptor CA Repository"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.6), OidEntry::new("id-ad-http-certs", "PKIX Access Descriptor HTTP Certificates"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.7), OidEntry::new("id-ad-http-crls", "PKIX Access Descriptor HTTP Certificate Revocation Lists"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.10), OidEntry::new("id-ad-rpki-manifest", "PKIX Access Descriptor RPKI Manifest"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.11), OidEntry::new("id-ad-signed-object", "PKIX Access Descriptor Signed Object"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.12), OidEntry::new("id-ad-cmc", "PKIX Access Descriptor CMC"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.13), OidEntry::new("id-ad-rpki-notify", "PKIX Access Descriptor RPKI Notify"));
|
||||
self.insert(oid!(1.3.6.1.5.5.7.48.14), OidEntry::new("id-ad-stirTNList", "PKIX Access Descriptor STIRTNLIST"));
|
||||
self.insert(oid!(2.5.4), OidEntry::new("x509", "X.509"));
|
||||
self.insert(oid!(2.5.4.0), OidEntry::new("objectClass", "Object classes"));
|
||||
self.insert(oid!(2.5.4.1), OidEntry::new("aliasedEntryName", "Aliased entry/object name"));
|
||||
self.insert(oid!(2.5.4.2), OidEntry::new("knowledgeInformation", "'knowledgeInformation' attribute type"));
|
||||
self.insert(oid!(2.5.4.3), OidEntry::new("commonName", "Common Name"));
|
||||
self.insert(oid!(2.5.4.4), OidEntry::new("surname", "Surname"));
|
||||
self.insert(oid!(2.5.4.5), OidEntry::new("serialNumber", "Serial Number"));
|
||||
self.insert(oid!(2.5.4.6), OidEntry::new("countryName", "Country Name"));
|
||||
self.insert(oid!(2.5.4.7), OidEntry::new("localityName", "Locality Name"));
|
||||
self.insert(oid!(2.5.4.8), OidEntry::new("stateOrProvinceName", "State or Province name"));
|
||||
self.insert(oid!(2.5.4.9), OidEntry::new("streetAddress", "Street Address"));
|
||||
self.insert(oid!(2.5.4.10), OidEntry::new("organizationName", "Organization Name"));
|
||||
self.insert(oid!(2.5.4.11), OidEntry::new("organizationalUnit", "Organizational Unit"));
|
||||
self.insert(oid!(2.5.4.12), OidEntry::new("title", "Title"));
|
||||
self.insert(oid!(2.5.4.13), OidEntry::new("description", "Description"));
|
||||
self.insert(oid!(2.5.4.14), OidEntry::new("searchGuide", "Search Guide"));
|
||||
self.insert(oid!(2.5.4.15), OidEntry::new("businessCategory", "Business Category"));
|
||||
self.insert(oid!(2.5.4.16), OidEntry::new("postalAddress", "Postal Address"));
|
||||
self.insert(oid!(2.5.4.17), OidEntry::new("postalCode", "Postal Code"));
|
||||
self.insert(oid!(2.5.4.41), OidEntry::new("name", "Name"));
|
||||
self.insert(oid!(2.5.4.42), OidEntry::new("givenName", "Given Name"));
|
||||
self.insert(oid!(2.5.4.45), OidEntry::new("uniqueIdentifier", "Bit String Unique Identifier"));
|
||||
self.insert(oid!(2.5.29.14), OidEntry::new("subjectKeyIdentifier", "X509v3 Subject Key Identifier"));
|
||||
self.insert(oid!(2.5.29.15), OidEntry::new("keyUsage", "X509v3 Key Usage"));
|
||||
self.insert(oid!(2.5.29.16), OidEntry::new("privateKeyUsagePeriod", "X509v3 Private Key Usage Period"));
|
||||
self.insert(oid!(2.5.29.17), OidEntry::new("subjectAltName", "X509v3 Subject Alternative Name"));
|
||||
self.insert(oid!(2.5.29.18), OidEntry::new("issuerAltName", "X509v3 Issuer Alternative Name"));
|
||||
self.insert(oid!(2.5.29.19), OidEntry::new("basicConstraints", "X509v3 Basic Constraints"));
|
||||
self.insert(oid!(2.5.29.20), OidEntry::new("crlNumber", "X509v3 CRL Number"));
|
||||
self.insert(oid!(2.5.29.21), OidEntry::new("reasonCode", "X509v3 Reason Code"));
|
||||
self.insert(oid!(2.5.29.23), OidEntry::new("holdInstructionCode", "X509v3 Hold Instruction Code"));
|
||||
self.insert(oid!(2.5.29.24), OidEntry::new("invalidityDate", "X509v3 Invalidity Date"));
|
||||
self.insert(oid!(2.5.29.27), OidEntry::new("deltaCRLIndicator", "X509v3 Delta CRL Indicator"));
|
||||
self.insert(oid!(2.5.29.28), OidEntry::new("issuerDistributionPoint", "X509v3 Issuer Distribution Point"));
|
||||
self.insert(oid!(2.5.29.29), OidEntry::new("issuer", "X509v3 Issuer"));
|
||||
self.insert(oid!(2.5.29.30), OidEntry::new("nameConstraints", "X509v3 Name Constraints"));
|
||||
self.insert(oid!(2.5.29.31), OidEntry::new("crlDistributionPoints", "X509v3 CRL Distribution Points"));
|
||||
self.insert(oid!(2.5.29.32), OidEntry::new("certificatePolicies", "X509v3 Certificate Policies"));
|
||||
self.insert(oid!(2.5.29.33), OidEntry::new("policyMappings", "X509v3 Policy Mappings"));
|
||||
self.insert(oid!(2.5.29.35), OidEntry::new("authorityKeyIdentifier", "X509v3 Authority Key Identifier"));
|
||||
self.insert(oid!(2.5.29.36), OidEntry::new("policyConstraints", "X509v3 Policy Constraints"));
|
||||
self.insert(oid!(2.5.29.37), OidEntry::new("extendedKeyUsage", "X509v3 Extended Key Usage"));
|
||||
self.insert(oid!(2.5.29.46), OidEntry::new("freshestCRL", "X509v3 Freshest CRL"));
|
||||
self.insert(oid!(2.5.29.54), OidEntry::new("inhibitantAnyPolicy", "X509v3 Inhibit Any-policy"));
|
||||
self.insert(oid!(2.16.840.1.113730.1.1), OidEntry::new("nsCertType", "X.509 v3 Certificate Type"));
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "x962")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "x962")))]
|
||||
#[doc = "Load all known OIDs for feature `x962` in the registry."]
|
||||
pub fn with_x962(mut self) -> Self {
|
||||
self.insert(oid!(1.2.840.10045.2.1), OidEntry::new("id-ecPublicKey", "Elliptic curve public key cryptography"));
|
||||
self.insert(oid!(1.2.840.10045.4.3.1), OidEntry::new("ecdsa-with-SHA224", "Elliptic curve Digital Signature Algorithm (DSA) coupled with the Secure Hash Algorithm 224 (SHA224) algorithm"));
|
||||
self.insert(oid!(1.2.840.10045.4.3.2), OidEntry::new("ecdsa-with-SHA256", "Elliptic curve Digital Signature Algorithm (DSA) coupled with the Secure Hash Algorithm 256 (SHA256) algorithm"));
|
||||
self.insert(oid!(1.2.840.10045.4.3.3), OidEntry::new("ecdsa-with-SHA384", "Elliptic curve Digital Signature Algorithm (DSA) coupled with the Secure Hash Algorithm 384 (SHA384) algorithm"));
|
||||
self.insert(oid!(1.2.840.10045.4.3.4), OidEntry::new("ecdsa-with-SHA512", "Elliptic curve Digital Signature Algorithm (DSA) coupled with the Secure Hash Algorithm 512 (SHA512) algorithm"));
|
||||
self.insert(oid!(1.2.840.10045.3.1.7), OidEntry::new("prime256v1", "P-256 elliptic curve parameter"));
|
||||
self
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! count {
|
||||
() => { proc_macro_call_0!() };
|
||||
(!) => { proc_macro_call_1!() };
|
||||
(!!) => { proc_macro_call_2!() };
|
||||
(!!!) => { proc_macro_call_3!() };
|
||||
(!!!!) => { proc_macro_call_4!() };
|
||||
(!!!!!) => { proc_macro_call_5!() };
|
||||
(!!!!!!) => { proc_macro_call_6!() };
|
||||
(!!!!!!!) => { proc_macro_call_7!() };
|
||||
(!!!!!!!!) => { proc_macro_call_8!() };
|
||||
(!!!!!!!!!) => { proc_macro_call_9!() };
|
||||
(!!!!!!!!!!) => { proc_macro_call_10!() };
|
||||
(!!!!!!!!!!!) => { proc_macro_call_11!() };
|
||||
(!!!!!!!!!!!!) => { proc_macro_call_12!() };
|
||||
(!!!!!!!!!!!!!) => { proc_macro_call_13!() };
|
||||
(!!!!!!!!!!!!!!) => { proc_macro_call_14!() };
|
||||
(!!!!!!!!!!!!!!!) => { proc_macro_call_15!() };
|
||||
(!!!!!!!!!!!!!!!!) => { proc_macro_call_16!() };
|
||||
(!!!!!!!!!!!!!!!!!) => { proc_macro_call_17!() };
|
||||
(!!!!!!!!!!!!!!!!!!) => { proc_macro_call_18!() };
|
||||
(!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_19!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_20!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_21!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_22!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_23!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_24!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_25!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_26!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_27!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_28!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_29!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_30!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_31!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_32!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_33!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_34!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_35!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_36!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_37!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_38!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_39!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_40!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_41!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_42!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_43!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_44!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_45!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_46!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_47!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_48!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_49!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_50!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_51!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_52!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_53!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_54!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_55!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_56!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_57!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_58!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_59!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_60!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_61!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_62!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_63!() };
|
||||
(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) => { proc_macro_call_64!() };
|
||||
($(!)+) => {
|
||||
compile_error! {
|
||||
"this macro does not support >64 nested macro invocations"
|
||||
}
|
||||
};
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
/// protobuf crate version
|
||||
pub const VERSION: &'static str = "2.27.1";
|
||||
/// This symbol is used by codegen
|
||||
#[doc(hidden)]
|
||||
pub const VERSION_IDENT: &'static str = "VERSION_2_27_1";
|
||||
/// This symbol can be referenced to assert that proper version of crate is used
|
||||
pub const VERSION_2_27_1: () = ();
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
This file is here to create this output directory when the source is pulled from git.
|
Loading…
Reference in New Issue