Changeset 571


Ignore:
Timestamp:
Mar 9, 2006, 2:08:41 PM (14 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Updated README for network driver, fixed remaining exporters
Location:
libcaca/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/README

    r566 r571  
    1111     --enable-gl: support for OpenGL rendering
    1212     --enable-win32: support for the Windows console
     13     --enable-network: support for network output
    1314
    1415     --disable-imlib2: remove Imlib2 support in cacaview
  • libcaca/trunk/cucul/cucul.c

    r568 r571  
    7676
    7777    qq->ansi_buffer = NULL;
     78    qq->irc_buffer = NULL;
     79    qq->html3_buffer = NULL;
     80    qq->html_buffer = NULL;
    7881   
    7982    return qq;
     
    277280    if(qq->ansi_buffer)
    278281        free(qq->ansi_buffer);
     282    if(qq->irc_buffer)
     283        free(qq->irc_buffer);
     284    if(qq->html3_buffer)
     285        free(qq->html3_buffer);
     286    if(qq->html_buffer)
     287        free(qq->html_buffer);
     288
    279289
    280290    free(qq);
  • libcaca/trunk/cucul/cucul_internals.h

    r568 r571  
    4848
    4949    /* Exporters facilities */
    50     unsigned char *ansi_buffer;
     50    char *ansi_buffer;
     51    char *irc_buffer;
     52    char *html3_buffer;
     53    char *html_buffer;
     54   
     55
    5156
    5257};
  • libcaca/trunk/cucul/export.c

    r568 r571  
    4545        0x444, 0x44f, 0x4f4, 0x4ff, 0xf44, 0xf4f, 0xff4, 0xfff,
    4646    };
    47     char *buffer, *cur;
     47    char *cur;
    4848    unsigned int x, y, len;
    4949
     
    5151     * 40 -> max size used for a pixel (plus 10, never know)*/
    5252    /* FIXME: Check this value */
    53     buffer = malloc((13000 + ((qq->width*qq->height) * 40)) * sizeof(char));
    54     cur = buffer;
     53    if(qq->html_buffer)
     54        free(qq->html_buffer);
     55
     56    qq->html_buffer = malloc((13000 + ((qq->width*qq->height) * 40)) * sizeof(char));
     57    cur = qq->html_buffer;
    5558
    5659    /* HTML header */
     
    97100
    98101    /* Crop to really used size */
    99     *size = (strlen(buffer) + 1) * sizeof(char);
    100     buffer = realloc(buffer, *size);
    101 
    102     return buffer;
     102    *size = (strlen(qq->html_buffer) + 1) * sizeof(char);
     103    qq->html_buffer = realloc(qq->html_buffer, *size);
     104
     105    return qq->html_buffer;
    103106}
    104107
     
    120123        0xff4444, 0xff44ff, 0xffff44, 0xffffff,
    121124    };
    122     char *buffer, *cur;
     125    char *cur;
    123126    unsigned int x, y, len;
    124127
    125128    /* 13000 -> css palette
    126129     * 40 -> max size used for a pixel (plus 10, never know) */
    127     buffer = malloc((13000 + ((qq->width*qq->height)*40))*sizeof(char));
    128     cur = buffer;
     130
     131    if(qq->html3_buffer)
     132        free(qq->html3_buffer);
     133
     134    qq->html3_buffer = malloc((13000 + ((qq->width*qq->height)*40))*sizeof(char));
     135    cur = qq->html3_buffer;
    129136
    130137    /* Table */
     
    174181
    175182    /* Crop to really used size */
    176     *size = (strlen(buffer) + 1) * sizeof(char);
    177     buffer = realloc(buffer, *size);
     183    *size = (strlen(qq->html3_buffer) + 1) * sizeof(char);
     184    qq->html3_buffer = realloc(qq->html3_buffer, *size);
    178185   
    179     return buffer;
     186    return qq->html3_buffer;
    180187}
    181188
     
    193200    };
    194201
    195     char *buffer, *cur;
     202    char *cur;
    196203    unsigned int x, y;
    197204
     
    203210     * In real life, the average bytes per pixel value will be around 5.
    204211     */
    205     buffer = malloc((2 + (qq->width * qq->height * 11)) * sizeof(char));
    206     cur = buffer;
     212
     213    if(qq->irc_buffer)
     214        free(qq->irc_buffer);
     215
     216    qq->irc_buffer = malloc((2 + (qq->width * qq->height * 11)) * sizeof(char));
     217    cur = qq->irc_buffer;
    207218
    208219    *cur++ = '\x0f';
     
    256267
    257268    /* Crop to really used size */
    258     *size = (strlen(buffer) + 1) * sizeof(char);
    259     buffer = realloc(buffer, *size);
    260 
    261     return buffer;
     269    *size = (strlen(qq->irc_buffer) + 1) * sizeof(char);
     270    qq->irc_buffer = realloc(qq->irc_buffer, *size);
     271
     272    return qq->irc_buffer;
    262273}
    263274
Note: See TracChangeset for help on using the changeset viewer.