comparison lwasm/unicorns.c @ 224:3864d96ee8c7

Make unicorns notice referenced files better Fix bug related to includebin and also make unicorns notice all files opened through the input subsystem when generating the resource list.
author William Astle <lost@l-w.ca>
date Sun, 15 Jul 2012 20:50:18 -0600
parents 211fc8038b8d
children 7c2c2239ec9c
comparison
equal deleted inserted replaced
223:211fc8038b8d 224:3864d96ee8c7
25 */ 25 */
26 26
27 #include <stdio.h> 27 #include <stdio.h>
28 #include <string.h> 28 #include <string.h>
29 29
30 #include "input.h"
30 #include "lwasm.h" 31 #include "lwasm.h"
31 #include "lw_alloc.h" 32 #include "lw_alloc.h"
32 33
33 static void print_urlencoding(FILE *stream, const char *string) 34 static void print_urlencoding(FILE *stream, const char *string)
34 { 35 {
45 } 46 }
46 } 47 }
47 48
48 void lwasm_do_unicorns(asmstate_t *as) 49 void lwasm_do_unicorns(asmstate_t *as)
49 { 50 {
50 char *n; 51 struct ifl *ifl;
51 macrotab_t *me; 52 macrotab_t *me;
52 structtab_t *se; 53 structtab_t *se;
53 int i; 54 int i;
54 55
55 /* output file list */ 56 /* output file list */
56 while ((n = lw_stack_pop(as -> includelist))) 57 for (ifl = ifl_head; ifl; ifl = ifl -> next)
57 { 58 {
58 fputs("RESOURCE: type=file,filename=", stdout); 59 fputs("RESOURCE: type=file,filename=", stdout);
59 print_urlencoding(stdout, n); 60 print_urlencoding(stdout, ifl -> fn);
60 fputc('\n', stdout); 61 fputc('\n', stdout);
61 lw_free(n);
62 } 62 }
63 63
64 /* output macro list */ 64 /* output macro list */
65 for (me = as -> macros; me; me = me -> next) 65 for (me = as -> macros; me; me = me -> next)
66 { 66 {