Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 #ifndef MOJO_PUBLIC_C_BINDINGS_STRUCT_H_ | |
| 6 #define MOJO_PUBLIC_C_BINDINGS_STRUCT_H_ | |
| 7 | |
| 8 #include <stdbool.h> | |
| 9 #include <stdint.h> | |
| 10 | |
| 11 #ifdef __cplusplus | |
| 12 extern "C" { | |
| 13 #endif | |
| 14 | |
| 15 // Validates that a given buffer has a mojo struct header and that the size of | |
| 16 // the struct in the header matches the size of the buffer. | |
| 17 bool mojo_validate_struct_header(void* data, uint32_t size); | |
|
viettrungluu
2016/02/02 00:48:47
const void*?
Also, should you use a |size_t| for
| |
| 18 | |
| 19 typedef struct struct_header { | |
| 20 uint32_t num_bytes; | |
| 21 uint32_t version; | |
| 22 } mojo_struct_header_t; | |
| 23 | |
| 24 #ifdef __cplusplus | |
| 25 } // extern "C" | |
| 26 #endif | |
| 27 | |
| 28 #endif // MOJO_PUBLIC_C_BINDINGS_STRUCT_H_ | |
| OLD | NEW |