X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvalue-labels.h;h=e2d4b364092b5c9915ed0fd29cc1e04e8267eb53;hb=52c54183e360053b1845e46cb96cd44a0cf96040;hp=f0f7ce01264c392552f7b96d130be6577ddb50a9;hpb=fe8dc2171009e90d2335f159d05f7e6660e24780;p=pspp diff --git a/src/data/value-labels.h b/src/data/value-labels.h index f0f7ce0126..e2d4b36409 100644 --- a/src/data/value-labels.h +++ b/src/data/value-labels.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2009, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,8 @@ #include "data/value.h" #include "libpspp/hmap.h" +struct pxd; + /* One value label. A value label is normally part of a struct val_labs (see @@ -37,6 +39,7 @@ struct val_lab { struct hmap_node node; /* Node in hash map. */ + struct pxd_object *cache; /* Object cache. */ union value value; /* The value being labeled. */ const char *label; /* An interned string. */ const char *escaped_label; /* An interned string. */ @@ -78,6 +81,7 @@ val_lab_get_escaped_label (const struct val_lab *vl) /* A set of value labels. */ struct val_labs { + struct pxd_object *cache; /* Object cache. */ int width; /* 0=numeric, otherwise string width. */ struct hmap labels; /* Hash table of `struct val_lab's. */ }; @@ -93,6 +97,8 @@ size_t val_labs_count (const struct val_labs *); const char *val_labs_find (const struct val_labs *, const union value *); struct val_lab *val_labs_lookup (const struct val_labs *, const union value *); +const union value *val_labs_find_value (const struct val_labs *, + const char *label); /* Basic properties. */ size_t val_labs_count (const struct val_labs *); @@ -115,4 +121,8 @@ const struct val_lab **val_labs_sorted (const struct val_labs *); unsigned int val_labs_hash (const struct val_labs *, unsigned int basis); bool val_labs_equal (const struct val_labs *, const struct val_labs *); +/* Saving and loading. */ +struct pxd_object *val_labs_save (const struct val_labs *, struct pxd *); +struct val_labs *val_labs_load (struct pxd_object *, const struct pxd *); + #endif /* data/value-labels.h */