X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fformat.c;h=33a81ff30142366fc5c044ee1deadd86b8e10e1c;hb=f9d47b5bba8416419cf3bcd3aa23c2d40a05fcac;hp=bed7241884099b14864c2c3f0e69104f8a0ee00e;hpb=6ad392174e035d6e0823fd7894a0488acf274b97;p=pspp-builds.git diff --git a/src/format.c b/src/format.c index bed72418..33a81ff3 100644 --- a/src/format.c +++ b/src/format.c @@ -340,3 +340,13 @@ parse_format_specifier (struct fmt_spec *input, int allow_xt) return 1; } +int +get_format_var_width (const struct fmt_spec *spec) +{ + if (spec->type == FMT_AHEX) + return spec->w * 2; + else if (spec->type == FMT_A) + return spec->w; + else + return 0; +}