]> git.sesse.net Git - cubemap/blob - metacube2.h
Tweak the MutexLock implementation slightly, so as to confuse Coverity less.
[cubemap] / metacube2.h
1 #ifndef _METACUBE2_H
2 #define _METACUBE2_H
3
4 /*
5  * Definitions for the Metacube2 protocol, used to communicate with Cubemap.
6  *
7  * Note: This file is meant to compile as both C and C++, for easier inclusion
8  * in other projects.
9  */
10
11 #include <stdint.h>
12
13 #define METACUBE2_SYNC "cube!map"  /* 8 bytes long. */
14 #define METACUBE_FLAGS_HEADER 0x1
15 #define METACUBE_FLAGS_NOT_SUITABLE_FOR_STREAM_START 0x2
16
17 struct metacube2_block_header {
18         char sync[8];    /* METACUBE2_SYNC */
19         uint32_t size;   /* Network byte order. Does not include header. */
20         uint16_t flags;  /* Network byte order. METACUBE_FLAGS_*. */
21         uint16_t csum;   /* Network byte order. CRC16 of size and flags. */
22 };
23
24 uint16_t metacube2_compute_crc(const struct metacube2_block_header *hdr);
25
26 #endif  /* !defined(_METACUBE_H) */