modify upstream makefile to allow hardening build flags to apply
[debian/yforth] / file.h
1 /* yForth? - A Forth interpreter written in ANSI C
2  * Copyright (C) 2012 Luca Padovani
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  * ------------------------------------------------------------------------
17  * Module name: file.h
18  * Abstract:    File word-set include file
19  */
20
21 #ifdef DECLARE_WORDS
22 #       ifdef PROTOTYPES
23 #               undef PROTOTYPES
24 #       endif
25 #       undef __FILE_H__
26 #else
27 #       ifndef PROTOTYPES
28 #               define PROTOTYPES
29 #       endif
30 #endif
31
32 #ifndef __FILE_H__
33 #define __FILE_H__
34
35 #include <stdio.h>
36 #include "yforth.h"
37 #include "macro.h"
38
39 #define FILE_R_O                0
40 #define FILE_W_O                2
41 #define FILE_R_W                4
42 #define FILE_BIN                1
43
44 /**************************************************************************/
45 /* PROTOTYPES *************************************************************/
46 /**************************************************************************/
47
48 code(bin,                                                       "bin",                                  0)
49 code(close_file,                                        "close-file",                   0)
50 code(create_file,                                       "create-file",                  0)
51 code(delete_file,                                       "delete-file",                  0)
52 code(file_position,                                     "file-position",                0)
53 code(file_size,                                         "file-size",                    0)
54 code(include_file,                                      "include-file",                 0)
55 code(included,                                          "included",                             0)
56 code(open_file,                                         "open-file",                    0)
57 code(r_o,                                                       "r/o",                                  0)
58 code(r_w,                                                       "r/w",                                  0)
59 code(read_file,                                         "read-file",                    0)
60 code(read_line,                                         "read-line",                    0)
61 code(reposition_file,                           "reposition-file",              0)
62 code(resize_file,                                       "resize-file",                  0)
63 code(w_o,                                                       "w/o",                                  0)
64 code(write_file,                                        "write-file",                   0)
65 code(write_line,                                        "write-line",                   0)
66
67 #ifdef PROTOTYPES
68
69 /**************************************************************************/
70 /* AUXILIARY FUNCTIONS PROTOTYPES *****************************************/
71 /**************************************************************************/
72
73 Cell truncate_file(FILE *f, UDCell cur, UDCell ud);
74 Cell expand_file(FILE *f, UDCell cur, UDCell ud);
75 Char *get_file_name(void);
76 void load_file(Char *name);
77
78 #endif
79
80 #endif