rem: wxCallbackInfo *cbi = (wxCallbackInfo *)callBackUD;
add: wxCallbackInfo *cbi = (wxCallbackInfo *)GET_SAFEREF(callBackUD);
context: static void ExtensionCallback(NavEventCallbackMessage callBackSelector, 			      NavCBRecPtr callBackParms, 			      void *callBackUD){  wxCallbackInfo *cbi = (wxCallbackInfo *)callBackUD;  switch (callBackSelector) {  case kNavCBStart:    if (cbi->initial_directory) {      FSSpec spec;      if (scheme_mac_path_to_spec(cbi->initial_directory, &spec)) {	AEDesc desc;	AECreateDesc (typeFSS, &spec, sizeof(FSSpec), &desc);	NavCustomControl(callBackParms->context, kNavCtlSetLocation, &desc);	AEDisposeDesc(&desc);      }    }    break;  case kNavCBAccept:    if (cbi->force_extension) {      Str255 sv;      StringPtr s;      char *c, *suffix = cbi->force_extension;      int i, sl;      s = sv;      NavCustomControl(callBackParms->context, kNavCtlGetEditFileName, s);      c = wxP2C(s);      for (i = s[0]; i--; ) {	if (c[i] == '.')	  break;      }      if (i < 0)	i = 0;      if (strcmp(c + i, suffix)) {	unsigned char *s2;	sl = strlen(suffix);	s2 = (unsigned char *)(new WXGC_ATOMIC char[s[0] + sl + 1]);	memcpy(s2 + 1, s + 1, s[0]);	memcpy(s2 + 1 + s[0], suffix, sl);	s2[0] = s[0] + sl;	NavCustomControl(callBackParms->context, kNavCtlSetEditFileName, s2);	s = s2;      }      {	AEDesc here, there;	FSRef fsref;	OSErr err;	char *dir = NULL;	NavCustomControl(callBackParms->context, kNavCtlGetLocation, &here);	err = AECoerceDesc(&here, typeFSRef, &there);	if (err != noErr) {	  if (err == errAECoercionFail) {	    /* Try FSSpec: */	    FSSpec spec;	    err = AECoerceDesc(&here, typeFSRef, &there);	    if (err == noErr) {	    	      err = AEGetDescData(&there, &spec, sizeof(FSSpec));	      if (err == noErr)		dir = scheme_mac_spec_to_path(&spec);	      AEDisposeDesc(&there);	    }	  }	} else {	  err = AEGetDescData(&there, &fsref, sizeof(fsref));	  if (err == noErr)	    dir = wxFSRefToPath(fsref);	  AEDisposeDesc(&there);	}	if (!dir)	  printf("NoDir! %d\n", err);	if (dir) {	  AlertStdAlertParamRec rec;	  SInt16 which;	  rec.movable = FALSE;	  rec.helpButton = FALSE;	  rec.filterProc = NULL;	  rec.defaultText = "\pReplace";	  rec.cancelText = (ConstStringPtr)kAlertDefaultCancelText;	  rec.otherText = NULL;	  rec.defaultButton = kAlertStdAlertCancelButton;	  rec.cancelButton = 0;	  rec.position = kWindowAlertPositionParentWindowScreen;	  which = kAlertStdAlertCancelButton;	  err = StandardAlert(kAlertCautionAlert,			      "\pReally replace?",			      NULL,			      &rec,			      &which);	  if (which == kAlertStdAlertCancelButton) {	    /* ??????? */	  }	}      }    }  case kNavCBCancel: /* ^^^^^^^^^^ FALLTHROUGH ^^^^^^^^^^^^ */    QuitAppModalLoopForWindow(callBackParms->window);    break;  }}