X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Ftransformations.c;h=fdb2cb84bd7f854bc3c16a8d32c3968e0ceceace;hb=853329fd7c721a0b430a80abe0308d5eb1b1002c;hp=f1cfaf47c9688c5d51cd273d7d623b34292d3449;hpb=60c545e6e958d868db3399a8989d37d8f9e0c131;p=pspp diff --git a/src/data/transformations.c b/src/data/transformations.c index f1cfaf47c9..fdb2cb84bd 100644 --- a/src/data/transformations.c +++ b/src/data/transformations.c @@ -21,6 +21,7 @@ #include #include +#include "libpspp/array.h" #include "libpspp/str.h" #include "gl/xalloc.h" @@ -53,6 +54,18 @@ trns_chain_clear (struct trns_chain *chain) return ok; } +void +trns_chain_prepend (struct trns_chain *chain, const struct transformation *t) +{ + if (chain->n >= chain->allocated) + chain->xforms = x2nrealloc (chain->xforms, &chain->allocated, + sizeof *chain->xforms); + + insert_element (chain->xforms, 1, sizeof *chain->xforms, 0); + chain->xforms[0] = *t; + chain->n++; +} + void trns_chain_append (struct trns_chain *chain, const struct transformation *t) {