diff options
author | Robb Matzke <matzke@llnl.gov> | 1997-08-07 19:23:00 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1997-08-07 19:23:00 (GMT) |
commit | a905a3a1e343d4507049c30512842957e2f6307c (patch) | |
tree | aa01b7418431c48634458a028c2fe6fd354f1684 /src/H5Oprivate.h | |
parent | dd0fbd5b0060ebc7703da8eaab747f7a3025be2a (diff) | |
download | hdf5-a905a3a1e343d4507049c30512842957e2f6307c.zip hdf5-a905a3a1e343d4507049c30512842957e2f6307c.tar.gz hdf5-a905a3a1e343d4507049c30512842957e2f6307c.tar.bz2 |
[svn-r15] ./src/H5AC.c
./src/H5ACprivate.h
./src/H5ACproto.h
./src/H5Bproto.h
./src/H5Gproto.h
./src/H5Hproto.h
./src/H5MFprivate.h
./src/H5MFproto.h
./src/H5MM.c
./src/H5MMprivate.h
./src/H5MMproto.h
Changed my e-mail address.
./src/H5O.c NEW
./src/H5Onull.c NEW
./src/H5Ocont. NEW
./src/H5Ostab.c NEW
New functions for dealing with object headers. The H5O.c is
the generic stuff, and each particular message has a source
file for the specific stuff.
Use ./src/H5Ostab.c as a model for implementing other messages.
./src/Makefile
./src/test/Makefile
Added new files
./src/debug.c
Added debugging calls for object headers.
./src/H5B.c
./src/H5Bprivate.h
./src/H5Gnode.c
./src/H5MF.c
Changed my e-mail address.
Improved error handling.
./src/H5Eprivate.h
./src/H5Eproto.h
Added more error symbols
./src/H5F.c
Changed my e-mail address.
Used macros for sizeof offsets and lengths.
Added the interface initialization function to
H5F_block_read() and H5F_block_write().
Updated H5F_debug()
./src/H5Fprivate.h
Got rid of H5F_symbol_table_size(). Use H5G_SIZEOF_ENTRY()
instead.
Reformatted H5F_decode_offset() for readability.
./src/H5G.c
Changed my e-mail address.
Improved error handling.
Replaced not_implemented_yet__*() with real functions from
H5O.
./src/H5Gprivate.h
Changed `symtab' to `stab' to be consistent with other stuff.
./src/H5H.c
./src/H5Hprivate.h
Changed my e-mail address.
Improved error handling.
Added an extra argument to H5H_new() to indicate whether you
want a global heap or a local heap.
./src/hdf5gen.h
Added NELMTS()
Fixed FUNC_ENTER()
Rewrote FUNC_LEAVE() in terms of HRETURN().
./src/hdf5meta.h
Added `const' to the decode macros.
./src/hdf5pabl.h
Added PABLO_SAVE()
./test/testhdf5.c
./test/testhdf5.h
Added calls for object header testing.
./test/theap.c
Turned off some output.
Diffstat (limited to 'src/H5Oprivate.h')
-rw-r--r-- | src/H5Oprivate.h | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h new file mode 100644 index 0000000..dfaa5b5 --- /dev/null +++ b/src/H5Oprivate.h @@ -0,0 +1,127 @@ +/*------------------------------------------------------------------------- + * Copyright (C) 1997 National Center for Supercomputing Applications. + * All rights reserved. + * + *------------------------------------------------------------------------- + * + * Created: H5Oprivate.h + * Aug 5 1997 + * Robb Matzke <matzke@llnl.gov> + * + * Purpose: Object header private include file. + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +#ifndef _H5Oprivate_H +#define _H5Oprivate_H +#include "H5Oproto.h" + +#include "H5Fprivate.h" +#include "H5Gprivate.h" + +#define H5O_MIN_SIZE 64 /*min obj header data size */ +#define H5O_NMESGS 64 /*initial number of messages */ +#define H5O_NCHUNKS 64 /*initial number of chunks */ +#define H5O_NEW_MESG (-1) /*new message */ +#define H5O_NO_ADDR (-1) /*no disk address yet */ + +#define H5O_VERSION 1 +#define H5O_ALIGNMENT 4 +#define H5O_ALIGN(X,A) ((X)=(A)*(((X)+(A)-1)/(A))) + +#define H5O_SIZEOF_HDR(F) \ + (1 + /*version number */ \ + 1 + /*alignment */ \ + 2 + /*number of messages */ \ + 4 + /*reference count */ \ + 4) /*header data size */ + +typedef struct H5O_class_t { + intn id; /*message type ID on disk */ + const char *name; /*message name for debugging */ + void *(*decode)(hdf5_file_t*,const uint8*); /*decode mesg */ + herr_t (*encode)(hdf5_file_t*,size_t,uint8*,const void*); + void *(*fast)(const H5G_entry_t*, void*); /*get from stab ent */ + hbool_t (*cache)(H5G_entry_t*,const void*); /*put into entry */ + void *(*copy)(const void*,void*); /*copy native value */ + size_t (*size)(hdf5_file_t*,const void*); /*size of raw value */ + void *(*free)(void*); /*free native data struct */ + herr_t (*debug)(hdf5_file_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 */ + void *native; /*native format message */ + uint8 *raw; /*ptr to raw data */ + size_t raw_size; /*size with alignment */ + intn chunkno; /*chunk number for this mesg */ +} H5O_mesg_t; + +typedef struct H5O_chunk_t { + hbool_t dirty; /*dirty flag */ + haddr_t addr; /*chunk file address */ + size_t size; /*chunk size */ + uint8 *image; /*image of file */ +} H5O_chunk_t; + +typedef struct H5O_t { + hbool_t dirty; /*out of data wrt disk */ + intn version; /*version number */ + intn alignment; /*message alignment */ + intn nlink; /*link count */ + intn nmesgs; /*number of messages */ + intn alloc_nmesgs; /*number of message slots */ + H5O_mesg_t *mesg; /*array of messages */ + intn nchunks; /*number of chunks */ + intn alloc_nchunks; /*chunks allocated */ + H5O_chunk_t *chunk; /*array of chunks */ +} H5O_t; + +/* + * Null message. + */ +#define H5O_NULL_ID 0x0000 +extern const H5O_class_t H5O_NULL[1]; + +/* + * Object header continuation message. + */ +#define H5O_CONT_ID 0x0010 +extern const H5O_class_t H5O_CONT[1]; + +typedef struct H5O_cont_t { + haddr_t addr; /*address of continuation block */ + size_t size; /*size of continuation block */ + + /* the following field(s) do not appear on disk */ + intn chunkno; /*chunk this mesg refers to */ +} H5O_cont_t; + +/* + * Symbol table message. + */ +#define H5O_STAB_ID 0x0011 +extern const H5O_class_t H5O_STAB[1]; + +typedef struct H5O_stab_t { + haddr_t btree; /*address of B-tree */ + haddr_t heap; /*address of name heap */ +} H5O_stab_t; + + +haddr_t H5O_new (hdf5_file_t *f, intn nlink, size_t size_hint); +intn H5O_link (hdf5_file_t *f, haddr_t addr, H5G_entry_t *ent, intn adjust); +void *H5O_read (hdf5_file_t *f, haddr_t addr, H5G_entry_t *ent, + const H5O_class_t *type, intn sequence, void *mesg); +const void *H5O_peek (hdf5_file_t *f, haddr_t addr, const H5O_class_t *type, + intn sequence); +intn H5O_modify (hdf5_file_t *f, haddr_t addr, H5G_entry_t *ent, + hbool_t *ent_modified, const H5O_class_t *type, + intn overwrite, const void *mesg); +herr_t H5O_debug (hdf5_file_t *f, haddr_t addr, FILE *stream, + intn indent, intn fwidth); + +#endif |