1 // Copyright 2016 The android_log_sys Developers 2 // 3 // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or 4 // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or 5 // http://opensource.org/licenses/MIT>, at your option. This file may not be 6 // copied, modified, or distributed except according to those terms. 7 8 use std::os::raw; 9 10 #[allow(non_camel_case_types)] 11 pub type c_va_list = raw::c_void; 12 #[allow(non_camel_case_types)] 13 pub type c_int = raw::c_int; 14 #[allow(non_camel_case_types)] 15 pub type c_char = raw::c_char; 16 #[allow(non_camel_case_types)] 17 pub type c_size_t = raw::c_ulong; 18 19 // automatically generated by rust-bindgen 20 21 #[derive(Clone, Copy)] 22 #[repr(isize)] 23 pub enum LogPriority { 24 UNKNOWN = 0, 25 DEFAULT = 1, 26 VERBOSE = 2, 27 DEBUG = 3, 28 INFO = 4, 29 WARN = 5, 30 ERROR = 6, 31 FATAL = 7, 32 SILENT = 8, 33 } 34 35 #[allow(non_camel_case_types)] 36 #[derive(Clone, Copy)] 37 #[non_exhaustive] 38 #[repr(i32)] 39 pub enum log_id_t { 40 MAIN = 0, 41 RADIO = 1, 42 EVENTS = 2, 43 SYSTEM = 3, 44 CRASH = 4, 45 STATS = 5, 46 SECURITY = 6, 47 KERNEL = 7, 48 MAX = 8, 49 DEFAULT = 0x7FFFFFFF, 50 } 51 52 #[allow(non_camel_case_types)] 53 #[repr(C)] 54 #[derive(Debug, Copy, Clone)] 55 pub struct __android_log_message { 56 pub struct_size: usize, 57 pub buffer_id: i32, 58 pub priority: i32, 59 pub tag: *const c_char, 60 pub file: *const c_char, 61 pub line: u32, 62 pub message: *const c_char, 63 } 64 65 #[link(name = "log")] 66 extern "C" { __android_log_write(prio: c_int, tag: *const c_char, text: *const c_char) -> c_int67 pub fn __android_log_write(prio: c_int, 68 tag: *const c_char, 69 text: *const c_char) 70 -> c_int; __android_log_buf_write(bufID: c_int, prio: c_int, tag: *const c_char, text: *const c_char) -> c_int71 pub fn __android_log_buf_write(bufID: c_int, 72 prio: c_int, 73 tag: *const c_char, 74 text: *const c_char) 75 -> c_int; __android_log_print(prio: c_int, tag: *const c_char, fmt: *const c_char, ...) -> c_int76 pub fn __android_log_print(prio: c_int, 77 tag: *const c_char, 78 fmt: *const c_char, 79 ...) 80 -> c_int; __android_log_vprint(prio: c_int, tag: *const c_char, fmt: *const c_char, ap: *mut c_va_list) -> c_int81 pub fn __android_log_vprint(prio: c_int, 82 tag: *const c_char, 83 fmt: *const c_char, 84 ap: *mut c_va_list) 85 -> c_int; __android_log_assert(cond: *const c_char, tag: *const c_char, fmt: *const c_char, ...)86 pub fn __android_log_assert(cond: *const c_char, 87 tag: *const c_char, 88 fmt: *const c_char, 89 ...); __android_log_is_loggable(prio: c_int, tag: *const c_char, default_prio: c_int) -> c_int90 pub fn __android_log_is_loggable(prio: c_int, 91 tag: *const c_char, 92 default_prio: c_int) 93 -> c_int; __android_log_is_loggable_len(prio: c_int, tag: *const c_char, size: c_size_t, default_prio: c_int) -> c_int94 pub fn __android_log_is_loggable_len(prio: c_int, 95 tag: *const c_char, 96 size: c_size_t, 97 default_prio: c_int) 98 -> c_int; __android_log_write_log_message(log_message: *mut __android_log_message)99 pub fn __android_log_write_log_message(log_message: *mut __android_log_message); 100 } 101