diff options
author | James Laird <jlaird@hdfgroup.org> | 2004-09-28 20:52:15 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2004-09-28 20:52:15 (GMT) |
commit | 093c14b8db58051b116b4f39dc65247a0c637ad8 (patch) | |
tree | e2998ead8693aed1c1c995d04b96731db0ae6687 /src/H5Tpkg.h | |
parent | ed0ebdd7d0c11c0823f3f417a8ce112f7c7c18bf (diff) | |
download | hdf5-093c14b8db58051b116b4f39dc65247a0c637ad8.zip hdf5-093c14b8db58051b116b4f39dc65247a0c637ad8.tar.gz hdf5-093c14b8db58051b116b4f39dc65247a0c637ad8.tar.bz2 |
[svn-r9334]
Purpose:
Feature
Description:
(Same change to release branch)
Datatypes and groups now use H5FO "file object" code that was previously
only used by datasets. These objects will hold a file open if the file
is closed but they have not yet been closed. If these objects are unlinked
then relinked, they will not be destroyed. If they are opened twice (even
by two different names), both IDs will "see" changes made to the object
using the other ID.
When an object is opened using two different names (e.g., if a dataset was
opened under one name, then mounted and opened under its new name), calling
H5Iget_name() on a given hid_t will return the name used to open that hid_t,
not the current name of the object (this is a feature, and a change from the
previous behavior of datasets).
Solution:
Used H5FO code that was already in place for datasets. Broke H5D_t's, H5T_t's,
and H5G_t's into a "shared" struct and a private struct. The shared structs
(H5D_shared_t, etc.) hold the object's information and are used by all IDs
that point to a given object in the file. The private structs are pointed
to by the hid_t and contain the object's group entry information (including its
name) and a pointer to the shared struct for that object.
This changed the naming of structs throughout the library (e.g., datatype->size
is now datatype->shared->size). I added an updated H5Tinit.c to windows.zip.
Platforms tested:
Visual Studio 7, sleipnir, arabica, verbena
Misc. update:
Diffstat (limited to 'src/H5Tpkg.h')
-rw-r--r-- | src/H5Tpkg.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 72bcd5f..bc2841f 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -184,9 +184,10 @@ typedef enum H5T_state_t { H5T_STATE_OPEN /*named constant, open object header */ } H5T_state_t; -struct H5T_t { + /* This struct is shared between all occurances of an open named type */ +typedef struct H5T_shared_t { + hsize_t fo_count; /* number of references to this file object */ H5T_state_t state; /*current state of the type */ - H5G_entry_t ent; /*the type is a named type */ 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 */ @@ -200,6 +201,11 @@ struct H5T_t { H5T_opaque_t opaque; /* an opaque datatype */ H5T_array_t array; /* an array datatype */ } u; +} H5T_shared_t; + +struct H5T_t { + H5G_entry_t ent; /* entry information if the type is a named type */ + H5T_shared_t *shared; /* all other information */ }; /* A compound datatype member */ |