rem: sprintf(RErrorString, "could not get image");
add: RErrorCode = RERR_XERROR;
context: RCreateImageFromDrawable(RContext *context, Drawable drawable, Pixmap mask){    RImage *image;    XImage *pimg, *mimg;    unsigned int w, h, bar;    int foo;    Window baz;    RErrorString[0] = 0;    assert(drawable!=None);        if (!XGetGeometry(context->dpy, drawable, &baz, &foo, &foo, 		      &w, &h, &bar, &bar)) {	printf("wrlib:invalid window or pixmap passed to RCreateImageFromPixmap\n");	return NULL;    }    pimg = XGetImage(context->dpy, drawable, 0, 0, w, h, AllPlanes, 		     ZPixmap);        if (!pimg) {	sprintf(RErrorString, "could not get image");	return NULL;    }    mimg = NULL;    if (mask) {	if (XGetGeometry(context->dpy, mask, &baz, &foo, &foo, 			  &w, &h, &bar, &bar)) {	    mimg = XGetImage(context->dpy, mask, 0, 0, w, h, AllPlanes, 			     ZPixmap);	}    }    image = RCreateImageFromXImage(context, pimg, mimg);    XDestroyImage(pimg);    if (mimg)      XDestroyImage(mimg);    return image;}