Update build system to Autoconf 2.58, Automake 1.7, gettext 0.12.1.
[pspp-builds.git] / src / sfm.h
1 /* PSPP - computes sample statistics.
2    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3    Written by Ben Pfaff <blp@gnu.org>.
4
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.
9
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.
14
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., 59 Temple Place - Suite 330, Boston, MA
18    02111-1307, USA. */
19
20 #if !sfm_h
21 #define sfm_h 1
22
23 /* System file manager (sfm).
24
25    This module is in charge of reading and writing system files.  For
26    now, only ordinary system files are supported; in the future, PC+
27    compatible system files should be supported, too.  sfm is an
28    fhuser, so see file-handle.h for the fhuser interface.  */
29
30 /* Information produced by sfm_read_dictionary() that doesn't fit into
31    a dictionary struct. */
32 struct sfm_read_info
33   {
34     char creation_date[10];     /* `dd mmm yy' plus a null. */
35     char creation_time[9];      /* `hh:mm:ss' plus a null. */
36     int bigendian;              /* 1=big-endian, 0=little-endian. */
37     int compressed;             /* 0=no, 1=yes. */
38     int ncases;                 /* -1 if unknown. */
39     char product[61];           /* Product name plus a null. */
40   };
41
42 struct dictionary;
43 struct file_handle;
44 union value;
45
46 struct dictionary *sfm_read_dictionary (struct file_handle *,
47                                         struct sfm_read_info *);
48 int sfm_read_case (struct file_handle *, union value *, struct dictionary *);
49 void sfm_maybe_close (struct file_handle *);
50
51 /* Information needed by sfm_write_dictionary(). */
52 struct sfm_write_info
53   {
54     /* Read by sfm_write_dictionary(). */
55     struct file_handle *h;      /* File handle. */
56     struct dictionary *dict;    /* Primary dictionary. */
57     int compress;               /* 1=compress, 0=do not compress. */
58
59     /* Written by sfm_write_dictionary(). */
60     int case_size;              /* Number of flt64 elements per case. */
61   };
62
63 int sfm_write_dictionary (struct sfm_write_info *);
64 int sfm_write_case (struct file_handle *, const flt64* elem, int n_elem);
65
66 #endif /* !sfm_h */