summaryrefslogtreecommitdiffstats
path: root/tools/h5tools.h
Commit message (Collapse)AuthorAgeFilesLines
* [svn-r3066] Purpose:Quincey Koziol2000-12-021-2/+2
| | | | | | | | | | | | Bug Fix. Description: Attributes whose datatype was an object or dataset region reference weren't dumping correctly. Solution: Pass along attribute ID to the code which prints the attributes, so the reference types can be dereferenced and printed. Platforms tested: FreeBSD 4.2 (hawkwind) & IRIX64 6.5 (modi4)
* [svn-r2987] Purpose:Quincey Koziol2000-11-211-1/+27
| | | | | | | | | Bug fixes and misc. code fixing. Description: Updated to reflect current DDL document. Also changed VL data to be able to be able also dump VL data of any other datatype. Platforms tested: FreeBSD 4.1.1 (hawkwind)
* [svn-r2790] Purpose:Albert Cheng2000-11-021-0/+2
| | | | | | | | | | | | | | | | new feature Description: h5tools.c: Created h5tools_init() and h5tools_close() for the initialization of the h5tools library and closing of it. With this, the rawdatastream and other internal structures can be initialized properly. h5tools.h: added prototypes for h5tools_init and h5tools_close. h5dump.c: h5ls.c: Added the calls for h5tools_init() and h5tools_close(). Platforms tested: IRIX64 -64 parallel and Linux
* [svn-r2768] ./hdf5/tools/h5tools.hRobb Matzke2000-10-311-292/+293
| | | | | * 2000-10-31 Robb Matzke <matzke@llnl.gov> Reindented.
* [svn-r2626] Purpose:Albert Cheng2000-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | New Feature Description: Add -o option to h5dumper. It displays the raw data of datasets to a separate output file. Add a feature to h5tools library that it uses the FILE *rawdatastream as the stream for the display of datasets raw data. Solution: Define an "extern FILE *rawdatastream" in h5tools.h and declare it in h5tools.c. This way, it would work even if an application does not explicitely declare it. Tried to initialized it to stdout as FILE *rawdatastream = stdout; but Linux gcc rejected it though all other platforms+compilers accepted it fine. For now, put in a kludge to set it right before it is used. Need a safer way to initialize it. Platforms tested: arabica, eirene, modi4 -64.
* [svn-r2460] Fixed some comparisons between signed and unsigned values. Made ↵Bill Wendling2000-08-041-1/+1
| | | | | | | some of the functions prototypes so that the compiler wouldn't complain about them.
* [svn-r2412] Fixed a variety of problems with the new H5ToolsFopen() function.Robb Matzke2000-06-231-5/+1
| | | | | | | | | | | | | | | | | | | | 1. The `driver' table is initialized only once, making it faster and leaking less memory. 2. The returned driver name is set to the empty string on failure. 3. Added an argument so the function cannot overwrite the end of the drivername return value. 4. Avoids core dump when assigning driver name to return value if the file could not be opened by any driver. 5. Changed name of function to h5dump_fopen() to follow the naming scheme for this source file. 6. Reindented according to hdf5 code standard. 7. Added `const' qualifiers to read-only formals. 8. Removed duplicate forward declaration. Reindented some parts of these source files that had very odd indentation (some lines had no indentation while others had 3x what they should). Fixed calls to H5ToolsFopen() function.
* [svn-r2341] took the code out of h5ls to open files using different drivers ↵Patrick Lu2000-06-061-0/+5
| | | | | | | | | and created a function in the tools library for it(H5ToolsFopen-takes a filename and a char ptr if you want the name of the driver) added the function to h5tools.c, a header to h5tools.h and changed h5ls.c and h5dump.c to use the new functions
* [svn-r2243] h5dump.c: Removed some Carriage-return'sAlbert Cheng2000-05-111-1/+1
| | | | | h5tools.c h5tools.h: Modified print_version() to use const char * argument instead.
* [svn-r2211] took the development branch code and moved it into the release. ↵Patrick Lu2000-05-031-1/+7
| | | | | | | had to add some conditional compile statements in the code to compile for the release. defined a VERSION12 and VERSION13 macro. all changes were surrounded by these statements
* [svn-r2167] i removed unneeded code from the tool lib.Patrick Lu2000-04-201-1/+1
| | | | | | | from h5tools.h just got rid of a prototype for copy_atmoic_char which was never used in the h5tools.c i removed the copy_atomic_char, all the display_*_data, where the * is numeric, string or compound, the print_data, h5dump_attr. also removed a block of codfe that was surrounded by #if 0
* [svn-r2017] added a new data structure for the dump header format for ↵Patrick Lu2000-03-091-0/+51
| | | | customized output
* [svn-r1973] fixed the dataset regions problem with the dumper.Patrick Lu2000-02-171-0/+8
| | | | | | now the dump structure contains 2 extra members that tell how to format the data for the dataset regions(blocks and pts). had to give h5ls values for these
* [svn-r1969] fixed a bug with the objrefs. added a format string to the dump ↵Patrick Lu2000-02-171-0/+4
| | | | | | struct to display the format for the obj refs.
* [svn-r1956] in h5tools.h I added a fwe new members to the struct for the ↵Patrick Lu2000-02-151-12/+19
| | | | | | | | | formatting. in h5dump.c just initialized the values for the formatting struct. in h5tools.c made some changes in the printing area to get the dump output to look closer to what we wanted. the strings are currently not printing correctly. also removed the program type variable from here.
* [svn-r1870] h5dump.c:Albert Cheng1999-12-101-0/+5
| | | | | | | | Added -V option for displaying version information. h5tools.c: Added print_version routine to display version information. h5tools.h: Added print_version prototype.
* [svn-r1813] moved the globals out of the tools lib(h5findshd.c) into the ↵Patrick Lu1999-11-031-1/+2
| | | | | | | | | h5toh4 tool. had to change some of the functions in the h5findshd.c file since we didn't have the globals anymore. these changes also affected the h5toh5.c file. passes all tests on unix
* [svn-r1805] more changes. I found some duplicate functions in the library ↵Patrick Lu1999-11-021-1/+3
| | | | | | | | | | | and the dumper. so i moved the dumper stuff out to the libary. Had to change some functions in h5findshd so they would stop using globals that shouldn't be defined in the lib. I will remove the globals next. also the h5findshd.c has an extra member to the struct for that objects in the table so i added that into the appropriate place. the dumper is working ok now but the h5toh4 is still broken.
* [svn-r1800] moved the code from the dumper that iterates thru the files and ↵Patrick Lu1999-10-291-1/+35
| | | | | | | | stores the info into the tables into the tools lib. h5findshd-had some of the same functions so i removed them for now
* [svn-r1742] changed the name of the objectid macro to objid. conflicted with ↵Patrick Lu1999-10-131-1/+1
| | | | | | a windows define
* [svn-r1697] Changes since 19990915Robb Matzke1999-09-301-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------- ./src/H5public.h We undefine a bunch of things that could get redefined in the config file because some customers have applications that include headers from multiple packages, all of which might be using autoconf. Include <stdint.h> for the C9x types. ./test/h5test.h More flushing of stdout for when testing is redirected down a pipe. ./tools/h5ls.c Added a `-S' or `--simple' switch which causes the output to be simplified somewhat for easier parsing by other scripts. For instance, characters are escaped using a very simple mechanism instead of C's more complicated backslash notation, data doesn't have `{}' or `[]' characters interspersed for compound and array types, and data is printed with exactly one element per line. This switch is now used by an HDF5-to-HTML CGI script being developed for the DMF people. ./tools/h5tools.c ./tools/h5tools.h The repeat threshold which controls how strings are printed when a character repeats a bunch of times is now settable at runtime instead of compile time. The default is to show all characters, like "abceeeeeeeeeeeeeeeeeeeeeeeeeeeeeefgh" But if you set it to something like 5 then any sequence of 5 or more characters is replaced by something shorter, like: "abc" 'e'x30 "fgh" or Added an `str_locale' property which describes how to escape special characters in strings. The default is C-like escapes but an alternative is ESCAPE_HTML which replaces all non-alphanumeric characters with a 3-character HTML escape of the form `%XX' Fixed a bug where empty strings didn't even have the quote characters printed. Now empty strings show up as `""' instead of absolutely nothing. Added a `per_line' property which controls the maximum number of elements which will appear per line of output. The default is infinity but in practice the right margin causes line breaks. By setting the `per_line' value to one and the right margin to a very large value one can achieve output with exactly one element per line.
* [svn-r1636] Patrick Lu1999-09-151-0/+1
| | | | | | | | h5tools.h- added a define for OBJECTID-->"OBJECTID" h5dump.c - added an option in there to print object id's still needs some testing but I just wanted the changes to be put up there before i forget
* [svn-r1377] Patrick Lu1999-06-241-1/+0
| | | | removed teh TYPE define since it was already there as DATATYPE
* [svn-r1350] Patrick Lu1999-06-151-0/+31
| | | | added the #defines for the string macros here
* [svn-r1324] Patrick Lu1999-06-101-0/+4
| | | | | moved the ATTRIBUTE_DATA definition from h5dump.h to h5tools.h also created a ENUM_DATA in th5tools.h
* [svn-r1308] Changes since 19990607Robb Matzke1999-06-071-2/+12
| | | | | | | | | | | ---------------------- ./tools/h5ls.c ./tools/h5tools.c ./tools/h5tools.h Finished the `-x' or `--hexdump' switch, which causes all data to be printed in hexadecimal format with no translation from file to memory data type.
* [svn-r1299] Patrick Lu1999-06-041-3/+19
| | | | added an enum for programtypes and the program types variable
* [svn-r1253] started to bring the tools lib and the dumputil file together. ↵Patrick Lu1999-05-131-1/+10
| | | | | | | | | | | | | | | | | | incorportated all the constants and from dumputil to to the tools lib and merged h5dump_fixtype together. I had to add an extra parameter to the function to specify what action should be taken when it hits H5T_STRING in the case statement. if the parameter (strDUAction) is true then it does what it use to do in dumputil but if it is false then it will do what it originally did in this file. I also put the h5dump_sprint functions into the same file. it isn't really merged yet. i just wanted to get everything into a file and then worry about the merging of this function. The toolslib way of h5dump_sprint takes an extra parameter. If this parameter is set to NULL then it will do the dumputil's version of this function. like i said this is just the first step i am taking. it will be merged better later. the rest of the changes to the other files were related to the above changes.
* [svn-r1224] Changes since 19990426Robb Matzke1999-04-271-12/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------- ./tools/h5tools.c ./tools/h5tools.h Finally fixed a long-standing bug that caused core dumps if a compound datum rendered to more than some number of characters (we kept bumping up the limit at the risk of violating stack size limits on some machines). The fix works only on systems that have the vsnprintf() function (otherwise a 4kB limit is imposed, which if violated probably dumps core). If vsnprintf() is present then the library dynamically allocates space for the output string. Also made it possible to control how compound data is rendered across multiple lines of output by allowing the caller to specify where optional line-breaks get inserted. The output functions split up the value at one or more optional line-breaks to prevent it from wrapping around the screen. If a datum doesn't fit on the current line but would fit on the next line then it is printed on the next line regardless of whether optional line-breaks would have prevent wrapping around the screen. This makes it easier to find the beginnings of compound data values. This feature is disabled by default but can be enabled by the application. If a datum doesn't fit on the current line and the previous datum also occupied more than one line then we move to the next line before printing. This makes it easier to find the beginnings of compound data values but prevents the output from looking fragmented if there are only a few long values among mostly short values. This feature is disabled by default but can be enabled by the application. The application can control the printf() formats used for all the native data types. The defaults are what the library used to use: %g, %ld, %lu, %d, and %u ./tools/h5ls.c Compound datatype values can now be split across multiple lines of output instead of just wrapping. Also, when lots of compound values are too long they all start at the beginning of a line. This only required about 10 lines of changes in the setup for tools library calls (I didn't modify the h5dump program because it uses its own version of the tools library that forked off long ago). Added code for Win32 which is unable to cast `unsigned long long' to `double'. If the dataset size exceeds (2^63)-1 then the percent utilization is not displayed (this is easily possible with chunked datasets). This is untested yet. ./configure.in ./src/H5config.h.in ./src/H5.c ./src/H5private.h Check for vsnprintf() and provide a simple, stupid definition if it isn't available. The stupid definition just calls vsprintf() and ignores the second argument. This can result in buffer overflows in h5ls and h5dump since vsprintf() is an unsafe function (and anyone can create an hdf5 file that runs an arbitrary command from h5ls and h5dump in that case)! ./config/conclude.in Remove more *.o files for `make clean' ./src/H5A.c ./src/H5D.c ./src/H5F.c ./src/H5I.c ./src/H5Iprivate.h ./src/H5P.c ./src/H5R.c ./src/H5RA.c ./src/H5S.c ./src/H5T.c ./src/H5TB.c Cleaned up a memory leak during H5_term_library() by allowing H5I_clear_group() to skip items that couldn't be freed. This allows the item to remain in the group until we can free it later. ./src/H5F.c The H5F_close_all() function fails if a file cannot be closed.
* [svn-r1032] Changes since 19990118Robb Matzke1999-01-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------- ./tools/h5tools.c Strings are not converted to null-padding before being printed; they are printed with whatever byte values appear in the file. ./tools/h5ls.c Now able to display attribute data type and data. Added a `-f' or `--full' switch which causes the full name of each object to be displayed instead of just the base name. Added a `-r' or `--recursive' switch that recursively prints the contents of groups, avoiding cycles. More bulletproofing for non-printable characters in things like object names, attribute names, and comment strings. We don't want listing a file to send termal escape sequences because it's sometimes possible to execute commands that way. Since h5ls doesn't usually use quotes around object names we must sometimes escape space characters. External files are listed in a table to make the output less confusing. ./tools/h5tools.c ./tools/h5tools.h Changed h5dump() to h5dump_dset() and added h5dump_mem(). Also make h5dump_fixtype() public. ./test/dtypes.c Wrote some data to an attribute to test h5ls attribute printing. ./src/H5ACprivate.h ./src/H5Apublic.h ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5Epublic.h ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Gprivate.h ./src/H5HLprivate.h ./src/H5Oprivate.h ./src/H5Ppublic.h ./src/H5RApublic.h ./src/H5Rpublic.h ./src/H5Spublic.h ./src/H5Tpkg.h ./src/H5Tpublic.h ./src/H5Vprivate.h ./src/H5Zpublic.h ./src/H5private.h ./src/H5public.h Reindented function prototypes after `HDF5API' was added. Also rewrapped long lines. ./src/H5Flow.c Added an `#ifdef WIN32' around an unused variable. ./src/H5api_adpt.h Removed extra carriage returns inserted by "broken" operating system. ./src/H5Dprivate.h ./src/H5Oprivate.h ./src/H5Vprivate.h ./src/H5private.h Removed extraneous inclusion of H5api_adpt.h since it's included in H5public.h which is included by everything. ./src/Makefile.in Added H5api_adpt.h to the list of public header files to fix broken `make install'.
* [svn-r876] Changes since 19981102Robb Matzke1998-11-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------- ./bin/snapshot Made same fix as for the release script yesterday. ./src/H5D.c ./src/H5Dprivate.h ./src/H5G.c ./src/H5Gprivate.h ./src/H5Gpublic.h ./src/H5O.c ./src/H5Oprivate.h ./src/H5RA.c ./src/H5RAprivate.h ./src/H5T.c ./src/H5Tprivate.h Improved object type checking. Instead of determining the object type by trying to open each of the possible types, we keep a table of associations between object type number (like H5G_GROUP, H5G_DATASET, H5D_TYPE, and H5D_RAGGED) and an `isa' function that returns true if the object header has the right messages to make the object a particular type. This mechanism also allows specialization of object types by permitting an object to satisfy more than one `isa' function. Added `isa' functions for groups, datasets, ragged arrays, and committed data types. ./src/H5config.h.in Added HAVE_STAT_ST_BLOCKS. I thought this had already been added, but apparently not. ./tools/h5ls.c Removed system include files since they're already included by H5private.h and since I wasn't including them portably anyway. By default, 1-byte integer types are printed as integer values instead of ASCII characters. However, the `-s' or `--string' command-line switch causes the data to be interpretted as ASCII. String data types are always printed as character data. Ragged arrays are now identified as ragged arrays and h5ls doesn't descend into the group automatically. This uses the new object type specialization stuff. ./tools/h5tools.c ./tools/h5tools.h Added the ability to print 1-byte integer types as either ASCII or numeric data instead of always ASCII. The default is to print as numeric data.
* [svn-r546] Changes since 19980724Robb Matzke1998-07-291-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------- ./MANIFEST ./doc/html/H5.format.html ./src/H5O.c ./src/H5Oprivate.h ./src/H5Omtime.c [NEW] ./src/H5private.h ./src/Makefile.in Added the modification time message. If an object header has this message then it's value is updated with the current time whenever anything changes in the object header. ./acconfig.h ./configure.in Alas, there seems to be no standard way to convert a string time like 19980727122800 in UTC to a time_t since mktime() only converts local times to time_t. So I've modified the configuration to check for various ways of getting the time zone information: * Added checks for the `tm_gmtoff' field of `struct tm'. * Added a check for the `timezone' global variable. * Added a check for `struct timezone'. * Added a check for BSDgettimeofday(). * Added a check for gettimeofday() although it doesn't actually set the timezone argument on some systems. * Added a check to see if `tm_zone' is a member of `struct tm'. * Added a check to see if `tzname' is a global variable. * Added a check to see if `struct tm' is defined in time.h or sys/time.h. It's not difficult to get the right UTC modification message into the object header, but some systems might have problems getting the right time back out (Irix64 is one) and those systems will report zero for the H5G_stat_t.mtime from an H5Gstat() call as if the mtime message isn't even present. It will, however, continue to be updated as normal. ./src/H5G.c ./src/H5Gpublic.h The H5G_stat_t struct now contains an `mtime' field which will hold the object modification time. If the object has no object modification time then the `mtime' will be initialized to zero. Fixed a bug in H5G_stat() that caused the `objno' field of the H5G_stat_t to be set incorrectly on some machines. ./src/H5D.c Writing to external datasets fail if the hdf5 file is not open for writing. A modification time message is added to the dataset object header when it's created and H5O_touch() is called from H5D_write() to update that message. ./src/H5T.c Fixed a bug in H5Tget_member_dims() that caused a segmentation fault if one of the output array arguments was the null pointer. Relaxed the member dimension checking in H5Tinsert_array() so it can also be used for scalar members. ./test/Makefile.in Added additional file names to the `mostlyclean' target. ./tools/h5dump.c ./tools/h5tools.h Increased the temporary buffer size to 1MB. Added support for printing compound data types with array members. When printing H5T_NATIVE_CHAR and H5T_NATIVE_UCHAR we escape double quote characters. ./tools/h5ls.c Changed the output format a little because we were starting to get too much info to fit on a line. Without `--verbose' each object occupies one line of output. Otherwise, additional information is printed below the object name: object file address, comment, and modification time. If `--dump' is given then the data is printed after the other information. ./test/cmpd_dset.c Changed the way the dataset is initialized to be more uniform.
* [svn-r541] Changes since 19980723Robb Matzke1998-07-241-0/+22
| | | | | | | | | | | ---------------------- ./tools/h5dump.c ./tools/h5ls.c ./tools/h5tools.h Able to handle compound data types now. Moved code that chooses memory data type based on file data type from h5ls to libh5tools.a(h5dump.o)
* [svn-r537] Changes since 19980722Robb Matzke1998-07-231-0/+81
---------------------- ./src/H5A.c ./src/H5Apublic.h ./test/tattr.c Switched the order of the second and third argument of H5Aget_name() to make it consistent with other functions that take buffers and buffer sizes. ./src/H5G.c ./src/H5Gpublic.h ./src/H5Gprivate.h The H5Gget_comment() function returns the size of the comment including the null terminator. If the object has no comment then zero is returned. If an error occurs then a negative value is returned. ./MANIFEST ./tools/Makefile.in ./tools/h5tools.h [NEW] ./tools/h5dump.c [NEW] Created a library for printing values of datasets in a way that looks nice. It's not done yet, but I needed it for debugging the contents of files from Jim Reus. ./tools/h5ls.c Added the `-d' and `--dump' options which cause the contents of a dataset to be printed. Added `-w N' and `--width=N' options to control how wide the raw data output should be. If you want single-column output then say `-w1'. Printing dataset values can now handle datasets of any integer or floating point atomic type. As a special case, integers which are one byte wide are treated a character strings for now. Sample output: $ h5ls --dump --width=60 banana.hdf ARCHIVE 0:0:0:744 Dataset {52/Inf} Data: (0) "U struct complex { double R; double I; };\012V" (43) " double;\012" U 0:0:0:2500 Dataset {256/512} Data: printing of compound data types is not implemented yet V 0:0:0:3928 Dataset {256/512} Data: (0) 0, 0.015625, 0.03125, 0.046875, 0.0625, (5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625, (10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875, (15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875, ...