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