/* * Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary * source code may only be used and distributed under the Widevine Master * License Agreement. */ #ifndef ODKITEE_MARSHALLER_BASE_H_ #define ODKITEE_MARSHALLER_BASE_H_ #include #include #include #include #include "OEMCryptoCENC.h" #include "serialization_base.h" #ifdef __cplusplus extern "C" { #endif typedef struct _Message Message; /* * When packing a pointer to size_t, and the pointer is null, pass * this special value of size_t instead */ #define SZ_NULL (size_t)~0 void Init_bool(bool* value); void Init_size_t(size_t* value); void Init_c_str(char** value); void Init_uint8_t(uint8_t* value); void Init_uint16_t(uint16_t* value); void Init_uint32_t(uint32_t* value); void Init_uint64_t(uint64_t* value); void InitMemory(uint8_t* addr, size_t length); void InitPointer(uint8_t** addr); /* * Allocate memory for a variable from the bump allocator, used for * DeclarePackVar, DeclareUnpackVar, for some pointer types */ uint8_t* VarAlloc(size_t size); /* * Special cases due to union & shared memory */ void Init_OEMCrypto_DestBufferDesc(OEMCrypto_DestBufferDesc* desc); #ifdef __cplusplus } // extern "C" #endif #endif // ODKITEE_MARSHALLER_BASE_H_