static int zipnum;
+static void write_countrydir(int phase, int maxnamelen);
+
static void
write_tilesdir(int phase, int maxlen, FILE *out)
{
GList *tiles_list,*next;
char **data;
struct tile_head *th,**last=NULL;
+ zipnum=0;
tiles_list=get_tiles_list();
if (phase == 3)
#if 0
fprintf(stderr,"PROGRESS: collecting tiles with len=%d\n", len);
#endif
+#ifdef GENERATE_INDEX
+ if (! len)
+ write_countrydir(phase, maxlen);
+#endif
next=g_list_first(tiles_list);
while (next) {
if (strlen(next->data) == len) {
*last=th;
last=&th->next;
th->next=NULL;
- th->zipnum=zipnum++;
+ th->zipnum=zipnum;
fprintf(out,"%s:%d",(char *)next->data,th->total_size);
for ( idx = 0; idx< th->num_subtiles; idx++ ){
}
if (th->name[0])
index_submap_add(phase, th, &tiles_list);
+ zipnum++;
processed_tiles++;
}
next=g_list_next(next);
if (phase == 3)
tile_extend(index_tile, (struct item_bin *)&ii, NULL);
- else
+ else
write_item(index_tile, (struct item_bin *)&ii);
}
merge_tiles();
sig_alrm(0);
alarm(0);
- zipnum=0;
write_tilesdir(phase, maxnamelen, tilesdir_out);
-#ifdef GENERATE_INDEX
- write_countrydir(phase, maxnamelen);
-#endif
return 0;
th=tile_head_root;
while (th) {
if (th->process) {
+ if (! strlen(th->name))
+ zipfiles+=write_aux_tiles(out, dir_out, compression_level, maxnamelen);
if (th->total_size != th->total_size_used) {
fprintf(stderr,"Size error '%s': %d vs %d\n", th->name, th->total_size, th->total_size_used);
exit(1);
if (strlen(th->name))
write_zipmember(out, dir_out, th->name, maxnamelen, th->zip_data, th->total_size, compression_level);
else {
-#ifdef GENERATE_INDEX
- zipfiles+=write_aux_tiles(out, dir_out, compression_level, maxnamelen);
-#endif
write_zipmember(out, dir_out, "index", sizeof("index")-1, th->zip_data, th->total_size, compression_level);
}
zipfiles++;