Browse Source

Get rid of deprecated libcaca calls now that beta17 is out.

pull/1/head
Sam Hocevar sam 15 years ago
parent
commit
86d44a6982
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      src/render.c
  2. +1
    -1
      tools/caca2tlf.c

+ 3
- 3
src/render.c View File

@@ -63,7 +63,7 @@ int render_stdin(context_t *cx)
break; break;


caca_set_canvas_size(cv, 0, 0); caca_set_canvas_size(cv, 0, 0);
caca_import_memory(cv, line, strlen(line), "utf8");
caca_import_canvas_from_memory(cv, line, strlen(line), "utf8");
for(i = 0; i < caca_get_canvas_width(cv); i++) for(i = 0; i < caca_get_canvas_width(cv); i++)
{ {
uint32_t ch = caca_get_char(cv, i, 0); uint32_t ch = caca_get_char(cv, i, 0);
@@ -106,7 +106,7 @@ int render_list(context_t *cx, int argc, char *argv[])
len = strlen(parser); len = strlen(parser);


caca_set_canvas_size(cv, 0, 0); caca_set_canvas_size(cv, 0, 0);
caca_import_memory(cv, parser, len, "utf8");
caca_import_canvas_from_memory(cv, parser, len, "utf8");
for(i = 0; i < caca_get_canvas_width(cv); i++) for(i = 0; i < caca_get_canvas_width(cv); i++)
{ {
uint32_t ch = caca_get_char(cv, i, 0); uint32_t ch = caca_get_char(cv, i, 0);
@@ -156,7 +156,7 @@ static int render_flush(context_t *cx)
filter_do(cx); filter_do(cx);


/* Output line */ /* Output line */
buffer = caca_export_memory(cx->torender, cx->export, &len);
buffer = caca_export_canvas_to_memory(cx->torender, cx->export, &len);
if(!buffer) if(!buffer)
return -1; return -1;
fwrite(buffer, len, 1, stdout); fwrite(buffer, len, 1, stdout);


+ 1
- 1
tools/caca2tlf.c View File

@@ -331,7 +331,7 @@ static void add_char(unsigned long int ch)
caca_draw_line(out, mygw, 0, mygw, gh - 1, '@'); caca_draw_line(out, mygw, 0, mygw, gh - 1, '@');
caca_put_char(out, mygw + 1, gh - 1, '@'); caca_put_char(out, mygw + 1, gh - 1, '@');


buf = caca_export_memory(out, "utf8", &len);
buf = caca_export_canvas_to_memory(out, "utf8", &len);
fwrite(buf, len, 1, stdout); fwrite(buf, len, 1, stdout);
free(buf); free(buf);
} }


Loading…
Cancel
Save