1 | /* |
1 | /* |
2 | generate_page.c - Part of psiconv, a PSION 5 file formats converter |
2 | generate_page.c - Part of psiconv, a PSION 5 file formats converter |
3 | Copyright (c) 2000-2004 Frodo Looijaard <frodol@dds.nl> |
3 | Copyright (c) 2000-2014 Frodo Looijaard <frodo@frodo.looijaard.name> |
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. |
… | |
… | |
48 | res = -PSICONV_E_GENERATE; |
48 | res = -PSICONV_E_GENERATE; |
49 | goto ERROR1; |
49 | goto ERROR1; |
50 | } |
50 | } |
51 | |
51 | |
52 | if (!(basepara=psiconv_basic_paragraph_layout())) { |
52 | if (!(basepara=psiconv_basic_paragraph_layout())) { |
|
|
53 | psiconv_error(config,lev+1,0,"Out of memory error"); |
53 | res = -PSICONV_E_NOMEM; |
54 | res = -PSICONV_E_NOMEM; |
54 | goto ERROR1; |
55 | goto ERROR1; |
55 | } |
56 | } |
56 | if (!(basechar=psiconv_basic_character_layout())) { |
57 | if (!(basechar=psiconv_basic_character_layout())) { |
|
|
58 | psiconv_error(config,lev+1,0,"Out of memory error"); |
57 | res = -PSICONV_E_NOMEM; |
59 | res = -PSICONV_E_NOMEM; |
58 | goto ERROR2; |
60 | goto ERROR2; |
59 | } |
61 | } |
60 | |
62 | |
61 | /* Unknown byte */ |
63 | /* Unknown byte */ |
… | |
… | |
130 | goto ERROR3; |
132 | goto ERROR3; |
131 | if ((res = psiconv_write_length(config,buf,lev+1,value->page_height))) |
133 | if ((res = psiconv_write_length(config,buf,lev+1,value->page_height))) |
132 | goto ERROR3; |
134 | goto ERROR3; |
133 | if ((res = psiconv_write_bool(config,buf,lev+1,value->landscape))) |
135 | if ((res = psiconv_write_bool(config,buf,lev+1,value->landscape))) |
134 | goto ERROR3; |
136 | goto ERROR3; |
135 | if ((res = psiconv_buffer_concat(buf,header_buf))) |
137 | if ((res = psiconv_buffer_concat(buf,header_buf))) { |
|
|
138 | psiconv_error(config,lev+1,0,"Out of memory error"); |
136 | goto ERROR3; |
139 | goto ERROR3; |
|
|
140 | } |
137 | res = psiconv_buffer_concat(buf,footer_buf); |
141 | if ((res = psiconv_buffer_concat(buf,footer_buf))) { |
|
|
142 | psiconv_error(config,lev+1,0,"Out of memory error"); |
|
|
143 | goto ERROR3; |
|
|
144 | } |
138 | |
145 | |
139 | |
146 | |
140 | ERROR3: |
147 | ERROR3: |
141 | psiconv_buffer_free(footer_buf); |
148 | psiconv_buffer_free(footer_buf); |
142 | ERROR2: |
149 | ERROR2: |