checkin of 0.3.0
[pspp-builds.git] / src / sfmP.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 /* PORTME: There might easily be alignment problems with some of these
21    structures. */
22
23 /* This attribute might avoid some problems.  On the other hand... */
24 #define P __attribute__((packed))
25
26 #if __BORLANDC__
27 #pragma option -a-              /* Turn off alignment. */
28 #endif
29
30 /* Record Type 1: General Information. */
31 struct sysfile_header
32   {
33     char rec_type[4] P;         /* Record-type code, "$FL2". */
34     char prod_name[60] P;       /* Product identification. */
35     int32 layout_code P;        /* 2. */
36     int32 case_size P;          /* Number of `value's per case. */
37     int32 compressed P;         /* 1=compressed, 0=not compressed. */
38     int32 weight_index P;       /* 1-based index of weighting var, or zero. */
39     int32 ncases P;             /* Number of cases, -1 if unknown. */
40     flt64 bias P;               /* Compression bias (100.0). */
41     char creation_date[9] P;    /* `dd mmm yy' creation date of file. */
42     char creation_time[8] P;    /* `hh:mm:ss' 24-hour creation time. */
43     char file_label[64] P;      /* File label. */
44     char padding[3] P;          /* Ignored padding. */
45   };
46
47 /* Record Type 2: Variable. */
48 struct sysfile_variable
49   {
50     int32 rec_type P;           /* 2. */
51     int32 type P;               /* 0=numeric, 1-255=string width,
52                                    -1=continued string. */
53     int32 has_var_label P;      /* 1=has a variable label, 0=doesn't. */
54     int32 n_missing_values P;   /* Missing value code of -3,-2,0,1,2, or 3. */
55     int32 print P;      /* Print format. */
56     int32 write P;      /* Write format. */
57     char name[8] P;             /* Variable name. */
58     /* The rest of the structure varies. */
59   };
60
61 #if __BORLANDC__
62 #pragma -a4
63 #endif