annotate src/file-io.h @ 1009:dfe01093f657

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