/[public]/psiconv/trunk/lib/psiconv/parse_driver.c
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/parse_driver.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 42 Revision 63
1/* 1/*
2 parse_driver.c - Part of psiconv, a PSION 5 file formats converter 2 parse_driver.c - Part of psiconv, a PSION 5 file formats converter
3 Copyright (c) 1999 Frodo Looijaard <frodol@dds.nl> 3 Copyright (c) 1999, 2000 Frodo Looijaard <frodol@dds.nl>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
82 82
83int psiconv_parse_clipart_file(const psiconv_buffer buf,int lev, 83int 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
91int psiconv_parse_mbm_file(const psiconv_buffer buf,int lev, psiconv_u32 off, 112int 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");

Legend:
Removed from v.42  
changed lines
  Added in v.63

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26