1 // Copyright (c) 2012 The Chromium 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.
5 // Functions exported by the RLZ DLL.
7 #include "rlz/lib/rlz_lib.h"
9 #define RLZ_DLL_EXPORT extern "C" __declspec(dllexport)
11 RLZ_DLL_EXPORT
bool RecordProductEvent(rlz_lib::Product product
,
12 rlz_lib::AccessPoint point
,
13 rlz_lib::Event event_id
) {
14 return rlz_lib::RecordProductEvent(product
, point
, event_id
);
17 RLZ_DLL_EXPORT
bool GetProductEventsAsCgi(rlz_lib::Product product
,
19 size_t unescaped_cgi_size
) {
20 return rlz_lib::GetProductEventsAsCgi(product
, unescaped_cgi
,
23 RLZ_DLL_EXPORT
bool ClearAllProductEvents(rlz_lib::Product product
) {
24 return rlz_lib::ClearAllProductEvents(product
);
27 RLZ_DLL_EXPORT
bool ClearProductEvent(rlz_lib::Product product
,
28 rlz_lib::AccessPoint point
,
29 rlz_lib::Event event_id
) {
30 return rlz_lib::ClearProductEvent(product
, point
, event_id
);
33 RLZ_DLL_EXPORT
bool GetAccessPointRlz(rlz_lib::AccessPoint point
,
36 return rlz_lib::GetAccessPointRlz(point
, rlz
, rlz_size
);
39 RLZ_DLL_EXPORT
bool SetAccessPointRlz(rlz_lib::AccessPoint point
,
40 const char* new_rlz
) {
41 return rlz_lib::SetAccessPointRlz(point
, new_rlz
);
44 RLZ_DLL_EXPORT
bool CreateMachineState() {
45 return rlz_lib::CreateMachineState();
48 RLZ_DLL_EXPORT
bool SetMachineDealCode(const char* dcc
) {
49 return rlz_lib::SetMachineDealCode(dcc
);
52 RLZ_DLL_EXPORT
bool GetMachineDealCodeAsCgi(char* cgi
, size_t cgi_size
) {
53 return rlz_lib::GetMachineDealCodeAsCgi(cgi
, cgi_size
);
56 RLZ_DLL_EXPORT
bool GetMachineDealCode2(char* dcc
, size_t dcc_size
) {
57 return rlz_lib::GetMachineDealCode(dcc
, dcc_size
);
60 RLZ_DLL_EXPORT
bool GetPingParams(rlz_lib::Product product
,
61 const rlz_lib::AccessPoint
* access_points
,
63 size_t unescaped_cgi_size
) {
64 return rlz_lib::GetPingParams(product
, access_points
, unescaped_cgi
,
68 RLZ_DLL_EXPORT
bool ParsePingResponse(rlz_lib::Product product
,
69 const char* response
) {
70 return rlz_lib::ParsePingResponse(product
, response
);
73 RLZ_DLL_EXPORT
bool IsPingResponseValid(const char* response
,
75 return rlz_lib::IsPingResponseValid(response
, checksum_idx
);
78 RLZ_DLL_EXPORT
bool SetMachineDealCodeFromPingResponse(const char* response
) {
79 return rlz_lib::SetMachineDealCodeFromPingResponse(response
);
82 RLZ_DLL_EXPORT
bool SendFinancialPing(rlz_lib::Product product
,
83 const rlz_lib::AccessPoint
* access_points
,
84 const char* product_signature
,
85 const char* product_brand
,
86 const char* product_id
,
87 const char* product_lang
,
88 bool exclude_machine_id
) {
89 return rlz_lib::SendFinancialPing(product
, access_points
, product_signature
,
90 product_brand
, product_id
, product_lang
, exclude_machine_id
);
93 RLZ_DLL_EXPORT
bool SendFinancialPingNoDelay(
94 rlz_lib::Product product
,
95 const rlz_lib::AccessPoint
* access_points
,
96 const char* product_signature
,
97 const char* product_brand
,
98 const char* product_id
,
99 const char* product_lang
,
100 bool exclude_machine_id
) {
101 return rlz_lib::SendFinancialPing(product
, access_points
, product_signature
,
102 product_brand
, product_id
, product_lang
, exclude_machine_id
, true);
105 RLZ_DLL_EXPORT
void ClearProductState(
106 rlz_lib::Product product
, const rlz_lib::AccessPoint
* access_points
) {
107 return rlz_lib::ClearProductState(product
, access_points
);