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.
4 //
5 // Functions exported by the RLZ DLL.
6
7 #include "rlz/lib/rlz_lib.h"
8
9 #define RLZ_DLL_EXPORT extern "C" __declspec(dllexport)
10
RecordProductEvent(rlz_lib::Product product,rlz_lib::AccessPoint point,rlz_lib::Event event_id)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);
15 }
16
GetProductEventsAsCgi(rlz_lib::Product product,char * unescaped_cgi,size_t unescaped_cgi_size)17 RLZ_DLL_EXPORT bool GetProductEventsAsCgi(rlz_lib::Product product,
18 char* unescaped_cgi,
19 size_t unescaped_cgi_size) {
20 return rlz_lib::GetProductEventsAsCgi(product, unescaped_cgi,
21 unescaped_cgi_size);
22 }
ClearAllProductEvents(rlz_lib::Product product)23 RLZ_DLL_EXPORT bool ClearAllProductEvents(rlz_lib::Product product) {
24 return rlz_lib::ClearAllProductEvents(product);
25 }
26
ClearProductEvent(rlz_lib::Product product,rlz_lib::AccessPoint point,rlz_lib::Event event_id)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);
31 }
32
GetAccessPointRlz(rlz_lib::AccessPoint point,char * rlz,size_t rlz_size)33 RLZ_DLL_EXPORT bool GetAccessPointRlz(rlz_lib::AccessPoint point,
34 char* rlz,
35 size_t rlz_size) {
36 return rlz_lib::GetAccessPointRlz(point, rlz, rlz_size);
37 }
38
SetAccessPointRlz(rlz_lib::AccessPoint point,const char * new_rlz)39 RLZ_DLL_EXPORT bool SetAccessPointRlz(rlz_lib::AccessPoint point,
40 const char* new_rlz) {
41 return rlz_lib::SetAccessPointRlz(point, new_rlz);
42 }
43
CreateMachineState()44 RLZ_DLL_EXPORT bool CreateMachineState() {
45 return rlz_lib::CreateMachineState();
46 }
47
SetMachineDealCode(const char * dcc)48 RLZ_DLL_EXPORT bool SetMachineDealCode(const char* dcc) {
49 return rlz_lib::SetMachineDealCode(dcc);
50 }
51
GetMachineDealCodeAsCgi(char * cgi,size_t cgi_size)52 RLZ_DLL_EXPORT bool GetMachineDealCodeAsCgi(char* cgi, size_t cgi_size) {
53 return rlz_lib::GetMachineDealCodeAsCgi(cgi, cgi_size);
54 }
55
GetMachineDealCode2(char * dcc,size_t dcc_size)56 RLZ_DLL_EXPORT bool GetMachineDealCode2(char* dcc, size_t dcc_size) {
57 return rlz_lib::GetMachineDealCode(dcc, dcc_size);
58 }
59
GetPingParams(rlz_lib::Product product,const rlz_lib::AccessPoint * access_points,char * unescaped_cgi,size_t unescaped_cgi_size)60 RLZ_DLL_EXPORT bool GetPingParams(rlz_lib::Product product,
61 const rlz_lib::AccessPoint* access_points,
62 char* unescaped_cgi,
63 size_t unescaped_cgi_size) {
64 return rlz_lib::GetPingParams(product, access_points, unescaped_cgi,
65 unescaped_cgi_size);
66 }
67
ParsePingResponse(rlz_lib::Product product,const char * response)68 RLZ_DLL_EXPORT bool ParsePingResponse(rlz_lib::Product product,
69 const char* response) {
70 return rlz_lib::ParsePingResponse(product, response);
71 }
72
IsPingResponseValid(const char * response,int * checksum_idx)73 RLZ_DLL_EXPORT bool IsPingResponseValid(const char* response,
74 int* checksum_idx) {
75 return rlz_lib::IsPingResponseValid(response, checksum_idx);
76 }
77
SetMachineDealCodeFromPingResponse(const char * response)78 RLZ_DLL_EXPORT bool SetMachineDealCodeFromPingResponse(const char* response) {
79 return rlz_lib::SetMachineDealCodeFromPingResponse(response);
80 }
81
SendFinancialPing(rlz_lib::Product product,const rlz_lib::AccessPoint * access_points,const char * product_signature,const char * product_brand,const char * product_id,const char * product_lang,bool exclude_machine_id)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);
91 }
92
SendFinancialPingNoDelay(rlz_lib::Product product,const rlz_lib::AccessPoint * access_points,const char * product_signature,const char * product_brand,const char * product_id,const char * product_lang,bool 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);
103 }
104
ClearProductState(rlz_lib::Product product,const rlz_lib::AccessPoint * access_points)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);
108 }
109