Changeset 644


Ignore:
Timestamp:
Mar 18, 2006, 1:06:24 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Renamed cucul_buffer to cucul_export. Vanilla rum rules.
Location:
libcaca/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver_network.c

    r619 r644  
    101101    char prefix[sizeof(INIT_PREFIX)];
    102102
    103     struct cucul_buffer *ex;
     103    struct cucul_export *ex;
    104104
    105105    int client_count;
     
    220220
    221221    if(kk->drv.p->ex)
    222         cucul_free(kk->drv.p->ex);
     222        cucul_free_export(kk->drv.p->ex);
    223223
    224224    /* Restore SIGPIPE handler */
     
    253253    if(kk->drv.p->ex)
    254254    {
    255         cucul_free(kk->drv.p->ex);
     255        cucul_free_export(kk->drv.p->ex);
    256256        kk->drv.p->ex = NULL;
    257257    }
     
    259259    /* Get ANSI representation of the image and skip the end-of buffer
    260260     * linefeed ("\r\n\0", 3 bytes) */
    261     kk->drv.p->ex = cucul_export(kk->qq, CUCUL_FORMAT_ANSI);
     261    kk->drv.p->ex = cucul_get_export(kk->qq, CUCUL_FORMAT_ANSI);
    262262    kk->drv.p->ex->size -= 3;
    263263
     
    375375                    fprintf(stderr, "client %i said: %.02x %.02x %.02x (%s %s %s)\n",
    376376                            c->fd, c->inbuf[0], c->inbuf[1], c->inbuf[2],
    377                             COMMAND_NAME(c->inbuf[0]), COMMAND_NAME(c->inbuf[1]), OPTION_NAME(c->inbuf[2]));
     377                            COMMAND_NAME(c->inbuf[0]), COMMAND_NAME(c->inbuf[1]), OPTION_NAME(c->inbuf[2]));
    378378                    /* Just ignore, lol */
    379379                    c->inbytes = 0;
  • libcaca/trunk/cucul/cucul.c

    r633 r644  
    3030
    3131static void cucul_read_environment(cucul_t *);
    32 void _cucul_set_size(cucul_t *, unsigned int, unsigned int);
    3332
    3433/** \brief Initialise \e libcucul.
     
    277276}
    278277
    279 struct cucul_buffer * cucul_export(cucul_t *qq, enum cucul_format format)
    280 {
    281     struct cucul_buffer *ex;
    282 
    283     ex = malloc(sizeof(struct cucul_buffer));
     278struct cucul_export * cucul_get_export(cucul_t *qq, enum cucul_format format)
     279{
     280    struct cucul_export *ex;
     281
     282    ex = malloc(sizeof(struct cucul_export));
    284283
    285284    switch(format)
     
    311310}
    312311
    313 void cucul_free(struct cucul_buffer *ex)
     312void cucul_free_export(struct cucul_export *ex)
    314313{
    315314    free(ex->buffer);
  • libcaca/trunk/cucul/cucul.h

    r620 r644  
    2121#ifndef __CUCUL_H__
    2222#define __CUCUL_H__
     23
     24#define CUCUL_API_VERSION_1
    2325
    2426#ifdef __cplusplus
     
    216218 *
    217219 *  These functions export the current canvas to various text formats. It
    218  *  is necessary to call cucul_free() to dispose of the data.
    219  *
    220  *  @{ */
    221 struct cucul_buffer
     220 *  is necessary to call cucul_free_export() to dispose of the data.
     221 *
     222 *  @{ */
     223struct cucul_export
    222224{
    223225    unsigned int size;
     
    225227};
    226228
    227 struct cucul_buffer * cucul_export(cucul_t *, enum cucul_format);
    228 void cucul_free(struct cucul_buffer *);
     229struct cucul_export * cucul_get_export(cucul_t *, enum cucul_format);
     230void cucul_free_export(struct cucul_export *);
    229231
    230232/*  @} */
  • libcaca/trunk/cucul/export_ansi.c

    r609 r644  
    3030#include "cucul_internals.h"
    3131
    32 
    33 
    3432/** \brief Generate ANSI representation of current image.
    3533 *
     
    4038 *  \return buffer containing generated ANSI codes as a big string
    4139 */
    42 void _cucul_get_ansi(cucul_t *qq, struct cucul_buffer *ex)
     40void _cucul_get_ansi(cucul_t *qq, struct cucul_export *ex)
    4341{
    4442    static int const palette[] =
  • libcaca/trunk/cucul/export_html.c

    r624 r644  
    3030#include "cucul_internals.h"
    3131
    32 
    33 
    34 /* HTML */
    35 
    3632/** \brief Generate HTML representation of current image.
    3733 *
     
    3935 *  the current image.
    4036 */
    41 void _cucul_get_html(cucul_t *qq, struct cucul_buffer *ex)
     37void _cucul_get_html(cucul_t *qq, struct cucul_export *ex)
    4238{
    4339    static int const palette[] =
     
    117113 *  a correct header.
    118114 */
    119 void _cucul_get_html3(cucul_t *qq, struct cucul_buffer *ex)
     115void _cucul_get_html3(cucul_t *qq, struct cucul_export *ex)
    120116{
    121117    static int const palette[] =
  • libcaca/trunk/cucul/export_irc.c

    r609 r644  
    3030#include "cucul_internals.h"
    3131
    32 
    33 
    3432/** \brief Generate IRC representation of current image.
    3533 *
     
    3735 *  the current image.
    3836 */
    39 void _cucul_get_irc(cucul_t *qq, struct cucul_buffer *ex)
     37void _cucul_get_irc(cucul_t *qq, struct cucul_export *ex)
    4038{
    4139    static int const palette[] =
  • libcaca/trunk/cucul/export_ps.c

    r639 r644  
    6060 *  the current image.
    6161 */
    62 void _cucul_get_ps(cucul_t *qq, struct cucul_buffer *ex)
     62void _cucul_get_ps(cucul_t *qq, struct cucul_export *ex)
    6363{
    6464    static char const * const palette[] =
  • libcaca/trunk/cucul/export_svg.c

    r641 r644  
    4545 *  the current image.
    4646 */
    47 void _cucul_get_svg(cucul_t *qq, struct cucul_buffer *ex)
     47void _cucul_get_svg(cucul_t *qq, struct cucul_export *ex)
    4848{
    4949    static int const palette[] =
  • libcaca/trunk/test/export.c

    r642 r644  
    3838    enum cucul_format format;
    3939    struct cucul_bitmap *bitmap;
    40     struct cucul_buffer *buffer;
     40    struct cucul_export *buffer;
    4141    int x, y;
    4242
     
    9999    cucul_putstr(qq, WIDTH / 2 - 7, HEIGHT / 2, "    LIBCACA    ");
    100100
    101     buffer = cucul_export(qq, format);
     101    buffer = cucul_get_export(qq, format);
    102102    fwrite(buffer->buffer, buffer->size - 1, 1, stdout);
    103     cucul_free(buffer);
     103    cucul_free_export(buffer);
    104104
    105105    cucul_end(qq);
Note: See TracChangeset for help on using the changeset viewer.