[258] | 1 | //////////////////////////////////////////////////////////////////////////// |
---|
| 2 | // File : xml_driver.c |
---|
| 3 | // Date : 04/04/2012 |
---|
| 4 | // Author : alain greiner |
---|
| 5 | // Copyright (c) UPMC-LIP6 |
---|
| 6 | //////////////////////////////////////////////////////////////////////////// |
---|
| 7 | // This program translate a binary file containing a MAPPING_INFO |
---|
| 8 | // data structure to an xml file. |
---|
| 9 | //////////////////////////////////////////////////////////////////////////// |
---|
| 10 | |
---|
| 11 | #include <stdlib.h> |
---|
| 12 | #include <fcntl.h> |
---|
| 13 | #include <unistd.h> |
---|
| 14 | #include <stdio.h> |
---|
| 15 | #include <string.h> |
---|
| 16 | #include <stdint.h> |
---|
| 17 | #include <mapping_info.h> |
---|
| 18 | |
---|
| 19 | ////////////////////////////////////////////////////// |
---|
[295] | 20 | void buildXml(mapping_header_t * header, FILE * fpout) |
---|
| 21 | { |
---|
| 22 | // mnemonics defined in mapping_info.h |
---|
[511] | 23 | const char * vseg_type[] = |
---|
[258] | 24 | { |
---|
[548] | 25 | "ELF", // From a .elf file |
---|
| 26 | "BLOB", // Raw Binary |
---|
| 27 | "PTAB", // Page Table |
---|
| 28 | "PERI", // Hardware Component |
---|
| 29 | "BUFFER", // No intialisation needed (stacks...) |
---|
[258] | 30 | "SCHED", // Scheduler |
---|
[472] | 31 | "HEAP", // Heap |
---|
[258] | 32 | }; |
---|
| 33 | |
---|
[295] | 34 | // mnemonics defined in mapping_info.h |
---|
[258] | 35 | const char * pseg_type[] = |
---|
| 36 | { |
---|
| 37 | "RAM", |
---|
| 38 | "PERI", |
---|
| 39 | }; |
---|
| 40 | |
---|
[295] | 41 | // mnemonics defined in mapping_info.h |
---|
[258] | 42 | const char * irq_type[] = |
---|
| 43 | { |
---|
[295] | 44 | "HWI", |
---|
| 45 | "WTI", |
---|
| 46 | "PTI", |
---|
[258] | 47 | }; |
---|
| 48 | |
---|
[522] | 49 | // These mnemonics must be consistent with values in |
---|
| 50 | // irq_handler.h / irq_handler.c / mapping.py |
---|
[258] | 51 | const char * isr_type[] = |
---|
| 52 | { |
---|
[295] | 53 | "ISR_DEFAULT", |
---|
| 54 | "ISR_TICK", |
---|
| 55 | "ISR_TTY_RX", |
---|
| 56 | "ISR_TTY_TX", |
---|
| 57 | "ISR_BDV", |
---|
[258] | 58 | "ISR_TIMER", |
---|
[295] | 59 | "ISR_WAKUP", |
---|
| 60 | "ISR_NIC_RX", |
---|
| 61 | "ISR_NIC_TX", |
---|
| 62 | "ISR_CMA", |
---|
[323] | 63 | "ISR_MMC", |
---|
| 64 | "ISR_DMA", |
---|
[548] | 65 | "ISR_SDC", |
---|
[522] | 66 | "ISR_MWR", |
---|
[531] | 67 | "ISR_HBA", |
---|
[258] | 68 | }; |
---|
| 69 | |
---|
[522] | 70 | const char * mwr_subtype[] = |
---|
| 71 | { |
---|
| 72 | "GCD", |
---|
| 73 | "DCT", |
---|
[559] | 74 | "CPY", |
---|
[522] | 75 | }; |
---|
| 76 | |
---|
[258] | 77 | const char * periph_type[] = |
---|
| 78 | { |
---|
| 79 | "CMA", |
---|
| 80 | "DMA", |
---|
| 81 | "FBF", |
---|
| 82 | "IOB", |
---|
| 83 | "IOC", |
---|
| 84 | "MMC", |
---|
| 85 | "MWR", |
---|
| 86 | "NIC", |
---|
| 87 | "ROM", |
---|
| 88 | "SIM", |
---|
| 89 | "TIM", |
---|
| 90 | "TTY", |
---|
| 91 | "XCU", |
---|
[295] | 92 | "PIC", |
---|
[491] | 93 | "DROM", |
---|
[258] | 94 | }; |
---|
| 95 | |
---|
[295] | 96 | const char * ioc_subtype[] = |
---|
[289] | 97 | { |
---|
| 98 | "BDV", |
---|
| 99 | "HBA", |
---|
[548] | 100 | "SDC", |
---|
[567] | 101 | "SPI", |
---|
[289] | 102 | }; |
---|
| 103 | |
---|
[258] | 104 | const char * mode_str[] = |
---|
| 105 | { |
---|
| 106 | "____", |
---|
| 107 | "___U", |
---|
| 108 | "__W_", |
---|
| 109 | "__WU", |
---|
| 110 | "_X__", |
---|
| 111 | "_X_U", |
---|
| 112 | "_XW_", |
---|
| 113 | "_XWU", |
---|
| 114 | "C___", |
---|
| 115 | "C__U", |
---|
| 116 | "C_W_", |
---|
| 117 | "C_WU", |
---|
| 118 | "CX__", |
---|
| 119 | "CX_U", |
---|
| 120 | "CXW_", |
---|
| 121 | "CXWU", |
---|
| 122 | }; |
---|
| 123 | |
---|
| 124 | unsigned int vspace_id; |
---|
| 125 | unsigned int cluster_id; |
---|
| 126 | unsigned int pseg_id; |
---|
| 127 | unsigned int vseg_id; |
---|
| 128 | unsigned int task_id; |
---|
| 129 | unsigned int proc_id; |
---|
| 130 | unsigned int irq_id; |
---|
| 131 | unsigned int periph_id; |
---|
| 132 | |
---|
| 133 | mapping_cluster_t * cluster; |
---|
| 134 | mapping_pseg_t * pseg; |
---|
| 135 | mapping_vspace_t * vspace; |
---|
| 136 | mapping_vseg_t * vseg; |
---|
| 137 | mapping_task_t * task; |
---|
| 138 | mapping_irq_t * irq; |
---|
| 139 | mapping_periph_t * periph; |
---|
| 140 | |
---|
| 141 | // computes the base adresss for clusters array, |
---|
| 142 | cluster = (mapping_cluster_t *)((char *) header + |
---|
| 143 | MAPPING_HEADER_SIZE); |
---|
| 144 | |
---|
| 145 | // computes the base adresss for psegs array, |
---|
| 146 | pseg = (mapping_pseg_t *) ((char *) header + |
---|
| 147 | MAPPING_HEADER_SIZE + |
---|
[263] | 148 | MAPPING_CLUSTER_SIZE * header->x_size * header->y_size); |
---|
[258] | 149 | |
---|
| 150 | // computes the base adresss for vspaces array, |
---|
| 151 | vspace = (mapping_vspace_t *) ((char *) header + |
---|
| 152 | MAPPING_HEADER_SIZE + |
---|
[263] | 153 | MAPPING_CLUSTER_SIZE * header->x_size * header->y_size + |
---|
[258] | 154 | MAPPING_PSEG_SIZE * header->psegs); |
---|
| 155 | |
---|
| 156 | // computes the base adresss for vsegs array, |
---|
| 157 | vseg = (mapping_vseg_t *) ((char *) header + |
---|
| 158 | MAPPING_HEADER_SIZE + |
---|
[263] | 159 | MAPPING_CLUSTER_SIZE * header->x_size * header->y_size + |
---|
[258] | 160 | MAPPING_PSEG_SIZE * header->psegs + |
---|
| 161 | MAPPING_VSPACE_SIZE * header->vspaces); |
---|
| 162 | |
---|
| 163 | // computes the base address for tasks array |
---|
| 164 | task = (mapping_task_t *) ((char *) header + |
---|
| 165 | MAPPING_HEADER_SIZE + |
---|
[263] | 166 | MAPPING_CLUSTER_SIZE * header->x_size * header->y_size + |
---|
[258] | 167 | MAPPING_PSEG_SIZE * header->psegs + |
---|
| 168 | MAPPING_VSPACE_SIZE * header->vspaces + |
---|
| 169 | MAPPING_VSEG_SIZE * header->vsegs); |
---|
| 170 | |
---|
| 171 | // computes the base address for irqs array |
---|
| 172 | irq = (mapping_irq_t *) ((char *) header + |
---|
| 173 | MAPPING_HEADER_SIZE + |
---|
[263] | 174 | MAPPING_CLUSTER_SIZE * header->x_size * header->y_size + |
---|
[258] | 175 | MAPPING_PSEG_SIZE * header->psegs + |
---|
| 176 | MAPPING_VSPACE_SIZE * header->vspaces + |
---|
| 177 | MAPPING_VSEG_SIZE * header->vsegs + |
---|
| 178 | MAPPING_TASK_SIZE * header->tasks + |
---|
| 179 | MAPPING_PROC_SIZE * header->procs); |
---|
| 180 | |
---|
| 181 | // computes the base address for periphs array |
---|
| 182 | periph = (mapping_periph_t *) ((char *) header + |
---|
| 183 | MAPPING_HEADER_SIZE + |
---|
[263] | 184 | MAPPING_CLUSTER_SIZE * header->x_size * header->y_size + |
---|
[258] | 185 | MAPPING_PSEG_SIZE * header->psegs + |
---|
| 186 | MAPPING_VSPACE_SIZE * header->vspaces + |
---|
| 187 | MAPPING_VSEG_SIZE * header->vsegs + |
---|
| 188 | MAPPING_TASK_SIZE * header->tasks + |
---|
| 189 | MAPPING_PROC_SIZE * header->procs + |
---|
[522] | 190 | MAPPING_IRQ_SIZE * header->irqs); |
---|
[258] | 191 | |
---|
| 192 | ///////////////////////// header ///////////////////////////////////////////// |
---|
| 193 | |
---|
| 194 | fprintf(fpout, "<?xml version = \"1.0\"?>\n\n"); |
---|
| 195 | |
---|
[287] | 196 | fprintf(fpout, "<mapping_info signature = \"0x%x\" \n" , header->signature); |
---|
| 197 | fprintf(fpout, " name = \"%s\" \n" , header->name); |
---|
| 198 | fprintf(fpout, " x_size = \"%d\" \n" , header->x_size); |
---|
| 199 | fprintf(fpout, " y_size = \"%d\" \n" , header->y_size); |
---|
| 200 | fprintf(fpout, " x_width = \"%d\" \n" , header->x_width); |
---|
| 201 | fprintf(fpout, " y_width = \"%d\" \n" , header->y_width); |
---|
[295] | 202 | fprintf(fpout, " irq_per_proc = \"%d\" \n" , header->irq_per_proc); |
---|
[306] | 203 | fprintf(fpout, " use_ram_disk = \"%d\" \n" , header->use_ram_disk); |
---|
[295] | 204 | fprintf(fpout, " x_io = \"%d\" \n" , header->x_io); |
---|
| 205 | fprintf(fpout, " y_io = \"%d\" >\n\n", header->y_io); |
---|
[258] | 206 | |
---|
| 207 | ///////////////////// clusters /////////////////////////////////////////////// |
---|
| 208 | |
---|
| 209 | fprintf( fpout, " <clusterset>\n"); |
---|
[263] | 210 | for (cluster_id = 0; cluster_id < (header->x_size * header->y_size); cluster_id++) |
---|
[258] | 211 | { |
---|
[306] | 212 | fprintf(fpout, " <cluster x=\"%d\" y=\"%d\" >\n", |
---|
[263] | 213 | cluster[cluster_id].x, cluster[cluster_id].y ); |
---|
| 214 | |
---|
| 215 | ///////////////////// psegs //////////////////////////////////////////////// |
---|
| 216 | |
---|
[258] | 217 | for (pseg_id = cluster[cluster_id].pseg_offset; |
---|
| 218 | pseg_id < cluster[cluster_id].pseg_offset + cluster[cluster_id].psegs; |
---|
| 219 | pseg_id++) |
---|
| 220 | { |
---|
[306] | 221 | fprintf(fpout, " <pseg name=\"%s\"", pseg[pseg_id].name); |
---|
| 222 | fprintf(fpout, " type=\"%s\"", pseg_type[pseg[pseg_id].type]); |
---|
| 223 | fprintf(fpout, " base=\"0x%llx\"", pseg[pseg_id].base); |
---|
| 224 | fprintf(fpout, " length=\"0x%llx\" />\n", pseg[pseg_id].length); |
---|
[258] | 225 | } |
---|
| 226 | |
---|
| 227 | ///////////////////// processors ///////////////////////////////////////////// |
---|
| 228 | |
---|
| 229 | unsigned int proc_index = 0; |
---|
| 230 | for (proc_id = cluster[cluster_id].proc_offset; |
---|
| 231 | proc_id < cluster[cluster_id].proc_offset + cluster[cluster_id].procs; |
---|
[295] | 232 | proc_id++, proc_index++) |
---|
[258] | 233 | { |
---|
[306] | 234 | fprintf(fpout, " <proc index=\"%d\" />\n", proc_index); |
---|
[258] | 235 | } |
---|
| 236 | |
---|
| 237 | ///////////////////// periphs /////////////////////////////////////////////// |
---|
| 238 | |
---|
| 239 | for (periph_id = cluster[cluster_id].periph_offset; |
---|
| 240 | periph_id < cluster[cluster_id].periph_offset + cluster[cluster_id].periphs; |
---|
| 241 | periph_id++) |
---|
| 242 | { |
---|
[306] | 243 | fprintf(fpout, " <periph type=\"%s\"", periph_type[periph[periph_id].type]); |
---|
[289] | 244 | |
---|
[306] | 245 | if (periph[periph_id].type == PERIPH_TYPE_IOC) |
---|
| 246 | fprintf(fpout, " subtype=\"%s\"", ioc_subtype[periph[periph_id].subtype]); |
---|
[289] | 247 | |
---|
[522] | 248 | if (periph[periph_id].type == PERIPH_TYPE_MWR) |
---|
| 249 | fprintf(fpout, " subtype=\"%s\"", mwr_subtype[periph[periph_id].subtype]); |
---|
| 250 | |
---|
[306] | 251 | fprintf(fpout, " psegname=\"%s\"", pseg[periph[periph_id].psegid].name); |
---|
[323] | 252 | fprintf(fpout, " channels=\"%d\"", periph[periph_id].channels); |
---|
[627] | 253 | fprintf(fpout, " arg0=\"%d\"", periph[periph_id].arg0); |
---|
| 254 | fprintf(fpout, " arg1=\"%d\"", periph[periph_id].arg1); |
---|
| 255 | fprintf(fpout, " arg2=\"%d\"", periph[periph_id].arg2); |
---|
[522] | 256 | fprintf(fpout, " arg3=\"%d\" >\n", periph[periph_id].arg3); |
---|
[323] | 257 | if ( (periph[periph_id].type == PERIPH_TYPE_PIC) || |
---|
[439] | 258 | (periph[periph_id].type == PERIPH_TYPE_XCU) ) |
---|
[295] | 259 | { |
---|
[306] | 260 | for (irq_id = periph[periph_id].irq_offset; |
---|
| 261 | irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs; |
---|
| 262 | irq_id++) |
---|
| 263 | { |
---|
| 264 | fprintf(fpout, " <irq srctype=\"%s\"", irq_type[irq[irq_id].srctype]); |
---|
| 265 | fprintf(fpout, " srcid=\"%d\"", irq[irq_id].srcid); |
---|
| 266 | fprintf(fpout, " isr=\"%s\"", isr_type[irq[irq_id].isr]); |
---|
[323] | 267 | fprintf(fpout, " channel=\"%d\" />\n", irq[irq_id].channel); |
---|
[306] | 268 | } |
---|
| 269 | } |
---|
[295] | 270 | fprintf(fpout, " </periph>\n"); |
---|
[258] | 271 | } |
---|
| 272 | fprintf(fpout, " </cluster>\n" ); |
---|
| 273 | } |
---|
| 274 | fprintf(fpout, " </clusterset>\n\n" ); |
---|
| 275 | |
---|
| 276 | /////////////////// globals ///////////////////////////////////////////////// |
---|
| 277 | |
---|
| 278 | fprintf(fpout, " <globalset>\n" ); |
---|
| 279 | for (vseg_id = 0; vseg_id < header->globals; vseg_id++) |
---|
| 280 | { |
---|
[306] | 281 | unsigned int pseg_id = vseg[vseg_id].psegid; |
---|
| 282 | unsigned int cluster_id = pseg[pseg_id].clusterid; |
---|
[258] | 283 | |
---|
[306] | 284 | fprintf(fpout, " <vseg name=\"%s\"", vseg[vseg_id].name); |
---|
| 285 | fprintf(fpout, " vbase=\"0x%x\"", vseg[vseg_id].vbase); |
---|
[511] | 286 | fprintf(fpout, " length=\"0x%x\"", vseg[vseg_id].length); |
---|
| 287 | fprintf(fpout, " type=\"%s\"", vseg_type[vseg[vseg_id].type]); |
---|
[306] | 288 | fprintf(fpout, " mode=\"%s\"", mode_str[vseg[vseg_id].mode]); |
---|
[511] | 289 | fprintf(fpout, "\n "); |
---|
[306] | 290 | fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x); |
---|
| 291 | fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); |
---|
| 292 | fprintf(fpout, " psegname=\"%s\"", pseg[pseg_id].name); |
---|
[511] | 293 | if( vseg[vseg_id].ident ) |
---|
| 294 | fprintf(fpout, " ident=\"1\""); |
---|
| 295 | if( vseg[vseg_id].local ) |
---|
| 296 | fprintf(fpout, " local=\"1\""); |
---|
| 297 | if( vseg[vseg_id].big ) |
---|
| 298 | fprintf(fpout, " big=\"1\""); |
---|
| 299 | if( vseg[vseg_id].binpath[0] != 0 ) |
---|
| 300 | fprintf(fpout, " binpath=\"%s\"", vseg[vseg_id].binpath); |
---|
[306] | 301 | fprintf(fpout, " >\n"); |
---|
[258] | 302 | } |
---|
| 303 | fprintf(fpout, " </globalset>\n" ); |
---|
| 304 | |
---|
| 305 | //////////////////// vspaces //////////////////////////////////////////////// |
---|
| 306 | |
---|
| 307 | fprintf( fpout, "\n <vspaceset>\n\n" ); |
---|
| 308 | for (vspace_id = 0; vspace_id < header->vspaces; vspace_id++) |
---|
| 309 | { |
---|
[511] | 310 | unsigned int vseg_id = vspace[vspace_id].start_vseg_id; |
---|
[258] | 311 | fprintf(fpout, " <vspace name = \"%s\" ", vspace[vspace_id].name); |
---|
[511] | 312 | fprintf(fpout, " startname = \"%s\" >\n", vseg[vseg_id].name); |
---|
[258] | 313 | |
---|
[263] | 314 | //////////////////// vsegs ////////////////////////////////////////////// |
---|
| 315 | |
---|
[258] | 316 | for (vseg_id = vspace[vspace_id].vseg_offset; |
---|
| 317 | vseg_id < (vspace[vspace_id].vseg_offset + vspace[vspace_id].vsegs); |
---|
| 318 | vseg_id++) |
---|
| 319 | { |
---|
[263] | 320 | unsigned int pseg_id = vseg[vseg_id].psegid; |
---|
| 321 | unsigned int cluster_id = pseg[pseg_id].clusterid; |
---|
[258] | 322 | |
---|
[306] | 323 | fprintf(fpout, " <vseg name=\"%s\"", vseg[vseg_id].name); |
---|
| 324 | fprintf(fpout, " vbase=\"0x%x\"", vseg[vseg_id].vbase); |
---|
[511] | 325 | fprintf(fpout, " length=\"0x%x\"", vseg[vseg_id].length); |
---|
| 326 | fprintf(fpout, " type=\"%s\"", vseg_type[vseg[vseg_id].type]); |
---|
[306] | 327 | fprintf(fpout, " mode=\"%s\"", mode_str[vseg[vseg_id].mode]); |
---|
[511] | 328 | fprintf(fpout, "\n "); |
---|
[306] | 329 | fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x); |
---|
| 330 | fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); |
---|
| 331 | fprintf(fpout, " psegname=\"%s\"", pseg[pseg_id].name); |
---|
[511] | 332 | if( vseg[vseg_id].ident ) |
---|
| 333 | fprintf(fpout, " ident=\"1\""); |
---|
| 334 | if( vseg[vseg_id].local ) |
---|
| 335 | fprintf(fpout, " local=\"1\""); |
---|
| 336 | if( vseg[vseg_id].big ) |
---|
| 337 | fprintf(fpout, " big=\"1\""); |
---|
| 338 | if( vseg[vseg_id].binpath[0] != 0 ) |
---|
| 339 | fprintf(fpout, " binpath=\"%s\"", vseg[vseg_id].binpath); |
---|
[306] | 340 | fprintf(fpout, " >\n"); |
---|
[258] | 341 | } |
---|
[263] | 342 | |
---|
| 343 | //////////////////// tasks ////////////////////////////////////////////// |
---|
| 344 | |
---|
[258] | 345 | for (task_id = vspace[vspace_id].task_offset; |
---|
| 346 | task_id < (vspace[vspace_id].task_offset + vspace[vspace_id].tasks); |
---|
| 347 | task_id++) |
---|
| 348 | { |
---|
[511] | 349 | unsigned int stack_vseg_id = task[task_id].stack_vseg_id; |
---|
| 350 | unsigned int heap_vseg_id = task[task_id].heap_vseg_id; |
---|
[323] | 351 | unsigned int cluster_id = task[task_id].clusterid; |
---|
[258] | 352 | |
---|
[306] | 353 | fprintf(fpout, " <task name=\"%s\"", task[task_id].name); |
---|
| 354 | fprintf(fpout, " trdid=\"%d\"", task[task_id].trdid); |
---|
| 355 | fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x); |
---|
| 356 | fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); |
---|
| 357 | fprintf(fpout, " p=\"%d\"", task[task_id].proclocid); |
---|
[511] | 358 | fprintf(fpout, "\n "); |
---|
| 359 | fprintf(fpout, " stackname=\"%s\"", vseg[stack_vseg_id].name); |
---|
| 360 | if (heap_vseg_id != -1) |
---|
| 361 | fprintf(fpout, " heapname=\"%s\"", vseg[heap_vseg_id].name); |
---|
[306] | 362 | fprintf(fpout, " startid = \"%d\"", task[task_id].startid); |
---|
| 363 | fprintf(fpout, " />\n"); |
---|
[258] | 364 | } |
---|
| 365 | fprintf(fpout, " </vspace>\n\n"); |
---|
| 366 | } |
---|
| 367 | fprintf(fpout, " </vspaceset>\n"); |
---|
| 368 | fprintf(fpout, "</mapping_info>\n"); |
---|
| 369 | } // end buildXml() |
---|
| 370 | |
---|
| 371 | |
---|
| 372 | ///////////////////////////////////// |
---|
[306] | 373 | int main(int argc, char * argv[]) |
---|
| 374 | { |
---|
| 375 | if (argc < 2) |
---|
| 376 | { |
---|
[258] | 377 | printf("Usage: bin2xml <input_file_path> <output_file_path>\n"); |
---|
| 378 | return 1; |
---|
| 379 | } |
---|
| 380 | |
---|
| 381 | unsigned int bin[0x10000]; // 64 K int = 256 Kbytes |
---|
| 382 | |
---|
| 383 | int fdin = open(argv[1], O_RDONLY); |
---|
[306] | 384 | if (fdin < 0) |
---|
| 385 | { |
---|
[258] | 386 | perror("open"); |
---|
| 387 | exit(1); |
---|
| 388 | } |
---|
| 389 | |
---|
| 390 | FILE * fpout = fopen( argv[2], "w"); |
---|
[306] | 391 | if (fpout == NULL) |
---|
| 392 | { |
---|
[258] | 393 | perror("open"); |
---|
| 394 | exit(1); |
---|
| 395 | } |
---|
| 396 | |
---|
| 397 | unsigned int length = read(fdin, bin, 0x40000); |
---|
| 398 | |
---|
[306] | 399 | if (length <= 0) |
---|
| 400 | { |
---|
[258] | 401 | perror("read"); |
---|
| 402 | exit(1); |
---|
| 403 | } |
---|
| 404 | |
---|
[306] | 405 | if (bin[0] == IN_MAPPING_SIGNATURE) |
---|
| 406 | { |
---|
[258] | 407 | buildXml((mapping_header_t *) bin, fpout); |
---|
| 408 | } |
---|
[306] | 409 | else |
---|
| 410 | { |
---|
[258] | 411 | printf("[ERROR] Wrong file format\n"); |
---|
| 412 | exit(1); |
---|
| 413 | } |
---|
| 414 | return 0; |
---|
| 415 | } // end main() |
---|
| 416 | |
---|
| 417 | |
---|
| 418 | |
---|
| 419 | // Local Variables: |
---|
| 420 | // tab-width: 4 |
---|
| 421 | // c-basic-offset: 4 |
---|
| 422 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 423 | // indent-tabs-mode: nil |
---|
| 424 | // End: |
---|
| 425 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 426 | |
---|