* Normalization with develop * Removes checks and work-arounds for strtoll and strtoull (#769) * Removes checks for (v)snprintf, which are C99 (#772) * Update missing release note info. (#776) * Replaces the H5_OVERRIDE macro with override (#773) The macro is no longer necessary now that we require C++11. * Cleans up some POSIX header bits in H5private.h (#783) * Removes outdated checks for ways inline might be defined (#781) These are obsolete now that we require C99. * Removes checks for system(), which is C89/90 (#782) * Removes C++ dependency on H5private.h (#774) * Removes C++ dependency on H5private.h Most C API calls have been removed, aside from a few uses of free, where we just dropped the 'HD'. A couple of H5_ATTR_UNUSED macros were also replaced with (void) statements. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Further simplifies Autotools type size checks (#789) Also fixes an issue where clock_gettime and difftime are not detected due to earlier simplifications of this code. * Release Note (#784) * Normalization of CMake H5pubconf.h with Autotools (#791) Mostly just moving things around and changing the comments to keep the delta small. The only symbol change is that for curl/curl.h which I changed to H5_HAVE_CURL_CURL_H to match the Autotools. This symbol is not used in the library and is just an artifact of the checks. * Fix tools test (#794) * Removes ancient Autotools cruft (#790) * Reorganization of C and POSIX headers in H5public.h & H5private.h (#793) * Reorganization of C and POSIX headers in H5public.h & H5private.h Consolidated and removed duplicates * It turns out Windows has sys/types.h Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Removes checks for signal and set/longjmp, which are C89 (#798) Also removes checks for setjmp.h and stddef.h * Assume frexpl/f and fabsl/f, which are C99 (#799) * Assume the library has C99 types in C++ type code (#806) * Assume the library has C99 types in C++ type code * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes obsolete equivalents of C99's __func__ (#800) * Cleans up POSIX/C bits in H5private.h (#804) * Cleans up POSIX/C bits in H5private.h * Assume difftime exists (C89) * Reorg AC_CHECK_HEADERS so headers are in alphabetical order * Split off networking-related AC_CHECK_HEADERS * Remove unused UNAME_CYGWIN from configure.ac * Remove checks for unused sys/timeb.h * Tidying pass over H5private.h HD prefix macros * Tidy H5win32defs.h * Add HD prefix to various scanf calls * Committing clang-format changes * Fixes to the alarm(2) code used in the tests to make Windows happy Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Brings the tools getopt(3) replacement into the main library (#803) * Moves get_option from the tools library to the C library * Adds H5 prefix to get_option call and variables * Renames the H5_get_option long options struct and enum * Removes type guesses when C99 types are missing (#807) * Assume C99 types exist in H5detect.c (#808) * Fixes parallel issues from recent C99 changes * Adds MPE FUNC --> __func__ changes missed in earlier PRs * Fix typo * Fixes parallel issues from recent C99 changes (#809) * Fixes parallel issues from recent C99 changes * Adds MPE FUNC --> __func__ changes missed in earlier PRs * Even more missed FUNC --> __func__ macros * Removes remaining H5_TIME_WITH_SYS_TIME cruft (#810) Mostly from CMake Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
143 lines
5.5 KiB
C
143 lines
5.5 KiB
C
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
* Copyright by The HDF Group. *
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
* All rights reserved. *
|
|
* *
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
* the COPYING file, which can be found at the root of the source code *
|
|
* distribution tree, or in https://www.hdfgroup.org/licenses. *
|
|
* If you do not have access to either file, you may request a copy from *
|
|
* help@hdfgroup.org. *
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
/*
|
|
* Programmer: Bill Wendling
|
|
* Tuesday, 6. March 2001
|
|
*
|
|
* Purpose: Support functions for the various tools.
|
|
*/
|
|
#ifndef H5TOOLS_UTILS_H
|
|
#define H5TOOLS_UTILS_H
|
|
|
|
#include "hdf5.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* ``parallel_print'' information */
|
|
#define PRINT_DATA_MAX_SIZE 512
|
|
#define OUTBUFF_SIZE (PRINT_DATA_MAX_SIZE * 4)
|
|
|
|
H5TOOLS_DLLVAR int g_nTasks;
|
|
H5TOOLS_DLLVAR unsigned char g_Parallel;
|
|
H5TOOLS_DLLVAR char outBuff[];
|
|
H5TOOLS_DLLVAR unsigned outBuffOffset;
|
|
H5TOOLS_DLLVAR FILE *overflow_file;
|
|
|
|
/* Maximum size used in a call to malloc for a dataset */
|
|
H5TOOLS_DLLVAR hsize_t H5TOOLS_MALLOCSIZE;
|
|
/* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */
|
|
H5TOOLS_DLLVAR hsize_t H5TOOLS_BUFSIZE;
|
|
|
|
/*struct taken from the dumper. needed in table struct*/
|
|
typedef struct obj_t {
|
|
H5O_token_t obj_token;
|
|
char * objname;
|
|
hbool_t displayed; /* Flag to indicate that the object has been displayed */
|
|
hbool_t recorded; /* Flag for named datatypes to indicate they were found in the group hierarchy */
|
|
} obj_t;
|
|
|
|
/*struct for the tables that the find_objs function uses*/
|
|
typedef struct table_t {
|
|
hid_t fid;
|
|
size_t size;
|
|
size_t nobjs;
|
|
obj_t *objs;
|
|
} table_t;
|
|
|
|
/*this struct stores the information that is passed to the find_objs function*/
|
|
typedef struct find_objs_t {
|
|
hid_t fid;
|
|
table_t *group_table;
|
|
table_t *type_table;
|
|
table_t *dset_table;
|
|
} find_objs_t;
|
|
|
|
H5TOOLS_DLLVAR unsigned h5tools_nCols; /*max number of columns for outputting */
|
|
|
|
/* Definitions of useful routines */
|
|
H5TOOLS_DLL void indentation(unsigned);
|
|
H5TOOLS_DLL void print_version(const char *progname);
|
|
H5TOOLS_DLL void parallel_print(const char *format, ...);
|
|
H5TOOLS_DLL herr_t parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems,
|
|
char ***ptrs_out);
|
|
H5TOOLS_DLL void error_msg(const char *fmt, ...);
|
|
H5TOOLS_DLL void warn_msg(const char *fmt, ...);
|
|
H5TOOLS_DLL void help_ref_msg(FILE *output);
|
|
H5TOOLS_DLL void free_table(table_t *table);
|
|
#ifdef H5DUMP_DEBUG
|
|
H5TOOLS_DLL void dump_tables(find_objs_t *info);
|
|
#endif /* H5DUMP_DEBUG */
|
|
H5TOOLS_DLL herr_t init_objs(hid_t fid, find_objs_t *info, table_t **group_table, table_t **dset_table,
|
|
table_t **type_table);
|
|
H5TOOLS_DLL obj_t *search_obj(table_t *temp, const H5O_token_t *obj_token);
|
|
#ifndef H5_HAVE_TMPFILE
|
|
H5TOOLS_DLL FILE *tmpfile(void);
|
|
#endif
|
|
|
|
/*************************************************************
|
|
*
|
|
* candidate functions to be public
|
|
*
|
|
*************************************************************/
|
|
|
|
/* This code is layout for common code among tools */
|
|
typedef enum toolname_t {
|
|
TOOL_H5DIFF,
|
|
TOOL_H5LS,
|
|
TOOL__H5DUMP /* add as necessary */
|
|
} h5tool_toolname_t;
|
|
|
|
/* this struct can be used to differntiate among tools */
|
|
typedef struct {
|
|
h5tool_toolname_t toolname;
|
|
int msg_mode;
|
|
} h5tool_opt_t;
|
|
|
|
/* obtain link info from H5tools_get_symlink_info() */
|
|
typedef struct {
|
|
H5O_type_t trg_type; /* OUT: target type */
|
|
char * trg_path; /* OUT: target obj path. This must be freed
|
|
* when used with H5tools_get_symlink_info() */
|
|
H5O_token_t obj_token; /* OUT: target object token */
|
|
unsigned long fileno; /* OUT: File number that target object is located in */
|
|
H5L_info2_t linfo; /* OUT: link info */
|
|
h5tool_opt_t opt; /* IN: options */
|
|
} h5tool_link_info_t;
|
|
|
|
/* Definitions of routines */
|
|
H5TOOLS_DLL int H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t *link_info,
|
|
hbool_t get_obj_type);
|
|
H5TOOLS_DLL const char *h5tools_getprogname(void);
|
|
H5TOOLS_DLL void h5tools_setprogname(const char *progname);
|
|
H5TOOLS_DLL int h5tools_getstatus(void);
|
|
H5TOOLS_DLL void h5tools_setstatus(int d_status);
|
|
H5TOOLS_DLL int h5tools_getenv_update_hyperslab_bufsize(void);
|
|
#ifdef H5_HAVE_ROS3_VFD
|
|
H5TOOLS_DLL herr_t h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim,
|
|
H5FD_ros3_fapl_t *fapl_config_out);
|
|
H5TOOLS_DLL int h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values);
|
|
#endif /* H5_HAVE_ROS3_VFD */
|
|
#ifdef H5_HAVE_LIBHDFS
|
|
H5TOOLS_DLL herr_t h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim,
|
|
H5FD_hdfs_fapl_t *fapl_config_out);
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* H5TOOLS_UTILS_H */
|