X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvalue.c;h=cd52f147ca3a0f4fd924c40861788cfc22081623;hb=d22c3971e926ceaf62416c6482fe0fb1dc5407f0;hp=e9411c8cefa976ff4a4c46d94db837e9eefffb23;hpb=bacc3f20714fef3025d79c439993af3403f20bcc;p=pspp-builds.git diff --git a/src/data/value.c b/src/data/value.c index e9411c8c..cd52f147 100644 --- a/src/data/value.c +++ b/src/data/value.c @@ -30,6 +30,16 @@ value_dup (const union value *val, int width) return xmemdup (val, MAX (width, sizeof *val)); } + +/* Create a value of specified width. + The caller is responsible for freeing the returned value. */ +union value * +value_create (int width) +{ + return xnmalloc (value_cnt_from_width (width), sizeof (union value)); +} + + /* Compares A and B, which both have the given WIDTH, and returns a strcmp()-type result. Only the short string portion of longer strings are