X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvariable.h;h=5d28d5b8940234846d47dc1abf5419cd443beb7d;hb=04c88b897db0d2281faa2829ed57b0f344395b8a;hp=ccfdd7f86a5f6500aa522641a28b1cbca5593867;hpb=c41f14854e73ad44824b54933ae96eb52f781fc2;p=pspp-builds.git diff --git a/src/data/variable.h b/src/data/variable.h index ccfdd7f8..5d28d5b8 100644 --- a/src/data/variable.h +++ b/src/data/variable.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009 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 @@ -32,6 +32,8 @@ union value; struct variable *var_create (const char *name, int width); struct variable *var_clone (const struct variable *); void var_destroy (struct variable *); +struct variable *var_create_internal (int case_idx, int width); + /* Variable names. */ #define VAR_NAME_LEN 64 /* Maximum length of variable name, in bytes. */ @@ -48,6 +50,8 @@ unsigned hash_var_by_name (const void *, const void *); int compare_var_ptrs_by_name (const void *, const void *, const void *); unsigned hash_var_ptr_by_name (const void *, const void *); +int compare_var_ptrs_by_dict_index (const void *, const void *, const void *); + /* Types and widths of values associated with a variable. */ enum val_type var_get_type (const struct variable *); int var_get_width (const struct variable *); @@ -55,10 +59,6 @@ void var_set_width (struct variable *, int width); bool var_is_numeric (const struct variable *); bool var_is_alpha (const struct variable *); -bool var_is_short_string (const struct variable *); -bool var_is_long_string (const struct variable *); - -size_t var_get_value_cnt (const struct variable *); /* Variables' missing values. */ const struct missing_values *var_get_missing_values (const struct variable *); @@ -99,6 +99,8 @@ const struct fmt_spec *var_get_write_format (const struct variable *); void var_set_write_format (struct variable *, const struct fmt_spec *); void var_set_both_formats (struct variable *, const struct fmt_spec *); +struct fmt_spec var_default_formats (int width); + /* Variable labels. */ const char *var_to_string (const struct variable *); const char *var_get_label (const struct variable *); @@ -119,6 +121,8 @@ bool measure_is_valid (enum measure); enum measure var_get_measure (const struct variable *); void var_set_measure (struct variable *, enum measure); +enum measure var_default_measure (enum val_type); + /* GUI display width. */ int var_get_display_width (const struct variable *); void var_set_display_width (struct variable *, int display_width); @@ -138,6 +142,8 @@ bool alignment_is_valid (enum alignment); enum alignment var_get_alignment (const struct variable *); void var_set_alignment (struct variable *, enum alignment); +enum alignment var_default_alignment (enum val_type); + /* Whether variables' values should be preserved from case to case. */ bool var_get_leave (const struct variable *); @@ -167,6 +173,11 @@ struct cat_vals *var_get_obs_vals (const struct variable *); void var_set_obs_vals (const struct variable *, struct cat_vals *); bool var_has_obs_vals (const struct variable *); +/* Custom attributes. */ +struct attrset *var_get_attributes (const struct variable *); +void var_set_attributes (struct variable *, const struct attrset *); +bool var_has_attributes (const struct variable *); + /* Function types. */ typedef bool var_predicate_func (const struct variable *);