--- psiconv/trunk/lib/psiconv/generate_layout.c 2000/12/25 14:34:17 78 +++ psiconv/trunk/lib/psiconv/generate_layout.c 2000/12/25 22:25:33 79 @@ -27,7 +27,7 @@ { int res; if (!value) { - psiconv_warn(0,psiconv_list_length(buf),"Null color"); + psiconv_warn(0,psiconv_buffer_length(buf),"Null color"); return -PSICONV_E_GENERATE; } if ((res = psiconv_write_u8(buf,value->red))) @@ -41,7 +41,7 @@ { int res; if (!value) { - psiconv_warn(0,psiconv_list_length(buf),"Null font"); + psiconv_warn(0,psiconv_buffer_length(buf),"Null font"); return -PSICONV_E_GENERATE; } if ((res = psiconv_write_string(buf,value->name))) @@ -54,11 +54,11 @@ int res; if (!value) { - psiconv_warn(0,psiconv_list_length(buf),"Null border"); + psiconv_warn(0,psiconv_buffer_length(buf),"Null border"); return -PSICONV_E_GENERATE; } if (value->kind > psiconv_border_dotdotdashed) - psiconv_warn(0,psiconv_list_length(buf), + psiconv_warn(0,psiconv_buffer_length(buf), "Unknown border kind (%d); assuming none",value->kind); if ((res =psiconv_write_u8(buf,value->kind == psiconv_border_none?0: value->kind == psiconv_border_solid?1: @@ -84,11 +84,11 @@ int res; psiconv_buffer extra_buf; if (!value) { - psiconv_warn(0,psiconv_list_length(buf),"Null bullet"); + psiconv_warn(0,psiconv_buffer_length(buf),"Null bullet"); return -PSICONV_E_GENERATE; } - if (!(extra_buf = psiconv_new_buffer())) + if (!(extra_buf = psiconv_buffer_new(0))) return -PSICONV_E_NOMEM; if ((res = psiconv_write_size(extra_buf,value->font_size))) goto ERROR; @@ -103,12 +103,12 @@ if ((res = psiconv_write_font(extra_buf,value->font))) goto ERROR; - if ((res = psiconv_write_u8(buf,psiconv_list_length(extra_buf)))) + if ((res = psiconv_write_u8(buf,psiconv_buffer_length(extra_buf)))) goto ERROR; - res = psiconv_list_concat(buf,extra_buf); + res = psiconv_buffer_concat(buf,extra_buf); ERROR: - psiconv_free_buffer(extra_buf); + psiconv_buffer_free(extra_buf); return res; } @@ -116,7 +116,7 @@ { int res; if (!value) { - psiconv_warn(0,psiconv_list_length(buf),"Null tab"); + psiconv_warn(0,psiconv_buffer_length(buf),"Null tab"); return -PSICONV_E_GENERATE; } if ((res = psiconv_write_length(buf,value->location))) @@ -124,7 +124,7 @@ if ((value->kind != psiconv_tab_left) && (value->kind != psiconv_tab_right) && (value->kind != psiconv_tab_centre)) - psiconv_warn(0,psiconv_list_length(buf), + psiconv_warn(0,psiconv_buffer_length(buf), "Unknown tab kind (%d); assuming left",value->kind); return psiconv_write_u8(buf, value->kind == psiconv_tab_right?2: value->kind == psiconv_tab_centre?3:1); @@ -139,10 +139,10 @@ psiconv_tab tab; if (!value) { - psiconv_warn(0,psiconv_list_length(buf),"Null paragraph layout list"); + psiconv_warn(0,psiconv_buffer_length(buf),"Null paragraph layout list"); return -PSICONV_E_GENERATE; } - if (!(extra_buf = psiconv_new_buffer())) + if (!(extra_buf = psiconv_buffer_new(0))) return -PSICONV_E_NOMEM; if (!base || psiconv_compare_color(base->back_color,value->back_color)) { @@ -178,7 +178,7 @@ goto ERROR; if ((value->justify_hor < psiconv_justify_left) || (value->justify_hor > psiconv_justify_full)) - psiconv_warn(0,psiconv_list_length(buf), + psiconv_warn(0,psiconv_buffer_length(buf), "Unknown horizontal justify (%d); assuming left", value->justify_hor); if ((res = psiconv_write_u8(extra_buf, @@ -193,7 +193,7 @@ goto ERROR; if ((value->justify_ver < psiconv_justify_top) || (value->justify_ver > psiconv_justify_bottom)) - psiconv_warn(0,psiconv_list_length(buf), + psiconv_warn(0,psiconv_buffer_length(buf), "Unknown vertical justify (%d); assuming middle", value->justify_ver); if ((res = psiconv_write_u8(extra_buf, @@ -305,7 +305,7 @@ } if (!value->tabs || !value->tabs->extras) { - psiconv_warn(0,psiconv_list_length(buf),"Null tabs"); + psiconv_warn(0,psiconv_buffer_length(buf),"Null tabs"); res = -PSICONV_E_GENERATE; goto ERROR; } @@ -320,7 +320,7 @@ goto ERROR; for (i = 0; i < psiconv_list_length(value->tabs->extras); i++) { if (!(tab = psiconv_list_get(value->tabs->extras,i))) { - psiconv_warn(0,psiconv_list_length(buf),"Massive memory corruption"); + psiconv_warn(0,psiconv_buffer_length(buf),"Massive memory corruption"); res = -PSICONV_E_NOMEM; goto ERROR; } @@ -331,13 +331,13 @@ } } - if ((res = psiconv_write_u32(buf,psiconv_list_length(extra_buf)))) + if ((res = psiconv_write_u32(buf,psiconv_buffer_length(extra_buf)))) goto ERROR; - res = psiconv_list_concat(buf,extra_buf); + res = psiconv_buffer_concat(buf,extra_buf); ERROR: - psiconv_free_buffer(extra_buf); + psiconv_buffer_free(extra_buf); return res; } @@ -348,10 +348,10 @@ int res; psiconv_buffer extra_buf; if (!value) { - psiconv_warn(0,psiconv_list_length(buf),"Null character layout list"); + psiconv_warn(0,psiconv_buffer_length(buf),"Null character layout list"); return -PSICONV_E_GENERATE; } - if (!(extra_buf = psiconv_new_buffer())) + if (!(extra_buf = psiconv_buffer_new(0))) return -PSICONV_E_NOMEM; if (!base || psiconv_compare_color(base->color,value->color)) { @@ -393,7 +393,7 @@ if ((value->super_sub != psiconv_superscript) && (value->super_sub != psiconv_subscript) && (value->super_sub != psiconv_normalscript)) - psiconv_warn(0,psiconv_list_length(buf), + psiconv_warn(0,psiconv_buffer_length(buf), "Unknown supersubscript (%d); assuming normal", value->super_sub); if ((res = psiconv_write_u8(extra_buf,0x1f))) @@ -425,12 +425,12 @@ goto ERROR; } - if ((res = psiconv_write_u32(buf,psiconv_list_length(extra_buf)))) + if ((res = psiconv_write_u32(buf,psiconv_buffer_length(extra_buf)))) goto ERROR; - res = psiconv_list_concat(buf,extra_buf); + res = psiconv_buffer_concat(buf,extra_buf); ERROR: - psiconv_free_buffer(extra_buf); + psiconv_buffer_free(extra_buf); return res; }