Ignore:
Timestamp:
Mar 8, 2006, 9:23:06 PM (14 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Exporters now return size of generated data
File:
1 edited

Legend:

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

    r554 r555  
    4545    unsigned int port;
    4646    int sockfd, new_fd;
    47     struct sockaddr_in my_addr;    // my address information
     47    struct sockaddr_in my_addr;
    4848    struct sockaddr_in remote_addr;
    4949    socklen_t sin_size;
     
    127127           (unsigned int)((kk->drv.p->remote_addr.sin_addr.s_addr)&0xFF000000)>>24);
    128128   
     129    /* FIXME, handle >255 sizes */
    129130    codes[16] = (unsigned char) kk->drv.p->width&0xff;
    130131    codes[18] = (unsigned char) kk->drv.p->height&0xff;
     
    165166static void network_display(caca_t *kk)
    166167{
    167     /* Clear screen */
    168     /*    if (send(kk->drv.p->new_fd, "\033?75l\033[2J\033[H", 12, 0) == -1) {
    169         perror("send");
    170         return;
    171     }
    172     */
    173 
    174     char *to_send = cucul_get_ansi(kk->qq, 0);;
     168    int size;
     169    char *to_send = cucul_get_ansi(kk->qq, 0, &size);;
    175170    to_send = realloc(to_send, kk->qq->width * kk->qq->height * 15 * 3);
    176171   
     
    180175        return;
    181176    }
    182     if (send(kk->drv.p->new_fd, to_send, kk->qq->width * kk->qq->height * 15, 0) == -1) {
     177    if (send(kk->drv.p->new_fd, to_send, size, 0) == -1) {
    183178        perror("send");
    184179        return;
    185180    }
    186     if (send(kk->drv.p->new_fd, "\033?75l\033[2J\033[H", 12, 0) == -1) {
     181    /*   if (send(kk->drv.p->new_fd, "\033?75l\033[2J\033[H", 12, 0) == -1) {
    187182        perror("send");
    188183        return;
    189184    }
    190  
     185    */
    191186}
    192187static void network_handle_resize(caca_t *kk)
Note: See TracChangeset for help on using the changeset viewer.