opcodes[]: global scope global { global scope implicit__Dir { FileInfo kill ( FileInfo ) { var FileInfo ANON dup ( -- FileInfo¢ ) item+9 "name" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) dispose ( ucs1str -- ) } Ranges kill ( Ranges ) { var Ranges ANON dup ( -- Ranges¢ ) forallitems ( Ranges¢ -- Range& ) -> L814 L813: peek ( Range& -- Range¢ ) dispose ( Range -- ) L814: ForAllEnd .. L813 } } type utf8str: type ucs1str: type ucs2str: type FD: type BlockDevice: Range allocate_blocks ( BlockDevice¢ bdev, uint32 maxnum, uint32 bestpos ) { var BlockDevice¢ bdev var uint32 maxnum var uint32 bestpos var File¢ fd local scope ANON var Ranges¢ ranges var Range¢ r var uint16 fpos var uint16 rsize var uint32 rstart var uint32 rcount lvar+4+0 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) 1 ( -- uint32 ) >= ( uint32, uint32 -- bool ) call assert1 ( bool ) lvar+8+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) call getFreeBlocksFile ( BlockDevice¢ -- File¢ ) lvar-2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) ! ( File¢ -- bool ) jp_z ( bool -- ) -> L997 NULL ( -- void* ) jp ( -- ) -> L996 L997: lvar-2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+23 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) 0 ( -- uint32 ) == ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L999 lvar-2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+27 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) lvar-4+4 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) count ( Ranges¢ -- uint16 ) 0 ( -- uint16 ) == ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L1001 16 ( -- OSErr ) call null_with_error ( OSErr -- void* ) tor ( Range -- ) drop ( Ranges¢ -- ) fromr ( -- Range ) jp ( -- ) -> L996 L1001: 1 ( -- bool ) lvar-2+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+30 "file_dirty" ( -- bool& ) poke ( bool, bool& -- ) lvar-4+4 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) lvar-4+6 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) count ( Ranges¢ -- uint16 ) 1 ( -- uint16 ) - ( uint16, uint16 -- uint16 ) atindex ( Ranges¢, int16 -- Range& ) peek ( Range& -- Range¢ ) lvar-6+6 "r" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+4+10 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) <= ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L1004 lvar-6+6 "r" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+10 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+10 "totalblocks" ( -- uint32& ) -= ( uint32, uint32& -- ) lvar-4+6 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) call pop ( Ranges¢ -- Range ) tor ( Range -- ) drop ( Range¢ -- ) drop ( Ranges¢ -- ) fromr ( -- Range ) jp ( -- ) -> L996 L1004: lvar+4+6 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+10 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+10 "totalblocks" ( -- uint32& ) -= ( uint32, uint32& -- ) lvar+4+6 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-6+10 "r" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+0 "start" ( -- uint32& ) += ( uint32, uint32& -- ) lvar+4+6 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-6+10 "r" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) -= ( uint32, uint32& -- ) lvar-6+6 "r" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+0 "start" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+4+10 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) - ( uint32, uint32 -- uint32 ) lvar+4+10 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) call new ( uint32, uint32 -- Range ) tor ( Range -- ) drop ( Range¢ -- ) drop ( Ranges¢ -- ) fromr ( -- Range ) jp ( -- ) -> L996 L1003: drop ( Range¢ -- ) drop ( Ranges¢ -- ) jp ( -- ) -> L999 L999: lvar-2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+4 "bestpos" ( -- uint32& ) peek ( uint32& -- uint32 ) call find_range ( File¢, uint32 -- uint16 ) call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L1005 NULL ( -- void* ) tor ( Range -- ) drop ( uint16 -- ) fromr ( -- Range ) jp ( -- ) -> L996 L1005: 4 ( -- uint16 ) lvar-2+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( uint16, int16 -- uint16 ) lvar-4+6 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) lvar-2+10 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+23 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) == ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L1007 lvar-6+6 "rsize" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-4+8 "fpos" ( -- uint16& ) -= ( uint16, uint16& -- ) jp ( -- ) -> L1007 L1007: 0 ( -- uint32 ) 0 ( -- uint32 ) lvar-2+14 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+16 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-10+18 "rstart" ( -- uint32& ) lvar-14+20 "rcount" ( -- uint32& ) call read_range_at ( File¢, uint16, uint32&, uint32& ) call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L1009 NULL ( -- void* ) tor ( Range -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint16 -- ) drop ( uint16 -- ) fromr ( -- Range ) jp ( -- ) -> L996 L1009: lvar-10+14 "rstart" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+18 "bestpos" ( -- uint32& ) peek ( uint32& -- uint32 ) < ( uint32, uint32 -- bool ) and0 ( bool -- ) -> L1013 lvar-4+14 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) 0 ( -- uint16 ) != ( uint16, uint16 -- bool ) L1013: jp_z ( bool -- ) -> L1011 lvar-6+14 "rsize" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-4+16 "fpos" ( -- uint16& ) -= ( uint16, uint16& -- ) lvar-2+14 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+16 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-10+18 "rstart" ( -- uint32& ) lvar-14+20 "rcount" ( -- uint32& ) call read_range_at ( File¢, uint16, uint32&, uint32& ) call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L1011 NULL ( -- void* ) tor ( Range -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint16 -- ) drop ( uint16 -- ) fromr ( -- Range ) jp ( -- ) -> L996 L1011: lvar-14+14 "rcount" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+4+18 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) > ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L1017 lvar-2+14 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+16 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-10+18 "rstart" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+4+22 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) + ( uint32, uint32 -- uint32 ) lvar-14+22 "rcount" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+4+26 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) - ( uint32, uint32 -- uint32 ) call write_range_at ( File¢, uint16, uint32, uint32 ) lvar-10+14 "rstart" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+4+18 "maxnum" ( -- uint32& ) peek ( uint32& -- uint32 ) call new ( uint32, uint32 -- Range ) tor ( Range -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint16 -- ) drop ( uint16 -- ) fromr ( -- Range ) jp ( -- ) -> L996 L1017: lvar-2+14 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+16 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) lvar-6+20 "rsize" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) call close_gap ( File¢, uint32, uint32 -- bool ) drop ( bool -- ) lvar-10+14 "rstart" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-14+18 "rcount" ( -- uint32& ) peek ( uint32& -- uint32 ) call new ( uint32, uint32 -- Range ) tor ( Range -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint16 -- ) drop ( uint16 -- ) fromr ( -- Range ) jp ( -- ) -> L996 L1016: drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint16 -- ) drop ( uint16 -- ) L996: tor ( Range -- ) drop ( File¢ -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( BlockDevice¢ -- ) fromr ( -- Range ) local scope ANON { } } bool writeFilesystem ( BlockDevice¢ bdev, ucs1str¢ name, bool wide ) { var BlockDevice¢ bdev var ucs1str¢ name var bool wide const uint16 root_i = 1 const uint16 root_n = 2 const uint16 free_i = 3 const uint16 root_size = 24 var uint32 mdate var File fd lvar+0+0 "wide" ( -- bool& ) peek ( bool& -- bool ) or1 ( bool -- ) -> L956 lvar+4+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+10 "totalblocks" ( -- uint32& ) peek ( uint32& -- uint32 ) 32768 ( -- uint32 ) < ( uint32, uint32 -- bool ) L956: call assert1 ( bool ) lvar+4+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+15 "open_files" ( -- File[]& ) peek ( File[]& -- File[]¢ ) ! ( File[]¢ -- bool ) call assert1 ( bool ) call clear_error () lvar+0+0 "wide" ( -- bool& ) peek ( bool& -- bool ) lvar+4+2 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+14 "wide" ( -- bool& ) poke ( bool, bool& -- ) lvar+0+0 "wide" ( -- bool& ) peek ( bool& -- bool ) jp_z ( bool -- ) -> L957 gvar "systemtime" ( -- uint32& ) peek ( uint32& -- uint32 ) jp ( -- ) -> L958 L957: gvar "systemtime" ( -- uint32& ) peek ( uint32& -- uint32 ) 86400 ( -- uint32 ) / ( uint32, uint32 -- uint32 ) L958: lvar+4+4 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) call newDeviceFile ( BlockDevice¢ -- File ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 4547 ( -- uint32 ) 28102 ( -- uint32 ) call write_words ( File¢, uint32, uint32 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) lvar-6+8 "fd" ( -- File& ) peek ( File& -- File¢ ) item+9 "log2blocksize" ( -- uint8& ) peek ( uint8& -- uint8 ) cast ( uint8 -- uint16 ) call write_byte ( File¢, uint16 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) lvar-6+8 "fd" ( -- File& ) peek ( File& -- File¢ ) item+10 "totalblocks" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_word ( File¢, uint32 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) lvar+2+8 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) call write_name ( File¢, ucs1str¢ ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) lvar-6+8 "fd" ( -- File& ) peek ( File& -- File¢ ) item+5 "blocksize" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) call setfpos ( File¢, uint32 -- bool ) drop ( bool -- ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 147 ( -- uint16 ) call write_byte ( File¢, uint16 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 0 ( -- uint32 ) call write_word ( File¢, uint32 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 24 ( -- uint16 ) lvar+0+10 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( uint16, int16 -- uint16 ) cast ( uint16 -- uint32 ) lvar-4+12 "mdate" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_words ( File¢, uint32, uint32 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 1 ( -- uint16 ) call write_byte ( File¢, uint16 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 1 ( -- uint32 ) 2 ( -- uint32 ) call write_words ( File¢, uint32, uint32 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 1 ( -- uint16 ) call write_byte ( File¢, uint16 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 4 ( -- uint16 ) lvar+0+10 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( uint16, int16 -- uint16 ) cast ( uint16 -- uint32 ) lvar-4+12 "mdate" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_words ( File¢, uint32, uint32 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 0 ( -- uint16 ) call write_byte ( File¢, uint16 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 1 ( -- uint16 ) call write_byte ( File¢, uint16 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 3 ( -- uint32 ) lvar-6+12 "fd" ( -- File& ) peek ( File& -- File¢ ) item+10 "totalblocks" ( -- uint32& ) peek ( uint32& -- uint32 ) 3 ( -- uint32 ) - ( uint32, uint32 -- uint32 ) call write_words ( File¢, uint32, uint32 ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) 0 ( -- uint16 ) call write_byte ( File¢, uint16 ) call error ( -- OSErr ) !! ( OSErr -- bool ) or1 ( bool -- ) -> L959 lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) call purge_buffer ( File¢ -- bool ) L959: tor ( bool -- ) call! kill ( File -- File ) dispose ( File -- ) drop ( uint32 -- ) drop ( bool -- ) drop ( ucs1str¢ -- ) drop ( BlockDevice¢ -- ) fromr ( -- bool ) } File newDeviceFile ( BlockDevice¢ bdev ) { var BlockDevice¢ bdev lvar+0+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) 1 ( -- NodeType ) lvar+0+4 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+3 "name" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) 0 ( -- uint32 ) 0 ( -- uint32 ) lvar+0+14 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+10 "totalblocks" ( -- uint32& ) peek ( uint32& -- uint32 ) call new ( uint32, uint32 -- Ranges ) dup2r ( Ranges -- Ranges¢ ) call new_file ( BlockDevice¢, NodeType, ucs1str¢, uint32, Ranges¢ -- File ) fromr ( -- Ranges ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) tor ( File -- ) drop ( BlockDevice¢ -- ) fromr ( -- File ) } File¢ getRootDirectory ( BlockDevice¢ bdev ) { var BlockDevice¢ bdev var ucs1str fsname var File rootdir var File fd call clear_error () lvar+0+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+15 "open_files" ( -- File[]& ) peek ( File[]& -- File[]¢ ) !! ( File[]¢ -- bool ) jp_z ( bool -- ) -> L942 lvar+0+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+15 "open_files" ( -- File[]& ) peek ( File[]& -- File[]¢ ) 0 ( -- int16 ) atindex ( File[]¢, int16 -- File& ) peek ( File& -- File¢ ) jp ( -- ) -> L941 L942: lvar+0+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) call get_fsname ( BlockDevice¢ -- ucs1str ) lvar-2+2 "fsname" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) ! ( ucs1str¢ -- bool ) jp_z ( bool -- ) -> L944 NULL ( -- void* ) tor ( File¢ -- ) dispose ( ucs1str -- ) fromr ( -- File¢ ) jp ( -- ) -> L941 L944: lvar+0+2 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) lvar-2+4 "fsname" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) 0 ( -- uint32 ) 1 ( -- uint32 ) call new_dir ( BlockDevice¢, ucs1str¢, uint32, uint32 -- File ) lvar-4+4 "rootdir" ( -- File& ) peek ( File& -- File¢ ) ! ( File¢ -- bool ) jp_z ( bool -- ) -> L946 NULL ( -- void* ) tor ( File¢ -- ) call! kill ( File -- File ) dispose ( File -- ) dispose ( ucs1str -- ) fromr ( -- File¢ ) jp ( -- ) -> L941 L946: lvar-4+4 "rootdir" ( -- File& ) peek ( File& -- File¢ ) call newFileAtFpos ( File¢ -- File ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) !! ( File¢ -- bool ) and0 ( bool -- ) -> L950 lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) call is_file ( FD¢ -- bool ) L950: jp_z ( bool -- ) -> L949 1 ( -- bool ) lvar-6+8 "fd" ( -- File& ) peek ( File& -- File¢ ) item+29 "writable" ( -- bool& ) poke ( bool, bool& -- ) 8 ( -- uint16 ) alloc ( uint16 -- File[] ) lvar+0+8 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+15 "open_files" ( -- File[]& ) poke ( File[], File[]& -- ) lvar-4+6 "rootdir" ( -- File& ) peek ( File& -- File¢ ) retain ( File¢ -- File ) lvar+0+8 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+15 "open_files" ( -- File[]& ) peek ( File[]& -- File[]¢ ) 0 ( -- int16 ) atindex ( File[]¢, int16 -- File& ) poke ( File, File& -- ) lvar-6+6 "fd" ( -- File& ) peek ( File& -- File¢ ) retain ( File¢ -- File ) lvar+0+8 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+15 "open_files" ( -- File[]& ) peek ( File[]& -- File[]¢ ) 1 ( -- int16 ) atindex ( File[]¢, int16 -- File& ) poke ( File, File& -- ) lvar-4+6 "rootdir" ( -- File& ) peek ( File& -- File¢ ) tor ( File¢ -- ) call! kill ( File -- File ) dispose ( File -- ) call! kill ( File -- File ) dispose ( File -- ) dispose ( ucs1str -- ) fromr ( -- File¢ ) jp ( -- ) -> L941 L949: 17 ( -- OSErr ) call null_with_error ( OSErr -- void* ) tor ( File¢ -- ) call! kill ( File -- File ) dispose ( File -- ) call! kill ( File -- File ) dispose ( File -- ) dispose ( ucs1str -- ) fromr ( -- File¢ ) jp ( -- ) -> L941 L948: call! kill ( File -- File ) dispose ( File -- ) call! kill ( File -- File ) dispose ( File -- ) dispose ( ucs1str -- ) L941: tor ( File¢ -- ) drop ( BlockDevice¢ -- ) fromr ( -- File¢ ) } File¢ getFreeBlocksFile ( BlockDevice¢ bdev ) { var BlockDevice¢ bdev lvar+0+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+15 "open_files" ( -- File[]& ) peek ( File[]& -- File[]¢ ) !! ( File[]¢ -- bool ) jp_z ( bool -- ) -> L952 lvar+0+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+15 "open_files" ( -- File[]& ) peek ( File[]& -- File[]¢ ) 1 ( -- int16 ) atindex ( File[]¢, int16 -- File& ) peek ( File& -- File¢ ) jp ( -- ) -> L953 L952: NULL ( -- void* ) L953: tor ( File¢ -- ) drop ( BlockDevice¢ -- ) fromr ( -- File¢ ) } void return_blocks ( BlockDevice¢ bdev, Range¢ range ) { var BlockDevice¢ bdev var Range¢ range var File¢ fd var uint16 fpos var uint32 lstart var uint32 lcount var uint32 hstart var uint32 hcount var uint16 rsize var bool merge_l var bool merge_h lvar+2+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) call getFreeBlocksFile ( BlockDevice¢ -- File¢ ) lvar-2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) ! ( File¢ -- bool ) jp_z ( bool -- ) -> L974 jp ( -- ) -> L973 L974: lvar+0+2 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) ! ( Range¢ -- bool ) jp_z ( bool -- ) -> L976 jp ( -- ) -> L973 L976: lvar+0+2 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) 0 ( -- uint32 ) == ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L978 jp ( -- ) -> L973 L978: lvar-2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+4 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+0 "start" ( -- uint32& ) peek ( uint32& -- uint32 ) call find_range ( File¢, uint32 -- uint16 ) call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L980 drop ( uint16 -- ) jp ( -- ) -> L973 L980: 0 ( -- uint32 ) 0 ( -- uint32 ) 0 ( -- uint32 ) 0 ( -- uint32 ) 4 ( -- uint16 ) lvar-2+22 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( uint16, int16 -- uint16 ) lvar-4+22 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) lvar-2+26 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+23 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) < ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L982 lvar-2+22 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+24 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-8+26 "lstart" ( -- uint32& ) lvar-12+28 "lcount" ( -- uint32& ) call read_range_at ( File¢, uint16, uint32&, uint32& ) jp ( -- ) -> L982 L982: lvar+0+22 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+0 "start" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-8+26 "lstart" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-12+30 "lcount" ( -- uint32& ) peek ( uint32& -- uint32 ) + ( uint32, uint32 -- uint32 ) == ( uint32, uint32 -- bool ) lvar-4+24 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) !! ( uint16 -- bool ) jp_z ( bool -- ) -> L984 lvar-2+24 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+26 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-22+28 "rsize" ( -- uint16& ) peek ( uint16& -- uint16 ) - ( uint16, uint16 -- uint16 ) lvar-16+28 "hstart" ( -- uint32& ) lvar-20+30 "hcount" ( -- uint32& ) call read_range_at ( File¢, uint16, uint32&, uint32& ) jp ( -- ) -> L984 L984: lvar+0+24 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+0 "start" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+28 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) + ( uint32, uint32 -- uint32 ) lvar-16+28 "hstart" ( -- uint32& ) peek ( uint32& -- uint32 ) == ( uint32, uint32 -- bool ) lvar-24+26 "merge_l" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L987 lvar-26+26 "merge_h" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L989 lvar-2+26 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+28 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-22+30 "rsize" ( -- uint16& ) peek ( uint16& -- uint16 ) - ( uint16, uint16 -- uint16 ) lvar-8+30 "lstart" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-12+34 "lcount" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+38 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) + ( uint32, uint32 -- uint32 ) lvar-20+38 "hcount" ( -- uint32& ) peek ( uint32& -- uint32 ) + ( uint32, uint32 -- uint32 ) call write_range_at ( File¢, uint16, uint32, uint32 ) lvar-2+26 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+28 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) lvar-22+32 "rsize" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) call close_gap ( File¢, uint32, uint32 -- bool ) drop ( bool -- ) jp ( -- ) -> L986 L989: lvar-2+26 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+28 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-8+30 "lstart" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-12+34 "lcount" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+38 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) + ( uint32, uint32 -- uint32 ) call write_range_at ( File¢, uint16, uint32, uint32 ) jp ( -- ) -> L986 L987: lvar-26+26 "merge_h" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L991 lvar-2+26 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+28 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-22+30 "rsize" ( -- uint16& ) peek ( uint16& -- uint16 ) - ( uint16, uint16 -- uint16 ) lvar+0+30 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+0 "start" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+34 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-20+38 "hcount" ( -- uint32& ) peek ( uint32& -- uint32 ) + ( uint32, uint32 -- uint32 ) call write_range_at ( File¢, uint16, uint32, uint32 ) jp ( -- ) -> L986 L991: lvar-2+26 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+23 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+30 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+10 "totalblocks" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+34 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+9 "log2blocksize" ( -- uint8& ) peek ( uint8& -- uint8 ) cast ( uint8 -- int16 ) << ( uint32, int16 -- uint32 ) == ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L993 lvar+0+26 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) retain ( Range¢ -- Range ) lvar-2+28 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+27 "ranges" ( -- Ranges& ) appenditem ( Range, Ranges& -- ) lvar+0+26 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+30 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+10 "totalblocks" ( -- uint32& ) += ( uint32, uint32& -- ) 1 ( -- bool ) lvar-2+28 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+30 "file_dirty" ( -- bool& ) poke ( bool, bool& -- ) jp ( -- ) -> L992 L993: lvar-4+26 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) lvar-2+30 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+23 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) < ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L992 lvar-2+26 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+28 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) lvar-22+32 "rsize" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) call open_gap ( File¢, uint32, uint32 -- bool ) drop ( bool -- ) jp ( -- ) -> L992 L992: lvar-2+26 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-4+28 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+0+30 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+0 "start" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+34 "range" ( -- Range¢& ) peek ( Range¢& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_range_at ( File¢, uint16, uint32, uint32 ) L986: drop ( bool -- ) drop ( bool -- ) drop ( uint16 -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint16 -- ) L973: drop ( File¢ -- ) drop ( Range¢ -- ) drop ( BlockDevice¢ -- ) } File new_file ( BlockDevice¢ q, NodeType ft, ucs1str¢ name, uint32 parent, Ranges¢ ranges ) { var BlockDevice¢ q var NodeType ft var ucs1str¢ name var uint32 parent var Ranges¢ ranges var File z 49 ( -- uint16 ) alloc ( uint16 -- File ) lvar-2+2 "z" ( -- File& ) peek ( File& -- File¢ ) lvar+8+4 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) lvar+6+6 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) gvar "file_handlers" ( -- FD_Handlers& ) peek ( FD_Handlers& -- FD_Handlers¢ ) lvar+10+10 "q" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+9 "log2blocksize" ( -- uint8& ) peek ( uint8& -- uint8 ) lvar+0+12 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) call totalblocks ( Ranges¢ -- uint32 ) call init ( BlockDevice¢, NodeType, ucs1str¢, FD_Handlers¢, uint8, uint32 ) lvar+10+2 "q" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) retain ( BlockDevice¢ -- BlockDevice ) lvar-2+4 "z" ( -- File& ) peek ( File& -- File¢ ) item+21 "device" ( -- BlockDevice& ) poke ( BlockDevice, BlockDevice& -- ) lvar+10+2 "q" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) lvar-2+4 "z" ( -- File& ) peek ( File& -- File¢ ) item+14 "wide" ( -- bool& ) poke ( bool, bool& -- ) lvar+2+2 "parent" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+6 "z" ( -- File& ) peek ( File& -- File¢ ) item+17 "parent" ( -- uint32& ) poke ( uint32, uint32& -- ) lvar+0+2 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) retain ( Ranges¢ -- Ranges ) lvar-2+4 "z" ( -- File& ) peek ( File& -- File¢ ) item+27 "ranges" ( -- Ranges& ) poke ( Ranges, Ranges& -- ) lvar-2+2 "z" ( -- File& ) peek ( File& -- File¢ ) retain ( File¢ -- File ) tor ( File -- ) call! kill ( File -- File ) dispose ( File -- ) drop ( Ranges¢ -- ) drop ( uint32 -- ) drop ( ucs1str¢ -- ) drop ( NodeType -- ) drop ( BlockDevice¢ -- ) fromr ( -- File ) } File new_dir ( BlockDevice¢ bdev, ucs1str¢ name, uint32 parent, uint32 block0 ) { var BlockDevice¢ bdev var ucs1str¢ name var uint32 parent var uint32 block0 var File fd lvar+10+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) 2 ( -- NodeType ) lvar+8+4 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) lvar+4+6 "parent" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+10 "block0" ( -- uint32& ) peek ( uint32& -- uint32 ) 32768 ( -- uint32 ) call new ( uint32, uint32 -- Ranges ) dup2r ( Ranges -- Ranges¢ ) call new_file ( BlockDevice¢, NodeType, ucs1str¢, uint32, Ranges¢ -- File ) fromr ( -- Ranges ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) 1 ( -- uint16 ) lvar-2+4 "fd" ( -- File& ) peek ( File& -- File¢ ) item+23 "fsize" ( -- uint32& ) hi ( uint32& -- uint16& ) poke ( uint16, uint16& -- ) lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) call read_byte ( File¢ -- uint16 ) 147 ( -- uint16 ) != ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L922 17 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L921 L922: lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar-2+6 "fd" ( -- File& ) peek ( File& -- File¢ ) item+17 "parent" ( -- uint32& ) peek ( uint32& -- uint32 ) != ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L924 17 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L921 L924: lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar-2+6 "fd" ( -- File& ) peek ( File& -- File¢ ) item+23 "fsize" ( -- uint32& ) poke ( uint32, uint32& -- ) lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) 2 ( -- uint16 ) call skip_bytes ( File¢, uint16 ) lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) 1 ( -- bool ) call read_ranges ( File¢, bool -- Ranges ) dup2r ( Ranges -- Ranges¢ ) call totalblocks ( Ranges¢ -- uint32 ) fromr ( -- Ranges ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) lvar-2+6 "fd" ( -- File& ) peek ( File& -- File¢ ) item+10 "totalblocks" ( -- uint32& ) poke ( uint32, uint32& -- ) call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L926 NULL ( -- void* ) jp ( -- ) -> L921 L926: lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) item+23 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) 1 ( -- uint32 ) - ( uint32, uint32 -- uint32 ) lvar-2+6 "fd" ( -- File& ) peek ( File& -- File¢ ) item+9 "log2blocksize" ( -- uint8& ) peek ( uint8& -- uint8 ) cast ( uint8 -- int16 ) >> ( uint32, int16 -- uint32 ) lvar-2+6 "fd" ( -- File& ) peek ( File& -- File¢ ) item+10 "totalblocks" ( -- uint32& ) peek ( uint32& -- uint32 ) >= ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L928 17 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L921 L928: lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) retain ( File¢ -- File ) L921: tor ( File -- ) call! kill ( File -- File ) dispose ( File -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( ucs1str¢ -- ) drop ( BlockDevice¢ -- ) fromr ( -- File ) } ucs1str get_fsname ( BlockDevice¢ bdev ) { var BlockDevice¢ bdev var File fd lvar+0+0 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) 1 ( -- NodeType ) NULL ( -- void* ) 0 ( -- uint32 ) 0 ( -- uint32 ) 1 ( -- uint32 ) call new ( uint32, uint32 -- Ranges ) dup2r ( Ranges -- Ranges¢ ) call new_file ( BlockDevice¢, NodeType, ucs1str¢, uint32, Ranges¢ -- File ) fromr ( -- Ranges ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) 1 ( -- bool ) lvar-2+4 "fd" ( -- File& ) peek ( File& -- File¢ ) item+14 "wide" ( -- bool& ) poke ( bool, bool& -- ) L932: lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) call read_word ( File¢ -- uint32 ) 4547 ( -- uint32 ) == ( uint32, uint32 -- bool ) and0 ( bool -- ) -> L934 lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) call read_word ( File¢ -- uint32 ) 28102 ( -- uint32 ) == ( uint32, uint32 -- bool ) L934: jp_nz ( bool -- ) -> L933 call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L935 NULL ( -- void* ) jp ( -- ) -> L931 L935: lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) ! ( bool -- bool ) jp_z ( bool -- ) -> L937 5 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L931 L937: 0 ( -- bool ) lvar-2+4 "fd" ( -- File& ) peek ( File& -- File¢ ) item+14 "wide" ( -- bool& ) poke ( bool, bool& -- ) 0 ( -- uint16 ) lvar-2+4 "fd" ( -- File& ) peek ( File& -- File¢ ) item+39 "fpos" ( -- uint32& ) lo ( uint32& -- uint16& ) poke ( uint16, uint16& -- ) jp ( -- ) -> L932 L933: lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) call read_byte ( File¢ -- uint16 ) lvar+0+4 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+9 "log2blocksize" ( -- uint8& ) peek ( uint8& -- uint8 ) cast ( uint8 -- uint16 ) != ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L939 5 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L931 L939: lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) 2 ( -- uint16 ) call skip_bytes ( File¢, uint16 ) lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) lvar+0+4 "bdev" ( -- BlockDevice¢& ) peek ( BlockDevice¢& -- BlockDevice¢ ) item+14 "wide" ( -- bool& ) poke ( bool, bool& -- ) lvar-2+2 "fd" ( -- File& ) peek ( File& -- File¢ ) call read_name ( File¢ -- ucs1str ) L931: tor ( ucs1str -- ) call! kill ( File -- File ) dispose ( File -- ) drop ( BlockDevice¢ -- ) fromr ( -- ucs1str ) } uint16 find_range ( File¢ fd, uint32 bpos ) { var File¢ fd var uint32 bpos var uint16 wsize var uint16 rmask var uint16 a var uint16 e local scope ANON var uint16 m 2 ( -- uint16 ) lvar+4+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( uint16, int16 -- uint16 ) 65532 ( -- uint16 ) lvar+4+4 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( uint16, int16 -- uint16 ) 0 ( -- uint16 ) lvar+4+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+23 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) cast ( uint32 -- uint16 ) 0 ( -- uint16 ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 1 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) poke ( uint16, uint16& -- ) lvar-8+8 "e" ( -- uint16& ) peek ( uint16& -- uint16 ) 0 ( -- uint16 ) == ( uint16, uint16 -- bool ) or1 ( bool -- ) -> L964 lvar+4+8 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-8+10 "e" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-4+12 "rmask" ( -- uint16& ) peek ( uint16& -- uint16 ) + ( uint16, uint16 -- uint16 ) cast ( uint16 -- uint32 ) call setfpos ( File¢, uint32 -- bool ) L964: or1 ( bool -- ) -> L965 lvar+4+8 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- uint16 ) lvar-2+14 "wsize" ( -- uint16& ) peek ( uint16& -- uint16 ) call read ( File¢, uint8[]¢, uint16, uint16 -- bool ) L965: or1 ( bool -- ) -> L966 lvar+0+8 "bpos" ( -- uint32& ) peek ( uint32& -- uint32 ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) peek ( uint32& -- uint32 ) < ( uint32, uint32 -- bool ) L966: jp_z ( bool -- ) -> L967 lvar-8+8 "e" ( -- uint16& ) peek ( uint16& -- uint16 ) jp ( -- ) -> L961 L967: lvar-6+8 "a" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-8+10 "e" ( -- uint16& ) peek ( uint16& -- uint16 ) < ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L968 lvar-6+8 "a" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-8+10 "e" ( -- uint16& ) peek ( uint16& -- uint16 ) + ( uint16, uint16 -- uint16 ) 1 ( -- int16 ) >> ( uint16, int16 -- uint16 ) lvar-4+10 "rmask" ( -- uint16& ) peek ( uint16& -- uint16 ) & ( uint16, uint16 -- uint16 ) lvar+4+10 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-10+12 "m" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) call setfpos ( File¢, uint32 -- bool ) jp_z ( bool -- ) -> L969 drop ( uint16 -- ) jp ( -- ) -> L968 L969: lvar+4+10 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- uint16 ) lvar-2+16 "wsize" ( -- uint16& ) peek ( uint16& -- uint16 ) call read ( File¢, uint8[]¢, uint16, uint16 -- bool ) jp_z ( bool -- ) -> L970 drop ( uint16 -- ) jp ( -- ) -> L968 L970: lvar+0+10 "bpos" ( -- uint32& ) peek ( uint32& -- uint32 ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) peek ( uint32& -- uint32 ) >= ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L972 lvar-10+10 "m" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-8+12 "e" ( -- uint16& ) poke ( uint16, uint16& -- ) jp ( -- ) -> L971 L972: lvar-10+10 "m" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-4+12 "rmask" ( -- uint16& ) peek ( uint16& -- uint16 ) - ( uint16, uint16 -- uint16 ) lvar-6+12 "a" ( -- uint16& ) poke ( uint16, uint16& -- ) L971: drop ( uint16 -- ) jp ( -- ) -> L967 L968: lvar-8+8 "e" ( -- uint16& ) peek ( uint16& -- uint16 ) L961: tor ( uint16 -- ) drop ( uint16 -- ) drop ( uint16 -- ) drop ( uint16 -- ) drop ( uint16 -- ) drop ( uint32 -- ) drop ( File¢ -- ) fromr ( -- uint16 ) local scope ANON { } } type Range: type File: bool sync ( File¢ ) { var File¢ ANON 1 ( -- bool ) tor ( bool -- ) drop ( File¢ -- ) fromr ( -- bool ) } bool rewind_directory ( File¢ fd ) { var File¢ fd call clear_error () lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call rewind ( File¢ -- bool ) jp_z ( bool -- ) -> L823 1 ( -- bool ) jp ( -- ) -> L822 L823: lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) 147 ( -- uint16 ) != ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L825 9 ( -- OSErr ) call yes_with_cond_error ( OSErr -- bool ) jp ( -- ) -> L822 L825: lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) 2 ( -- uint16 ) call skip_bytes ( File¢, uint16 ) lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call skip_ranges ( File¢ ) call error ( -- OSErr ) cast ( OSErr -- uint8 ) 0 ( -- uint8 ) != ( uint8, uint8 -- bool ) L822: tor ( bool -- ) drop ( File¢ -- ) fromr ( -- bool ) } uint16 num_direntries ( File¢ fd ) { var File¢ fd var uint16 n lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call rewind_directory ( File¢ -- bool ) drop ( bool -- ) 0 ( -- uint16 ) L870: lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call skip_direntry ( File¢ -- bool ) jp_nz ( bool -- ) -> L871 lvar-2+2 "n" ( -- uint16& ) ++ ( uint16& -- ) jp ( -- ) -> L870 L871: call error ( -- OSErr ) !! ( OSErr -- bool ) jp_z ( bool -- ) -> L872 0 ( -- uint16 ) jp ( -- ) -> L873 L872: lvar-2+2 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) L873: tor ( uint16 -- ) drop ( uint16 -- ) drop ( File¢ -- ) fromr ( -- uint16 ) } FileInfo next_fileinfo ( File¢ fd ) { var File¢ fd var NodeType ft var FileInfo fi call clear_error () lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_filetype ( File¢ -- NodeType ) lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 0 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L828 NULL ( -- void* ) jp ( -- ) -> L827 L828: lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) lvar+0+4 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar+0+8 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar+0+12 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_name ( File¢ -- ucs1str ) dup2r ( ucs1str -- ucs1str¢ ) call new ( NodeType, uint32, uint32, ucs1str¢ -- FileInfo ) fromr ( -- ucs1str ) dispose ( ucs1str -- ) lvar+0+4 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-2+6 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) call skip_ranges ( File¢, NodeType ) call error ( -- OSErr ) !! ( OSErr -- bool ) jp_z ( bool -- ) -> L830 NULL ( -- void* ) jp ( -- ) -> L831 L830: lvar-4+4 "fi" ( -- FileInfo& ) peek ( FileInfo& -- FileInfo¢ ) L831: retain ( FileInfo¢ -- FileInfo ) tor ( FileInfo -- ) call! kill ( FileInfo -- FileInfo ) dispose ( FileInfo -- ) fromr ( -- FileInfo ) jp ( -- ) -> L827 L827: tor ( FileInfo -- ) drop ( NodeType -- ) drop ( File¢ -- ) fromr ( -- FileInfo ) } ucs1str next_filename ( File¢ fd ) { var File¢ fd var NodeType ft var ucs1str fname call clear_error () lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_filetype ( File¢ -- NodeType ) lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 0 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L833 NULL ( -- void* ) jp ( -- ) -> L832 L833: lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 2 ( -- uint8 ) != ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L835 lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) 4 ( -- uint16 ) call skip_bytes ( File¢, uint16 ) jp ( -- ) -> L835 L835: lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_name ( File¢ -- ucs1str ) lvar+0+4 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-2+6 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) call skip_ranges ( File¢, NodeType ) call error ( -- OSErr ) !! ( OSErr -- bool ) jp_z ( bool -- ) -> L837 NULL ( -- void* ) jp ( -- ) -> L838 L837: lvar-4+4 "fname" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) L838: retain ( ucs1str¢ -- ucs1str ) tor ( ucs1str -- ) dispose ( ucs1str -- ) fromr ( -- ucs1str ) jp ( -- ) -> L832 L832: tor ( ucs1str -- ) drop ( NodeType -- ) drop ( File¢ -- ) fromr ( -- ucs1str ) } NodeType seek_direntry ( File¢ fd, ucs1str¢ name ) { var File¢ fd var ucs1str¢ name local scope ANON local scope ANON var NodeType ft var uint32 fpos var uint16 slen local scope ANON var int16 i lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call rewind_directory ( File¢ -- bool ) ! ( bool -- bool ) jp_z ( bool -- ) -> L840 L842: lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_filetype ( File¢ -- NodeType ) lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 0 ( -- uint8 ) != ( uint8, uint8 -- bool ) jp_nz ( bool -- ) -> L844 drop ( NodeType -- ) jp ( -- ) -> L840 L844: lvar+2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+39 "fpos" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+6 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 2 ( -- uint8 ) != ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L845 lvar+2+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) 4 ( -- uint16 ) call skip_bytes ( File¢, uint16 ) jp ( -- ) -> L845 L845: lvar+2+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) lvar-8+8 "slen" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+0+10 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) count ( ucs1str¢ -- uint16 ) == ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L847 0 ( -- int16 ) L849: lvar-8+10 "slen" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-10+12 "i" ( -- int16& ) peek ( int16& -- int16 ) == ( uint16, int16 -- bool ) jp_z ( bool -- ) -> L851 call error ( -- OSErr ) !! ( OSErr -- bool ) or1 ( bool -- ) -> L853 lvar+2+10 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-6+12 "fpos" ( -- uint32& ) peek ( uint32& -- uint32 ) call setfpos ( File¢, uint32 -- bool ) L853: jp_z ( bool -- ) -> L854 0 ( -- NodeType ) jp ( -- ) -> L855 L854: lvar-2+10 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) L855: tor ( NodeType -- ) drop ( int16 -- ) drop ( uint16 -- ) drop ( uint32 -- ) drop ( NodeType -- ) fromr ( -- NodeType ) jp ( -- ) -> L839 L851: lvar+0+10 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) lvar-10+12 "i" ( -- int16& ) peekpp ( int16& -- int16 ) atindex ( ucs1str¢, int16 -- ucs1char& ) peek ( ucs1char& -- ucs1char ) cast ( ucs1char -- uint8 ) cast ( uint8 -- uint16 ) lvar+2+12 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) == ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L850 jp ( -- ) -> L849 L850: lvar-10+10 "i" ( -- int16& ) peek ( int16& -- int16 ) lvar-8+12 "slen" ( -- uint16& ) -= ( uint16, uint16& -- ) drop ( int16 -- ) jp ( -- ) -> L847 L847: lvar+2+8 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-8+10 "slen" ( -- uint16& ) peek ( uint16& -- uint16 ) call skip_bytes ( File¢, uint16 ) lvar+2+8 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-2+10 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) call skip_ranges ( File¢, NodeType ) drop ( uint16 -- ) drop ( uint32 -- ) drop ( NodeType -- ) jp ( -- ) -> L842 L840: 0 ( -- NodeType ) L839: tor ( NodeType -- ) drop ( ucs1str¢ -- ) drop ( File¢ -- ) fromr ( -- NodeType ) local scope ANON { local scope ANON { local scope ANON { } } } } File newFileAtFpos ( File¢ dir, NodeType ft ) { var File¢ dir var NodeType ft var uint32 fsize var ucs1str name local scope ANON var File z call clear_error () call TODO () lvar+2+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar+2+4 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) 2 ( -- uint16 ) call skip_bytes ( File¢, uint16 ) lvar+2+4 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_name ( File¢ -- ucs1str ) lvar+0+6 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 2 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L876 lvar+2+6 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) item+21 "device" ( -- BlockDevice& ) peek ( BlockDevice& -- BlockDevice¢ ) lvar-6+8 "name" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) lvar+2+10 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call block0 ( File¢ -- uint32 ) lvar+2+14 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_word ( File¢ -- uint32 ) call new_dir ( BlockDevice¢, ucs1str¢, uint32, uint32 -- File ) jp ( -- ) -> L874 L876: lvar+2+6 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) item+21 "device" ( -- BlockDevice& ) peek ( BlockDevice& -- BlockDevice¢ ) lvar+0+8 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) lvar-6+10 "name" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) lvar+2+12 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call block0 ( File¢ -- uint32 ) lvar+2+16 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) 0 ( -- bool ) call read_ranges ( File¢, bool -- Ranges ) dup2r ( Ranges -- Ranges¢ ) call new_file ( BlockDevice¢, NodeType, ucs1str¢, uint32, Ranges¢ -- File ) fromr ( -- Ranges ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) lvar-4+8 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-8+12 "z" ( -- File& ) peek ( File& -- File¢ ) item+23 "fsize" ( -- uint32& ) poke ( uint32, uint32& -- ) call! kill ( File -- File ) dispose ( File -- ) L875: call error ( -- OSErr ) !! ( OSErr -- bool ) jp_z ( bool -- ) -> L877 NULL ( -- void* ) jp ( -- ) -> L878 L877: lvar+2+6 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) L878: retain ( File¢ -- File ) L874: tor ( File -- ) dispose ( ucs1str -- ) drop ( uint32 -- ) drop ( NodeType -- ) drop ( File¢ -- ) fromr ( -- File ) local scope ANON { } } File open ( File¢ dir, ucs1str¢ name, FileMode filemode ) { var File¢ dir var ucs1str¢ name var FileMode filemode var NodeType ft local scope ANON local scope ANON var File file local scope ANON var File file local scope ANON var File file lvar+4+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+2+2 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) call seek_direntry ( File¢, ucs1str¢ -- NodeType ) lvar+0+2 "filemode" ( -- FileMode& ) peek ( FileMode& -- FileMode ) cast ( FileMode -- uint8 ) 1 ( -- uint8 ) == ( uint8, uint8 -- bool ) and0 ( bool -- ) -> L884 lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 2 ( -- uint8 ) == ( uint8, uint8 -- bool ) L884: jp_z ( bool -- ) -> L882 10 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L881 L882: lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 0 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L886 lvar+0+2 "filemode" ( -- FileMode& ) peek ( FileMode& -- FileMode ) cast ( FileMode -- uint8 ) 0 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L887 8 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L881 L887: lvar+0+2 "filemode" ( -- FileMode& ) peek ( FileMode& -- FileMode ) cast ( FileMode -- uint8 ) 4 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L890 call TODO () lvar+4+2 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) item+21 "device" ( -- BlockDevice& ) peek ( BlockDevice& -- BlockDevice¢ ) 2 ( -- NodeType ) lvar+2+6 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) lvar+4+8 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call block0 ( File¢ -- uint32 ) 0 ( -- uint16 ) alloc ( uint16 -- Ranges ) dup2r ( Ranges -- Ranges¢ ) call new_file ( BlockDevice¢, NodeType, ucs1str¢, uint32, Ranges¢ -- File ) fromr ( -- Ranges ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) !! ( File¢ -- bool ) jp_z ( bool -- ) -> L891 1 ( -- bool ) lvar-4+6 "file" ( -- File& ) peek ( File& -- File¢ ) item+29 "writable" ( -- bool& ) poke ( bool, bool& -- ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) 147 ( -- uint16 ) call write_byte ( File¢, uint16 ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) lvar-4+6 "file" ( -- File& ) peek ( File& -- File¢ ) item+17 "parent" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_word ( File¢, uint32 ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) lvar-4+6 "file" ( -- File& ) peek ( File& -- File¢ ) item+27 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) call write_ranges ( File¢, Ranges¢ ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) 0 ( -- uint16 ) call write_byte ( File¢, uint16 ) 0 ( -- bool ) lvar-4+6 "file" ( -- File& ) peek ( File& -- File¢ ) item+29 "writable" ( -- bool& ) poke ( bool, bool& -- ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) retain ( File¢ -- File ) tor ( File -- ) call! kill ( File -- File ) dispose ( File -- ) fromr ( -- File ) jp ( -- ) -> L881 L891: call! kill ( File -- File ) dispose ( File -- ) jp ( -- ) -> L885 L890: lvar+4+2 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) item+21 "device" ( -- BlockDevice& ) peek ( BlockDevice& -- BlockDevice¢ ) 1 ( -- NodeType ) lvar+2+6 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) lvar+4+8 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call block0 ( File¢ -- uint32 ) 0 ( -- uint16 ) alloc ( uint16 -- Ranges ) dup2r ( Ranges -- Ranges¢ ) call new_file ( BlockDevice¢, NodeType, ucs1str¢, uint32, Ranges¢ -- File ) fromr ( -- Ranges ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) !! ( File¢ -- bool ) jp_z ( bool -- ) -> L893 1 ( -- bool ) lvar-4+6 "file" ( -- File& ) peek ( File& -- File¢ ) item+29 "writable" ( -- bool& ) poke ( bool, bool& -- ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) retain ( File¢ -- File ) tor ( File -- ) call! kill ( File -- File ) dispose ( File -- ) fromr ( -- File ) jp ( -- ) -> L881 L893: call! kill ( File -- File ) dispose ( File -- ) jp ( -- ) -> L885 L886: lvar+0+2 "filemode" ( -- FileMode& ) peek ( FileMode& -- FileMode ) cast ( FileMode -- uint8 ) 3 ( -- uint8 ) - ( uint8, uint8 -- uint16 ) 1 ( -- uint16 ) <= ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L895 13 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L881 L895: lvar+4+2 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-2+4 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) call newFileAtFpos ( File¢, NodeType -- File ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) !! ( File¢ -- bool ) jp_z ( bool -- ) -> L902 lvar+0+4 "filemode" ( -- FileMode& ) peek ( FileMode& -- FileMode ) cast ( FileMode -- uint8 ) 0 ( -- uint8 ) != ( uint8, uint8 -- bool ) lvar-4+6 "file" ( -- File& ) peek ( File& -- File¢ ) item+29 "writable" ( -- bool& ) poke ( bool, bool& -- ) lvar+0+4 "filemode" ( -- FileMode& ) peek ( FileMode& -- FileMode ) cast ( FileMode -- uint8 ) 1 ( -- uint8 ) == ( uint8, uint8 -- bool ) and0 ( bool -- ) -> L906 lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) call truncate ( File¢ -- bool ) L906: jp_z ( bool -- ) -> L904 NULL ( -- void* ) tor ( File -- ) call! kill ( File -- File ) dispose ( File -- ) fromr ( -- File ) jp ( -- ) -> L881 L904: lvar+4+4 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call block0 ( File¢ -- uint32 ) lvar-4+8 "file" ( -- File& ) peek ( File& -- File¢ ) item+17 "parent" ( -- uint32& ) poke ( uint32, uint32& -- ) lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) call is_dir ( FD¢ -- bool ) jp_z ( bool -- ) -> L907 lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) call rewind_directory ( File¢ -- bool ) jp_z ( bool -- ) -> L911 NULL ( -- void* ) tor ( File -- ) call! kill ( File -- File ) dispose ( File -- ) fromr ( -- File ) jp ( -- ) -> L881 L911: lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) call skip_direntry ( File¢ -- bool ) jp_nz ( bool -- ) -> L912 jp ( -- ) -> L911 L912: call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L913 NULL ( -- void* ) tor ( File -- ) call! kill ( File -- File ) dispose ( File -- ) fromr ( -- File ) jp ( -- ) -> L881 L913: lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) item+39 "fpos" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-4+8 "file" ( -- File& ) peek ( File& -- File¢ ) item+23 "fsize" ( -- uint32& ) poke ( uint32, uint32& -- ) jp ( -- ) -> L907 L907: lvar-4+4 "file" ( -- File& ) peek ( File& -- File¢ ) retain ( File¢ -- File ) tor ( File -- ) call! kill ( File -- File ) dispose ( File -- ) fromr ( -- File ) jp ( -- ) -> L881 L902: call! kill ( File -- File ) dispose ( File -- ) L885: NULL ( -- void* ) L881: tor ( File -- ) drop ( NodeType -- ) drop ( FileMode -- ) drop ( ucs1str¢ -- ) drop ( File¢ -- ) fromr ( -- File ) local scope ANON { local scope ANON { } local scope ANON { } } local scope ANON { } } bool rename ( File¢ dir, ucs1str¢ name, ucs1str¢ newname ) { var File¢ dir var ucs1str¢ name var ucs1str¢ newname 1 ( -- bool ) tor ( bool -- ) drop ( ucs1str¢ -- ) drop ( ucs1str¢ -- ) drop ( File¢ -- ) fromr ( -- bool ) } bool move ( File¢ dir, ucs1str¢ oldname, File¢ zdir, ucs1str¢ newname ) { var File¢ dir var ucs1str¢ oldname var File¢ zdir var ucs1str¢ newname 1 ( -- bool ) tor ( bool -- ) drop ( ucs1str¢ -- ) drop ( File¢ -- ) drop ( ucs1str¢ -- ) drop ( File¢ -- ) fromr ( -- bool ) } bool move ( File¢ dir, ucs1str¢ oldname, ucs1str¢ zdir ) { var File¢ dir var ucs1str¢ oldname var ucs1str¢ zdir 1 ( -- bool ) tor ( bool -- ) drop ( ucs1str¢ -- ) drop ( ucs1str¢ -- ) drop ( File¢ -- ) fromr ( -- bool ) } ucs1str fullpath ( File¢ ) { var File¢ ANON NULL ( -- void* ) tor ( ucs1str -- ) drop ( File¢ -- ) fromr ( -- ucs1str ) } uint16 read_byte ( File¢ fd ) { var File¢ fd call error ( -- OSErr ) !! ( OSErr -- bool ) jp_z ( bool -- ) -> L737 0 ( -- uint16 ) jp ( -- ) -> L738 L737: lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) jp_z ( bool -- ) -> L735 lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- uint16 ) 2 ( -- uint16 ) call read ( File¢, uint8[]¢, uint16, uint16 -- bool ) jp_z ( bool -- ) -> L733 0 ( -- uint16 ) jp ( -- ) -> L738 L733: gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) peek ( uint16& -- uint16 ) jp ( -- ) -> L738 L735: lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call getc ( File¢ -- ucs1char ) cast ( uint8 -- uint16 ) L738: tor ( uint16 -- ) drop ( File¢ -- ) fromr ( -- uint16 ) } uint32 read_word ( File¢ fd ) { var File¢ fd call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L741 0 ( -- uint32 ) jp ( -- ) -> L740 L741: 0 ( -- uint16 ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 1 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) poke ( uint16, uint16& -- ) lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- uint16 ) 2 ( -- uint16 ) lvar+0+8 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( uint16, int16 -- uint16 ) call read ( File¢, uint8[]¢, uint16, uint16 -- bool ) jp_z ( bool -- ) -> L743 0 ( -- uint32 ) jp ( -- ) -> L744 L743: gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) peek ( uint32& -- uint32 ) L744: L740: tor ( uint32 -- ) drop ( File¢ -- ) fromr ( -- uint32 ) } void write_byte ( File¢ fd, uint16 n ) { var File¢ fd var uint16 n call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L747 jp ( -- ) -> L746 L747: lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L750 lvar+0+0 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) poke ( uint16, uint16& -- ) lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- uint16 ) 2 ( -- uint16 ) call write ( File¢, uint8[]¢, uint16, uint16 -- bool ) drop ( bool -- ) jp ( -- ) -> L746 L750: lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- ucs1char ) call putc ( File¢, ucs1char ) L746: drop ( uint16 -- ) drop ( File¢ -- ) } void write_word ( File¢ fd, uint32 n ) { var File¢ fd var uint32 n call error ( -- OSErr ) cast ( OSErr -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L753 jp ( -- ) -> L752 L753: lvar+4+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L756 lvar+0+0 "n" ( -- uint32& ) peek ( uint32& -- uint32 ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) poke ( uint32, uint32& -- ) lvar+4+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- uint16 ) 4 ( -- uint16 ) call write ( File¢, uint8[]¢, uint16, uint16 -- bool ) drop ( bool -- ) jp ( -- ) -> L752 L756: lvar+0+0 "n" ( -- uint32& ) lo ( uint32& -- uint16& ) peek ( uint16& -- uint16 ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) poke ( uint16, uint16& -- ) lvar+4+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) gvar-2 "scratch" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- uint16 ) 2 ( -- uint16 ) call write ( File¢, uint8[]¢, uint16, uint16 -- bool ) drop ( bool -- ) L752: drop ( uint32 -- ) drop ( File¢ -- ) } void write_words ( File¢ fd, uint32 a, uint32 b ) { var File¢ fd var uint32 a var uint32 b lvar+8+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+4+2 "a" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_word ( File¢, uint32 ) lvar+8+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "b" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_word ( File¢, uint32 ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( File¢ -- ) } void skip_bytes ( File¢ fd, uint16 n ) { var File¢ fd var uint16 n call error ( -- OSErr ) cast ( OSErr -- uint8 ) 0 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L760 lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+2+4 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( uint16, int16 -- uint16 ) cast ( uint16 -- int32 ) call skip ( File¢, int32 -- bool ) drop ( bool -- ) jp ( -- ) -> L760 L760: drop ( uint16 -- ) drop ( File¢ -- ) } ucs1str read_name ( File¢ fd ) { var File¢ fd var uint16 n var ucs1str s var uint16 i lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) lvar-2+2 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) alloc ( uint16 -- ucs1str ) 0 ( -- uint16 ) L765: lvar-6+6 "i" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-2+8 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) < ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L766 lvar+0+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) cast ( uint16 -- ucs1char ) lvar-4+8 "s" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) lvar-6+10 "i" ( -- uint16& ) peekpp ( uint16& -- uint16 ) atindex ( ucs1str¢, int16 -- ucs1char& ) poke ( ucs1char, ucs1char& -- ) jp ( -- ) -> L765 L766: call error ( -- OSErr ) !! ( OSErr -- bool ) jp_z ( bool -- ) -> L767 NULL ( -- void* ) jp ( -- ) -> L768 L767: lvar-4+6 "s" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) L768: retain ( ucs1str¢ -- ucs1str ) tor ( ucs1str -- ) drop ( uint16 -- ) dispose ( ucs1str -- ) drop ( uint16 -- ) drop ( File¢ -- ) fromr ( -- ucs1str ) } void write_name ( File¢ fd, ucs1str¢ name ) { var File¢ fd var ucs1str¢ name var uint16 i 0 ( -- uint16 ) lvar+2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+4 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) count ( ucs1str¢ -- uint16 ) call write_byte ( File¢, uint16 ) L771: lvar-2+2 "i" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+0+4 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) count ( ucs1str¢ -- uint16 ) == ( uint16, uint16 -- bool ) jp_nz ( bool -- ) -> L770 lvar+2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+4 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) lvar-2+6 "i" ( -- uint16& ) peekpp ( uint16& -- uint16 ) atindex ( ucs1str¢, int16 -- ucs1char& ) peek ( ucs1char& -- ucs1char ) cast ( uint8 -- uint16 ) call write_byte ( File¢, uint16 ) jp ( -- ) -> L771 L770: drop ( uint16 -- ) drop ( ucs1str¢ -- ) drop ( File¢ -- ) } void skip_name ( File¢ fd ) { var File¢ fd lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) call skip_bytes ( File¢, uint16 ) drop ( File¢ -- ) } NodeType read_filetype ( File¢ fd ) { var File¢ fd var NodeType ft 0 ( -- NodeType ) L777: lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) cast ( uint16 -- NodeType ) lvar-2+4 "ft" ( -- NodeType& ) poke ( NodeType, NodeType& -- ) lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) 128 ( -- NodeType ) operator & ( NodeType, NodeType -- NodeType ) cast ( NodeType -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L778 lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-2+4 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 127 ( -- uint8 ) & ( uint8, uint8 -- uint8 ) cast ( uint8 -- uint16 ) call skip_bytes ( File¢, uint16 ) jp ( -- ) -> L777 L778: lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- int16 ) switch ( int16 -- ) { 0:L779, 1:L779, 2:L779, dflt:L780, join:L779 } L780: 17 ( -- OSErr ) call set_error ( OSErr ) 0 ( -- NodeType ) jp ( -- ) -> L776 L779: lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) L776: tor ( NodeType -- ) drop ( NodeType -- ) drop ( File¢ -- ) fromr ( -- NodeType ) } void read_range_at ( File¢ fd, uint16 fpos, uint32& a, uint32& n ) { var File¢ fd var uint16 fpos var uint32& a var uint32& n call error ( -- OSErr ) ! ( OSErr -- bool ) jp_z ( bool -- ) -> L786 lvar+6+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+4+2 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) call setfpos ( File¢, uint32 -- bool ) drop ( bool -- ) jp ( -- ) -> L786 L786: lvar+6+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar+2+4 "a" ( -- uint32&& ) peek ( uint32&& -- uint32& ) poke ( uint32, uint32& -- ) lvar+6+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar+0+4 "n" ( -- uint32&& ) peek ( uint32&& -- uint32& ) poke ( uint32, uint32& -- ) drop ( uint32& -- ) drop ( uint32& -- ) drop ( uint16 -- ) drop ( File¢ -- ) } void write_range_at ( File¢ fd, uint16 fpos, uint32 a, uint32 n ) { var File¢ fd var uint16 fpos var uint32 a var uint32 n call error ( -- OSErr ) ! ( OSErr -- bool ) jp_z ( bool -- ) -> L790 lvar+10+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+8+2 "fpos" ( -- uint16& ) peek ( uint16& -- uint16 ) cast ( uint16 -- uint32 ) call setfpos ( File¢, uint32 -- bool ) drop ( bool -- ) jp ( -- ) -> L790 L790: lvar+10+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+4+2 "a" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+6 "n" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_words ( File¢, uint32, uint32 ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( uint16 -- ) drop ( File¢ -- ) } void skip_ranges ( File¢ fd ) { var File¢ fd lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) 2 ( -- int16 ) << ( uint16, int16 -- uint16 ) call skip_bytes ( File¢, uint16 ) drop ( File¢ -- ) } void skip_ranges ( File¢ fd, NodeType ft ) { var File¢ fd var NodeType ft lvar+0+0 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 2 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L797 lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) 2 ( -- uint16 ) call skip_bytes ( File¢, uint16 ) jp ( -- ) -> L795 L797: lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call skip_ranges ( File¢ ) L795: drop ( NodeType -- ) drop ( File¢ -- ) } void write_ranges ( File¢ fd, Ranges¢ ranges ) { var File¢ fd var Ranges¢ ranges var uint16 i 0 ( -- uint16 ) lvar+2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+4 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) count ( Ranges¢ -- uint16 ) call write_byte ( File¢, uint16 ) L800: lvar-2+2 "i" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+0+4 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) count ( Ranges¢ -- uint16 ) == ( uint16, uint16 -- bool ) jp_nz ( bool -- ) -> L799 lvar+2+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+4 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) lvar-2+6 "i" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( Ranges¢, int16 -- Range& ) peek ( Range& -- Range¢ ) item+0 "start" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+0+8 "ranges" ( -- Ranges¢& ) peek ( Ranges¢& -- Ranges¢ ) lvar-2+10 "i" ( -- uint16& ) peekpp ( uint16& -- uint16 ) atindex ( Ranges¢, int16 -- Range& ) peek ( Range& -- Range¢ ) item+4 "count" ( -- uint32& ) peek ( uint32& -- uint32 ) call write_words ( File¢, uint32, uint32 ) jp ( -- ) -> L800 L799: drop ( uint16 -- ) drop ( Ranges¢ -- ) drop ( File¢ -- ) } Ranges read_ranges ( File¢ fd, bool dir ) { var File¢ fd var bool dir var uint16 n var Ranges ranges var uint16 i lvar+2+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_byte ( File¢ -- uint16 ) lvar-2+2 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) 0 ( -- uint16 ) == ( uint16, uint16 -- bool ) and0 ( bool -- ) -> L806 lvar+0+2 "dir" ( -- bool& ) peek ( bool& -- bool ) L806: jp_z ( bool -- ) -> L804 17 ( -- OSErr ) call null_with_error ( OSErr -- void* ) jp ( -- ) -> L803 L804: lvar-2+2 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) 2 ( -- uint16 ) * ( uint16, uint16 -- uint16 ) alloc ( uint16 -- Ranges ) 0 ( -- uint16 ) L807: lvar-6+6 "i" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-2+8 "n" ( -- uint16& ) peek ( uint16& -- uint16 ) < ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L808 8 ( -- uint16 ) alloc ( uint16 -- Range ) lvar-4+8 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) lvar-6+10 "i" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( Ranges¢, int16 -- Range& ) poke ( Range, Range& -- ) lvar+2+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar-4+10 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) lvar-6+12 "i" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( Ranges¢, int16 -- Range& ) peek ( Range& -- Range¢ ) item+0 "start" ( -- uint32& ) poke ( uint32, uint32& -- ) lvar+2+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_word ( File¢ -- uint32 ) lvar-4+10 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) lvar-6+12 "i" ( -- uint16& ) peekpp ( uint16& -- uint16 ) atindex ( Ranges¢, int16 -- Range& ) peek ( Range& -- Range¢ ) item+4 "count" ( -- uint32& ) poke ( uint32, uint32& -- ) lvar+0+6 "dir" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) !! ( uint8 -- bool ) jp_z ( bool -- ) -> L807 0 ( -- bool ) lvar+0+8 "dir" ( -- bool& ) poke ( bool, bool& -- ) lvar+2+6 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call block0 ( File¢ -- uint32 ) lvar-4+10 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) 0 ( -- int16 ) atindex ( Ranges¢, int16 -- Range& ) peek ( Range& -- Range¢ ) item+0 "start" ( -- uint32& ) peek ( uint32& -- uint32 ) != ( uint32, uint32 -- bool ) jp_z ( bool -- ) -> L812 17 ( -- OSErr ) call null_with_error ( OSErr -- void* ) tor ( Ranges -- ) drop ( uint16 -- ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) fromr ( -- Ranges ) jp ( -- ) -> L803 L812: lvar-4+6 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) retain ( Ranges¢ -- Ranges ) lvar+2+8 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) item+27 "ranges" ( -- Ranges& ) swapwithvar ( Ranges, Ranges& -- Ranges ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) jp ( -- ) -> L807 L808: lvar-4+6 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) retain ( Ranges¢ -- Ranges ) tor ( Ranges -- ) drop ( uint16 -- ) call! kill ( Ranges -- Ranges ) dispose ( Ranges -- ) fromr ( -- Ranges ) jp ( -- ) -> L803 L803: tor ( Ranges -- ) drop ( uint16 -- ) drop ( bool -- ) drop ( File¢ -- ) fromr ( -- Ranges ) } void write_direntry ( File¢ dir, File¢ file ) { var File¢ dir var File¢ file lvar+2+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "file" ( -- File¢& ) peek ( File¢& -- File¢ ) item+23 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar+2+6 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) jp_z ( bool -- ) -> L818 gvar "systemtime" ( -- uint32& ) peek ( uint32& -- uint32 ) jp ( -- ) -> L819 L818: gvar "systemtime" ( -- uint32& ) peek ( uint32& -- uint32 ) 86400 ( -- uint32 ) / ( uint32, uint32 -- uint32 ) L819: call write_words ( File¢, uint32, uint32 ) lvar+2+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "file" ( -- File¢& ) peek ( File¢& -- File¢ ) item+3 "name" ( -- ucs1str& ) peek ( ucs1str& -- ucs1str¢ ) call write_name ( File¢, ucs1str¢ ) lvar+0+0 "file" ( -- File¢& ) peek ( File¢& -- File¢ ) item+2 "nodetype" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 2 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L821 lvar+2+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "file" ( -- File¢& ) peek ( File¢& -- File¢ ) call block0 ( File¢ -- uint32 ) call write_word ( File¢, uint32 ) jp ( -- ) -> L817 L821: lvar+2+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar+0+2 "file" ( -- File¢& ) peek ( File¢& -- File¢ ) item+27 "ranges" ( -- Ranges& ) peek ( Ranges& -- Ranges¢ ) call write_ranges ( File¢, Ranges¢ ) L817: drop ( File¢ -- ) drop ( File¢ -- ) } bool skip_direntry ( File¢ fd ) { var File¢ fd var NodeType ft lvar+0+0 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call read_filetype ( File¢ -- NodeType ) lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 0 ( -- uint8 ) == ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L858 1 ( -- bool ) jp ( -- ) -> L857 L858: lvar-2+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) cast ( NodeType -- uint8 ) 2 ( -- uint8 ) != ( uint8, uint8 -- bool ) jp_z ( bool -- ) -> L860 lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) 4 ( -- uint16 ) call skip_bytes ( File¢, uint16 ) jp ( -- ) -> L860 L860: lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) call skip_name ( File¢ ) lvar+0+2 "fd" ( -- File¢& ) peek ( File¢& -- File¢ ) lvar-2+4 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) call skip_ranges ( File¢, NodeType ) call error ( -- OSErr ) cast ( OSErr -- uint8 ) 0 ( -- uint8 ) != ( uint8, uint8 -- bool ) L857: tor ( bool -- ) drop ( NodeType -- ) drop ( File¢ -- ) fromr ( -- bool ) } bool seek_dir_endmarker ( File¢ dir ) { var File¢ dir lvar+0+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call rewind_directory ( File¢ -- bool ) jp_z ( bool -- ) -> L866 1 ( -- bool ) jp ( -- ) -> L863 L866: lvar+0+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) call skip_direntry ( File¢ -- bool ) jp_nz ( bool -- ) -> L867 jp ( -- ) -> L866 L867: call error ( -- OSErr ) !! ( OSErr -- bool ) or1 ( bool -- ) -> L868 lvar+0+0 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) -1 ( -- int16 ) lvar+0+4 "dir" ( -- File¢& ) peek ( File¢& -- File¢ ) item+14 "wide" ( -- bool& ) peek ( bool& -- bool ) cast ( bool -- uint8 ) cast ( uint8 -- int16 ) << ( int16, int16 -- int16 ) cast ( int16 -- int32 ) call skip ( File¢, int32 -- bool ) L868: L863: tor ( bool -- ) drop ( File¢ -- ) fromr ( -- bool ) } File newFileAtFpos ( File¢ dir ) { var File¢ dir call TODO () NULL ( -- void* ) tor ( File -- ) drop ( File¢ -- ) fromr ( -- File ) } type Ranges: FileInfo new ( NodeType ft, uint32 fsize, uint32 mdate, ucs1str¢ name ) { var NodeType ft var uint32 fsize var uint32 mdate var ucs1str¢ name var FileInfo this 11 ( -- uint16 ) alloc ( uint16 -- FileInfo ) lvar+10+2 "ft" ( -- NodeType& ) peek ( NodeType& -- NodeType ) lvar-2+4 "this" ( -- FileInfo& ) peek ( FileInfo& -- FileInfo¢ ) item+0 "filetype" ( -- NodeType& ) poke ( NodeType, NodeType& -- ) lvar+6+2 "fsize" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+6 "this" ( -- FileInfo& ) peek ( FileInfo& -- FileInfo¢ ) item+1 "fsize" ( -- uint32& ) poke ( uint32, uint32& -- ) lvar+2+2 "mdate" ( -- uint32& ) peek ( uint32& -- uint32 ) lvar-2+6 "this" ( -- FileInfo& ) peek ( FileInfo& -- FileInfo¢ ) item+5 "mdate" ( -- uint32& ) poke ( uint32, uint32& -- ) lvar+0+2 "name" ( -- ucs1str¢& ) peek ( ucs1str¢& -- ucs1str¢ ) retain ( ucs1str¢ -- ucs1str ) lvar-2+4 "this" ( -- FileInfo& ) peek ( FileInfo& -- FileInfo¢ ) item+9 "name" ( -- ucs1str& ) poke ( ucs1str, ucs1str& -- ) lvar-2+2 "this" ( -- FileInfo& ) peek ( FileInfo& -- FileInfo¢ ) retain ( FileInfo¢ -- FileInfo ) tor ( FileInfo -- ) call! kill ( FileInfo -- FileInfo ) dispose ( FileInfo -- ) drop ( ucs1str¢ -- ) drop ( uint32 -- ) drop ( uint32 -- ) drop ( NodeType -- ) fromr ( -- FileInfo ) } void shrink ( uint8[]¢ this, uint16 new_max ) { var uint8[]¢ this var uint16 new_max var uint16 this_count local scope ANON var uint8[] that lvar+2+0 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) count ( uint8[]¢ -- uint16 ) lvar-2+2 "this_count" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+0+4 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) <= ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L708 jp ( -- ) -> L707 L708: lvar+2+2 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) lvar-2+4 "this_count" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( uint8[]¢, int16 -- uint8& ) gvar "heap_end" ( -- uint8*& ) peek ( uint8*& -- uint8* ) == ( uint8*, uint8* -- bool ) jp_z ( bool -- ) -> L711 lvar+2+2 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) lvar+0+4 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( uint8[]¢, int16 -- uint8& ) lvar-2+4 "this_count" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+0+6 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) - ( uint16, uint16 -- uint16 ) call memclr ( void*, uint16 ) lvar+2+2 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) lvar+0+4 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( uint8[]¢, int16 -- uint8& ) gvar "heap_end" ( -- uint8*& ) poke ( uint8*, uint8*& -- ) jp ( -- ) -> L710 L711: lvar+0+2 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar-2+4 "this_count" ( -- uint16& ) peek ( uint16& -- uint16 ) 1 ( -- uint16 ) - ( uint16, uint16 -- uint16 ) == ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L713 lvar+0+2 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) alloc ( uint16 -- uint8[] ) lvar-4+4 "that" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) lvar+2+6 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) lvar+0+8 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) call memcpy ( void*, void*, uint16 ) lvar+2+4 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) lvar-4+6 "that" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) swap ( int8*&, int8*& -- ) dispose ( uint8[] -- ) jp ( -- ) -> L707 L713: lvar-2+2 "this_count" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+0+4 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) - ( uint16, uint16 -- uint16 ) 2 ( -- uint16 ) - ( uint16, uint16 -- uint16 ) lvar+2+4 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) lvar+0+6 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( uint8[]¢, int16 -- uint8& ) poke ( uint16, uint16& -- ) L710: lvar+0+2 "new_max" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+2+4 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) -2 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) poke ( uint16, uint16& -- ) L707: drop ( uint16 -- ) drop ( uint16 -- ) drop ( uint8[]¢ -- ) local scope ANON { } } void grow ( uint8[]¢ this, uint16 new_size ) { var uint8[]¢ this var uint16 new_size var uint16 old_size local scope ANON var uint8[] that var uint8* new_end lvar+2+0 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) count ( uint8[]¢ -- uint16 ) lvar-2+2 "old_size" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+0+4 "new_size" ( -- uint16& ) peek ( uint16& -- uint16 ) >= ( uint16, uint16 -- bool ) jp_z ( bool -- ) -> L715 jp ( -- ) -> L714 L715: lvar+2+2 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) lvar-2+4 "old_size" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( uint8[]¢, int16 -- uint8& ) gvar "heap_end" ( -- uint8*& ) peek ( uint8*& -- uint8* ) != ( uint8*, uint8* -- bool ) jp_z ( bool -- ) -> L717 lvar-2+2 "old_size" ( -- uint16& ) peek ( uint16& -- uint16 ) alloc ( uint16 -- uint8[] ) lvar-4+4 "that" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) lvar+2+6 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) 0 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) lvar-2+8 "old_size" ( -- uint16& ) peek ( uint16& -- uint16 ) call memcpy ( void*, void*, uint16 ) lvar+2+4 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) lvar-4+6 "that" ( -- uint8[]& ) peek ( uint8[]& -- uint8[]¢ ) swap ( int8*&, int8*& -- ) dispose ( uint8[] -- ) jp ( -- ) -> L717 L717: lvar+2+2 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) lvar+0+4 "new_size" ( -- uint16& ) peek ( uint16& -- uint16 ) atindex ( uint8[]¢, int16 -- uint8& ) lvar-4+4 "new_end" ( -- uint8*& ) peek ( uint8*& -- uint8* ) gvar "handles_start" ( -- uint8*& ) peek ( uint8*& -- uint8* ) > ( uint8*, uint8* -- bool ) jp_z ( bool -- ) -> L719 call MEM_COMPACT () lvar-4+4 "new_end" ( -- uint8*& ) peek ( uint8*& -- uint8* ) gvar "handles_start" ( -- uint8*& ) peek ( uint8*& -- uint8* ) > ( uint8*, uint8* -- bool ) jp_z ( bool -- ) -> L719 extern const uint8 ERROR_OUT_OF_MEMORY call panic ( uint8 ) jp ( -- ) -> L719 L719: lvar-4+4 "new_end" ( -- uint8*& ) peek ( uint8*& -- uint8* ) gvar "heap_end" ( -- uint8*& ) poke ( uint8*, uint8*& -- ) lvar+0+4 "new_size" ( -- uint16& ) peek ( uint16& -- uint16 ) lvar+2+6 "this" ( -- uint8[]¢& ) peek ( uint8[]¢& -- uint8[]¢ ) -2 ( -- int16 ) atindex ( uint8[]¢, int16 -- uint8& ) poke ( uint16, uint16& -- ) drop ( uint8* -- ) L714: drop ( uint16 -- ) drop ( uint16 -- ) drop ( uint8[]¢ -- ) local scope ANON { } } bool yes_with_cond_error ( OSErr e ) { var OSErr e call error ( -- OSErr ) !! ( OSErr -- bool ) or1 ( bool -- ) -> L725 lvar+0+0 "e" ( -- OSErr& ) peek ( OSErr& -- OSErr ) call yes_with_error ( OSErr -- bool ) L725: tor ( bool -- ) drop ( OSErr -- ) fromr ( -- bool ) } } 4 ( -- uint16 ) alloc ( uint16 -- uint8[4] ) gsinit "scratch"