2003-04-01 02:30:57 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
|
|
|
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
1997-09-20 00:36:59 +08:00
|
|
|
/*
|
|
|
|
* Programmer: Robb Matzke <matzke@llnl.gov>
|
|
|
|
* Thursday, September 18, 1997
|
|
|
|
*
|
1998-01-17 06:23:43 +08:00
|
|
|
* Purpose: This file contains declarations which are visible
|
|
|
|
* only within the H5G package. Source files outside the
|
|
|
|
* H5G package should include H5Gprivate.h instead.
|
1997-09-20 00:36:59 +08:00
|
|
|
*/
|
|
|
|
#ifndef H5G_PACKAGE
|
|
|
|
#error "Do not include this file outside the H5G package!"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _H5Gpkg_H
|
|
|
|
#define _H5Gpkg_H
|
|
|
|
|
2003-05-16 03:22:33 +08:00
|
|
|
/* Get package's private header */
|
2001-04-06 01:29:14 +08:00
|
|
|
#include "H5Gprivate.h"
|
1997-09-20 00:36:59 +08:00
|
|
|
|
2003-05-16 03:22:33 +08:00
|
|
|
/* Other private headers needed by this file */
|
|
|
|
#include "H5ACprivate.h" /* Metadata cache */
|
1998-01-23 00:41:32 +08:00
|
|
|
|
1997-09-25 00:30:22 +08:00
|
|
|
/*
|
|
|
|
* A symbol table node is a collection of symbol table entries. It can
|
|
|
|
* be thought of as the lowest level of the B-link tree that points to
|
|
|
|
* a collection of symbol table entries that belong to a specific symbol
|
1997-10-21 07:14:35 +08:00
|
|
|
* table or group.
|
1997-09-25 00:30:22 +08:00
|
|
|
*/
|
|
|
|
typedef struct H5G_node_t {
|
2000-06-02 07:45:11 +08:00
|
|
|
H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
|
|
|
|
/* first field in structure */
|
1998-01-23 00:41:32 +08:00
|
|
|
int nsyms; /*number of symbols */
|
|
|
|
H5G_entry_t *entry; /*array of symbol table entries */
|
1997-09-25 00:30:22 +08:00
|
|
|
} H5G_node_t;
|
|
|
|
|
[svn-r9329]
Purpose:
Feature
Description:
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:
2004-09-29 03:04:19 +08:00
|
|
|
/*
|
|
|
|
* Reference count shared between all instances of an open group
|
|
|
|
*/
|
|
|
|
struct H5G_shared_t {
|
|
|
|
int fo_count; /* open file object count */
|
|
|
|
};
|
|
|
|
|
1998-01-06 11:07:15 +08:00
|
|
|
/*
|
|
|
|
* A group handle passed around through layers of the library within and
|
|
|
|
* above the H5G layer.
|
|
|
|
*/
|
|
|
|
struct H5G_t {
|
[svn-r9329]
Purpose:
Feature
Description:
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:
2004-09-29 03:04:19 +08:00
|
|
|
H5G_shared_t* shared; /*shared file object data */
|
|
|
|
H5G_entry_t ent; /*info about the group */
|
1998-01-06 11:07:15 +08:00
|
|
|
};
|
|
|
|
|
1997-09-20 00:36:59 +08:00
|
|
|
/*
|
|
|
|
* These operations can be passed down from the H5G_stab layer to the
|
|
|
|
* H5G_node layer through the B-tree layer.
|
|
|
|
*/
|
|
|
|
typedef enum H5G_oper_t {
|
1998-09-22 23:27:26 +08:00
|
|
|
H5G_OPER_FIND = 0, /*find a symbol */
|
|
|
|
H5G_OPER_INSERT = 1, /*insert a new symbol */
|
|
|
|
H5G_OPER_REMOVE = 2 /*remove existing symbol */
|
1997-09-20 00:36:59 +08:00
|
|
|
} H5G_oper_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Data exchange structure for symbol table nodes. This structure is
|
|
|
|
* passed through the B-link tree layer to the methods for the objects
|
|
|
|
* to which the B-link tree points.
|
|
|
|
*/
|
|
|
|
typedef struct H5G_bt_ud1_t {
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
/* downward */
|
1998-01-23 00:41:32 +08:00
|
|
|
H5G_oper_t operation; /*what operation to perform */
|
|
|
|
const char *name; /*points to temporary memory */
|
|
|
|
haddr_t heap_addr; /*symbol table heap address */
|
1997-09-20 00:36:59 +08:00
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
/* downward for INSERT, upward for FIND */
|
1998-01-23 00:41:32 +08:00
|
|
|
H5G_entry_t ent; /*entry to insert into table */
|
1997-09-20 00:36:59 +08:00
|
|
|
|
|
|
|
} H5G_bt_ud1_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Data exchange structure to pass through the B-tree layer for the
|
1998-03-24 22:53:57 +08:00
|
|
|
* H5B_iterate function.
|
1997-09-20 00:36:59 +08:00
|
|
|
*/
|
|
|
|
typedef struct H5G_bt_ud2_t {
|
1998-01-17 06:23:43 +08:00
|
|
|
/* downward */
|
1998-03-24 22:53:57 +08:00
|
|
|
hid_t group_id; /*group id to pass to iteration operator */
|
2003-08-22 21:50:01 +08:00
|
|
|
H5G_entry_t *ent; /*the entry to which group_id points */
|
1998-03-24 22:53:57 +08:00
|
|
|
int skip; /*initial entries to skip */
|
|
|
|
H5G_iterate_t op; /*iteration operator */
|
|
|
|
void *op_data; /*user-defined operator data */
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
|
|
/* upward */
|
2003-08-22 21:50:01 +08:00
|
|
|
int final_ent; /*final entry looked at */
|
1998-03-24 22:53:57 +08:00
|
|
|
|
1997-09-20 00:36:59 +08:00
|
|
|
} H5G_bt_ud2_t;
|
|
|
|
|
2002-11-26 01:59:14 +08:00
|
|
|
/*
|
|
|
|
* Data exchange structure to pass through the B-tree layer for the
|
|
|
|
* H5B_iterate function.
|
|
|
|
*/
|
|
|
|
typedef struct H5G_bt_ud3_t {
|
2003-08-22 21:50:01 +08:00
|
|
|
/* downward */
|
|
|
|
H5G_entry_t *ent; /*the entry of group being queried */
|
|
|
|
hsize_t idx; /*index of group member to be queried */
|
2002-11-26 01:59:14 +08:00
|
|
|
hsize_t num_objs; /*the number of objects having been traversed*/
|
2003-08-22 21:50:01 +08:00
|
|
|
|
|
|
|
/* upward */
|
|
|
|
char *name; /*member name to be returned */
|
2003-07-10 03:16:17 +08:00
|
|
|
H5G_obj_t type; /*member type to be returned */
|
2002-11-26 01:59:14 +08:00
|
|
|
} H5G_bt_ud3_t;
|
|
|
|
|
1997-09-20 00:36:59 +08:00
|
|
|
/*
|
|
|
|
* This is the class identifier to give to the B-tree functions.
|
|
|
|
*/
|
2002-09-21 04:36:09 +08:00
|
|
|
H5_DLLVAR H5B_class_t H5B_SNODE[1];
|
1997-09-20 00:36:59 +08:00
|
|
|
|
1997-09-22 10:08:54 +08:00
|
|
|
/* The cache subclass */
|
2002-09-21 04:36:09 +08:00
|
|
|
H5_DLLVAR const H5AC_class_t H5AC_SNODE[1];
|
1997-09-22 10:08:54 +08:00
|
|
|
|
1997-09-20 00:36:59 +08:00
|
|
|
/*
|
1997-10-21 07:14:35 +08:00
|
|
|
* Functions that understand symbol tables but not names. The
|
|
|
|
* functions that understand names are exported to the rest of
|
1997-09-20 00:36:59 +08:00
|
|
|
* the library and appear in H5Gprivate.h.
|
|
|
|
*/
|
2003-02-11 01:26:09 +08:00
|
|
|
H5_DLL herr_t H5G_stab_create(H5F_t *f, hid_t dxpl_id, size_t size_hint,
|
1999-02-19 00:21:34 +08:00
|
|
|
H5G_entry_t *ent/*out*/);
|
2002-09-21 04:36:09 +08:00
|
|
|
H5_DLL herr_t H5G_stab_find(H5G_entry_t *grp_ent, const char *name,
|
2003-02-11 01:26:09 +08:00
|
|
|
H5G_entry_t *obj_ent/*out*/, hid_t dxpl_id);
|
2002-09-21 04:36:09 +08:00
|
|
|
H5_DLL herr_t H5G_stab_insert(H5G_entry_t *grp_ent, const char *name,
|
2003-02-11 01:26:09 +08:00
|
|
|
H5G_entry_t *obj_ent, hid_t dxpl_id);
|
2003-05-16 03:22:33 +08:00
|
|
|
H5_DLL herr_t H5G_stab_delete(H5F_t *f, hid_t dxpl_id, haddr_t btree_addr, haddr_t heap_addr);
|
2003-02-11 01:26:09 +08:00
|
|
|
H5_DLL herr_t H5G_stab_remove(H5G_entry_t *grp_ent, const char *name, hid_t dxpl_id);
|
1998-09-22 23:27:26 +08:00
|
|
|
|
1997-09-20 00:36:59 +08:00
|
|
|
/*
|
|
|
|
* Functions that understand symbol table entries.
|
|
|
|
*/
|
2002-09-21 04:36:09 +08:00
|
|
|
H5_DLL herr_t H5G_ent_decode_vec(H5F_t *f, const uint8_t **pp,
|
2001-08-15 06:09:56 +08:00
|
|
|
H5G_entry_t *ent, int n);
|
2002-09-21 04:36:09 +08:00
|
|
|
H5_DLL herr_t H5G_ent_encode_vec(H5F_t *f, uint8_t **pp,
|
2001-08-15 06:09:56 +08:00
|
|
|
const H5G_entry_t *ent, int n);
|
2001-10-16 03:36:48 +08:00
|
|
|
|
2002-04-24 00:01:43 +08:00
|
|
|
/* Functions that understand symbol table nodes */
|
2004-12-29 22:26:20 +08:00
|
|
|
H5_DLL int H5G_node_iterate (H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
|
|
|
|
const void *_rt_key, void *_udata);
|
|
|
|
H5_DLL int H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
|
|
|
|
const void *_rt_key, void *_udata);
|
|
|
|
H5_DLL int H5G_node_name(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
|
|
|
|
const void *_rt_key, void *_udata);
|
|
|
|
H5_DLL int H5G_node_type(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
|
|
|
|
const void *_rt_key, void *_udata);
|
1997-09-20 00:36:59 +08:00
|
|
|
#endif
|