Ignore:
Timestamp:
Dec 12, 2003, 5:19:44 PM (19 years ago)
Author:
Sam Hocevar
Message:
  • configure.ac debian/changelog: + Prepare for 0.3 release. + Check for strcasecmp().
  • src/caca.c: + Honor CACA_BACKGROUND, CACA_DITHERING and CACA_ANTIALIASING environment

variables.

File:
1 edited

Legend:

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

    r249 r250  
    251251static void caca_init_features(void)
    252252{
     253    /* FIXME: if strcasecmp isn't available, use strcmp */
     254#if defined(HAVE_GETENV) && defined(HAVE_STRCASECMP)
     255    char *var;
     256#endif
     257
    253258    caca_set_feature(CACA_BACKGROUND);
    254259    caca_set_feature(CACA_ANTIALIASING);
    255260    caca_set_feature(CACA_DITHERING);
     261
     262#if defined(HAVE_GETENV) && defined(HAVE_STRCASECMP)
     263    if((var = getenv("CACA_BACKGROUND")))
     264    {
     265        if(!strcasecmp("black", var))
     266            caca_set_feature(CACA_BACKGROUND_BLACK);
     267        else if(!strcasecmp("solid", var))
     268            caca_set_feature(CACA_BACKGROUND_SOLID);
     269    }
     270
     271    if((var = getenv("CACA_ANTIALIASING")))
     272    {
     273        if(!strcasecmp("none", var))
     274            caca_set_feature(CACA_ANTIALIASING_NONE);
     275        else if(!strcasecmp("prefilter", var))
     276            caca_set_feature(CACA_ANTIALIASING_PREFILTER);
     277    }
     278
     279    if((var = getenv("CACA_DITHERING")))
     280    {
     281        if(!strcasecmp("none", var))
     282            caca_set_feature(CACA_DITHERING_NONE);
     283        else if(!strcasecmp("ordered2", var))
     284            caca_set_feature(CACA_DITHERING_ORDERED2);
     285        else if(!strcasecmp("ordered4", var))
     286            caca_set_feature(CACA_DITHERING_ORDERED4);
     287        else if(!strcasecmp("ordered8", var))
     288            caca_set_feature(CACA_DITHERING_ORDERED8);
     289        else if(!strcasecmp("random", var))
     290            caca_set_feature(CACA_DITHERING_RANDOM);
     291    }
     292#endif
    256293}
    257294
Note: See TracChangeset for help on using the changeset viewer.