X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fsys-file-private.h;h=21ff8ade3a6026fe4e882997292598e83bf4c08e;hb=8a8cd108378417cba0cb530533fd83019965cdc7;hp=e839cd6ac02008ab5fec2ee08feffcfbdcad003f;hpb=b5c82cc9aabe7e641011130240ae1b2e84348e23;p=pspp diff --git a/src/data/sys-file-private.h b/src/data/sys-file-private.h index e839cd6ac0..21ff8ade3a 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, 2009 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2009-2012 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,6 +35,14 @@ struct dictionary; +/* Magic numbers. + + Both of these are actually $FL2 in the respective character set. The "FL2" + part is invariant among national variants of each character set, but "$" has + different encodings, so it is safer to write them as hexadecimal. */ +#define ASCII_MAGIC "\x24\x46\x4c\x32" +#define EBCDIC_MAGIC "\x5b\xc6\xd3\xf2" + /* A variable in a system file. */ struct sfm_var { @@ -60,4 +68,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 */