1 /* PSPP - computes sample statistics.
2 Copyright (C) 2006 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #include <data/variable.h>
21 #include <data/value.h>
22 #include <libpspp/compiler.h>
29 compare_freq ( const void *_f1, const void *_f2, const void *_var)
31 const struct freq *f1 = _f1;
32 const struct freq *f2 = _f2;
33 const struct variable *var = _var;
35 return compare_values (f1->value, f2->value, var_get_width (var) );
39 hash_freq (const void *_f, const void *_var)
41 const struct freq *f = _f;
42 const struct variable *var = _var;
44 return hash_value (f->value, var_get_width (var));
47 /* Free function to be used on FR whose value parameter has been copied */
49 free_freq_mutable_hash (void *fr, const void *var UNUSED)
51 struct freq_mutable *freq = fr;
57 free_freq_hash (void *fr, const void *var UNUSED)