X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fany-reader.h;h=998e12441b2894ccad6c1abdfd10e7754c66950f;hb=c8f16e229dede3bf3ec30c329cccc6924778553a;hp=5614a6007507c3f71539a183197dc01661b46829;hpb=63c7521729b947ace9e192dff9330813ecfb5812;p=pspp diff --git a/src/data/any-reader.h b/src/data/any-reader.h index 5614a60075..998e12441b 100644 --- a/src/data/any-reader.h +++ b/src/data/any-reader.h @@ -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 *); @@ -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 *);