mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-15 07:40:23 +08:00
e4834c43ce
---------------------- ./src/H5.c [1.3] ./src/H5AC.c [1.3] ./src/H5ACprivate.h [1.3] ./src/H5B.c [1.3] ./src/H5Bprivate.h [1.3] ./src/H5D.c [1.3] ./src/H5F.c [1.3] ./src/H5Farray.c [1.3] ./src/H5Fcore.c [1.3] ./src/H5Ffamily.c [1.3] ./src/H5Fistore.c [1.3] ./src/H5Flow.c [1.3] ./src/H5Fmpio.c [1.3] ./src/H5Fprivate.h [1.3] ./src/H5Fsec2.c [1.3] ./src/H5Fsplit.c [1.3] ./src/H5Fstdio.c [1.3] ./src/H5G.c [1.3] ./src/H5Gent.c [1.3] ./src/H5Gnode.c [1.3] ./src/H5Gprivate.h [1.3] ./src/H5Gstab.c [1.3] ./src/H5HG.c [1.3] ./src/H5HGprivate.h [1.3] ./src/H5HL.c [1.3] ./src/H5HLprivate.h [1.3] ./src/H5MF.c [1.3] ./src/H5MFprivate.h [1.3] ./src/H5O.c [1.3] ./src/H5Oattr.c [1.3] ./src/H5Ocont.c [1.3] ./src/H5Odtype.c [1.3] ./src/H5Oefl.c [1.3] ./src/H5Olayout.c [1.3] ./src/H5Oprivate.h [1.3] ./src/H5Oshared.c [1.3] ./src/H5Ostab.c [1.3] ./src/H5P.c [1.3] ./src/H5R.c [1.3] ./src/H5Smpio.c [1.3] ./src/H5T.c [1.3] ./src/H5Tvlen.c [1.3] ./src/H5private.h [1.3] ./test/dtypes.c [1.3] ./test/gheap.c [1.3] ./test/istore.c [1.3] ./test/lheap.c [1.3] ./test/ohdr.c [1.3] ./tools/h5debug.c [1.3] File addresses (the `haddr_t' type) are passed by value instead of by reference. The type is no longer a struct. This is one of the preliminary changes needed for the Virtual File Layer stuff. ./src/H5Fprivate.h [1.3] ./src/H5Flow.c [1.3] Some address functions were rewritten as macros.
171 lines
6.8 KiB
C
171 lines
6.8 KiB
C
/*-------------------------------------------------------------------------
|
|
* Copyright (C) 1997 National Center for Supercomputing Applications.
|
|
* All rights reserved.
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*
|
|
* Created: H5Gprivate.h
|
|
* Jul 11 1997
|
|
* Robb Matzke <matzke@llnl.gov>
|
|
*
|
|
* Purpose: Library-visible declarations.
|
|
*
|
|
* Modifications:
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef _H5Gprivate_H
|
|
#define _H5Gprivate_H
|
|
|
|
#include <H5Gpublic.h>
|
|
|
|
/* Private headers needed by this file */
|
|
#include <H5private.h>
|
|
#include <H5Bprivate.h>
|
|
#include <H5Fprivate.h>
|
|
|
|
/*
|
|
* Define this to enable debugging.
|
|
*/
|
|
#ifdef NDEBUG
|
|
# undef H5G_DEBUG
|
|
#endif
|
|
#define H5G_NODE_MAGIC "SNOD" /*symbol table node magic number */
|
|
#define H5G_NODE_SIZEOF_MAGIC 4 /*sizeof symbol node magic number */
|
|
#define H5G_NO_CHANGE (-1) /*see H5G_ent_modified() */
|
|
#define H5G_NLINKS 16 /*max symlinks to follow per lookup */
|
|
|
|
/*
|
|
* The disk size for a symbol table entry...
|
|
*/
|
|
#define H5G_SIZEOF_SCRATCH 16
|
|
#define H5G_SIZEOF_ENTRY(F) \
|
|
(H5F_SIZEOF_SIZE(F) + /*offset of name into heap */ \
|
|
H5F_SIZEOF_ADDR(F) + /*address of object header */ \
|
|
4 + /*entry type */ \
|
|
4 + /*reserved */ \
|
|
H5G_SIZEOF_SCRATCH) /*scratch pad space */
|
|
|
|
/*
|
|
* Various types of object header information can be cached in a symbol
|
|
* table entry (it's normal home is the object header to which the entry
|
|
* points). This datatype determines what (if anything) is cached in the
|
|
* symbol table entry.
|
|
*/
|
|
typedef enum H5G_type_t {
|
|
H5G_CACHED_ERROR = -1, /*force enum to be signed */
|
|
H5G_NOTHING_CACHED = 0, /*nothing is cached, must be 0 */
|
|
H5G_CACHED_STAB = 1, /*symbol table, `stab' */
|
|
H5G_CACHED_SLINK = 2, /*symbolic link */
|
|
|
|
H5G_NCACHED = 3 /*THIS MUST BE LAST */
|
|
} H5G_type_t;
|
|
|
|
/*
|
|
* A symbol table entry caches these parameters from object header
|
|
* messages... The values are entered into the symbol table when an object
|
|
* header is created (by hand) and are extracted from the symbol table with a
|
|
* callback function registered in H5O_init_interface(). Be sure to update
|
|
* H5G_ent_decode(), H5G_ent_encode(), and H5G_ent_debug() as well.
|
|
*/
|
|
typedef union H5G_cache_t {
|
|
struct {
|
|
haddr_t btree_addr; /*file address of symbol table B-tree*/
|
|
haddr_t heap_addr; /*file address of stab name heap */
|
|
} stab;
|
|
|
|
struct {
|
|
size_t lval_offset; /*link value offset */
|
|
} slink;
|
|
} H5G_cache_t;
|
|
|
|
/*
|
|
* A symbol table entry. The two important fields are `name_off' and
|
|
* `header'. The remaining fields are used for caching information that
|
|
* also appears in the object header to which this symbol table entry
|
|
* points.
|
|
*/
|
|
typedef struct H5G_entry_t {
|
|
hbool_t dirty; /*entry out-of-date? */
|
|
size_t name_off; /*offset of name within name heap */
|
|
haddr_t header; /*file address of object header */
|
|
H5G_type_t type; /*type of information cached */
|
|
H5G_cache_t cache; /*cached data from object header */
|
|
H5F_t *file; /*file to which this obj hdr belongs */
|
|
} H5G_entry_t;
|
|
typedef struct H5G_t H5G_t;
|
|
|
|
/*
|
|
* This table contains a list of object types, descriptions, and the
|
|
* functions that determine if some object is a particular type. The table
|
|
* is allocated dynamically.
|
|
*/
|
|
typedef struct H5G_typeinfo_t {
|
|
intn type; /*one of the public H5G_* types */
|
|
htri_t (*isa)(H5G_entry_t*); /*function to determine type */
|
|
char *desc; /*description of object type */
|
|
} H5G_typeinfo_t;
|
|
|
|
/*
|
|
* Library prototypes... These are the ones that other packages routinely
|
|
* call.
|
|
*/
|
|
__DLL__ herr_t H5G_register_type(intn type, htri_t(*isa)(H5G_entry_t*),
|
|
const char *desc);
|
|
__DLL__ H5G_entry_t *H5G_loc(hid_t loc_id);
|
|
__DLL__ herr_t H5G_mkroot(H5F_t *f, H5G_entry_t *root_entry);
|
|
__DLL__ H5G_entry_t *H5G_entof(H5G_t *grp);
|
|
__DLL__ H5F_t *H5G_fileof(H5G_t *grp);
|
|
__DLL__ H5G_t *H5G_create(H5G_entry_t *loc, const char *name,
|
|
size_t size_hint);
|
|
__DLL__ H5G_t *H5G_open(H5G_entry_t *loc, const char *name);
|
|
__DLL__ H5G_t *H5G_open_oid(H5G_entry_t *ent);
|
|
__DLL__ H5G_t *H5G_reopen(H5G_t *grp);
|
|
__DLL__ herr_t H5G_close(H5G_t *grp);
|
|
__DLL__ H5G_t *H5G_rootof(H5F_t *f);
|
|
__DLL__ htri_t H5G_isa(H5G_entry_t *ent);
|
|
__DLL__ herr_t H5G_link(H5G_entry_t *loc, H5G_link_t type,
|
|
const char *cur_name, const char *new_name,
|
|
uintn namei_flags);
|
|
__DLL__ intn H5G_get_type(H5G_entry_t *ent);
|
|
__DLL__ herr_t H5G_get_objinfo(H5G_entry_t *loc, const char *name,
|
|
hbool_t follow_link,
|
|
H5G_stat_t *statbuf/*out*/);
|
|
__DLL__ herr_t H5G_linkval(H5G_entry_t *loc, const char *name, size_t size,
|
|
char *buf/*out*/);
|
|
__DLL__ herr_t H5G_set_comment(H5G_entry_t *loc, const char *name,
|
|
const char *buf);
|
|
__DLL__ intn H5G_get_comment(H5G_entry_t *loc, const char *name,
|
|
size_t bufsize, char *buf);
|
|
__DLL__ herr_t H5G_insert(H5G_entry_t *loc, const char *name,
|
|
H5G_entry_t *ent);
|
|
__DLL__ herr_t H5G_move(H5G_entry_t *loc, const char *src_name,
|
|
const char *dst_name);
|
|
__DLL__ herr_t H5G_unlink(H5G_entry_t *loc, const char *name);
|
|
__DLL__ herr_t H5G_find(H5G_entry_t *loc, const char *name,
|
|
H5G_entry_t *grp_ent/*out*/, H5G_entry_t *ent/*out*/);
|
|
__DLL__ H5F_t *H5G_insertion_file(H5G_entry_t *loc, const char *name);
|
|
__DLL__ herr_t H5G_traverse_slink(H5G_entry_t *grp_ent/*in,out*/,
|
|
H5G_entry_t *obj_ent/*in,out*/,
|
|
intn *nlinks/*in,out*/);
|
|
__DLL__ herr_t H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent);
|
|
__DLL__ herr_t H5G_ent_decode(H5F_t *f, const uint8_t **pp,
|
|
H5G_entry_t *ent/*out*/);
|
|
|
|
/*
|
|
* These functions operate on symbol table nodes.
|
|
*/
|
|
__DLL__ herr_t H5G_node_debug(H5F_t *f, haddr_t addr, FILE *stream,
|
|
intn indent, intn fwidth, haddr_t heap);
|
|
|
|
/*
|
|
* These functions operate on symbol table entries. They're used primarily
|
|
* in the H5O package where header messages are cached in symbol table
|
|
* entries. The subclasses of H5O probably don't need them though.
|
|
*/
|
|
__DLL__ H5G_cache_t *H5G_ent_cache(H5G_entry_t *ent, H5G_type_t *cache_type);
|
|
__DLL__ herr_t H5G_ent_modified(H5G_entry_t *ent, H5G_type_t cache_type);
|
|
__DLL__ herr_t H5G_ent_debug(H5F_t *f, const H5G_entry_t *ent, FILE * stream,
|
|
intn indent, intn fwidth, haddr_t heap);
|
|
#endif
|