summaryrefslogtreecommitdiffstats
path: root/src/H5B.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-08-28 16:37:58 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-08-28 16:37:58 (GMT)
commit27078082978818bb1e284677639c1ebac45bf90a (patch)
tree187d2ceda4e7c15aeaa6fa9c8c05f50acbd58054 /src/H5B.c
parentae4e4231330459115827485b2896c992f904294d (diff)
downloadhdf5-27078082978818bb1e284677639c1ebac45bf90a.zip
hdf5-27078082978818bb1e284677639c1ebac45bf90a.tar.gz
hdf5-27078082978818bb1e284677639c1ebac45bf90a.tar.bz2
[svn-r44] ./src/H5D.c
I commented out a bunch of code in H5D_flush() so I could compile and link the test cases. If you commit your changes to that file, whatever they may be, I'll change H5D_flush() to use the new directory functions described below... ./src/H5G.c H5G_namei() ----------- Understands files without directories. The root object (directory or not) can be found by asking for `/' (or any equivalent absolute or relative name like `/.//.///' or `.//.///' (if the cwd is the root)) or by name like `/foo' (or any other equivalent absolute or relative name) if the object has a name message with the value `foo'. This function is used by most of the other H5G functions so they now understand directory-less files too. H5G_new() --------- Creates the root directory implicitly if it doesn't already exist, moving any previous non-directory root object into the new root directory before creating the requested directory within the root. The creation of the root directory happens first, regardless of whether the requested directory creation succeeds. Once the root directory is created it never disappears even if the file later has only one object. This "feature" can be used to force a file to have a root directory by saying something like: H5G_new (..., "/", ...); H5ECLEAR; /*we don't care about the H5E_EXISTS failure*/ The H5G_new() in the previous example fails because the root directory is created implicitly before we attempt to create the requested "/" directory. H5G_find() ---------- Understands files without directories. If there is no root object then this function is guaranteed to fail even if the request is for `/'. As mentioned for H5G_namei(), the root object can be retrieved with `/' or `/foo' (or equivalent absolute or relative names). H5G_insert() ------------ Understands files without directories and attempts to create such files when there is only one object. The root symbol table is created implicitly when necessary. A root object can be given a name message by the caller and then inserted with the name `/' or it can be inserted with the name `/foo' in which case H5G_insert() will set the name message to `foo'. H5G_modify() ------------ Understands files without directories. ./src/H5Fprivate.h Removed the root_type field from hdf5_file_t. ./src/H5Fprivate.h ./src/H5F.c Removed H5F_root_type() ./src/H5Fpublic.h Removed H5F_root_symtype_t. ./src/H5Oprivate.h ./src/H5O.c Added H5O_remove() which is currently a no-op.
Diffstat (limited to 'src/H5B.c')
-rw-r--r--src/H5B.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/H5B.c b/src/H5B.c
index b09e3bc..f1fd996 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -347,7 +347,7 @@ H5B_flush (hdf5_file_t *f, hbool_t destroy, haddr_t addr, H5B_t *bt)
if (bt->dirty) {
/* magic number */
- memcpy (p, H5B_MAGIC, H5B_SIZEOF_MAGIC);
+ HDmemcpy (p, H5B_MAGIC, H5B_SIZEOF_MAGIC);
p += 4;
/* node type and level */
@@ -586,12 +586,12 @@ H5B_split (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr, intn anchor)
/*
* Copy data into the new node from the old node.
*/
- memcpy (bt->page + H5B_SIZEOF_HDR(f),
- old->page + H5B_SIZEOF_HDR(f) + delta*recsize,
- H5B_K(f,type) * recsize + bt->sizeof_rkey);
- memcpy (bt->native,
- old->native + delta * type->sizeof_nkey,
- (H5B_K(f,type)+1) * type->sizeof_nkey);
+ HDmemcpy (bt->page + H5B_SIZEOF_HDR(f),
+ old->page + H5B_SIZEOF_HDR(f) + delta*recsize,
+ H5B_K(f,type) * recsize + bt->sizeof_rkey);
+ HDmemcpy (bt->native,
+ old->native + delta * type->sizeof_nkey,
+ (H5B_K(f,type)+1) * type->sizeof_nkey);
for (i=0, offset=H5B_SIZEOF_HDR(f);
i<=2*H5B_K(f,type);
@@ -630,12 +630,12 @@ H5B_split (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr, intn anchor)
old->nchildren = H5B_K(f,type);
if (H5B_ANCHOR_RT==anchor) {
- memcpy (old->page + H5B_SIZEOF_HDR(f),
- old->page + H5B_SIZEOF_HDR(f) + delta*recsize,
- H5B_K(f,type) * recsize);
- memmove (old->native,
- old->native + delta * type->sizeof_nkey,
- (H5B_K(f,type)+1) * type->sizeof_nkey);
+ HDmemcpy (old->page + H5B_SIZEOF_HDR(f),
+ old->page + H5B_SIZEOF_HDR(f) + delta*recsize,
+ H5B_K(f,type) * recsize);
+ HDmemmove (old->native,
+ old->native + delta * type->sizeof_nkey,
+ (H5B_K(f,type)+1) * type->sizeof_nkey);
for (i=0; i<=2*H5B_K(f,type); i++) {
@@ -798,7 +798,7 @@ H5B_insert (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
if (!bt->key[0].nkey && H5B_decode_key (f, bt, 0)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (lt_key, bt->key[0].nkey, type->sizeof_nkey);
+ HDmemcpy (lt_key, bt->key[0].nkey, type->sizeof_nkey);
}
/* the new node */
@@ -810,7 +810,7 @@ H5B_insert (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
H5B_decode_key (f, bt, bt->nchildren)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (rt_key, bt->key[bt->nchildren].nkey, type->sizeof_nkey);
+ HDmemcpy (rt_key, bt->key[bt->nchildren].nkey, type->sizeof_nkey);
}
/*
@@ -872,16 +872,16 @@ H5B_insert (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
bt->child[0] = addr;
bt->key[0].dirty = 1;
bt->key[0].nkey = bt->native;
- memcpy (bt->key[0].nkey, lt_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[0].nkey, lt_key, type->sizeof_nkey);
bt->child[1] = child;
bt->key[1].dirty = 1;
bt->key[1].nkey = bt->native + type->sizeof_nkey;
- memcpy (bt->key[1].nkey, md_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[1].nkey, md_key, type->sizeof_nkey);
bt->key[2].dirty = 1;
bt->key[2].nkey = bt->native + 2 * type->sizeof_nkey;
- memcpy (bt->key[2].nkey, rt_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[2].nkey, rt_key, type->sizeof_nkey);
FUNC_LEAVE (new_root);
}
@@ -925,13 +925,13 @@ H5B_insert_child (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr,
/*
* The MD_KEY is the left key of the new node.
*/
- memmove (bt->page + H5B_SIZEOF_HDR(f) + (idx+1)*recsize,
- bt->page + H5B_SIZEOF_HDR(f) + idx*recsize,
- (bt->nchildren-idx)*recsize + bt->sizeof_rkey);
+ HDmemmove (bt->page + H5B_SIZEOF_HDR(f) + (idx+1)*recsize,
+ bt->page + H5B_SIZEOF_HDR(f) + idx*recsize,
+ (bt->nchildren-idx)*recsize + bt->sizeof_rkey);
- memmove (bt->native + (idx+1) * type->sizeof_nkey,
- bt->native + idx * type->sizeof_nkey,
- ((bt->nchildren-idx)+1) * type->sizeof_nkey);
+ HDmemmove (bt->native + (idx+1) * type->sizeof_nkey,
+ bt->native + idx * type->sizeof_nkey,
+ ((bt->nchildren-idx)+1) * type->sizeof_nkey);
for (i=bt->nchildren; i>=idx; --i) {
bt->key[i+1].dirty = bt->key[i].dirty;
@@ -943,21 +943,21 @@ H5B_insert_child (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr,
}
bt->key[idx].dirty = 1;
bt->key[idx].nkey = bt->native + idx * type->sizeof_nkey;
- memcpy (bt->key[idx].nkey, md_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[idx].nkey, md_key, type->sizeof_nkey);
} else {
/*
* The MD_KEY is the right key of the new node.
*/
- memmove (bt->page + (H5B_SIZEOF_HDR(f) +
- (idx+1)*recsize + bt->sizeof_rkey),
- bt->page + (H5B_SIZEOF_HDR(f) +
- idx*recsize + bt->sizeof_rkey),
- (bt->nchildren-idx) * recsize);
+ HDmemmove (bt->page + (H5B_SIZEOF_HDR(f) +
+ (idx+1)*recsize + bt->sizeof_rkey),
+ bt->page + (H5B_SIZEOF_HDR(f) +
+ idx*recsize + bt->sizeof_rkey),
+ (bt->nchildren-idx) * recsize);
- memmove (bt->native + idx + 2,
- bt->native + idx + 1,
- (bt->nchildren-idx) * type->sizeof_nkey);
+ HDmemmove (bt->native + idx + 2,
+ bt->native + idx + 1,
+ (bt->nchildren-idx) * type->sizeof_nkey);
for (i=bt->nchildren; i>idx; --i) {
bt->key[i+1].dirty = bt->key[i].dirty;
@@ -969,12 +969,12 @@ H5B_insert_child (hdf5_file_t *f, const H5B_class_t *type, haddr_t addr,
}
bt->key[idx+1].dirty = 1;
bt->key[idx+1].nkey = bt->native + (idx+1) * type->sizeof_nkey;
- memcpy (bt->key[idx+1].nkey, md_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[idx+1].nkey, md_key, type->sizeof_nkey);
}
- memmove (bt->child + idx + 1,
- bt->child + idx,
- (bt->nchildren - idx) * sizeof(haddr_t));
+ HDmemmove (bt->child + idx + 1,
+ bt->child + idx,
+ (bt->nchildren - idx) * sizeof(haddr_t));
bt->child[idx] = child;
bt->nchildren += 1;
@@ -1064,13 +1064,13 @@ H5B_insert_helper (hdf5_file_t *f, haddr_t addr, const H5B_class_t *type,
if (!bt->key[idx].nkey && H5B_decode_key (f, bt, idx)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (lt_key, bt->key[idx].nkey, type->sizeof_nkey);
+ HDmemcpy (lt_key, bt->key[idx].nkey, type->sizeof_nkey);
/* right key */
if (!bt->key[idx+1].nkey && H5B_decode_key (f, bt, idx+1)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (rt_key, bt->key[idx+1].nkey, type->sizeof_nkey);
+ HDmemcpy (rt_key, bt->key[idx+1].nkey, type->sizeof_nkey);
/* compare */
if ((cmp=(type->cmp)(f, lt_key, udata, rt_key))<0) {
@@ -1096,11 +1096,11 @@ H5B_insert_helper (hdf5_file_t *f, haddr_t addr, const H5B_class_t *type,
if (!bt->key[idx].nkey && H5B_decode_key (f, bt, idx)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (lt_key, bt->key[idx].nkey, type->sizeof_nkey);
+ HDmemcpy (lt_key, bt->key[idx].nkey, type->sizeof_nkey);
if (!bt->key[idx+1].nkey && H5B_decode_key (f, bt, idx+1)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (rt_key, bt->key[idx+1].nkey, type->sizeof_nkey);
+ HDmemcpy (rt_key, bt->key[idx+1].nkey, type->sizeof_nkey);
}
} else if (cmp>0 && idx+1>=bt->nchildren) {
idx = bt->nchildren-1;
@@ -1109,11 +1109,11 @@ H5B_insert_helper (hdf5_file_t *f, haddr_t addr, const H5B_class_t *type,
if (!bt->key[idx].nkey && H5B_decode_key (f, bt, idx)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (lt_key, bt->key[idx].nkey, type->sizeof_nkey);
+ HDmemcpy (lt_key, bt->key[idx].nkey, type->sizeof_nkey);
if (!bt->key[idx+1].nkey && H5B_decode_key (f, bt, idx+1)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (rt_key, bt->key[idx+1].nkey, type->sizeof_nkey);
+ HDmemcpy (rt_key, bt->key[idx+1].nkey, type->sizeof_nkey);
}
}
assert (0==cmp);
@@ -1138,11 +1138,11 @@ H5B_insert_helper (hdf5_file_t *f, haddr_t addr, const H5B_class_t *type,
bt->key[0].dirty = 1;
bt->key[0].nkey = bt->native;
- memcpy (bt->key[0].nkey, lt_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[0].nkey, lt_key, type->sizeof_nkey);
bt->key[1].dirty = 1;
bt->key[1].nkey = bt->native + type->sizeof_nkey;
- memcpy (bt->key[1].nkey, rt_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[1].nkey, rt_key, type->sizeof_nkey);
idx = 0;
}
@@ -1171,7 +1171,7 @@ H5B_insert_helper (hdf5_file_t *f, haddr_t addr, const H5B_class_t *type,
*/
if (*lt_key_changed) {
bt->key[idx].nkey = bt->native + idx * type->sizeof_nkey;
- memcpy (bt->key[idx].nkey, lt_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[idx].nkey, lt_key, type->sizeof_nkey);
bt->dirty += 1;
bt->key[idx].dirty = 1;
if (idx>0) *lt_key_changed = FALSE;
@@ -1179,7 +1179,7 @@ H5B_insert_helper (hdf5_file_t *f, haddr_t addr, const H5B_class_t *type,
if (*rt_key_changed) {
bt->key[idx+1].nkey = bt->native +
(idx+1) * type->sizeof_nkey;
- memcpy (bt->key[idx+1].nkey, rt_key, type->sizeof_nkey);
+ HDmemcpy (bt->key[idx+1].nkey, rt_key, type->sizeof_nkey);
bt->dirty += 1;
bt->key[idx+1].dirty = 1;
if (idx+1<bt->nchildren) *rt_key_changed = FALSE;
@@ -1229,13 +1229,13 @@ H5B_insert_helper (hdf5_file_t *f, haddr_t addr, const H5B_class_t *type,
if (!bt->key[0].nkey && H5B_decode_key (f, bt, 0)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (md_key, bt->key[0].nkey, type->sizeof_nkey);
+ HDmemcpy (md_key, bt->key[0].nkey, type->sizeof_nkey);
} else {
if (!bt->key[bt->nchildren].nkey &&
H5B_decode_key (f, bt, bt->nchildren)<0) {
HRETURN_ERROR (H5E_BTREE, H5E_CANTDECODE, FAIL);
}
- memcpy (md_key, bt->key[bt->nchildren].nkey, type->sizeof_nkey);
+ HDmemcpy (md_key, bt->key[bt->nchildren].nkey, type->sizeof_nkey);
}
}