X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fsys-file-private.h;h=a39b0c1aa304c5774f729151eabf5973ef1e7c6e;hb=06ac0c2d623e9ae54c3e22a2d6740219ab357b21;hp=9d5f52f0ebd304c3c87fd8b26d523b1e47a9f0d8;hpb=37273a2e5b058a1907bc7b4b5bf666c64e0afdbb;p=pspp diff --git a/src/data/sys-file-private.h b/src/data/sys-file-private.h index 9d5f52f0eb..a39b0c1aa3 100644 --- a/src/data/sys-file-private.h +++ b/src/data/sys-file-private.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2009-2013 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 @@ -35,10 +35,24 @@ struct dictionary; +/* ASCII magic numbers. */ +#define ASCII_MAGIC "$FL2" /* For regular files. */ +#define ASCII_ZMAGIC "$FL3" /* For ZLIB compressed files. */ + +/* EBCDIC magic number, the same as ASCII_MAGIC but encoded in EBCDIC. + + No EBCDIC ZLIB compressed files have been observed, so we do not define + EBCDIC_ZMAGIC even though the value is obvious. */ +#define EBCDIC_MAGIC "\x5b\xc6\xd3\xf2" + +/* Amount of data that ZLIB compressed data blocks typically decompress to. */ +#define ZBLOCK_SIZE 0x3ff000 + /* A variable in a system file. */ struct sfm_var { - int width; /* Value width (0=numeric, else string). */ + int var_width; /* Variable width (0 to 32767). */ + int segment_width; /* Segment width (0 to 255). */ int case_index; /* Index into case. */ /* The following members are interesting only for string @@ -59,4 +73,17 @@ int sfm_width_to_segments (int width); int sfm_segment_effective_offset (int width, int segment); int sfm_segment_alloc_width (int width, int segment); +/* A mapping between an encoding name and a Windows codepage. */ +struct sys_encoding + { + int number; + const char *name; + }; + +extern struct sys_encoding sys_codepage_number_to_name[]; +extern struct sys_encoding sys_codepage_name_to_number[]; + +int sys_get_codepage_from_encoding (const char *); +const char *sys_get_encoding_from_codepage (int); + #endif /* data/sys-file-private.h */