treewide: Replace <name>_cnt by n_<name>s and <name>_cap by allocated_<name>.
[pspp] / src / data / any-reader.h
index 5614a6007507c3f71539a183197dc01661b46829..6e4d751f781fc0c876af30c0a7984a27afc3134e 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2006, 2010, 2012, 2014 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2010, 2012, 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
@@ -34,9 +34,12 @@ struct any_reader
 
 struct any_reader_class
   {
+    /* The name of this kind of data file, e.g. "SPSS System File". */
     const char *name;
 
-    int (*detect) (FILE *);
+    /* Detects whether FILE contains this type of file.  Returns 1 if so, 0 if
+       not, and a negative errno value if there is an error reading FILE. */
+    int (*detect) (FILE *file);
 
     struct any_reader *(*open) (struct file_handle *);
     bool (*close) (struct any_reader *);
@@ -77,7 +80,7 @@ struct any_read_info
     enum integer_format integer_format;
     enum float_format float_format;
     enum any_compression compression;
-    casenumber case_cnt;        /* -1 if unknown. */
+    casenumber n_cases;         /* -1 if unknown. */
     char *product;             /* Product name. */
     char *product_ext;          /* Extra product info. */
 
@@ -94,7 +97,7 @@ void any_read_info_destroy (struct any_read_info *);
 struct file_handle;
 struct dictionary;
 
-int any_reader_detect (const char *file_name,
+int any_reader_detect (const struct file_handle *file_name,
                        const struct any_reader_class **);
 
 struct any_reader *any_reader_open (struct file_handle *);