2 * @file fres_container_internal.h
3 * @author Michal Sojka <sojkam1@fel.cvut.cz>
5 * @brief Internal interface to fres_container.
7 * This header should only be included by files in frsh/cm library.
10 #ifndef FRES_CONTAINER_INTERNAL_H
11 #define FRES_CONTAINER_INTERNAL_H
13 #include <fres_contract_idl.h>
15 /** State of the block in container. */
16 enum fres_block_state {
17 /** There is no such block in the container. */
19 /** The container contains the block in the deserialized
22 /** The container contains the block in the serialized form
23 * (sequence of octets).*/
27 #define FRES_BLOCK_FLAG_ENDIAN_m 0x0001
28 #define FRES_BLOCK_LITTLE_ENDIAN 0x0001
30 /**< Unserialized (unknown) contracts blocks */
31 typedef struct fres_block_stream {
32 void *data; /**< Serialized data */
33 CORBA_unsigned_short flags; /**< Flags: bit 1 - little endian */
34 size_t length; /**< Length of the stream */
35 } fres_block_stream_t;
38 enum fres_block_state state;
40 /** Pointer to data according to param_type
41 * (state == FRES_BLOCK_DATA) */
44 /** Unserialized (unknown) data
45 * (state == FRES_BLOCK_STREAM) */
46 fres_block_stream_t stream;
50 struct fres_container {
51 struct fres_block blocks[FRES_NUM_BLOCKS];
54 #define FRES_BLOCK_TYPE_VALID(type) \
55 ((type) < FRES_NUM_BLOCKS && \