diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-04-07 15:34:16 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-04-07 15:34:16 (GMT) |
commit | 68fa66bf8130d6a6e607e233da8cc61a154bf172 (patch) | |
tree | b5a0e0120492c7bb9f935ab74f4cef97d6bbcbee /src/H5G.c | |
parent | 92571bbe1d77c74ddefeeba6ac0b2097593c058d (diff) | |
download | hdf5-68fa66bf8130d6a6e607e233da8cc61a154bf172.zip hdf5-68fa66bf8130d6a6e607e233da8cc61a154bf172.tar.gz hdf5-68fa66bf8130d6a6e607e233da8cc61a154bf172.tar.bz2 |
[svn-r337] Changes since 19980403
----------------------
./configure.in
Moved setting of compiler warning switches earlier in the file.
Turned on more warning switches to gcc.
./config/linux
Prints a warning if the gcc version is less than 2.8.1 since
that version has problems with register allocation for `long
long'.
./html/Datatypes.html
Documented sharing of data types between datasets.
./src/H5G.c
./src/H5Gpublic.h
Implemented H5Gmove(), H5Glink() and H5Gunlink() for hard
links. Still have soft links to do.
./src/H5AC.c
./src/H5ACprivate.h
./src/H5D.c
./src/H5E.c
./src/H5Eprivate.h
./src/H5F.c
./src/H5Farray.c
./src/H5Fcore.c
./src/H5Ffamily.c
./src/H5Fistore.c
./src/H5Flow.c
./src/H5Fprivate.h
./src/H5Fpublic.h
./src/H5Fsec2.c
./src/H5Fstdio.c
./src/H5G.c
./src/H5Gent.c
./src/H5Gnode.c
./src/H5Gpkg.h
./src/H5Gprivate.h
./src/H5HG.c
./src/H5HL.c
./src/H5HLprivate.h
./src/H5I.c
./src/H5Iprivate.h
./src/H5MM.c
./src/H5MMprivate.h
./src/H5O.c
./src/H5Oefl.c
./src/H5Oprivate.h
./src/H5Osdspace.c
./src/H5Oshared.c
./src/H5Ostab.c
./src/H5P.c
./src/H5S.c
./src/H5Ssimp.c
./src/H5T.c
./src/H5Tconv.c
./src/H5Tprivate.h
./src/H5Tpublic.h
./src/H5V.c
./src/H5Vprivate.h
./src/H5detect.c
./src/h5ls.c
./test/cmpd_dset.c
./test/dsets.c
./test/external.c
./test/hyperslab.c
./test/iopipe.c
./test/istore.c
./test/shtype.c
./test/tstab.c
Fixed comparisons between signed and unsigned values. Fixed
warnings about unused function arguments.
Diffstat (limited to 'src/H5G.c')
-rw-r--r-- | src/H5G.c | 180 |
1 files changed, 180 insertions, 0 deletions
@@ -492,6 +492,131 @@ H5Giterate (hid_t loc_id, const char *name, int *idx, FUNC_LEAVE (ret_value); } + +/*------------------------------------------------------------------------- + * Function: H5Gmove + * + * Purpose: Renames an object within an HDF5 file. The original name SRC + * is unlinked from the group graph and the new name DST is + * inserted as an atomic operation. Both names are interpreted + * relative to LOC_ID which is either a file ID or a group ID. + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Monday, April 6, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Gmove (hid_t loc_id __attribute__((unused)), + const char *src __attribute__((unused)), + const char *dst __attribute__((unused))) +{ + FUNC_ENTER (H5Gmove, FAIL); + + HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL, + "unable to rename object (not implemented yet)"); + + FUNC_LEAVE (SUCCEED); +} + + +/*------------------------------------------------------------------------- + * Function: H5Glink + * + * Purpose: Creates a link of the specified type from NEW_NAME to + * CUR_NAME. + * + * If TYPE is H5G_LINK_HARD then CUR_NAME must name an existing + * object and both names are interpreted relative to LOC_ID + * which is either a file ID or a group ID. + * + * If TYPE is H5G_LINK_SOFT then CUR_NAME can be anything and is + * interpreted at lookup time relative to the group which + * contains the final component of NEW_NAME. For instance, if + * CUR_NAME is `./foo' and NEW_NAME is `./x/y/bar' and a request + * is made for `./x/y/bar' then the actual object looked up is + * `./x/y/./foo'. + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Monday, April 6, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Glink (hid_t loc_id, H5G_link_t type, const char *cur_name, + const char *new_name) +{ + H5G_t *loc = NULL; + + FUNC_ENTER (H5Glink, FAIL); + + if (NULL==(loc=H5G_loc (loc_id))) { + HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); + } + if (type!=H5G_LINK_HARD && type!=H5G_LINK_SOFT) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unrecognized link type"); + } + if (!cur_name || !*cur_name) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "no current name specified"); + } + if (!new_name || !*new_name) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "no new name specified"); + } + if (H5G_link (loc, type, cur_name, new_name)<0) { + HRETURN_ERROR (H5E_SYM, H5E_LINK, FAIL, "unable to create link"); + } + + FUNC_LEAVE (SUCCEED); +} + + +/*------------------------------------------------------------------------- + * Function: H5Gunlink + * + * Purpose: Removes the specified NAME from the group graph and + * decrements the link count for the object to which NAME + * points. If the link count reaches zero then all file-space + * associated with the object will be reclaimed (but if the + * object is open, then the reclamation of the file space is + * delayed until all handles to the object are closed). + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Monday, April 6, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Gunlink (hid_t loc_id __attribute__((unused)), + const char *name __attribute__((unused))) +{ + FUNC_ENTER (H5Gunlink, FAIL); + + HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL, + "unable to unlink name (not implemented yet)"); + + FUNC_LEAVE (SUCCEED); +} + /* *------------------------------------------------------------------------- *------------------------------------------------------------------------- @@ -1385,3 +1510,58 @@ H5G_loc (hid_t loc_id) FUNC_LEAVE (ret_value); } + + +/*------------------------------------------------------------------------- + * Function: H5G_link + * + * Purpose: Creates a link from NEW_NAME to CUR_NAME. See H5Glink() for + * full documentation. + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Monday, April 6, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_link (H5G_t *loc, H5G_type_t type, const char *cur_name, + const char *new_name) +{ + H5G_entry_t cur_obj; + + FUNC_ENTER (H5G_link, FAIL); + + /* Check args */ + assert (loc); + assert (cur_name && *cur_name); + assert (new_name && *new_name); + + switch (type) { + case H5G_LINK_SOFT: + HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL, + "unable to create soft link (not implemented yet)"); + + case H5G_LINK_HARD: + if (H5G_find (loc, cur_name, NULL, &cur_obj)<0) { + HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, + "source object not found"); + } + if (H5G_insert (loc, new_name, &cur_obj)<0) { + HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, + "unable to create new name/link for object"); + } + break; + + default: + HRETURN_ERROR (H5E_SYM, H5E_BADVALUE, FAIL, + "unrecognized link type"); + } + + FUNC_LEAVE (SUCCEED); +} |