1
|
1 // file-io.h -*- C++ -*- |
|
2 /* |
|
3 |
1009
|
4 Copyright (C) 1993, 1994, 1995 John W. Eaton |
1
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 // Written by John C. Campbell <jcc@che.utexas.edu>. |
|
25 |
383
|
26 #if !defined (octave_files_h) |
|
27 #define octave_files_h 1 |
1
|
28 |
|
29 #include <Pix.h> |
|
30 |
497
|
31 #include "oct-obj.h" |
1
|
32 |
164
|
33 extern Pix return_valid_file (const tree_constant& arg); |
1
|
34 |
497
|
35 extern Octave_object fclose_internal (const Octave_object& args); |
506
|
36 extern Octave_object feof_internal (const Octave_object& args, int nargout); |
|
37 extern Octave_object ferror_internal (const Octave_object& args, int nargout); |
497
|
38 extern Octave_object fflush_internal (const Octave_object& args); |
|
39 extern Octave_object fgets_internal (const Octave_object& args, int nargout); |
|
40 extern Octave_object fopen_internal (const Octave_object& args); |
506
|
41 extern Octave_object fread_internal (const Octave_object& args, int nargout); |
497
|
42 extern Octave_object freport_internal (void); |
|
43 extern Octave_object frewind_internal (const Octave_object& args); |
506
|
44 extern Octave_object fseek_internal (const Octave_object& args); |
497
|
45 extern Octave_object ftell_internal (const Octave_object& args); |
506
|
46 extern Octave_object fwrite_internal (const Octave_object& args, int nargout); |
1
|
47 |
164
|
48 extern void initialize_file_io (void); |
1
|
49 |
164
|
50 extern void close_files (void); |
1
|
51 |
497
|
52 extern Octave_object do_printf (const char *type, const Octave_object& args, |
506
|
53 int nargout); |
1
|
54 |
497
|
55 extern Octave_object do_scanf (const char *type, const Octave_object& args, |
506
|
56 int nargout); |
1
|
57 |
759
|
58 class |
|
59 file_info |
|
60 { |
|
61 public: |
|
62 file_info (void); |
|
63 file_info (int num, const char *nm, FILE *t, const char *md); |
|
64 file_info (const file_info& f); |
|
65 |
|
66 file_info& operator = (const file_info& f); |
|
67 |
|
68 ~file_info (void); |
|
69 |
|
70 int number (void) const; |
|
71 const char *name (void) const; |
|
72 FILE *fptr (void) const; |
|
73 const char *mode (void) const; |
|
74 |
|
75 int eof (void) const; |
|
76 int error (void) const; |
|
77 |
|
78 private: |
|
79 int file_number; |
|
80 char *file_name; |
|
81 FILE *file_fptr; |
|
82 char *file_mode; |
|
83 }; |
|
84 |
1
|
85 #endif |
|
86 |
|
87 /* |
|
88 ;;; Local Variables: *** |
|
89 ;;; mode: C++ *** |
|
90 ;;; page-delimiter: "^/\\*" *** |
|
91 ;;; End: *** |
|
92 */ |