2 * IDOS Timetable Extractor
4 * (c) 2013 Tomas Pokorny <jethro@kam.mff.cuni.cz>
6 * This software can be freely distributed and used according
7 * to the terms of the GNU General Public License.
21 void print_strings(uint32_t offset
)
23 fseek(in
,offset
,SEEK_SET
);
26 fread(&count
,1,sizeof(count
),in
);
27 printf("Will read %d strings\n",count
);
30 indexes
= malloc(sizeof(int32_t)*(count
+1));
33 for (int i
=0;i
<=count
;i
++){
34 fread(indexes
+i
,1,sizeof(int32_t),in
);
39 for (int i
=0;i
<count
;i
++){
40 fread(buf
,indexes
[i
+1]-indexes
[i
],1,in
);
41 for (int j
=0; j
<indexes
[i
+1]-indexes
[i
];j
++)
48 int main(int argc
, char * argv
[])
50 in
= fopen(argv
[1], "r");
64 /* fclose(fopen("data/strings.dat","w"));
65 fclose(fopen("data/stations.dat","w"));
67 fseek(in,next,SEEK_SET);
68 printf("Reading header\n");
69 fread(&len,1,sizeof(count),in);
70 fread(&blocks,1,sizeof(blocks),in);
71 int_count = malloc(blocks);
72 for (int i=0;i<blocks;i++)
74 printf("Len: %d, blocks: %d\n",len,blocks);
77 printf("Skipping, header had changed.\n");
83 for (int i=blocks;i>0;i--){
84 fread(buf,1,rec_len,in);
85 for (int j=0;j<rec_len;j++)
95 printf("At: %x\n",ftell(in
));
100 printf("At: %x\n",ftell(in
));
105 printf("At: %x\n",ftell(in
));
107 //Bezbariérové stanice
110 printf("At: %x\n",ftell(in
));
115 printf("At: %x\n",ftell(in
));
119 printf("At: %x\n",ftell(in
));