Datalist* datalistreplace(Datalist* dl, unsigned int index, NCConstant* con) { ASSERT(dl != NULL); ASSERT(index < dl->length); ASSERT(con != NULL); dl->data[index] = cloneconstant(con); return dl; }
Datalist* datalistclone(Datalist* dl) { int i; Datalist* clone = builddatalist(dl->length); for(i=0;i<dl->length;i++) { clone->data[i] = cloneconstant(dl->data+i); } return clone; }
Datalist* datalistappend(Datalist* dl, NCConstant* con) { NCConstant** vector; ASSERT(dl != NULL); if(con == NULL) return dl; vector = (NCConstant**)erealloc(dl->data,sizeof(NCConstant*)*(dl->length+1)); if(vector == NULL) return NULL; vector[dl->length] = cloneconstant(con); dl->length++; dl->data = vector; return dl; }