data->info_callback=(int (*)())ptr;
{ union int_fn_to_char_u tmp_cb;  tmp_cb.char_p=ptr; data->info_callback=tmp_cb.fn_p; }
static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)	{	BIO *dbio;	int *ip;	const char **pptr;	long ret=1;	BIO_CONNECT *data;	data=(BIO_CONNECT *)b->ptr;	switch (cmd)		{	case BIO_CTRL_RESET:		ret=0;		data->state=BIO_CONN_S_BEFORE;		conn_close_socket(b);		b->flags=0;		break;	case BIO_C_DO_STATE_MACHINE:		/* use this one to start the connection */		if (!data->state != BIO_CONN_S_OK)			ret=(long)conn_state(b,data);		else			ret=1;		break;	case BIO_C_GET_CONNECT:		if (ptr != NULL)			{			pptr=(const char **)ptr;			if (num == 0)				{				*pptr=data->param_hostname;				}			else if (num == 1)				{				*pptr=data->param_port;				}			else if (num == 2)				{				*pptr= (char *)&(data->ip[0]);				}			else if (num == 3)				{				*((int *)ptr)=data->port;				}			if ((!b->init) || (ptr == NULL))				*pptr="not initalised";			ret=1;			}		break;	case BIO_C_SET_CONNECT:		if (ptr != NULL)			{			b->init=1;			if (num == 0)				{				if (data->param_hostname != NULL)					Free(data->param_hostname);				data->param_hostname=BUF_strdup(ptr);				}			else if (num == 1)				{				if (data->param_port != NULL)					Free(data->param_port);				data->param_port=BUF_strdup(ptr);				}			else if (num == 2)				{				char buf[16];				sprintf(buf,"%d.%d.%d.%d",					ptr[0],ptr[1],ptr[2],ptr[3]);				if (data->param_hostname != NULL)					Free(data->param_hostname);				data->param_hostname=BUF_strdup(buf);				memcpy(&(data->ip[0]),ptr,4);				}			else if (num == 3)				{				char buf[16];				sprintf(buf,"%d",*(int *)ptr);				if (data->param_port != NULL)					Free(data->param_port);				data->param_port=BUF_strdup(buf);				data->port= *(int *)ptr;				}			}		break;	case BIO_C_SET_NBIO:		data->nbio=(int)num;		break;	case BIO_C_GET_FD:		if (b->init)			{			ip=(int *)ptr;			if (ip != NULL)				*ip=b->num;			ret=b->num;			}		else			ret= -1;		break;	case BIO_CTRL_GET_CLOSE:		ret=b->shutdown;		break;	case BIO_CTRL_SET_CLOSE:		b->shutdown=(int)num;		break;	case BIO_CTRL_PENDING:	case BIO_CTRL_WPENDING:		ret=0;		break;	case BIO_CTRL_FLUSH:		break;	case BIO_CTRL_DUP:		dbio=(BIO *)ptr;		if (data->param_port)			BIO_set_conn_port(dbio,data->param_port);		if (data->param_hostname)			BIO_set_conn_hostname(dbio,data->param_hostname);		BIO_set_nbio(dbio,data->nbio);		(void)BIO_set_info_callback(dbio,data->info_callback);		break;	case BIO_CTRL_SET_CALLBACK:		data->info_callback=(int (*)())ptr;		break;	case BIO_CTRL_GET_CALLBACK:		{		int (**fptr)();		fptr=(int (**)())ptr;		*fptr=data->info_callback;		}		break;	default:		ret=0;		break;		}	return(ret);	}