-- Words making sense in POSIX-like systems only.
Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved.
description: This file exports a set of system words for a posixish OS environment. So should do any alternative wordset you might create for your OS.
EXTENSIONS
#!
( "...<eol>" -- )(
)
;
p4:"ignore-line";
ignores the rest of the line, defining `#!' is used to support forth scripts executed by the unix kernel
EXTENSIONS
CLOCK
( --- ticks )(
)
;
"clock";
return clock()
EXTENSIONS
GETTIMEOFDAY
( -- double-time )( | ) ; |
; |
returns SVR/BSD gettimeofday(2). Never defined on 16-bit systems, hence TIME&DATE is more portable.
EXTENSIONS
NTOHL
( l -- l' )(
)
;
p4:"ntohl";
if current host-encoding is bigendian, this is a NOOP otherwise byteswap the lower 32-bit bits of the topofstack. see L@ and L! (being usually just @ and ! ) (on some platforms, the upper bits are erased, on others not)
EXTENSIONS
HTONL
( .. )(
)
;
as:"htonl";
ordinary primitive HTONL
an executable word (no special usage info)
or wrapper call around p4_ntohl
EXTENSIONS
NTOHS
( w -- w' )(
)
;
p4:"ntohs";
if current host-encoding is bigendian, this is a NOOP otherwise byteswap the lower 16-bit bits of the topofstack. see W@ and W! (on some platforms, the upper bits are erased, on others not)
EXTENSIONS
HTONS
( .. )(
)
;
as:"htons";
ordinary primitive HTONS
an executable word (no special usage info)
or wrapper call around p4_ntohs
ENVIRONMENT
CLK_TCK
( .. )(
)
;
as:"clk-tck";
ordinary primitive CLK_TCK
an executable word (no special usage info)
or wrapper call around p4__clk_tck