Bertrand SIMONNET | 52e5b99 | 2015-08-10 15:18:00 -0700 | [diff] [blame] | 1 | /* |
| 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 Leffler | 10b301d | 2010-06-17 14:22:43 -0700 | [diff] [blame] | 16 | |
Bertrand SIMONNET | e6cfd64 | 2014-07-09 16:35:23 -0700 | [diff] [blame] | 17 | #ifndef METRICS_C_METRICS_LIBRARY_H_ |
| 18 | #define METRICS_C_METRICS_LIBRARY_H_ |
Sam Leffler | 10b301d | 2010-06-17 14:22:43 -0700 | [diff] [blame] | 19 | |
| 20 | #if defined(__cplusplus) |
| 21 | extern "C" { |
| 22 | #endif |
| 23 | typedef struct CMetricsLibraryOpaque* CMetricsLibrary; |
| 24 | |
| 25 | // C wrapper for MetricsLibrary::MetricsLibrary. |
| 26 | CMetricsLibrary CMetricsLibraryNew(void); |
| 27 | |
| 28 | // C wrapper for MetricsLibrary::~MetricsLibrary. |
| 29 | void CMetricsLibraryDelete(CMetricsLibrary handle); |
| 30 | |
| 31 | // C wrapper for MetricsLibrary::Init. |
| 32 | void CMetricsLibraryInit(CMetricsLibrary handle); |
| 33 | |
| 34 | // C wrapper for MetricsLibrary::SendToUMA. |
| 35 | int CMetricsLibrarySendToUMA(CMetricsLibrary handle, |
Ken Mixter | 4c5daa4 | 2010-08-26 18:35:06 -0700 | [diff] [blame] | 36 | const char* name, int sample, |
| 37 | int min, int max, int nbuckets); |
Sam Leffler | 10b301d | 2010-06-17 14:22:43 -0700 | [diff] [blame] | 38 | |
| 39 | // C wrapper for MetricsLibrary::SendEnumToUMA. |
| 40 | int CMetricsLibrarySendEnumToUMA(CMetricsLibrary handle, |
Ken Mixter | 4c5daa4 | 2010-08-26 18:35:06 -0700 | [diff] [blame] | 41 | const char* name, int sample, int max); |
| 42 | |
Luigi Semenzato | a7ebeb3 | 2013-03-19 15:02:42 -0700 | [diff] [blame] | 43 | // C wrapper for MetricsLibrary::SendSparseToUMA. |
| 44 | int CMetricsLibrarySendSparseToUMA(CMetricsLibrary handle, |
| 45 | const char* name, int sample); |
| 46 | |
Ken Mixter | be2e13b | 2011-01-22 06:15:56 -0800 | [diff] [blame] | 47 | // C wrapper for MetricsLibrary::SendCrashToUMA. |
| 48 | int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle, |
| 49 | const char* crash_kind); |
| 50 | |
Ken Mixter | 4c5daa4 | 2010-08-26 18:35:06 -0700 | [diff] [blame] | 51 | // C wrapper for MetricsLibrary::AreMetricsEnabled. |
| 52 | int CMetricsLibraryAreMetricsEnabled(CMetricsLibrary handle); |
| 53 | |
Sam Leffler | 10b301d | 2010-06-17 14:22:43 -0700 | [diff] [blame] | 54 | #if defined(__cplusplus) |
| 55 | } |
| 56 | #endif |
Bertrand SIMONNET | e6cfd64 | 2014-07-09 16:35:23 -0700 | [diff] [blame] | 57 | #endif // METRICS_C_METRICS_LIBRARY_H_ |