terminfo: separate string-offset word.

db4
John Benediktsson 2013-04-26 11:36:25 -07:00
parent a6ab66d290
commit e69f007eef
1 changed files with 5 additions and 3 deletions

View File

@ -45,10 +45,12 @@ C: <terminfo-header> terminfo-header
: read-numbers ( header -- numbers ) : read-numbers ( header -- numbers )
[ align-even-bytes ] [ #numbers>> read-shorts ] bi ; [ align-even-bytes ] [ #numbers>> read-shorts ] bi ;
: string-offset ( from seq -- str )
0 2over index-from swap subseq >string ;
: read-strings ( header -- strings ) : read-strings ( header -- strings )
[ #strings>> read-shorts ] [ string-bytes>> read ] bi '[ [ #strings>> read-shorts ] [ string-bytes>> read ] bi
[ _ 0 2over index-from swap subseq >string ] [ f ] if* '[ [ _ string-offset ] [ f ] if* ] map ;
] map ;
TUPLE: terminfo names booleans numbers strings ; TUPLE: terminfo names booleans numbers strings ;