|
|
@@ -37,24 +37,31 @@ int main(int argc, char *argv[]) |
|
|
|
cucul_t *qq; |
|
|
|
cucul_dither_t *dither; |
|
|
|
cucul_buffer_t *buffer; |
|
|
|
char const * const * exports, * const * p; |
|
|
|
int x, y; |
|
|
|
|
|
|
|
exports = cucul_get_export_list(); |
|
|
|
|
|
|
|
if(argc != 2) |
|
|
|
{ |
|
|
|
fprintf(stderr, "%s: wrong argument count\n", argv[0]); |
|
|
|
fprintf(stderr, "usage: %s <format>\n", argv[0]); |
|
|
|
fprintf(stderr, "where <format> is one of: ansi, html, html3, irc, ps, svg\n"); |
|
|
|
fprintf(stderr, "where <format> is one of:\n"); |
|
|
|
for(p = exports; *p; p += 2) |
|
|
|
fprintf(stderr, " \"%s\" (%s)\n", *p, *(p + 1)); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
|
|
|
|
if(strcasecmp(argv[1], "ansi") |
|
|
|
&& strcasecmp(argv[1], "html") |
|
|
|
&& strcasecmp(argv[1], "html3") |
|
|
|
&& strcasecmp(argv[1], "irc") |
|
|
|
&& strcasecmp(argv[1], "ps") |
|
|
|
&& strcasecmp(argv[1], "svg")) |
|
|
|
for(p = exports; *p; p += 2) |
|
|
|
if(!strcasecmp(argv[1], *p)) |
|
|
|
break; |
|
|
|
|
|
|
|
if(!*p) |
|
|
|
{ |
|
|
|
fprintf(stderr, "%s: unknown format `%s'\n", argv[0], argv[1]); |
|
|
|
fprintf(stderr, "please use one of:\n"); |
|
|
|
for(p = exports; *p; p += 2) |
|
|
|
fprintf(stderr, " \"%s\" (%s)\n", *p, *(p + 1)); |
|
|
|
exit(-1); |
|
|
|
} |
|
|
|
|
|
|
@@ -89,6 +96,12 @@ int main(int argc, char *argv[]) |
|
|
|
cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_LIGHTBLUE); |
|
|
|
cucul_putstr(qq, WIDTH / 2 - 7, HEIGHT / 2, " LIBCACA "); |
|
|
|
|
|
|
|
for(x = 0; x < 16; x++) |
|
|
|
{ |
|
|
|
cucul_set_truecolor(qq, 0xff00 | x, 0xf00f | (x << 4)); |
|
|
|
cucul_putstr(qq, WIDTH / 2 - 7 + x, HEIGHT / 2 + 5, "#"); |
|
|
|
} |
|
|
|
|
|
|
|
buffer = cucul_create_export(qq, argv[1]); |
|
|
|
fwrite(cucul_get_buffer_data(buffer), |
|
|
|
cucul_get_buffer_size(buffer), 1, stdout); |
|
|
|