X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fdata%2Fsys-file-private.h;h=9d5f52f0ebd304c3c87fd8b26d523b1e47a9f0d8;hb=c9e28aa922c35b8764925fe824794886b8f17a86;hp=ee93706fb54118b4b7887f46d26b44fb87e45191;hpb=480a0746507ce73d26f528b56dc3ed80195096e0;p=pspp-builds.git
diff --git a/src/data/sys-file-private.h b/src/data/sys-file-private.h
index ee93706f..9d5f52f0 100644
--- a/src/data/sys-file-private.h
+++ b/src/data/sys-file-private.h
@@ -1,29 +1,62 @@
-/* PSPP - computes sample statistics.
- Copyright (C) 2006 Free Software Foundation, Inc.
+/* PSPP - a program for statistical analysis.
+ Copyright (C) 2006, 2007 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 the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see . */
+
+/* Infrastructure common to system file reader and writer.
+
+ Old versions of SPSS limited string variables to a width of
+ 255 bytes. For backward compatibility with these older
+ versions, the system file format represents a string longer
+ than 255 bytes, called a "very long string", as a collection
+ of strings no longer than 255 bytes each. The strings
+ concatenated to make a very long string are called its
+ "segments"; for consistency, variables other than very long
+ strings are considered to have a single segment.
+
+ The interfaces in this file primarily provide support for
+ dealing with very long strings. */
#ifndef DATA_SYS_FILE_PRIVATE_H
#define DATA_SYS_FILE_PRIVATE_H 1
-/* This nonsense is required for SPSS compatibility. */
+#include
+
+struct dictionary;
+
+/* A variable in a system file. */
+struct sfm_var
+ {
+ int width; /* Value width (0=numeric, else string). */
+ int case_index; /* Index into case. */
+
+ /* The following members are interesting only for string
+ variables (width != 0). For numeric variables (width ==
+ 0) their values are always 0.
+
+ Note: width + padding is always a multiple of 8. */
+ int offset; /* Offset within string variable in case. */
+ int padding; /* Number of padding bytes following data. */
+ };
+
+int sfm_dictionary_to_sfm_vars (const struct dictionary *,
+ struct sfm_var **, size_t *);
-#define MIN_VERY_LONG_STRING 256
-#define EFFECTIVE_LONG_STRING_LENGTH (MIN_VERY_LONG_STRING - 4)
+int sfm_width_to_octs (int width);
+int sfm_width_to_segments (int width);
-int sfm_width_to_bytes (int width);
+int sfm_segment_effective_offset (int width, int segment);
+int sfm_segment_alloc_width (int width, int segment);
#endif /* data/sys-file-private.h */