/* PSPP - a program for statistical analysis.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2011 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
#include <config.h>
-#include <data/casereader-provider.h>
-#include <data/subcase.h>
+#include "data/casereader-provider.h"
+#include "data/subcase.h"
#include "gl/xalloc.h"
};
static struct ccase *
-project_case (struct ccase *old, casenumber idx UNUSED, const void *project_)
+project_case (struct ccase *old, void *project_)
{
const struct casereader_project *project = project_;
struct ccase *new = case_create (subcase_get_proto (&project->new_sc));
destroy_projection (void *project_)
{
struct casereader_project *project = project_;
- subcase_destroy (&project->old_sc);
- subcase_destroy (&project->new_sc);
+ subcase_uninit (&project->old_sc);
+ subcase_uninit (&project->new_sc);
free (project);
return true;
}
subcase_init_empty (&project->new_sc);
subcase_add_proto_always (&project->new_sc, proto);
+ static const struct casereader_translator_class class = {
+ project_case, destroy_projection,
+ };
+
return casereader_translate_stateless (subreader, proto,
- project_case, destroy_projection,
- project);
+ &class, project);
}
}
subcase_init (&sc, column, caseproto_get_width (subproto, column),
SC_ASCEND);
reader = casereader_project (subreader, &sc);
- subcase_destroy (&sc);
+ subcase_uninit (&sc);
return reader;
}