20 #include "netcdf_filter.h"
21 #include "nc4internal.h"
23 #include "ncdispatch.h"
25 #include "netcdf_aux.h"
37 static const NC_reservedatt NC_reserved[] = {
38 {NC_ATT_CLASS, READONLYFLAG|HIDDENATTRFLAG},
39 {NC_ATT_DIMENSION_LIST, READONLYFLAG|HIDDENATTRFLAG},
40 {NC_ATT_NAME, READONLYFLAG|HIDDENATTRFLAG},
41 {NC_ATT_REFERENCE_LIST, READONLYFLAG|HIDDENATTRFLAG},
42 {NC_XARRAY_DIMS, READONLYFLAG|HIDDENATTRFLAG},
43 {NC_ATT_FORMAT, READONLYFLAG},
44 {ISNETCDF4ATT, READONLYFLAG|NAMEONLYFLAG},
45 {NCPROPS, READONLYFLAG|NAMEONLYFLAG|MATERIALIZEDFLAG},
46 {NC_NCZARR_ATTR, READONLYFLAG|HIDDENATTRFLAG},
47 {NC_ATT_COORDINATES, READONLYFLAG|HIDDENATTRFLAG|MATERIALIZEDFLAG},
48 {NC_ATT_DIMID_NAME, READONLYFLAG|HIDDENATTRFLAG|MATERIALIZEDFLAG},
49 {SUPERBLOCKATT, READONLYFLAG|NAMEONLYFLAG},
50 {NC_ATT_NC3_STRICT_NAME, READONLYFLAG|MATERIALIZEDFLAG},
52 #define NRESERVED (sizeof(NC_reserved) / sizeof(NC_reservedatt))
59 static int NC4_move_in_NCList(NC* nc,
int new_id);
65 int nc_log_level = NC_TURN_OFF_LOGGING;
81 nc4_check_name(
const char *name,
char *norm_name)
95 if ((retval = NC_check_name(name)))
99 if ((retval = nc_utf8_normalize((
const unsigned char *)name,
100 (
unsigned char **)&temp)))
111 strcpy(norm_name, temp);
138 nc4_file_list_add(
int ncid,
const char *path,
int mode,
void **dispatchdata)
144 if ((ret = NC_check_id(ncid, &nc)))
149 if ((ret = nc4_nc4f_list_add(nc, path, mode)))
155 *dispatchdata = nc->dispatchdata;
174 nc4_file_change_ncid(
int ncid,
unsigned short new_ncid_index)
179 LOG((2,
"%s: ncid %d new_ncid_index %d", __func__, ncid, new_ncid_index));
182 if ((ret = NC_check_id(ncid, &nc)))
187 LOG((3,
"moving nc->ext_ncid %d nc->ext_ncid >> ID_SHIFT %d",
188 nc->ext_ncid, nc->ext_ncid >> ID_SHIFT));
189 if (NC4_move_in_NCList(nc, new_ncid_index))
191 LOG((3,
"moved to new_ncid_index %d new nc->ext_ncid %d", new_ncid_index,
217 nc4_file_list_get(
int ncid,
char **path,
int *mode,
void **dispatchdata)
223 if ((ret = NC_check_id(ncid, &nc)))
236 *dispatchdata = nc->dispatchdata;
256 nc4_nc4f_list_add(NC *nc,
const char *path,
int mode)
261 assert(nc && !NC4_DATA(nc) && path);
265 if (!(h5 = calloc(1,
sizeof(NC_FILE_INFO_T))))
267 nc->dispatchdata = h5;
270 h5->hdr.sort = NCFIL;
271 h5->hdr.name = strdup(path);
272 h5->hdr.id = nc->ext_ncid;
275 h5->cmode = mode | NC_INDEF;
279 h5->next_typeid = NC_FIRSTUSERTYPEID;
282 h5->alldims = nclistnew();
283 h5->alltypes = nclistnew();
284 h5->allgroups = nclistnew();
289 if ((retval = nc4_grp_list_add(h5, NULL, NC_GROUP_NAME, &h5->root_grp)))
308 nc4_find_nc4_grp(
int ncid, NC_GRP_INFO_T **grp)
310 return nc4_find_nc_grp_h5(ncid, NULL, grp, NULL);
329 nc4_find_grp_h5(
int ncid, NC_GRP_INFO_T **grp, NC_FILE_INFO_T **h5)
331 return nc4_find_nc_grp_h5(ncid, NULL, grp, h5);
349 nc4_find_nc_grp_h5(
int ncid, NC **nc, NC_GRP_INFO_T **grp, NC_FILE_INFO_T **h5)
351 NC_GRP_INFO_T *my_grp = NULL;
352 NC_FILE_INFO_T *my_h5 = NULL;
357 if ((retval = NC_check_id(ncid, &my_nc)))
359 my_h5 = my_nc->dispatchdata;
360 assert(my_h5 && my_h5->root_grp);
363 if (!(my_grp = nclistget(my_h5->allgroups, (ncid & GRP_ID_MASK))))
393 nc4_find_grp_h5_var(
int ncid,
int varid, NC_FILE_INFO_T **h5, NC_GRP_INFO_T **grp,
396 NC_FILE_INFO_T *my_h5;
397 NC_GRP_INFO_T *my_grp;
398 NC_VAR_INFO_T *my_var;
402 if ((retval = nc4_find_grp_h5(ncid, &my_grp, &my_h5)))
404 assert(my_grp && my_h5);
407 if (!(my_var = (NC_VAR_INFO_T *)ncindexith(my_grp->vars, varid)))
409 assert(my_var && my_var->hdr.id == varid);
436 nc4_find_dim(NC_GRP_INFO_T *grp,
int dimid, NC_DIM_INFO_T **dim,
437 NC_GRP_INFO_T **dim_grp)
439 assert(grp && grp->nc4_info && dim);
440 LOG((4,
"%s: dimid %d", __func__, dimid));
443 if (!((*dim) = nclistget(grp->nc4_info->alldims, dimid)))
448 *dim_grp = (*dim)->container;
464 nc4_find_var(NC_GRP_INFO_T *grp,
const char *name, NC_VAR_INFO_T **var)
466 assert(grp && var && name);
469 *var = (NC_VAR_INFO_T*)ncindexlookup(grp->vars,name);
483 nc4_rec_find_named_type(NC_GRP_INFO_T *start_grp,
char *name)
486 NC_TYPE_INFO_T *type, *res;
492 type = (NC_TYPE_INFO_T*)ncindexlookup(start_grp->type,name);
497 for(i=0;i<ncindexsize(start_grp->children);i++) {
498 g = (NC_GRP_INFO_T*)ncindexith(start_grp->children,i);
499 if(g == NULL)
continue;
500 if ((res = nc4_rec_find_named_type(g, name)))
519 nc4_find_type(
const NC_FILE_INFO_T *h5,
nc_type typeid, NC_TYPE_INFO_T **type)
523 if (
typeid < 0 || !type)
533 if (!(*type = nclistget(h5->alltypes,
typeid)))
555 nc4_find_grp_att(NC_GRP_INFO_T *grp,
int varid,
const char *name,
int attnum,
559 NC_ATT_INFO_T *my_att;
560 NCindex *attlist = NULL;
562 assert(grp && grp->hdr.name && att);
564 LOG((4,
"%s: grp->name %s varid %d attnum %d", __func__, grp->hdr.name,
574 var = (NC_VAR_INFO_T*)ncindexith(grp->vars,varid);
584 my_att = (NC_ATT_INFO_T *)ncindexlookup(attlist, name);
586 my_att = (NC_ATT_INFO_T *)ncindexith(attlist, attnum);
612 nc4_find_nc_att(
int ncid,
int varid,
const char *name,
int attnum,
618 LOG((4,
"nc4_find_nc_att: ncid 0x%x varid %d name %s attnum %d",
619 ncid, varid, name, attnum));
622 if ((retval = nc4_find_grp_h5(ncid, &grp, NULL)))
626 return nc4_find_grp_att(grp, varid, name, attnum, att);
638 obj_track(NC_FILE_INFO_T* file, NC_OBJ* obj)
643 case NCDIM: list = file->alldims;
break;
644 case NCTYP: list = file->alltypes;
break;
645 case NCGRP: list = file->allgroups;
break;
650 nclistset(list,obj->id,obj);
668 nc4_var_list_add2(NC_GRP_INFO_T *grp,
const char *name, NC_VAR_INFO_T **var)
670 NC_VAR_INFO_T *new_var = NULL;
673 if (!(new_var = calloc(1,
sizeof(NC_VAR_INFO_T))))
675 new_var->hdr.sort = NCVAR;
676 new_var->container = grp;
684 new_var->hdr.id = ncindexsize(grp->vars);
685 if (!(new_var->hdr.name = strdup(name))) {
692 new_var->att = ncindexnew(0);
695 ncindexadd(grp->vars, (NC_OBJ *)new_var);
717 nc4_var_set_ndims(NC_VAR_INFO_T *var,
int ndims)
727 if (!(var->dim = calloc(ndims,
sizeof(NC_DIM_INFO_T *))))
729 if (!(var->dimids = calloc(ndims,
sizeof(
int))))
734 memset(var->dimids, -1, ndims *
sizeof(
int));
755 nc4_var_list_add(NC_GRP_INFO_T* grp,
const char* name,
int ndims,
760 if ((retval = nc4_var_list_add2(grp, name, var)))
762 if ((retval = nc4_var_set_ndims(*var, ndims)))
782 nc4_dim_list_add(NC_GRP_INFO_T *grp,
const char *name,
size_t len,
783 int assignedid, NC_DIM_INFO_T **dim)
785 NC_DIM_INFO_T *new_dim = NULL;
790 if (!(new_dim = calloc(1,
sizeof(NC_DIM_INFO_T))))
793 new_dim->hdr.sort = NCDIM;
797 new_dim->hdr.id = assignedid;
799 new_dim->hdr.id = grp->nc4_info->next_dimid++;
802 if (!(new_dim->hdr.name = strdup(name))) {
812 new_dim->unlimited = NC_TRUE;
815 new_dim->container = grp;
818 ncindexadd(grp->dim, (NC_OBJ *)new_dim);
819 obj_track(grp->nc4_info, (NC_OBJ *)new_dim);
841 nc4_att_list_add(NCindex *list,
const char *name, NC_ATT_INFO_T **att)
843 NC_ATT_INFO_T *new_att = NULL;
845 LOG((3,
"%s: name %s ", __func__, name));
847 if (!(new_att = calloc(1,
sizeof(NC_ATT_INFO_T))))
849 new_att->hdr.sort = NCATT;
852 new_att->hdr.id = ncindexsize(list);
853 if (!(new_att->hdr.name = strdup(name))) {
860 ncindexadd(list, (NC_OBJ *)new_att);
884 nc4_grp_list_add(NC_FILE_INFO_T *h5, NC_GRP_INFO_T *parent,
char *name,
887 NC_GRP_INFO_T *new_grp;
891 LOG((3,
"%s: name %s ", __func__, name));
894 if (!(new_grp = calloc(1,
sizeof(NC_GRP_INFO_T))))
898 new_grp->hdr.sort = NCGRP;
899 new_grp->nc4_info = h5;
900 new_grp->parent = parent;
903 new_grp->hdr.id = h5->next_nc_grpid++;
904 assert(parent || !new_grp->hdr.id);
907 if (!(new_grp->hdr.name = strdup(name)))
914 new_grp->children = ncindexnew(0);
915 new_grp->dim = ncindexnew(0);
916 new_grp->att = ncindexnew(0);
917 new_grp->type = ncindexnew(0);
918 new_grp->vars = ncindexnew(0);
922 ncindexadd(parent->children, (NC_OBJ *)new_grp);
923 obj_track(h5, (NC_OBJ *)new_grp);
946 nc4_check_dup_name(NC_GRP_INFO_T *grp,
char *name)
948 NC_TYPE_INFO_T *type;
953 type = (NC_TYPE_INFO_T*)ncindexlookup(grp->type,name);
958 g = (NC_GRP_INFO_T*)ncindexlookup(grp->children,name);
963 var = (NC_VAR_INFO_T*)ncindexlookup(grp->vars,name);
984 nc4_type_new(
size_t size,
const char *name,
int assignedid,
985 NC_TYPE_INFO_T **type)
987 NC_TYPE_INFO_T *new_type;
989 LOG((4,
"%s: size %d name %s assignedid %d", __func__, size, name, assignedid));
995 if (!(new_type = calloc(1,
sizeof(NC_TYPE_INFO_T))))
997 new_type->hdr.sort = NCTYP;
998 new_type->hdr.id = assignedid;
1001 new_type->size = size;
1002 if (!(new_type->hdr.name = strdup(name))) {
1027 nc4_type_list_add(NC_GRP_INFO_T *grp,
size_t size,
const char *name,
1028 NC_TYPE_INFO_T **type)
1030 NC_TYPE_INFO_T *new_type;
1034 assert(grp && name && type);
1035 LOG((4,
"%s: size %d name %s", __func__, size, name));
1038 if ((retval = nc4_type_new(size, name, grp->nc4_info->next_typeid,
1041 grp->nc4_info->next_typeid++;
1047 ncindexadd(grp->type, (NC_OBJ *)new_type);
1048 obj_track(grp->nc4_info,(NC_OBJ*)new_type);
1070 nc4_field_list_add(NC_TYPE_INFO_T *parent,
const char *name,
1071 size_t offset,
nc_type xtype,
int ndims,
1072 const int *dim_sizesp)
1074 NC_FIELD_INFO_T *field;
1081 if (!(field = calloc(1,
sizeof(NC_FIELD_INFO_T))))
1083 field->hdr.sort = NCFLD;
1086 if (!(field->hdr.name = strdup(name)))
1091 field->nc_typeid = xtype;
1092 field->offset = offset;
1093 field->ndims = ndims;
1097 if (!(field->dim_size = malloc(ndims *
sizeof(
int))))
1099 free(field->hdr.name);
1103 for (i = 0; i < ndims; i++)
1104 field->dim_size[i] = dim_sizesp[i];
1108 field->hdr.id = nclistlength(parent->u.c.field);
1109 nclistpush(parent->u.c.field,field);
1127 nc4_enum_member_add(NC_TYPE_INFO_T *parent,
size_t size,
1128 const char *name,
const void *value)
1130 NC_ENUM_MEMBER_INFO_T *member;
1133 assert(name && size > 0 && value);
1134 LOG((4,
"%s: size %d name %s", __func__, size, name));
1137 if (!(member = calloc(1,
sizeof(NC_ENUM_MEMBER_INFO_T))))
1139 if (!(member->value = malloc(size))) {
1143 if (!(member->name = strdup(name))) {
1144 free(member->value);
1150 memcpy(member->value, value, size);
1153 nclistpush(parent->u.e.enum_member,member);
1167 field_free(NC_FIELD_INFO_T *field)
1170 if (field->hdr.name)
1171 free(field->hdr.name);
1172 if (field->dim_size)
1173 free(field->dim_size);
1189 nc4_type_free(NC_TYPE_INFO_T *type)
1193 assert(type && type->rc && type->hdr.name);
1201 LOG((4,
"%s: deleting type %s", __func__, type->hdr.name));
1204 free(type->hdr.name);
1207 switch (type->nc_type_class)
1211 NC_FIELD_INFO_T *field;
1215 for(i=0;i<nclistlength(type->u.c.field);i++) {
1216 field = nclistget(type->u.c.field,i);
1219 nclistfree(type->u.c.field);
1225 NC_ENUM_MEMBER_INFO_T *enum_member;
1228 for(i=0;i<nclistlength(type->u.e.enum_member);i++) {
1229 enum_member = nclistget(type->u.e.enum_member,i);
1230 free(enum_member->value);
1231 free(enum_member->name);
1234 nclistfree(type->u.e.enum_member);
1258 nc4_att_free(NC_ATT_INFO_T *att)
1263 LOG((3,
"%s: name %s ", __func__, att->hdr.name));
1272 free(att->hdr.name);
1282 for (i = 0; i < att->len; i++)
1284 free(att->stdata[i]);
1291 for (i = 0; i < att->len; i++)
1310 var_free(NC_VAR_INFO_T *var)
1316 LOG((4,
"%s: deleting var %s", __func__, var->hdr.name));
1319 for (i = 0; i < ncindexsize(var->att); i++)
1320 if ((retval = nc4_att_free((NC_ATT_INFO_T *)ncindexith(var->att, i))))
1322 ncindexfree(var->att);
1325 if (var->chunksizes)
1326 free(var->chunksizes);
1329 free(var->alt_name);
1338 if (var->fill_value)
1339 free(var->fill_value);
1343 if ((retval = nc4_type_free(var->type_info)))
1348 free(var->hdr.name);
1366 nc4_var_list_del(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var)
1373 i = ncindexfind(grp->vars, (NC_OBJ *)var);
1375 ncindexidel(grp->vars, i);
1377 return var_free(var);
1389 dim_free(NC_DIM_INFO_T *dim)
1392 LOG((4,
"%s: deleting dim %s", __func__, dim->hdr.name));
1396 free(dim->hdr.name);
1412 nc4_dim_list_del(NC_GRP_INFO_T *grp, NC_DIM_INFO_T *dim)
1416 int pos = ncindexfind(grp->dim, (NC_OBJ *)dim);
1418 ncindexidel(grp->dim, pos);
1421 return dim_free(dim);
1434 nc4_rec_grp_del(NC_GRP_INFO_T *grp)
1440 LOG((3,
"%s: grp->name %s", __func__, grp->hdr.name));
1444 for (i = 0; i < ncindexsize(grp->children); i++)
1445 if ((retval = nc4_rec_grp_del((NC_GRP_INFO_T *)ncindexith(grp->children,
1448 ncindexfree(grp->children);
1451 for (i = 0; i < ncindexsize(grp->att); i++)
1452 if ((retval = nc4_att_free((NC_ATT_INFO_T *)ncindexith(grp->att, i))))
1454 ncindexfree(grp->att);
1457 for (i = 0; i < ncindexsize(grp->vars); i++) {
1458 NC_VAR_INFO_T* v = (NC_VAR_INFO_T *)ncindexith(grp->vars, i);
1459 if ((retval = var_free(v)))
1462 ncindexfree(grp->vars);
1465 for (i = 0; i < ncindexsize(grp->dim); i++)
1466 if ((retval = dim_free((NC_DIM_INFO_T *)ncindexith(grp->dim, i))))
1468 ncindexfree(grp->dim);
1471 for (i = 0; i < ncindexsize(grp->type); i++)
1472 if ((retval = nc4_type_free((NC_TYPE_INFO_T *)ncindexith(grp->type, i))))
1474 ncindexfree(grp->type);
1477 free(grp->hdr.name);
1496 nc4_att_list_del(NCindex *list, NC_ATT_INFO_T *att)
1498 assert(att && list);
1499 ncindexidel(list, ((NC_OBJ *)att)->
id);
1500 return nc4_att_free(att);
1517 nc4_file_list_del(
int ncid)
1523 if ((retval = nc4_find_grp_h5(ncid, NULL, &h5)))
1528 if ((retval = nc4_nc4f_list_del(h5)))
1544 nc4_nc4f_list_del(NC_FILE_INFO_T *h5)
1552 if ((retval = nc4_rec_grp_del(h5->root_grp)))
1556 nclistfree(h5->alldims);
1557 nclistfree(h5->allgroups);
1558 nclistfree(h5->alltypes);
1561 nullfree(h5->hdr.name);
1581 nc4_normalize_name(
const char *name,
char *norm_name)
1584 int stat = nc_utf8_normalize((
const unsigned char *)name,(
unsigned char **)&temp_name);
1592 strcpy(norm_name, temp_name);
1597 #ifdef ENABLE_SET_LOG_LEVEL
1614 nc_set_log_level(
int new_level)
1618 nc_log_level = new_level;
1619 LOG((4,
"log_level changed to %d", nc_log_level));
1626 #define MAX_NESTS 10
1637 rec_print_metadata(NC_GRP_INFO_T *grp,
int tab_count)
1642 NC_TYPE_INFO_T *type;
1643 NC_FIELD_INFO_T *field;
1644 char tabs[MAX_NESTS+1] =
"";
1645 char temp_string[10];
1646 int t, retval, d, i;
1649 for (t = 0; t < tab_count && t < MAX_NESTS; t++)
1653 LOG((2,
"%s GROUP - %s nc_grpid: %d nvars: %d natts: %d",
1654 tabs, grp->hdr.name, grp->hdr.id, ncindexsize(grp->vars), ncindexsize(grp->att)));
1656 for (i = 0; i < ncindexsize(grp->att); i++)
1658 att = (NC_ATT_INFO_T *)ncindexith(grp->att, i);
1660 LOG((2,
"%s GROUP ATTRIBUTE - attnum: %d name: %s type: %d len: %d",
1661 tabs, att->hdr.id, att->hdr.name, att->nc_typeid, att->len));
1664 for (i = 0; i < ncindexsize(grp->dim); i++)
1666 dim = (NC_DIM_INFO_T *)ncindexith(grp->dim, i);
1668 LOG((2,
"%s DIMENSION - dimid: %d name: %s len: %d unlimited: %d",
1669 tabs, dim->hdr.id, dim->hdr.name, dim->len, dim->unlimited));
1672 for (i = 0; i < ncindexsize(grp->vars); i++)
1676 char *dims_string = NULL;
1678 var = (NC_VAR_INFO_T*)ncindexith(grp->vars,i);
1682 if (!(dims_string = malloc(
sizeof(
char) * var->ndims * 4)))
1684 strcpy(dims_string,
"");
1685 for (d = 0; d < var->ndims; d++)
1687 sprintf(temp_string,
" %d", var->dimids[d]);
1688 strcat(dims_string, temp_string);
1691 if (!var->meta_read)
1692 strcat(storage_str,
"unknown");
1694 strcat(storage_str,
"contiguous");
1696 strcat(storage_str,
"compact");
1698 strcat(storage_str,
"chunked");
1700 strcat(storage_str,
"virtual");
1702 strcat(storage_str,
"unknown");
1703 LOG((2,
"%s VARIABLE - varid: %d name: %s ndims: %d "
1704 "dimids:%s storage: %s", tabs, var->hdr.id, var->hdr.name,
1706 (dims_string ? dims_string :
" -"), storage_str));
1707 for (j = 0; j < ncindexsize(var->att); j++)
1709 att = (NC_ATT_INFO_T *)ncindexith(var->att, j);
1711 LOG((2,
"%s VAR ATTRIBUTE - attnum: %d name: %s type: %d len: %d",
1712 tabs, att->hdr.id, att->hdr.name, att->nc_typeid, att->len));
1718 for (i = 0; i < ncindexsize(grp->type); i++)
1720 type = (NC_TYPE_INFO_T*)ncindexith(grp->type, i);
1722 LOG((2,
"%s TYPE - nc_typeid: %d size: %d committed: %d name: %s",
1723 tabs, type->hdr.id, type->size, (
int)type->committed, type->hdr.name));
1728 LOG((3,
"compound type"));
1729 for (j = 0; j < nclistlength(type->u.c.field); j++)
1731 field = (NC_FIELD_INFO_T *)nclistget(type->u.c.field, j);
1732 LOG((4,
"field %s offset %d nctype %d ndims %d", field->hdr.name,
1733 field->offset, field->nc_typeid, field->ndims));
1736 else if (type->nc_type_class ==
NC_VLEN)
1738 LOG((3,
"VLEN type"));
1739 LOG((4,
"base_nc_type: %d", type->u.v.base_nc_typeid));
1741 else if (type->nc_type_class ==
NC_OPAQUE)
1742 LOG((3,
"Opaque type"));
1743 else if (type->nc_type_class ==
NC_ENUM)
1745 LOG((3,
"Enum type"));
1746 LOG((4,
"base_nc_type: %d", type->u.e.base_nc_typeid));
1750 LOG((0,
"Unknown class: %d", type->nc_type_class));
1756 for (i = 0; i < ncindexsize(grp->children); i++)
1757 if ((retval = rec_print_metadata((NC_GRP_INFO_T *)ncindexith(grp->children, i),
1775 log_metadata_nc(NC_FILE_INFO_T *h5)
1777 LOG((2,
"*** NetCDF-4 Internal Metadata: int_ncid 0x%x ext_ncid 0x%x",
1778 h5->root_grp->nc4_info->controller->int_ncid,
1779 h5->root_grp->nc4_info->controller->ext_ncid));
1782 LOG((2,
"This is a netCDF-3 file."));
1785 LOG((2,
"FILE - path: %s cmode: 0x%x parallel: %d redef: %d "
1786 "fill_mode: %d no_write: %d next_nc_grpid: %d", h5->root_grp->nc4_info->controller->path,
1787 h5->cmode, (
int)h5->parallel, (
int)h5->redef, h5->fill_mode, (
int)h5->no_write,
1788 h5->next_nc_grpid));
1789 if(nc_log_level >= 2)
1790 return rec_print_metadata(h5->root_grp, 0);
1808 NC4_show_metadata(
int ncid)
1813 int old_log_level = nc_log_level;
1816 if ((retval = nc4_find_grp_h5(ncid, NULL, &h5)))
1821 retval = log_metadata_nc(h5);
1822 nc_log_level = old_log_level;
1834 const NC_reservedatt*
1835 NC_findreserved(
const char* name)
1842 int m = (L + R) / 2;
1843 const NC_reservedatt* p = &NC_reserved[m];
1844 int cmp = strcmp(p->name,name);
1845 if(cmp == 0)
return p;
1855 NC4_move_in_NCList(NC* nc,
int new_id)
1857 int stat = move_in_NCList(nc,new_id);
1860 if(nc->dispatchdata)
1861 ((NC_OBJ*)nc->dispatchdata)->id = nc->ext_ncid;