Implement RENAME-FILE
authorHelmut Eller <eller.helmut@gmail.com>
Mon, 2 Jan 2017 18:28:25 +0000 (19:28 +0100)
committerHelmut Eller <eller.helmut@gmail.com>
Mon, 2 Jan 2017 18:28:25 +0000 (19:28 +0100)
commit6f3de3962bb26f4e1be714dfefc78de0fc16b376
tree689eb48b9288ed9ec3a2b7da7e5a12124bd2ff42
parent82b409b0854d22efe9bbf8b2e7c2d003ab06e2e3
Implement RENAME-FILE

This introduces a primitive (RENAME-FILE) which takes C-strings as
arguments.  The conversion from Forth-strings to C-strings is done in
Forth code as it doesn't seem to be any easier to do it in C.

* csrc/pf_io.h (sdRenameFile): New.  It has the same semantics as
rename(2) from <stdio.h>

* csrc/pf_io.c (sdRenameFile): New stub.

* csrc/pf_guts.h (cforth_primitive_ids): ID_FILE_RENAME added,
ID_RESERVED12 removed

* csrc/pf_inner.c: Add case for ID_FILE_RENAME.

* csrc/pfcompil.c (pfBuildDictionary): Create entry for (RENAME-FILE).

* fth/file.fth (RENAME-FILE): New.
(THROW_RENAME_FILE): New constant.

* fth/t_file.fth: Remove stub and uncomment some tests.
csrc/pf_guts.h
csrc/pf_inner.c
csrc/pf_io.c
csrc/pf_io.h
csrc/pfcompil.c
fth/file.fth
fth/t_file.fth