mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
[svn-r335] Changes since 19980330
---------------------- ./MANIFEST ./src/Makefile.in ./test/Makefile.in Added new files. ./config/linux ./src/H5HL.c ./src/H5HLprivate.h ./src/H5MF.c ./src/H5MFprivate.h Added `-DH5HL_DEBUG -DH5MF_DEBUG' to the debug list. ./html/H5.format.html Updated shared object message information. ./src/H5D.c Datasets can now share data types. ./src/H5F.c Updated a comment that referred to H5ACC_WRITE. ./src/H5HG.c ./src/H5HGprivate.h Moved a few things around. Made debugging better so you can now give a collection address to ./src/debug and it shows some useful stuff. ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Onull.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c [NEW] ./src/H5Ostab.c Supports shared messages. ./src/H5T.c ./src/H5Tpkg.h ./src/H5Tprivate.h ./src/H5Tpublic.h The H5Tshare() function allows the user to give the library hints about how a data type will be used. ./test/shtype.c Tests the H5Tshare() function. ./test/gheap.c Tests the global heap. ./configure.in ./config/BlankForm [NEW] ./config/alpha-dec ./config/freebsd2.2.1 ./config/hpux10.20 ./config/irix6.2 ./config/irix64 ./config/linux ./config/powerpc-ibm-aix4.2.1.0 ./config/rs6000-ibm-aix4.1.4.0 ./config/solaris2.5 Cleaned up lots of configuration stuff and made the site configuration files lots easier and more uniform. To make a new file grab the BlankForm and modify it. By default, debugging is turned on for most packages. Within a package one can use `#ifdef H5AC_DEBUG' to wrap debugging code. Other options are: --enable-debug --enable-debug=yes The default, most but not all packages. --disable-debug --enable-debug=no --enable-debug=none The symbol NDEBUG is defined and none of the package debug symbols. --enable-debug=all Debugging is turned on for all packages. This might produce lots of output. --enable-debug=g,d Debugging is turned on for H5G and H5D. A compile mode is also now supported --enable-production --enable-production=yes The library is compiled with optimizations turned on. The compiler flags are augmented by adding PROD_CFLAGS and PROD_CPPFLAGS which are defined in the site config file. --disable-production --enable-production=no The default. The library is compiled for development by including DEBUG_CFLAGS and DEBUG_CPPFLAGS defined in the site config file. This is usually just `-g'. --enable-production=profile --enable-production=pg Builds a library for profiling by including the flags from PROFILE_CFLAGS and PROFILE_CPPFLAGS defined in the site config file. This is usullay just `-pg' but it could include optimization flags as well depending on the type of profile one wants. In summary, configure by saying `./configure' and you'll get a development version of the library. Configure by saying `./configure --enable-production --disable-debug' and you'll get a production version with no debugging code.
This commit is contained in:
parent
2a77c19b22
commit
a780cdd178
3
MANIFEST
3
MANIFEST
@ -15,6 +15,7 @@
|
||||
./bin/errors
|
||||
./bin/install-sh
|
||||
./bin/release
|
||||
./config/BlankForm
|
||||
./config/alpha-dec
|
||||
./config/commence.in
|
||||
./config/conclude.in
|
||||
@ -158,6 +159,7 @@
|
||||
./src/H5Oprivate.h
|
||||
./src/H5Opublic.h
|
||||
./src/H5Osdspace.c
|
||||
./src/H5Oshared.c
|
||||
./src/H5Ostab.c
|
||||
./src/H5P.c
|
||||
./src/H5Pprivate.h
|
||||
@ -189,6 +191,7 @@
|
||||
./test/dtypes.c
|
||||
./test/extend.c
|
||||
./test/external.c
|
||||
./test/gheap.c
|
||||
./test/hyperslab.c
|
||||
./test/iopipe.c
|
||||
./test/istore.c
|
||||
|
43
config/BlankForm
Normal file
43
config/BlankForm
Normal file
@ -0,0 +1,43 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
# Sometimes a particular compiler must be used. If that's the case
|
||||
# then uncomment the following line. Otherwise the main configure
|
||||
# script will try to detect the compiler automatically.
|
||||
#CC=gcc
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
#CFLAGS="$CFLAGS -ansi"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=-O
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
@ -1,54 +1,38 @@
|
||||
#!/bin/sh
|
||||
# Site configuration -- do not distribute this file.
|
||||
|
||||
|
||||
# Based on the setting of environment variable `HDF5_MODE' we set the
|
||||
# compiler flags unless they're already set. Its value can be one or
|
||||
# more of the following words (be sure to use single quotes when
|
||||
# setting its value or the dollar signs will be expanded as variables
|
||||
# too soon):
|
||||
#
|
||||
# $warn -- Generates compiler warnings. You should always
|
||||
# include this since it has no effect on the speed of
|
||||
# the code produced.
|
||||
#
|
||||
# $debug -- Compiles in code to check for invariant conditions
|
||||
# and turns on the `-g' flag for interactive
|
||||
# debugging. It also turns off seek optimizations in
|
||||
# the low-level file driver. This version of the
|
||||
# library can be significantly slower than a production
|
||||
# version.
|
||||
#
|
||||
# $production -- Compiles an optimized version of the library
|
||||
# and disables code that checks for invariant
|
||||
# conditions.
|
||||
#
|
||||
# $profile -- Compiles code with the `-pg' flag which
|
||||
# produces a `gmon.out' file when the library
|
||||
# runs. The gprof(1) command can read that file
|
||||
# and produce detailed run-time statistics.
|
||||
#
|
||||
# If HDF5_MODE is undefined then we use the value
|
||||
#
|
||||
# $debug $warn -DH5F_LOW_DFLT=H5F_LOW_SEC2
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
# Unconditionally set the compiler to gcc since the following flags
|
||||
# only apply to that compiler.
|
||||
CC=cc
|
||||
|
||||
warn=""
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
profile="-pg"
|
||||
# What must *always* be present for things to compile correctly?
|
||||
#CFLAGS="$CFLAGS -ansi"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
debug="-g -DH5AC_DEBUG -DH5B_DEBUG -DH5F_DEBUG -DH5G_DEBUG -UH5O_DEBUG -DH5T_DEBUG -DH5F_OPT_SEEK=0"
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
|
||||
|
||||
production="-O -DNDEBUG"
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=-O
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
default_mode='$debug $warn -DH5F_LOW_DFLT=H5F_LOW_SEC2'
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
# Don't set CFLAGS if the user already did.
|
||||
if test -z "$CFLAGS"; then
|
||||
CFLAGS="`eval echo ${HDF5_MODE:-$default_mode}`"
|
||||
export CFLAGS
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
@ -1,54 +1,6 @@
|
||||
#!/bin/sh
|
||||
# Site configuration -- do not distribute this file.
|
||||
# -*- shell-script -*-
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
# Based on the setting of environment variable `HDF5_MODE' we set the
|
||||
# compiler flags unless they're already set. Its value can be one or
|
||||
# more of the following words (be sure to use single quotes when
|
||||
# setting its value or the dollar signs will be expanded as variables
|
||||
# too soon):
|
||||
#
|
||||
# $warn -- Generates compiler warnings. You should always
|
||||
# include this since it has no effect on the speed of
|
||||
# the code produced.
|
||||
#
|
||||
# $debug -- Compiles in code to check for invariant conditions
|
||||
# and turns on the `-g' flag for interactive
|
||||
# debugging. It also turns off seek optimizations in
|
||||
# the low-level file driver. This version of the
|
||||
# library can be significantly slower than a production
|
||||
# version.
|
||||
#
|
||||
# $production -- Compiles an optimized version of the library
|
||||
# and disables code that checks for invariant
|
||||
# conditions.
|
||||
#
|
||||
# $profile -- Compiles code with the `-pg' flag which
|
||||
# produces a `gmon.out' file when the library
|
||||
# runs. The gprof(1) command can read that file
|
||||
# and produce detailed run-time statistics.
|
||||
#
|
||||
# If HDF5_MODE is undefined then we use the value
|
||||
#
|
||||
# $debug $warn -DH5F_LOW_DFLT=H5F_LOW_SEC2
|
||||
#
|
||||
|
||||
# Unconditionally set the compiler to gcc since the following flags
|
||||
# only apply to that compiler.
|
||||
CC=gcc
|
||||
|
||||
warn="-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
|
||||
|
||||
profile="-pg"
|
||||
|
||||
debug="-g -DH5AC_DEBUG -DH5B_DEBUG -DH5D_DEBUG -DH5F_DEBUG -DH5G_DEBUG -UH5O_DEBUG -DH5T_DEBUG -DH5F_OPT_SEEK=0 -fverbose-asm"
|
||||
|
||||
production="-O3 -DNDEBUG -finline-functions -funroll-loops -malign-double -fomit-frame-pointer"
|
||||
|
||||
default_mode='-ansi $debug $warn -DH5F_LOW_DFLT=H5F_LOW_SEC2'
|
||||
|
||||
# Don't set CFLAGS if the user already did.
|
||||
if test -z "$CFLAGS"; then
|
||||
CFLAGS="`eval echo ${HDF5_MODE:-$default_mode}`"
|
||||
export CFLAGS
|
||||
fi
|
||||
. config/linux
|
||||
|
@ -1,6 +1,38 @@
|
||||
# Site configuration -- do not distribute this file.
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
if test "x$CFLAGS" = "x"; then
|
||||
CFLAGS="-Ae"
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
CFLAGS="$CFLAGS -Ae"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
@ -1,6 +1,38 @@
|
||||
# Site configuration -- do not distribute this file.
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
if test "x$CFLAGS" = "x"; then
|
||||
CFLAGS="-ansi -n32"
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
CFLAGS="$CFLAGS -ansi -n32"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=-O
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
@ -1,27 +1,46 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
# Always turn off these warnings:
|
||||
# 1174: function declared but not used
|
||||
# 1429: the `long long' type is not standard
|
||||
# 1209: constant expressions
|
||||
# 1196: __vfork() (this is an SGI config problem)
|
||||
#
|
||||
CFLAGS="$CFLAGS -fullwarn -ansi -64 -woff 1174,1429,1209,1196"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=-O
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
#!/bin/sh
|
||||
# Site configuration -- do not distribute this file.
|
||||
|
||||
CC="cc -ansi -64"
|
||||
|
||||
# -woff 1174 about function declared but not used
|
||||
# -woff 1429 about long long type non-standard
|
||||
# -woff 1209 about constant expressions
|
||||
# -woff 1196 about __vfork() being implicitly declared, config prob.
|
||||
warn="-fullwarn -woff 1174,1429,1209,1196"
|
||||
#warn="-woff 1174,1429,1209,1196"
|
||||
|
||||
profile="-pg"
|
||||
|
||||
debug="-g"
|
||||
|
||||
#production="-O -DNDEBUG"
|
||||
|
||||
default_mode='$debug $warn'
|
||||
|
||||
RANLIB=: # SGI needs not ranlib
|
||||
|
||||
# Don't set CFLAGS if the user already did.
|
||||
if test -z "$CFLAGS"; then
|
||||
CFLAGS="`eval echo ${HDF5_MODE:-$default_mode}`"
|
||||
export CFLAGS
|
||||
fi
|
||||
|
89
config/linux
89
config/linux
@ -1,63 +1,38 @@
|
||||
#!/bin/sh
|
||||
# Site configuration -- do not distribute this file.
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
# Based on the setting of environment variable `HDF5_MODE' we set the
|
||||
# compiler flags unless they're already set. Its value can be one or
|
||||
# more of the following words (be sure to use single quotes when
|
||||
# setting its value or the dollar signs will be expanded as variables
|
||||
# too soon):
|
||||
#
|
||||
# $warn -- Generates compiler warnings. You should always
|
||||
# include this since it has no effect on the speed of
|
||||
# the code produced.
|
||||
#
|
||||
# $debug -- Compiles in code to check for invariant conditions
|
||||
# and turns on the `-g' flag for interactive
|
||||
# debugging. It also turns off seek optimizations in
|
||||
# the low-level file driver. This version of the
|
||||
# library can be significantly slower than a production
|
||||
# version.
|
||||
#
|
||||
# $production -- Compiles an optimized version of the library
|
||||
# and disables code that checks for invariant
|
||||
# conditions.
|
||||
#
|
||||
# $profile -- Compiles code with the `-pg' flag which
|
||||
# produces a `gmon.out' file when the library
|
||||
# runs. The gprof(1) command can read that file
|
||||
# and produce detailed run-time statistics.
|
||||
#
|
||||
# If HDF5_MODE is undefined then we use the value
|
||||
#
|
||||
# $debug $warn -DH5F_LOW_DFLT=H5F_LOW_SEC2
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
if [ arborea = `hostname` -a -z "$enable_parallel" ]; then
|
||||
enable_parallel=mpio
|
||||
fi
|
||||
# What must *always* be present for things to compile correctly?
|
||||
CFLAGS="$CFLAGS -ansi"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# The following flags only apply to the gcc compiler.
|
||||
CC=${CC:-gcc}
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS="-g -fverbose-asm"
|
||||
DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
|
||||
|
||||
# First set up the CFLAGS arguments.
|
||||
if test "X" = "X$CFLAGS"; then
|
||||
warn="-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
|
||||
profile="-pg"
|
||||
debug="-g -fverbose-asm"
|
||||
production="-O3 -finline-functions -funroll-loops -malign-double -fomit-frame-pointer"
|
||||
parallel=""
|
||||
default_mode='-ansi $debug $warn $parallel'
|
||||
CFLAGS="`eval echo ${HDF5_MODE:-$default_mode}`"
|
||||
fi
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS="-O3 -finline-functions -malign-double -fomit-frame-pointer"
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# Then set up the CPPFLAGS arguments.
|
||||
if test "X" = "X$CPPFLAGS"; then
|
||||
warn=
|
||||
profile=
|
||||
debug="-DH5AC_DEBUG -DH5B_DEBUG -DH5D_DEBUG -DH5F_DEBUG -DH5G_DEBUG -UH5O_DEBUG -DH5T_DEBUG -DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
|
||||
production="-DNDEBUG"
|
||||
parallel=""
|
||||
default_mode='$debug $warn $parallel'
|
||||
CPPFLAGS="`eval echo ${HDF5_MODE:-$default_mode}`"
|
||||
fi
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
@ -1 +1,39 @@
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'} # or 'no'
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
#CFLAGS="$CFLAGS -ansi"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
||||
|
@ -1 +1,39 @@
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'} # or 'no'
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
#CFLAGS="$CFLAGS -ansi"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
||||
|
@ -1,6 +1,41 @@
|
||||
# Site configuration -- do not distribute this file.
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# This file is part of the HDF5 build script. It is processed shortly
|
||||
# after configure starts and defines, among other things, flags for
|
||||
# the various compile modes.
|
||||
|
||||
if test "x$CFLAGS" = "x"; then
|
||||
CFLAGS="-Wall -g -O2"
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Compiler flags. The CPPFLAGS values should not include package debug
|
||||
# flags like `-DH5G_DEBUG' since these are added with the
|
||||
# `--enable-debug' switch of configure.
|
||||
|
||||
# We can only use gcc
|
||||
CC=gcc
|
||||
|
||||
# What must *always* be present for things to compile correctly?
|
||||
CFLAGS="$CFLAGS -ansi"
|
||||
#CPPFLAGS="$CPPFLAGS -I."
|
||||
|
||||
# What compiler flags should be used for code development?
|
||||
DEBUG_CFLAGS=-g
|
||||
DEBUG_CPPFLAGS=
|
||||
|
||||
# What compiler flags should be used for building a production
|
||||
# library?
|
||||
PROD_CFLAGS=-O2
|
||||
PROD_CPPFLAGS=
|
||||
|
||||
# What compiler flags enable code profiling?
|
||||
PROFILE_CFLAGS=-pg
|
||||
PROFILE_CPPFLAGS=
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Values for overriding configuration tests when cross compiling.
|
||||
# This includes compiling on some machines where the serial front end
|
||||
# compiles for a parallel back end.
|
||||
|
||||
# Set this to `yes' or `no' depending on whether the target is big
|
||||
# endian or little endian.
|
||||
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
|
265
configure
vendored
265
configure
vendored
@ -13,6 +13,13 @@ ac_help=
|
||||
ac_default_prefix=/usr/local
|
||||
# Any additions from configure.in:
|
||||
ac_help="$ac_help
|
||||
--enable-production=yes|no Determines how to run the compiler."
|
||||
ac_help="$ac_help
|
||||
--enable-debug=all Turn on debugging in all packages. One may also
|
||||
specify a comma-separated list of package names
|
||||
without the leading H5 or the word no. The default
|
||||
is most packages."
|
||||
ac_help="$ac_help
|
||||
--enable-parallel=mpio Enable parallel support with MPIO"
|
||||
|
||||
# Initialize some variables set by options.
|
||||
@ -548,7 +555,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking host system type""... $ac_c" 1>&6
|
||||
echo "configure:552: checking host system type" >&5
|
||||
echo "configure:559: checking host system type" >&5
|
||||
|
||||
host_alias=$host
|
||||
case "$host_alias" in
|
||||
@ -571,7 +578,7 @@ echo "$ac_t""$host" 1>&6
|
||||
|
||||
|
||||
echo $ac_n "checking for cached host""... $ac_c" 1>&6
|
||||
echo "configure:575: checking for cached host" >&5
|
||||
echo "configure:582: checking for cached host" >&5
|
||||
if eval "test \"`echo '$''{'hdf5_cv_host'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -590,7 +597,7 @@ fi
|
||||
|
||||
|
||||
echo $ac_n "checking for site config file""... $ac_c" 1>&6
|
||||
echo "configure:594: checking for site config file" >&5
|
||||
echo "configure:601: checking for site config file" >&5
|
||||
site_config="none"
|
||||
for f in $host \
|
||||
$host_vendor-$host_os \
|
||||
@ -613,7 +620,7 @@ fi
|
||||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:617: checking for $ac_word" >&5
|
||||
echo "configure:624: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -642,7 +649,7 @@ if test -z "$CC"; then
|
||||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:646: checking for $ac_word" >&5
|
||||
echo "configure:653: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -690,7 +697,7 @@ fi
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:701: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
@ -700,11 +707,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 704 "configure"
|
||||
#line 711 "configure"
|
||||
#include "confdefs.h"
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@ -724,12 +731,12 @@ if test $ac_cv_prog_cc_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:735: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:733: checking whether we are using GNU C" >&5
|
||||
echo "configure:740: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -738,7 +745,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
@ -753,7 +760,7 @@ if test $ac_cv_prog_gcc = yes; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:757: checking whether ${CC-cc} accepts -g" >&5
|
||||
echo "configure:764: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -781,7 +788,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
|
||||
echo "configure:785: checking whether ${MAKE-make} sets \${MAKE}" >&5
|
||||
echo "configure:792: checking whether ${MAKE-make} sets \${MAKE}" >&5
|
||||
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -818,7 +825,7 @@ fi
|
||||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
|
||||
echo "configure:822: checking for a BSD compatible install" >&5
|
||||
echo "configure:829: checking for a BSD compatible install" >&5
|
||||
if test -z "$INSTALL"; then
|
||||
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -870,7 +877,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
||||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:874: checking for $ac_word" >&5
|
||||
echo "configure:881: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -903,7 +910,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:907: checking for $ac_word" >&5
|
||||
echo "configure:914: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -936,7 +943,7 @@ fi
|
||||
|
||||
|
||||
echo $ac_n "checking for GNU Make""... $ac_c" 1>&6
|
||||
echo "configure:940: checking for GNU Make" >&5
|
||||
echo "configure:947: checking for GNU Make" >&5
|
||||
if test "`${MAKE-make} --version -f /dev/null 2>/dev/null |\
|
||||
sed -n 1p|cut -c1-8`" = "GNU Make"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
@ -945,10 +952,43 @@ else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for production mode""... $ac_c" 1>&6
|
||||
echo "configure:957: checking for production mode" >&5
|
||||
# Check whether --enable-production or --disable-production was given.
|
||||
if test "${enable_production+set}" = set; then
|
||||
enableval="$enable_production"
|
||||
:
|
||||
fi
|
||||
|
||||
|
||||
case "X-$enableval" in
|
||||
X-yes)
|
||||
echo "$ac_t"""production"" 1>&6
|
||||
CFLAGS="$CFLAGS $PROD_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PROD_CPPFLAGS"
|
||||
;;
|
||||
X-|X-no)
|
||||
echo "$ac_t"""development"" 1>&6
|
||||
CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DEBUG_CPPFLAGS"
|
||||
;;
|
||||
X-pg|X-profile)
|
||||
echo "$ac_t"""profile"" 1>&6
|
||||
CFLAGS="$CFLAGS $PROFILE_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PROFILE_CPPFLAGS"
|
||||
;;
|
||||
*)
|
||||
echo "$ac_t"""user-defined"" 1>&6
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if test Xyes = "X$GCC"; then
|
||||
CFLAGS="$CFLAGS -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for main in -lcoug""... $ac_c" 1>&6
|
||||
echo "configure:952: checking for main in -lcoug" >&5
|
||||
echo "configure:992: checking for main in -lcoug" >&5
|
||||
ac_lib_var=`echo coug'_'main | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -956,14 +996,14 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lcoug $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 960 "configure"
|
||||
#line 1000 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
main()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -992,7 +1032,7 @@ fi
|
||||
|
||||
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:996: checking how to run the C preprocessor" >&5
|
||||
echo "configure:1036: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@ -1007,13 +1047,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1011 "configure"
|
||||
#line 1051 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1024,13 +1064,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1028 "configure"
|
||||
#line 1068 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1053,12 +1093,12 @@ fi
|
||||
echo "$ac_t""$CPP" 1>&6
|
||||
|
||||
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
|
||||
echo "configure:1057: checking for ANSI C header files" >&5
|
||||
echo "configure:1097: checking for ANSI C header files" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1062 "configure"
|
||||
#line 1102 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
@ -1066,7 +1106,7 @@ else
|
||||
#include <float.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -1083,7 +1123,7 @@ rm -f conftest*
|
||||
if test $ac_cv_header_stdc = yes; then
|
||||
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1087 "configure"
|
||||
#line 1127 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <string.h>
|
||||
EOF
|
||||
@ -1101,7 +1141,7 @@ fi
|
||||
if test $ac_cv_header_stdc = yes; then
|
||||
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1105 "configure"
|
||||
#line 1145 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdlib.h>
|
||||
EOF
|
||||
@ -1122,7 +1162,7 @@ if test "$cross_compiling" = yes; then
|
||||
:
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1126 "configure"
|
||||
#line 1166 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h>
|
||||
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
|
||||
@ -1133,7 +1173,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
|
||||
exit (0); }
|
||||
|
||||
EOF
|
||||
if { (eval echo configure:1137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
@ -1160,17 +1200,17 @@ for ac_hdr in unistd.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:1164: checking for $ac_hdr" >&5
|
||||
echo "configure:1204: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1169 "configure"
|
||||
#line 1209 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -1199,12 +1239,12 @@ done
|
||||
|
||||
|
||||
echo $ac_n "checking for off_t""... $ac_c" 1>&6
|
||||
echo "configure:1203: checking for off_t" >&5
|
||||
echo "configure:1243: checking for off_t" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1208 "configure"
|
||||
#line 1248 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
@ -1232,12 +1272,12 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for size_t""... $ac_c" 1>&6
|
||||
echo "configure:1236: checking for size_t" >&5
|
||||
echo "configure:1276: checking for size_t" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1241 "configure"
|
||||
#line 1281 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
@ -1270,12 +1310,12 @@ fi
|
||||
for ac_func in getpwuid gethostname system
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:1274: checking for $ac_func" >&5
|
||||
echo "configure:1314: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1279 "configure"
|
||||
#line 1319 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
@ -1298,7 +1338,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
@ -1324,24 +1364,24 @@ done
|
||||
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1328 "configure"
|
||||
#line 1368 "configure"
|
||||
#include "confdefs.h"
|
||||
#include<sys/types.h>
|
||||
int main() {
|
||||
off64_t n = 0;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
for ac_func in lseek64 fseek64
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:1340: checking for $ac_func" >&5
|
||||
echo "configure:1380: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1345 "configure"
|
||||
#line 1385 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
@ -1364,7 +1404,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
@ -1398,14 +1438,14 @@ rm -f conftest*
|
||||
|
||||
|
||||
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
|
||||
echo "configure:1402: checking whether byte ordering is bigendian" >&5
|
||||
echo "configure:1442: checking whether byte ordering is bigendian" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_cv_c_bigendian=unknown
|
||||
# See if sys/param.h defines the BYTE_ORDER macro.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1409 "configure"
|
||||
#line 1449 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
@ -1416,11 +1456,11 @@ int main() {
|
||||
#endif
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
# It does; now see whether it defined to BIG_ENDIAN or not.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1424 "configure"
|
||||
#line 1464 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
@ -1431,7 +1471,7 @@ int main() {
|
||||
#endif
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_c_bigendian=yes
|
||||
else
|
||||
@ -1451,7 +1491,7 @@ if test "$cross_compiling" = yes; then
|
||||
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1455 "configure"
|
||||
#line 1495 "configure"
|
||||
#include "confdefs.h"
|
||||
main () {
|
||||
/* Are we little or big endian? From Harbison&Steele. */
|
||||
@ -1464,7 +1504,7 @@ main () {
|
||||
exit (u.c[sizeof (long) - 1] == 1);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_c_bigendian=no
|
||||
else
|
||||
@ -1488,7 +1528,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking size of short""... $ac_c" 1>&6
|
||||
echo "configure:1492: checking size of short" >&5
|
||||
echo "configure:1532: checking size of short" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1496,7 +1536,7 @@ else
|
||||
ac_cv_sizeof_short=2
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1500 "configure"
|
||||
#line 1540 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
main()
|
||||
@ -1507,7 +1547,7 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_sizeof_short=`cat conftestval`
|
||||
else
|
||||
@ -1527,7 +1567,7 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking size of int""... $ac_c" 1>&6
|
||||
echo "configure:1531: checking size of int" >&5
|
||||
echo "configure:1571: checking size of int" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1535,7 +1575,7 @@ else
|
||||
ac_cv_sizeof_int=4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1539 "configure"
|
||||
#line 1579 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
main()
|
||||
@ -1546,7 +1586,7 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_sizeof_int=`cat conftestval`
|
||||
else
|
||||
@ -1566,7 +1606,7 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking size of long""... $ac_c" 1>&6
|
||||
echo "configure:1570: checking size of long" >&5
|
||||
echo "configure:1610: checking size of long" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1574,7 +1614,7 @@ else
|
||||
ac_cv_sizeof_long=4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1578 "configure"
|
||||
#line 1618 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
main()
|
||||
@ -1585,7 +1625,7 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_sizeof_long=`cat conftestval`
|
||||
else
|
||||
@ -1605,7 +1645,7 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking size of long long""... $ac_c" 1>&6
|
||||
echo "configure:1609: checking size of long long" >&5
|
||||
echo "configure:1649: checking size of long long" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1613,7 +1653,7 @@ else
|
||||
ac_cv_sizeof_long_long=8
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1617 "configure"
|
||||
#line 1657 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
main()
|
||||
@ -1624,7 +1664,7 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_sizeof_long_long=`cat conftestval`
|
||||
else
|
||||
@ -1644,7 +1684,7 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking size of float""... $ac_c" 1>&6
|
||||
echo "configure:1648: checking size of float" >&5
|
||||
echo "configure:1688: checking size of float" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1652,7 +1692,7 @@ else
|
||||
ac_cv_sizeof_float=4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1656 "configure"
|
||||
#line 1696 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
main()
|
||||
@ -1663,7 +1703,7 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_sizeof_float=`cat conftestval`
|
||||
else
|
||||
@ -1683,7 +1723,7 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking size of double""... $ac_c" 1>&6
|
||||
echo "configure:1687: checking size of double" >&5
|
||||
echo "configure:1727: checking size of double" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1691,7 +1731,7 @@ else
|
||||
ac_cv_sizeof_double=8
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1695 "configure"
|
||||
#line 1735 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
main()
|
||||
@ -1702,7 +1742,7 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_sizeof_double=`cat conftestval`
|
||||
else
|
||||
@ -1722,7 +1762,7 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking size of size_t""... $ac_c" 1>&6
|
||||
echo "configure:1726: checking size of size_t" >&5
|
||||
echo "configure:1766: checking size of size_t" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1730,7 +1770,7 @@ else
|
||||
ac_cv_sizeof_size_t=4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1734 "configure"
|
||||
#line 1774 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
main()
|
||||
@ -1741,7 +1781,7 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_sizeof_size_t=`cat conftestval`
|
||||
else
|
||||
@ -1764,7 +1804,7 @@ cat >>confdefs.h <<\EOF
|
||||
#include <sys/types.h> /*for off_t definition*/
|
||||
EOF
|
||||
echo $ac_n "checking size of off_t""... $ac_c" 1>&6
|
||||
echo "configure:1768: checking size of off_t" >&5
|
||||
echo "configure:1808: checking size of off_t" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1772,7 +1812,7 @@ else
|
||||
ac_cv_sizeof_off_t=4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1776 "configure"
|
||||
#line 1816 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
main()
|
||||
@ -1783,7 +1823,7 @@ main()
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:1827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_sizeof_off_t=`cat conftestval`
|
||||
else
|
||||
@ -1807,12 +1847,12 @@ EOF
|
||||
|
||||
|
||||
echo $ac_n "checking for working const""... $ac_c" 1>&6
|
||||
echo "configure:1811: checking for working const" >&5
|
||||
echo "configure:1851: checking for working const" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1816 "configure"
|
||||
#line 1856 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
@ -1861,7 +1901,7 @@ ccp = (char const *const *) p;
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_c_const=yes
|
||||
else
|
||||
@ -1882,21 +1922,21 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for inline""... $ac_c" 1>&6
|
||||
echo "configure:1886: checking for inline" >&5
|
||||
echo "configure:1926: checking for inline" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_cv_c_inline=no
|
||||
for ac_kw in inline __inline__ __inline; do
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1893 "configure"
|
||||
#line 1933 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
} $ac_kw foo() {
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_c_inline=$ac_kw; break
|
||||
else
|
||||
@ -1923,16 +1963,16 @@ esac
|
||||
|
||||
|
||||
echo $ac_n "checking for __attribute__ extension""... $ac_c" 1>&6
|
||||
echo "configure:1927: checking for __attribute__ extension" >&5
|
||||
echo "configure:1967: checking for __attribute__ extension" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1929 "configure"
|
||||
#line 1969 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
int __attribute__((unused)) f(void){return 1;}
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_ATTRIBUTE 1
|
||||
@ -1948,16 +1988,16 @@ fi
|
||||
rm -f conftest*
|
||||
|
||||
echo $ac_n "checking for __FUNCTION__ extension""... $ac_c" 1>&6
|
||||
echo "configure:1952: checking for __FUNCTION__ extension" >&5
|
||||
echo "configure:1992: checking for __FUNCTION__ extension" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1954 "configure"
|
||||
#line 1994 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
int f(void){return __FUNCTION__;}
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_FUNCTION 1
|
||||
@ -1972,6 +2012,37 @@ else
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
echo $ac_n "checking for debug flags""... $ac_c" 1>&6
|
||||
echo "configure:2017: checking for debug flags" >&5;
|
||||
# Check whether --enable-debug or --disable-debug was given.
|
||||
if test "${enable_debug+set}" = set; then
|
||||
enableval="$enable_debug"
|
||||
DEBUG_PKG=$enableval
|
||||
fi
|
||||
|
||||
|
||||
all_packages="ac,b,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v"
|
||||
if test X = "X$DEBUG_PKG" -o Xyes = "X$DEBUG_PKG"; then
|
||||
DEBUG_PKG=ac,b,d,e,f,g,hg,hl,i,mf,mm,p,s,t,v
|
||||
CPPFLAGS="$CPPFLAGS -UNDEBUG"
|
||||
echo "$ac_t""default ($DEBUG_PKG)" 1>&6
|
||||
elif test Xall = "X$DEBUG_PKG"; then
|
||||
DEBUG_PKG=$all_packages
|
||||
CPPFLAGS="$CPPFLAGS -UNDEBUG"
|
||||
echo "$ac_t""all ($DEBUG_PKG)" 1>&6
|
||||
elif test Xno = "X$DEBUG_PKG" -o Xnone = "X$DEBUG_PKG"; then
|
||||
echo "$ac_t""none" 1>&6
|
||||
DEBUG_PKG=
|
||||
CPPFLAGS="$CPPFLAGS -DNDEBUG"
|
||||
else
|
||||
echo "$ac_t""$DEBUG_PKG" 1>&6
|
||||
fi
|
||||
|
||||
if test "X" != "X$DEBUG_PKG"; then
|
||||
for pkg in `echo $DEBUG_PKG | tr 'a-z,' 'A-Z '`; do
|
||||
CPPFLAGS="$CPPFLAGS -DH5${pkg}_DEBUG"
|
||||
done
|
||||
fi
|
||||
|
||||
# Check whether --enable-parallel or --disable-parallel was given.
|
||||
if test "${enable_parallel+set}" = set; then
|
||||
@ -1980,7 +2051,7 @@ if test "${enable_parallel+set}" = set; then
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for parallel support""... $ac_c" 1>&6
|
||||
echo "configure:1984: checking for parallel support" >&5;
|
||||
echo "configure:2055: checking for parallel support" >&5;
|
||||
|
||||
|
||||
|
||||
@ -2006,7 +2077,7 @@ EOF
|
||||
CPPFLAGS="$CPPFLAGS $MPI_INC"
|
||||
CFLAGS="$CFLAGS $MPI_LIB"
|
||||
echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6
|
||||
echo "configure:2010: checking for main in -lmpi" >&5
|
||||
echo "configure:2081: checking for main in -lmpi" >&5
|
||||
ac_lib_var=`echo mpi'_'main | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2014,14 +2085,14 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lmpi $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2018 "configure"
|
||||
#line 2089 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
main()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2048,7 +2119,7 @@ else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
echo $ac_n "checking for main in -lmpio""... $ac_c" 1>&6
|
||||
echo "configure:2052: checking for main in -lmpio" >&5
|
||||
echo "configure:2123: checking for main in -lmpio" >&5
|
||||
ac_lib_var=`echo mpio'_'main | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2056,14 +2127,14 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lmpio $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2060 "configure"
|
||||
#line 2131 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
main()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
|
67
configure.in
67
configure.in
@ -86,7 +86,41 @@ else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Production flags?
|
||||
dnl
|
||||
AC_MSG_CHECKING(for production mode)
|
||||
AC_ARG_ENABLE(production,
|
||||
[--enable-production=yes|no Determines how to run the compiler.])
|
||||
|
||||
case "X-$enableval" in
|
||||
X-yes)
|
||||
AC_MSG_RESULT("production")
|
||||
CFLAGS="$CFLAGS $PROD_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PROD_CPPFLAGS"
|
||||
;;
|
||||
X-|X-no)
|
||||
AC_MSG_RESULT("development")
|
||||
CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DEBUG_CPPFLAGS"
|
||||
;;
|
||||
X-pg|X-profile)
|
||||
AC_MSG_RESULT("profile")
|
||||
CFLAGS="$CFLAGS $PROFILE_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PROFILE_CPPFLAGS"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT("user-defined")
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Turn on warning flags for gcc.
|
||||
dnl
|
||||
if test Xyes = "X$GCC"; then
|
||||
CFLAGS="$CFLAGS -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check for libraries. (none required yet)
|
||||
@ -157,6 +191,39 @@ AC_TRY_COMPILE(,[int f(void){return __FUNCTION__;}],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Turn on debugging by setting compiler flags
|
||||
dnl
|
||||
AC_MSG_CHECKING(for debug flags);
|
||||
AC_ARG_ENABLE(debug,
|
||||
[--enable-debug=all Turn on debugging in all packages. One may also
|
||||
specify a comma-separated list of package names
|
||||
without the leading H5 or the word no. The default
|
||||
is most packages.],
|
||||
DEBUG_PKG=$enableval)
|
||||
|
||||
all_packages="ac,b,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v"
|
||||
if test X = "X$DEBUG_PKG" -o Xyes = "X$DEBUG_PKG"; then
|
||||
DEBUG_PKG=ac,b,d,e,f,g,hg,hl,i,mf,mm,p,s,t,v
|
||||
CPPFLAGS="$CPPFLAGS -UNDEBUG"
|
||||
AC_MSG_RESULT(default ($DEBUG_PKG))
|
||||
elif test Xall = "X$DEBUG_PKG"; then
|
||||
DEBUG_PKG=$all_packages
|
||||
CPPFLAGS="$CPPFLAGS -UNDEBUG"
|
||||
AC_MSG_RESULT(all ($DEBUG_PKG))
|
||||
elif test Xno = "X$DEBUG_PKG" -o Xnone = "X$DEBUG_PKG"; then
|
||||
AC_MSG_RESULT(none)
|
||||
DEBUG_PKG=
|
||||
CPPFLAGS="$CPPFLAGS -DNDEBUG"
|
||||
else
|
||||
AC_MSG_RESULT($DEBUG_PKG)
|
||||
fi
|
||||
|
||||
if test "X" != "X$DEBUG_PKG"; then
|
||||
for pkg in `echo $DEBUG_PKG | tr 'a-z,' 'A-Z '`; do
|
||||
CPPFLAGS="$CPPFLAGS -DH5${pkg}_DEBUG"
|
||||
done
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check for parallel support
|
||||
|
@ -641,7 +641,7 @@ H5AC_protect(H5F_t *f, const H5AC_class_t *type, const haddr_t *addr,
|
||||
#ifdef H5AC_DEBUG
|
||||
static int ncalls = 0;
|
||||
if (0 == ncalls++) {
|
||||
fprintf(stderr, "HDF5-DIAG: debugging cache (expensive)\n");
|
||||
fprintf(stderr, "H5AC: debugging cache (expensive)\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -838,7 +838,7 @@ H5AC_debug(H5F_t *f)
|
||||
|
||||
FUNC_ENTER(H5AC_debug, FAIL);
|
||||
|
||||
fprintf(stderr, "HDF5-DIAG: cache diagnostics for %s\n", f->name);
|
||||
fprintf(stderr, "H5AC: cache diagnostics for %s\n", f->name);
|
||||
fprintf(stderr, " %18s %8s %8s %8s %8s+%-8s\n",
|
||||
"", "Hits", "Misses", "MissRate", "Inits", "Flushes");
|
||||
|
||||
|
@ -1640,7 +1640,7 @@ H5B_assert(H5F_t *f, const haddr_t *addr, const H5B_class_t *type,
|
||||
|
||||
FUNC_ENTER(H5B_assert, FAIL);
|
||||
if (0 == ncalls++) {
|
||||
fprintf(stderr, "HDF5-DIAG: debugging B-trees (expensive)\n");
|
||||
fprintf(stderr, "H5B: debugging B-trees (expensive)\n");
|
||||
}
|
||||
/* Initialize the queue */
|
||||
bt = H5AC_find(f, H5AC_BT, addr, type, udata);
|
||||
|
19
src/H5D.c
19
src/H5D.c
@ -820,7 +820,8 @@ H5D_create(H5G_t *loc, const char *name, const H5T_t *type, const H5S_t *space,
|
||||
}
|
||||
|
||||
/* Update the type and space header messages */
|
||||
if (H5O_modify(&(new_dset->ent), H5O_DTYPE, 0, H5O_FLAG_CONSTANT,
|
||||
if (H5O_modify(&(new_dset->ent), H5O_DTYPE, 0,
|
||||
(H5O_FLAG_CONSTANT|H5O_FLAG_SHARED),
|
||||
new_dset->type) < 0 ||
|
||||
H5S_modify(&(new_dset->ent), new_dset->space) < 0) {
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL,
|
||||
@ -1162,7 +1163,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
mem_space, buf/*out*/);
|
||||
if (status>=0) goto succeed;
|
||||
#ifdef H5D_DEBUG
|
||||
fprintf (stderr, "HDF5-DIAG: input pipe optimization failed "
|
||||
fprintf (stderr, "H5D: input pipe optimization failed "
|
||||
"(falling through)\n");
|
||||
#endif
|
||||
H5E_clear ();
|
||||
@ -1217,7 +1218,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
/* Strip mine diagnostics.... */
|
||||
size_t buffer_size = smine_nelmts * MAX (src_type_size, dst_type_size);
|
||||
if (smine_nelmts<nelmts) {
|
||||
fprintf (stderr, "HDF5-DIAG: strip mine");
|
||||
fprintf (stderr, "H5D: strip mine");
|
||||
if (smine_nelmts!=request_nelmts) {
|
||||
fprintf (stderr, " got %lu of %lu",
|
||||
(unsigned long)smine_nelmts,
|
||||
@ -1225,10 +1226,10 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
}
|
||||
if (buffer_size!=target_size) {
|
||||
fprintf (stderr, " (%1.1f%% of buffer)",
|
||||
100.0*buffer_size/target_size);
|
||||
100.0*(double)buffer_size/(double)target_size);
|
||||
}
|
||||
fprintf (stderr, " %1.1f iterations\n",
|
||||
(double)nelmts/smine_nelmts);
|
||||
(double)nelmts/(double)smine_nelmts);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1388,7 +1389,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
mem_space, buf);
|
||||
if (status>=0) goto succeed;
|
||||
#ifdef H5D_DEBUG
|
||||
fprintf (stderr, "HDF5-DIAG: output pipe optimization failed "
|
||||
fprintf (stderr, "H5D: output pipe optimization failed "
|
||||
"(falling through)\n");
|
||||
#endif
|
||||
H5E_clear ();
|
||||
@ -1443,7 +1444,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
/* Strip mine diagnostics.... */
|
||||
size_t buffer_size = smine_nelmts * MAX (src_type_size, dst_type_size);
|
||||
if (smine_nelmts<nelmts) {
|
||||
fprintf (stderr, "HDF5-DIAG: strip mine");
|
||||
fprintf (stderr, "H5D: strip mine");
|
||||
if (smine_nelmts!=request_nelmts) {
|
||||
fprintf (stderr, " got %lu of %lu",
|
||||
(unsigned long)smine_nelmts,
|
||||
@ -1451,10 +1452,10 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
|
||||
}
|
||||
if (buffer_size!=target_size) {
|
||||
fprintf (stderr, " (%1.1f%% of buffer)",
|
||||
100.0*buffer_size/target_size);
|
||||
100.0*(double)buffer_size/(double)target_size);
|
||||
}
|
||||
fprintf (stderr, " %1.1f iterations\n",
|
||||
(double)nelmts/smine_nelmts);
|
||||
(double)nelmts/(double)smine_nelmts);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -553,7 +553,7 @@ H5F_dest(H5F_t *f)
|
||||
* following flags which are similar in nature to the Posix
|
||||
* open(2) flags.
|
||||
*
|
||||
* H5F_ACC_WRITE: Open with read/write access. If the file is
|
||||
* H5F_ACC_RDWR: Open with read/write access. If the file is
|
||||
* currently open for read-only access then it
|
||||
* will be reopened. Absence of this flag
|
||||
* implies read-only access.
|
||||
@ -968,7 +968,7 @@ H5F_open(const char *name, uintn flags,
|
||||
* hdf5 data.
|
||||
*/
|
||||
#ifdef H5F_DEBUG
|
||||
fprintf(stderr, "HDF5-DIAG: resetting EOF from ");
|
||||
fprintf(stderr, "H5F: resetting EOF from ");
|
||||
H5F_addr_print(stderr, &addr1);
|
||||
fprintf(stderr, " to ");
|
||||
H5F_addr_print(stderr, &addr2);
|
||||
@ -1323,7 +1323,7 @@ H5F_close(H5F_t *f)
|
||||
*/
|
||||
if (f->nopen>0) {
|
||||
#ifndef NDEBUG
|
||||
fprintf(stderr, "HDF5-DIAG: H5F_close: %u object header%s still "
|
||||
fprintf(stderr, "H5F: H5F_close: %u object header%s still "
|
||||
"open (file close will complete when %s closed)\n",
|
||||
f->nopen,
|
||||
1 == f->nopen ? " is" : "s are",
|
||||
@ -1333,7 +1333,7 @@ H5F_close(H5F_t *f)
|
||||
HRETURN(SUCCEED);
|
||||
} else if (f->close_pending) {
|
||||
#ifndef NDEBUG
|
||||
fprintf(stderr, "HDF5-DIAG: H5F_close: operation completed\n");
|
||||
fprintf(stderr, "H5F: H5F_close: operation completed\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ H5F_fam_open(const char *name, const H5F_access_t *access_parms,
|
||||
if (size != mask) {
|
||||
size++;
|
||||
#ifdef H5F_DEBUG
|
||||
fprintf(stderr, "HDF5-DIAG: family member size was "
|
||||
fprintf(stderr, "H5F: family member size was "
|
||||
"rounded up to a power of 2");
|
||||
#endif
|
||||
}
|
||||
@ -199,16 +199,16 @@ H5F_fam_open(const char *name, const H5F_access_t *access_parms,
|
||||
|
||||
#ifdef H5F_DEBUG
|
||||
if (nbits >= 30) {
|
||||
fprintf(stderr, "HDF5-DIAG: family members are %dGB\n",
|
||||
fprintf(stderr, "H5F: family members are %dGB\n",
|
||||
1 << (nbits-30));
|
||||
} else if (nbits >= 20) {
|
||||
fprintf(stderr, "HDF5-DIAG: family members are %dMB\n",
|
||||
fprintf(stderr, "H5F: family members are %dMB\n",
|
||||
1 << (nbits-20));
|
||||
} else if (nbits >= 10) {
|
||||
fprintf(stderr, "HDF5-DIAG: family members are %dkB\n",
|
||||
fprintf(stderr, "H5F: family members are %dkB\n",
|
||||
1 << (nbits-10));
|
||||
} else {
|
||||
fprintf(stderr, "HDF5-DIAG: family members are %d bytes\n",
|
||||
fprintf(stderr, "H5F: family members are %d bytes\n",
|
||||
1 << nbits);
|
||||
}
|
||||
#endif
|
||||
|
@ -283,7 +283,7 @@ H5F_low_write(H5F_low_t *lf, const H5F_access_t *access_parms,
|
||||
tmp_addr = *addr;
|
||||
H5F_addr_inc(&tmp_addr, size);
|
||||
if (H5F_addr_gt(&tmp_addr, &(lf->eof))) {
|
||||
fprintf(stderr, "HDF5-DIAG: extending file w/o allocation\n");
|
||||
fprintf(stderr, "H5F: extending file w/o allocation\n");
|
||||
lf->eof = tmp_addr;
|
||||
}
|
||||
/* Write the data */
|
||||
@ -718,7 +718,7 @@ H5F_addr_encode(H5F_t *f, uint8 **pp, const haddr_t *addr)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
H5F_addr_decode(H5F_t *f, const uint8 **pp, haddr_t *addr /*out */ )
|
||||
H5F_addr_decode(H5F_t *f, const uint8 **pp, haddr_t *addr/*out*/)
|
||||
{
|
||||
int i;
|
||||
haddr_t tmp;
|
||||
@ -763,9 +763,9 @@ H5F_addr_decode(H5F_t *f, const uint8 **pp, haddr_t *addr /*out */ )
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
H5F_addr_print(FILE * stream, const haddr_t *addr)
|
||||
H5F_addr_print(FILE *stream, const haddr_t *addr)
|
||||
{
|
||||
haddr_t tmp;
|
||||
haddr_t tmp;
|
||||
|
||||
assert(stream);
|
||||
assert(addr);
|
||||
|
66
src/H5HG.c
66
src/H5HG.c
@ -33,25 +33,20 @@
|
||||
|
||||
#define PABLO_MASK H5HG_mask
|
||||
|
||||
struct H5HG_t {
|
||||
haddr_t addr; /*address of collection */
|
||||
intn idx; /*object ID within collection */
|
||||
};
|
||||
|
||||
typedef struct H5HG_obj_t {
|
||||
intn nrefs; /*reference count */
|
||||
size_t size; /*total size of object */
|
||||
uint8 *begin; /*ptr to object into heap->chunk*/
|
||||
} H5HG_obj_t;
|
||||
|
||||
typedef struct H5HG_heap_t {
|
||||
struct H5HG_heap_t {
|
||||
haddr_t addr; /*collection address */
|
||||
hbool_t dirty; /*does heap need to be saved? */
|
||||
size_t size; /*total size of collection */
|
||||
uint8 *chunk; /*the collection, incl. header */
|
||||
intn nalloc; /*numb object slots allocated */
|
||||
H5HG_obj_t *obj; /*array of object descriptions */
|
||||
} H5HG_heap_t;
|
||||
};
|
||||
|
||||
/* PRIVATE PROTOTYPES */
|
||||
static H5HG_heap_t *H5HG_load(H5F_t *f, const haddr_t *addr,
|
||||
@ -81,9 +76,11 @@ static intn interface_initialize_g = FALSE;
|
||||
* new collection is allocated in the file and added to the
|
||||
* beginning of the CWFS list.
|
||||
*
|
||||
* Return: Success: SUCCEED
|
||||
* Return: Success: Ptr to a cached heap. The pointer is valid
|
||||
* only until some other hdf5 library function
|
||||
* is called.
|
||||
*
|
||||
* Failure: FAIL
|
||||
* Failure: NULL
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Friday, March 27, 1998
|
||||
@ -92,15 +89,15 @@ static intn interface_initialize_g = FALSE;
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5HG_heap_t *
|
||||
H5HG_create (H5F_t *f, size_t size)
|
||||
{
|
||||
H5HG_heap_t *heap = NULL;
|
||||
herr_t ret_value = FAIL;
|
||||
H5HG_heap_t *ret_value = NULL;
|
||||
uint8 *p = NULL;
|
||||
haddr_t addr;
|
||||
|
||||
FUNC_ENTER (H5HG_create, FAIL);
|
||||
FUNC_ENTER (H5HG_create, NULL);
|
||||
|
||||
/* Check args */
|
||||
assert (f);
|
||||
@ -108,7 +105,7 @@ H5HG_create (H5F_t *f, size_t size)
|
||||
|
||||
/* Create it */
|
||||
if (H5MF_alloc (f, H5MF_META, size, &addr/*out*/)<0) {
|
||||
HGOTO_ERROR (H5E_HEAP, H5E_CANTINIT, FAIL,
|
||||
HGOTO_ERROR (H5E_HEAP, H5E_CANTINIT, NULL,
|
||||
"unable to allocate file space for global heap");
|
||||
}
|
||||
heap = H5MM_xcalloc (1, sizeof(H5HG_heap_t));
|
||||
@ -123,7 +120,9 @@ H5HG_create (H5F_t *f, size_t size)
|
||||
HDmemcpy (heap->chunk, H5HG_MAGIC, H5HG_SIZEOF_MAGIC);
|
||||
p = heap->chunk + H5HG_SIZEOF_MAGIC;
|
||||
*p++ = H5HG_VERSION;
|
||||
p += 3; /*reserved*/
|
||||
*p++ = 0; /*reserved*/
|
||||
*p++ = 0; /*reserved*/
|
||||
*p++ = 0; /*reserved*/
|
||||
H5F_encode_length (f, p, size);
|
||||
|
||||
/* The freespace object */
|
||||
@ -136,7 +135,7 @@ H5HG_create (H5F_t *f, size_t size)
|
||||
|
||||
/* Add the heap to the cache */
|
||||
if (H5AC_set (f, H5AC_GHEAP, &addr, heap)<0) {
|
||||
HGOTO_ERROR (H5E_HEAP, H5E_CANTINIT, FAIL,
|
||||
HGOTO_ERROR (H5E_HEAP, H5E_CANTINIT, NULL,
|
||||
"unable to cache global heap collection");
|
||||
}
|
||||
|
||||
@ -152,10 +151,10 @@ H5HG_create (H5F_t *f, size_t size)
|
||||
f->shared->ncwfs = MIN (H5HG_NCWFS, f->shared->ncwfs+1);
|
||||
}
|
||||
|
||||
ret_value = SUCCEED;
|
||||
ret_value = heap;
|
||||
|
||||
done:
|
||||
if (ret_value<0 && heap) {
|
||||
if (!ret_value && heap) {
|
||||
H5MM_xfree (heap->chunk);
|
||||
H5MM_xfree (heap->obj);
|
||||
H5MM_xfree (heap);
|
||||
@ -263,7 +262,7 @@ H5HG_load (H5F_t *f, const haddr_t *addr, const void *udata1, void *udata2)
|
||||
UINT16DECODE (p, heap->obj[idx].nrefs);
|
||||
H5F_decode_length (f, p, heap->obj[idx].size);
|
||||
heap->obj[idx].begin = begin;
|
||||
p += heap->obj[idx].size;
|
||||
p = begin + heap->obj[idx].size;
|
||||
}
|
||||
}
|
||||
assert (p==heap->chunk+heap->size);
|
||||
@ -502,8 +501,8 @@ H5HG_insert (H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/)
|
||||
f->shared->cwfs[cwfsno] = f->shared->cwfs[cwfsno-1];
|
||||
f->shared->cwfs[cwfsno-1] = tmp;
|
||||
--cwfsno;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -512,11 +511,12 @@ H5HG_insert (H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/)
|
||||
* new collection large enough for the message plus the collection header.
|
||||
*/
|
||||
if (cwfsno>=f->shared->ncwfs) {
|
||||
if (H5HG_create (f, need+H5HG_SIZEOF_HDR (f))<0) {
|
||||
if (NULL==(heap=H5HG_create (f, need+H5HG_SIZEOF_HDR (f)))) {
|
||||
HRETURN_ERROR (H5E_HEAP, H5E_CANTINIT, FAIL,
|
||||
"unable to allocate a global heap collection");
|
||||
}
|
||||
assert (f->shared->ncwfs>0);
|
||||
assert (f->shared->cwfs[0]==heap);
|
||||
assert (f->shared->cwfs[0]->obj[0].size >= need+H5HG_SIZEOF_HDR(f));
|
||||
cwfsno = 0;
|
||||
}
|
||||
@ -763,6 +763,8 @@ H5HG_remove (H5F_t *f, H5HG_t *hobj)
|
||||
heap->obj[0].begin = heap->chunk + (heap->size-size);
|
||||
heap->obj[0].size = size;
|
||||
heap->obj[0].nrefs = 0;
|
||||
} else {
|
||||
heap->obj[0].size += size;
|
||||
}
|
||||
HDmemmove (obj_start, obj_start+size,
|
||||
heap->size-((obj_start+size)-heap->chunk));
|
||||
@ -830,9 +832,11 @@ herr_t
|
||||
H5HG_debug(H5F_t *f, const haddr_t *addr, FILE *stream, intn indent,
|
||||
intn fwidth)
|
||||
{
|
||||
int i, nused, maxobj;
|
||||
int i, j, k, nused, maxobj;
|
||||
H5HG_heap_t *h = NULL;
|
||||
char buf[64];
|
||||
size_t size;
|
||||
uint8 *p = NULL;
|
||||
|
||||
FUNC_ENTER(H5HG_debug, FAIL);
|
||||
|
||||
@ -873,13 +877,31 @@ H5HG_debug(H5F_t *f, const haddr_t *addr, FILE *stream, intn indent,
|
||||
for (i=1; i<h->nalloc; i++) {
|
||||
if (h->obj[i].begin) {
|
||||
sprintf (buf, "Object %d", i);
|
||||
fprintf (stream, "%*s%-*s:\n", indent, "", fwidth, buf);
|
||||
fprintf (stream, "%*s%s\n", indent, "", buf);
|
||||
fprintf (stream, "%*s%-*s %d\n", indent+3, "", MIN(fwidth-3, 0),
|
||||
"Reference count:",
|
||||
h->obj[i].nrefs);
|
||||
fprintf (stream, "%*s%-*s %lu\n", indent+3, "", MIN(fwidth-3, 0),
|
||||
"Size of object body:",
|
||||
(unsigned long)(h->obj[i].size));
|
||||
size = h->obj[i].size - H5HG_SIZEOF_OBJHDR (f);
|
||||
p = h->obj[i].begin + H5HG_SIZEOF_OBJHDR (f);
|
||||
for (j=0; j<size; j+=16) {
|
||||
fprintf (stream, "%*s%04d: ", indent+6, "", j);
|
||||
for (k=0; k<16; k++) {
|
||||
if (8==k) fprintf (stream, " ");
|
||||
if (j+k<size) {
|
||||
fprintf (stream, "%02x ", p[j+k]);
|
||||
} else {
|
||||
fputs (" ", stream);
|
||||
}
|
||||
}
|
||||
for (k=0; k<16 && j+k<size; k++) {
|
||||
if (8==k) fprintf (stream, " ");
|
||||
fputc (p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream);
|
||||
}
|
||||
fprintf (stream, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
#include <H5HGpublic.h>
|
||||
|
||||
#include <H5Fprivate.h>
|
||||
|
||||
/*
|
||||
* Each collection has a magic number for some redundancy.
|
||||
*/
|
||||
@ -59,14 +61,27 @@
|
||||
* The initial guess for the number of messages in a collection. We assume
|
||||
* that all objects in that collection are zero length, giving the maximum
|
||||
* possible number of objects in the collection. The collection itself has
|
||||
* some overhead and each message has some overhead.
|
||||
* some overhead and each message has some overhead. The `+2' accounts for
|
||||
* rounding and for the free space object.
|
||||
*/
|
||||
#define H5HG_NOBJS(f,z) (int)((((z)-H5HG_SIZEOF_HDR(f))/ \
|
||||
H5HG_SIZEOF_OBJHDR(f)+1))
|
||||
H5HG_SIZEOF_OBJHDR(f)+2))
|
||||
|
||||
typedef struct H5HG_t H5HG_t;
|
||||
/*
|
||||
* Makes a global heap object pointer undefined, or checks whether one is
|
||||
* defined.
|
||||
*/
|
||||
#define H5HG_undef(HGP) ((HGP)->idx=0)
|
||||
#define H5HG_defined(HGP) ((HGP)->idx!=0)
|
||||
|
||||
herr_t H5HG_create (H5F_t *f, size_t size);
|
||||
typedef struct H5HG_t {
|
||||
haddr_t addr; /*address of collection */
|
||||
intn idx; /*object ID within collection */
|
||||
} H5HG_t;
|
||||
|
||||
typedef struct H5HG_heap_t H5HG_heap_t;
|
||||
|
||||
H5HG_heap_t *H5HG_create (H5F_t *f, size_t size);
|
||||
herr_t H5HG_insert (H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/);
|
||||
void *H5HG_peek (H5F_t *f, H5HG_t *hobj);
|
||||
void *H5HG_read (H5F_t *f, H5HG_t *hobj, void *object);
|
||||
|
44
src/H5HL.c
44
src/H5HL.c
@ -529,9 +529,6 @@ H5HL_insert(H5F_t *f, const haddr_t *addr, size_t buf_size, const void *buf)
|
||||
size_t offset = 0;
|
||||
size_t need_size, old_size, need_more;
|
||||
hbool_t found;
|
||||
#ifndef NDEBUG
|
||||
static int nmessages = 0;
|
||||
#endif
|
||||
|
||||
FUNC_ENTER(H5HL_insert, (size_t)(-1));
|
||||
|
||||
@ -601,14 +598,10 @@ H5HL_insert(H5F_t *f, const haddr_t *addr, size_t buf_size, const void *buf)
|
||||
assert (max_fl->size==H5HL_ALIGN (max_fl->size));
|
||||
|
||||
if (max_fl->size < H5HL_SIZEOF_FREE(f)) {
|
||||
#ifndef NDEBUG
|
||||
#ifdef H5HL_DEBUG
|
||||
if (max_fl->size) {
|
||||
fprintf(stderr, "H5HL_insert: lost %lu bytes at line %d\n",
|
||||
(unsigned long) (max_fl->size), __LINE__);
|
||||
if (0 == nmessages++) {
|
||||
fprintf(stderr, "Messages from H5HL_insert() will go "
|
||||
"away when assertions are turned off.\n");
|
||||
}
|
||||
fprintf(stderr, "H5HL: lost %lu bytes at line %d\n",
|
||||
(unsigned long)(max_fl->size), __LINE__);
|
||||
}
|
||||
#endif
|
||||
max_fl = H5HL_remove_free(heap, max_fl);
|
||||
@ -629,26 +622,18 @@ H5HL_insert(H5F_t *f, const haddr_t *addr, size_t buf_size, const void *buf)
|
||||
fl->next = heap->freelist;
|
||||
if (heap->freelist) heap->freelist->prev = fl;
|
||||
heap->freelist = fl;
|
||||
#ifndef NDEBUG
|
||||
#ifdef H5HL_DEBUG
|
||||
} else if (need_more > need_size) {
|
||||
fprintf(stderr, "H5HL_insert: lost %lu bytes at line %d\n",
|
||||
(unsigned long) (need_more - need_size), __LINE__);
|
||||
if (0 == nmessages++) {
|
||||
fprintf(stderr, "Messages from H5HL_insert() will go away "
|
||||
"when assertions are turned off.\n");
|
||||
}
|
||||
(unsigned long)(need_more - need_size), __LINE__);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
fprintf(stderr, "H5HL_insert: resize mem buf from %lu to %lu bytes\n",
|
||||
(unsigned long) (heap->mem_alloc),
|
||||
(unsigned long) (heap->mem_alloc + need_more));
|
||||
if (0 == nmessages++) {
|
||||
fprintf(stderr, "Messages from H5HL_insert() will go away "
|
||||
"when assertions are turned off.\n");
|
||||
}
|
||||
#ifdef H5HL_DEBUG
|
||||
fprintf(stderr, "H5HL: resize mem buf from %lu to %lu bytes\n",
|
||||
(unsigned long)(heap->mem_alloc),
|
||||
(unsigned long)(heap->mem_alloc + need_more));
|
||||
#endif
|
||||
old_size = heap->mem_alloc;
|
||||
heap->mem_alloc += need_more;
|
||||
@ -748,9 +733,6 @@ H5HL_remove(H5F_t *f, const haddr_t *addr, size_t offset, size_t size)
|
||||
{
|
||||
H5HL_t *heap = NULL;
|
||||
H5HL_free_t *fl = heap->freelist, *fl2 = NULL;
|
||||
#ifndef NDEBUG
|
||||
static int nmessages = 0;
|
||||
#endif
|
||||
|
||||
FUNC_ENTER(H5HL_remove, FAIL);
|
||||
|
||||
@ -817,12 +799,8 @@ H5HL_remove(H5F_t *f, const haddr_t *addr, size_t offset, size_t size)
|
||||
* lost.
|
||||
*/
|
||||
if (size < H5HL_SIZEOF_FREE(f)) {
|
||||
#ifndef NDEBUG
|
||||
fprintf(stderr, "H5HL_remove: lost %lu bytes\n", (unsigned long) size);
|
||||
if (0 == nmessages++) {
|
||||
fprintf(stderr, "Messages from H5HL_remove() will go away "
|
||||
"when assertions are turned off.\n");
|
||||
}
|
||||
#ifdef H5HL_DEBUG
|
||||
fprintf(stderr, "H5HL: lost %lu bytes\n", (unsigned long) size);
|
||||
#endif
|
||||
HRETURN(SUCCEED);
|
||||
}
|
||||
|
@ -23,6 +23,14 @@
|
||||
#include <H5private.h>
|
||||
#include <H5Fprivate.h>
|
||||
|
||||
/*
|
||||
* Feature: Define H5HL_DEBUG on the compiler command line if you want to
|
||||
* diagnostic messages from this layer.
|
||||
*/
|
||||
#ifdef NDEBUG
|
||||
# undef H5HL_DEBUG
|
||||
#endif
|
||||
|
||||
#define H5HL_MAGIC "HEAP" /*heap magic number */
|
||||
#define H5HL_SIZEOF_MAGIC 4
|
||||
|
||||
|
@ -116,7 +116,7 @@ H5MF_free(H5F_t *f, const haddr_t *addr, size_t size)
|
||||
HRETURN(SUCCEED);
|
||||
assert(!H5F_addr_zerop(addr));
|
||||
|
||||
#ifndef NDEBUG
|
||||
#ifdef H5MF_DEBUG
|
||||
fprintf(stderr, "H5MF_free: lost %lu bytes of file storage\n",
|
||||
(unsigned long) size);
|
||||
#endif
|
||||
|
@ -23,6 +23,14 @@
|
||||
#include <H5private.h>
|
||||
#include <H5Fprivate.h>
|
||||
|
||||
/*
|
||||
* Feature: Define H5MF_DEBUG on the compiler command line if you want to
|
||||
* see diagnostics from this layer.
|
||||
*/
|
||||
#ifdef NDEBUG
|
||||
# undef H5MF_DEBUG
|
||||
#endif
|
||||
|
||||
#define H5MF_META 0 /*request storage for meta data */
|
||||
#define H5MF_RAW 1 /*request storage for raw data */
|
||||
|
||||
|
374
src/H5O.c
374
src/H5O.c
@ -107,6 +107,7 @@ H5O_init_interface(void)
|
||||
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_create
|
||||
@ -281,6 +282,7 @@ H5O_close(H5G_entry_t *obj_ent)
|
||||
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_load
|
||||
@ -317,7 +319,7 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
|
||||
haddr_t chunk_addr;
|
||||
size_t chunk_size;
|
||||
H5O_cont_t *cont = NULL;
|
||||
hbool_t constant; /*is message a constant mesg? */
|
||||
uint8 flags;
|
||||
|
||||
FUNC_ENTER(H5O_load, NULL);
|
||||
|
||||
@ -392,14 +394,8 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
|
||||
UINT16DECODE(p, id);
|
||||
UINT16DECODE(p, mesg_size);
|
||||
assert (mesg_size==H5O_ALIGN (mesg_size));
|
||||
p += 4; /*reserved*/
|
||||
|
||||
/*
|
||||
* The message ID field actually contains some bits near the
|
||||
* high-order end that are not part of the ID.
|
||||
*/
|
||||
constant = (id & H5O_FLAG_CONSTANT) ? TRUE : FALSE;
|
||||
id &= ~H5O_FLAG_BITS;
|
||||
flags = *p++;
|
||||
p += 3; /*reserved*/
|
||||
|
||||
if (id >= NELMTS(message_type_g) || NULL == message_type_g[id]) {
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, NULL,
|
||||
@ -424,7 +420,7 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
|
||||
mesgno = oh->nmesgs++;
|
||||
oh->mesg[mesgno].type = message_type_g[id];
|
||||
oh->mesg[mesgno].dirty = FALSE;
|
||||
oh->mesg[mesgno].constant = constant;
|
||||
oh->mesg[mesgno].flags = flags;
|
||||
oh->mesg[mesgno].native = NULL;
|
||||
oh->mesg[mesgno].raw = p;
|
||||
oh->mesg[mesgno].raw_size = mesg_size;
|
||||
@ -439,7 +435,7 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
|
||||
curmesg++) {
|
||||
if (H5O_CONT_ID == oh->mesg[curmesg].type->id) {
|
||||
uint8 *p2 = oh->mesg[curmesg].raw;
|
||||
cont = (H5O_CONT->decode) (f, oh->mesg[curmesg].raw_size, p2);
|
||||
cont = (H5O_CONT->decode) (f, p2, NULL);
|
||||
oh->mesg[curmesg].native = cont;
|
||||
chunk_addr = cont->addr;
|
||||
chunk_size = cont->size;
|
||||
@ -464,6 +460,7 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
|
||||
}
|
||||
FUNC_LEAVE(ret_value);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_flush
|
||||
@ -491,6 +488,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
|
||||
uint8 buf[16], *p;
|
||||
intn i, id;
|
||||
H5O_cont_t *cont = NULL;
|
||||
herr_t (*encode)(H5F_t*, uint8*, const void*) = NULL;
|
||||
|
||||
FUNC_ENTER(H5O_flush, FAIL);
|
||||
|
||||
@ -532,12 +530,10 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
|
||||
if (oh->mesg[i].dirty) {
|
||||
p = oh->mesg[i].raw - H5O_SIZEOF_MSGHDR(f);
|
||||
|
||||
/* The message id has some flags in the high-order bits. */
|
||||
id = oh->mesg[i].type->id;
|
||||
id |= oh->mesg[i].constant ? H5O_FLAG_CONSTANT : 0;
|
||||
UINT16ENCODE(p, id);
|
||||
UINT16ENCODE(p, oh->mesg[i].raw_size);
|
||||
*p++ = 0; /*reserved*/
|
||||
*p++ = oh->mesg[i].flags;
|
||||
*p++ = 0; /*reserved*/
|
||||
*p++ = 0; /*reserved*/
|
||||
*p++ = 0; /*reserved*/
|
||||
@ -563,7 +559,11 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
|
||||
oh->chunk[cont->chunkno].addr = cont->addr;
|
||||
}
|
||||
|
||||
/* encode the message */
|
||||
/*
|
||||
* Encode the message. If the message is shared then we
|
||||
* encode a Shared Object message instead of the object
|
||||
* which is being shared.
|
||||
*/
|
||||
assert(oh->mesg[i].raw >=
|
||||
oh->chunk[oh->mesg[i].chunkno].image);
|
||||
assert (oh->mesg[i].raw_size ==
|
||||
@ -571,9 +571,12 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
|
||||
assert(oh->mesg[i].raw + oh->mesg[i].raw_size <=
|
||||
oh->chunk[oh->mesg[i].chunkno].image +
|
||||
oh->chunk[oh->mesg[i].chunkno].size);
|
||||
if ((oh->mesg[i].type->encode) (f, oh->mesg[i].raw_size,
|
||||
oh->mesg[i].raw,
|
||||
oh->mesg[i].native) < 0) {
|
||||
if (oh->mesg[i].flags & H5O_FLAG_SHARED) {
|
||||
encode = H5O_SHARED->encode;
|
||||
} else {
|
||||
encode = oh->mesg[i].type->encode;
|
||||
}
|
||||
if ((encode)(f, oh->mesg[i].raw, oh->mesg[i].native)<0) {
|
||||
HRETURN_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL,
|
||||
"unable to encode object header message");
|
||||
}
|
||||
@ -607,7 +610,11 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
|
||||
|
||||
/* destroy messages */
|
||||
for (i = 0; i < oh->nmesgs; i++) {
|
||||
H5O_reset(oh->mesg[i].type, oh->mesg[i].native);
|
||||
if (oh->mesg[i].flags & H5O_FLAG_SHARED) {
|
||||
H5O_reset (H5O_SHARED, oh->mesg[i].native);
|
||||
} else {
|
||||
H5O_reset(oh->mesg[i].type, oh->mesg[i].native);
|
||||
}
|
||||
oh->mesg[i].native = H5MM_xfree(oh->mesg[i].native);
|
||||
}
|
||||
oh->mesg = H5MM_xfree(oh->mesg);
|
||||
@ -617,6 +624,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
|
||||
}
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_reset
|
||||
@ -654,6 +662,7 @@ H5O_reset(const H5O_class_t *type, void *native)
|
||||
}
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_link
|
||||
@ -676,8 +685,8 @@ H5O_reset(const H5O_class_t *type, void *native)
|
||||
intn
|
||||
H5O_link(H5G_entry_t *ent, intn adjust)
|
||||
{
|
||||
H5O_t *oh = NULL;
|
||||
intn ret_value = FAIL;
|
||||
H5O_t *oh = NULL;
|
||||
intn ret_value = FAIL;
|
||||
|
||||
FUNC_ENTER(H5O_link, FAIL);
|
||||
|
||||
@ -714,6 +723,7 @@ H5O_link(H5G_entry_t *ent, intn adjust)
|
||||
}
|
||||
FUNC_LEAVE(ret_value);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_read
|
||||
@ -739,11 +749,11 @@ H5O_link(H5G_entry_t *ent, intn adjust)
|
||||
void *
|
||||
H5O_read(H5G_entry_t *ent, const H5O_class_t *type, intn sequence, void *mesg)
|
||||
{
|
||||
H5O_t *oh = NULL;
|
||||
void *retval = NULL;
|
||||
intn idx;
|
||||
H5G_cache_t *cache = NULL;
|
||||
H5G_type_t cache_type;
|
||||
H5O_t *oh = NULL;
|
||||
void *ret_value = NULL;
|
||||
intn idx;
|
||||
H5G_cache_t *cache = NULL;
|
||||
H5G_type_t cache_type;
|
||||
|
||||
FUNC_ENTER(H5O_read, NULL);
|
||||
|
||||
@ -757,9 +767,9 @@ H5O_read(H5G_entry_t *ent, const H5O_class_t *type, intn sequence, void *mesg)
|
||||
/* can we get it from the symbol table entry? */
|
||||
cache = H5G_ent_cache(ent, &cache_type);
|
||||
if (H5O_fast_g[cache_type]) {
|
||||
retval = (H5O_fast_g[cache_type]) (cache, type, mesg);
|
||||
if (retval)
|
||||
HRETURN(retval);
|
||||
ret_value = (H5O_fast_g[cache_type]) (cache, type, mesg);
|
||||
if (ret_value)
|
||||
HRETURN(ret_value);
|
||||
H5E_clear(); /*don't care, try reading from header */
|
||||
}
|
||||
|
||||
@ -776,19 +786,54 @@ H5O_read(H5G_entry_t *ent, const H5O_class_t *type, intn sequence, void *mesg)
|
||||
HRETURN_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL,
|
||||
"unable to load object header");
|
||||
}
|
||||
retval = (type->copy) (oh->mesg[idx].native, mesg);
|
||||
if (oh->mesg[idx].flags & H5O_FLAG_SHARED) {
|
||||
/*
|
||||
* If the message is shared then then the native pointer points to an
|
||||
* H5O_SHARED message. We use that information to look up the real
|
||||
* message in the global heap.
|
||||
*/
|
||||
H5O_shared_t *shared;
|
||||
void *tmp_buf, *tmp_mesg;
|
||||
|
||||
shared = (H5O_shared_t *)(oh->mesg[idx].native);
|
||||
if (NULL==(tmp_buf = H5HG_read (ent->file, shared, NULL))) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_CANTLOAD, NULL,
|
||||
"unable to read shared message from global heap");
|
||||
}
|
||||
tmp_mesg = (type->decode)(ent->file, tmp_buf, shared);
|
||||
if (!tmp_mesg) {
|
||||
H5MM_xfree (tmp_buf);
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_CANTLOAD, NULL,
|
||||
"unable to decode object header shared message");
|
||||
}
|
||||
if (mesg) {
|
||||
HDmemcpy (mesg, tmp_mesg, type->native_size);
|
||||
H5MM_xfree (tmp_mesg);
|
||||
} else {
|
||||
ret_value = tmp_mesg;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* The message is not shared, but rather exists in the object
|
||||
* header. The object header caches the native message (along with
|
||||
* the raw message) so we must copy the native message before
|
||||
* returning.
|
||||
*/
|
||||
if (NULL==(ret_value = (type->copy) (oh->mesg[idx].native, mesg))) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_CANTINIT, NULL,
|
||||
"unable to copy message to user space");
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
if (H5AC_unprotect(ent->file, H5AC_OHDR, &(ent->header), oh) < 0) {
|
||||
HRETURN_ERROR(H5E_OHDR, H5E_PROTECT, NULL,
|
||||
"unable to release object header");
|
||||
}
|
||||
oh = NULL;
|
||||
|
||||
if (!retval) {
|
||||
HRETURN_ERROR(H5E_OHDR, H5E_CANTINIT, NULL,
|
||||
"unable to copy object header message to user space");
|
||||
}
|
||||
FUNC_LEAVE(retval);
|
||||
FUNC_LEAVE(ret_value);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_find_in_ohdr
|
||||
@ -812,23 +857,24 @@ static intn
|
||||
H5O_find_in_ohdr(H5F_t *f, const haddr_t *addr, const H5O_class_t **type_p,
|
||||
intn sequence)
|
||||
{
|
||||
H5O_t *oh = NULL;
|
||||
int i;
|
||||
H5O_t *oh = NULL;
|
||||
int i;
|
||||
const H5O_class_t *type = NULL;
|
||||
|
||||
FUNC_ENTER(H5O_find_in_ohdr, FAIL);
|
||||
|
||||
/* check args */
|
||||
/* Check args */
|
||||
assert(f);
|
||||
assert(addr && H5F_addr_defined(addr));
|
||||
assert(type_p);
|
||||
|
||||
/* load the object header */
|
||||
/* Load the object header */
|
||||
if (NULL == (oh = H5AC_find(f, H5AC_OHDR, addr, NULL, NULL))) {
|
||||
HRETURN_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL,
|
||||
"unable to load object header");
|
||||
}
|
||||
|
||||
/* scan through the messages looking for the right one */
|
||||
/* Scan through the messages looking for the right one */
|
||||
for (i = 0; i < oh->nmesgs; i++) {
|
||||
if (*type_p && (*type_p)->id != oh->mesg[i].type->id) continue;
|
||||
if (--sequence < 0) break;
|
||||
@ -838,24 +884,32 @@ H5O_find_in_ohdr(H5F_t *f, const haddr_t *addr, const H5O_class_t **type_p,
|
||||
"unable to find object header message");
|
||||
}
|
||||
|
||||
/* decode the message if necessary */
|
||||
/*
|
||||
* Decode the message if necessary. If the message is shared then decode
|
||||
* a shared message, ignoring the message type.
|
||||
*/
|
||||
if (oh->mesg[i].flags & H5O_FLAG_SHARED) {
|
||||
type = H5O_SHARED;
|
||||
} else {
|
||||
type = oh->mesg[i].type;
|
||||
}
|
||||
if (NULL == oh->mesg[i].native) {
|
||||
assert(oh->mesg[i].type->decode);
|
||||
assert (oh->mesg[i].raw_size==H5O_ALIGN (oh->mesg[i].raw_size));
|
||||
oh->mesg[i].native = (oh->mesg[i].type->decode) (f,
|
||||
oh->mesg[i].raw_size,
|
||||
oh->mesg[i].raw);
|
||||
assert(type->decode);
|
||||
oh->mesg[i].native = (type->decode) (f, oh->mesg[i].raw, NULL);
|
||||
if (NULL == oh->mesg[i].native) {
|
||||
HRETURN_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL,
|
||||
"unable to decode message");
|
||||
}
|
||||
}
|
||||
|
||||
/*return the message type */
|
||||
/*
|
||||
* Return the message type. If this is a shared message then return the
|
||||
* pointed-to type.
|
||||
*/
|
||||
*type_p = oh->mesg[i].type;
|
||||
|
||||
FUNC_LEAVE(i);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_modify
|
||||
@ -898,10 +952,11 @@ intn
|
||||
H5O_modify(H5G_entry_t *ent, const H5O_class_t *type, intn overwrite,
|
||||
uintn flags, const void *mesg)
|
||||
{
|
||||
H5O_t *oh = NULL;
|
||||
intn idx, sequence;
|
||||
intn ret_value = FAIL;
|
||||
size_t size;
|
||||
H5O_t *oh = NULL;
|
||||
intn idx, sequence;
|
||||
intn ret_value = FAIL;
|
||||
size_t size = 0;
|
||||
H5O_shared_t *sh_mesg = NULL;
|
||||
|
||||
FUNC_ENTER(H5O_modify, FAIL);
|
||||
|
||||
@ -911,6 +966,7 @@ H5O_modify(H5G_entry_t *ent, const H5O_class_t *type, intn overwrite,
|
||||
assert(H5F_addr_defined(&(ent->header)));
|
||||
assert(type);
|
||||
assert(mesg);
|
||||
assert (0==(flags & ~H5O_FLAG_BITS));
|
||||
|
||||
if (NULL == (oh = H5AC_protect(ent->file, H5AC_OHDR, &(ent->header),
|
||||
NULL, NULL))) {
|
||||
@ -937,27 +993,59 @@ H5O_modify(H5G_entry_t *ent, const H5O_class_t *type, intn overwrite,
|
||||
}
|
||||
if (overwrite < 0) {
|
||||
/* Allocate space for the new message */
|
||||
size = (type->raw_size) (ent->file, mesg);
|
||||
if (flags & H5O_FLAG_SHARED) {
|
||||
if (NULL==type->share) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_UNSUPPORTED, FAIL,
|
||||
"message class is not sharable");
|
||||
}
|
||||
sh_mesg = H5MM_xcalloc (1, sizeof *sh_mesg);
|
||||
if ((type->share)(ent->file, mesg, sh_mesg/*out*/)<0) {
|
||||
/*
|
||||
* If the message isn't shared then turn of the shared bit
|
||||
* and treat it as an unshared message.
|
||||
*/
|
||||
H5E_clear ();
|
||||
flags &= ~H5O_FLAG_SHARED;
|
||||
} else {
|
||||
if (H5HG_link (ent->file, sh_mesg, 1)<0) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_LINK, FAIL,
|
||||
"unable to adjust shared object link count");
|
||||
}
|
||||
size = (H5O_SHARED->raw_size)(ent->file, sh_mesg);
|
||||
}
|
||||
}
|
||||
if (0==(flags & H5O_FLAG_SHARED)) {
|
||||
size = (type->raw_size) (ent->file, mesg);
|
||||
}
|
||||
size = H5O_ALIGN(size);
|
||||
idx = H5O_alloc(ent->file, oh, type, size);
|
||||
if (idx < 0) {
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL,
|
||||
"unable to allocate object header space for message");
|
||||
"unable to allocate space for message");
|
||||
}
|
||||
sequence++;
|
||||
|
||||
} else if (oh->mesg[idx].constant) {
|
||||
|
||||
} else if (oh->mesg[idx].flags & H5O_FLAG_CONSTANT) {
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
|
||||
"unable to modify constant message");
|
||||
} else if (oh->mesg[idx].flags & H5O_FLAG_SHARED) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_WRITEERROR, FAIL,
|
||||
"unable to modify shared (constant) message");
|
||||
}
|
||||
|
||||
|
||||
/* Copy the native value into the object header */
|
||||
oh->mesg[idx].native = (type->copy) (mesg, oh->mesg[idx].native);
|
||||
if (NULL == oh->mesg[idx].native) {
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL,
|
||||
"unable to copy message to object header");
|
||||
if (flags & H5O_FLAG_SHARED) {
|
||||
oh->mesg[idx].native = sh_mesg;
|
||||
} else {
|
||||
oh->mesg[idx].native = (type->copy) (mesg, oh->mesg[idx].native);
|
||||
if (NULL == oh->mesg[idx].native) {
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL,
|
||||
"unable to copy message to object header");
|
||||
}
|
||||
}
|
||||
oh->mesg[idx].constant = (flags & H5O_FLAG_CONSTANT) ? TRUE : FALSE;
|
||||
|
||||
oh->mesg[idx].flags = flags;
|
||||
oh->mesg[idx].dirty = TRUE;
|
||||
oh->dirty = TRUE;
|
||||
ret_value = sequence;
|
||||
@ -967,8 +1055,10 @@ H5O_modify(H5G_entry_t *ent, const H5O_class_t *type, intn overwrite,
|
||||
HRETURN_ERROR(H5E_OHDR, H5E_PROTECT, FAIL,
|
||||
"unable to release object header");
|
||||
}
|
||||
|
||||
FUNC_LEAVE(ret_value);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_remove
|
||||
@ -1000,9 +1090,10 @@ H5O_modify(H5G_entry_t *ent, const H5O_class_t *type, intn overwrite,
|
||||
herr_t
|
||||
H5O_remove(H5G_entry_t *ent, const H5O_class_t *type, intn sequence)
|
||||
{
|
||||
H5O_t *oh = NULL;
|
||||
intn i, seq, nfailed = 0;
|
||||
herr_t ret_value = FAIL;
|
||||
H5O_t *oh = NULL;
|
||||
intn i, seq, nfailed = 0;
|
||||
herr_t ret_value = FAIL;
|
||||
H5O_shared_t *sh_mesg = NULL;
|
||||
|
||||
FUNC_ENTER(H5O_remove, FAIL);
|
||||
|
||||
@ -1018,6 +1109,7 @@ H5O_remove(H5G_entry_t *ent, const H5O_class_t *type, intn sequence)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL,
|
||||
"unable to load object header");
|
||||
}
|
||||
|
||||
for (i = seq = 0; i < oh->nmesgs; i++) {
|
||||
if (type->id != oh->mesg[i].type->id) continue;
|
||||
if (seq++ == sequence || H5O_ALL == sequence) {
|
||||
@ -1025,11 +1117,27 @@ H5O_remove(H5G_entry_t *ent, const H5O_class_t *type, intn sequence)
|
||||
* Keep track of how many times we failed trying to remove constant
|
||||
* messages.
|
||||
*/
|
||||
if (oh->mesg[i].constant) {
|
||||
if (oh->mesg[i].flags & H5O_FLAG_CONSTANT) {
|
||||
nfailed++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (oh->mesg[i].flags & H5O_FLAG_SHARED) {
|
||||
if (NULL==oh->mesg[i].native) {
|
||||
sh_mesg = (H5O_SHARED->decode)(ent->file, oh->mesg[i].raw,
|
||||
NULL);
|
||||
if (NULL==(oh->mesg[i].native = sh_mesg)) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_CANTDECODE, FAIL,
|
||||
"unable to decode shared message info");
|
||||
}
|
||||
}
|
||||
if (H5HG_link (ent->file, sh_mesg, -1)<0) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_LINK, FAIL,
|
||||
"unable to decrement link count on shared "
|
||||
"message");
|
||||
}
|
||||
}
|
||||
|
||||
/* change message type to nil and zero it */
|
||||
oh->mesg[i].type = H5O_NULL;
|
||||
HDmemset(oh->mesg[i].raw, 0, oh->mesg[i].raw_size);
|
||||
@ -1055,6 +1163,7 @@ H5O_remove(H5G_entry_t *ent, const H5O_class_t *type, intn sequence)
|
||||
}
|
||||
FUNC_LEAVE(ret_value);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_alloc_extend_chunk
|
||||
@ -1083,9 +1192,9 @@ H5O_remove(H5G_entry_t *ent, const H5O_class_t *type, intn sequence)
|
||||
static intn
|
||||
H5O_alloc_extend_chunk(H5O_t *oh, intn chunkno, size_t size)
|
||||
{
|
||||
intn idx, i;
|
||||
size_t delta;
|
||||
uint8 *old_addr;
|
||||
intn idx, i;
|
||||
size_t delta;
|
||||
uint8 *old_addr;
|
||||
|
||||
FUNC_ENTER(H5O_alloc_extend_chunk, FAIL);
|
||||
|
||||
@ -1167,6 +1276,7 @@ H5O_alloc_extend_chunk(H5O_t *oh, intn chunkno, size_t size)
|
||||
}
|
||||
FUNC_LEAVE(idx);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_alloc_new_chunk
|
||||
@ -1339,6 +1449,7 @@ H5O_alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size)
|
||||
|
||||
FUNC_LEAVE(idx);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_alloc
|
||||
@ -1360,9 +1471,9 @@ H5O_alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size)
|
||||
static intn
|
||||
H5O_alloc(H5F_t *f, H5O_t *oh, const H5O_class_t *type, size_t size)
|
||||
{
|
||||
intn chunkno;
|
||||
intn idx;
|
||||
intn null_idx;
|
||||
intn chunkno;
|
||||
intn idx;
|
||||
intn null_idx;
|
||||
|
||||
FUNC_ENTER(H5O_alloc, FAIL);
|
||||
|
||||
@ -1441,6 +1552,60 @@ H5O_alloc(H5F_t *f, H5O_t *oh, const H5O_class_t *type, size_t size)
|
||||
oh->dirty = TRUE;
|
||||
FUNC_LEAVE(idx);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_share
|
||||
*
|
||||
* Purpose: Writes a message to the global heap.
|
||||
*
|
||||
* Return: Success: SUCCEED, and HOBJ describes the global heap
|
||||
* object.
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, April 2, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5O_share (H5F_t *f, const H5O_class_t *type, const void *mesg,
|
||||
H5HG_t *hobj/*out*/)
|
||||
{
|
||||
size_t size;
|
||||
void *buf = NULL;
|
||||
herr_t ret_value = FAIL;
|
||||
|
||||
FUNC_ENTER (H5O_share, FAIL);
|
||||
|
||||
/* Check args */
|
||||
assert (f);
|
||||
assert (type);
|
||||
assert (mesg);
|
||||
assert (hobj);
|
||||
|
||||
/* Encode the message put it in the global heap */
|
||||
if ((size = (type->raw_size)(f, mesg))>0) {
|
||||
buf = H5MM_xmalloc (size);
|
||||
if ((type->encode)(f, buf, mesg)<0) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_CANTENCODE, FAIL,
|
||||
"unable to encode message");
|
||||
}
|
||||
if (H5HG_insert (f, size, buf, hobj)<0) {
|
||||
HGOTO_ERROR (H5E_OHDR, H5E_CANTINIT, FAIL,
|
||||
"unable to store message in global heap");
|
||||
}
|
||||
}
|
||||
ret_value = SUCCEED;
|
||||
|
||||
done:
|
||||
H5MM_xfree (buf);
|
||||
FUNC_LEAVE (ret_value);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_debug
|
||||
@ -1463,12 +1628,14 @@ herr_t
|
||||
H5O_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
|
||||
intn fwidth)
|
||||
{
|
||||
H5O_t *oh = NULL;
|
||||
intn i, chunkno;
|
||||
size_t mesg_total = 0, chunk_total = 0;
|
||||
int *sequence;
|
||||
haddr_t tmp_addr;
|
||||
herr_t ret_value = FAIL;
|
||||
H5O_t *oh = NULL;
|
||||
intn i, chunkno;
|
||||
size_t mesg_total = 0, chunk_total = 0;
|
||||
int *sequence;
|
||||
haddr_t tmp_addr;
|
||||
herr_t ret_value = FAIL;
|
||||
void *(*decode)(H5F_t*, const uint8*, H5HG_t*);
|
||||
herr_t (*debug)(H5F_t*, const void*, FILE*, intn, intn)=NULL;
|
||||
|
||||
FUNC_ENTER(H5O_debug, FAIL);
|
||||
|
||||
@ -1540,6 +1707,7 @@ H5O_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
|
||||
oh->mesg[i].type->id);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* message name and size */
|
||||
fprintf(stream, "%*s%-*s 0x%04x %s(%d)\n",
|
||||
indent + 3, "", MAX(0, fwidth - 3),
|
||||
@ -1547,12 +1715,20 @@ H5O_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
|
||||
(unsigned) (oh->mesg[i].type->id),
|
||||
oh->mesg[i].type->name,
|
||||
sequence[oh->mesg[i].type->id]++);
|
||||
fprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0, fwidth - 3),
|
||||
"Raw size in bytes:",
|
||||
(unsigned long) (oh->mesg[i].raw_size));
|
||||
fprintf (stream, "%*s%-*s %s\n", indent+3, "", MAX (0, fwidth-3),
|
||||
"Shared message:",
|
||||
(oh->mesg[i].flags & H5O_FLAG_SHARED) ? "Yes" : "No");
|
||||
fprintf(stream, "%*s%-*s %s\n", indent + 3, "", MAX(0, fwidth - 3),
|
||||
"Constant:",
|
||||
oh->mesg[i].constant ? "Yes" : "No");
|
||||
(oh->mesg[i].flags & H5O_FLAG_CONSTANT) ? "Yes" : "No");
|
||||
if (oh->mesg[i].flags & ~H5O_FLAG_BITS) {
|
||||
fprintf (stream, "%*s%-*s 0x%02x\n", indent+3,"",MAX(0,fwidth-3),
|
||||
"*** ADDITIONAL UNKNOWN FLAGS --->",
|
||||
oh->mesg[i].flags & ~H5O_FLAG_BITS);
|
||||
}
|
||||
fprintf(stream, "%*s%-*s %lu bytes\n", indent+3, "", MAX(0,fwidth-3),
|
||||
"Raw size in obj header:",
|
||||
(unsigned long) (oh->mesg[i].raw_size));
|
||||
fprintf(stream, "%*s%-*s %d\n", indent + 3, "", MAX(0, fwidth - 3),
|
||||
"Chunk number:",
|
||||
(int) (oh->mesg[i].chunkno));
|
||||
@ -1560,25 +1736,47 @@ H5O_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
|
||||
if (chunkno < 0 || chunkno >= oh->nchunks) {
|
||||
fprintf(stream, "*** BAD CHUNK NUMBER\n");
|
||||
}
|
||||
|
||||
/* check the size */
|
||||
if ((oh->mesg[i].raw + oh->mesg[i].raw_size >
|
||||
oh->chunk[chunkno].image + oh->chunk[chunkno].size) ||
|
||||
(oh->mesg[i].raw < oh->chunk[chunkno].image)) {
|
||||
fprintf(stream, "*** BAD MESSAGE RAW ADDRESS\n");
|
||||
}
|
||||
|
||||
/* decode the message */
|
||||
if (NULL == oh->mesg[i].native && oh->mesg[i].type->decode) {
|
||||
oh->mesg[i].native = (oh->mesg[i].type->decode) (f,
|
||||
oh->mesg[i].raw_size,
|
||||
oh->mesg[i].raw);
|
||||
if (oh->mesg[i].flags & H5O_FLAG_SHARED) {
|
||||
decode = H5O_SHARED->decode;
|
||||
debug = H5O_SHARED->debug;
|
||||
} else {
|
||||
decode = oh->mesg[i].type->decode;
|
||||
debug = oh->mesg[i].type->debug;
|
||||
}
|
||||
oh->mesg[i].native = (decode)(f, oh->mesg[i].raw, NULL);
|
||||
} else {
|
||||
debug = NULL;
|
||||
}
|
||||
|
||||
/* print the message */
|
||||
if (oh->mesg[i].type->debug) {
|
||||
(oh->mesg[i].type->debug)(f, oh->mesg[i].native, stream, indent+3,
|
||||
MAX(0, fwidth-3));
|
||||
if (debug) {
|
||||
(debug)(f, oh->mesg[i].native, stream, indent+3, MAX(0, fwidth-3));
|
||||
} else {
|
||||
fprintf(stream, "%*sNo info for this message.\n", indent + 3, "");
|
||||
}
|
||||
|
||||
/* If the message is shared then also print the pointed-to message */
|
||||
if (oh->mesg[i].flags & H5O_FLAG_SHARED) {
|
||||
void *p = H5HG_read (f, oh->mesg[i].native, NULL);
|
||||
void *mesg = (oh->mesg[i].type->decode)(f, p, oh->mesg[i].native);
|
||||
if (oh->mesg[i].type->debug) {
|
||||
(oh->mesg[i].type->debug)(f, mesg, stream, indent+3,
|
||||
MAX (0, fwidth-3));
|
||||
}
|
||||
H5O_reset (oh->mesg[i].type, mesg);
|
||||
H5MM_xfree (mesg);
|
||||
H5MM_xfree (p);
|
||||
}
|
||||
}
|
||||
sequence = H5MM_xfree(sequence);
|
||||
|
||||
|
@ -25,9 +25,8 @@
|
||||
#define PABLO_MASK H5O_cont_mask
|
||||
|
||||
/* PRIVATE PROTOTYPES */
|
||||
static void *H5O_cont_decode(H5F_t *f, size_t raw_size, const uint8 *p);
|
||||
static herr_t H5O_cont_encode(H5F_t *f, size_t size, uint8 *p,
|
||||
const void *_mesg);
|
||||
static void *H5O_cont_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj);
|
||||
static herr_t H5O_cont_encode(H5F_t *f, uint8 *p, const void *_mesg);
|
||||
static herr_t H5O_cont_debug(H5F_t *f, const void *_mesg, FILE * stream,
|
||||
intn indent, intn fwidth);
|
||||
|
||||
@ -41,6 +40,7 @@ const H5O_class_t H5O_CONT[1] = {{
|
||||
NULL, /*no copy method */
|
||||
NULL, /*no size method */
|
||||
NULL, /*default reset method */
|
||||
NULL, /*no share method */
|
||||
H5O_cont_debug, /*debugging */
|
||||
}};
|
||||
|
||||
@ -65,8 +65,8 @@ static intn interface_initialize_g = FALSE;
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void *
|
||||
H5O_cont_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
static void *
|
||||
H5O_cont_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj)
|
||||
{
|
||||
H5O_cont_t *cont = NULL;
|
||||
|
||||
@ -74,8 +74,8 @@ H5O_cont_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(raw_size == H5O_ALIGN (H5F_SIZEOF_ADDR(f) + H5F_SIZEOF_SIZE(f)));
|
||||
assert(p);
|
||||
assert (!hobj || !H5HG_defined (hobj));
|
||||
|
||||
/* decode */
|
||||
cont = H5MM_xcalloc(1, sizeof(H5O_cont_t));
|
||||
@ -103,7 +103,7 @@ H5O_cont_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_cont_encode(H5F_t *f, size_t size, uint8 *p, const void *_mesg)
|
||||
H5O_cont_encode(H5F_t *f, uint8 *p, const void *_mesg)
|
||||
{
|
||||
const H5O_cont_t *cont = (const H5O_cont_t *) _mesg;
|
||||
|
||||
@ -111,7 +111,6 @@ H5O_cont_encode(H5F_t *f, size_t size, uint8 *p, const void *_mesg)
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(size == H5O_ALIGN (H5F_SIZEOF_ADDR(f) + H5F_SIZEOF_SIZE(f)));
|
||||
assert(p);
|
||||
assert(cont);
|
||||
|
||||
|
@ -28,29 +28,28 @@ static char RcsId[] = "@(#)$Revision$";
|
||||
#define PABLO_MASK H5O_dtype_mask
|
||||
|
||||
/* PRIVATE PROTOTYPES */
|
||||
static herr_t H5O_dtype_encode(H5F_t *f, size_t raw_size, uint8 *p,
|
||||
const void *mesg);
|
||||
static void *H5O_dtype_decode(H5F_t *f, size_t raw_size, const uint8 *p);
|
||||
static void *H5O_dtype_copy(const void *_mesg, void *_dest);
|
||||
static size_t H5O_dtype_size(H5F_t *f, const void *_mesg);
|
||||
static herr_t H5O_dtype_reset(void *_mesg);
|
||||
static herr_t H5O_dtype_debug(H5F_t *f, const void *_mesg,
|
||||
FILE * stream, intn indent, intn fwidth);
|
||||
static herr_t H5O_dtype_encode (H5F_t *f, uint8 *p, const void *mesg);
|
||||
static void *H5O_dtype_decode (H5F_t *f, const uint8 *p, H5HG_t *hobj);
|
||||
static void *H5O_dtype_copy (const void *_mesg, void *_dest);
|
||||
static size_t H5O_dtype_size (H5F_t *f, const void *_mesg);
|
||||
static herr_t H5O_dtype_reset (void *_mesg);
|
||||
static herr_t H5O_dtype_debug (H5F_t *f, const void *_mesg,
|
||||
FILE * stream, intn indent, intn fwidth);
|
||||
static herr_t H5O_dtype_share (H5F_t *f, const void *_mesg, H5HG_t *hobj);
|
||||
|
||||
/* This message derives from H5O */
|
||||
const H5O_class_t H5O_DTYPE[1] =
|
||||
{
|
||||
{
|
||||
H5O_DTYPE_ID, /* message id number */
|
||||
"data_type", /* message name for debugging */
|
||||
sizeof(H5T_t), /* native message size */
|
||||
H5O_dtype_decode, /* decode message */
|
||||
H5O_dtype_encode, /* encode message */
|
||||
H5O_dtype_copy, /* copy the native value */
|
||||
H5O_dtype_size, /* size of raw message */
|
||||
H5O_dtype_reset, /* reset method */
|
||||
H5O_dtype_debug, /* debug the message */
|
||||
}};
|
||||
const H5O_class_t H5O_DTYPE[1] = {{
|
||||
H5O_DTYPE_ID, /* message id number */
|
||||
"data_type", /* message name for debugging */
|
||||
sizeof(H5T_t), /* native message size */
|
||||
H5O_dtype_decode, /* decode message */
|
||||
H5O_dtype_encode, /* encode message */
|
||||
H5O_dtype_copy, /* copy the native value */
|
||||
H5O_dtype_size, /* size of raw message */
|
||||
H5O_dtype_reset, /* reset method */
|
||||
H5O_dtype_share, /* share method */
|
||||
H5O_dtype_debug, /* debug the message */
|
||||
}};
|
||||
|
||||
/* Interface initialization */
|
||||
static hbool_t interface_initialize_g = FALSE;
|
||||
@ -436,8 +435,8 @@ H5O_dtype_encode_helper(uint8 **pp, const H5T_t *dt)
|
||||
into a struct in memory native format. The struct is allocated within this
|
||||
function using malloc() and is returned to the caller.
|
||||
--------------------------------------------------------------------------*/
|
||||
static void *
|
||||
H5O_dtype_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
static void *
|
||||
H5O_dtype_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj)
|
||||
{
|
||||
H5T_t *dt = NULL;
|
||||
|
||||
@ -445,7 +444,6 @@ H5O_dtype_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(raw_size > 0);
|
||||
assert(p);
|
||||
|
||||
dt = H5MM_xcalloc(1, sizeof(H5T_t));
|
||||
@ -455,7 +453,10 @@ H5O_dtype_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL,
|
||||
"can't decode type");
|
||||
}
|
||||
assert(raw_size == H5O_ALIGN (H5O_dtype_size(f, (void *) dt)));
|
||||
if (hobj) {
|
||||
dt->sh_heap = *hobj;
|
||||
dt->sh_file = f;
|
||||
}
|
||||
|
||||
FUNC_LEAVE(dt);
|
||||
}
|
||||
@ -478,7 +479,7 @@ H5O_dtype_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
message in the "raw" disk form.
|
||||
--------------------------------------------------------------------------*/
|
||||
static herr_t
|
||||
H5O_dtype_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *mesg)
|
||||
H5O_dtype_encode(H5F_t *f, uint8 *p, const void *mesg)
|
||||
{
|
||||
const H5T_t *dt = (const H5T_t *) mesg;
|
||||
|
||||
@ -486,7 +487,6 @@ H5O_dtype_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *mesg)
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(raw_size == H5O_ALIGN (H5O_dtype_size(f, mesg)));
|
||||
assert(p);
|
||||
assert(dt);
|
||||
|
||||
@ -625,6 +625,45 @@ H5O_dtype_reset(void *_mesg)
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_dtype_share
|
||||
*
|
||||
* Purpose: Returns, through argument HOBJ, whether a data type is shared
|
||||
* in the specified file.
|
||||
*
|
||||
* Return: Success: SUCCEED if the data type is shared in file F,
|
||||
* and HOBJ is set to the global heap address.
|
||||
*
|
||||
* Failure: FAIL if the data type is not shared, or
|
||||
* shared but not in file F. The value of HOBJ
|
||||
* is undefined.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, April 2, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_dtype_share (H5F_t *f, const void *_mesg, H5HG_t *hobj/*out*/)
|
||||
{
|
||||
const H5T_t *dt = (const H5T_t *)_mesg;
|
||||
|
||||
FUNC_ENTER (H5O_dtype_share, FAIL);
|
||||
|
||||
if (!H5HG_defined (&(dt->sh_heap)) ||
|
||||
NULL==dt->sh_file ||
|
||||
dt->sh_file->shared != f->shared) {
|
||||
HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,
|
||||
"data type is not shared");
|
||||
}
|
||||
|
||||
*hobj = dt->sh_heap;
|
||||
FUNC_LEAVE (SUCCEED);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
NAME
|
||||
H5O_dtype_debug
|
||||
|
12
src/H5Oefl.c
12
src/H5Oefl.c
@ -14,9 +14,8 @@
|
||||
#define PABLO_MASK H5O_efl_mask
|
||||
|
||||
/* PRIVATE PROTOTYPES */
|
||||
static void *H5O_efl_decode(H5F_t *f, size_t raw_size, const uint8 *p);
|
||||
static herr_t H5O_efl_encode(H5F_t *f, size_t size, uint8 *p,
|
||||
const void *_mesg);
|
||||
static void *H5O_efl_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj);
|
||||
static herr_t H5O_efl_encode(H5F_t *f, uint8 *p, const void *_mesg);
|
||||
static void *H5O_efl_copy(const void *_mesg, void *_dest);
|
||||
static size_t H5O_efl_size(H5F_t *f, const void *_mesg);
|
||||
static herr_t H5O_efl_reset(void *_mesg);
|
||||
@ -33,6 +32,7 @@ const H5O_class_t H5O_EFL[1] = {{
|
||||
H5O_efl_copy, /*copy native value */
|
||||
H5O_efl_size, /*size of message on disk */
|
||||
H5O_efl_reset, /*reset method */
|
||||
NULL, /*no share method */
|
||||
H5O_efl_debug, /*debug the message */
|
||||
}};
|
||||
|
||||
@ -59,7 +59,7 @@ static hbool_t interface_initialize_g = FALSE;
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void *
|
||||
H5O_efl_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
H5O_efl_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj)
|
||||
{
|
||||
H5O_efl_t *mesg = NULL;
|
||||
int i;
|
||||
@ -70,6 +70,7 @@ H5O_efl_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
/* Check args */
|
||||
assert(f);
|
||||
assert(p);
|
||||
assert (!hobj || !H5HG_defined (hobj));
|
||||
|
||||
/* Decode the header */
|
||||
mesg = H5MM_xcalloc(1, sizeof(H5O_efl_t));
|
||||
@ -122,7 +123,7 @@ H5O_efl_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_efl_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
|
||||
H5O_efl_encode(H5F_t *f, uint8 *p, const void *_mesg)
|
||||
{
|
||||
const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg;
|
||||
int i;
|
||||
@ -134,7 +135,6 @@ H5O_efl_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(mesg);
|
||||
assert(raw_size == H5O_ALIGN (H5O_efl_size(f, _mesg)));
|
||||
assert(p);
|
||||
|
||||
/* Encode header */
|
||||
|
@ -14,9 +14,8 @@
|
||||
#include <H5Oprivate.h>
|
||||
|
||||
/* PRIVATE PROTOTYPES */
|
||||
static void *H5O_layout_decode(H5F_t *f, size_t raw_size, const uint8 *p);
|
||||
static herr_t H5O_layout_encode(H5F_t *f, size_t size, uint8 *p,
|
||||
const void *_mesg);
|
||||
static void *H5O_layout_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj);
|
||||
static herr_t H5O_layout_encode(H5F_t *f, uint8 *p, const void *_mesg);
|
||||
static void *H5O_layout_copy(const void *_mesg, void *_dest);
|
||||
static size_t H5O_layout_size(H5F_t *f, const void *_mesg);
|
||||
static herr_t H5O_layout_debug(H5F_t *f, const void *_mesg, FILE * stream,
|
||||
@ -32,6 +31,7 @@ const H5O_class_t H5O_LAYOUT[1] = {{
|
||||
H5O_layout_copy, /*copy the native value */
|
||||
H5O_layout_size, /*size of message on disk */
|
||||
NULL, /*reset method */
|
||||
NULL, /*no share method */
|
||||
H5O_layout_debug, /*debug the message */
|
||||
}};
|
||||
|
||||
@ -58,8 +58,8 @@ static hbool_t interface_initialize_g = FALSE;
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void *
|
||||
H5O_layout_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
static void *
|
||||
H5O_layout_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj)
|
||||
{
|
||||
H5O_layout_t *mesg = NULL;
|
||||
intn i;
|
||||
@ -69,12 +69,12 @@ H5O_layout_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(p);
|
||||
assert (!hobj || !H5HG_defined (hobj));
|
||||
|
||||
/* decode */
|
||||
mesg = H5MM_xcalloc(1, sizeof(H5O_layout_t));
|
||||
H5F_addr_decode(f, &p, &(mesg->addr));
|
||||
mesg->ndims = *p++;
|
||||
assert(raw_size == H5O_ALIGN (H5O_layout_size(f, mesg)));
|
||||
|
||||
/* Layout class */
|
||||
mesg->type = *p++;
|
||||
@ -108,7 +108,7 @@ H5O_layout_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_layout_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
|
||||
H5O_layout_encode(H5F_t *f, uint8 *p, const void *_mesg)
|
||||
{
|
||||
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
|
||||
int i;
|
||||
@ -119,7 +119,6 @@ H5O_layout_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
|
||||
assert(f);
|
||||
assert(mesg);
|
||||
assert(mesg->ndims > 0 && mesg->ndims <= H5O_LAYOUT_NDIMS);
|
||||
assert(raw_size == H5O_ALIGN (H5O_layout_size(f, _mesg)));
|
||||
assert(p);
|
||||
|
||||
/* data or B-tree address */
|
||||
|
@ -22,9 +22,8 @@
|
||||
#define PABLO_MASK H5O_name_mask
|
||||
|
||||
/* PRIVATE PROTOTYPES */
|
||||
static void *H5O_name_decode(H5F_t *f, size_t raw_size, const uint8 *p);
|
||||
static herr_t H5O_name_encode(H5F_t *f, size_t raw_size, uint8 *p,
|
||||
const void *_mesg);
|
||||
static void *H5O_name_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj);
|
||||
static herr_t H5O_name_encode(H5F_t *f, uint8 *p, const void *_mesg);
|
||||
static void *H5O_name_copy(const void *_mesg, void *_dest);
|
||||
static size_t H5O_name_size(H5F_t *f, const void *_mesg);
|
||||
static herr_t H5O_name_reset(void *_mesg);
|
||||
@ -41,6 +40,7 @@ const H5O_class_t H5O_NAME[1] = {{
|
||||
H5O_name_copy, /*copy the native value */
|
||||
H5O_name_size, /*raw message size */
|
||||
H5O_name_reset, /*free internal memory */
|
||||
NULL, /*no share method */
|
||||
H5O_name_debug, /*debug the message */
|
||||
}};
|
||||
|
||||
@ -67,23 +67,22 @@ static hbool_t interface_initialize_g = FALSE;
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void *
|
||||
H5O_name_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
static void *
|
||||
H5O_name_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj)
|
||||
{
|
||||
H5O_name_t *mesg;
|
||||
char *s;
|
||||
|
||||
FUNC_ENTER(H5O_name_decode, NULL);
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(p);
|
||||
assert (!hobj || !H5HG_defined (hobj));
|
||||
|
||||
/* decode */
|
||||
mesg = H5MM_xcalloc(1, sizeof(H5O_name_t));
|
||||
s = H5MM_xmalloc(raw_size);
|
||||
HDmemcpy(s, p, raw_size);
|
||||
mesg->s = s;
|
||||
mesg->s = H5MM_xmalloc (strlen ((const char*)p)+1);
|
||||
strcpy (mesg->s, (const char*)p);
|
||||
|
||||
FUNC_LEAVE(mesg);
|
||||
}
|
||||
@ -106,10 +105,9 @@ H5O_name_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_name_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
|
||||
H5O_name_encode(H5F_t *f, uint8 *p, const void *_mesg)
|
||||
{
|
||||
const H5O_name_t *mesg = (const H5O_name_t *) _mesg;
|
||||
size_t size;
|
||||
|
||||
FUNC_ENTER(H5O_name_encode, FAIL);
|
||||
|
||||
@ -118,14 +116,8 @@ H5O_name_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
|
||||
assert(p);
|
||||
assert(mesg && mesg->s);
|
||||
|
||||
/* message size */
|
||||
size = HDstrlen(mesg->s) + 1;
|
||||
assert(size <= raw_size);
|
||||
|
||||
/* encode */
|
||||
HDmemcpy(p, mesg->s, size);
|
||||
HDmemset(p + size, 0, raw_size - size);
|
||||
|
||||
strcpy ((char*)p, mesg->s);
|
||||
FUNC_LEAVE(SUCCEED);
|
||||
}
|
||||
|
||||
@ -255,10 +247,10 @@ H5O_name_reset(void *_mesg)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_name_debug(H5F_t *f, const void *_mesg, FILE * stream,
|
||||
intn indent, intn fwidth)
|
||||
H5O_name_debug(H5F_t *f, const void *_mesg, FILE *stream, intn indent,
|
||||
intn fwidth)
|
||||
{
|
||||
const H5O_name_t *mesg = (const H5O_name_t *) _mesg;
|
||||
const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
|
||||
|
||||
FUNC_ENTER(H5O_name_debug, FAIL);
|
||||
|
||||
|
@ -29,5 +29,6 @@ const H5O_class_t H5O_NULL[1] = {{
|
||||
NULL, /*no copy method */
|
||||
NULL, /*no size method */
|
||||
NULL, /*no reset method */
|
||||
NULL, /*no share method */
|
||||
NULL, /*no debug method */
|
||||
}};
|
||||
|
@ -19,10 +19,11 @@
|
||||
|
||||
#include <H5Opublic.h>
|
||||
|
||||
/* Private headers neede by this file */
|
||||
/* Private headers needed by this file */
|
||||
#include <H5private.h>
|
||||
#include <H5Fprivate.h>
|
||||
#include <H5Gprivate.h>
|
||||
#include <H5HGprivate.h>
|
||||
#include <H5Tprivate.h>
|
||||
#include <H5Sprivate.h>
|
||||
|
||||
@ -40,9 +41,10 @@
|
||||
#define H5O_NEW_MESG (-1) /*new message */
|
||||
#define H5O_ALL (-1) /*delete all messages of type */
|
||||
|
||||
/* Flags which are part of the message id */
|
||||
#define H5O_FLAG_CONSTANT 0x8000
|
||||
#define H5O_FLAG_BITS 0x8000
|
||||
/* Flags which are part of a message */
|
||||
#define H5O_FLAG_CONSTANT 0x01
|
||||
#define H5O_FLAG_SHARED 0x02
|
||||
#define H5O_FLAG_BITS 0x03
|
||||
#define H5O_VERSION 1
|
||||
|
||||
/*
|
||||
@ -64,21 +66,22 @@
|
||||
4) /*reserved */
|
||||
|
||||
typedef struct H5O_class_t {
|
||||
intn id; /*message type ID on disk*/
|
||||
const char *name; /*message name for debugging*/
|
||||
size_t native_size; /*size of native message*/
|
||||
void *(*decode) (H5F_t *, size_t, const uint8 *);
|
||||
herr_t (*encode) (H5F_t *, size_t, uint8 *, const void *);
|
||||
void *(*copy) (const void *, void *); /*copy native value */
|
||||
size_t (*raw_size) (H5F_t *, const void *); /*sizeof raw val */
|
||||
herr_t (*reset) (void *); /*free nested data structures*/
|
||||
herr_t (*debug) (H5F_t *, const void *, FILE *, intn, intn);
|
||||
intn id; /*message type ID on disk */
|
||||
const char *name; /*for debugging */
|
||||
size_t native_size; /*size of native message */
|
||||
void *(*decode)(H5F_t*, const uint8*, H5HG_t*);
|
||||
herr_t (*encode)(H5F_t*, uint8*, const void*);
|
||||
void *(*copy)(const void*, void*); /*copy native value */
|
||||
size_t (*raw_size)(H5F_t*, const void*);/*sizeof raw val */
|
||||
herr_t (*reset)(void *); /*free nested data structs */
|
||||
herr_t (*share)(H5F_t*, const void*, H5HG_t*);
|
||||
herr_t (*debug)(H5F_t*, const void*, FILE*, intn, intn);
|
||||
} H5O_class_t;
|
||||
|
||||
typedef struct H5O_mesg_t {
|
||||
const H5O_class_t *type; /*type of message */
|
||||
hbool_t dirty; /*raw out of date wrt native */
|
||||
hbool_t constant; /*is message constant? */
|
||||
uint8 flags; /*message flags */
|
||||
void *native; /*native format message */
|
||||
uint8 *raw; /*ptr to raw data */
|
||||
size_t raw_size; /*size with alignment */
|
||||
@ -169,9 +172,19 @@ typedef struct H5O_layout_t {
|
||||
extern const H5O_class_t H5O_NAME[1];
|
||||
|
||||
typedef struct H5O_name_t {
|
||||
const char *s; /*ptr to malloc'd memory */
|
||||
char *s; /*ptr to malloc'd memory */
|
||||
} H5O_name_t;
|
||||
|
||||
/*
|
||||
* Shared object message. This message ID never really appears in an object
|
||||
* header. Instead, bit 2 of the `Flags' field will be set and the ID field
|
||||
* will be the ID of the pointed-to message.
|
||||
*/
|
||||
#define H5O_SHARED_ID 0x000f
|
||||
extern const H5O_class_t H5O_SHARED[1];
|
||||
|
||||
typedef H5HG_t H5O_shared_t;
|
||||
|
||||
/*
|
||||
* Object header continuation message.
|
||||
*/
|
||||
@ -211,6 +224,8 @@ intn H5O_modify (H5G_entry_t *ent, const H5O_class_t *type, intn overwrite,
|
||||
uintn flags, const void *mesg);
|
||||
herr_t H5O_remove (H5G_entry_t *ent, const H5O_class_t *type, intn sequence);
|
||||
herr_t H5O_reset (const H5O_class_t *type, void *native);
|
||||
herr_t H5O_share (H5F_t *f, const H5O_class_t *type, const void *mesg,
|
||||
H5HG_t *hobj/*out*/);
|
||||
herr_t H5O_debug (H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
|
||||
intn fwidth);
|
||||
|
||||
|
@ -25,9 +25,8 @@ static char RcsId[] = "@(#)$Revision$";
|
||||
#define PABLO_MASK H5O_sdspace_mask
|
||||
|
||||
/* PRIVATE PROTOTYPES */
|
||||
static void *H5O_sdspace_decode(H5F_t *f, size_t raw_size, const uint8 *p);
|
||||
static herr_t H5O_sdspace_encode(H5F_t *f, size_t size, uint8 *p,
|
||||
const void *_mesg);
|
||||
static void *H5O_sdspace_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj);
|
||||
static herr_t H5O_sdspace_encode(H5F_t *f, uint8 *p, const void *_mesg);
|
||||
static void *H5O_sdspace_copy(const void *_mesg, void *_dest);
|
||||
static size_t H5O_sdspace_size(H5F_t *f, const void *_mesg);
|
||||
static herr_t H5O_sdspace_debug(H5F_t *f, const void *_mesg,
|
||||
@ -43,6 +42,7 @@ const H5O_class_t H5O_SDSPACE[1] = {{
|
||||
H5O_sdspace_copy, /* copy the native value */
|
||||
H5O_sdspace_size, /* size of symbol table entry */
|
||||
NULL, /* default reset method */
|
||||
NULL, /* no share method */
|
||||
H5O_sdspace_debug, /* debug the message */
|
||||
}};
|
||||
|
||||
@ -69,7 +69,7 @@ static hbool_t interface_initialize_g = FALSE;
|
||||
within this function using malloc() and is returned to the caller.
|
||||
--------------------------------------------------------------------------*/
|
||||
static void *
|
||||
H5O_sdspace_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
H5O_sdspace_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj)
|
||||
{
|
||||
H5S_simple_t *sdim = NULL;/* New simple dimensionality structure */
|
||||
uintn u; /* local counting variable */
|
||||
@ -79,8 +79,8 @@ H5O_sdspace_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(raw_size >= 8); /* at least the rank and flags must be present */
|
||||
assert(p);
|
||||
assert (!hobj || !H5HG_defined (hobj));
|
||||
|
||||
/* decode */
|
||||
if ((sdim = H5MM_xcalloc(1, sizeof(H5S_simple_t))) != NULL) {
|
||||
@ -131,7 +131,7 @@ H5O_sdspace_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
dimensionality message in the "raw" disk form.
|
||||
--------------------------------------------------------------------------*/
|
||||
static herr_t
|
||||
H5O_sdspace_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *mesg)
|
||||
H5O_sdspace_encode(H5F_t *f, uint8 *p, const void *mesg)
|
||||
{
|
||||
const H5S_simple_t *sdim = (const H5S_simple_t *) mesg;
|
||||
uintn u; /* Local counting variable */
|
||||
@ -141,7 +141,6 @@ H5O_sdspace_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *mesg)
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(raw_size >= 8); /* at least the rank & flags must be present */
|
||||
assert(p);
|
||||
assert(sdim);
|
||||
|
||||
|
184
src/H5Oshared.c
Normal file
184
src/H5Oshared.c
Normal file
@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Copyright (C) 1998 NCSA
|
||||
* All rights reserved.
|
||||
*
|
||||
* Programmer: Robb Matzke <matzke@llnl.gov>
|
||||
* Wednesday, April 1, 1998
|
||||
*
|
||||
* Purpose: Functions that operate on a shared message. The shared
|
||||
* message doesn't ever actually appear in the object header as
|
||||
* a normal message. Instead, if a message is shared, the
|
||||
* H5O_FLAG_SHARED bit is set and the message body is that
|
||||
* defined here for H5O_SHARED. The message ID is the ID of the
|
||||
* pointed-to message and the pointed-to message is stored in
|
||||
* the global heap.
|
||||
*/
|
||||
#include <H5private.h>
|
||||
#include <H5Eprivate.h>
|
||||
#include <H5MMprivate.h>
|
||||
#include <H5Oprivate.h>
|
||||
|
||||
static void *H5O_shared_decode (H5F_t*, const uint8*, H5HG_t *hobj);
|
||||
static herr_t H5O_shared_encode (H5F_t*, uint8*, const void*);
|
||||
static size_t H5O_shared_size (H5F_t*, const void*);
|
||||
static herr_t H5O_shared_debug (H5F_t*, const void*, FILE*, intn, intn);
|
||||
|
||||
/* This message derives from H5O */
|
||||
const H5O_class_t H5O_SHARED[1] = {{
|
||||
H5O_SHARED_ID, /*message id number */
|
||||
"shared", /*message name for debugging */
|
||||
sizeof(H5O_shared_t), /*native message size */
|
||||
H5O_shared_decode, /*decode method */
|
||||
H5O_shared_encode, /*encode method */
|
||||
NULL, /*no copy method */
|
||||
H5O_shared_size, /*size method */
|
||||
NULL, /*no reset method */
|
||||
NULL, /*no share method */
|
||||
H5O_shared_debug, /*debug method */
|
||||
}};
|
||||
|
||||
/* Interface initialization */
|
||||
#define PABLO_MASK H5O_shared_mask
|
||||
static hbool_t interface_initialize_g = FALSE;
|
||||
#define INTERFACE_INIT NULL
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_shared_decode
|
||||
*
|
||||
* Purpose: Decodes a shared object message and returns it.
|
||||
*
|
||||
* Return: Success: Ptr to a new shared object message.
|
||||
*
|
||||
* Failure: NULL
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, April 2, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void *
|
||||
H5O_shared_decode (H5F_t *f, const uint8 *buf, H5HG_t *hobj)
|
||||
{
|
||||
H5O_shared_t *mesg;
|
||||
|
||||
FUNC_ENTER (H5O_shared_decode, NULL);
|
||||
|
||||
/* Check args */
|
||||
assert (f);
|
||||
assert (buf);
|
||||
assert (!hobj || !H5HG_defined (hobj));
|
||||
|
||||
/* Decode */
|
||||
mesg = H5MM_xcalloc (1, sizeof *mesg);
|
||||
H5F_addr_decode (f, &buf, &(mesg->addr));
|
||||
INT32DECODE (buf, mesg->idx);
|
||||
|
||||
FUNC_LEAVE (mesg);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_shared_encode
|
||||
*
|
||||
* Purpose: Encodes message _MESG into buffer BUF.
|
||||
*
|
||||
* Return: Success: SUCCEED
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, April 2, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_shared_encode (H5F_t *f, uint8 *buf/*out*/, const void *_mesg)
|
||||
{
|
||||
const H5O_shared_t *mesg = (const H5O_shared_t *)_mesg;
|
||||
|
||||
FUNC_ENTER (H5O_shared_encode, FAIL);
|
||||
|
||||
/* Check args */
|
||||
assert (f);
|
||||
assert (buf);
|
||||
assert (mesg);
|
||||
|
||||
/* Encode */
|
||||
H5F_addr_encode (f, &buf, &(mesg->addr));
|
||||
INT32ENCODE (buf, mesg->idx);
|
||||
|
||||
FUNC_LEAVE (SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_shared_size
|
||||
*
|
||||
* Purpose: Returns the length of a shared object message.
|
||||
*
|
||||
* Return: Success: Length
|
||||
*
|
||||
* Failure: 0
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, April 2, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static size_t
|
||||
H5O_shared_size (H5F_t *f, const void *_mesg)
|
||||
{
|
||||
FUNC_ENTER (H5O_shared_size, 0);
|
||||
FUNC_LEAVE (H5F_SIZEOF_ADDR(f)+4);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5O_shared_debug
|
||||
*
|
||||
* Purpose: Prints debugging info for the message
|
||||
*
|
||||
* Return: Success: SUCCEED
|
||||
*
|
||||
* Failure: FAIL
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, April 2, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_shared_debug (H5F_t *f, const void *_mesg, FILE *stream, intn indent,
|
||||
intn fwidth)
|
||||
{
|
||||
const H5O_shared_t *mesg = (const H5O_shared_t *)_mesg;
|
||||
|
||||
FUNC_ENTER (H5O_shared_debug, FAIL);
|
||||
|
||||
/* Check args */
|
||||
assert (f);
|
||||
assert (mesg);
|
||||
assert (stream);
|
||||
assert (indent>=0);
|
||||
assert (fwidth>=0);
|
||||
|
||||
fprintf (stream, "%*s%-*s ", indent, "", fwidth,
|
||||
"Collection address:");
|
||||
H5F_addr_print (stream, &(mesg->addr));
|
||||
fprintf (stream, "\n");
|
||||
|
||||
fprintf (stream, "%*s%-*s %d\n", indent, "", fwidth,
|
||||
"Object ID within collection:",
|
||||
mesg->idx);
|
||||
|
||||
FUNC_LEAVE (SUCCEED);
|
||||
}
|
@ -23,9 +23,8 @@
|
||||
#define PABLO_MASK H5O_stab_mask
|
||||
|
||||
/* PRIVATE PROTOTYPES */
|
||||
static void *H5O_stab_decode(H5F_t *f, size_t raw_size, const uint8 *p);
|
||||
static herr_t H5O_stab_encode(H5F_t *f, size_t size, uint8 *p,
|
||||
const void *_mesg);
|
||||
static void *H5O_stab_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj);
|
||||
static herr_t H5O_stab_encode(H5F_t *f, uint8 *p, const void *_mesg);
|
||||
static void *H5O_stab_copy(const void *_mesg, void *_dest);
|
||||
static size_t H5O_stab_size(H5F_t *f, const void *_mesg);
|
||||
static herr_t H5O_stab_debug(H5F_t *f, const void *_mesg,
|
||||
@ -41,6 +40,7 @@ const H5O_class_t H5O_STAB[1] = {{
|
||||
H5O_stab_copy, /*copy the native value */
|
||||
H5O_stab_size, /*size of symbol table entry */
|
||||
NULL, /*default reset method */
|
||||
NULL, /*no share method */
|
||||
H5O_stab_debug, /*debug the message */
|
||||
}};
|
||||
|
||||
@ -67,7 +67,7 @@ static hbool_t interface_initialize_g = FALSE;
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void *
|
||||
H5O_stab_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
H5O_stab_decode(H5F_t *f, const uint8 *p, H5HG_t *hobj)
|
||||
{
|
||||
H5O_stab_t *stab;
|
||||
|
||||
@ -75,8 +75,8 @@ H5O_stab_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(raw_size == H5O_ALIGN (2 * H5F_SIZEOF_ADDR(f)));
|
||||
assert(p);
|
||||
assert (!hobj || !H5HG_defined (hobj));
|
||||
|
||||
/* decode */
|
||||
stab = H5MM_xcalloc(1, sizeof(H5O_stab_t));
|
||||
@ -104,7 +104,7 @@ H5O_stab_decode(H5F_t *f, size_t raw_size, const uint8 *p)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5O_stab_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
|
||||
H5O_stab_encode(H5F_t *f, uint8 *p, const void *_mesg)
|
||||
{
|
||||
const H5O_stab_t *stab = (const H5O_stab_t *) _mesg;
|
||||
|
||||
@ -112,7 +112,6 @@ H5O_stab_encode(H5F_t *f, size_t raw_size, uint8 *p, const void *_mesg)
|
||||
|
||||
/* check args */
|
||||
assert(f);
|
||||
assert(raw_size == H5O_ALIGN (2 * H5F_SIZEOF_ADDR(f)));
|
||||
assert(p);
|
||||
assert(stab);
|
||||
|
||||
|
@ -63,7 +63,7 @@ H5T_conv_noop(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
|
||||
/* Nothing to free */
|
||||
#ifdef H5T_DEBUG
|
||||
if (cdata->ncalls>0) {
|
||||
fprintf (stderr, "HDF5-DIAG: H5T_conv_noop statistics...\n");
|
||||
fprintf (stderr, "H5T: H5T_conv_noop statistics...\n");
|
||||
fprintf (stderr, " Number of calls: %lu\n", cdata->ncalls);
|
||||
fprintf (stderr, " Data points converted: %lu\n", cdata->nelmts);
|
||||
}
|
||||
@ -174,7 +174,7 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
|
||||
/* Free private data */
|
||||
#ifdef H5T_DEBUG
|
||||
if (cdata->ncalls>0) {
|
||||
fprintf (stderr, "HDF5-DIAG: H5T_conv_order statistics...\n");
|
||||
fprintf (stderr, "H5T: H5T_conv_order statistics...\n");
|
||||
fprintf (stderr, " Number of calls: %lu\n", cdata->ncalls);
|
||||
fprintf (stderr, " Data points converted: %lu\n", cdata->nelmts);
|
||||
}
|
||||
@ -396,7 +396,7 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
|
||||
*/
|
||||
#ifdef H5T_DEBUG
|
||||
if (cdata->ncalls>0) {
|
||||
fprintf (stderr, "HDF5-DIAG: H5T_conv_struct statistics...\n");
|
||||
fprintf (stderr, "H5T: H5T_conv_struct statistics...\n");
|
||||
fprintf (stderr, " Number of calls: %lu\n", cdata->ncalls);
|
||||
fprintf (stderr, " Data points converted: %lu\n", cdata->nelmts);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
# undef H5T_DEBUG
|
||||
#endif
|
||||
|
||||
#include <H5HGprivate.h>
|
||||
#include <H5Tprivate.h>
|
||||
|
||||
typedef struct H5T_atomic_t {
|
||||
@ -62,6 +63,8 @@ typedef struct H5T_compnd_t {
|
||||
|
||||
struct H5T_t {
|
||||
hbool_t locked; /*if locked, then can't be modified */
|
||||
H5HG_t sh_heap; /*if defined, type is in global heap */
|
||||
H5F_t *sh_file; /*file pointer if this is a shared type */
|
||||
H5T_class_t type; /*which class of type is this? */
|
||||
size_t size; /*total size of an instance of this type */
|
||||
union {
|
||||
|
@ -32,6 +32,8 @@ herr_t H5T_init_interface (void);
|
||||
H5T_t *H5T_create (H5T_class_t type, size_t size);
|
||||
H5T_t *H5T_copy (const H5T_t *old_dt);
|
||||
herr_t H5T_close (H5T_t *dt);
|
||||
herr_t H5T_share (H5F_t *f, H5T_t *dt);
|
||||
herr_t H5T_unshare (H5T_t *dt);
|
||||
size_t H5T_get_size (const H5T_t *dt);
|
||||
intn H5T_cmp (const H5T_t *dt1, const H5T_t *dt2);
|
||||
hbool_t H5T_is_atomic (const H5T_t *dt);
|
||||
|
@ -184,6 +184,7 @@ hid_t H5Tcopy (hid_t type_id);
|
||||
herr_t H5Tclose (hid_t type_id);
|
||||
hbool_t H5Tequal (hid_t type1_id, hid_t type2_id);
|
||||
herr_t H5Tlock (hid_t type_id);
|
||||
herr_t H5Tshare (hid_t location_id, hid_t type_id);
|
||||
|
||||
/* Operations defined on compound data types */
|
||||
herr_t H5Tinsert (hid_t parent_id, const char *name, off_t offset,
|
||||
|
@ -20,7 +20,7 @@ LIB_SRC=H5.c H5AC.c H5B.c H5D.c H5E.c H5F.c H5Farray.c H5Fcore.c H5Ffamily.c \
|
||||
H5Fistore.c H5Flow.c H5Fsec2.c H5Fsplit.c H5Fstdio.c H5G.c H5Gent.c \
|
||||
H5Gnode.c H5Gstab.c H5HG.c H5HL.c H5I.c H5MF.c H5MM.c H5O.c H5Ocont.c \
|
||||
H5Odtype.c H5Oefl.c H5Olayout.c H5Oname.c H5Onull.c H5Osdspace.c \
|
||||
H5Ostab.c H5P.c H5S.c H5Ssimp.c H5T.c H5Tconv.c H5Tinit.c \
|
||||
H5Oshared.c H5Ostab.c H5P.c H5S.c H5Ssimp.c H5T.c H5Tconv.c H5Tinit.c \
|
||||
H5V.c @PARALLEL_SRC@
|
||||
|
||||
LIB_OBJ=$(LIB_SRC:.c=.o)
|
||||
|
@ -66,9 +66,12 @@ tohdr.o: \
|
||||
../src/H5Bpublic.h \
|
||||
../src/H5Oprivate.h \
|
||||
../src/H5Opublic.h \
|
||||
../src/H5HGprivate.h \
|
||||
../src/H5HGpublic.h \
|
||||
../src/H5Tprivate.h \
|
||||
../src/H5Tpublic.h \
|
||||
../src/H5Sprivate.h
|
||||
../src/H5Sprivate.h \
|
||||
../src/H5Spublic.h
|
||||
tstab.o: \
|
||||
tstab.c \
|
||||
testhdf5.h \
|
||||
@ -92,9 +95,12 @@ tstab.o: \
|
||||
../src/H5Bpublic.h \
|
||||
../src/H5Oprivate.h \
|
||||
../src/H5Opublic.h \
|
||||
../src/H5HGprivate.h \
|
||||
../src/H5HGpublic.h \
|
||||
../src/H5Tprivate.h \
|
||||
../src/H5Tpublic.h \
|
||||
../src/H5Sprivate.h
|
||||
../src/H5Sprivate.h \
|
||||
../src/H5Spublic.h
|
||||
th5s.o: \
|
||||
th5s.c \
|
||||
testhdf5.h \
|
||||
@ -114,10 +120,10 @@ th5s.o: \
|
||||
../src/H5Gpublic.h \
|
||||
../src/H5Oprivate.h \
|
||||
../src/H5Opublic.h \
|
||||
../src/H5HGprivate.h \
|
||||
../src/H5HGpublic.h \
|
||||
../src/H5Tprivate.h \
|
||||
../src/H5Tpublic.h \
|
||||
../src/H5Pprivate.h \
|
||||
../src/H5Ppublic.h
|
||||
../src/H5Tpublic.h
|
||||
dtypes.o: \
|
||||
dtypes.c \
|
||||
../src/hdf5.h \
|
||||
@ -169,8 +175,11 @@ istore.o: \
|
||||
../src/H5MMpublic.h \
|
||||
../src/H5Oprivate.h \
|
||||
../src/H5Opublic.h \
|
||||
../src/H5HGprivate.h \
|
||||
../src/H5HGpublic.h \
|
||||
../src/H5Tprivate.h \
|
||||
../src/H5Tpublic.h
|
||||
../src/H5Tpublic.h \
|
||||
../src/H5Sprivate.h
|
||||
dsets.o: \
|
||||
dsets.c \
|
||||
../src/hdf5.h \
|
||||
@ -262,3 +271,19 @@ iopipe.o: \
|
||||
../src/H5Ppublic.h \
|
||||
../src/H5Spublic.h \
|
||||
../src/H5Tpublic.h
|
||||
gheap.o: \
|
||||
gheap.c \
|
||||
../src/H5private.h \
|
||||
../src/H5public.h \
|
||||
../src/H5config.h \
|
||||
../src/H5Eprivate.h \
|
||||
../src/H5Epublic.h \
|
||||
../src/H5Ipublic.h \
|
||||
../src/H5Fprivate.h \
|
||||
../src/H5Fpublic.h \
|
||||
../src/H5Gprivate.h \
|
||||
../src/H5Gpublic.h \
|
||||
../src/H5Bprivate.h \
|
||||
../src/H5Bpublic.h \
|
||||
../src/H5HGprivate.h \
|
||||
../src/H5HGpublic.h
|
||||
|
@ -11,9 +11,9 @@ CPPFLAGS=-I. -I../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.
|
||||
PROGS=testhdf5 hyperslab istore dtypes dsets cmpd_dset extend external \
|
||||
PROGS=testhdf5 gheap hyperslab istore dtypes dsets cmpd_dset extend external \
|
||||
iopipe
|
||||
TESTS=testhdf5 hyperslab istore dtypes dsets cmpd_dset extend external
|
||||
TESTS=testhdf5 gheap hyperslab istore dtypes dsets cmpd_dset extend external
|
||||
TIMINGS=iopipe
|
||||
|
||||
# Temporary files
|
||||
@ -21,7 +21,8 @@ MOSTLYCLEAN=cmpd_dset.h5 dataset.h5 extend.h5 istore.h5 tfile1.h5 tfile2.h5 \
|
||||
tfile3.h5 th5s1.h5 theap.h5 tohdr.h5 tstab1.h5 tstab2.h5 \
|
||||
extern_1.h5 extern_2.h5 extern_3.h5 extern_1.raw extern_1b.raw \
|
||||
extern_2.raw extern_2b.raw extern_3.raw extern_3b.raw \
|
||||
extern_4.raw extern_4b.raw iopipe.raw iopipe.h5
|
||||
extern_4.raw extern_4b.raw iopipe.raw iopipe.h5 gheap0.h5 \
|
||||
gheap1.h5 gheap2.h5 gheap3.h5 gheap4.h5
|
||||
|
||||
# Source and object files for programs... The PROG_SRC list contains all the
|
||||
# source files and is used for things like dependencies, archiving, etc. The
|
||||
@ -29,12 +30,15 @@ MOSTLYCLEAN=cmpd_dset.h5 dataset.h5 extend.h5 istore.h5 tfile1.h5 tfile2.h5 \
|
||||
# overlap with other tests.
|
||||
PROG_SRC=testhdf5.c tfile.c theap.c tmeta.c tohdr.c tstab.c th5s.c dtypes.c \
|
||||
hyperslab.c istore.c dsets.c cmpd_dset.c extend.c external.c \
|
||||
iopipe.c
|
||||
iopipe.c gheap.c
|
||||
PROG_OBJ=$(PROG_SRC:.c=.o)
|
||||
|
||||
TESTHDF5_SRC=testhdf5.c tfile.c theap.c tmeta.c tohdr.c tstab.c th5s.c
|
||||
TESTHDF5_OBJ=$(TESTHDF5_SRC:.c=.o)
|
||||
|
||||
GHEAP_SRC=gheap.c
|
||||
GHEAP_OBJ=$(GHEAP_SRC:.c=.o)
|
||||
|
||||
DSETS_SRC=dsets.c
|
||||
DSETS_OBJ=$(DSETS_SRC:.c=.o)
|
||||
|
||||
@ -79,6 +83,9 @@ timings _timings: $(TIMINGS)
|
||||
testhdf5: $(TESTHDF5_OBJ) ../src/libhdf5.a
|
||||
$(CC) $(CFLAGS) -o $@ $(TESTHDF5_OBJ) ../src/libhdf5.a $(LIBS)
|
||||
|
||||
gheap: $(GHEAP_OBJ) ../src/libhdf5.a
|
||||
$(CC) $(CFLAGS) -o $@ $(GHEAP_OBJ) ../src/libhdf5.a $(LIBS)
|
||||
|
||||
dsets: $(DSETS_OBJ) ../src/libhdf5.a
|
||||
$(CC) $(CFLAGS) -o $@ $(DSETS_OBJ) ../src/libhdf5.a $(LIBS)
|
||||
|
||||
|
398
test/gheap.c
Normal file
398
test/gheap.c
Normal file
@ -0,0 +1,398 @@
|
||||
/*
|
||||
* Copyright (C) 1998 NCSA
|
||||
* All rights reserved.
|
||||
*
|
||||
* Programmer: Robb Matzke <matzke@llnl.gov>
|
||||
* Tuesday, March 31, 1998
|
||||
*
|
||||
* Purpose: Tests the global heap. The global heap is the set of all
|
||||
* collections but the collections are not related to one
|
||||
* another by anything that appears in the file format.
|
||||
*/
|
||||
#include <H5private.h>
|
||||
#include <H5Eprivate.h>
|
||||
#include <H5Fprivate.h>
|
||||
#include <H5Gprivate.h>
|
||||
#include <H5HGprivate.h>
|
||||
#include <H5Pprivate.h>
|
||||
|
||||
#ifndef HAVE_FUNCTION
|
||||
# undef __FUNCTION__
|
||||
# define __FUNCTION__ ""
|
||||
#endif
|
||||
|
||||
#define FAILED(S) { \
|
||||
puts ("*FAILED*"); \
|
||||
printf (" Failed at %s:%d in %s()%s%s\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, \
|
||||
(S)&&*(S)?": ":"", (S)?(S):""); \
|
||||
H5Eprint (stdout); \
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: emit_diagnostics
|
||||
*
|
||||
* Purpose: If debugging is turned on then this function will cause the
|
||||
* library to emit it's diagnostic messages now instead of when
|
||||
* we're trying to make the output look nice.
|
||||
*
|
||||
* Return: void
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, March 31, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void
|
||||
emit_diagnostics (void)
|
||||
{
|
||||
H5F_t *f = H5F_open ("gheap0.h5", H5F_ACC_CREAT|H5F_ACC_RDWR|H5F_ACC_TRUNC,
|
||||
NULL, NULL);
|
||||
H5G_t *g = H5G_create (f->shared->root_grp, "emit", 0);
|
||||
H5G_close (g);
|
||||
H5F_close (f);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_1
|
||||
*
|
||||
* Purpose: Writes a sequence of objects to the global heap where each
|
||||
* object is larger than the one before.
|
||||
*
|
||||
* Return: Success: 0
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, March 31, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int
|
||||
test_1 (void)
|
||||
{
|
||||
H5F_t *f;
|
||||
H5HG_t obj[1024];
|
||||
uint8 out[1024];
|
||||
uint8 in[1024];
|
||||
int i;
|
||||
size_t size;
|
||||
herr_t status;
|
||||
int retval = 0;
|
||||
|
||||
printf ("%-70s", "...monotonically increasing lengths");
|
||||
fflush (stdout);
|
||||
|
||||
/* Open a clean file */
|
||||
H5Eclear ();
|
||||
f = H5F_open ("gheap1.h5", H5F_ACC_CREAT|H5F_ACC_RDWR|H5F_ACC_TRUNC,
|
||||
NULL, NULL);
|
||||
if (!f) {
|
||||
FAILED ("unable to create file");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the objects, monotonically increasing in length. Since this is
|
||||
* a clean file, the addresses allocated for the collections should also
|
||||
* be monotonically increasing.
|
||||
*/
|
||||
for (i=0; i<1024; i++) {
|
||||
size = i+1;
|
||||
memset (out, 'A'+i%26, size);
|
||||
H5Eclear ();
|
||||
status = H5HG_insert (f, size, out, obj+i);
|
||||
if (status<0) {
|
||||
FAILED ("unable to insert object into global heap");
|
||||
--retval;
|
||||
} else if (i && H5F_addr_gt (&(obj[i-1].addr), &(obj[i].addr))) {
|
||||
FAILED ("collection addresses are not monotonically increasing");
|
||||
--retval;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now try to read each object back.
|
||||
*/
|
||||
for (i=0; i<1024; i++) {
|
||||
size = i+1;
|
||||
memset (out, 'A'+i%26, size);
|
||||
H5Eclear ();
|
||||
if (NULL==H5HG_read (f, obj+i, in)) {
|
||||
FAILED ("unable to read object");
|
||||
--retval;
|
||||
} else if (memcmp (in, out, size)) {
|
||||
FAILED ("value read doesn't match value written");
|
||||
--retval;
|
||||
}
|
||||
}
|
||||
|
||||
H5F_close (f);
|
||||
puts (" PASSED");
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_2
|
||||
*
|
||||
* Purpose: Writes a sequence of objects to the global heap where each
|
||||
* object is smaller than the one before.
|
||||
*
|
||||
* Return: Success: 0
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, March 31, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int
|
||||
test_2 (void)
|
||||
{
|
||||
H5F_t *f;
|
||||
H5HG_t obj[1024];
|
||||
uint8 out[1024];
|
||||
uint8 in[1024];
|
||||
int i;
|
||||
size_t size;
|
||||
herr_t status;
|
||||
int retval = 0;
|
||||
|
||||
printf ("%-70s", "...monotonically decreasing lengths");
|
||||
fflush (stdout);
|
||||
|
||||
/* Open a clean file */
|
||||
H5Eclear ();
|
||||
f = H5F_open ("gheap2.h5", H5F_ACC_CREAT|H5F_ACC_RDWR|H5F_ACC_TRUNC,
|
||||
NULL, NULL);
|
||||
if (!f) {
|
||||
FAILED ("unable to create file");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the objects, monotonically decreasing in length.
|
||||
*/
|
||||
for (i=0; i<1024; i++) {
|
||||
size = 1024-i;
|
||||
memset (out, 'A'+i%26, size);
|
||||
H5Eclear ();
|
||||
status = H5HG_insert (f, size, out, obj+i);
|
||||
if (status<0) {
|
||||
FAILED ("unable to insert object into global heap");
|
||||
--retval;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now try to read each object back.
|
||||
*/
|
||||
for (i=0; i<1024; i++) {
|
||||
size = 1024-i;
|
||||
memset (out, 'A'+i%26, size);
|
||||
H5Eclear ();
|
||||
if (NULL==H5HG_read (f, obj+i, in)) {
|
||||
FAILED ("unable to read object");
|
||||
--retval;
|
||||
} else if (memcmp (in, out, size)) {
|
||||
FAILED ("value read doesn't match value written");
|
||||
--retval;
|
||||
}
|
||||
}
|
||||
|
||||
H5F_close (f);
|
||||
puts (" PASSED");
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_3
|
||||
*
|
||||
* Purpose: Creates a few global heap objects and then removes them all.
|
||||
* The collection should also be removed.
|
||||
*
|
||||
* Return: Success: 0
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, March 31, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int
|
||||
test_3 (void)
|
||||
{
|
||||
H5F_t *f;
|
||||
H5HG_t obj[1024];
|
||||
uint8 out[1024];
|
||||
int i;
|
||||
size_t size;
|
||||
herr_t status;
|
||||
int retval = 0;
|
||||
|
||||
printf ("%-70s", "...complete object removal");
|
||||
fflush (stdout);
|
||||
|
||||
/* Open a clean file */
|
||||
H5Eclear ();
|
||||
f = H5F_open ("gheap3.h5", H5F_ACC_CREAT|H5F_ACC_RDWR|H5F_ACC_TRUNC,
|
||||
NULL, NULL);
|
||||
if (!f) {
|
||||
FAILED ("unable to create file");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Create some stuff */
|
||||
for (i=0; i<1024; i++) {
|
||||
size = i%30+100;
|
||||
memset (out, 'A'+i%26, size);
|
||||
H5Eclear ();
|
||||
status = H5HG_insert (f, size, out, obj+i);
|
||||
if (status<0) {
|
||||
FAILED ("unable to insert object into global heap");
|
||||
--retval;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove everything */
|
||||
for (i=0; i<1024; i++) {
|
||||
status = H5HG_remove (f, obj+i);
|
||||
if (status<0) {
|
||||
FAILED ("unable to remove object");
|
||||
--retval;
|
||||
}
|
||||
}
|
||||
|
||||
H5F_close (f);
|
||||
puts (" PASSED");
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_4
|
||||
*
|
||||
* Purpose: Tests the H5HG_remove() feature by writing lots of objects
|
||||
* and occassionally removing some. When we're done they're all
|
||||
* removed.
|
||||
*
|
||||
* Return: Success: 0
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, March 31, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int
|
||||
test_4 (void)
|
||||
{
|
||||
H5F_t *f;
|
||||
H5HG_t obj[1024];
|
||||
uint8 out[1024];
|
||||
int i;
|
||||
size_t size;
|
||||
herr_t status;
|
||||
int retval = 0;
|
||||
|
||||
printf ("%-70s", "...partial object removal");
|
||||
fflush (stdout);
|
||||
|
||||
/* Open a clean file */
|
||||
H5Eclear ();
|
||||
f = H5F_open ("gheap4.h5", H5F_ACC_CREAT|H5F_ACC_RDWR|H5F_ACC_TRUNC,
|
||||
NULL, NULL);
|
||||
if (!f) {
|
||||
FAILED ("unable to create file");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<1024; i++) {
|
||||
/* Insert */
|
||||
size = i%30+100;
|
||||
memset (out, 'A'+i%26, size);
|
||||
H5Eclear ();
|
||||
status = H5HG_insert (f, size, out, obj+i);
|
||||
if (status<0) {
|
||||
FAILED ("unable to insert object into global heap");
|
||||
--retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove every third one beginning with the second, but after the
|
||||
* next one has already been inserted. That is, insert A, B, C;
|
||||
* remove B, insert D, E, F; remove E; etc.
|
||||
*/
|
||||
if (1==i%3) {
|
||||
H5Eclear ();
|
||||
status = H5HG_remove (f, obj+i-1);
|
||||
if (status<0) {
|
||||
FAILED ("unable to remove object");
|
||||
--retval;
|
||||
}
|
||||
memset (obj+i-1, 0, sizeof *obj);
|
||||
}
|
||||
}
|
||||
|
||||
H5F_close (f);
|
||||
puts (" PASSED");
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: main
|
||||
*
|
||||
* Purpose: Tests global heap.
|
||||
*
|
||||
* Return: Success: zero
|
||||
*
|
||||
* Failure: non-zero
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, March 31, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
int nfailed=0;
|
||||
|
||||
emit_diagnostics ();
|
||||
|
||||
|
||||
nfailed += test_1()<0 ? 1 : 0;
|
||||
nfailed += test_2()<0 ? 1 : 0;
|
||||
nfailed += test_3()<0 ? 1 : 0;
|
||||
nfailed += test_4()<0 ? 1 : 0;
|
||||
|
||||
if (nfailed) {
|
||||
printf ("*** %d global heap test%s failed ***\n",
|
||||
nfailed, 1==nfailed?"":"s");
|
||||
} else {
|
||||
printf ("All global heap tests passed.\n");
|
||||
}
|
||||
return nfailed?-1:0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user