2
Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
4
This file is part of GNU Common Lisp, herein referred to as GCL
6
GCL is free software; you can redistribute it and/or modify it under
7
the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
8
the Free Software Foundation; either version 2, or (at your option)
11
GCL is distributed in the hope that it will be useful, but WITHOUT
12
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14
License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with GCL; see the file COPYING. If not, write to the Free Software
18
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
80
fread(buffer, BUFSIZ, 1, from);
81
fwrite(buffer, BUFSIZ, 1, to);
84
fread(buffer, 1, n, from);
85
fwrite(buffer, 1, n, to);
92
memory_save(original_file, save_file)
93
char *original_file, *save_file;
95
char *data_begin, *data_end;
97
FILE *original, *save;
102
original = freopen(original_file,"r",stdin);
104
original = fopen(original_file, "r");
107
if (stdin != original || original->_file != 0) {
108
fprintf(stderr, "Can't open the original file.\n");
111
setbuf(original, stdin_buf);
114
n = open(save_file, O_CREAT|O_WRONLY, 0777);
115
if (n != 1 || (save = fdopen(n, "w")) != stdout) {
116
fprintf(stderr, "Can't open the save file.\n");
119
setbuf(save, stdout_buf);
124
for (n = header.a_data, p = data_begin; ; n -= BUFSIZ, p += BUFSIZ)
126
fwrite(p, BUFSIZ, 1, save);
128
fwrite(p, 1, n, save);
133
fseek(original, original_data, 1);
141
extern void _cleanup();
148
check_type_or_pathname_string_symbol_stream(&vs_base[0]);
149
coerce_to_filename(vs_base[0], filename);
158
nfile = NUMBER_OPEN_FILES;
160
for (p = &_iob[3]; p < &_iob[nfile]; p++)
164
memory_save(kcl_self, filename);
172
#endif /* UNIXSAVE include */
175
gcl_init_unixsave(void)
177
make_function("SAVE", Lsave);