7#ifndef MONGO_CRYPT_SUPPORT_H
8#define MONGO_CRYPT_SUPPORT_H
13#pragma push_macro("MONGO_API_CALL")
16#pragma push_macro("MONGO_API_IMPORT")
17#undef MONGO_API_IMPORT
19#pragma push_macro("MONGO_API_EXPORT")
20#undef MONGO_API_EXPORT
22#pragma push_macro("MONGO_CRYPT_SUPPORT_API")
23#undef MONGO_CRYPT_SUPPORT_API
26#define MONGO_API_CALL __cdecl
27#define MONGO_API_IMPORT __declspec(dllimport)
28#define MONGO_API_EXPORT __declspec(dllexport)
31#define MONGO_API_IMPORT __attribute__((visibility("default")))
32#define MONGO_API_EXPORT __attribute__((used, visibility("default")))
35#if defined(MONGO_CRYPT_SUPPORT_STATIC)
36#define MONGO_CRYPT_API
38#if defined(MONGO_CRYPT_SUPPORT_COMPILING)
39#define MONGO_CRYPT_API MONGO_API_EXPORT
41#define MONGO_CRYPT_API MONGO_API_IMPORT
71typedef struct mongo_crypt_v1_status mongo_crypt_v1_status;
80MONGO_CRYPT_API mongo_crypt_v1_status* MONGO_API_CALL mongo_crypt_v1_status_create(
void);
99MONGO_CRYPT_API
void MONGO_API_CALL mongo_crypt_v1_status_destroy(mongo_crypt_v1_status* status);
110 MONGO_CRYPT_V1_ERROR_IN_REPORTING_ERROR = -2,
111 MONGO_CRYPT_V1_ERROR_UNKNOWN = -1,
113 MONGO_CRYPT_V1_SUCCESS = 0,
115 MONGO_CRYPT_V1_ERROR_ENOMEM = 1,
116 MONGO_CRYPT_V1_ERROR_EXCEPTION = 2,
117 MONGO_CRYPT_V1_ERROR_LIBRARY_ALREADY_INITIALIZED = 3,
118 MONGO_CRYPT_V1_ERROR_LIBRARY_NOT_INITIALIZED = 4,
119 MONGO_CRYPT_V1_ERROR_INVALID_LIB_HANDLE = 5,
120 MONGO_CRYPT_V1_ERROR_REENTRANCY_NOT_ALLOWED = 6,
121} mongo_crypt_v1_error;
135MONGO_CRYPT_API
int MONGO_API_CALL
136mongo_crypt_v1_status_get_error(
const mongo_crypt_v1_status* status);
152MONGO_CRYPT_API
const char* MONGO_API_CALL
153mongo_crypt_v1_status_get_explanation(
const mongo_crypt_v1_status* status);
166MONGO_CRYPT_API
int MONGO_API_CALL
167mongo_crypt_v1_status_get_code(
const mongo_crypt_v1_status* status);
182typedef struct mongo_crypt_v1_lib mongo_crypt_v1_lib;
190MONGO_CRYPT_API mongo_crypt_v1_lib* MONGO_API_CALL
191mongo_crypt_v1_lib_create(mongo_crypt_v1_status* status);
208MONGO_CRYPT_API
int MONGO_API_CALL mongo_crypt_v1_lib_destroy(mongo_crypt_v1_lib* lib,
209 mongo_crypt_v1_status* status);
223MONGO_CRYPT_API uint64_t MONGO_API_CALL mongo_crypt_v1_get_version(
void);
232MONGO_CRYPT_API
const char* MONGO_API_CALL mongo_crypt_v1_get_version_str(
void);
245typedef struct mongo_crypt_v1_query_analyzer mongo_crypt_v1_query_analyzer;
254MONGO_CRYPT_API mongo_crypt_v1_query_analyzer* MONGO_API_CALL
255mongo_crypt_v1_query_analyzer_create(mongo_crypt_v1_lib* lib, mongo_crypt_v1_status* status);
266MONGO_CRYPT_API
void MONGO_API_CALL
267mongo_crypt_v1_query_analyzer_destroy(mongo_crypt_v1_query_analyzer* analyzer);
287MONGO_CRYPT_API uint8_t* MONGO_API_CALL
288mongo_crypt_v1_analyze_query(mongo_crypt_v1_query_analyzer* analyzer,
289 const uint8_t* documentBSON,
293 mongo_crypt_v1_status* status);
302MONGO_CRYPT_API
void MONGO_API_CALL mongo_crypt_v1_bson_free(uint8_t* bson);
308#undef MONGO_CRYPT_SUPPORT_API
309#pragma pop_macro("MONGO_CRYPT_SUPPORT_API")
311#undef MONGO_API_EXPORT
312#pragma push_macro("MONGO_API_EXPORT")
314#undef MONGO_API_IMPORT
315#pragma push_macro("MONGO_API_IMPORT")
318#pragma pop_macro("MONGO_API_CALL")