h5tools_str.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 /*
00017  * Programmer:  Bill Wendling <wendling@ncsa.uiuc.edu>
00018  *              Monday, 19. February 2001
00019  */
00020 #ifndef H5TOOLS_STR_H__
00021 #define H5TOOLS_STR_H__
00022 
00023 typedef struct h5tools_str_t {
00024     char    *s;     /*allocate string       */
00025     size_t  len;        /*length of actual value    */
00026     size_t  nalloc;     /*allocated size of string  */
00027 } h5tools_str_t;
00028 
00029 extern void     h5tools_str_close(h5tools_str_t *str);
00030 extern size_t   h5tools_str_len(h5tools_str_t *str);
00031 extern char    *h5tools_str_append(h5tools_str_t *str, const char *fmt, ...);
00032 extern char    *h5tools_str_reset(h5tools_str_t *str);
00033 extern char    *h5tools_str_trunc(h5tools_str_t *str, size_t size);
00034 extern char    *h5tools_str_fmt(h5tools_str_t *str, size_t start, const char *fmt);
00035 extern char    *h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t *info,
00036                                    hsize_t elmtno, unsigned ndims, hsize_t min_idx[],
00037                                    hsize_t max_idx[], h5tools_context_t *ctx);
00038 /*
00039  * new functions needed to display region reference data
00040  */
00041 extern char    *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info,
00042                                    hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t min_idx[],
00043                                    hsize_t max_idx[], h5tools_context_t *ctx);
00044 extern void     h5tools_str_dump_region_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *,
00045                                    h5tools_context_t *ctx);
00046 extern void     h5tools_str_dump_region_points(h5tools_str_t *, hid_t, const h5tool_format_t *,
00047                                    h5tools_context_t *ctx);
00048 extern void     h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, hid_t container,
00049                                    void *vp, h5tools_context_t *ctx);
00050 extern char    *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info,
00051                                    hid_t container, hid_t type, void *vp,
00052                                    h5tools_context_t *ctx);
00053 
00054 #endif  /* H5TOOLS_STR_H__ */