add: } else if (strcasecmp(val, "igradient")==0) { RColor colors1[2], colors2[2]; int th1, th2; XColor xcolor; int i;  if (nelem != 7) { wwarning(_("bad number of arguments in gradient specification")); return NULL; }   for (i = 0; i < 2; i++) { elem = PLGetArrayElement(pl, 1+i); if (!elem || !PLIsString(elem)) return NULL; val = PLGetString(elem);  if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) { wwarning(_("\"%s\" is not a valid color name"), val); return NULL; } colors1[i].alpha = 255; colors1[i].red = xcolor.red >> 8; colors1[i].green = xcolor.green >> 8; colors1[i].blue = xcolor.blue >> 8; } elem = PLGetArrayElement(pl, 3); if (!elem || !PLIsString(elem)) return NULL; val = PLGetString(elem); th1 = atoi(val);    for (i = 0; i < 2; i++) { elem = PLGetArrayElement(pl, 4+i); if (!elem || !PLIsString(elem)) return NULL; val = PLGetString(elem);  if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) { wwarning(_("\"%s\" is not a valid color name"), val); return NULL; } colors2[i].alpha = 255; colors2[i].red = xcolor.red >> 8; colors2[i].green = xcolor.green >> 8; colors2[i].blue = xcolor.blue >> 8; } elem = PLGetArrayElement(pl, 6); if (!elem || !PLIsString(elem)) return NULL; val = PLGetString(elem); th2 = atoi(val);  texture = (WTexture*)wTextureMakeIGradient(scr, th1, colors1, th2, colors2);
context: parse_texture(WScreen *scr, proplist_t pl){    proplist_t elem;    char *val;    int nelem;    WTexture *texture=NULL;        nelem = PLGetNumberOfElements(pl);    if (nelem < 1)      return NULL;            elem = PLGetArrayElement(pl, 0);    if (!elem || !PLIsString(elem))      return NULL;    val = PLGetString(elem);        if (strcasecmp(val, "solid")==0) {	XColor color;	if (nelem != 2)	    return NULL;	/* get color */		elem = PLGetArrayElement(pl, 1);	if (!elem || !PLIsString(elem)) 	  return NULL;	val = PLGetString(elem);	if (!XParseColor(dpy, scr->w_colormap, val, &color)) {	    wwarning(_("\"%s\" is not a valid color name"), val);	    return NULL;	}		texture = (WTexture*)wTextureMakeSolid(scr, &color);    } else if (strcasecmp(val, "dgradient")==0	       || strcasecmp(val, "vgradient")==0	       || strcasecmp(val, "hgradient")==0) {	RColor color1, color2;	XColor xcolor;	int type;	if (nelem != 3) {	    wwarning(_("bad number of arguments in gradient specification"));	    return NULL;	}	if (val[0]=='d' || val[0]=='D')	  type = WTEX_DGRADIENT;	else if (val[0]=='h' || val[0]=='H')	  type = WTEX_HGRADIENT;	else	  type = WTEX_VGRADIENT;		/* get from color */	elem = PLGetArrayElement(pl, 1);	if (!elem || !PLIsString(elem)) 	  return NULL;	val = PLGetString(elem);	if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) {	    wwarning(_("\"%s\" is not a valid color name"), val);	    return NULL;	}	color1.alpha = 255;	color1.red = xcolor.red >> 8;	color1.green = xcolor.green >> 8;	color1.blue = xcolor.blue >> 8;		/* get to color */	elem = PLGetArrayElement(pl, 2);	if (!elem || !PLIsString(elem)) {	    return NULL;	}	val = PLGetString(elem);	if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) {	    wwarning(_("\"%s\" is not a valid color name"), val);	    return NULL;	}	color2.alpha = 255;	color2.red = xcolor.red >> 8;	color2.green = xcolor.green >> 8;	color2.blue = xcolor.blue >> 8;	texture = (WTexture*)wTextureMakeGradient(scr, type, &color1, &color2);	    } else if (strcasecmp(val, "mhgradient")==0	       || strcasecmp(val, "mvgradient")==0	       || strcasecmp(val, "mdgradient")==0) {	XColor color;	RColor **colors;	int i, count;	int type;	if (nelem < 3) {	    wwarning(_("too few arguments in multicolor gradient specification"));	    return NULL;	}	if (val[1]=='h' || val[1]=='H')	    type = WTEX_MHGRADIENT;	else if (val[1]=='v' || val[1]=='V')	    type = WTEX_MVGRADIENT;	else	    type = WTEX_MDGRADIENT;	count = nelem-1;	colors = wmalloc(sizeof(RColor*)*(count+1));	for (i=0; i<count; i++) {	    elem = PLGetArrayElement(pl, i+1);	    if (!elem || !PLIsString(elem)) {		for (--i; i>=0; --i) {		    free(colors[i]);		}		free(colors);		return NULL;	    }	    val = PLGetString(elem);	    if (!XParseColor(dpy, scr->w_colormap, val, &color)) {		wwarning(_("\"%s\" is not a valid color name"), val);		for (--i; i>=0; --i) {		    free(colors[i]);		}		free(colors);		return NULL;	    } else {		colors[i] = wmalloc(sizeof(RColor));		colors[i]->red = color.red >> 8;		colors[i]->green = color.green >> 8;		colors[i]->blue = color.blue >> 8;	    }	}	colors[i] = NULL;		texture = (WTexture*)wTextureMakeMGradient(scr, type, colors);    } else if (strcasecmp(val, "spixmap")==0 ||	       strcasecmp(val, "cpixmap")==0 ||               strcasecmp(val, "tpixmap")==0) {	XColor color;        int type;	if (nelem != 3) 	    return NULL;        if (val[0] == 's' || val[0] == 'S')            type = WTP_SCALE;        else if (val[0] == 'c' || val[0] == 'C')	    type = WTP_CENTER;	else            type = WTP_TILE;	/* get color */	elem = PLGetArrayElement(pl, 2);	if (!elem || !PLIsString(elem)) {	    return NULL;	}	val = PLGetString(elem);	if (!XParseColor(dpy, scr->w_colormap, val, &color)) {	    wwarning(_("\"%s\" is not a valid color name"), val);	    return NULL;	}		/* file name */	elem = PLGetArrayElement(pl, 1);	if (!elem || !PLIsString(elem)) 	  return NULL;	val = PLGetString(elem);	texture = (WTexture*)wTextureMakePixmap(scr, type, val, &color);    } else if (strcasecmp(val, "thgradient")==0	       || strcasecmp(val, "tvgradient")==0	       || strcasecmp(val, "tdgradient")==0) {	RColor color1, color2;	XColor xcolor;	int opacity;	int style;	if (val[1]=='h' || val[1]=='H')	    style = WTEX_THGRADIENT;	else if (val[1]=='v' || val[1]=='V')	    style = WTEX_TVGRADIENT;	else	    style = WTEX_TDGRADIENT;	if (nelem != 5) {	    wwarning(_("bad number of arguments in textured gradient specification"));	    return NULL;	}		/* get from color */	elem = PLGetArrayElement(pl, 3);	if (!elem || !PLIsString(elem)) 	  return NULL;	val = PLGetString(elem);	if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) {	    wwarning(_("\"%s\" is not a valid color name"), val);	    return NULL;	}	color1.alpha = 255;	color1.red = xcolor.red >> 8;	color1.green = xcolor.green >> 8;	color1.blue = xcolor.blue >> 8;	/* get to color */	elem = PLGetArrayElement(pl, 4);	if (!elem || !PLIsString(elem)) {	    return NULL;	}	val = PLGetString(elem);	if (!XParseColor(dpy, scr->w_colormap, val, &xcolor)) {	    wwarning(_("\"%s\" is not a valid color name"), val);	    return NULL;	}	color2.alpha = 255;	color2.red = xcolor.red >> 8;	color2.green = xcolor.green >> 8;	color2.blue = xcolor.blue >> 8;	/* get opacity */	elem = PLGetArrayElement(pl, 2);	if (!elem || !PLIsString(elem))	    opacity = 128;	else	    val = PLGetString(elem);		if (!val || (opacity = atoi(val)) < 0 || opacity > 255) {	    wwarning(_("bad opacity value for tgradient texture \"%s\". Should be [0..255]"), val);	    opacity = 128;	}	/* get file name */	elem = PLGetArrayElement(pl, 1);	if (!elem || !PLIsString(elem))	  return NULL;	val = PLGetString(elem);	texture = (WTexture*)wTextureMakeTGradient(scr, style, &color1, &color2,						   val, opacity);    }#ifdef TEXTURE_PLUGIN    else if (strcasecmp(val, "function")==0) {	WTexFunction *function;	void (*initFunc) (Display *, Colormap);	char *lib, *func, **argv;	int i, argc;        if (nelem < 3)	    return NULL;	/* get the library name */	elem = PLGetArrayElement(pl, 1);	if (!elem || !PLIsString(elem)) {	    return NULL;	}	lib = PLGetString(elem);	/* get the function name */	elem = PLGetArrayElement(pl, 2);	if (!elem || !PLIsString(elem)) {	    return NULL;	}	func = PLGetString(elem);	argc = nelem - 2;	argv = (char **)wmalloc(argc * sizeof(char *));	/* get the parameters */	argv[0] = wstrdup(func);	for (i = 0; i < argc - 1; i++) {	    elem = PLGetArrayElement(pl, 3 + i);	    if (!elem || !PLIsString(elem)) {		free(argv);		return NULL;	    }	    argv[i+1] = wstrdup(PLGetString(elem));	}	function = wTextureMakeFunction(scr, lib, func, argc, argv);#ifdef HAVE_DLFCN_H	if (function) {	    initFunc = dlsym(function->handle, "initWindowMaker");	    if (initFunc) {		initFunc(dpy, scr->w_colormap);	    } else {		wwarning(_("could not initialize library %s"), lib);	    }	} else {	    wwarning(_("could not find function %s::%s"), lib, func);	}#endif /* HAVE_DLFCN_H */	texture = (WTexture*)function;    }#endif /* TEXTURE_PLUGIN */    else {	wwarning(_("invalid texture type %s"), val);	return NULL;    }    return texture;}