projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move global initialization and cleanup code into main.c.
[pspp]
/
src
/
file-handle.h
diff --git
a/src/file-handle.h
b/src/file-handle.h
index 145d520228cb644f3308014299b3040a8e24f15d..eab80521a2d6fdd7d845b42352940b607bd4528e 100644
(file)
--- a/
src/file-handle.h
+++ b/
src/file-handle.h
@@
-14,63
+14,30
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#if !file_handle_h
#define file_handle_h 1
#if !file_handle_h
#define file_handle_h 1
-/* File handle provider (fhp).
-
- This module provides file handles in the form of file_handle
- structures to the dfm and sfm modules, which are known as file
- handle users (fhusers). fhp does not know anything about file
- contents. */
+/* File handles. */
#include <stddef.h>
#include <stddef.h>
-#include "error.h"
-
-struct file_handle;
+#include "file-handle-def.h"
-/* Services that fhusers provide to fhp. */
-struct fh_ext_class
- {
- int magic; /* Magic identifier for fhuser. */
- const char *name; /* String identifier for fhuser. */
- void (*close) (struct file_handle *); /* Closes the file. */
- };
-/* Mostly-opaque structure. */
-struct file_handle
- {
- struct private_file_handle *private;
- const struct fh_ext_class *class; /* Polymorphism support. */
- void *ext; /* Extension struct for fhuser use. */
- };
+void fh_init(void);
+void fh_done(void);
-/* File modes. */
-enum file_handle_mode
- {
- MODE_TEXT, /* New-line delimited lines. */
- MODE_BINARY /* Fixed-length records. */
- };
-/* Pointer to the file handle that corresponds to data in the command
- file entered via BEGIN DATA/END DATA. */
-extern struct file_handle *inline_file;
+/* Parsing handles. */
+struct file_handle *fh_parse (void);
-/* Initialization. */
-void fh_init_files (void);
/* Opening and closing handles. */
/* Opening and closing handles. */
-
struct file_handle *fh_parse_file_handle (void
);
-
void fh_close_handle (struct file_handle *handl
e);
+
void **fh_open (struct file_handle *, const char *type, const char *mode
);
+
int fh_close (struct file_handle *, const char *type, const char *mod
e);
-/* Handle info. */
-const char *handle_get_name (const struct file_handle *handle);
-const char *handle_get_filename (const struct file_handle *handle);
-enum file_handle_mode handle_get_mode (const struct file_handle *);
-size_t handle_get_record_width (const struct file_handle *);
#endif /* !file_handle.h */
#endif /* !file_handle.h */