hdf5/src/H5Fprivate.h

104 lines
4.4 KiB
C
Raw Normal View History

1997-07-31 05:17:56 +08:00
/****************************************************************************
* NCSA HDF *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* *
* For conditions of distribution and use, see the accompanying *
* hdf/COPYING file. *
* *
****************************************************************************/
/* $Id$ */
/*
* This file contains macros & information for file access
*/
#ifndef HDF5FILE_H
#define HDF5FILE_H
#include "H5Fproto.h" /* Include Public Definitions */
/*****************************************/
/*** This is the top level header file ***/
/*** and shouldn't depend on any other ***/
/*** packages! ***/
/*****************************************/
#define H5F_SIZEOF_OFFSET(F) ((F)->file_create_parms.offset_size)
#define H5F_SIZEOF_SIZE(F) ((F)->file_create_parms.length_size)
1997-07-31 05:17:56 +08:00
/* Define the structure to store the file information for HDF5 files */
typedef struct {
char *dir; /* Directory the file is located within */
char *filename; /* Filename of file */
uintn acc_perm; /* Access Permissions for file */
hdf_file_t file_handle; /* File handle for actual I/O */
uintn ref_count; /* Reference count for number of times file is opened */
uint32 consist_flags; /* File Consistency Flags */
haddr_t smallobj_off; /* Offset of small-object heap within the file */
haddr_t freespace_off; /* Offset of free-space info within the file */
1997-07-31 05:17:56 +08:00
size_t logical_len; /* Logical length of file */
struct H5AC_cache_t *cache; /* The object cache */
file_create_temp_t file_create_parms; /* File-creation template parameters */
#ifdef LATER
file_access_temp_t file_access_parms; /* File-access template parameters */
#endif /* LATER */
struct H5G_entry_t *root_sym; /* Extra for the root symbol in the file */
} hdf5_file_t;
#ifdef NOT_YET
#define H5F_encode_offset(f,p,o) (H5F_SIZEOF_OFFSET(f)==4 ? UINT32ENCODE(p,o) \
: H5F_SIZEOF_OFFSET(f)==8 ? UINT64ENCODE(p,o) \
: H5F_SIZEOF_OFFSET(f)==2 ? UINT16ENCODE(p,o) \
1997-07-31 05:17:56 +08:00
: H5FPencode_unusual_offset(f,&(p),(uint8 *)&(o)))
#else /* NOT_YET */
#define H5F_encode_offset(f,p,o) switch(H5F_SIZEOF_OFFSET(f)) { case 4: UINT32ENCODE(p,o); break;\
1997-07-31 05:17:56 +08:00
case 8: UINT64ENCODE(p,o); break;\
case 2: UINT16ENCODE(p,o); break;}
#endif /* NOT_YET */
[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.
1997-08-08 03:23:00 +08:00
#define H5F_decode_offset(f,p,o) \
switch (H5F_SIZEOF_OFFSET (f)) { \
case 4: \
UINT32DECODE (p, o); \
break; \
case 8: \
UINT64DECODE (p, o); \
break; \
case 2: \
UINT16DECODE (p, o); \
break; \
}
1997-07-31 05:17:56 +08:00
#ifdef NOT_YET
#define H5F_encode_length(f,p,l) (H5F_SIZEOF_SIZE(f)==4 ? UINT32ENCODE(p,l) \
: H5F_SIZEOF_SIZE(f)==8 ? UINT64ENCODE(p,l) \
: H5F_SIZEOF_SIZE(f)==2 ? UINT16ENCODE(p,l) : H5FPencode_unusual_length(f,&(p),(uint8 *)&(l)))
1997-07-31 05:17:56 +08:00
#else /* NOT_YET */
#define H5F_encode_length(f,p,l) switch(H5F_SIZEOF_SIZE(f)) { case 4: UINT32ENCODE(p,l); break;\
1997-07-31 05:17:56 +08:00
case 8: UINT64ENCODE(p,l); break;\
case 2: UINT16ENCODE(p,l); break;}
#endif /* NOT_YET */
#define H5F_decode_length(f,p,l) switch(H5F_SIZEOF_SIZE(f)) { case 4: UINT32DECODE(p,l); break;\
1997-07-31 05:17:56 +08:00
case 8: UINT64DECODE(p,l); break;\
case 2: UINT16DECODE(p,l); break;}
/* Private functions, not part of the publicly documented API */
void H5F_encode_length_unusual(const hdf5_file_t *f, uint8 **p, uint8 *l);
void H5F_encode_offset_unusual(const hdf5_file_t *f, uint8 **p, uint8 *o);
intn H5F_compare_filename(const VOIDP obj, const VOIDP key);
herr_t H5F_block_read (hdf5_file_t *f, haddr_t addr, size_t size, void *buf);
herr_t H5F_block_write (hdf5_file_t *f, haddr_t addr, size_t size, void *buf);
herr_t H5F_debug (hdf5_file_t *f, haddr_t addr, FILE *stream, intn indent,
intn fwidth);
1997-07-31 05:17:56 +08:00
#endif /* HDF5FILE_H */