if (screen->selection == NULL) return False;
if (screen->selection_data == NULL) return False;
ConvertSelection(	Widget w,	Atom *selection,	Atom *target,	Atom *type,	XtPointer *value,	unsigned long *length,	int *format){    Display* d = XtDisplay(w);    TScreen *screen;    if (!IsXtermWidget(w))	return False;    screen = &((XtermWidget)w)->screen;    if (screen->selection == NULL) return False; /* can this happen? */    if (*target == XA_TARGETS(d)) {	Atom* targetP;	Atom* std_targets;	unsigned long std_length;	XmuConvertStandardSelection(		    w, screen->selection_time, selection,		    target, type, (XPointer *)&std_targets, &std_length, format		   );	*length = std_length + 5;	targetP = (Atom*)XtMalloc(sizeof(Atom)*(*length));	*value = (XtPointer) targetP;	*targetP++ = XA_STRING;	*targetP++ = XA_TEXT(d);	*targetP++ = XA_COMPOUND_TEXT(d);	*targetP++ = XA_LENGTH(d);	*targetP++ = XA_LIST_LENGTH(d);	memcpy ( (char*)targetP, (char*)std_targets, sizeof(Atom)*std_length);	XtFree((char*)std_targets);	*type = XA_ATOM;	*format = 32;	return True;    }    if (*target == XA_STRING ||	*target == XA_TEXT(d) ||	*target == XA_COMPOUND_TEXT(d)) {	if (*target == XA_COMPOUND_TEXT(d)) {	    XTextProperty textprop;	    *value = (XtPointer) screen->selection;	    if (XmbTextListToTextProperty (d, (char**)value, 1,					   XCompoundTextStyle, &textprop)			< Success) return False;	    *value = (XtPointer) textprop.value;	    *length = textprop.nitems;	    *type = *target;	} else {	    *type = XA_STRING;	    *value = screen->selection;	    *length = screen->selection_length;	}	*format = 8;	return True;    }    if (*target == XA_LIST_LENGTH(d)) {	*value = XtMalloc(4);	if (sizeof(long) == 4)	    *(long*)*value = 1;	else {	    long temp = 1;	    memcpy ( (char*)*value, ((char*)&temp)+sizeof(long)-4, 4);	}	*type = XA_INTEGER;	*length = 1;	*format = 32;	return True;    }    if (*target == XA_LENGTH(d)) {	*value = XtMalloc(4);	if (sizeof(long) == 4)	    *(long*)*value = screen->selection_length;	else {	    long temp = screen->selection_length;	    memcpy ( (char*)*value, ((char*)&temp)+sizeof(long)-4, 4);	}	*type = XA_INTEGER;	*length = 1;	*format = 32;	return True;    }    if (XmuConvertStandardSelection(w, screen->selection_time, selection,				    target, type,				    (XPointer *)value, length, format))	return True;    /* else */    return False;}