diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2000-05-11 22:15:12 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2000-05-11 22:15:12 (GMT) |
commit | e02e441734f6f9a86b77c87a4d009ff8f4df0e60 (patch) | |
tree | 5e890562010db9fc9b66600352b7a38ca01d337b /tools/h5dumputil.c | |
parent | 330d49b27aace66a65b8b3ec9fdd3a25573c09bb (diff) | |
download | hdf5-e02e441734f6f9a86b77c87a4d009ff8f4df0e60.zip hdf5-e02e441734f6f9a86b77c87a4d009ff8f4df0e60.tar.gz hdf5-e02e441734f6f9a86b77c87a4d009ff8f4df0e60.tar.bz2 |
[svn-r2242] Removed h5dumputil.c. Its functions have been migrated to h5tools.c.
Diffstat (limited to 'tools/h5dumputil.c')
-rw-r--r-- | tools/h5dumputil.c | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/tools/h5dumputil.c b/tools/h5dumputil.c deleted file mode 100644 index a88f4b2..0000000 --- a/tools/h5dumputil.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * - * Purpose: A library for displaying the values of a dataset or an attribute - * in a human readable format. - * - * Note: h5dumputil is a modification of h5tools.c - */ -#include <assert.h> -#include <ctype.h> -#include <h5dump.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "h5tools.h" - -/* - * The output functions need a temporary buffer to hold a piece of the - * dataset while it's being printed. This constant sets the limit on the - * size of that temporary buffer in bytes. For efficiency's sake, choose the - * largest value suitable for your machine (for testing use a small value). - */ -#if 0 -#define H5DUMP_BUFSIZE (1024*1024) -#else -#define H5DUMP_BUFSIZE (1024) -#endif - -#ifndef MIN -#define MIN(X,Y) ((X)<(Y)?(X):(Y)) -#endif -#ifndef NELMTS -#define NELMTS(X) (sizeof(X)/sizeof(*X)) -#endif -#define ALIGN(A,Z) ((((A)+(Z)-1)/(Z))*(Z)) - - -extern void indentation(int); - -int print_data(hid_t , hid_t , int); - -/*------------------------------------------------------------------------- - * Function: h5dump_sprint - * - * Purpose: Prints the value pointed to by VP into the string S assuming - * the data type of VP is TYPE. - * - * Return: void - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -#if 0 -static void -h5dump_sprint(char *s/*out*/, hid_t type, void *vp) -{ - size_t i, n; - char temp[1024]; - int j; - H5T_str_t str_pad; - - if (H5Tequal(type, H5T_NATIVE_DOUBLE)) { - sprintf(s, "%g", *((double*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_FLOAT)) { - sprintf(s, "%g", *((float*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_SHORT)) { - sprintf(s, "%d", *((short*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_USHORT)) { - sprintf(s, "%u", *((unsigned short*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_INT)) { - sprintf(s, "%d", *((int*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_UINT)) { - sprintf(s, "%u", *((unsigned*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_LONG)) { - sprintf(s, "%ld", *((long*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_ULONG)) { - sprintf(s, "%lu", *((unsigned long*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_SCHAR)) { - sprintf(s, "%d", *((signed char*)vp)); - } else if (H5Tequal(type, H5T_NATIVE_UCHAR)) { - sprintf(s, "%u", *((unsigned char*)vp)); - } else if (H5T_STRING==H5Tget_class(type)) { - str_pad = H5Tget_strpad(type) ; - j = 0; - for (i = 0; i < H5Tget_size(type); i++) { - switch (*((char*)vp+i)) { - case '"': - strcpy(s+j, "\\\""); - j += strlen("\\\""); - break; - case '\\': - strcpy(s+j, "\\\\"); - j += strlen("\\\\"); - break; - case '\b': - strcpy(s+j, "\\b"); - j += strlen("\\b"); - break; - case '\f': - strcpy(s+j, "\\f"); - j += strlen("\\f"); - break; - case '\n': - strcpy(s+j, "\\n"); - j += strlen("\\n"); - break; - case '\r': - strcpy(s+j, "\\r"); - j += strlen("\\r"); - break; - case '\t': - strcpy(s+j, "\\t"); - j += strlen("\\t"); - break; - default: - if (isprint(*((char*)vp+i))){ - sprintf(s+j, "%c", *((char*)vp+i)); - j += strlen(s+j); - } else { - if (str_pad == H5T_STR_NULLTERM && - *((unsigned char*)vp+i) == '\0' ) { - sprintf(s+j, "%c", *((unsigned char*)vp+i)); - i = H5Tget_size(type); - } else { - sprintf(s+j, "\\%03o", *((unsigned char*)vp+i)); - j += strlen(s+j); - } - } - break; - } - } - } else { - strcpy(temp, "0x"); - n = H5Tget_size(type); - for (i=0; i<n; i++) { - sprintf(temp+strlen(temp), "%02x", ((unsigned char*)vp)[i]); - } - sprintf(s, "%s", temp); - } - -} - - -#endif - - |