• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 // automatically generated by rust-bindgen
18 
19 #[derive(Clone, Copy)]
20 #[repr(isize)]
21 pub enum LogPriority {
22     UNKNOWN = 0,
23     DEFAULT = 1,
24     VERBOSE = 2,
25     DEBUG = 3,
26     INFO = 4,
27     WARN = 5,
28     ERROR = 6,
29     FATAL = 7,
30     SILENT = 8,
31 }
32 
33 #[allow(non_camel_case_types)]
34 #[derive(Clone, Copy)]
35 #[non_exhaustive]
36 #[repr(i32)]
37 pub enum log_id_t {
38     MAIN = 0,
39     RADIO = 1,
40     EVENTS = 2,
41     SYSTEM = 3,
42     CRASH = 4,
43     STATS = 5,
44     SECURITY = 6,
45     KERNEL = 7,
46     MAX = 8,
47     DEFAULT = 0x7FFFFFFF,
48 }
49 
50 #[allow(non_camel_case_types)]
51 #[repr(C)]
52 #[derive(Debug, Copy, Clone)]
53 pub struct __android_log_message {
54     pub struct_size: usize,
55     pub buffer_id: i32,
56     pub priority: i32,
57     pub tag: *const c_char,
58     pub file: *const c_char,
59     pub line: u32,
60     pub message: *const c_char,
61 }
62 
63 #[link(name = "log")]
64 extern "C" {
__android_log_write(prio: c_int, tag: *const c_char, text: *const c_char) -> c_int65     pub fn __android_log_write(prio: c_int,
66                                tag: *const c_char,
67                                text: *const c_char)
68                                -> c_int;
__android_log_print(prio: c_int, tag: *const c_char, fmt: *const c_char, ...) -> c_int69     pub fn __android_log_print(prio: c_int,
70                                tag: *const c_char,
71                                fmt: *const c_char,
72                                ...)
73                                -> c_int;
__android_log_vprint(prio: c_int, tag: *const c_char, fmt: *const c_char, ap: *mut c_va_list) -> c_int74     pub fn __android_log_vprint(prio: c_int,
75                                 tag: *const c_char,
76                                 fmt: *const c_char,
77                                 ap: *mut c_va_list)
78                                 -> c_int;
__android_log_assert(cond: *const c_char, tag: *const c_char, fmt: *const c_char, ...)79     pub fn __android_log_assert(cond: *const c_char,
80                                 tag: *const c_char,
81                                 fmt: *const c_char,
82                                 ...);
__android_log_is_loggable(prio: c_int, tag: *const c_char, default_prio: c_int) -> c_int83     pub fn __android_log_is_loggable(prio: c_int,
84                                      tag: *const c_char,
85                                      default_prio: c_int)
86                                      -> c_int;
__android_log_write_log_message(log_message: *mut __android_log_message)87     pub fn __android_log_write_log_message(log_message: *mut __android_log_message);
88 }
89