… | |
… | |
82 | |
82 | |
83 | int psiconv_parse_clipart_file(const psiconv_buffer buf,int lev, |
83 | int psiconv_parse_clipart_file(const psiconv_buffer buf,int lev, |
84 | psiconv_u32 off, psiconv_clipart_f *result) |
84 | psiconv_u32 off, psiconv_clipart_f *result) |
85 | { |
85 | { |
86 | int res=0; |
86 | int res=0; |
|
|
87 | int i; |
|
|
88 | psiconv_jumptable_section table; |
|
|
89 | psiconv_clipart_section clipart; |
|
|
90 | psiconv_u32 *entry; |
|
|
91 | |
|
|
92 | psiconv_progress(lev+1,off,"Going to read a clipart file"); |
87 | (*result) = malloc(sizeof(**result)); |
93 | (*result) = malloc(sizeof(**result)); |
|
|
94 | |
|
|
95 | psiconv_progress(lev+2,off,"Going to read the MBM jumptable"); |
|
|
96 | res |= psiconv_parse_jumptable_section(buf,lev+2,off, NULL,&table); |
|
|
97 | |
|
|
98 | psiconv_progress(lev+2,off,"Going to read the clipart sections"); |
|
|
99 | (*result)->sections = psiconv_list_new(sizeof(*clipart)); |
|
|
100 | for (i = 0; i < psiconv_list_length(table); i ++) { |
|
|
101 | entry = psiconv_list_get(table,i); |
|
|
102 | psiconv_progress(lev+3,off,"Going to read clipart section %i",i); |
|
|
103 | psiconv_parse_clipart_section(buf,lev+3,*entry,NULL,&clipart); |
|
|
104 | psiconv_list_add((*result)->sections,clipart); |
|
|
105 | } |
|
|
106 | |
|
|
107 | psiconv_free_jumptable_section(table); |
|
|
108 | psiconv_progress(lev+1,off,"End of clipart file"); |
88 | return 0; |
109 | return res; |
89 | } |
110 | } |
90 | |
111 | |
91 | int psiconv_parse_mbm_file(const psiconv_buffer buf,int lev, psiconv_u32 off, |
112 | int psiconv_parse_mbm_file(const psiconv_buffer buf,int lev, psiconv_u32 off, |
92 | psiconv_mbm_f *result) |
113 | psiconv_mbm_f *result) |
93 | { |
114 | { |
… | |
… | |
111 | psiconv_progress(lev+2,off,"Going to read the picture sections"); |
132 | psiconv_progress(lev+2,off,"Going to read the picture sections"); |
112 | (*result)->sections = psiconv_list_new(sizeof(*paint)); |
133 | (*result)->sections = psiconv_list_new(sizeof(*paint)); |
113 | for (i = 0; i < psiconv_list_length(table); i ++) { |
134 | for (i = 0; i < psiconv_list_length(table); i ++) { |
114 | entry = psiconv_list_get(table,i); |
135 | entry = psiconv_list_get(table,i); |
115 | psiconv_progress(lev+3,off,"Going to read picture section %i",i); |
136 | psiconv_progress(lev+3,off,"Going to read picture section %i",i); |
116 | psiconv_parse_paint_data_section(buf,lev+3,*entry,NULL,&paint); |
137 | psiconv_parse_paint_data_section(buf,lev+3,*entry,NULL,0,&paint); |
117 | psiconv_list_add((*result)->sections,paint); |
138 | psiconv_list_add((*result)->sections,paint); |
118 | } |
139 | } |
119 | |
140 | |
120 | psiconv_free_jumptable_section(table); |
141 | psiconv_free_jumptable_section(table); |
121 | psiconv_progress(lev+1,off,"End of mbm file"); |
142 | psiconv_progress(lev+1,off,"End of mbm file"); |