mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-24 17:51:25 +08:00
[svn-r9558] Purpose:
insert high level library into main library Description: configure.in has a new entry (--enable-hl, disable-hl) it is on by default the configure message prints info regarding if hl is enabled or not the tree is /hl /hl/src /hl/test Solution: Platforms tested: linux solaris AIX Misc. update:
This commit is contained in:
parent
35ffb5bd13
commit
293fe87eee
21
MANIFEST
21
MANIFEST
@ -1546,4 +1546,25 @@
|
||||
./tools/testfiles/u512.txt
|
||||
./tools/testfiles/u513.txt
|
||||
|
||||
# high level libraries
|
||||
./hl/Makefile.in
|
||||
./hl/src/Dependencies
|
||||
./hl/src/Makefile.in
|
||||
./hl/src/H5HL.h
|
||||
./hl/src/H5IM.c
|
||||
./hl/src/H5IM.h
|
||||
./hl/src/H5LT.c
|
||||
./hl/src/H5LT.h
|
||||
./hl/src/H5TA.c
|
||||
./hl/src/H5TA.h
|
||||
./hl/test/Dependencies
|
||||
./hl/test/Makefile.in
|
||||
./hl/test/test_image.c
|
||||
./hl/test/test_lite.c
|
||||
./hl/test/test_table.c
|
||||
./hl/test/test_table_le.hdf5
|
||||
./hl/test/test_table_be.hdf5
|
||||
./hl/test/test_table_cray.hdf5
|
||||
|
||||
|
||||
./windows/all.zip
|
||||
|
@ -25,7 +25,7 @@ srcdir=@srcdir@
|
||||
# Subdirectories in build-order (not including `examples')
|
||||
# TESTPARALLEL must be after test since it uses libtest.a. Putting it
|
||||
# before tools allows parallel tests to run sooner.
|
||||
SUBDIRS=src test @TESTPARALLEL@ tools @PABLO@ @HDF5_INTERFACES@
|
||||
SUBDIRS=src test @TESTPARALLEL@ tools @HL@ @PABLO@ @HDF5_INTERFACES@
|
||||
|
||||
##############################################################################
|
||||
## T A R G E T S
|
||||
|
40
configure.in
40
configure.in
@ -2815,6 +2815,26 @@ if test -n "$CPPFLAGS"; then
|
||||
CPPFLAGS=$TEMP_CPPFLAGS
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check if they would like the High Level library compiled
|
||||
dnl
|
||||
|
||||
AC_SUBST(HL) HL=""
|
||||
AC_MSG_CHECKING([if high level library is enabled])
|
||||
AC_ARG_ENABLE([hl],
|
||||
[AC_HELP_STRING([--enable-hl],
|
||||
[Do not compile the high level library [default=yes]])],
|
||||
[HDF5_HL=$enableval],
|
||||
[HDF5_HL=yes])
|
||||
|
||||
if test "X$HDF5_HL" = "Xyes"; then
|
||||
echo "yes"
|
||||
HL="hl"
|
||||
else
|
||||
echo "no"
|
||||
fi
|
||||
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Build the Makefiles. Almost every Makefile.in will begin with the line
|
||||
dnl `@COMMENCE@' and end with the line `@CONCLUDE@'. These lines insert
|
||||
@ -2895,6 +2915,17 @@ if test "X$HDF_CXX" = "Xyes"; then
|
||||
c++/examples/Makefile"
|
||||
fi
|
||||
|
||||
# conditionally generate the high level makefiles
|
||||
# to do : fortran with hl
|
||||
|
||||
if test "X$HDF5_HL" = "Xyes"; then
|
||||
HL_FILES="hl/Makefile
|
||||
hl/src/Makefile
|
||||
hl/test/Makefile"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
AC_CONFIG_FILES([src/libhdf5.settings
|
||||
config/depend1
|
||||
config/depend2
|
||||
@ -2922,7 +2953,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
|
||||
tools/misc/h5cc
|
||||
tools/gifconv/Makefile
|
||||
tools/h5jam/Makefile
|
||||
tools/h5jam/testh5jam.sh
|
||||
tools/h5jam/testh5jam.sh
|
||||
examples/Makefile
|
||||
doc/Makefile
|
||||
doc/html/Makefile
|
||||
@ -2939,7 +2970,8 @@ AC_CONFIG_FILES([src/libhdf5.settings
|
||||
doc/html/cpplus/Makefile
|
||||
doc/html/fortran/Makefile
|
||||
$FORTRAN_FILES
|
||||
$CXX_FILES])
|
||||
$CXX_FILES
|
||||
$HL_FILES])
|
||||
|
||||
AC_OUTPUT
|
||||
no_create=$saved_no_create
|
||||
@ -3157,3 +3189,7 @@ IF_ENABLED_DISABLED "$STREAM_VFD"
|
||||
|
||||
PRINT_N " Threadsafety"
|
||||
IF_ENABLED_DISABLED "$THREADSAFE"
|
||||
|
||||
PRINT_N " High Level library"
|
||||
IF_ENABLED_DISABLED "$HDF5_HL"
|
||||
|
||||
|
101
hl/Makefile.in
Executable file
101
hl/Makefile.in
Executable file
@ -0,0 +1,101 @@
|
||||
## Top-level HDF5 Makefile(.in)
|
||||
##
|
||||
## Copyright (C) 2001 National Center for Supercomputing Applications.
|
||||
## All rights reserved.
|
||||
##
|
||||
##
|
||||
## This makefile mostly just reinvokes make in the various subdirectories
|
||||
## but does so in the correct order. You can alternatively invoke make from
|
||||
## each subdirectory manually.
|
||||
##
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=..
|
||||
srcdir=@srcdir@
|
||||
|
||||
|
||||
# Subdirectories in build-order
|
||||
SUBDIRS=src test
|
||||
|
||||
##############################################################################
|
||||
## T A R G E T S
|
||||
##
|
||||
## all: Build libraries, header files, tests, and programs in the
|
||||
## various subdirectories but does not run tests or install the
|
||||
## library, header files, or programs. The components can be
|
||||
## built individually with the targets lib, progs, and tests.
|
||||
## check: Test the uninstalled library to make sure it works. You may
|
||||
## also say `test' or `_test' (`test' doesn't work from the top
|
||||
## level directory for some versions of make because `test' is
|
||||
## also a directory).
|
||||
## install: Installs libraries, header files, programs, and documentation
|
||||
## in the various directories under the prefix directory (lib,
|
||||
## include, bin, man, info). Use the `--prefix=PATH' option
|
||||
## to `configure' (or `config.status') or say `--help' for
|
||||
## other alternatives. The default prefix is `/usr/local'.
|
||||
## uninstall: Delete all the installed files that the `install' target
|
||||
## created (but not the noninstalled files such as `make all'
|
||||
## created).
|
||||
## clean: Removes temporary files except those that record the
|
||||
## configuration and those that are part of the distribution.
|
||||
## mostlyclean: Like `clean' except it doesn't delete a few files like
|
||||
## libraries, programs, and/or generated header files because
|
||||
## regenerating them is rarely necessary and takes a lot of time.
|
||||
## distclean: Deletes all files that are created by configuring or building
|
||||
## HDF5. If you have unpacked the source and built HDF5 without
|
||||
## creating any other files, then `make distclean' will leave
|
||||
## only the files that were in the distrubution.
|
||||
## maintainer-clean:
|
||||
## Like `distclean' except it deletes more files. It deletes
|
||||
## all generated files. This target is not intended for normal
|
||||
## users; it deletes files that may require special tools to
|
||||
## rebuild.
|
||||
## TAGS: Updates the tags table for this program.
|
||||
## dep depend: Builds dependencies in all subdirectories. These targets
|
||||
## might not be available on certain combinations of make
|
||||
## programs and C compilers. At the other extreme, the GNU
|
||||
## make used in combination with gcc will maintain dependency
|
||||
## information automatically.
|
||||
lib progs check test _test uninstall:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
(cd $$d && $(MAKE) $@) || exit 1; \
|
||||
done
|
||||
|
||||
tests TAGS dep depend:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
(cd $$d && $(MAKE) $@) || exit 1; \
|
||||
done
|
||||
|
||||
install:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
(cd $$d && $(MAKE) $@) || exit 1; \
|
||||
done
|
||||
@$(LT) --mode=finish $(libdir);
|
||||
|
||||
install-doc:
|
||||
(cd doc && $(MAKE) $@) || exit 1;
|
||||
|
||||
uninstall-doc:
|
||||
(cd doc && $(MAKE) $@) || exit 1;
|
||||
|
||||
.PHONY: all lib progs test _test install uninstall dep depend clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
clean mostlyclean:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
(cd $$d && $(MAKE) $@); \
|
||||
done
|
||||
|
||||
distclean:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
(cd $$d && $(MAKE) $@); \
|
||||
done
|
||||
-$(RM) Makefile
|
||||
|
||||
maintainer-clean:
|
||||
@echo "This target is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
(cd $$d && $(MAKE) $@); \
|
||||
done
|
||||
|
||||
|
14
hl/src/Dependencies
Normal file
14
hl/src/Dependencies
Normal file
@ -0,0 +1,14 @@
|
||||
## This file is machine generated on GNU systems.
|
||||
## Only temporary changes may be made here.
|
||||
|
||||
H5IM.lo: \
|
||||
$(srcdir)/H5IM.c \
|
||||
$(srcdir)/H5IM.h \
|
||||
$(srcdir)/H5LT.h
|
||||
H5LT.lo: \
|
||||
$(srcdir)/H5LT.c \
|
||||
$(srcdir)/H5LT.h
|
||||
H5TB.lo: \
|
||||
$(srcdir)/H5TB.c \
|
||||
$(srcdir)/H5TB.h \
|
||||
$(srcdir)/H5LT.h
|
25
hl/src/H5HL.h
Normal file
25
hl/src/H5HL.h
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
/****************************************************************************
|
||||
* NCSA HDF *
|
||||
* Scientific Data Technologies *
|
||||
* National Center for Supercomputing Applications *
|
||||
* University of Illinois at Urbana-Champaign *
|
||||
* 605 E. Springfield, Champaign IL 61820 *
|
||||
* *
|
||||
* For conditions of distribution and use, see the accompanying *
|
||||
* hdf/COPYING file. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef _H5HL_H
|
||||
#define _H5HL_H
|
||||
|
||||
#include "H5LT.h"
|
||||
#include "H5IM.h"
|
||||
#include "H5TA.h"
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
1264
hl/src/H5IM.c
Normal file
1264
hl/src/H5IM.c
Normal file
File diff suppressed because it is too large
Load Diff
91
hl/src/H5IM.h
Normal file
91
hl/src/H5IM.h
Normal file
@ -0,0 +1,91 @@
|
||||
|
||||
/****************************************************************************
|
||||
* NCSA HDF *
|
||||
* Scientific Data Technologies *
|
||||
* National Center for Supercomputing Applications *
|
||||
* University of Illinois at Urbana-Champaign *
|
||||
* 605 E. Springfield, Champaign IL 61820 *
|
||||
* *
|
||||
* For conditions of distribution and use, see the accompanying *
|
||||
* hdf/COPYING file. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef _H5IM_H
|
||||
#define _H5IM_H
|
||||
|
||||
#include "H5LT.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
herr_t H5IMmake_image_8bit( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t width,
|
||||
hsize_t height,
|
||||
const unsigned char *buffer );
|
||||
|
||||
herr_t H5IMmake_image_24bit( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t width,
|
||||
hsize_t height,
|
||||
const char *interlace,
|
||||
const unsigned char *buffer );
|
||||
|
||||
herr_t H5IMget_image_info( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t *width,
|
||||
hsize_t *height,
|
||||
hsize_t *planes,
|
||||
char *interlace,
|
||||
hssize_t *npals );
|
||||
|
||||
herr_t H5IMread_image( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
unsigned char *buffer );
|
||||
|
||||
|
||||
|
||||
herr_t H5IMmake_palette( hid_t loc_id,
|
||||
const char *pal_name,
|
||||
const hsize_t *pal_dims,
|
||||
const unsigned char *pal_data );
|
||||
|
||||
herr_t H5IMlink_palette( hid_t loc_id,
|
||||
const char *image_name,
|
||||
const char *pal_name );
|
||||
|
||||
herr_t H5IMunlink_palette( hid_t loc_id,
|
||||
const char *image_name,
|
||||
const char *pal_name );
|
||||
|
||||
herr_t H5IMget_npalettes( hid_t loc_id,
|
||||
const char *image_name,
|
||||
hssize_t *npals );
|
||||
|
||||
herr_t H5IMget_palette_info( hid_t loc_id,
|
||||
const char *image_name,
|
||||
int pal_number,
|
||||
hsize_t *pal_dims );
|
||||
|
||||
|
||||
herr_t H5IMget_palette( hid_t loc_id,
|
||||
const char *image_name,
|
||||
int pal_number,
|
||||
unsigned char *pal_data );
|
||||
|
||||
herr_t H5IMis_image( hid_t loc_id,
|
||||
const char *dset_name );
|
||||
|
||||
herr_t H5IMis_palette( hid_t loc_id,
|
||||
const char *dset_name );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
2716
hl/src/H5LT.c
Normal file
2716
hl/src/H5LT.c
Normal file
File diff suppressed because it is too large
Load Diff
374
hl/src/H5LT.h
Normal file
374
hl/src/H5LT.h
Normal file
@ -0,0 +1,374 @@
|
||||
|
||||
/****************************************************************************
|
||||
* NCSA HDF *
|
||||
* Scientific Data Technologies *
|
||||
* National Center for Supercomputing Applications *
|
||||
* University of Illinois at Urbana-Champaign *
|
||||
* 605 E. Springfield, Champaign IL 61820 *
|
||||
* *
|
||||
* For conditions of distribution and use, see the accompanying *
|
||||
* hdf/COPYING file. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef _H5LT_H
|
||||
#define _H5LT_H
|
||||
|
||||
#include <hdf5.h>
|
||||
|
||||
#define TESTING(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
|
||||
#define PASSED() {puts(" PASSED");fflush(stdout);}
|
||||
#define H5_FAILED() {puts("*FAILED*");fflush(stdout);}
|
||||
#define SKIPPED() {puts(" -SKIP-");fflush(stdout);}
|
||||
#define EXAMPLE(WHAT) {printf("%-70s", "Example " WHAT); fflush(stdout);}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Make dataset functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5LTmake_dataset( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int rank,
|
||||
const hsize_t *dims,
|
||||
hid_t type_id,
|
||||
const void *buffer );
|
||||
|
||||
herr_t H5LTmake_dataset_char( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int rank,
|
||||
const hsize_t *dims,
|
||||
const char *buffer );
|
||||
|
||||
herr_t H5LTmake_dataset_short( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int rank,
|
||||
const hsize_t *dims,
|
||||
const short *buffer );
|
||||
|
||||
herr_t H5LTmake_dataset_int( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int rank,
|
||||
const hsize_t *dims,
|
||||
const int *buffer );
|
||||
|
||||
herr_t H5LTmake_dataset_long( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int rank,
|
||||
const hsize_t *dims,
|
||||
const long *buffer );
|
||||
|
||||
herr_t H5LTmake_dataset_float( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int rank,
|
||||
const hsize_t *dims,
|
||||
const float *buffer );
|
||||
|
||||
herr_t H5LTmake_dataset_double( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int rank,
|
||||
const hsize_t *dims,
|
||||
const double *buffer );
|
||||
|
||||
herr_t H5LTmake_dataset_string(hid_t loc_id,
|
||||
const char *dset_name,
|
||||
const char *buf );
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Read dataset functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5LTread_dataset( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hid_t type_id,
|
||||
void *buffer );
|
||||
|
||||
herr_t H5LTread_dataset_char( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
char *buffer );
|
||||
|
||||
herr_t H5LTread_dataset_short( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
short *buffer );
|
||||
|
||||
herr_t H5LTread_dataset_int( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int *buffer );
|
||||
|
||||
herr_t H5LTread_dataset_long( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
long *buffer );
|
||||
|
||||
herr_t H5LTread_dataset_float( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
float *buffer );
|
||||
|
||||
herr_t H5LTread_dataset_double( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
double *buffer );
|
||||
|
||||
herr_t H5LTread_dataset_string( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
char *buf );
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Query dataset functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
herr_t H5LTget_dataset_ndims( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
int *rank );
|
||||
|
||||
herr_t H5LTget_dataset_info( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t *dims,
|
||||
H5T_class_t *type_class,
|
||||
size_t *type_size );
|
||||
|
||||
herr_t H5LTfind_dataset( hid_t loc_id, const char *name );
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Set attribute functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
herr_t H5LTset_attribute_string( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const char *attr_data );
|
||||
|
||||
herr_t H5LTset_attribute_char( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const char *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_uchar( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const unsigned char *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_short( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const short *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_ushort( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const unsigned short *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_int( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const int *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_uint( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const unsigned int *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_long( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const long *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_ulong( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const unsigned long *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_float( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const float *buffer,
|
||||
size_t size );
|
||||
|
||||
herr_t H5LTset_attribute_double( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
const double *buffer,
|
||||
size_t size );
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Get attribute functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5LTget_attribute( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
hid_t mem_type_id,
|
||||
void *data );
|
||||
|
||||
herr_t H5LTget_attribute_string( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
char *data );
|
||||
|
||||
herr_t H5LTget_attribute_char( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
char *data );
|
||||
|
||||
herr_t H5LTget_attribute_uchar( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
unsigned char *data );
|
||||
|
||||
herr_t H5LTget_attribute_short( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
short *data );
|
||||
|
||||
herr_t H5LTget_attribute_ushort( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
unsigned short *data );
|
||||
|
||||
herr_t H5LTget_attribute_int( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
int *data );
|
||||
|
||||
herr_t H5LTget_attribute_uint( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
unsigned int *data );
|
||||
|
||||
herr_t H5LTget_attribute_long( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
long *data );
|
||||
|
||||
herr_t H5LTget_attribute_ulong( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
unsigned long *data );
|
||||
|
||||
herr_t H5LTget_attribute_float( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
float *data );
|
||||
|
||||
herr_t H5LTget_attribute_double( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
double *data );
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Query attribute functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
herr_t H5LTget_attribute_ndims( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
int *rank );
|
||||
|
||||
herr_t H5LTget_attribute_info( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
hsize_t *dims,
|
||||
H5T_class_t *type_class,
|
||||
size_t *type_size );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* General functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[],
|
||||
const size_t *field_offset, const hid_t *field_types );
|
||||
|
||||
|
||||
herr_t H5LTrepack( hsize_t nfields,
|
||||
hsize_t nrecords,
|
||||
size_t src_size,
|
||||
const size_t *src_offset,
|
||||
const size_t *src_sizes,
|
||||
size_t dst_size,
|
||||
const size_t *dst_offset,
|
||||
const size_t *dst_sizes,
|
||||
unsigned char *src_buf,
|
||||
unsigned char *dst_buf );
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Private functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
herr_t H5LT_get_attribute_mem( hid_t obj_id,
|
||||
const char *attr_name,
|
||||
hid_t mem_type_id,
|
||||
void *data );
|
||||
|
||||
herr_t H5LT_get_attribute_disk( hid_t obj_id,
|
||||
const char *attr_name,
|
||||
void *data );
|
||||
|
||||
herr_t H5LT_find_attribute( hid_t loc_id, const char *name );
|
||||
|
||||
|
||||
herr_t H5LT_set_attribute_numerical( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
size_t size,
|
||||
hid_t type_id,
|
||||
const void *data );
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
3689
hl/src/H5TA.c
Normal file
3689
hl/src/H5TA.c
Normal file
File diff suppressed because it is too large
Load Diff
246
hl/src/H5TA.h
Normal file
246
hl/src/H5TA.h
Normal file
@ -0,0 +1,246 @@
|
||||
|
||||
/****************************************************************************
|
||||
* NCSA HDF *
|
||||
* Scientific Data Technologies *
|
||||
* National Center for Supercomputing Applications *
|
||||
* University of Illinois at Urbana-Champaign *
|
||||
* 605 E. Springfield, Champaign IL 61820 *
|
||||
* *
|
||||
* For conditions of distribution and use, see the accompanying *
|
||||
* hdf/COPYING file. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef _H5TB_H
|
||||
#define _H5TB_H
|
||||
|
||||
#if 0
|
||||
#define H5_TB_DEBUG
|
||||
#endif
|
||||
|
||||
#include "H5LT.h"
|
||||
|
||||
#define HLTB_MAX_FIELD_LEN 255
|
||||
|
||||
#if !defined(MAX)
|
||||
#define MAX(X,Y) ((X)>(Y)?(X):(Y))
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Create functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5TBmake_table( const char *table_title,
|
||||
hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t nfields,
|
||||
hsize_t nrecords,
|
||||
size_t type_size,
|
||||
const char *field_names[],
|
||||
const size_t *field_offset,
|
||||
const hid_t *field_types,
|
||||
hsize_t chunk_size,
|
||||
void *fill_data,
|
||||
int compress,
|
||||
const void *data );
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Write functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5TBappend_records( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t nrecords,
|
||||
size_t type_size,
|
||||
const size_t *field_offset,
|
||||
const size_t *dst_sizes,
|
||||
const void *data );
|
||||
|
||||
herr_t H5TBwrite_records( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t start,
|
||||
hsize_t nrecords,
|
||||
size_t type_size,
|
||||
const size_t *field_offset,
|
||||
const size_t *dst_sizes,
|
||||
const void *data );
|
||||
|
||||
|
||||
herr_t H5TBwrite_fields_name( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
const char *field_names,
|
||||
hsize_t start,
|
||||
hsize_t nrecords,
|
||||
size_t type_size,
|
||||
const size_t *field_offset,
|
||||
const size_t *dst_sizes,
|
||||
const void *data );
|
||||
|
||||
herr_t H5TBwrite_fields_index( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t nfields,
|
||||
const int *field_index,
|
||||
hsize_t start,
|
||||
hsize_t nrecords,
|
||||
size_t type_size,
|
||||
const size_t *field_offset,
|
||||
const size_t *dst_sizes,
|
||||
const void *data );
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Read functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
herr_t H5TBread_table( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
size_t dst_size,
|
||||
const size_t *dst_offset,
|
||||
const size_t *dst_sizes,
|
||||
void *dst_buf );
|
||||
|
||||
|
||||
herr_t H5TBread_fields_name( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
const char *field_names,
|
||||
hsize_t start,
|
||||
hsize_t nrecords,
|
||||
size_t type_size,
|
||||
const size_t *field_offset,
|
||||
const size_t *dst_sizes,
|
||||
void *data );
|
||||
|
||||
herr_t H5TBread_fields_index( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t nfields,
|
||||
const int *field_index,
|
||||
hsize_t start,
|
||||
hsize_t nrecords,
|
||||
size_t type_size,
|
||||
const size_t *field_offset,
|
||||
const size_t *dst_sizes,
|
||||
void *data );
|
||||
|
||||
|
||||
herr_t H5TBread_records( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t start,
|
||||
hsize_t nrecords,
|
||||
size_t type_size,
|
||||
const size_t *dst_offset,
|
||||
const size_t *dst_sizes,
|
||||
void *data );
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Inquiry functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
herr_t H5TBget_table_info ( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t *nfields,
|
||||
hsize_t *nrecords );
|
||||
|
||||
herr_t H5TBget_field_info( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
char *field_names[],
|
||||
size_t *field_sizes,
|
||||
size_t *field_offsets,
|
||||
size_t *type_size );
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Manipulation functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
herr_t H5TBdelete_record( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t start,
|
||||
hsize_t nrecords );
|
||||
|
||||
|
||||
herr_t H5TBinsert_record( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hsize_t start,
|
||||
hsize_t nrecords,
|
||||
size_t dst_size,
|
||||
const size_t *dst_offset,
|
||||
const size_t *dst_sizes,
|
||||
void *data );
|
||||
|
||||
herr_t H5TBadd_records_from( hid_t loc_id,
|
||||
const char *dset_name1,
|
||||
hsize_t start1,
|
||||
hsize_t nrecords,
|
||||
const char *dset_name2,
|
||||
hsize_t start2 );
|
||||
|
||||
herr_t H5TBcombine_tables( hid_t loc_id1,
|
||||
const char *dset_name1,
|
||||
hid_t loc_id2,
|
||||
const char *dset_name2,
|
||||
const char *dset_name3 );
|
||||
|
||||
herr_t H5TBinsert_field( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
const char *field_name,
|
||||
hid_t field_type,
|
||||
hsize_t position,
|
||||
const void *fill_data,
|
||||
const void *data );
|
||||
|
||||
herr_t H5TBdelete_field( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
const char *field_name );
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Table attribute functions
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5TBAget_title( hid_t loc_id,
|
||||
char *table_title );
|
||||
|
||||
herr_t H5TBAget_fill( hid_t loc_id,
|
||||
const char *dset_name,
|
||||
hid_t dset_id,
|
||||
unsigned char *dst_buf );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
34
hl/src/Makefile.in
Normal file
34
hl/src/Makefile.in
Normal file
@ -0,0 +1,34 @@
|
||||
## HDF5 Library Makefile(.in)
|
||||
##
|
||||
## Copyright (C) 2001 National Center for Supercomputing Applications.
|
||||
## All rights reserved.
|
||||
##
|
||||
##
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=../..
|
||||
srcdir=@srcdir@
|
||||
@COMMENCE@
|
||||
|
||||
## Add `-I.' to the C preprocessor flags.
|
||||
CPPFLAGS=-I. -I$(srcdir) -I$(top_builddir)/src -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib @CPPFLAGS@
|
||||
|
||||
## This is our main target, but also remove the settings file when cleaning.
|
||||
LIB=libhdf5_hl.la
|
||||
LIBHDF5=$(top_builddir)/src/libhdf5.la
|
||||
CLEAN=
|
||||
|
||||
## Source and object files for the library (lexicographically)...
|
||||
LIB_SRC=H5LT.c H5TA.c H5IM.c
|
||||
|
||||
LIB_OBJ=$(LIB_SRC:.c=.lo)
|
||||
|
||||
## Temporary files
|
||||
MOSTLYCLEAN=
|
||||
|
||||
## Public header files (to be installed)...
|
||||
PUB_HDR=H5IM.h H5LT.h H5TA.h H5HL.h
|
||||
|
||||
## Other header files (not to be installed)...
|
||||
PRIVATE_HDR=
|
||||
|
||||
@CONCLUDE@
|
69
hl/test/Dependencies
Normal file
69
hl/test/Dependencies
Normal file
@ -0,0 +1,69 @@
|
||||
## This file is machine generated on GNU systems.
|
||||
## Only temporary changes may be made here.
|
||||
|
||||
lite_dset_test.lo: \
|
||||
$(srcdir)/lite_dset_test.c \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
lite_attr_test.lo: \
|
||||
$(srcdir)/lite_attr_test.c \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
image_test.lo: \
|
||||
$(srcdir)/image_test.c \
|
||||
$(top_srcdir)/src/H5IM.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
image_demo.lo: \
|
||||
$(srcdir)/image_demo.c \
|
||||
$(top_srcdir)/src/H5IM.h \
|
||||
$(top_srcdir)/src/H5LT.h \
|
||||
$(srcdir)/pal_rgb.h
|
||||
image_make.lo: \
|
||||
$(srcdir)/image_make.c \
|
||||
$(top_srcdir)/src/H5IM.h \
|
||||
$(top_srcdir)/src/H5LT.h \
|
||||
$(srcdir)/pal_rgb.h
|
||||
make_table.lo: \
|
||||
$(srcdir)/make_table.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
append_record.lo: \
|
||||
$(srcdir)/append_record.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
write_record_fill.lo: \
|
||||
$(srcdir)/write_record_fill.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
field_names.lo: \
|
||||
$(srcdir)/field_names.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
field_index.lo: \
|
||||
$(srcdir)/field_index.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
query_table.lo: \
|
||||
$(srcdir)/query_table.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
insert_record.lo: \
|
||||
$(srcdir)/insert_record.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
delete_record.lo: \
|
||||
$(srcdir)/delete_record.c
|
||||
add_record_from.lo: \
|
||||
$(srcdir)/add_record_from.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
combine_tables.lo: \
|
||||
$(srcdir)/combine_tables.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
insert_field.lo: \
|
||||
$(srcdir)/insert_field.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
||||
delete_field.lo: \
|
||||
$(srcdir)/delete_field.c \
|
||||
$(top_srcdir)/src/H5TB.h \
|
||||
$(top_srcdir)/src/H5LT.h
|
65
hl/test/Makefile.in
Normal file
65
hl/test/Makefile.in
Normal file
@ -0,0 +1,65 @@
|
||||
## HDF5 Library Test Makefile(.in)
|
||||
##
|
||||
## Copyright (C) 2001 National Center for Supercomputing Applications.
|
||||
## All rights reserved.
|
||||
##
|
||||
##
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=../..
|
||||
srcdir=@srcdir@
|
||||
@COMMENCE@
|
||||
|
||||
## Add include directory to the C preprocessor flags and the h5test and hdf5
|
||||
## libraries to the library list.
|
||||
CPPFLAGS=-I. -I$(srcdir) -I../src -I$(top_srcdir)/src @CPPFLAGS@
|
||||
|
||||
## These are our main targets. They should be listed in the order to be
|
||||
## executed, generally most specific tests to least specific tests.
|
||||
RUNTEST=$(LT_RUN)
|
||||
|
||||
TEST_PROGS=test_lite test_image test_table
|
||||
|
||||
## The libh5test.a library provides common support code for the tests. We link
|
||||
## this library statically because some systems can only link executables to
|
||||
## a single shared library and libhdf5 is much bigger than libh5test.
|
||||
LIBHDF5=$(top_builddir)/src/libhdf5.la
|
||||
LIBHDF5_HL=../src/libhdf5_hl.la
|
||||
LIB_SRC=
|
||||
LIB_OBJ=$(LIB_SRC:.c=.lo)
|
||||
PUB_LIB=
|
||||
|
||||
## Temporary files. These files are the ones created by setting the
|
||||
## HDF5_NOCLEANUP environment variable and running `make test' without
|
||||
## specifying a file prefix or low-level driver. Changing the file
|
||||
## prefix or low-level driver with environment variables will influence
|
||||
## the temporary file name in ways that the makefile is not aware of.
|
||||
MOSTLYCLEAN=$(TEST_PROGS)
|
||||
CLEAN=*.h5
|
||||
|
||||
## Source and object files for programs... The TEST_SRC list contains all the
|
||||
## source files and is used for things like dependencies, archiving, etc. The
|
||||
## other source lists are for the individual tests, the files of which may
|
||||
## overlap with other tests.
|
||||
|
||||
TEST_SRC=test_lite.c test_image.c test_table.c
|
||||
|
||||
TEST_OBJ=$(TEST_SRC:.c=.lo)
|
||||
|
||||
## Private header files (not to be installed)...
|
||||
PRIVATE_HDR=
|
||||
|
||||
## How to build the tests... They all depend on the hdf5_hl and hdf5
|
||||
## libraries.
|
||||
$(TEST_PROGS): $(LIBHDF5_HL)
|
||||
|
||||
test_lite: test_lite.lo
|
||||
@$(LT_LINK_EXE) $(CFLAGS) -o $@ test_lite.lo $(LIBHDF5_HL) $(LIBHDF5) $(LDFLAGS) $(LIBS)
|
||||
|
||||
test_image: test_image.lo
|
||||
@$(LT_LINK_EXE) $(CFLAGS) -o $@ test_image.lo $(LIBHDF5_HL) $(LIBHDF5) $(LDFLAGS) $(LIBS)
|
||||
|
||||
test_table: test_table.lo
|
||||
@$(LT_LINK_EXE) $(CFLAGS) -o $@ test_table.lo $(LIBHDF5_HL) $(LIBHDF5) $(LDFLAGS) $(LIBS)
|
||||
|
||||
|
||||
@CONCLUDE@
|
196
hl/test/test_image.c
Normal file
196
hl/test/test_image.c
Normal file
@ -0,0 +1,196 @@
|
||||
|
||||
/****************************************************************************
|
||||
* NCSA HDF *
|
||||
* Scientific Data Technologies *
|
||||
* National Center for Supercomputing Applications *
|
||||
* University of Illinois at Urbana-Champaign *
|
||||
* 605 E. Springfield, Champaign IL 61820 *
|
||||
* *
|
||||
* For conditions of distribution and use, see the accompanying *
|
||||
* hdf/COPYING f. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "H5HL.h"
|
||||
|
||||
#define FILE_NAME "test_image.h5"
|
||||
#define WIDTH (hsize_t)500
|
||||
#define HEIGHT (hsize_t)200
|
||||
unsigned char image_in1 [ WIDTH*HEIGHT ];
|
||||
unsigned char image_out1[ WIDTH*HEIGHT ];
|
||||
unsigned char image_in2 [ WIDTH*HEIGHT*3 ];
|
||||
unsigned char image_out2[ WIDTH*HEIGHT*3 ];
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* the main program
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int main( void )
|
||||
{
|
||||
hid_t file_id;
|
||||
herr_t status;
|
||||
hsize_t width, height, planes;
|
||||
hsize_t pal_dims[] = {9,3};
|
||||
hsize_t pal_dims_out[2];
|
||||
hsize_t i;
|
||||
char interlace[20];
|
||||
hssize_t npals;
|
||||
herr_t is_image;
|
||||
herr_t is_palette;
|
||||
|
||||
unsigned char pal_data_out[9*3];
|
||||
/* create a 9 entry grey palette */
|
||||
unsigned char pal_data_in[9*3] = {0,0,0,
|
||||
25,25,25,
|
||||
50,50,50,
|
||||
75,75,75,
|
||||
100,100,100,
|
||||
125,125,125,
|
||||
150,150,150,
|
||||
175,175,175,
|
||||
200,200,200};
|
||||
|
||||
for (i = 0; i < WIDTH*HEIGHT; i++ )
|
||||
image_in1[i] = (unsigned char)i;
|
||||
for (i = 0; i < WIDTH*HEIGHT*3; i++)
|
||||
image_in2[i] = (unsigned char)i;
|
||||
|
||||
/* Create a new HDF5 file using default properties. */
|
||||
file_id = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT );
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Indexed image test
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
TESTING("indexed image");
|
||||
|
||||
/* Write image */
|
||||
if ( H5IMmake_image_8bit( file_id, "Image1", WIDTH, HEIGHT, image_in1 ) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Make a palette */
|
||||
if ( H5IMmake_palette( file_id, "Pallete", pal_dims, pal_data_in ) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Attach a palette to the image dataset */
|
||||
if ( H5IMlink_palette( file_id, "Image1", "Pallete" ) < 0 )
|
||||
goto out;
|
||||
|
||||
/* Read image */
|
||||
if ( H5IMget_image_info( file_id, "Image1", &width, &height, &planes, interlace, &npals ) < 0 )
|
||||
goto out;
|
||||
|
||||
if ( H5IMread_image( file_id, "Image1", image_out1 ) < 0 )
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < height*width*planes; i++) {
|
||||
if ( image_in1[i] != image_out1[i] ) {
|
||||
goto out;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
PASSED();
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* True color image test
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
TESTING("true color image");
|
||||
|
||||
/* Write image */
|
||||
if ( H5IMmake_image_24bit( file_id, "Image2", WIDTH, HEIGHT, "INTERLACE_PIXEL", image_in2 ) )
|
||||
goto out;
|
||||
|
||||
/* Read image */
|
||||
if ( H5IMget_image_info( file_id, "Image2", &width, &height, &planes, interlace, &npals ) < 0 )
|
||||
goto out;
|
||||
|
||||
if ( H5IMread_image( file_id, "Image2", image_out2 ) < 0 )
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < height*width*planes; i++) {
|
||||
if ( image_in2[i] != image_out2[i] ) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
PASSED();
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5IMget_npalettes test
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
TESTING("pallete functions");
|
||||
|
||||
if ( H5IMget_npalettes( file_id, "Image1", &npals ) < 0 )
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5IMget_palette_info test
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( H5IMget_palette_info( file_id, "Image1", 0, pal_dims_out ) < 0 )
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if ( pal_dims[i] != pal_dims_out[i] ) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5IMget_palette test
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( H5IMget_palette( file_id, "Image1", 0, pal_data_out ) < 0 )
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < 9*3; i++) {
|
||||
if ( pal_data_in[i] != pal_data_out[i] ) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5IMis_image test
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( (is_image = H5IMis_image( file_id, "Image1" )) < 0 )
|
||||
goto out;
|
||||
|
||||
if ( (is_image = H5IMis_image( file_id, "Image2" )) < 0 )
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5IMis_palette test
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( (is_palette = H5IMis_palette( file_id, "Pallete" )) < 0 )
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* end tests
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* Close the file. */
|
||||
status = H5Fclose( file_id );
|
||||
|
||||
PASSED();
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5_FAILED();
|
||||
return 1;
|
||||
|
||||
}
|
1069
hl/test/test_lite.c
Normal file
1069
hl/test/test_lite.c
Normal file
File diff suppressed because it is too large
Load Diff
1589
hl/test/test_table.c
Normal file
1589
hl/test/test_table.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
hl/test/test_table_be.hdf5
Normal file
BIN
hl/test/test_table_be.hdf5
Normal file
Binary file not shown.
BIN
hl/test/test_table_cray.hdf5
Normal file
BIN
hl/test/test_table_cray.hdf5
Normal file
Binary file not shown.
BIN
hl/test/test_table_le.hdf5
Normal file
BIN
hl/test/test_table_le.hdf5
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user