Google

STRING-EXT String + extensions

The basic words for handling string buffers. There are much more buffer words used in most Forth implementations around but they can usually implemented as colon-word quite effectivly on the basis of the STRING wordset.



-TRAILING ( str-ptr str-len -- str-ptr str-len' )  
ansi 17.6.1.0170
check the given buffer if it contains whitespace at its end. If so, shorten str-len to meet the last non-whitespace character in the buffer.

reference: p4_dash_trailing in ../src/string.c:0038, export CO -TRAILING

/STRING
ansi 17.6.1.0245

no forth documentation available   (p4_slash_string)

  • see the ANSI Documentation of this word : ansi 17.6.1.0245

reference: p4_slash_string in ../src/string.c:0048, export CO /STRING

BLANK ( str-ptr str-len -- )  
ansi 17.6.1.0780
FILL a given buffer with BL blanks

reference: p4_blank in ../src/string.c:0066, export CO BLANK

CMOVE ( from-ptr to-ptr len -- )  
ansi 17.6.1.0910
memcpy an area from->to for len bytes, starting at the lower addresses, see CMOVE>

reference: p4_cmove in ../src/string.c:0076, export CO CMOVE

CMOVE> ( from-ptr to-ptr len -- )  
ansi 17.6.1.0920
memcpy an area from->to for len bytes, starting with the higher addresses, see CMOVE

reference: p4_cmove_up in ../src/string.c:0091, export CO CMOVE>

COMPARE ( str-ptr1 str-len1 str-ptr2 str-len2 -- n )  
ansi 17.6.1.0935
compare both str-buffers, return 0 if they are equal, -1 if lower or shorter, and 1 if greater or longer

reference: p4_compare in ../src/string.c:0108, export CO COMPARE

SEARCH ( str-ptr1 str-len1 str-ptr2 str-len2 -- str-ptr1' str-len1' flag )  
ansi 17.6.1.2191
search the str-buffer1 for the text of str-buffer2, if it is contained return TRUE and return buffer-values that point to the contained string, otherwise return FALSE and leave the original str-buffer1.

reference: p4_search in ../src/string.c:0133, export CO SEARCH

SLITERAL ( -- string ) (runtime)   compile-only
smart-word ansi 17.6.1.2212
this word does almost the same as LITERAL - it takes an S" string as specified in the CS-STACK at compile time and compiles into the current definition where it is returned as if there were a direct string-literal. This can be used to compute a string-literal at compile-time and hardwire it.
 example:
   : ORIGINAL-HOME  [ $HOME COUNT ] SLITERAL ; ( -- str-ptr str-len )

reference: p4_sliteral in ../src/string.c:0158, export CS SLITERAL