fprintf(stderr, "getting resource %x, id %d\n", restype, resid);
static OSErr copy_resource(ResType restype, short resid){    Handle h;    Str255 resname;    fprintf(stderr, "getting resource %x, id %d\n", restype, resid);    h = GetResource(restype, resid);    if (h != NULL) {	GetResInfo(h, &resid, &restype, resname);	DetachResource(h);	AddResource(h, restype, resid, resname);	if (ResError() == noErr)	    WriteResource(h);    }    fprintf(stderr, "ResError() == %d\n", ResError());    return ResError();}