fbuf: New data structure for buffered file I/O.
[pspp] / src / data / por-file-reader.c
index bba62d168f8f72fa2c8842c16bee0ad5ff85b455..7f6f7e6b73f2aa1e988ba987c2a26b2b7823c2e9 100644 (file)
@@ -170,7 +170,7 @@ pfm_close (struct any_reader *r_)
   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));
@@ -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. */
-struct any_reader *
+static struct any_reader *
 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. */
-  r->file = fn_open (fh_get_file_name (r->fh), "rb");
+  r->file = fn_fopen (r->fh, "rb");
   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;
 }
 
-struct casereader *
+static struct casereader *
 pfm_decode (struct any_reader *r_, const char *encoding UNUSED,
             struct dictionary **dictp, struct any_read_info *info)
 {
@@ -924,7 +924,7 @@ por_file_casereader_read (struct casereader *reader, void *r_)
 
 /* 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. */
-int
+static int
 pfm_detect (FILE *file)
 {
   unsigned char header[464];