Changeset 611


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.
Location:
libcaca/trunk/caca
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.h

    r599 r611  
    8888 *  \li \b CACA_GEOMETRY: set the video display size. The format of this
    8989 *      variable must be XxY, with X and Y being integer values. This option
    90  *      currently only works with the X11 and the GL driver.
     90 *      currently works with the network, X11 and GL drivers.
    9191 *
    9292 *  \li \b CACA_FONT: set the rendered font. The format of this variable is
  • 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.