char *urlspec; url->GetSpec( &urlspec ); strcpy( HistoryReplyBuf[j].url, urlspec );
nsCAutoString specString; url->GetSpec(specString); strcpy( HistoryReplyBuf[j].url, (char *) specString.get() );
mozilla_get_info(PtWidget_t *widget, PtArg_t *argt){	PtMozillaWidget_t *moz = (PtMozillaWidget_t *) widget;	nsIPref *pref = moz->EmbedRef->GetPrefs();	int retval;	switch (argt->type)	{		case Pt_ARG_MOZ_NAVIGATE_PAGE:			moz->navigate_flags = 0;			if (moz->EmbedRef->CanGoBack())				moz->navigate_flags |= ( 1 << WWW_DIRECTION_BACK );			if (moz->EmbedRef->CanGoForward())				moz->navigate_flags |= ( 1 << WWW_DIRECTION_FWD );			*((int **)argt->value) = &moz->navigate_flags;			break;		case Pt_ARG_MOZ_OPTION:			mozilla_get_pref( widget, (char*)argt->len, (char*) argt->value );			break;		case Pt_ARG_MOZ_GET_CONTEXT:			if ( moz->rightClickUrl ) 				strcpy( (char*) argt->value, moz->rightClickUrl );			else 				*(char*) argt->value = 0;			break;		case Pt_ARG_MOZ_ENCODING: 			{			PRUnichar *charset = nsnull;			pref->GetLocalizedUnicharPref( "intl.charset.default", &charset );			strcpy( (char*)argt->value, NS_ConvertUCS2toUTF8(charset).get() );			}			break;		case Pt_ARG_MOZ_GET_HISTORY: 			{				WWWRequest *req = ( WWWRequest * ) argt->len;				PtWebClientHistoryData_t *HistoryReplyBuf = (PtWebClientHistoryData_t *) argt->value;				int i, j;				PRInt32 total;				moz->EmbedRef->mSessionHistory->GetCount( &total );				for( i=total-2, j=0; i>=0 && j<req->History.num; i--, j++) 				{					nsIHistoryEntry *entry;					moz->EmbedRef->mSessionHistory->GetEntryAtIndex( i, PR_FALSE, &entry );									PRUnichar *title;					nsIURI *url;					entry->GetTitle( &title );					entry->GetURI( &url );					nsString stitle( title );					strncpy( HistoryReplyBuf[j].title, ToNewCString(stitle), 127 );					HistoryReplyBuf[j].title[127] = '\0';					char *urlspec;					url->GetSpec( &urlspec );					strcpy( HistoryReplyBuf[j].url, urlspec );				}			}			break;	}	return (Pt_CONTINUE);}