Changeset 586


Ignore:
Timestamp:
Mar 10, 2006, 4:11:40 PM (15 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Added CACA_NETWORK_PORT env and related documentation
Location:
libcaca/trunk/caca
Files:
3 edited

Legend:

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

    r565 r586  
    115115#if defined(HAVE_GETENV) && defined(HAVE_STRCASECMP)
    116116    char *var = getenv("CACA_DRIVER");
    117 
     117   
    118118    /* If the environment variable was set, use it */
    119119    if(var && *var)
    120     {
     120        {
    121121#if defined(USE_WIN32)
    122122        if(!strcasecmp(var, "win32"))
  • libcaca/trunk/caca/caca.h

    r561 r586  
    9393 *      implementation dependent, but since it currently only works with the
    9494 *      X11 driver, an X11 font name such as "fixed" or "5x7" is expected.
     95 *
     96 *  \li \b CACA_NETWORK_PORT: set the port the network driver will listen on.
     97 *      Obviously only works when using CACA_DRIVER=network.
     98 *      Default to 7575 (KK in ASCII Dec)
    9599 */
    96100
  • libcaca/trunk/caca/driver_network.c

    r585 r586  
    7878{
    7979    int yes=1;
     80    int net_port = 7575;
     81    char *network_port;
     82
    8083
    8184    kk->drv.p = malloc(sizeof(struct driver_private));
     
    8386        return -1;
    8487
     88
     89#if defined(HAVE_GETENV)
     90    network_port = getenv("CACA_NETWORK_PORT");
     91    if(network_port && *network_port) {
     92        net_port = atoi(network_port);
     93        if(!net_port)
     94            net_port = 7575;
     95    }
     96#endif
     97   
     98
    8599    kk->drv.p->width = 80;
    86100    kk->drv.p->height = 23; // Avoid scrolling
    87     kk->drv.p->port = 7575; // 75 75 decimal ASCII -> KK   // FIXME, sadly
    88101    kk->drv.p->client_count = 0;
    89102    kk->drv.p->fd_list = NULL;
    90 
     103    kk->drv.p->port = net_port;
    91104
    92105
     
    266279}
    267280
     281
    268282#endif // USE_NETWORK
    269283
Note: See TracChangeset for help on using the changeset viewer.