diff options
Diffstat (limited to 'language/dynamic/input.e')
| -rw-r--r-- | language/dynamic/input.e | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/language/dynamic/input.e b/language/dynamic/input.e index 9d73c16..ccff6ca 100644 --- a/language/dynamic/input.e +++ b/language/dynamic/input.e @@ -15,11 +15,13 @@ : buffer-logical-length 3 8 * + ; ~ (pointer to buffer metadata -- pointer to buffer "file-descriptor" field) : buffer-file-descriptor 4 8 * + ; +~ (pointer to buffer metadata -- pointer to buffer "filename" field) +: buffer-filename 5 8 * + ; ~ (pointer to input buffer metadata -- pointer to input buffer "refill" field) -: input-buffer-refill 5 8 * + ; +: input-buffer-refill 6 8 * + ; ~ (pointer to input buffer metadata ~ -- pointer to input buffer "next-source" field) -: input-buffer-next-source 6 8 * + ; +: input-buffer-next-source 7 8 * + ; ~ Given an initialized buffer (input or otherwise), sets its logical-start @@ -48,6 +50,7 @@ dup buffer-logical-start 0 swap ! dup buffer-logical-length 0 swap ! dup buffer-file-descriptor -1 swap ! + dup buffer-filename 0 swap ! dup input-buffer-refill 0 swap ! ~ Notice the absence of a dup this time. input-buffer-next-source 0 swap ! ; @@ -58,7 +61,7 @@ ~ ~ (-- pointer to input buffer metadata) : allocate-input-buffer-metadata - 7 8 * allocate + 8 8 * allocate dup zero-input-buffer-metadata ; @@ -67,10 +70,10 @@ ~ ~ (buffer capacity in bytes -- pointer to input buffer metadata) : allocate-input-buffer - dup 7 8 * + allocate + dup 8 8 * + allocate dup zero-input-buffer-metadata ~ (capacity in bytes, metadata pointer) - dup dup 7 8 * + + dup dup 8 8 * + ~ (capacity in bytes, metadata pointer, metadata pointer, physical start) swap buffer-physical-start ! ~ (capacity in bytes, metadata pointer) |