00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "h5File.h"
00017 #include "h5Group.h"
00018 #include "hdf5.h"
00019 #include <assert.h>
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 int H5Group_create(H5Group* g)
00031 {
00032 int ret_value = 0;
00033
00034 THROW_UNSUPPORTED_OPERATION(g->error,
00035 "H5Group_create(H5Group* g) is not implemented",
00036 ret_value, done);
00037
00038 done:
00039 return ret_value;
00040 }
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 int H5Group_delete(H5Group* g)
00052 {
00053 int ret_value = 0;
00054
00055 THROW_UNSUPPORTED_OPERATION(g->error,
00056 "H5Group_delete(H5Group* g) is not implemented",
00057 ret_value, done);
00058
00059 done:
00060 return ret_value;
00061
00062 }
00063
00064 int H5Group_read_attribute(H5Group* ing, H5Group* outg)
00065 {
00066 int ret_value=0, i=0, n=0;
00067 hid_t gid=-1;
00068
00069 if ( (gid = H5Gopen(ing->fid, ing->fullpath)) < 0)
00070 THROW_H5LIBRARY_ERROR(ing->error,ret_value, done);
00071
00072 if ( (n = H5Aget_num_attrs(gid)) <=0 )
00073 goto done;
00074
00075 ing->nattributes = n;
00076 ing->attributes = (H5Attribute *)malloc(n*sizeof(H5Attribute));
00077 for (i=0; i<n; i++) {
00078 H5Attribute_ctor(&(ing->attributes[i]));
00079 ing->attributes[i].fid = ing->fid;
00080 ing->attributes[i].obj_path = (char *)malloc(strlen(ing->fullpath)+1);
00081 strcpy(ing->attributes[i].obj_path, ing->fullpath);
00082 ing->attributes[i].obj_type = H5OBJECT_GROUP;
00083 }
00084
00085
00086 H5File_read_attribute(gid, ing->attributes);
00087
00088 done:
00089 if (gid > 0 ) H5Gclose(gid);
00090
00091 #ifndef HDF5_LOCAL
00092 memset (outg, 0, sizeof (H5Group));
00093
00094
00095
00096 outg->error = ing->error;
00097 outg->nattributes = ing->nattributes;
00098 outg->attributes = ing->attributes;
00099
00100 ing->attributes = NULL;
00101 ing->nattributes = 0;
00102 #endif
00103
00104 return ret_value;
00105 }
00106