Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 3
0
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;
}