--- psiconv/trunk/lib/psiconv/generate_page.c 2002/01/29 18:38:38 142 +++ psiconv/trunk/lib/psiconv/generate_page.c 2003/11/25 17:57:05 168 @@ -32,7 +32,8 @@ -int psiconv_write_page_header(psiconv_buffer buf, +int psiconv_write_page_header(const psiconv_config config, + psiconv_buffer buf, const psiconv_page_header value, psiconv_buffer *extra_buf) { @@ -41,7 +42,7 @@ psiconv_character_layout basechar; if (!value) { - psiconv_warn(0,psiconv_buffer_length(buf),"Null page header"); + psiconv_warn(config,0,psiconv_buffer_length(buf),"Null page header"); res = -PSICONV_E_GENERATE; goto ERROR1; } @@ -56,24 +57,24 @@ } /* Unknown byte */ - if ((res = psiconv_write_u8(buf,0x01))) + if ((res = psiconv_write_u8(config,buf,0x01))) goto ERROR3; - if ((res = psiconv_write_bool(buf,value->on_first_page))) + if ((res = psiconv_write_bool(config,buf,value->on_first_page))) goto ERROR3; /* Three unknown bytes */ - if ((res = psiconv_write_u8(buf,0x00))) + if ((res = psiconv_write_u8(config,buf,0x00))) goto ERROR3; - if ((res = psiconv_write_u8(buf,0x00))) + if ((res = psiconv_write_u8(config,buf,0x00))) goto ERROR3; - if ((res = psiconv_write_u8(buf,0x00))) + if ((res = psiconv_write_u8(config,buf,0x00))) goto ERROR3; - if ((res = psiconv_write_paragraph_layout_list(buf, + if ((res = psiconv_write_paragraph_layout_list(config,buf, value->base_paragraph_layout,basepara))) goto ERROR3; - if ((res = psiconv_write_character_layout_list(buf, + if ((res = psiconv_write_character_layout_list(config,buf, value->base_character_layout,basechar))) goto ERROR3; - res = psiconv_write_texted_section(buf,value->text, + res = psiconv_write_texted_section(config,buf,value->text, value->base_character_layout, value->base_paragraph_layout,extra_buf); ERROR3: @@ -84,43 +85,44 @@ return res; } -int psiconv_write_page_layout_section(psiconv_buffer buf, +int psiconv_write_page_layout_section(const psiconv_config config, + psiconv_buffer buf, const psiconv_page_layout_section value) { int res; psiconv_buffer header_buf,footer_buf; if (!value) { - psiconv_warn(0,psiconv_buffer_length(buf),"Null page section"); + psiconv_warn(config,0,psiconv_buffer_length(buf),"Null page section"); res = -PSICONV_E_GENERATE; goto ERROR1; } - if ((res = psiconv_write_u32(buf,value->first_page_nr))) + if ((res = psiconv_write_u32(config,buf,value->first_page_nr))) goto ERROR1; - if ((res = psiconv_write_length(buf,value->header_dist))) + if ((res = psiconv_write_length(config,buf,value->header_dist))) goto ERROR1; - if ((res = psiconv_write_length(buf,value->footer_dist))) + if ((res = psiconv_write_length(config,buf,value->footer_dist))) goto ERROR1; - if ((res = psiconv_write_length(buf,value->left_margin))) + if ((res = psiconv_write_length(config,buf,value->left_margin))) goto ERROR1; - if ((res = psiconv_write_length(buf,value->right_margin))) + if ((res = psiconv_write_length(config,buf,value->right_margin))) goto ERROR1; - if ((res = psiconv_write_length(buf,value->top_margin))) + if ((res = psiconv_write_length(config,buf,value->top_margin))) goto ERROR1; - if ((res = psiconv_write_length(buf,value->bottom_margin))) + if ((res = psiconv_write_length(config,buf,value->bottom_margin))) goto ERROR1; - if ((res = psiconv_write_page_header(buf,value->header,&header_buf))) + if ((res = psiconv_write_page_header(config,buf,value->header,&header_buf))) goto ERROR1; - if ((res = psiconv_write_page_header(buf,value->footer,&footer_buf))) + if ((res = psiconv_write_page_header(config,buf,value->footer,&footer_buf))) goto ERROR2; - if ((res = psiconv_write_u32(buf,PSICONV_ID_PAGE_DIMENSIONS2))) + if ((res = psiconv_write_u32(config,buf,PSICONV_ID_PAGE_DIMENSIONS2))) goto ERROR3; - if ((res = psiconv_write_length(buf,value->page_width))) + if ((res = psiconv_write_length(config,buf,value->page_width))) goto ERROR3; - if ((res = psiconv_write_length(buf,value->page_height))) + if ((res = psiconv_write_length(config,buf,value->page_height))) goto ERROR3; - if ((res = psiconv_write_bool(buf,value->landscape))) + if ((res = psiconv_write_bool(config,buf,value->landscape))) goto ERROR3; if ((res = psiconv_buffer_concat(buf,header_buf))) goto ERROR3;