Beispiel #1
0
void far seek_prev_4()  /*sets ptr_rw_sub1_0 to position of previous op code 4*/
			/*in rewrite a sub code, without changing the */
			/*open_segment FILE pointer's position at all*/
{
long save_file_ptr,backwards_ptr;


	backwards_ptr = save_file_ptr = my_ftell();
	quit_segment = 'f';
	
	get_our_value(8,8);

	while((read_element.op_code != 4) && (quit_segment == 'f'))
	{
		backwards_ptr -= 1L;
		if(megatek_seek(which_cseg,backwards_ptr) == FAILURE)
			quit_segment = 't';

		get_our_value(9,2);
	}

	ptr_rw_sub1_0 = backwards_ptr;
	megatek_seek(which_cseg,save_file_ptr);
	quit_segment = 'f';
}
Beispiel #2
0
// ********************************************************************************************
bool BitStream::OpenRA(const char *file_name)
{
	if (file)
		fclose(file);
	if ((file = my_fopen(file_name, "rb")) != NULL)
		mode = FILE_MODE_READ_RA;

	IO_BUFFER_SIZE = BitStream::DEFAULT_IO_BUFFER_SIZE_RA;
	io_buffer = new uchar[IO_BUFFER_SIZE];
	io_buffer_size = IO_BUFFER_SIZE;

	word_buffer_size = 8;
	io_buffer_pos = IO_BUFFER_SIZE;
	file_pos = 0;

	if (mode == FILE_MODE_READ_RA)
	{
		my_fseek(file, 0, SEEK_END);
		file_size = my_ftell(file);

		my_fseek(file, 0, SEEK_SET);
	} 
	
	return mode == FILE_MODE_READ_RA;
}