if (!mdata->stream.file) return (XpmOpenFailed);
OpenWriteFile(filename, mdata)    char *filename;    xpmData *mdata;{#ifndef NO_ZPIPE    char buf[BUFSIZ];#endif    if (!filename) {	mdata->stream.file = (stdout);	mdata->type = XPMFILE;    } else {#ifndef NO_ZPIPE	int len = strlen(filename);	if (len > 2 && !strcmp(".Z", filename + (len - 2))) {	    sprintf(buf, "compress > \"%s\"", filename);	    if (!(mdata->stream.file = popen(buf, "w")))		return (XpmOpenFailed);	    mdata->type = XPMPIPE;	} else if (len > 3 && !strcmp(".gz", filename + (len - 3))) {	    sprintf(buf, "gzip -q > \"%s\"", filename);	    if (!(mdata->stream.file = popen(buf, "w")))		return (XpmOpenFailed);	    mdata->type = XPMPIPE;	} else {#endif	    if (!(mdata->stream.file = fopen(filename, "w")))		return (XpmOpenFailed);	    mdata->type = XPMFILE;#ifndef NO_ZPIPE	}#endif    }    return (XpmSuccess);}