1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 ss_prop_t *
 ss_prop_cons(hid_t type,                /* Property datatype (copied by this function) */
              void *values,              /* Optional initial values, of type TYPE */
              const char *name           /* Optional property list name */
              )
 {
     SS_ENTER(ss_prop_cons, ss_prop_tP);
     ss_prop_t   *newprop = NULL;

     if (NULL==(newprop=ss_prop_new(name))) SS_ERROR(CONS);
     if ((newprop->type=H5Tcopy(type))<0) SS_ERROR(CONS);
     if (values) {
         newprop->values = values;
         newprop->appendable = FALSE;
         newprop->managed = FALSE;
     } else {
         if (NULL==(newprop->values=calloc(1, H5Tget_size(type)))) SS_ERROR(RESOURCE);
     }

  SS_CLEANUP:
     if (newprop) ss_prop_dest(newprop);
     SS_LEAVE(newprop);
 }