Ignore:
Timestamp:
Mar 15, 2006, 11:01:14 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Support CACA_GEOMETRY in the network driver. Still defaults to 80x24.
  • Use RETSIGTYPE for signal handler return values.
File:
1 edited

Legend:

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

    r609 r611  
    9191    struct client *clients;
    9292
    93     void (*sigpipe_handler)(int);
     93    RETSIGTYPE (*sigpipe_handler)(int);
    9494};
    9595
     
    102102    int yes = 1, flags;
    103103    int port = 0xCACA; /* 51914 */
    104     char *network_port, *tmp;
     104    unsigned int width = 0, height = 0;
     105    char *tmp;
    105106
    106107    kk->drv.p = malloc(sizeof(struct driver_private));
     
    109110
    110111#if defined(HAVE_GETENV)
    111     network_port = getenv("CACA_PORT");
    112     if(network_port && *network_port)
    113     {
    114         int new_port = atoi(network_port);
     112    tmp = getenv("CACA_PORT");
     113    if(tmp && *tmp)
     114    {
     115        int new_port = atoi(tmp);
    115116        if(new_port)
    116117            port = new_port;
    117118    }
     119
     120    tmp = getenv("CACA_GEOMETRY");
     121    if(tmp && *tmp)
     122        sscanf(tmp, "%ux%u", &width, &height);
    118123#endif
    119124
    120     kk->drv.p->width = 80;
    121     kk->drv.p->height = 24;
     125    if(width && height)
     126    {
     127        kk->drv.p->width = width;
     128        kk->drv.p->height = height;
     129    }
     130    else
     131    {
     132        kk->drv.p->width = 80;
     133        kk->drv.p->height = 24;
     134    }
     135
    122136    kk->drv.p->client_count = 0;
    123137    kk->drv.p->clients = NULL;
Note: See TracChangeset for help on using the changeset viewer.