Exemplo n.º 1
0
static int
zipfile_to_tile(struct file *f, struct zip_cd *cd, struct tile *t)
{
	char buffer[1024];
	struct zip_lfh *lfh;
	char *zipfn;
	dbg(1,"enter %p %p %p\n", f, cd, t);
	dbg(1,"cd->zipofst=0x%x\n", cd->zipofst);
	t->start=NULL;
	lfh=binfile_read_lfh(f, cd->zipofst);
	zipfn=(char *)(file_data_read(f,cd->zipofst+sizeof(struct zip_lfh), lfh->zipfnln));
	strncpy(buffer, zipfn, lfh->zipfnln);
	buffer[lfh->zipfnln]='\0';
	t->start=(int *)binfile_read_content(f, cd->zipofst, lfh);
	t->end=t->start+lfh->zipuncmp/4;
	dbg(1,"0x%x '%s' %d %d,%d\n", lfh->ziplocsig, buffer, sizeof(*cd)+cd->zipcfnl, lfh->zipsize, lfh->zipuncmp);
	file_data_free(f, (unsigned char *)zipfn);
	file_data_free(f, (unsigned char *)lfh);
	return t->start != NULL;
}
Exemplo n.º 2
0
Arquivo: file.c Projeto: albertz/navit
unsigned char *
file_data_read_all(struct file *file)
{
	return file_data_read(file, 0, file->size);
}