blob: 5c7003d9eda0634dd3abb64cb6cee718e42c7179 [file] [log] [blame]
Sam Leffler10b301d2010-06-17 14:22:43 -07001// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef C_METRICS_LIBRARY_H_
6#define C_METRICS_LIBRARY_H_
7
8#if defined(__cplusplus)
9extern "C" {
10#endif
11typedef struct CMetricsLibraryOpaque* CMetricsLibrary;
12
13// C wrapper for MetricsLibrary::MetricsLibrary.
14CMetricsLibrary CMetricsLibraryNew(void);
15
16// C wrapper for MetricsLibrary::~MetricsLibrary.
17void CMetricsLibraryDelete(CMetricsLibrary handle);
18
19// C wrapper for MetricsLibrary::Init.
20void CMetricsLibraryInit(CMetricsLibrary handle);
21
22// C wrapper for MetricsLibrary::SendToUMA.
23int CMetricsLibrarySendToUMA(CMetricsLibrary handle,
Ken Mixter4c5daa42010-08-26 18:35:06 -070024 const char* name, int sample,
25 int min, int max, int nbuckets);
Sam Leffler10b301d2010-06-17 14:22:43 -070026
27// C wrapper for MetricsLibrary::SendEnumToUMA.
28int CMetricsLibrarySendEnumToUMA(CMetricsLibrary handle,
Ken Mixter4c5daa42010-08-26 18:35:06 -070029 const char* name, int sample, int max);
30
Darin Petkoved824852011-01-06 10:51:47 -080031// C wrapper for MetricsLibrary::SendUserActionToUMA.
32int CMetricsLibrarySendUserActionToUMA(CMetricsLibrary handle,
33 const char* action);
34
Ken Mixterbe2e13b2011-01-22 06:15:56 -080035// C wrapper for MetricsLibrary::SendCrashToUMA.
36int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle,
37 const char* crash_kind);
38
Ken Mixter4c5daa42010-08-26 18:35:06 -070039// C wrapper for MetricsLibrary::AreMetricsEnabled.
40int CMetricsLibraryAreMetricsEnabled(CMetricsLibrary handle);
41
Sam Leffler10b301d2010-06-17 14:22:43 -070042#if defined(__cplusplus)
43}
44#endif
Ken Mixter4c5daa42010-08-26 18:35:06 -070045#endif // C_METRICS_LIBRARY_H_