This introduces a RESIZE-FILE-LIMIT
authorHelmut Eller <eller.helmut@gmail.com>
Sun, 8 Jan 2017 20:27:28 +0000 (21:27 +0100)
committerHelmut Eller <eller.helmut@gmail.com>
Sun, 8 Jan 2017 20:50:44 +0000 (21:50 +0100)
commit0b1e24898c41afa1f07854c295881b23aa2faea6
tree74b7c8c8ed9a6e81e6d5c7946cb9602b4af32453
parente0d21c12cf924ad826eb0e73a10c5167f0195f65
This introduces a RESIZE-FILE-LIMIT

The intention is to protect the user from a presumably common mistake:
passing the size as single cell number instead of a double cell
number.  This would create a very big file that is written in many
small chunks.

I also changed sdResizeFile to use uint64_t instead of Lo/Hi pairs.

* csrc/pfcompil.c (pfBuildDictionary): Rename RESIZE-FILE
to (RESIZE-FILE).

* fth/file.fth (RESIZE-FILE-LIMIT): New variable.
(RESIZE-FILE): Use it.

* fth/system.fth (D<, D>): Implemented.  Needed for compare the limit.

* csrc/pf_io.h, csrc/pf_io.c (sdResizeFile): Use uint64_t.
* csrc/stdio/pf_fileio_stdio.c (sdResizeFile): Use uint64_t.
(IsGreaterThanLongMax): Deleted.

* csrc/pf_inner.c (ID_FILE_RESIZE): Convert the Lo/Hi pair to uint64_t.
(UdToUint64, UdIsUint64): New helpers.
csrc/pf_inner.c
csrc/pf_io.c
csrc/pf_io.h
csrc/pfcompil.c
csrc/stdio/pf_fileio_stdio.c
fth/file.fth
fth/system.fth