No-Typo-Check: Not related to this change. Bug: 161477208 Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
// Copyright 2019 Google LLC. All rights reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine
|
|
// License Agreement.
|
|
|
|
#ifndef WIDEVINE_ODK_SRC_ODK_MESSAGE_PRIV_H_
|
|
#define WIDEVINE_ODK_SRC_ODK_MESSAGE_PRIV_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
* This file must only be included by odk_message.c and serialization_base.c.
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include "odk_message.h"
|
|
|
|
/*
|
|
* This is the implementation of a message. This structure is private, i.e. it
|
|
* should only be included by files that are allowed to modify the internals of
|
|
* a message, that being odk_message.c and serialization_base.c. To ensure
|
|
* proper alignment and message size, an ODK_Message_Impl should never be
|
|
* allocated directly, instead allocate ODK_Message and cast to ODK_Message_Impl
|
|
* because ODK_Message_Impl may be smaller than ODK_Message.
|
|
*/
|
|
typedef struct {
|
|
uint8_t* base;
|
|
size_t capacity;
|
|
size_t size;
|
|
size_t read_offset;
|
|
ODK_MessageStatus status;
|
|
} ODK_Message_Impl;
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif // WIDEVINE_ODK_SRC_ODK_MESSAGE_PRIV_H_
|