projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change some instances of GtkAction to PsppireDialogAction
[pspp]
/
src
/
data
/
por-file-reader.c
diff --git
a/src/data/por-file-reader.c
b/src/data/por-file-reader.c
index 4fb6c5fb452de7fbf64a00cf3001124594d85d0e..15a3b7902e45b59f1548299e412482044897fa9c 100644
(file)
--- a/
src/data/por-file-reader.c
+++ b/
src/data/por-file-reader.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2012, 2013, 2014
, 2015
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
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
@@
-170,7
+170,7
@@
pfm_close (struct any_reader *r_)
any_read_info_destroy (&r->info);
if (r->file)
{
any_read_info_destroy (&r->info);
if (r->file)
{
- if (fn_close (
fh_get_file_name (r->fh)
, r->file) == EOF)
+ if (fn_close (
r->fh
, r->file) == EOF)
{
msg (ME, _("Error closing portable file `%s': %s."),
fh_get_file_name (r->fh), strerror (errno));
{
msg (ME, _("Error closing portable file `%s': %s."),
fh_get_file_name (r->fh), strerror (errno));
@@
-255,7
+255,7
@@
static void read_documents (struct pfm_reader *, struct dictionary *);
/* Reads the dictionary from file with handle H, and returns it in a
dictionary structure. This dictionary may be modified in order to
rename, reorder, and delete variables, etc. */
/* Reads the dictionary from file with handle H, and returns it in a
dictionary structure. This dictionary may be modified in order to
rename, reorder, and delete variables, etc. */
-struct any_reader *
+st
atic st
ruct any_reader *
pfm_open (struct file_handle *fh)
{
struct pool *volatile pool = NULL;
pfm_open (struct file_handle *fh)
{
struct pool *volatile pool = NULL;
@@
-288,7
+288,7
@@
pfm_open (struct file_handle *fh)
goto error;
/* Open file. */
goto error;
/* Open file. */
- r->file = fn_open (
fh_get_file_name (r->fh)
, "rb");
+ r->file = fn_open (
r->fh
, "rb");
if (r->file == NULL)
{
msg (ME, _("An error occurred while opening `%s' for reading "
if (r->file == NULL)
{
msg (ME, _("An error occurred while opening `%s' for reading "
@@
-322,7
+322,7
@@
pfm_open (struct file_handle *fh)
return NULL;
}
return NULL;
}
-struct casereader *
+st
atic st
ruct casereader *
pfm_decode (struct any_reader *r_, const char *encoding UNUSED,
struct dictionary **dictp, struct any_read_info *info)
{
pfm_decode (struct any_reader *r_, const char *encoding UNUSED,
struct dictionary **dictp, struct any_read_info *info)
{
@@
-922,9
+922,9
@@
por_file_casereader_read (struct casereader *reader, void *r_)
return c;
}
return c;
}
-/*
Returns true if FILE is an SPSS portable file
,
-
false otherwise
. */
-int
+/*
Detects whether FILE is an SPSS portable file. Returns 1 if so, 0 if not
,
+
and a negative errno value if there is an error reading FILE
. */
+
static
int
pfm_detect (FILE *file)
{
unsigned char header[464];
pfm_detect (FILE *file)
{
unsigned char header[464];
@@
-938,7
+938,7
@@
pfm_detect (FILE *file)
{
int c = getc (file);
if (c == EOF || raw_cnt++ > 512)
{
int c = getc (file);
if (c == EOF || raw_cnt++ > 512)
- return 0;
+ return
ferror (file) ? -errno :
0;
else if (c == '\n')
{
while (line_len < 80 && cooked_cnt < sizeof header)
else if (c == '\n')
{
while (line_len < 80 && cooked_cnt < sizeof header)