blob: 4e7e6668384c309e782ac94ba9c92069cafbbe42 [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
Darin Petkoved824852011-01-06 10:51:47 -080047// C wrapper for MetricsLibrary::SendUserActionToUMA.
48int CMetricsLibrarySendUserActionToUMA(CMetricsLibrary handle,
49 const char* action);
50
Ken Mixterbe2e13b2011-01-22 06:15:56 -080051// C wrapper for MetricsLibrary::SendCrashToUMA.
52int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle,
53 const char* crash_kind);
54
Ken Mixter4c5daa42010-08-26 18:35:06 -070055// C wrapper for MetricsLibrary::AreMetricsEnabled.
56int CMetricsLibraryAreMetricsEnabled(CMetricsLibrary handle);
57
Sam Leffler10b301d2010-06-17 14:22:43 -070058#if defined(__cplusplus)
59}
60#endif
Bertrand SIMONNETe6cfd642014-07-09 16:35:23 -070061#endif // METRICS_C_METRICS_LIBRARY_H_