1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group.                                               *
3  * Copyright by the Board of Trustees of the University of Illinois.         *
4  * All rights reserved.                                                      *
5  *                                                                           *
6  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
7  * terms governing use, modification, and redistribution, is contained in    *
8  * the COPYING file, which can be found at the root of the source code       *
9  * distribution tree, or in https://www.hdfgroup.org/licenses.               *
10  * If you do not have access to either file, you may request a copy from     *
11  * help@hdfgroup.org.                                                        *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*
15  * Programmer: Robb Matzke
16  *	       Tuesday, November 25, 1997
17  */
18 
19 #include "H5Omodule.h" /* This source code file is part of the H5O module */
20 
21 #include "H5private.h"   /* Generic Functions			*/
22 #include "H5Eprivate.h"  /* Error handling		  	*/
23 #include "H5Fprivate.h"  /* File access				*/
24 #include "H5HLprivate.h" /* Local Heaps				*/
25 #include "H5MMprivate.h" /* Memory management			*/
26 #include "H5Opkg.h"      /* Object headers			*/
27 
28 /* PRIVATE PROTOTYPES */
29 static void * H5O__efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
30                               const uint8_t *p);
31 static herr_t H5O__efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
32 static void * H5O__efl_copy(const void *_mesg, void *_dest);
33 static size_t H5O__efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
34 static herr_t H5O__efl_reset(void *_mesg);
35 static void * H5O__efl_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size,
36                                  unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata);
37 static herr_t H5O__efl_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
38 
39 /* This message derives from H5O message class */
40 const H5O_msg_class_t H5O_MSG_EFL[1] = {{
41     H5O_EFL_ID,           /*message id number		*/
42     "external file list", /*message name for debugging    */
43     sizeof(H5O_efl_t),    /*native message size	    	*/
44     0,                    /* messages are sharable?       */
45     H5O__efl_decode,      /*decode message		*/
46     H5O__efl_encode,      /*encode message		*/
47     H5O__efl_copy,        /*copy native value		*/
48     H5O__efl_size,        /*size of message on disk	*/
49     H5O__efl_reset,       /*reset method		    	*/
50     NULL,                 /* free method			*/
51     NULL,                 /* file delete method		*/
52     NULL,                 /* link method			*/
53     NULL,                 /*set share method		*/
54     NULL,                 /*can share method		*/
55     NULL,                 /* pre copy native value to file */
56     H5O__efl_copy_file,   /* copy native value to file    */
57     NULL,                 /* post copy native value to file    */
58     NULL,                 /* get creation index		*/
59     NULL,                 /* set creation index		*/
60     H5O__efl_debug        /*debug the message		*/
61 }};
62 
63 #define H5O_EFL_VERSION 1
64 
65 /*-------------------------------------------------------------------------
66  * Function:    H5O__efl_decode
67  *
68  * Purpose:	Decode an external file list message and return a pointer to
69  *          the message (and some other data).
70  *
71  * Return:  Success:    Ptr to a new message struct.
72  *
73  *          Failure:    NULL
74  *
75  * Programmer:	Robb Matzke
76  *              Tuesday, November 25, 1997
77  *
78  * Modification:
79  *              Raymond Lu
80  *              11 April 2011
81  *              We allow zero dimension size starting from the 1.8.7 release.
82  *              The dataset size of external storage can be zero.
83  *-------------------------------------------------------------------------
84  */
85 static void *
H5O__efl_decode(H5F_t * f,H5O_t H5_ATTR_UNUSED * open_oh,unsigned H5_ATTR_UNUSED mesg_flags,unsigned H5_ATTR_UNUSED * ioflags,size_t H5_ATTR_UNUSED p_size,const uint8_t * p)86 H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
87                 unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
88 {
89     H5O_efl_t * mesg = NULL;
90     int         version;
91     const char *s = NULL;
92     H5HL_t *    heap;
93     size_t      u;                /* Local index variable */
94     void *      ret_value = NULL; /* Return value */
95 
96     FUNC_ENTER_STATIC
97 
98     /* Check args */
99     HDassert(f);
100     HDassert(p);
101 
102     if (NULL == (mesg = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t))))
103         HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
104 
105     /* Version */
106     version = *p++;
107     if (version != H5O_EFL_VERSION)
108         HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for external file list message")
109 
110     /* Reserved */
111     p += 3;
112 
113     /* Number of slots */
114     UINT16DECODE(p, mesg->nalloc);
115     HDassert(mesg->nalloc > 0);
116     UINT16DECODE(p, mesg->nused);
117     HDassert(mesg->nused <= mesg->nalloc);
118 
119     /* Heap address */
120     H5F_addr_decode(f, &p, &(mesg->heap_addr));
121 
122 #ifndef NDEBUG
123     HDassert(H5F_addr_defined(mesg->heap_addr));
124 
125     if (NULL == (heap = H5HL_protect(f, mesg->heap_addr, H5AC__READ_ONLY_FLAG)))
126         HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value")
127 
128     s = (const char *)H5HL_offset_into(heap, 0);
129 
130     HDassert(s && !*s);
131 
132     if (H5HL_unprotect(heap) < 0)
133         HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read unprotect link value")
134     heap = NULL;
135 #endif
136 
137     /* Decode the file list */
138     mesg->slot = (H5O_efl_entry_t *)H5MM_calloc(mesg->nalloc * sizeof(H5O_efl_entry_t));
139     if (NULL == mesg->slot)
140         HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
141 
142     if (NULL == (heap = H5HL_protect(f, mesg->heap_addr, H5AC__READ_ONLY_FLAG)))
143         HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value")
144     for (u = 0; u < mesg->nused; u++) {
145         /* Name */
146         H5F_DECODE_LENGTH(f, p, mesg->slot[u].name_offset);
147 
148         if ((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL)
149             HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name")
150         if (*s == (char)'\0')
151             HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name")
152         mesg->slot[u].name = H5MM_xstrdup(s);
153         HDassert(mesg->slot[u].name);
154 
155         /* File offset */
156         H5F_DECODE_LENGTH(f, p, mesg->slot[u].offset);
157 
158         /* Size */
159         H5F_DECODE_LENGTH(f, p, mesg->slot[u].size);
160     } /* end for */
161 
162     if (H5HL_unprotect(heap) < 0)
163         HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read unprotect link value")
164     heap = NULL;
165 
166     /* Set return value */
167     ret_value = mesg;
168 
169 done:
170     if (ret_value == NULL)
171         if (mesg != NULL)
172             H5MM_xfree(mesg);
173 
174     FUNC_LEAVE_NOAPI(ret_value)
175 } /* end H5O__efl_decode() */
176 
177 /*-------------------------------------------------------------------------
178  * Function:	H5O__efl_encode
179  *
180  * Purpose:	Encodes a message.
181  *
182  * Return:	Non-negative on success/Negative on failure
183  *
184  * Programmer:	Robb Matzke
185  *		Tuesday, November 25, 1997
186  *
187  *-------------------------------------------------------------------------
188  */
189 static herr_t
H5O__efl_encode(H5F_t * f,hbool_t H5_ATTR_UNUSED disable_shared,uint8_t * p,const void * _mesg)190 H5O__efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
191 {
192     const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg;
193     size_t           u; /* Local index variable */
194 
195     FUNC_ENTER_STATIC_NOERR
196 
197     /* check args */
198     HDassert(f);
199     HDassert(mesg);
200     HDassert(p);
201 
202     /* Version */
203     *p++ = H5O_EFL_VERSION;
204 
205     /* Reserved */
206     *p++ = 0;
207     *p++ = 0;
208     *p++ = 0;
209 
210     /* Number of slots */
211     HDassert(mesg->nalloc > 0);
212     UINT16ENCODE(p, mesg->nused); /*yes, twice*/
213     HDassert(mesg->nused > 0 && mesg->nused <= mesg->nalloc);
214     UINT16ENCODE(p, mesg->nused);
215 
216     /* Heap address */
217     HDassert(H5F_addr_defined(mesg->heap_addr));
218     H5F_addr_encode(f, &p, mesg->heap_addr);
219 
220     /* Encode file list */
221     for (u = 0; u < mesg->nused; u++) {
222         /*
223          * The name should have been added to the heap when the dataset was
224          * created.
225          */
226         HDassert(mesg->slot[u].name_offset);
227         H5F_ENCODE_LENGTH(f, p, mesg->slot[u].name_offset);
228         H5F_ENCODE_LENGTH(f, p, (hsize_t)mesg->slot[u].offset);
229         H5F_ENCODE_LENGTH(f, p, mesg->slot[u].size);
230     } /* end for */
231 
232     FUNC_LEAVE_NOAPI(SUCCEED)
233 } /* end H5O__efl_encode() */
234 
235 /*-------------------------------------------------------------------------
236  * Function:	H5O__efl_copy
237  *
238  * Purpose:	Copies a message from _MESG to _DEST, allocating _DEST if
239  *		necessary.
240  *
241  * Return:	Success:	Ptr to _DEST
242  *
243  *		Failure:	NULL
244  *
245  * Programmer:	Robb Matzke
246  *		Tuesday, November 25, 1997
247  *
248  *-------------------------------------------------------------------------
249  */
250 static void *
H5O__efl_copy(const void * _mesg,void * _dest)251 H5O__efl_copy(const void *_mesg, void *_dest)
252 {
253     const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg;
254     H5O_efl_t *      dest = (H5O_efl_t *)_dest;
255     size_t           u;                      /* Local index variable */
256     hbool_t          slot_allocated = FALSE; /* Flag to indicate that dynamic allocation has begun */
257     void *           ret_value      = NULL;  /* Return value */
258 
259     FUNC_ENTER_STATIC
260 
261     /* check args */
262     HDassert(mesg);
263 
264     /* Allocate destination message, if necessary */
265     if (!dest && NULL == (dest = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t))))
266         HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "can't allocate efl message")
267 
268     /* copy */
269     *dest = *mesg;
270 
271     /* Deep copy allocated information */
272     if (dest->nalloc > 0) {
273         if (NULL == (dest->slot = (H5O_efl_entry_t *)H5MM_calloc(dest->nalloc * sizeof(H5O_efl_entry_t))))
274             HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "can't allocate efl message slots")
275         slot_allocated = TRUE;
276         for (u = 0; u < mesg->nused; u++) {
277             dest->slot[u] = mesg->slot[u];
278             if (NULL == (dest->slot[u].name = H5MM_xstrdup(mesg->slot[u].name)))
279                 HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "can't allocate efl message slot name")
280         } /* end for */
281     }     /* end if */
282 
283     /* Set return value */
284     ret_value = dest;
285 
286 done:
287     if (NULL == ret_value) {
288         if (slot_allocated) {
289             for (u = 0; u < dest->nused; u++)
290                 if (dest->slot[u].name != NULL && dest->slot[u].name != mesg->slot[u].name)
291                     dest->slot[u].name = (char *)H5MM_xfree(dest->slot[u].name);
292             dest->slot = (H5O_efl_entry_t *)H5MM_xfree(dest->slot);
293         } /* end if */
294         if (NULL == _dest)
295             dest = (H5O_efl_t *)H5MM_xfree(dest);
296     } /* end if */
297 
298     FUNC_LEAVE_NOAPI(ret_value)
299 } /* end H5O__efl_copy() */
300 
301 /*-------------------------------------------------------------------------
302  * Function:	H5O__efl_size
303  *
304  * Purpose:	Returns the size of the raw message in bytes not counting the
305  *		message type or size fields, but only the data fields.	This
306  *		function doesn't take into account message alignment. This
307  *		function doesn't count unused slots.
308  *
309  * Return:	Success:	Message data size in bytes.
310  *
311  *		Failure:	0
312  *
313  * Programmer:	Robb Matzke
314  *		Tuesday, November 25, 1997
315  *
316  *-------------------------------------------------------------------------
317  */
318 static size_t
H5O__efl_size(const H5F_t * f,hbool_t H5_ATTR_UNUSED disable_shared,const void * _mesg)319 H5O__efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
320 {
321     const H5O_efl_t *mesg      = (const H5O_efl_t *)_mesg;
322     size_t           ret_value = 0;
323 
324     FUNC_ENTER_STATIC_NOERR
325 
326     /* check args */
327     HDassert(f);
328     HDassert(mesg);
329 
330     ret_value = (size_t)H5F_SIZEOF_ADDR(f) +                /*heap address	*/
331                 2 +                                         /*slots allocated*/
332                 2 +                                         /*num slots used*/
333                 4 +                                         /*reserved	*/
334                 mesg->nused * ((size_t)H5F_SIZEOF_SIZE(f) + /*name offset	*/
335                                (size_t)H5F_SIZEOF_SIZE(f) + /*file offset	*/
336                                (size_t)H5F_SIZEOF_SIZE(f)); /*file size	*/
337 
338     FUNC_LEAVE_NOAPI(ret_value)
339 } /* end H5O__efl_size() */
340 
341 /*-------------------------------------------------------------------------
342  * Function:	H5O__efl_reset
343  *
344  * Purpose:	Frees internal pointers and resets the message to an
345  *		initialial state.
346  *
347  * Return:	Non-negative on success/Negative on failure
348  *
349  * Programmer:	Robb Matzke
350  *		Tuesday, November 25, 1997
351  *
352  *-------------------------------------------------------------------------
353  */
354 static herr_t
H5O__efl_reset(void * _mesg)355 H5O__efl_reset(void *_mesg)
356 {
357     H5O_efl_t *mesg = (H5O_efl_t *)_mesg;
358     size_t     u; /* Local index variable */
359 
360     FUNC_ENTER_STATIC_NOERR
361 
362     /* check args */
363     HDassert(mesg);
364 
365     /* reset */
366     if (mesg->slot) {
367         for (u = 0; u < mesg->nused; u++) {
368             mesg->slot[u].name        = (char *)H5MM_xfree(mesg->slot[u].name);
369             mesg->slot[u].name_offset = 0;
370         } /* end for */
371         mesg->slot = (H5O_efl_entry_t *)H5MM_xfree(mesg->slot);
372     } /* end if */
373     mesg->heap_addr = HADDR_UNDEF;
374     mesg->nused = mesg->nalloc = 0;
375 
376     FUNC_LEAVE_NOAPI(SUCCEED)
377 } /* end H5O__efl_reset() */
378 
379 /*-------------------------------------------------------------------------
380  * Function:	H5O_efl_total_size
381  *
382  * Purpose:	Return the total size of the external file list by summing
383  *		the sizes of all of the files.
384  *
385  * Return:	Success:	Total reserved size for external data.
386  *
387  *		Failure:	0
388  *
389  * Programmer:	Robb Matzke
390  *              Tuesday, March  3, 1998
391  *
392  *-------------------------------------------------------------------------
393  */
394 hsize_t
H5O_efl_total_size(H5O_efl_t * efl)395 H5O_efl_total_size(H5O_efl_t *efl)
396 {
397     hsize_t ret_value = 0, tmp;
398 
399     FUNC_ENTER_NOAPI(0)
400 
401     if (efl->nused > 0 && H5O_EFL_UNLIMITED == efl->slot[efl->nused - 1].size)
402         ret_value = H5O_EFL_UNLIMITED;
403     else {
404         size_t u; /* Local index variable */
405 
406         for (u = 0; u < efl->nused; u++, ret_value = tmp) {
407             tmp = ret_value + efl->slot[u].size;
408             if (tmp <= ret_value)
409                 HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, 0, "total external storage size overflowed");
410         } /* end for */
411     }     /* end else */
412 
413 done:
414     FUNC_LEAVE_NOAPI(ret_value)
415 } /* end H5O_efl_total_size() */
416 
417 /*-------------------------------------------------------------------------
418  * Function:    H5O__efl_copy_file
419  *
420  * Purpose:     Copies an efl message from _MESG to _DEST in file
421  *
422  * Return:      Success:        Ptr to _DEST
423  *
424  *              Failure:        NULL
425  *
426  * Programmer:  Peter Cao
427  *              September 29, 2005
428  *
429  *-------------------------------------------------------------------------
430  */
431 static void *
H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED * file_src,void * mesg_src,H5F_t * file_dst,hbool_t H5_ATTR_UNUSED * recompute_size,unsigned H5_ATTR_UNUSED * mesg_flags,H5O_copy_t H5_ATTR_UNUSED * cpy_info,void H5_ATTR_UNUSED * _udata)432 H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_dst,
433                    hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags,
434                    H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *_udata)
435 {
436     H5O_efl_t *efl_src = (H5O_efl_t *)mesg_src;
437     H5O_efl_t *efl_dst = NULL;
438     H5HL_t *   heap    = NULL; /* Pointer to local heap for EFL file names */
439     size_t     idx, size, name_offset, heap_size;
440     void *     ret_value = NULL; /* Return value */
441 
442     FUNC_ENTER_STATIC_TAG(H5AC__COPIED_TAG)
443 
444     /* check args */
445     HDassert(efl_src);
446     HDassert(file_dst);
447 
448     /* Allocate space for the destination efl */
449     if (NULL == (efl_dst = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t))))
450         HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
451 
452     /* Copy the "top level" information */
453     H5MM_memcpy(efl_dst, efl_src, sizeof(H5O_efl_t));
454 
455     /* Determine size needed for destination heap */
456     heap_size = H5HL_ALIGN(1); /* "empty" name */
457     for (idx = 0; idx < efl_src->nused; idx++)
458         heap_size += H5HL_ALIGN(HDstrlen(efl_src->slot[idx].name) + 1);
459 
460     /* Create name heap */
461     if (H5HL_create(file_dst, heap_size, &efl_dst->heap_addr /*out*/) < 0)
462         HGOTO_ERROR(H5E_EFL, H5E_CANTINIT, NULL, "can't create heap")
463 
464     /* Pin the heap down in memory */
465     if (NULL == (heap = H5HL_protect(file_dst, efl_dst->heap_addr, H5AC__NO_FLAGS_SET)))
466         HGOTO_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to protect EFL file name heap")
467 
468     /* Insert "empty" name first */
469     if (H5HL_insert(file_dst, heap, (size_t)1, "", &name_offset) < 0)
470         HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap")
471     HDassert(0 == name_offset);
472 
473     /* allocate array of external file entries */
474     if (efl_src->nalloc > 0) {
475         size = efl_src->nalloc * sizeof(H5O_efl_entry_t);
476         if ((efl_dst->slot = (H5O_efl_entry_t *)H5MM_calloc(size)) == NULL)
477             HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
478 
479         /* copy content from the source. Need to update later */
480         H5MM_memcpy(efl_dst->slot, efl_src->slot, size);
481     } /* end if */
482 
483     /* copy the name from the source */
484     for (idx = 0; idx < efl_src->nused; idx++) {
485         efl_dst->slot[idx].name = H5MM_xstrdup(efl_src->slot[idx].name);
486         if (H5HL_insert(file_dst, heap, HDstrlen(efl_dst->slot[idx].name) + 1, efl_dst->slot[idx].name,
487                         &(efl_dst->slot[idx].name_offset)) < 0)
488             HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap")
489     }
490 
491     /* Set return value */
492     ret_value = efl_dst;
493 
494 done:
495     /* Release resources */
496     if (heap && H5HL_unprotect(heap) < 0)
497         HDONE_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to unprotect EFL file name heap")
498     if (!ret_value)
499         if (efl_dst)
500             H5MM_xfree(efl_dst);
501 
502     FUNC_LEAVE_NOAPI_TAG(ret_value)
503 } /* end H5O__efl_copy_file() */
504 
505 /*-------------------------------------------------------------------------
506  * Function:	H5O__efl_debug
507  *
508  * Purpose:	Prints debugging info for a message.
509  *
510  * Return:	Non-negative on success/Negative on failure
511  *
512  * Programmer:	Robb Matzke
513  *		Tuesday, November 25, 1997
514  *
515  *-------------------------------------------------------------------------
516  */
517 static herr_t
H5O__efl_debug(H5F_t H5_ATTR_UNUSED * f,const void * _mesg,FILE * stream,int indent,int fwidth)518 H5O__efl_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth)
519 {
520     const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg;
521     size_t           u;
522 
523     FUNC_ENTER_STATIC_NOERR
524 
525     /* check args */
526     HDassert(f);
527     HDassert(mesg);
528     HDassert(stream);
529     HDassert(indent >= 0);
530     HDassert(fwidth >= 0);
531 
532     HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Heap address:", mesg->heap_addr);
533 
534     HDfprintf(stream, "%*s%-*s %zu/%zu\n", indent, "", fwidth, "Slots used/allocated:", mesg->nused,
535               mesg->nalloc);
536 
537     for (u = 0; u < mesg->nused; u++) {
538         char buf[64];
539 
540         HDsnprintf(buf, sizeof(buf), "File %zu", u);
541         HDfprintf(stream, "%*s%s:\n", indent, "", buf);
542 
543         HDfprintf(stream, "%*s%-*s \"%s\"\n", indent + 3, "", MAX(fwidth - 3, 0),
544                   "Name:", mesg->slot[u].name);
545 
546         HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(fwidth - 3, 0),
547                   "Name offset:", mesg->slot[u].name_offset);
548 
549         HDfprintf(stream, "%*s%-*s %" PRIdMAX "\n", indent + 3, "", MAX(fwidth - 3, 0),
550                   "Offset of data in file:", (intmax_t)(mesg->slot[u].offset));
551 
552         HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent + 3, "", MAX(fwidth - 3, 0),
553                   "Bytes reserved for data:", (mesg->slot[u].size));
554     } /* end for */
555 
556     FUNC_LEAVE_NOAPI(SUCCEED)
557 } /* end H5O__efl_debug() */
558