X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Foutput%2Fhtml.c;h=951208717f8ec7a47bc964f15262511f7c45294b;hb=fe249af480c19f05e951076f5e53f75a2db36ed2;hp=d5b4f5d4fb8d2443fde655cf3a6334144d3e0deb;hpb=3f2ed1c5fe6dc692ca00bb18a15e41617fa2d37d;p=pspp-builds.git diff --git a/src/output/html.c b/src/output/html.c index d5b4f5d4..95120871 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -50,7 +50,7 @@ static void print_title_tag (FILE *file, const char *name, const char *content); static bool -html_open_driver (struct outp_driver *this, const struct string *options) +html_open_driver (struct outp_driver *this, struct substring options) { struct html_driver_ext *x; @@ -165,7 +165,7 @@ handle_option (struct outp_driver *this, break; case string_arg: free (x->file_name); - x->file_name = xstrdup (ds_c_str (val)); + x->file_name = ds_xstrdup (val); break; default: abort (); @@ -233,7 +233,7 @@ escape_string (FILE *file, TEXT. */ void html_put_cell_contents (struct outp_driver *this, - unsigned int opts, struct fixed_string *text) + unsigned int opts, const struct substring text) { struct html_driver_ext *x = this->ext; @@ -244,15 +244,15 @@ html_put_cell_contents (struct outp_driver *this, if (opts & TAB_FIX) { fputs ("", x->file); - escape_string (x->file, ls_c_str (text), ls_length (text), " "); + escape_string (x->file, ss_data (text), ss_length (text), " "); fputs ("", x->file); } else { - size_t initial_spaces = strspn (ls_c_str (text), " \t"); + size_t initial_spaces = ss_span (text, ss_cstr (CC_SPACES)); escape_string (x->file, - ls_c_str (text) + initial_spaces, - ls_length (text) - initial_spaces, + ss_data (text) + initial_spaces, + ss_length (text) - initial_spaces, " "); } if (opts & TAB_EMPH) @@ -269,7 +269,7 @@ output_tab_table (struct outp_driver *this, struct tab_table *t) if (t->nr == 1 && t->nc == 1) { fputs ("
", x->file); - html_put_cell_contents (this, t->ct[0], t->cc); + html_put_cell_contents (this, t->ct[0], *t->cc); fputs ("
\n", x->file); return; @@ -277,11 +277,10 @@ output_tab_table (struct outp_driver *this, struct tab_table *t) fputs ("