Imported Upstream version 0.1beta
[debian/yforth] / file.h
1 /* yForth? - Written by Luca Padovani (C) 1996/97
2  * ------------------------------------------------------------------------
3  * This software is FreeWare as long as it comes with this header in each
4  * source file, anyway you can use it or any part of it whatever
5  * you want. It comes without any warranty, so use it at your own risk.
6  * ------------------------------------------------------------------------
7  * Module name: file.h
8  * Abstract:    File word-set include file
9  */
10
11 #ifdef DECLARE_WORDS
12 #       ifdef PROTOTYPES
13 #               undef PROTOTYPES
14 #       endif
15 #       undef __FILE_H__
16 #else
17 #       ifndef PROTOTYPES
18 #               define PROTOTYPES
19 #       endif
20 #endif
21
22 #ifndef __FILE_H__
23 #define __FILE_H__
24
25 #include <stdio.h>
26 #include "yforth.h"
27 #include "macro.h"
28
29 #define FILE_R_O                0
30 #define FILE_W_O                2
31 #define FILE_R_W                4
32 #define FILE_BIN                1
33
34 /**************************************************************************/
35 /* PROTOTYPES *************************************************************/
36 /**************************************************************************/
37
38 code(bin,                                                       "bin",                                  0)
39 code(close_file,                                        "close-file",                   0)
40 code(create_file,                                       "create-file",                  0)
41 code(delete_file,                                       "delete-file",                  0)
42 code(file_position,                                     "file-position",                0)
43 code(file_size,                                         "file-size",                    0)
44 code(include_file,                                      "include-file",                 0)
45 code(included,                                          "included",                             0)
46 code(open_file,                                         "open-file",                    0)
47 code(r_o,                                                       "r/o",                                  0)
48 code(r_w,                                                       "r/w",                                  0)
49 code(read_file,                                         "read-file",                    0)
50 code(read_line,                                         "read-line",                    0)
51 code(reposition_file,                           "reposition-file",              0)
52 code(resize_file,                                       "resize-file",                  0)
53 code(w_o,                                                       "w/o",                                  0)
54 code(write_file,                                        "write-file",                   0)
55 code(write_line,                                        "write-line",                   0)
56
57 #ifdef PROTOTYPES
58
59 /**************************************************************************/
60 /* AUXILIARY FUNCTIONS PROTOTYPES *****************************************/
61 /**************************************************************************/
62
63 Cell truncate_file(FILE *f, UDCell cur, UDCell ud);
64 Cell expand_file(FILE *f, UDCell cur, UDCell ud);
65 Char *get_file_name(void);
66 void load_file(Char *name);
67
68 #endif
69
70 #endif