NetCDF  4.6.1
nc4type.c
Go to the documentation of this file.
1 
16 #include "nc4internal.h"
17 #include "nc4dispatch.h"
18 
19 #define NUM_ATOMIC_TYPES 13
22 char atomic_name[NUM_ATOMIC_TYPES][NC_MAX_NAME + 1] = {"none", "byte", "char",
23  "short", "int", "float",
24  "double", "ubyte",
25  "ushort", "uint",
26  "int64", "uint64", "string"};
27 
28 /* The sizes of types may vary from platform to platform, but within
29  * netCDF files, type sizes are fixed. */
30 #define NC_CHAR_LEN sizeof(char)
31 #define NC_STRING_LEN sizeof(char *)
32 #define NC_BYTE_LEN 1
33 #define NC_SHORT_LEN 2
34 #define NC_INT_LEN 4
35 #define NC_FLOAT_LEN 4
36 #define NC_DOUBLE_LEN 8
37 #define NC_INT64_LEN 8
54 extern int
55 NC4_inq_type_equal(int ncid1, nc_type typeid1, int ncid2,
56  nc_type typeid2, int *equalp)
57 {
58  NC_GRP_INFO_T *grpone, *grptwo;
59  NC_TYPE_INFO_T *type1, *type2;
60  int retval;
61 
62  LOG((2, "nc_inq_type_equal: ncid1 0x%x typeid1 %d ncid2 0x%x typeid2 %d",
63  ncid1, typeid1, ncid2, typeid2));
64 
65  /* Check input. */
66  if(equalp == NULL) return NC_NOERR;
67 
68  if (typeid1 <= NC_NAT || typeid2 <= NC_NAT)
69  return NC_EINVAL;
70 
71  /* If one is atomic, and the other user-defined, the types are not
72  * equal. */
73  if ((typeid1 <= NC_STRING && typeid2 > NC_STRING) ||
74  (typeid2 <= NC_STRING && typeid1 > NC_STRING))
75  {
76  if (equalp) *equalp = 0;
77  return NC_NOERR;
78  }
79 
80  /* If both are atomic types, the answer is easy. */
81  if (typeid1 <= NUM_ATOMIC_TYPES)
82  {
83  if (equalp)
84  {
85  if (typeid1 == typeid2)
86  *equalp = 1;
87  else
88  *equalp = 0;
89  }
90  return NC_NOERR;
91  }
92 
93  /* Not atomic types - so find type1 and type2 information. */
94  if ((retval = nc4_find_nc4_grp(ncid1, &grpone)))
95  return retval;
96  if (!(type1 = nc4_rec_find_nc_type(grpone->nc4_info->root_grp,
97  typeid1)))
98  return NC_EBADTYPE;
99  if ((retval = nc4_find_nc4_grp(ncid2, &grptwo)))
100  return retval;
101  if (!(type2 = nc4_rec_find_nc_type(grptwo->nc4_info->root_grp,
102  typeid2)))
103  return NC_EBADTYPE;
104 
105  /* Are the two types equal? */
106  if (equalp)
107  {
108  if ((retval = H5Tequal(type1->native_hdf_typeid, type2->native_hdf_typeid)) < 0)
109  return NC_EHDFERR;
110  *equalp = 1 ? retval : 0;
111  }
112 
113  return NC_NOERR;
114 }
115 
130 extern int
131 NC4_inq_typeid(int ncid, const char *name, nc_type *typeidp)
132 {
133  NC_GRP_INFO_T *grp;
134  NC_GRP_INFO_T *grptwo;
135  NC_HDF5_FILE_INFO_T *h5;
136  NC_TYPE_INFO_T *type = NULL;
137  char *norm_name;
138  int i, retval;
139 
140  /* Handle atomic types. */
141  for (i = 0; i < NUM_ATOMIC_TYPES; i++)
142  if (!strcmp(name, atomic_name[i]))
143  {
144  if (typeidp)
145  *typeidp = i;
146  return NC_NOERR;
147  }
148 
149  /* Find info for this file and group, and set pointer to each. */
150  if ((retval = nc4_find_grp_h5(ncid, &grp, &h5)))
151  return retval;
152  assert(h5 && grp);
153 
154  /* If the first char is a /, this is a fully-qualified
155  * name. Otherwise, this had better be a local name (i.e. no / in
156  * the middle). */
157  if (name[0] != '/' && strstr(name, "/"))
158  return NC_EINVAL;
159 
160  /* Normalize name. */
161  if (!(norm_name = (char*)malloc(strlen(name) + 1)))
162  return NC_ENOMEM;
163  if ((retval = nc4_normalize_name(name, norm_name))) {
164  free(norm_name);
165  return retval;
166  }
167  /* Is the type in this group? If not, search parents. */
168  for (grptwo = grp; grptwo; grptwo = grptwo->parent)
169  for (type = grptwo->type; type; type = type->l.next)
170  if (!strcmp(norm_name, type->name))
171  {
172  if (typeidp)
173  *typeidp = type->nc_typeid;
174  break;
175  }
176 
177  /* Still didn't find type? Search file recursively, starting at the
178  * root group. */
179  if (!type)
180  if ((type = nc4_rec_find_named_type(grp->nc4_info->root_grp, norm_name)))
181  if (typeidp)
182  *typeidp = type->nc_typeid;
183 
184  free(norm_name);
185 
186  /* OK, I give up already! */
187  if (!type)
188  return NC_EBADTYPE;
189 
190  return NC_NOERR;
191 }
192 
206 int
207 NC4_inq_typeids(int ncid, int *ntypes, int *typeids)
208 {
209  NC_GRP_INFO_T *grp;
210  NC_HDF5_FILE_INFO_T *h5;
211  NC_TYPE_INFO_T *type;
212  int num = 0;
213  int retval;
214 
215  LOG((2, "nc_inq_typeids: ncid 0x%x", ncid));
216 
217  /* Find info for this file and group, and set pointer to each. */
218  if ((retval = nc4_find_grp_h5(ncid, &grp, &h5)))
219  return retval;
220  assert(h5 && grp);
221 
222  /* Count types. */
223  if (grp->type)
224  for (type = grp->type; type; type = type->l.next)
225  {
226  if (typeids)
227  typeids[num] = type->nc_typeid;
228  num++;
229  }
230 
231  /* Give the count to the user. */
232  if (ntypes)
233  *ntypes = num;
234 
235  return NC_NOERR;
236 }
237 
257 static int
258 add_user_type(int ncid, size_t size, const char *name, nc_type base_typeid,
259  nc_type type_class, nc_type *typeidp)
260 {
261  NC_HDF5_FILE_INFO_T *h5;
262  NC_GRP_INFO_T *grp;
263  NC_TYPE_INFO_T *type;
264  char norm_name[NC_MAX_NAME + 1];
265  int retval;
266 
267  /* Check and normalize the name. */
268  if ((retval = nc4_check_name(name, norm_name)))
269  return retval;
270 
271  LOG((2, "%s: ncid 0x%x size %d name %s base_typeid %d ",
272  __FUNCTION__, ncid, size, norm_name, base_typeid));
273 
274  /* Find group metadata. */
275  if ((retval = nc4_find_grp_h5(ncid, &grp, &h5)))
276  return retval;
277  assert(h5 && grp);
278 
279  /* Turn on define mode if it is not on. */
280  if (!(h5->cmode & NC_INDEF))
281  if ((retval = NC4_redef(ncid)))
282  return retval;
283 
284  /* No size is provided for vlens or enums, get it from the base type. */
285  if (type_class == NC_VLEN || type_class == NC_ENUM)
286  {
287  if ((retval = nc4_get_typelen_mem(grp->nc4_info, base_typeid, 0,
288  &size)))
289  return retval;
290  }
291  else if (size <= 0)
292  return NC_EINVAL;
293 
294  /* Check that this name is not in use as a var, grp, or type. */
295  if ((retval = nc4_check_dup_name(grp, norm_name)))
296  return retval;
297 
298  /* Add to our list of types. */
299  if ((retval = nc4_type_list_add(grp, size, norm_name, &type)))
300  return retval;
301 
302  /* Remember info about this type. */
303  type->nc_type_class = type_class;
304  if (type_class == NC_VLEN)
305  type->u.v.base_nc_typeid = base_typeid;
306  else if (type_class == NC_ENUM)
307  type->u.e.base_nc_typeid = base_typeid;
308 
309  /* Return the typeid to the user. */
310  if (typeidp)
311  *typeidp = type->nc_typeid;
312 
313  return NC_NOERR;
314 }
315 
330 int
331 NC4_inq_type(int ncid, nc_type typeid1, char *name, size_t *size)
332 {
333  NC_GRP_INFO_T *grp;
334  NC_TYPE_INFO_T *type;
335  int atomic_size[NUM_ATOMIC_TYPES] = {0, NC_BYTE_LEN, NC_CHAR_LEN, NC_SHORT_LEN,
336  NC_INT_LEN, NC_FLOAT_LEN, NC_DOUBLE_LEN,
337  NC_BYTE_LEN, NC_SHORT_LEN, NC_INT_LEN, NC_INT64_LEN,
338  NC_INT64_LEN, NC_STRING_LEN};
339 
340  int retval;
341 
342  LOG((2, "nc_inq_type: ncid 0x%x typeid %d", ncid, typeid1));
343 
344  /* If this is an atomic type, the answer is easy. */
345  if (typeid1 < NUM_ATOMIC_TYPES)
346  {
347  if (name)
348  strcpy(name, atomic_name[typeid1]);
349  if (size)
350  *size = atomic_size[typeid1];
351  return NC_NOERR;
352  }
353 
354  /* Not an atomic type - so find group. */
355  if ((retval = nc4_find_nc4_grp(ncid, &grp)))
356  return retval;
357 
358  /* Find this type. */
359  if (!(type = nc4_rec_find_nc_type(grp->nc4_info->root_grp, typeid1)))
360  return NC_EBADTYPE;
361 
362  if (name)
363  strcpy(name, type->name);
364 
365  if (size)
366  {
367  if (type->nc_type_class == NC_VLEN)
368  *size = sizeof(nc_vlen_t);
369  else if (type->nc_type_class == NC_STRING)
370  *size = 1;
371  else
372  *size = type->size;
373  }
374 
375  return NC_NOERR;
376 }
377 
392 int
393 NC4_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp)
394 {
395  return add_user_type(ncid, size, name, 0, NC_COMPOUND, typeidp);
396 }
397 
413 int
414 NC4_insert_compound(int ncid, nc_type typeid1, const char *name, size_t offset,
415  nc_type field_typeid)
416 {
417  return nc_insert_array_compound(ncid, typeid1, name, offset,
418  field_typeid, 0, NULL);
419 }
420 
438 extern int
439 NC4_insert_array_compound(int ncid, int typeid1, const char *name,
440  size_t offset, nc_type field_typeid,
441  int ndims, const int *dim_sizesp)
442 {
443  NC_GRP_INFO_T *grp;
444  NC_TYPE_INFO_T *type;
445  char norm_name[NC_MAX_NAME + 1];
446  int retval;
447 
448  LOG((2, "nc_insert_array_compound: ncid 0x%x, typeid %d name %s "
449  "offset %d field_typeid %d ndims %d", ncid, typeid1,
450  name, offset, field_typeid, ndims));
451 
452  /* Check and normalize the name. */
453  if ((retval = nc4_check_name(name, norm_name)))
454  return retval;
455 
456  /* Find file metadata. */
457  if ((retval = nc4_find_nc4_grp(ncid, &grp)))
458  return retval;
459 
460  /* Find type metadata. */
461  if ((retval = nc4_find_type(grp->nc4_info, typeid1, &type)))
462  return retval;
463 
464  /* Did the user give us a good compound type typeid? */
465  if (!type || type->nc_type_class != NC_COMPOUND)
466  return NC_EBADTYPE;
467 
468  /* If this type has already been written to the file, you can't
469  * change it. */
470  if (type->committed)
471  return NC_ETYPDEFINED;
472 
473  /* Insert new field into this type's list of fields. */
474  if ((retval = nc4_field_list_add(&type->u.c.field, type->u.c.num_fields,
475  norm_name, offset, 0, 0, field_typeid,
476  ndims, dim_sizesp)))
477  return retval;
478  type->u.c.num_fields++;
479 
480  return NC_NOERR;
481 }
482 
499 int
500 NC4_inq_user_type(int ncid, nc_type typeid1, char *name, size_t *size,
501  nc_type *base_nc_typep, size_t *nfieldsp, int *classp)
502 {
503  NC_GRP_INFO_T *grp;
504  NC_TYPE_INFO_T *type;
505  int retval;
506 
507  LOG((2, "nc_inq_user_type: ncid 0x%x typeid %d", ncid, typeid1));
508 
509  /* Find group metadata. */
510  if ((retval = nc4_find_nc4_grp(ncid, &grp)))
511  return retval;
512 
513  /* Find this type. */
514  if (!(type = nc4_rec_find_nc_type(grp->nc4_info->root_grp, typeid1)))
515  return NC_EBADTYPE;
516 
517  /* Count the number of fields. */
518  if (nfieldsp)
519  {
520  if (type->nc_type_class == NC_COMPOUND)
521  *nfieldsp = type->u.c.num_fields;
522  else if (type->nc_type_class == NC_ENUM)
523  *nfieldsp = type->u.e.num_members;
524  else
525  *nfieldsp = 0;
526  }
527 
528  /* Fill in size and name info, if desired. */
529  if (size)
530  {
531  if (type->nc_type_class == NC_VLEN)
532  *size = sizeof(nc_vlen_t);
533  else if (type->nc_type_class == NC_STRING)
534  *size = 1;
535  else
536  *size = type->size;
537  }
538  if (name)
539  strcpy(name, type->name);
540 
541  /* VLENS and ENUMs have a base type - that is, they type they are
542  * arrays of or enums of. */
543  if (base_nc_typep)
544  {
545  if (type->nc_type_class == NC_ENUM)
546  *base_nc_typep = type->u.e.base_nc_typeid;
547  else if (type->nc_type_class == NC_VLEN)
548  *base_nc_typep = type->u.v.base_nc_typeid;
549  else
550  *base_nc_typep = NC_NAT;
551  }
552 
553  /* If the user wants it, tell whether this is a compound, opaque,
554  * vlen, enum, or string class of type. */
555  if (classp)
556  *classp = type->nc_type_class;
557 
558  return NC_NOERR;
559 }
560 
578 int
579 NC4_inq_compound_field(int ncid, nc_type typeid1, int fieldid, char *name,
580  size_t *offsetp, nc_type *field_typeidp, int *ndimsp,
581  int *dim_sizesp)
582 {
583  NC_GRP_INFO_T *grp;
584  NC_TYPE_INFO_T *type;
585  NC_FIELD_INFO_T *field;
586  int d, retval;
587 
588  /* Find file metadata. */
589  if ((retval = nc4_find_nc4_grp(ncid, &grp)))
590  return retval;
591 
592  /* Find this type. */
593  if (!(type = nc4_rec_find_nc_type(grp->nc4_info->root_grp, typeid1)))
594  return NC_EBADTYPE;
595 
596  /* Find the field. */
597  for (field = type->u.c.field; field; field = field->l.next)
598  if (field->fieldid == fieldid)
599  {
600  if (name)
601  strcpy(name, field->name);
602  if (offsetp)
603  *offsetp = field->offset;
604  if (field_typeidp)
605  *field_typeidp = field->nc_typeid;
606  if (ndimsp)
607  *ndimsp = field->ndims;
608  if (dim_sizesp)
609  for (d = 0; d < field->ndims; d++)
610  dim_sizesp[d] = field->dim_size[d];
611  return NC_NOERR;
612  }
613 
614  return NC_EBADFIELD;
615 }
616 
629 static int
630 find_nc4_file(int ncid, NC **nc)
631 {
632  NC_HDF5_FILE_INFO_T* h5;
633 
634  /* Find file metadata. */
635  if (!((*nc) = nc4_find_nc_file(ncid, &h5)))
636  return NC_EBADID;
637  assert(h5);
638 
639  if (h5->cmode & NC_CLASSIC_MODEL)
640  return NC_ESTRICTNC3;
641 
642  return NC_NOERR;
643 }
644 
659 int
660 NC4_inq_compound_fieldindex(int ncid, nc_type typeid1, const char *name, int *fieldidp)
661 {
662  NC *nc;
663  NC_TYPE_INFO_T *type;
664  NC_FIELD_INFO_T *field;
665  char norm_name[NC_MAX_NAME + 1];
666  int retval;
667 
668  LOG((2, "nc_inq_compound_fieldindex: ncid 0x%x typeid %d name %s",
669  ncid, typeid1, name));
670 
671  /* Find file metadata. */
672  if ((retval = find_nc4_file(ncid, &nc)))
673  return retval;
674 
675  /* Find the type. */
676  if ((retval = nc4_find_type(NC4_DATA(nc), typeid1, &type)))
677  return retval;
678 
679  /* Did the user give us a good compound type typeid? */
680  if (!type || type->nc_type_class != NC_COMPOUND)
681  return NC_EBADTYPE;
682 
683  /* Normalize name. */
684  if ((retval = nc4_normalize_name(name, norm_name)))
685  return retval;
686 
687  /* Find the field with this name. */
688  for (field = type->u.c.field; field; field = field->l.next)
689  if (!strcmp(field->name, norm_name))
690  break;
691 
692  if (!field)
693  return NC_EBADFIELD;
694 
695  if (fieldidp)
696  *fieldidp = field->fieldid;
697  return NC_NOERR;
698 }
699 
700 
701 /* Opaque type. */
702 
717 int
718 NC4_def_opaque(int ncid, size_t datum_size, const char *name,
719  nc_type *typeidp)
720 {
721  return add_user_type(ncid, datum_size, name, 0, NC_OPAQUE, typeidp);
722 }
723 
724 
739 int
740 NC4_def_vlen(int ncid, const char *name, nc_type base_typeid,
741  nc_type *typeidp)
742 {
743  return add_user_type(ncid, 0, name, base_typeid, NC_VLEN, typeidp);
744 }
745 
760 int
761 NC4_def_enum(int ncid, nc_type base_typeid, const char *name,
762  nc_type *typeidp)
763 {
764  return add_user_type(ncid, 0, name, base_typeid, NC_ENUM, typeidp);
765 }
766 
767 
783 int
784 NC4_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier)
785 {
786  NC_GRP_INFO_T *grp;
787  NC_TYPE_INFO_T *type;
788  NC_ENUM_MEMBER_INFO_T *enum_member;
789  long long ll_val;
790  int i;
791  int retval;
792 
793  LOG((3, "nc_inq_enum_ident: xtype %d value %d\n", xtype, value));
794 
795  /* Find group metadata. */
796  if ((retval = nc4_find_nc4_grp(ncid, &grp)))
797  return retval;
798 
799  /* Find this type. */
800  if (!(type = nc4_rec_find_nc_type(grp->nc4_info->root_grp, xtype)))
801  return NC_EBADTYPE;
802 
803  /* Complain if they are confused about the type. */
804  if (type->nc_type_class != NC_ENUM)
805  return NC_EBADTYPE;
806 
807  /* Move to the desired enum member in the list. */
808  enum_member = type->u.e.enum_member;
809  for (i = 0; i < type->u.e.num_members; i++)
810  {
811  switch (type->u.e.base_nc_typeid)
812  {
813  case NC_BYTE:
814  ll_val = *(char *)enum_member->value;
815  break;
816  case NC_UBYTE:
817  ll_val = *(unsigned char *)enum_member->value;
818  break;
819  case NC_SHORT:
820  ll_val = *(short *)enum_member->value;
821  break;
822  case NC_USHORT:
823  ll_val = *(unsigned short *)enum_member->value;
824  break;
825  case NC_INT:
826  ll_val = *(int *)enum_member->value;
827  break;
828  case NC_UINT:
829  ll_val = *(unsigned int *)enum_member->value;
830  break;
831  case NC_INT64:
832  case NC_UINT64:
833  ll_val = *(long long *)enum_member->value;
834  break;
835  default:
836  return NC_EINVAL;
837  }
838  LOG((4, "ll_val=%d", ll_val));
839  if (ll_val == value)
840  {
841  if (identifier)
842  strcpy(identifier, enum_member->name);
843  break;
844  }
845  else
846  enum_member = enum_member->l.next;
847  }
848 
849  /* If we didn't find it, life sucks for us. :-( */
850  if (i == type->u.e.num_members)
851  return NC_EINVAL;
852 
853  return NC_NOERR;
854 }
855 
872 int
873 NC4_inq_enum_member(int ncid, nc_type typeid1, int idx, char *identifier,
874  void *value)
875 {
876  NC_GRP_INFO_T *grp;
877  NC_TYPE_INFO_T *type;
878  NC_ENUM_MEMBER_INFO_T *enum_member;
879  int i;
880  int retval;
881 
882  LOG((2, "nc_inq_enum_member: ncid 0x%x typeid %d", ncid, typeid1));
883 
884  /* Find group metadata. */
885  if ((retval = nc4_find_nc4_grp(ncid, &grp)))
886  return retval;
887 
888  /* Find this type. */
889  if (!(type = nc4_rec_find_nc_type(grp->nc4_info->root_grp, typeid1)))
890  return NC_EBADTYPE;
891 
892  /* Complain if they are confused about the type. */
893  if (type->nc_type_class != NC_ENUM)
894  return NC_EBADTYPE;
895 
896  /* Check index. */
897  if (idx >= type->u.e.num_members)
898  return NC_EINVAL;
899 
900  /* Move to the desired enum member in the list. */
901  enum_member = type->u.e.enum_member;
902  for (i = 0; i < idx; i++)
903  enum_member = enum_member->l.next;
904 
905  /* Give the people what they want. */
906  if (identifier)
907  strcpy(identifier, enum_member->name);
908  if (value)
909  memcpy(value, enum_member->value, type->size);
910 
911  return NC_NOERR;
912 }
913 
930 int
931 NC4_insert_enum(int ncid, nc_type typeid1, const char *identifier,
932  const void *value)
933 {
934  NC_GRP_INFO_T *grp;
935  NC_TYPE_INFO_T *type;
936  char norm_name[NC_MAX_NAME + 1];
937  int retval;
938 
939  LOG((2, "nc_insert_enum: ncid 0x%x, typeid %d identifier %s value %d", ncid,
940  typeid1, identifier, value));
941 
942  /* Check and normalize the name. */
943  if ((retval = nc4_check_name(identifier, norm_name)))
944  return retval;
945 
946  /* Find file metadata. */
947  if ((retval = nc4_find_nc4_grp(ncid, &grp)))
948  return retval;
949 
950  /* Find type metadata. */
951  if ((retval = nc4_find_type(grp->nc4_info, typeid1, &type)))
952  return retval;
953 
954  /* Did the user give us a good enum typeid? */
955  if (!type || type->nc_type_class != NC_ENUM)
956  return NC_EBADTYPE;
957 
958  /* If this type has already been written to the file, you can't
959  * change it. */
960  if (type->committed)
961  return NC_ETYPDEFINED;
962 
963  /* Insert new field into this type's list of fields. */
964  if ((retval = nc4_enum_member_add(&type->u.e.enum_member, type->size,
965  norm_name, value)))
966  return retval;
967  type->u.e.num_members++;
968 
969  return NC_NOERR;
970 }
971 
985 int
986 NC4_put_vlen_element(int ncid, int typeid1, void *vlen_element,
987  size_t len, const void *data)
988 {
989  nc_vlen_t *tmp = (nc_vlen_t*)vlen_element;
990  tmp->len = len;
991  tmp->p = (void *)data;
992  return NC_NOERR;
993 }
994 
1008 int
1009 NC4_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
1010  size_t *len, void *data)
1011 {
1012  const nc_vlen_t *tmp = (nc_vlen_t*)vlen_element;
1013  int type_size = 4;
1014 
1015  *len = tmp->len;
1016  memcpy(data, tmp->p, tmp->len * type_size);
1017  return NC_NOERR;
1018 }
1019 
#define NC_ENOMEM
Memory allocation (malloc) failure.
Definition: netcdf.h:395
#define NC_UBYTE
unsigned 1 byte int
Definition: netcdf.h:41
#define NC_CLASSIC_MODEL
Enforce classic model on netCDF-4.
Definition: netcdf.h:135
#define NC_UINT
unsigned 4-byte int
Definition: netcdf.h:43
#define NC_EHDFERR
Error at HDF5 layer.
Definition: netcdf.h:427
#define NC_OPAQUE
opaque types
Definition: netcdf.h:53
#define NC_INT64
signed 8-byte int
Definition: netcdf.h:44
#define NC_STRING
string
Definition: netcdf.h:46
EXTERNL int nc_insert_array_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid, int ndims, const int *dim_sizes)
Insert a named array field into a compound type.
Definition: dcompound.c:141
int nc_type
The nc_type type is just an int.
Definition: netcdf.h:24
#define NC_BYTE
signed 1 byte integer
Definition: netcdf.h:34
#define NC_EBADFIELD
Bad field ID.
Definition: netcdf.h:445
size_t len
Length of VL data (in base type units)
Definition: netcdf.h:668
#define NC_VLEN
vlen (variable-length) types
Definition: netcdf.h:52
#define NC_ETYPDEFINED
Type has already been defined and may not be edited.
Definition: netcdf.h:444
#define NUM_ATOMIC_TYPES
Number of netCDF atomic types.
Definition: nc4type.c:19
#define NC_EBADTYPE
Not a netcdf data type.
Definition: netcdf.h:357
#define NC_EINVAL
Invalid Argument.
Definition: netcdf.h:325
#define NC_INT
signed 4 byte integer
Definition: netcdf.h:37
#define NC_ESTRICTNC3
Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
Definition: netcdf.h:438
#define NC_MAX_NAME
Maximum for classic library.
Definition: netcdf.h:265
void * p
Pointer to VL data.
Definition: netcdf.h:669
#define NC_NAT
Not A Type.
Definition: netcdf.h:33
#define NC_USHORT
unsigned 2-byte int
Definition: netcdf.h:42
#define NC_EBADID
Not a netcdf id.
Definition: netcdf.h:322
This is the type of arrays of vlens.
Definition: netcdf.h:667
#define NC_SHORT
signed 2 byte integer
Definition: netcdf.h:36
#define NC_NOERR
No Error.
Definition: netcdf.h:315
#define NC_ENUM
enum types
Definition: netcdf.h:54
#define NC_COMPOUND
compound types
Definition: netcdf.h:55
#define NC_UINT64
unsigned 8-byte int
Definition: netcdf.h:45

Return to the Main Unidata NetCDF page.
Generated on Tue Mar 20 2018 06:30:46 for NetCDF. NetCDF is a Unidata library.