X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fdissect-sysfile.c;h=62161f9c540200b1bcc954d5cef829342e8d671f;hb=8ef8acb7c70a321963d30f2264e8f91e16427fcf;hp=25d01158ee77b1c80062f8c6689f7a5f0fb608fa;hpb=c3ac5a8af9c449072c7e872ca70a78c1755ae309;p=pspp-builds.git diff --git a/tests/dissect-sysfile.c b/tests/dissect-sysfile.c index 25d01158..62161f9c 100644 --- a/tests/dissect-sysfile.c +++ b/tests/dissect-sysfile.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009 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 @@ -66,6 +66,9 @@ static void read_datafile_attributes (struct sfm_reader *r, size_t size, size_t count); static void read_variable_attributes (struct sfm_reader *r, size_t size, size_t count); +static void read_character_encoding (struct sfm_reader *r, + size_t size, size_t count); + static struct text_record *open_text_record ( struct sfm_reader *, size_t size); @@ -510,6 +513,10 @@ read_extension_record (struct sfm_reader *r) read_variable_attributes (r, size, count); return; + case 20: + read_character_encoding (r, size, count); + return; + default: sys_warn (r, _("Unrecognized record type 7, subtype %d."), subtype); break; @@ -712,6 +719,17 @@ read_datafile_attributes (struct sfm_reader *r, size_t size, size_t count) close_text_record (text); } +static void +read_character_encoding (struct sfm_reader *r, size_t size, size_t count) +{ + const unsigned long int posn = ftell (r->file); + char *encoding = xcalloc (size, count + 1); + read_string (r, encoding, count + 1); + + printf ("%08lx: Character Encoding: %s\n", posn, encoding); +} + + static void read_variable_attributes (struct sfm_reader *r, size_t size, size_t count) {