lib/mapi/pst.rb
def load_idx_rec offset, linku1, start_val
		@idx_offsets << offset

		#_pst_read_block_size(pf, offset, BLOCK_SIZE, &buf, 0, 0) < BLOCK_SIZE)
		buf = pst_read_block_size offset, Index::BLOCK_SIZE, false

		item_count = buf[ITEM_COUNT_OFFSET]
		raise "have too many active items in index (#{item_count})" if item_count > Index::COUNT_MAX

		idx = Index.new buf[BACKLINK_OFFSET, Index::SIZE]
		raise 'blah 1' unless idx.id == linku1

		if buf[LEVEL_INDICATOR_OFFSET] == 0
			# leaf pointers
			# split the data into item_count index objects
			buf[0, Index::SIZE * item_count].scan(/.{#{Index::SIZE}}/mo).each_with_index do |data, i|
				idx = Index.new data
				# first entry
				raise 'blah 3' if i == 0 and start_val != 0 and idx.id != start_val
				idx.pst = self
				# this shouldn't really happen i'd imagine
				break if idx.id == 0
				@idx << idx
			end
		else
			# node pointers
			# split the data into item_count table pointers
			buf[0, TablePtr::SIZE * item_count].scan(/.{#{TablePtr::SIZE}}/mo).each_with_index do |data, i|
				table = TablePtr.new data
				# for the first value, we expect the start to be equal
				raise 'blah 3' if i == 0 and start_val != 0 and table.start != start_val
				# this shouldn't really happen i'd imagine
				break if table.start == 0
				load_idx_rec table.offset, table.u1, table.start
			end
		end
	end
# load the flat idx table, which maps ids to file ranges. this is the recursive helper
#
# corresponds to
# * _pst_build_id_ptr
load the flat idx table, which maps ids to file ranges. this is the recursive helper
corresponds to
_pst_build_id_ptr
load the flat idx table which maps ids to file ranges . this is the recursive helper corresponds to _pst_build_id_ptr
def load_idx_rec offset, linku1, start_val
		@idx_offsets << offset
		buf = pst_read_block_size offset, Index::BLOCK_SIZE, false
		item_count = buf[ITEM_COUNT_OFFSET]
		raise "have too many active items in index (#{item_count})" if item_count > Index::COUNT_MAX
		idx = Index.new buf[BACKLINK_OFFSET, Index::SIZE]
		raise 'blah 1' unless idx.id == linku1
		if buf[LEVEL_INDICATOR_OFFSET] == 0
			buf[0, Index::SIZE * item_count].scan(/.{#{Index::SIZE}}/mo).each_with_index do |data, i|
				idx = Index.new data
				raise 'blah 3' if i == 0 and start_val != 0 and idx.id != start_val
				idx.pst = self
				break if idx.id == 0
				@idx << idx
			end
		else
			buf[0, TablePtr::SIZE * item_count].scan(/.{#{TablePtr::SIZE}}/mo).each_with_index do |data, i|
				table = TablePtr.new data
				raise 'blah 3' if i == 0 and start_val != 0 and table.start != start_val
				break if table.start == 0
				load_idx_rec table.offset, table.u1, table.start
			end
		end
	end
def load_idx_rec offset , linku1 , start_val @idx_offsets << offset buf = pst_read_block_size offset , Index :: BLOCK_SIZE , false item_count = buf [ ITEM_COUNT_OFFSET ] raise "have too many active items in index (#{item_count})" if item_count > Index :: COUNT_MAX idx = Index . new buf [ BACKLINK_OFFSET , Index :: SIZE ] raise 'blah 1' unless idx . id == linku1 if buf [ LEVEL_INDICATOR_OFFSET ] == 0 buf [ 0 , Index :: SIZE * item_count ] . scan ( / .{ #{ Index :: SIZE } } /mo ) . each_with_index do | data , i | idx = Index . new data raise 'blah 3' if i == 0 and start_val != 0 and idx . id != start_val idx . pst = self break if idx . id == 0 @idx << idx end else buf [ 0 , TablePtr :: SIZE * item_count ] . scan ( / .{ #{ TablePtr :: SIZE } } /mo ) . each_with_index do | data , i | table = TablePtr . new data raise 'blah 3' if i == 0 and start_val != 0 and table . start != start_val break if table . start == 0 load_idx_rec table . offset , table . u1 , table . start end end end
load the flat idx table, which maps ids to file ranges.
load the flat idx table which maps ids to file ranges .
#_pst_read_block_size(pf, offset, BLOCK_SIZE, &buf, 0, 0) < BLOCK_SIZE) # leaf pointers # split the data into item_count index objects # first entry # this shouldn't really happen i'd imagine # node pointers # split the data into item_count table pointers # for the first value, we expect the start to be equal # this shouldn't really happen i'd imagine
offset
linku1
start_val