… | |
… | |
16 | along with this program; if not, write to the Free Software |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
18 | */ |
18 | */ |
19 | |
19 | |
20 | #include "config.h" |
20 | #include "config.h" |
|
|
21 | #include "compat.h" |
|
|
22 | |
21 | #include <stdlib.h> |
23 | #include <stdlib.h> |
22 | |
24 | |
23 | #include "parse.h" |
25 | #include "parse.h" |
24 | #include "parse_routines.h" |
26 | #include "parse_routines.h" |
25 | #include "data.h" |
|
|
26 | |
27 | |
27 | psiconv_file_type_t psiconv_file_type(psiconv_buffer buf,int *length, |
28 | psiconv_file_type_t psiconv_file_type(psiconv_buffer buf,int *length, |
28 | psiconv_header_section *result) |
29 | psiconv_header_section *result) |
29 | { |
30 | { |
30 | psiconv_header_section header; |
31 | psiconv_header_section header; |
… | |
… | |
112 | goto ERROR3; |
113 | goto ERROR3; |
113 | for (i = 0; i < psiconv_list_length(table); i ++) { |
114 | for (i = 0; i < psiconv_list_length(table); i ++) { |
114 | if (!(entry = psiconv_list_get(table,i))) |
115 | if (!(entry = psiconv_list_get(table,i))) |
115 | goto ERROR4; |
116 | goto ERROR4; |
116 | psiconv_progress(lev+3,off,"Going to read clipart section %i",i); |
117 | psiconv_progress(lev+3,off,"Going to read clipart section %i",i); |
117 | if (!(psiconv_parse_clipart_section(buf,lev+3,*entry,NULL,&clipart))) |
118 | if ((res = psiconv_parse_clipart_section(buf,lev+3,*entry,NULL,&clipart))) |
118 | goto ERROR4; |
119 | goto ERROR4; |
119 | if (!(psiconv_list_add((*result)->sections,clipart))) |
120 | if ((res = psiconv_list_add((*result)->sections,clipart))) |
120 | goto ERROR5; |
121 | goto ERROR5; |
121 | } |
122 | } |
122 | |
123 | |
123 | psiconv_free_jumptable_section(table); |
124 | psiconv_free_jumptable_section(table); |
124 | psiconv_progress(lev+1,off,"End of clipart file"); |
125 | psiconv_progress(lev+1,off,"End of clipart file"); |
… | |
… | |
644 | |
645 | |
645 | psiconv_free_application_id_section(appl_id); |
646 | psiconv_free_application_id_section(appl_id); |
646 | psiconv_free_section_table_section(table); |
647 | psiconv_free_section_table_section(table); |
647 | |
648 | |
648 | psiconv_progress(lev+1,off,"End of word file"); |
649 | psiconv_progress(lev+1,off,"End of word file"); |
649 | return res; |
650 | return 0; |
650 | |
651 | |
651 | |
652 | |
652 | ERROR8: |
653 | ERROR8: |
653 | psiconv_free_text_and_layout((*result)->paragraphs); |
654 | psiconv_free_text_and_layout((*result)->paragraphs); |
654 | ERROR7: |
655 | ERROR7: |