From: Helmut Eller Date: Tue, 3 Jan 2017 09:31:36 +0000 (+0100) Subject: Implement RESIZE-FILE X-Git-Url: https://git.subgeniuskitty.com/pforth/.git/commitdiff_plain/e0701bfb3e9047a565191d1e582f7f5d97a79f5f?hp=e0701bfb3e9047a565191d1e582f7f5d97a79f5f Implement RESIZE-FILE On Unix, the easiest way to implement RESIZE-FILE would be to call ftruncate, but in ANSI C alone it's quite difficult. As this takes a bit more code, I created a new file pf_fileio_stdio.c and moved it there. The idea is that somebody could replace that with say a pf_fileio_posix.c and use ftruncate there. Because there's a new file I had to change the Makefiles. I did not fix the VisualStudio project file, as I don't know how to do that. * csrc/stdio/pf_fileio_stdio.c: New file. * csrc/pf_guts.h (cforth_primitive_ids): ID_FILE_RESIZE added, ID_RESERVED10 removed. (THROW_RESIZE_FILE): New. * csrc/pf_io.h (sdResizeFile): New prototype. * csrc/pf_io.c (sdResizeFile): Define stub, (sdDeleteFile): Fix type. * csrc/pf_inner.c (pfCatch): Add case for ID_FILE_RESIZE. * csrc/pfcompil.c (pfBuildDictionary): Define RESIZE-FILE. * build/unix/Makefile, build/linux-crossbuild-amiga/Makefile build/mingw-crossbuild-linux/Makefile: Compile and link with pf_fileio_stdio. * fth/t_file.fth: Remove stub. ---