1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#![cfg(feature = "with_gecko")]
use crate::metrics::__glean_metric_maps as metric_maps;
use nsstring::nsACString;
use std::sync::atomic::Ordering;
#[no_mangle]
pub extern "C" fn fog_labeled_enum_to_str(id: u32, label: u16, value: &mut nsACString) {
let val = metric_maps::labeled_enum_to_str(id, label);
value.assign(&val);
}
#[no_mangle]
pub extern "C" fn fog_labeled_boolean_get(id: u32, label: &nsACString) -> u32 {
labeled_submetric_get!(
id,
label,
LABELED_BOOLEAN_MAP,
labeled_boolean_get,
BOOLEAN_MAP,
LabeledBooleanMetric
)
}
#[no_mangle]
pub extern "C" fn fog_labeled_boolean_enum_get(id: u32, label: u16) -> u32 {
labeled_submetric_enum_get!(
id,
label,
labeled_boolean_enum_get,
BOOLEAN_MAP,
LabeledBooleanMetric
)
}
#[no_mangle]
pub extern "C" fn fog_labeled_counter_get(id: u32, label: &nsACString) -> u32 {
labeled_submetric_get!(
id,
label,
LABELED_COUNTER_MAP,
labeled_counter_get,
COUNTER_MAP,
LabeledCounterMetric
)
}
#[no_mangle]
pub extern "C" fn fog_labeled_counter_enum_get(id: u32, label: u16) -> u32 {
labeled_submetric_enum_get!(
id,
label,
labeled_counter_enum_get,
COUNTER_MAP,
LabeledCounterMetric
)
}
#[no_mangle]
pub extern "C" fn fog_labeled_string_get(id: u32, label: &nsACString) -> u32 {
labeled_submetric_get!(
id,
label,
LABELED_STRING_MAP,
labeled_string_get,
STRING_MAP,
LabeledStringMetric
)
}
#[no_mangle]
pub extern "C" fn fog_labeled_string_enum_get(id: u32, label: u16) -> u32 {
labeled_submetric_enum_get!(
id,
label,
labeled_string_enum_get,
STRING_MAP,
LabeledStringMetric
)
}
|