summaryrefslogtreecommitdiffstats
path: root/third_party/rust/android_log-sys/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/android_log-sys/src
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/android_log-sys/src')
-rw-r--r--third_party/rust/android_log-sys/src/lib.rs88
1 files changed, 88 insertions, 0 deletions
diff --git a/third_party/rust/android_log-sys/src/lib.rs b/third_party/rust/android_log-sys/src/lib.rs
new file mode 100644
index 0000000000..eba5b19172
--- /dev/null
+++ b/third_party/rust/android_log-sys/src/lib.rs
@@ -0,0 +1,88 @@
+// Copyright 2016 The android_log_sys Developers
+//
+// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
+// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
+// http://opensource.org/licenses/MIT>, at your option. This file may not be
+// copied, modified, or distributed except according to those terms.
+
+use std::os::raw;
+
+#[allow(non_camel_case_types)]
+pub type c_va_list = raw::c_void;
+#[allow(non_camel_case_types)]
+pub type c_int = raw::c_int;
+#[allow(non_camel_case_types)]
+pub type c_char = raw::c_char;
+
+// automatically generated by rust-bindgen
+
+#[derive(Clone, Copy)]
+#[repr(isize)]
+pub enum LogPriority {
+ UNKNOWN = 0,
+ DEFAULT = 1,
+ VERBOSE = 2,
+ DEBUG = 3,
+ INFO = 4,
+ WARN = 5,
+ ERROR = 6,
+ FATAL = 7,
+ SILENT = 8,
+}
+
+#[allow(non_camel_case_types)]
+#[derive(Clone, Copy)]
+#[non_exhaustive]
+#[repr(i32)]
+pub enum log_id_t {
+ MAIN = 0,
+ RADIO = 1,
+ EVENTS = 2,
+ SYSTEM = 3,
+ CRASH = 4,
+ STATS = 5,
+ SECURITY = 6,
+ KERNEL = 7,
+ MAX = 8,
+ DEFAULT = 0x7FFFFFFF,
+}
+
+#[allow(non_camel_case_types)]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __android_log_message {
+ pub struct_size: usize,
+ pub buffer_id: i32,
+ pub priority: i32,
+ pub tag: *const c_char,
+ pub file: *const c_char,
+ pub line: u32,
+ pub message: *const c_char,
+}
+
+#[link(name = "log")]
+extern "C" {
+ pub fn __android_log_write(prio: c_int,
+ tag: *const c_char,
+ text: *const c_char)
+ -> c_int;
+ pub fn __android_log_print(prio: c_int,
+ tag: *const c_char,
+ fmt: *const c_char,
+ ...)
+ -> c_int;
+ pub fn __android_log_vprint(prio: c_int,
+ tag: *const c_char,
+ fmt: *const c_char,
+ ap: *mut c_va_list)
+ -> c_int;
+ pub fn __android_log_assert(cond: *const c_char,
+ tag: *const c_char,
+ fmt: *const c_char,
+ ...);
+ pub fn __android_log_is_loggable(prio: c_int,
+ tag: *const c_char,
+ default_prio: c_int)
+ -> c_int;
+ pub fn __android_log_write_log_message(log_message: *mut __android_log_message);
+}