summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-03-19 23:27:44 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-03-19 23:27:44 (GMT)
commit43c2e1bab7662ef781545b4d82a2112a6d04823a (patch)
treee4e66226e8892c7a25895cf9fa87598ecf1054bc /src
parent80cb3b063209762ca3b82620d049e40e49816080 (diff)
downloadhdf5-43c2e1bab7662ef781545b4d82a2112a6d04823a.zip
hdf5-43c2e1bab7662ef781545b4d82a2112a6d04823a.tar.gz
hdf5-43c2e1bab7662ef781545b4d82a2112a6d04823a.tar.bz2
[svn-r6500] Purpose:
New Feature Description: Added function pointers for the lock and unlock functions. Platforms tested: Linux, Modi4, Sol Misc. update:
Diffstat (limited to 'src')
-rw-r--r--src/H5FDpublic.h144
1 files changed, 87 insertions, 57 deletions
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index 0a48aff..0f541f9 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -1,7 +1,18 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
/*
- * Copyright © 1999-2001 NCSA
- * All rights reserved.
- *
* Programmer: Robb Matzke <matzke@llnl.gov>
* Monday, July 26, 1999
*/
@@ -31,6 +42,7 @@ typedef enum H5FD_mem_t {
H5FD_MEM_NTYPES /*must be last*/
} H5FD_mem_t;
+
/*
* A free-list map which maps all types of allocation requests to a single
* free list. This is useful for drivers that don't really care about
@@ -125,32 +137,35 @@ typedef struct H5FD_class_t {
haddr_t maxaddr;
H5F_close_degree_t fc_degree;
hsize_t (*sb_size)(H5FD_t *file);
- herr_t (*sb_encode)(H5FD_t *file, char *name/*out*/,
- unsigned char *p/*out*/);
- herr_t (*sb_decode)(H5FD_t *f, const char *name, const unsigned char *p);
- size_t fapl_size;
- void *(*fapl_get)(H5FD_t *file);
- void *(*fapl_copy)(const void *fapl);
- herr_t (*fapl_free)(void *fapl);
- size_t dxpl_size;
- void *(*dxpl_copy)(const void *dxpl);
- herr_t (*dxpl_free)(void *dxpl);
+ herr_t (*sb_encode)(H5FD_t *file, char *name/*out*/,
+ unsigned char *p/*out*/);
+ herr_t (*sb_decode)(H5FD_t *f, const char *name, const unsigned char *p);
+ size_t fapl_size;
+ void * (*fapl_get)(H5FD_t *file);
+ void * (*fapl_copy)(const void *fapl);
+ herr_t (*fapl_free)(void *fapl);
+ size_t dxpl_size;
+ void * (*dxpl_copy)(const void *dxpl);
+ herr_t (*dxpl_free)(void *dxpl);
H5FD_t *(*open)(const char *name, unsigned flags, hid_t fapl,
- haddr_t maxaddr);
- herr_t (*close)(H5FD_t *file);
- int (*cmp)(const H5FD_t *f1, const H5FD_t *f2);
- herr_t (*query)(const H5FD_t *f1, unsigned long *flags);
+ haddr_t maxaddr);
+ herr_t (*close)(H5FD_t *file);
+ int (*cmp)(const H5FD_t *f1, const H5FD_t *f2);
+ herr_t (*query)(const H5FD_t *f1, unsigned long *flags);
haddr_t (*alloc)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
- herr_t (*free)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
+ herr_t (*free)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
+ haddr_t addr, hsize_t size);
haddr_t (*get_eoa)(H5FD_t *file);
- herr_t (*set_eoa)(H5FD_t *file, haddr_t addr);
+ herr_t (*set_eoa)(H5FD_t *file, haddr_t addr);
haddr_t (*get_eof)(H5FD_t *file);
- herr_t (*get_handle)(H5FD_t *file, hid_t fapl, void**file_handle);
- herr_t (*read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size,
- void *buffer);
- herr_t (*write)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size,
- const void *buffer);
- herr_t (*flush)(H5FD_t *file, hid_t dxpl_id, unsigned closing);
+ herr_t (*get_handle)(H5FD_t *file, hid_t fapl, void**file_handle);
+ herr_t (*read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl,
+ haddr_t addr, size_t size, void *buffer);
+ herr_t (*write)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl,
+ haddr_t addr, size_t size, const void *buffer);
+ herr_t (*flush)(H5FD_t *file, hid_t dxpl_id, unsigned closing);
+ herr_t (*lock)(H5FD_t *file, unsigned char *oid, unsigned lock_type, hbool_t last);
+ herr_t (*unlock)(H5FD_t *file, unsigned char *oid, hbool_t last);
H5FD_mem_t fl_map[H5FD_MEM_NTYPES];
} H5FD_class_t;
@@ -162,38 +177,52 @@ typedef struct H5FD_free_t {
} H5FD_free_t;
/*
- * The main datatype for each driver. Public fields common to all drivers are
- * declared here and the driver appends private fields in memory.
+ * The main datatype for each driver. Public fields common to all drivers
+ * are declared here and the driver appends private fields in memory.
*/
struct H5FD_t {
- hid_t driver_id; /*driver ID for this file*/
- const H5FD_class_t *cls; /*constant class info */
- unsigned long fileno[2]; /* File serial number */
-
- unsigned long feature_flags; /* VFL Driver feature Flags */
- hsize_t threshold; /* Threshold for alignment */
- hsize_t alignment; /* Allocation alignment */
+ hid_t driver_id; /*driver ID for this file */
+ const H5FD_class_t *cls; /*constant class info */
+ unsigned long fileno[2]; /* File serial number */
+ unsigned long feature_flags; /* VFL Driver feature Flags */
+ hsize_t threshold; /* Threshold for alignment */
+ hsize_t alignment; /* Allocation alignment */
/* Metadata aggregation fields */
- hsize_t def_meta_block_size; /* Metadata allocation block size (if aggregating metadata) */
- hsize_t cur_meta_block_size; /* Current size of metadata allocation region left */
- haddr_t eoma; /*End of metadata allocated region*/
+ hsize_t def_meta_block_size; /* Metadata allocation
+ * block size (if
+ * aggregating metadata) */
+ hsize_t cur_meta_block_size; /* Current size of metadata
+ * allocation region left */
+ haddr_t eoma; /* End of metadata
+ * allocated region */
/* "Small data" aggregation fields */
- hsize_t def_sdata_block_size; /* "Small data" allocation block size (if aggregating "small data") */
- hsize_t cur_sdata_block_size; /* Current size of "small data" allocation region left */
- haddr_t eosda; /* End of "small data" allocated region */
+ hsize_t def_sdata_block_size; /* "Small data"
+ * allocation block size
+ * (if aggregating "small
+ * data") */
+ hsize_t cur_sdata_block_size; /* Current size of "small
+ * data" allocation
+ * region left */
+ haddr_t eosda; /* End of "small data"
+ * allocated region */
/* Metadata accumulator fields */
- unsigned char *meta_accum; /*Buffer to hold the accumulated metadata */
- haddr_t accum_loc; /* File location (offset) of the accumulated metadata */
- size_t accum_size; /* Size of the accumulated metadata buffer used (in bytes) */
- size_t accum_buf_size; /* Size of the accumulated metadata buffer allocated (in bytes) */
- unsigned accum_dirty; /* Flag to indicate that the accumulated metadata is dirty */
-
- haddr_t maxaddr;/*for this file, overrides class*/
- H5FD_free_t *fl[H5FD_MEM_NTYPES];/*freelist per allocation type*/
- hsize_t maxsize;/*largest object on FL, or zero */
+ unsigned char *meta_accum; /* Buffer to hold the accumulated metadata */
+ haddr_t accum_loc; /* File location (offset) of the
+ * accumulated metadata */
+ size_t accum_size; /* Size of the accumulated
+ * metadata buffer used (in
+ * bytes) */
+ size_t accum_buf_size; /* Size of the accumulated
+ * metadata buffer allocated (in
+ * bytes) */
+ unsigned accum_dirty; /* Flag to indicate that the
+ * accumulated metadata is dirty */
+ haddr_t maxaddr; /* For this file, overrides class */
+ H5FD_free_t *fl[H5FD_MEM_NTYPES]; /* Freelist per allocation type */
+ hsize_t maxsize; /* Largest object on FL, or zero */
};
#ifdef __cplusplus
@@ -204,22 +233,23 @@ extern "C" {
H5_DLL hid_t H5FDregister(const H5FD_class_t *cls);
H5_DLL herr_t H5FDunregister(hid_t driver_id);
H5_DLL H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id,
- haddr_t maxaddr);
+ haddr_t maxaddr);
H5_DLL herr_t H5FDclose(H5FD_t *file);
H5_DLL int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2);
H5_DLL int H5FDquery(const H5FD_t *f, unsigned long *flags);
H5_DLL haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
-H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
-H5_DLL haddr_t H5FDrealloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
- hsize_t old_size, hsize_t new_size);
+H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
+ haddr_t addr, hsize_t size);
+H5_DLL haddr_t H5FDrealloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
+ haddr_t addr, hsize_t old_size, hsize_t new_size);
H5_DLL haddr_t H5FDget_eoa(H5FD_t *file);
H5_DLL herr_t H5FDset_eoa(H5FD_t *file, haddr_t eof);
H5_DLL haddr_t H5FDget_eof(H5FD_t *file);
H5_DLL herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void**file_handle);
-H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- void *buf/*out*/);
-H5_DLL herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- const void *buf);
+H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
+ haddr_t addr, size_t size, void *buf/*out*/);
+H5_DLL herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
+ haddr_t addr, size_t size, const void *buf);
H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, unsigned closing);
#ifdef __cplusplus