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

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

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

Revision 65 Revision 162
20#include "config.h" 20#include "config.h"
21#include "compat.h" 21#include "compat.h"
22#include <stdlib.h> 22#include <stdlib.h>
23#include <string.h> 23#include <string.h>
24 24
25#include "data.h"
26#include "parse_routines.h" 25#include "parse_routines.h"
26#include "error.h"
27
28#ifdef DMALLOC
29#include <dmalloc.h>
30#endif
31
27 32
28static int psiconv_parse_layout_section(const psiconv_buffer buf, 33static int psiconv_parse_layout_section(const psiconv_buffer buf,
29 int lev,psiconv_u32 off, 34 int lev,psiconv_u32 off,
30 int *length, 35 int *length,
31 psiconv_text_and_layout result, 36 psiconv_text_and_layout result,
32 psiconv_word_styles_section styles, 37 psiconv_word_styles_section styles,
33 int with_styles); 38 int with_styles);
39static psiconv_file_type_t psiconv_determine_embedded_object_type
40 (const psiconv_buffer buf,int lev,
41 int *status);
34 42
35int psiconv_parse_header_section(const psiconv_buffer buf,int lev, 43int psiconv_parse_header_section(const psiconv_buffer buf,int lev,
36 psiconv_u32 off, int *length, 44 psiconv_u32 off, int *length,
37 psiconv_header_section *result) 45 psiconv_header_section *result)
38{ 46{
87 (*result)->file = psiconv_texted_file; 95 (*result)->file = psiconv_texted_file;
88 psiconv_debug(lev+2,off+len,"File is a TextEd file"); 96 psiconv_debug(lev+2,off+len,"File is a TextEd file");
89 } else if ((*result)->uid3 == PSICONV_ID_SKETCH) { 97 } else if ((*result)->uid3 == PSICONV_ID_SKETCH) {
90 (*result)->file = psiconv_sketch_file; 98 (*result)->file = psiconv_sketch_file;
91 psiconv_debug(lev+2,off+len,"File is a Sketch file"); 99 psiconv_debug(lev+2,off+len,"File is a Sketch file");
100 } else if ((*result)->uid3 == PSICONV_ID_SHEET) {
101 (*result)->file = psiconv_sheet_file;
102 psiconv_debug(lev+2,off+len,"File is a Sheet file");
92 } 103 }
93 } else if ((*result)->uid2 == PSICONV_ID_MBM_FILE) { 104 } else if ((*result)->uid2 == PSICONV_ID_MBM_FILE) {
94 (*result)->file = psiconv_mbm_file; 105 (*result)->file = psiconv_mbm_file;
95 if ((*result)->uid3 != 0x00) 106 if ((*result)->uid3 != 0x00)
96 psiconv_warn(lev+2,off+len,"UID3 set in MBM file?!?"); 107 psiconv_warn(lev+2,off+len,"UID3 set in MBM file?!?");
97 psiconv_debug(lev+2,off+len,"File is a MBM file"); 108 psiconv_debug(lev+2,off+len,"File is a MBM file");
706 psiconv_warn(lev+3,off+len, 717 psiconv_warn(lev+3,off+len,
707 "Layout section inlines: not enough element"); 718 "Layout section inlines: not enough element");
708 psiconv_debug(lev+3,off+len,"Can't read element!"); 719 psiconv_debug(lev+3,off+len,"Can't read element!");
709 } else { 720 } else {
710 total ++; 721 total ++;
722 in_line.object = NULL;
723 in_line.layout = NULL;
711 if (!(in_line.layout = psiconv_clone_character_layout 724 if (!(in_line.layout = psiconv_clone_character_layout
712 (para->base_character))) 725 (para->base_character)))
713 goto ERROR4; 726 goto ERROR4;
714 psiconv_progress(lev+4,off+len,"Going to read the element type"); 727 psiconv_progress(lev+4,off+len,"Going to read the element type");
715 temp = psiconv_read_u8(buf,lev+4,len+off,&res); 728 temp = psiconv_read_u8(buf,lev+4,len+off,&res);
716 if (res) 729 if (res)
717 goto ERROR4; 730 goto ERROR5;
718 len += 1; 731 len += 1;
719 psiconv_debug(lev+4,off,"Type: %02x",temp); 732 psiconv_debug(lev+4,off+len,"Type: %02x",temp);
720 psiconv_progress(lev+4,off, 733 psiconv_progress(lev+4,off+len,
721 "Going to read the number of characters it applies to"); 734 "Going to read the number of characters it applies to");
722 in_line.length = psiconv_read_u32(buf,lev+4,len+off,&res); 735 in_line.length = psiconv_read_u32(buf,lev+4,len+off,&res);
723 if (res) 736 if (res)
724 goto ERROR4; 737 goto ERROR5;
725 psiconv_debug(lev+4,off+len,"Length: %02x",in_line.length); 738 psiconv_debug(lev+4,off+len,"Length: %02x",in_line.length);
726 len += 4; 739 len += 4;
727 psiconv_progress(lev+4,off+len,"Going to read the character layout"); 740 psiconv_progress(lev+4,off+len,"Going to read the character layout");
728 if ((res = psiconv_parse_character_layout_list(buf,lev+4,off+len,&leng, 741 if ((res = psiconv_parse_character_layout_list(buf,lev+4,off+len,&leng,
729 in_line.layout))) 742 in_line.layout)))
730 goto ERROR4; 743 goto ERROR5;
731 len += leng; 744 len += leng;
732 745
733 if (temp == 0x01) { 746 if (temp == 0x01) {
734 psiconv_debug(lev+4,off+len,"Skipping object data"); 747 psiconv_debug(lev+4,off+len,"Found an embedded object");
735 len += 0x10; 748 psiconv_progress(lev+4,off+len,"Going to read the object marker "
749 "(0x%08x expected)",PSICONV_ID_OBJECT);
750 temp = psiconv_read_u32(buf,lev+4,off+len,&res);
751 if (res)
752 goto ERROR5;
753 if (temp != PSICONV_ID_OBJECT) {
754 psiconv_warn(lev+4,off+len,"Unknown id marks embedded object");
755 psiconv_debug(lev+4,off+len,"Marker: read %08x, expected %08x",
756 temp,PSICONV_ID_OBJECT);
757 }
758 len += 4;
759 psiconv_progress(lev+4,off+len,
760 "Going to read the Embedded Object Section offset");
761 temp = psiconv_read_u32(buf,lev+4,off+len,&res);
762 if (res)
763 goto ERROR5;
764 psiconv_debug(lev+4,off+len, "Offset: %08x",temp);
765 len += 4;
766 psiconv_progress(lev+4,off+len,
767 "Going to parse the Embedded Object");
768 if ((res = psiconv_parse_embedded_object(buf,lev+4,temp,
769 NULL,&(in_line.object))))
770 goto ERROR5;
771 psiconv_progress(lev+4,off+len,
772 "Going to read the object width");
773 in_line.object_width = psiconv_read_length(buf,lev+4,off+len,
774 &leng,&res);
775 if (res)
776 goto ERROR5;
777 psiconv_debug(lev+4,off+len,"Object width: %f cm",
778 in_line.object_width);
779 len += leng;
780 psiconv_progress(lev+4,off+len,
781 "Going to read the object height");
782 in_line.object_height = psiconv_read_length(buf,lev+4,off+len,&leng,
783 &res);
784 if (res)
785 goto ERROR5;
786 psiconv_debug(lev+4,off+len,"Object height: %f cm",
787 in_line.object_height);
788 len += leng;
736 } else if (temp != 0x00) { 789 } else if (temp != 0x00) {
737 psiconv_warn(lev+4,off+len,"Layout section unknown inline type"); 790 psiconv_warn(lev+4,off+len,"Layout section unknown inline type");
738 } 791 }
739 if (line_length + in_line.length > strlen(para->text)) { 792 if (line_length + in_line.length > strlen(para->text)) {
740 psiconv_warn(lev+4,off+len, 793 psiconv_warn(lev+4,off+len,
742 res = -1; 795 res = -1;
743 in_line.length = strlen(para->text) - line_length; 796 in_line.length = strlen(para->text) - line_length;
744 } 797 }
745 line_length += in_line.length; 798 line_length += in_line.length;
746 if ((res = psiconv_list_add(para->in_lines,&in_line))) 799 if ((res = psiconv_list_add(para->in_lines,&in_line)))
747 goto ERROR4; 800 goto ERROR5;
748 } 801 }
749 } 802 }
750 } 803 }
751 804
752 if (total != nr) { 805 if (total != nr) {
767 psiconv_list_free(anon_styles); 820 psiconv_list_free(anon_styles);
768 821
769 if (length) 822 if (length)
770 *length = len; 823 *length = len;
771 824
772 psiconv_progress(lev+1,off+len-1,"End of layout section (total length: %08x", 825 psiconv_progress(lev+1,off+len-1,"End of layout section (total length: %08x)",
773 len); 826 len);
774 827
775 return 0; 828 return 0;
776 829
777ERROR4_4: 830ERROR4_4:
788 psiconv_free_character_layout(anon.character); 841 psiconv_free_character_layout(anon.character);
789ERROR3_1: 842ERROR3_1:
790 psiconv_free_paragraph_layout(anon.paragraph); 843 psiconv_free_paragraph_layout(anon.paragraph);
791 goto ERROR3; 844 goto ERROR3;
792 845
846ERROR5:
847 if (in_line.layout)
848 psiconv_free_character_layout(in_line.layout);
849 if (in_line.object)
850 psiconv_free_object(in_line.object);
793ERROR4: 851ERROR4:
794 free(inline_count); 852 free(inline_count);
795ERROR3: 853ERROR3:
796 for (i = 0; i < psiconv_list_length(anon_styles); i++) { 854 for (i = 0; i < psiconv_list_length(anon_styles); i++) {
797 if (!(anon_ptr = psiconv_list_get(anon_styles,i))) { 855 if (!(anon_ptr = psiconv_list_get(anon_styles,i))) {
822{ 880{
823 return psiconv_parse_layout_section(buf,lev,off,length,result,styles,1); 881 return psiconv_parse_layout_section(buf,lev,off,length,result,styles,1);
824} 882}
825 883
826int psiconv_parse_styleless_layout_section(const psiconv_buffer buf, 884int psiconv_parse_styleless_layout_section(const psiconv_buffer buf,
827 int lev,psiconv_u32 off, 885 int lev,psiconv_u32 off,
828 int *length, 886 int *length,
829 psiconv_text_and_layout result, 887 psiconv_text_and_layout result,
830 psiconv_character_layout base_char, 888 const psiconv_character_layout base_char,
831 psiconv_paragraph_layout base_para) 889 const psiconv_paragraph_layout base_para)
832{ 890{
833 int res = 0; 891 int res = 0;
834 psiconv_word_styles_section styles_section; 892 psiconv_word_styles_section styles_section;
835 893
836 if (!(styles_section = malloc(sizeof(*styles_section)))) 894 if (!(styles_section = malloc(sizeof(*styles_section))))
874 return -PSICONV_E_NOMEM; 932 return -PSICONV_E_NOMEM;
875 else 933 else
876 return res; 934 return res;
877} 935}
878 936
937int psiconv_parse_embedded_object(const psiconv_buffer buf, int lev,
938 psiconv_u32 off, int *length,
939 psiconv_object *result)
940{
941 int res=0;
942 int len=0;
943 int leng,i;
944 psiconv_section_table_section table;
945 psiconv_section_table_entry entry;
946 psiconv_u32 icon_sec=0,display_sec=0,table_sec=0;
947 psiconv_buffer subbuf;
948
949 psiconv_progress(lev+1,off+len,"Going to read an Embedded Object");
950 if (!(*result = malloc(sizeof(**result))))
951 goto ERROR1;
952
953 psiconv_progress(lev+2,off+len,"Going to read the Embedded Object Section");
954 psiconv_parse_section_table_section(buf,lev+2,off+len,&leng,&table);
955 len += leng;
956
957 for (i = 0; i < psiconv_list_length(table); i++) {
958 psiconv_progress(lev+2,off+len,"Going to read entry %d",i);
959 if (!(entry = psiconv_list_get(table,i)))
960 goto ERROR2;
961 if (entry->id == PSICONV_ID_OBJECT_DISPLAY_SECTION) {
962 display_sec = entry->offset;
963 psiconv_debug(lev+3,off+len,"Found the Object Display Section at %08x",
964 display_sec);
965 } else if (entry->id == PSICONV_ID_OBJECT_ICON_SECTION) {
966 icon_sec = entry->offset;
967 psiconv_debug(lev+3,off+len,"Found the Object Icon Section at %08x",
968 icon_sec);
969 } else if (entry->id == PSICONV_ID_OBJECT_SECTION_TABLE_SECTION) {
970 table_sec = entry->offset;
971 psiconv_debug(lev+3,off+len,"Found the Object Section Table Section at %08x",
972 table_sec);
973 } else {
974 psiconv_warn(lev+3,off+len,
975 "Found unknown section in the Object Display Section "
976 "(ignoring)");
977 psiconv_debug(lev+3,off+len,"Section ID %08x, offset %08x",
978 entry->id, entry->offset);
979 }
980 }
981
982 psiconv_progress(lev+2,off+len,"Looking for the Object Display Section");
983 if (!icon_sec) {
984 psiconv_warn(lev+2,off+len,"Object Display Section not found");
985 (*result)->display = NULL;
986 } else {
987 psiconv_debug(lev+2,off+len,"Object Display Section at offset %08x",
988 display_sec);
989 if ((res = psiconv_parse_object_display_section(buf,lev+2,display_sec,NULL,
990 &(*result)->display)))
991 goto ERROR2;
992 }
993
994 psiconv_progress(lev+2,off+len,"Looking for the Object Icon Section");
995 if (!icon_sec) {
996 psiconv_warn(lev+2,off+len,"Object Icon Section not found");
997 (*result)->icon = NULL;
998 } else {
999 psiconv_debug(lev+2,off+len,"Object Icon Section at offset %08x",icon_sec);
1000 if ((res = psiconv_parse_object_icon_section(buf,lev+2,icon_sec,NULL,
1001 &(*result)->icon)))
1002 goto ERROR3;
1003 }
1004
1005 psiconv_progress(lev+2,off+len,
1006 "Looking for the Section Table Offset Section");
1007 if (!table_sec) {
1008 psiconv_warn(lev+2,off+len,
1009 "Embedded Section Table Offset Section not found");
1010 (*result)->object = NULL;
1011 } else {
1012 psiconv_progress(lev+2,off+len,
1013 "Extracting object: add %08x to all following offsets",
1014 table_sec);
1015 /* We can't determine the length of the object, so we just take it all */
1016 if ((res = psiconv_buffer_subbuffer(&subbuf,buf,table_sec,
1017 psiconv_buffer_length(buf)-table_sec)))
1018 goto ERROR4;
1019
1020 if (!((*result)->object = malloc(sizeof(*(*result)->object))))
1021 goto ERROR5;
1022
1023 /* We need to find the file type, but we don't have a normal header */
1024 /* So we try to find the Application ID Section and hope for the best */
1025 psiconv_progress(lev+3,0,"Trying to determine the file type");
1026 (*result)->object->type = psiconv_determine_embedded_object_type
1027 (subbuf,lev+3,&res);
1028 switch ((*result)->object->type) {
1029 case psiconv_word_file:
1030 if ((res = psiconv_parse_word_file(subbuf,lev+3,0,
1031 ((psiconv_word_f *) &(*result)->object->file))))
1032 goto ERROR6;
1033 break;
1034 case psiconv_texted_file:
1035 if ((res = psiconv_parse_texted_file(subbuf,lev+3,0,
1036 ((psiconv_texted_f *) &(*result)->object->file))))
1037 goto ERROR6;
1038 break;
1039 case psiconv_sheet_file:
1040 if ((res = psiconv_parse_sheet_file(subbuf,lev+3,0,
1041 ((psiconv_sheet_f *) &(*result)->object->file))))
1042 goto ERROR6;
1043 break;
1044 case psiconv_sketch_file:
1045 if ((res = psiconv_parse_sketch_file(subbuf,lev+3,0,
1046 ((psiconv_sketch_f *) &(*result)->object->file))))
1047 goto ERROR6;
1048 break;
1049 default:
1050 psiconv_warn(lev+3,0,"Can't parse embedded object (still continuing)");
1051 (*result)->object->file = NULL;
1052 }
1053 }
1054
1055 if (length)
1056 *length = len;
1057
1058 psiconv_progress(lev+1,off+len-1,"End of Embedded Object Section "
1059 "(total length: %08x)",len);
1060
1061 return res;
1062
1063
1064ERROR6:
1065 free((*result)->object);
1066ERROR5:
1067 psiconv_buffer_free(subbuf);
1068ERROR4:
1069 psiconv_free_object_icon_section((*result)->icon);
1070ERROR3:
1071 psiconv_free_object_display_section((*result)->display);
1072ERROR2:
1073 psiconv_free_section_table_section(table);
1074ERROR1:
1075 psiconv_warn(lev+1,off,"Reading Embedded Object failed");
1076
1077 if (length)
1078 *length = 0;
1079
1080 if (res == 0)
1081 return -PSICONV_E_NOMEM;
1082 else
1083 return res;
1084}
1085
1086psiconv_file_type_t psiconv_determine_embedded_object_type
1087 (const psiconv_buffer buf,int lev,
1088 int *status)
1089{
1090 psiconv_u32 off;
1091 psiconv_section_table_section table;
1092 int res,i;
1093 psiconv_file_type_t file_type = psiconv_unknown_file;
1094 psiconv_section_table_entry entry;
1095 psiconv_application_id_section applid;
1096
1097 psiconv_progress(lev+1,0,"Going to determine embedded object file type");
1098 psiconv_progress(lev+2,0,"Going to read the Section Table Offset Section");
1099 off = psiconv_read_u32(buf,lev,0,&res);
1100 if (res)
1101 goto ERROR1;
1102 psiconv_debug(lev+2,0,"Offset: %08x",off);
1103
1104 psiconv_progress(lev+2,off,"Going to read the Section Table Section");
1105 if ((res = psiconv_parse_section_table_section(buf,lev+2,off,NULL,&table)))
1106 goto ERROR1;
1107
1108 psiconv_progress(lev+2,off,"Going to search the Section Table Section "
1109 "for the Application ID Section");
1110 for (i=0; i < psiconv_list_length(table); i++) {
1111 psiconv_progress(lev+3,off,"Going to read entry %d",i);
1112 if (!(entry = psiconv_list_get(table,i)))
1113 goto ERROR2;
1114 if (entry->id == PSICONV_ID_APPL_ID_SECTION) {
1115 psiconv_progress(lev+3,off,
1116 "Found the Application ID Section at offset %08x",
1117 entry->offset);
1118 off = entry->offset;
1119 break;
1120 }
1121 }
1122 if (i == psiconv_list_length(table)) {
1123 psiconv_warn(lev+2,off,"No Application ID Section found");
1124 res = PSICONV_E_PARSE;
1125 goto ERROR2;
1126 }
1127
1128 psiconv_progress(lev+2,off,"Going to read the Application ID Section");
1129 if ((res = psiconv_parse_application_id_section(buf,lev+2,off,NULL,&applid)))
1130 goto ERROR2;
1131
1132 switch (applid->id) {
1133 case PSICONV_ID_WORD: file_type = psiconv_word_file;
1134 psiconv_debug(lev+2,off,"Found a Word file");
1135 break;
1136 case PSICONV_ID_TEXTED: file_type = psiconv_texted_file;
1137 psiconv_debug(lev+2,off,"Found a TextEd file");
1138 break;
1139 case PSICONV_ID_SKETCH: file_type = psiconv_sketch_file;
1140 psiconv_debug(lev+2,off,"Found a Sketch file");
1141 break;
1142 case PSICONV_ID_SHEET: file_type = psiconv_sheet_file;
1143 psiconv_debug(lev+2,off,"Found a Sheet file");
1144 break;
1145 default: psiconv_warn(lev+2,off,"Found an unknown file type");
1146 psiconv_debug(lev+2,off,"Found ID %08x",applid->id);
1147 }
1148
1149ERROR2:
1150 psiconv_free_application_id_section(applid);
1151ERROR1:
1152 psiconv_free_section_table_section(table);
1153 if (status)
1154 *status = res;
1155 return file_type;
1156
1157}
1158
1159int psiconv_parse_object_display_section(const psiconv_buffer buf,int lev,
1160 psiconv_u32 off, int *length,
1161 psiconv_object_display_section *result)
1162{
1163 int res = 0;
1164 int len = 0;
1165 int leng;
1166 psiconv_u32 temp;
1167
1168 psiconv_progress(lev+1,off,"Going to read the Object Display Section");
1169 if (!(*result = malloc(sizeof(**result))))
1170 goto ERROR1;
1171
1172 psiconv_progress(lev+2,off+len,"Going to read the display as icon flag "
1173 "(expecting 0x00 or 0x01)");
1174 temp = psiconv_read_u8(buf,lev+2,off+len,&res);
1175 if (res)
1176 goto ERROR2;
1177 if (temp == 0x00) {
1178 (*result)->show_icon = psiconv_bool_true;
1179 psiconv_debug(lev+2,off+len,"Displayed as icon");
1180 } else if (temp == 0x01) {
1181 (*result)->show_icon = psiconv_bool_false;
1182 psiconv_debug(lev+2,off+len,"Displayed as full document");
1183 } else {
1184 psiconv_warn(lev+2,off+len,"Unknown Object Display Section Icon Flag");
1185 psiconv_debug(lev+2,off+len,"Icon flag found: %02x",temp);
1186 /* Improvise */
1187 (*result)->show_icon = (temp & 0x01?psiconv_bool_false:psiconv_bool_true);
1188 }
1189 len ++;
1190
1191 psiconv_progress(lev+2,off+len,"Going to read the display width");
1192 (*result)->width = psiconv_read_length(buf,lev+2,off+len,&leng,&res);
1193 if (res)
1194 goto ERROR2;
1195 psiconv_debug(lev+2,off+len,"Display width: %f cm",(*result)->width);
1196 len += leng;
1197
1198 psiconv_progress(lev+2,off+len,"Going to read the display height");
1199 (*result)->height = psiconv_read_length(buf,lev+2,off+len,&leng,&res);
1200 if (res)
1201 goto ERROR2;
1202 psiconv_debug(lev+2,off+len,"Display length: %f cm",(*result)->height);
1203 len += leng;
1204
1205 psiconv_progress(lev+2,off+len,"Going to read unknown long (%08x expected)",
1206 0);
1207 temp = psiconv_read_u32(buf,lev+2,off+len,&res);
1208 if (temp != 0) {
1209 psiconv_warn(lev+2,off+len,"Unknown Object Display Section final long");
1210 psiconv_debug(lev+2,off+len,"Long read: %08x",temp);
1211 }
1212 len += 4;
1213
1214 if (length)
1215 *length = len;
1216
1217 psiconv_progress(lev+1,off+len-1,"End of Object Display Section "
1218 "(total length: %08x",len);
1219 return res;
1220
1221ERROR2:
1222 free(*result);
1223ERROR1:
1224 psiconv_warn(lev+1,off+len,"Reading of Object Display Section failed");
1225 if (length)
1226 *length=0;
1227 if (!res)
1228 return -PSICONV_E_NOMEM;
1229 else
1230 return res;
1231}
1232
1233int psiconv_parse_object_icon_section(const psiconv_buffer buf,int lev,
1234 psiconv_u32 off, int *length,
1235 psiconv_object_icon_section *result)
1236{
1237 int res = 0;
1238 int len = 0;
1239 int leng;
1240
1241 psiconv_progress(lev+1,off,"Going to read the Object Icon Section");
1242 if (!(*result = malloc(sizeof(**result))))
1243 goto ERROR1;
1244
1245 psiconv_progress(lev+2,off+len,"Going to read the icon name");
1246 (*result)->icon_name = psiconv_read_string(buf,lev+2,off+len,&leng,&res);
1247 if (res)
1248 goto ERROR2;
1249 psiconv_debug(lev+2,off+len,"Icon name: %s",(*result)->icon_name);
1250 len += leng;
1251
1252 psiconv_progress(lev+2,off+len,"Going to read the icon width");
1253 (*result)->icon_width = psiconv_read_length(buf,lev+2,off+len,&leng,&res);
1254 if (res)
1255 goto ERROR3;
1256 psiconv_debug(lev+2,off+len,"Icon width: %f cm",(*result)->icon_width);
1257 len += leng;
1258
1259 psiconv_progress(lev+2,off+len,"Going to read the icon height");
1260 (*result)->icon_height = psiconv_read_length(buf,lev+2,off+len,&leng,&res);
1261 if (res)
1262 goto ERROR3;
1263 psiconv_debug(lev+2,off+len,"Icon length: %f cm",(*result)->icon_height);
1264 len += leng;
1265
1266 if (length)
1267 *length = len;
1268
1269 psiconv_progress(lev+1,off+len-1,"End of Object Icon Section"
1270 "(total length: %08x",len);
1271 return res;
1272
1273ERROR3:
1274 free((*result)->icon_name);
1275ERROR2:
1276 free(*result);
1277ERROR1:
1278 psiconv_warn(lev+1,off+len,"Reading of Object Icon Section failed");
1279 if (length)
1280 *length=0;
1281 if (!res)
1282 return -PSICONV_E_NOMEM;
1283 else
1284 return res;
1285}

Legend:
Removed from v.65  
changed lines
  Added in v.162

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