blob: 1e597c2b7cc91c2441a756ab7bfe5baf5b5db90e [file] [log] [blame]
Bertrand SIMONNET52e5b992015-08-10 15:18:00 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Sam Leffler10b301d2010-06-17 14:22:43 -070016
Bertrand SIMONNETe6cfd642014-07-09 16:35:23 -070017#ifndef METRICS_C_METRICS_LIBRARY_H_
18#define METRICS_C_METRICS_LIBRARY_H_
Sam Leffler10b301d2010-06-17 14:22:43 -070019
20#if defined(__cplusplus)
21extern "C" {
22#endif
23typedef struct CMetricsLibraryOpaque* CMetricsLibrary;
24
25// C wrapper for MetricsLibrary::MetricsLibrary.
26CMetricsLibrary CMetricsLibraryNew(void);
27
28// C wrapper for MetricsLibrary::~MetricsLibrary.
29void CMetricsLibraryDelete(CMetricsLibrary handle);
30
31// C wrapper for MetricsLibrary::Init.
32void CMetricsLibraryInit(CMetricsLibrary handle);
33
34// C wrapper for MetricsLibrary::SendToUMA.
35int CMetricsLibrarySendToUMA(CMetricsLibrary handle,
Ken Mixter4c5daa42010-08-26 18:35:06 -070036 const char* name, int sample,
37 int min, int max, int nbuckets);
Sam Leffler10b301d2010-06-17 14:22:43 -070038
39// C wrapper for MetricsLibrary::SendEnumToUMA.
40int CMetricsLibrarySendEnumToUMA(CMetricsLibrary handle,
Ken Mixter4c5daa42010-08-26 18:35:06 -070041 const char* name, int sample, int max);
42
Luigi Semenzatoa7ebeb32013-03-19 15:02:42 -070043// C wrapper for MetricsLibrary::SendSparseToUMA.
44int CMetricsLibrarySendSparseToUMA(CMetricsLibrary handle,
45 const char* name, int sample);
46
Ken Mixterbe2e13b2011-01-22 06:15:56 -080047// C wrapper for MetricsLibrary::SendCrashToUMA.
48int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle,
49 const char* crash_kind);
50
Ken Mixter4c5daa42010-08-26 18:35:06 -070051// C wrapper for MetricsLibrary::AreMetricsEnabled.
52int CMetricsLibraryAreMetricsEnabled(CMetricsLibrary handle);
53
Sam Leffler10b301d2010-06-17 14:22:43 -070054#if defined(__cplusplus)
55}
56#endif
Bertrand SIMONNETe6cfd642014-07-09 16:35:23 -070057#endif // METRICS_C_METRICS_LIBRARY_H_