Source
179
179
180
180
/* Load native information for a message, if it's not already present */
181
181
/* (Only works for messages with decode callback) */
182
182
#define H5O_LOAD_NATIVE(F, DXPL, IOF, OH, MSG, ERR) \
183
183
if(NULL == (MSG)->native) { \
184
184
const H5O_msg_class_t *msg_type = (MSG)->type; \
185
185
unsigned ioflags = (IOF); \
186
186
\
187
187
/* Decode the message */ \
188
188
HDassert(msg_type->decode); \
189
-
if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \
189
+
if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw_size, (MSG)->raw))) \
190
190
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \
191
191
\
192
192
/* Mark the message dirty if it was changed by decoding */ \
193
193
if((ioflags & H5O_DECODEIO_DIRTY) && (H5F_get_intent((F)) & H5F_ACC_RDWR)) { \
194
194
(MSG)->dirty = TRUE; \
195
195
/* Increment the count of messages dirtied by decoding, but */ \
196
196
/* only ifndef NDEBUG */ \
197
197
INCR_NDECODE_DIRTIED(OH) \
198
198
} \
199
199
\
215
215
#define H5O_SHARE_IS_SHARABLE 0x01
216
216
#define H5O_SHARE_IN_OHDR 0x02
217
217
218
218
219
219
/* The "message class" type */
220
220
struct H5O_msg_class_t {
221
221
unsigned id; /*message type ID on disk */
222
222
const char *name; /*for debugging */
223
223
size_t native_size; /*size of native message */
224
224
unsigned share_flags; /* Message sharing settings */
225
-
void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, const uint8_t *);
225
+
void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, size_t, const uint8_t *);
226
226
herr_t (*encode)(H5F_t *, hbool_t, uint8_t *, const void *);
227
227
void *(*copy)(const void *, void *); /*copy native value */
228
228
size_t (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message */
229
229
herr_t (*reset)(void *); /*free nested data structs */
230
230
herr_t (*free)(void *); /*free main data struct */
231
231
herr_t (*del)(H5F_t *, hid_t, H5O_t *, void *); /* Delete space in file referenced by this message */
232
232
herr_t (*link)(H5F_t *, hid_t, H5O_t *, void *); /* Increment any links in file reference by this message */
233
233
herr_t (*set_share)(void*, const H5O_shared_t*); /* Set shared information */
234
234
htri_t (*can_share)(const void *); /* Is message allowed to be shared? */
235
235
herr_t (*pre_copy_file)(H5F_t *, const void *, hbool_t *, const H5O_copy_t *, void *); /*"pre copy" action when copying native value to file */