cdb7d9d5c3f6fc1bd5aa3813da9278a91cc52a44
[pspp-builds.git] / src / ui / gui / flexifile-factory.c
1 /* PSPP - computes sample statistics.
2    Copyright (C) 2006 Free Software Foundation, Inc.
3
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.
8
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.
13
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
17    02110-1301, USA. */
18
19 #include <config.h>
20
21 #include <stdlib.h>
22 #include <libpspp/alloc.h>
23 #include <libpspp/compiler.h>
24 #include "flexifile-factory.h"
25 #include <ui/flexifile.h>
26 #include <data/casefile-factory.h>
27
28
29 struct flexifile_factory
30  {
31    struct casefile_factory parent;
32  };
33
34
35 static struct casefile *
36 produce_flexifile (struct casefile_factory *this UNUSED, size_t value_cnt)
37 {
38   struct casefile *ff =  flexifile_create (value_cnt);
39
40   return ff;
41 }
42
43
44 struct casefile_factory *
45 flexifile_factory_create (void)
46 {
47   struct flexifile_factory *fact = xzalloc (sizeof (*fact));
48
49   fact->parent.create_casefile = produce_flexifile;
50
51   return (struct casefile_factory *) fact;
52 }
53
54
55 void
56 flexifile_factory_destroy (struct casefile_factory *factory)
57 {
58   free (factory);
59 }