/* PSPP - computes sample statistics.
Copyright (C) 2004 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
element of C numbered IDX.
The caller must not modify the returned data. */
const union value *
-case_data (const struct ccase *c, size_t idx)
+case_data_idx (const struct ccase *c, size_t idx)
{
assert (c != NULL);
assert (c->case_data != NULL);
/* Returns the numeric value of the `union value' in C numbered
IDX. */
double
-case_num (const struct ccase *c, size_t idx)
+case_num_idx (const struct ccase *c, size_t idx)
{
assert (c != NULL);
assert (c->case_data != NULL);
(Note that the value is not null-terminated.)
The caller must not modify the return value. */
const char *
-case_str (const struct ccase *c, size_t idx)
+case_str_idx (const struct ccase *c, size_t idx)
{
assert (c != NULL);
assert (c->case_data != NULL);
element of C numbered IDX.
The caller is allowed to modify the returned data. */
union value *
-case_data_rw (struct ccase *c, size_t idx)
+case_data_rw_idx (struct ccase *c, size_t idx)
{
assert (c != NULL);
assert (c->case_data != NULL);
const struct variable *va = *vap;
const struct variable *vb = *vbp;
- assert (va->type == vb->type);
- assert (va->width == vb->width);
+ assert (var_get_width (va) == var_get_width (vb));
- if (va->width == 0)
+ if (var_get_width (va) == 0)
{
- double af = case_num (ca, va->fv);
- double bf = case_num (cb, vb->fv);
+ double af = case_num (ca, va);
+ double bf = case_num (cb, vb);
if (af != bf)
return af > bf ? 1 : -1;
}
else
{
- const char *as = case_str (ca, va->fv);
- const char *bs = case_str (cb, vb->fv);
- int cmp = memcmp (as, bs, va->width);
+ const char *as = case_str (ca, va);
+ const char *bs = case_str (cb, vb);
+ int cmp = memcmp (as, bs, var_get_width (va));
if (cmp != 0)
return cmp;