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

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

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

Revision 62 Revision 95
1/* 1/*
2 data.c - Part of psiconv, a PSION 5 file formats converter 2 data.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.
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#include "data.h" 24#include "data.h"
25#include "list.h"
25 26
26static psiconv_color clone_color(psiconv_color color); 27static psiconv_color clone_color(psiconv_color color);
27static psiconv_font clone_font(psiconv_font font); 28static psiconv_font clone_font(psiconv_font font);
28static psiconv_border clone_border(psiconv_border border); 29static psiconv_border clone_border(psiconv_border border);
29static psiconv_bullet clone_bullet(psiconv_bullet bullet); 30static psiconv_bullet clone_bullet(psiconv_bullet bullet);
32static void psiconv_free_in_line_layout_aux(void * layout); 33static void psiconv_free_in_line_layout_aux(void * layout);
33static void psiconv_free_paragraph_aux(void * paragraph); 34static void psiconv_free_paragraph_aux(void * paragraph);
34static void psiconv_free_paint_data_section_aux(void * section); 35static void psiconv_free_paint_data_section_aux(void * section);
35static void psiconv_free_clipart_section_aux(void * section); 36static void psiconv_free_clipart_section_aux(void * section);
36 37
38static psiconv_word_styles_section psiconv_empty_word_styles_section(void);
39static psiconv_text_and_layout psiconv_empty_text_and_layout(void);
40static psiconv_texted_section psiconv_empty_texted_section(void);
41static psiconv_page_header psiconv_empty_page_header(void);
42static psiconv_page_layout_section psiconv_empty_page_layout_section(void);
43static psiconv_word_status_section psiconv_empty_word_status_section(void);
44static psiconv_word_f psiconv_empty_word_f(void);
45static psiconv_sheet_status_section psiconv_empty_sheet_status_section(void);
46static psiconv_sheet_workbook_section
47 psiconv_empty_sheet_workbook_section(void);
48static psiconv_sheet_f psiconv_empty_sheet_f(void);
49static psiconv_texted_f psiconv_empty_texted_f(void);
50static psiconv_paint_data_section psiconv_empty_paint_data_section(void);
51static psiconv_pictures psiconv_empty_pictures(void);
52static psiconv_mbm_f psiconv_empty_mbm_f(void);
53static psiconv_sketch_section psiconv_empty_sketch_section(void);
54static psiconv_sketch_f psiconv_empty_sketch_f(void);
55static psiconv_clipart_f psiconv_empty_clipart_f(void);
56static psiconv_cliparts psiconv_empty_cliparts(void);
57
58
59/* Note: these defaults seem to be hard-coded somewhere outside the
60 files themself. */
37psiconv_character_layout psiconv_basic_character_layout(void) 61psiconv_character_layout psiconv_basic_character_layout(void)
38{ 62{
39 /* Make the structures static, to oblige IRIX */ 63 /* Make the structures static, to oblige IRIX */
40 static struct psiconv_color_s black = 64 static struct psiconv_color_s black =
41 { 65 {
61 10.0, /* font_size */ 85 10.0, /* font_size */
62 psiconv_bool_false, /* italic */ 86 psiconv_bool_false, /* italic */
63 psiconv_bool_false, /* bold */ 87 psiconv_bool_false, /* bold */
64 psiconv_normalscript, /* super_sub */ 88 psiconv_normalscript, /* super_sub */
65 psiconv_bool_false, /* underline */ 89 psiconv_bool_false, /* underline */
66 psiconv_bool_false, /* strike_out */ 90 psiconv_bool_false, /* strikethrough */
67 &font, /* font */ 91 &font, /* font */
68 }; 92 };
69 93
70 return psiconv_clone_character_layout(&cl); 94 return psiconv_clone_character_layout(&cl);
71} 95}
72 96
97/* Note: these defaults seem to be hard-coded somewhere outside the
98 files themself. */
73psiconv_paragraph_layout psiconv_basic_paragraph_layout(void) 99psiconv_paragraph_layout psiconv_basic_paragraph_layout(void)
74{ 100{
75 static struct psiconv_font_s font = 101 static struct psiconv_font_s font =
76 { 102 {
77 "Times New Roman", /* name */ 103 "Times New Roman", /* name */
115 0.0, /* indent_left */ 141 0.0, /* indent_left */
116 0.0, /* indent_right */ 142 0.0, /* indent_right */
117 0.0, /* indent_first */ 143 0.0, /* indent_first */
118 psiconv_justify_left, /* justify_hor */ 144 psiconv_justify_left, /* justify_hor */
119 psiconv_justify_middle,/* justify_ver */ 145 psiconv_justify_middle,/* justify_ver */
120 0.0, /* interline */ 146 10.0, /* linespacing */
121 psiconv_bool_false, /* interline_exact */ 147 psiconv_bool_false, /* linespacing_exact */
122 0.0, /* top_space */ 148 0.0, /* space_above */
123 0.0, /* bottom_space */ 149 0.0, /* space_below */
124 psiconv_bool_false, /* on_one_page */
125 psiconv_bool_false, /* together_with */ 150 psiconv_bool_false, /* keep_together */
151 psiconv_bool_false, /* keep_with_next */
126 psiconv_bool_false, /* on_next_page */ 152 psiconv_bool_false, /* on_next_page */
127 psiconv_bool_false, /* no_widow_protection */ 153 psiconv_bool_false, /* no_widow_protection */
128 0.0, /* left_margin */ 154 0.0, /* left_margin */
129 &bullet, /* bullet */ 155 &bullet, /* bullet */
130 &no_border, /* left_border */ 156 &no_border, /* left_border */
512 psiconv_free_word_styles_section(file->styles_sec); 538 psiconv_free_word_styles_section(file->styles_sec);
513 free(file); 539 free(file);
514 } 540 }
515} 541}
516 542
543void psiconv_free_sheet_status_section(psiconv_sheet_status_section section)
544{
545 if (section)
546 free(section);
547}
548
549void psiconv_free_sheet_workbook_section(psiconv_sheet_workbook_section section)
550{
551 if (section)
552 free(section);
553}
554
555void psiconv_free_sheet_f(psiconv_sheet_f file)
556{
557 if (file) {
558 psiconv_free_page_layout_section(file->page_sec);
559 psiconv_free_sheet_status_section(file->status_sec);
560 psiconv_free_sheet_workbook_section(file->workbook_sec);
561 free(file);
562 }
563}
564
517void psiconv_free_texted_f(psiconv_texted_f file) 565void psiconv_free_texted_f(psiconv_texted_f file)
518{ 566{
519 if (file) { 567 if (file) {
520 psiconv_free_page_layout_section(file->page_sec); 568 psiconv_free_page_layout_section(file->page_sec);
521 psiconv_free_texted_section(file->texted_sec); 569 psiconv_free_texted_section(file->texted_sec);
616 psiconv_free_mbm_f((psiconv_mbm_f) file->file); 664 psiconv_free_mbm_f((psiconv_mbm_f) file->file);
617 else if (file->type == psiconv_sketch_file) 665 else if (file->type == psiconv_sketch_file)
618 psiconv_free_sketch_f((psiconv_sketch_f) file->file); 666 psiconv_free_sketch_f((psiconv_sketch_f) file->file);
619 else if (file->type == psiconv_clipart_file) 667 else if (file->type == psiconv_clipart_file)
620 psiconv_free_clipart_f((psiconv_clipart_f) file->file); 668 psiconv_free_clipart_f((psiconv_clipart_f) file->file);
669 else if (file->type == psiconv_sheet_file)
670 psiconv_free_sheet_f((psiconv_sheet_f) file->file);
621 free(file); 671 free(file);
622 } 672 }
623} 673}
674
675int psiconv_compare_color(const psiconv_color value1,
676 const psiconv_color value2)
677{
678 if (!value1 || !value2)
679 return 1;
680 if ((value1->red == value2->red) &&
681 (value1->green == value2->green) &&
682 (value1->blue == value2->blue))
683 return 0;
684 else
685 return 1;
686}
687
688int psiconv_compare_font(const psiconv_font value1,
689 const psiconv_font value2)
690{
691 if (!value1 || !value2 || !value1->name || !value2->name)
692 return 1;
693 if ((value1->screenfont == value2->screenfont) &&
694 !strcmp(value1->name,value2->name))
695 return 0;
696 else
697 return 1;
698}
699
700int psiconv_compare_border(const psiconv_border value1,
701 const psiconv_border value2)
702{
703 if (!value1 || !value2)
704 return 1;
705 if ((value1->kind == value2->kind) &&
706 (value1->thickness == value2->thickness) &&
707 !psiconv_compare_color(value1->color,value2->color))
708 return 0;
709 else
710 return 1;
711}
712
713int psiconv_compare_bullet(const psiconv_bullet value1,
714 const psiconv_bullet value2)
715{
716 if (!value1 || !value2)
717 return 1;
718 if ((value1->on == value2->on) &&
719 (value1->font_size == value2->font_size) &&
720 (value1->character == value2->character) &&
721 (value1->indent == value2->indent) &&
722 !psiconv_compare_color(value1->color,value2->color) &&
723 !psiconv_compare_font(value1->font,value2->font))
724 return 0;
725 else
726 return 1;
727}
728
729int psiconv_compare_tab(const psiconv_tab value1, const psiconv_tab value2)
730{
731 if (!value1 || !value2)
732 return 1;
733 if ((value1->location == value2->location) &&
734 (value1->kind == value2->kind))
735 return 0;
736 else
737 return 1;
738}
739
740int psiconv_compare_all_tabs(const psiconv_all_tabs value1,
741 const psiconv_all_tabs value2)
742{
743 int i;
744
745 if (!value1 || !value2 || !value1->extras || !value2->extras)
746 return 1;
747
748 if ((value1->normal != value2->normal) ||
749 psiconv_list_length(value1->extras) !=
750 psiconv_list_length(value2->extras))
751 return 1;
752 for (i = 0; i < psiconv_list_length(value1->extras); i++)
753 if (psiconv_compare_tab(psiconv_list_get(value1->extras,i),
754 psiconv_list_get(value2->extras,i)))
755
756 return 1;
757 return 0;
758}
759
760int psiconv_compare_paragraph_layout(const psiconv_paragraph_layout value1,
761 const psiconv_paragraph_layout value2)
762{
763 if (!value1 || !value2)
764 return 1;
765 if ((value1->indent_left == value2->indent_left) &&
766 (value1->indent_right == value2->indent_right) &&
767 (value1->indent_first == value2->indent_first) &&
768 (value1->justify_hor == value2->justify_hor) &&
769 (value1->justify_ver == value2->justify_ver) &&
770 (value1->linespacing == value2->linespacing) &&
771 (value1->space_above == value2->space_above) &&
772 (value1->space_below == value2->space_below) &&
773 (value1->keep_together == value2->keep_together) &&
774 (value1->keep_with_next == value2->keep_with_next) &&
775 (value1->on_next_page == value2->on_next_page) &&
776 (value1->no_widow_protection == value2->no_widow_protection) &&
777 (value1->border_distance == value2->border_distance) &&
778 !psiconv_compare_color(value1->back_color,value2->back_color) &&
779 !psiconv_compare_bullet(value1->bullet,value2->bullet) &&
780 !psiconv_compare_border(value1->left_border,value2->left_border) &&
781 !psiconv_compare_border(value1->right_border,value2->right_border) &&
782 !psiconv_compare_border(value1->top_border,value2->top_border) &&
783 !psiconv_compare_border(value1->bottom_border,value2->bottom_border) &&
784 !psiconv_compare_all_tabs(value1->tabs,value2->tabs))
785 return 0;
786 else
787 return 1;
788}
789
790
791int psiconv_compare_character_layout(const psiconv_character_layout value1,
792 const psiconv_character_layout value2)
793{
794 if (!value1 || !value2)
795 return 1;
796 if ((value1->font_size == value2->font_size) &&
797 (value1->italic == value2->italic) &&
798 (value1->bold == value2->bold) &&
799 (value1->super_sub == value2->super_sub) &&
800 (value1->underline == value2->underline) &&
801 (value1->strikethrough == value2->strikethrough) &&
802 !psiconv_compare_color(value1->color,value2->color) &&
803 !psiconv_compare_color(value1->back_color,value2->back_color) &&
804 !psiconv_compare_font(value1->font,value2->font))
805 return 0;
806 else
807 return 1;
808}
809
810
811
812psiconv_word_styles_section psiconv_empty_word_styles_section(void)
813{
814 psiconv_word_styles_section result;
815 if (!(result = malloc(sizeof(*result))))
816 goto ERROR1;
817 if (!(result->styles = psiconv_list_new(sizeof(struct psiconv_word_style_s))))
818 goto ERROR2;
819 if (!(result->normal = malloc(sizeof(struct psiconv_word_style_s))))
820 goto ERROR3;
821 if (!(result->normal->character = psiconv_basic_character_layout()))
822 goto ERROR4;
823 if (!(result->normal->paragraph = psiconv_basic_paragraph_layout()))
824 goto ERROR5;
825 result->normal->hotkey = 'N';
826 result->normal->name = NULL;
827 result->normal->built_in = psiconv_bool_true;
828 result->normal->outline_level = 0;
829 return result;
830ERROR5:
831 psiconv_free_character_layout(result->normal->character);
832ERROR4:
833 free(result->normal);
834ERROR3:
835 psiconv_list_free(result->styles);
836ERROR2:
837 free(result);
838ERROR1:
839 return NULL;
840}
841
842psiconv_text_and_layout psiconv_empty_text_and_layout(void)
843{
844 return psiconv_list_new(sizeof(struct psiconv_paragraph_s));
845}
846
847psiconv_texted_section psiconv_empty_texted_section(void)
848{
849 psiconv_texted_section result;
850 if (!(result = malloc(sizeof(*result))))
851 goto ERROR1;
852 if (!(result->paragraphs = psiconv_empty_text_and_layout()))
853 goto ERROR2;
854 return result;
855ERROR2:
856 free(result);
857ERROR1:
858 return NULL;
859}
860
861psiconv_page_header psiconv_empty_page_header(void)
862{
863 psiconv_page_header result;
864 if (!(result = malloc(sizeof(*result))))
865 goto ERROR1;
866 result->on_first_page = psiconv_bool_true;
867 if (!(result->base_paragraph_layout = psiconv_basic_paragraph_layout()))
868 goto ERROR2;
869 if (!(result->base_character_layout = psiconv_basic_character_layout()))
870 goto ERROR3;
871 if (!(result->text = psiconv_empty_texted_section()))
872 goto ERROR4;
873 return result;
874ERROR4:
875 psiconv_free_character_layout(result->base_character_layout);
876ERROR3:
877 psiconv_free_paragraph_layout(result->base_paragraph_layout);
878ERROR2:
879 free(result);
880ERROR1:
881 return NULL;
882}
883
884psiconv_page_layout_section psiconv_empty_page_layout_section(void)
885{
886 psiconv_page_layout_section result;
887 if (!(result = malloc(sizeof(*result))))
888 goto ERROR1;
889 result->first_page_nr = 1;
890 result->header_dist = result->footer_dist = 1.27;
891 result->left_margin = result->right_margin = 3.175;
892 result->top_margin = result->bottom_margin = 2.54;
893 result->page_width = 21.0;
894 result->page_height = 29.7;
895 result->landscape = psiconv_bool_false;
896 if (!(result->header = psiconv_empty_page_header()))
897 goto ERROR2;
898 if (!(result->footer = psiconv_empty_page_header()))
899 goto ERROR3;
900 return result;
901ERROR3:
902 psiconv_free_page_header(result->header);
903ERROR2:
904 free(result);
905ERROR1:
906 return NULL;
907}
908
909psiconv_word_status_section psiconv_empty_word_status_section(void)
910{
911 psiconv_word_status_section result;
912 if (!(result = malloc(sizeof(*result))))
913 return NULL;
914 result->show_tabs = result->show_spaces = result->show_paragraph_ends =
915 result->show_hard_minus = result->show_hard_space =
916 result->fit_lines_to_screen = psiconv_bool_false;
917 result->show_full_pictures = result->show_full_graphs =
918 result->show_top_toolbar = result->show_side_toolbar =
919 psiconv_bool_true;
920 result->cursor_position = 0;
921 result->display_size = 1000;
922 return result;
923}
924
925psiconv_word_f psiconv_empty_word_f(void)
926{
927 psiconv_word_f result;
928 if (!(result = malloc(sizeof(*result))))
929 goto ERROR1;
930 if (!(result->page_sec = psiconv_empty_page_layout_section()))
931 goto ERROR2;
932 if (!(result->paragraphs = psiconv_empty_text_and_layout()))
933 goto ERROR3;
934 if (!(result->status_sec = psiconv_empty_word_status_section()))
935 goto ERROR4;
936 if (!(result->styles_sec = psiconv_empty_word_styles_section()))
937 goto ERROR5;
938 return result;
939ERROR5:
940 psiconv_free_word_status_section(result->status_sec);
941ERROR4:
942 psiconv_free_text_and_layout(result->paragraphs);
943ERROR3:
944 psiconv_free_page_layout_section(result->page_sec);
945ERROR2:
946 free(result);
947ERROR1:
948 return NULL;
949}
950
951psiconv_sheet_status_section psiconv_empty_sheet_status_section(void)
952{
953 psiconv_sheet_status_section result;
954 if (!(result = malloc(sizeof(*result))))
955 return NULL;
956 result->show_horizontal_scrollbar = result->show_vertical_scrollbar =
957 psiconv_triple_auto;
958 result->show_graph = psiconv_bool_false;
959 result->show_top_sheet_toolbar = result->show_side_sheet_toolbar =
960 result->show_top_graph_toolbar = result->show_side_graph_toolbar =
961 psiconv_bool_true;
962 result->cursor_row = result->cursor_column = 0;
963 result->sheet_display_size = result->graph_display_size = 1000;
964 return result;
965}
966
967psiconv_sheet_workbook_section psiconv_empty_sheet_workbook_section(void)
968{
969 psiconv_sheet_workbook_section result;
970 if (!(result = malloc(sizeof(*result))))
971 return NULL;
972 return result;
973}
974
975psiconv_sheet_f psiconv_empty_sheet_f(void)
976{
977 psiconv_sheet_f result;
978 if (!(result = malloc(sizeof(*result))))
979 goto ERROR1;
980 if (!(result->page_sec = psiconv_empty_page_layout_section()))
981 goto ERROR2;
982 if (!(result->status_sec = psiconv_empty_sheet_status_section()))
983 goto ERROR3;
984 if (!(result->workbook_sec = psiconv_empty_sheet_workbook_section()))
985 goto ERROR4;
986 return result;
987ERROR4:
988 psiconv_free_sheet_status_section(result->status_sec);
989ERROR3:
990 psiconv_free_page_layout_section(result->page_sec);
991ERROR2:
992 free(result);
993ERROR1:
994 return NULL;
995}
996
997psiconv_texted_f psiconv_empty_texted_f(void)
998{
999 psiconv_texted_f result;
1000 if (!(result = malloc(sizeof(*result))))
1001 goto ERROR1;
1002 if (!(result->page_sec = psiconv_empty_page_layout_section()))
1003 goto ERROR2;
1004 if (!(result->texted_sec = psiconv_empty_texted_section()))
1005 goto ERROR3;
1006 return result;
1007ERROR3:
1008 psiconv_free_page_layout_section(result->page_sec);
1009ERROR2:
1010 free(result);
1011ERROR1:
1012 return NULL;
1013}
1014
1015psiconv_paint_data_section psiconv_empty_paint_data_section(void)
1016{
1017 psiconv_paint_data_section result;
1018 if (!(result = malloc(sizeof(*result))))
1019 goto ERROR1;
1020 /* Is this correct? */
1021 result->xsize = result->ysize = result->pic_xsize = result->pic_ysize = 0;
1022 /* Probably forbidden... */
1023 if (!(result->red = malloc(0)))
1024 goto ERROR2;
1025 if (!(result->green = malloc(0)))
1026 goto ERROR3;
1027 if (!(result->blue = malloc(0)))
1028 goto ERROR4;
1029 return result;
1030ERROR4:
1031 free(result->green);
1032ERROR3:
1033 free(result->red);
1034ERROR2:
1035 free(result);
1036ERROR1:
1037 return NULL;
1038}
1039
1040
1041psiconv_pictures psiconv_empty_pictures(void)
1042{
1043 psiconv_pictures result;
1044 psiconv_paint_data_section pds;
1045 if (!(result = psiconv_list_new(sizeof(struct psiconv_paint_data_section_s))))
1046 goto ERROR1;
1047 if (!(pds = psiconv_empty_paint_data_section()))
1048 goto ERROR2;
1049 if (psiconv_list_add(result,pds))
1050 goto ERROR3;
1051 free(pds);
1052 return result;
1053ERROR3:
1054 psiconv_free_paint_data_section(pds);
1055ERROR2:
1056 psiconv_list_free(result);
1057ERROR1:
1058 return NULL;
1059}
1060
1061psiconv_mbm_f psiconv_empty_mbm_f(void)
1062{
1063 psiconv_mbm_f result;
1064 if (!(result = malloc(sizeof(*result))))
1065 goto ERROR1;
1066 if (!(result->sections = psiconv_empty_pictures()))
1067 goto ERROR2;
1068 return result;
1069ERROR2:
1070 free(result);
1071ERROR1:
1072 return NULL;
1073}
1074
1075psiconv_sketch_section psiconv_empty_sketch_section(void)
1076{
1077 psiconv_sketch_section result;
1078 if (!(result = malloc(sizeof(*result))))
1079 goto ERROR1;
1080 result->form_xsize = 320;
1081 result->form_ysize = 200;
1082 result->picture_x_offset = result->picture_y_offset = result->picture_xsize =
1083 result->picture_ysize = 0;
1084 result->magnification_x = result->magnification_y = 1.0;
1085 result->cut_left = result->cut_right = result->cut_top =
1086 result->cut_bottom = 0.0;
1087 if (!(result->picture = psiconv_empty_paint_data_section()))
1088 goto ERROR2;
1089 return result;
1090ERROR2:
1091 free(result);
1092ERROR1:
1093 return NULL;
1094}
1095
1096psiconv_sketch_f psiconv_empty_sketch_f(void)
1097{
1098 psiconv_sketch_f result;
1099 if (!(result = malloc(sizeof(*result))))
1100 goto ERROR1;
1101 if (!(result->sketch_sec = psiconv_empty_sketch_section()))
1102 goto ERROR2;
1103 return result;
1104ERROR2:
1105 free(result);
1106ERROR1:
1107 return NULL;
1108}
1109
1110psiconv_cliparts psiconv_empty_cliparts(void)
1111{
1112 /* Is this correct? */
1113 return psiconv_list_new(sizeof(struct psiconv_clipart_section_s));
1114}
1115
1116psiconv_clipart_f psiconv_empty_clipart_f(void)
1117{
1118 psiconv_clipart_f result;
1119 if (!(result = malloc(sizeof(*result))))
1120 goto ERROR1;
1121 if (!(result->sections = psiconv_empty_cliparts()))
1122 goto ERROR2;
1123 return result;
1124ERROR2:
1125 free(result);
1126ERROR1:
1127 return NULL;
1128}
1129
1130psiconv_file psiconv_empty_file(psiconv_file_type_t type)
1131{
1132 psiconv_file result;
1133 if (!(result = malloc(sizeof(*result))))
1134 return NULL;
1135 result->type = type;
1136 if (type == psiconv_word_file) {
1137 if (!(result->file = psiconv_empty_word_f()))
1138 goto ERROR;
1139 } else if (type == psiconv_sheet_file) {
1140 if (!(result->file = psiconv_empty_sheet_f()))
1141 goto ERROR;
1142 } else if (type == psiconv_texted_file) {
1143 if (!(result->file = psiconv_empty_texted_f()))
1144 goto ERROR;
1145 } else if (type == psiconv_mbm_file) {
1146 if (!(result->file = psiconv_empty_mbm_f()))
1147 goto ERROR;
1148 } else if (type == psiconv_sketch_file) {
1149 if (!(result->file = psiconv_empty_sketch_f()))
1150 goto ERROR;
1151 } else if (type == psiconv_clipart_file) {
1152 if (!(result->file = psiconv_empty_clipart_f()))
1153 goto ERROR;
1154 } else
1155 goto ERROR;
1156 return result;
1157ERROR:
1158 free(result);
1159 return NULL;
1160}

Legend:
Removed from v.62  
changed lines
  Added in v.95

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