Ignore:
Timestamp:
Mar 28, 2006, 12:16:58 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Changed the 2nd argument of cucul_create_export to a string. This way we can add new exporters without changing the API.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/test/export.c

    r678 r706  
    3636{
    3737    cucul_t *qq;
    38     enum cucul_format format;
    3938    struct cucul_bitmap *bitmap;
    4039    struct cucul_export *buffer;
     
    4948    }
    5049
    51     if(!strcasecmp(argv[1], "ansi"))
    52         format = CUCUL_FORMAT_ANSI;
    53     else if(!strcasecmp(argv[1], "html"))
    54         format = CUCUL_FORMAT_HTML;
    55     else if(!strcasecmp(argv[1], "html3"))
    56         format = CUCUL_FORMAT_HTML3;
    57     else if(!strcasecmp(argv[1], "irc"))
    58         format = CUCUL_FORMAT_IRC;
    59     else if(!strcasecmp(argv[1], "ps"))
    60         format = CUCUL_FORMAT_PS;
    61     else if(!strcasecmp(argv[1], "svg"))
    62         format = CUCUL_FORMAT_SVG;
    63     else
     50    if(strcasecmp(argv[1], "ansi")
     51        && strcasecmp(argv[1], "html")
     52        && strcasecmp(argv[1], "html3")
     53        && strcasecmp(argv[1], "irc")
     54        && strcasecmp(argv[1], "ps")
     55        && strcasecmp(argv[1], "svg"))
    6456    {
    6557        fprintf(stderr, "%s: unknown format `%s'\n", argv[0], argv[1]);
     
    9991    cucul_putstr(qq, WIDTH / 2 - 7, HEIGHT / 2, "    LIBCACA    ");
    10092
    101     buffer = cucul_create_export(qq, format);
     93    buffer = cucul_create_export(qq, argv[1]);
    10294    fwrite(buffer->buffer, buffer->size - 1, 1, stdout);
    10395    cucul_free_export(buffer);
Note: See TracChangeset for help on using the changeset viewer.