nsCRT::memcpy(buff, (char*)&p_bh_encode_obj->head,
memcpy(buff, (char*)&p_bh_encode_obj->head,
int binhex_reencode_head(	binhex_encode_object *p_bh_encode_obj,	char* 	outbuff,	int32	buff_size,	int32*  real_size){	int32	size, dlen;	int 	status;	char	buff[64];		p_bh_encode_obj->state	 	= 0;		p_bh_encode_obj->state86 	= 0;		p_bh_encode_obj->CRC		= 0;	p_bh_encode_obj->line_length= 1;	p_bh_encode_obj->saved_bits = 0;	p_bh_encode_obj->s_overflow = 0	;		status = binhex_encode_next(						p_bh_encode_obj, 						p_bh_encode_obj->name,								p_bh_encode_obj->name[0]+2,		/* in_size */						outbuff, 						buff_size,						real_size);	if (status != NOERR)		return status;			size = *real_size;		/* now we should have the right data length in the head structure, but don't 		*/	/* forget convert it back to the net byte order (i.e., Motolora) before write it	*/	/*																					*/	/* Note:	since we don't change the size of rlen, so don't need to worry about it	*/		p_bh_encode_obj->head.dlen = htonl(dlen = p_bh_encode_obj->head.dlen);		/* make a copy before do the encoding, -- it may modify the head!!!. */	nsCRT::memcpy(buff, (char*)&p_bh_encode_obj->head, 						sizeof(binhex_header));	if (18 < sizeof(binhex_header))	{		/* we get an alignment problem here.	*/		nsCRT::memcpy(buff + 10, buff + 12, 8);	}										status = binhex_encode_next(						p_bh_encode_obj, 						(char*)buff,								18,						/* sizeof(binhex_header),*/						outbuff   + size, 						buff_size - size,						real_size);	if (status != NOERR)		return status;		size += *real_size;			status = binhex_encode_next(					/* for CRC */						p_bh_encode_obj, 						NULL,								0,							/* in_size */						outbuff  + size, 						buff_size - size,						real_size);		if (status != NOERR)		return status;			size += *real_size;	if (p_bh_encode_obj->state86 != 0)	{		/*			**	Make sure we don't destroy the orignal valid coding.		**		**	(Keep in mind that 3 characters share 4 coding chars,		**	 so it is possible for the head and data stream share one 4 code group.		**		**	How about only one or zero character in the data fork?		**		---- just rerun the encoding, not a big deal.		*/		if (dlen <= 1)		{			/* why just rerun the encoding once more.	*/			status = binhex_encode_next(						p_bh_encode_obj,						p_bh_encode_obj->c,						dlen,						outbuff   + size,						buff_size - size,						real_size);			if (status != NOERR)				return status;							size += *real_size;							/* encode the data fork		*/						status = binhex_encode_next(						p_bh_encode_obj,						NULL,						0,						outbuff   + size,						buff_size - size,						real_size);			if (status != NOERR)				return status;			size += *real_size;							/* for the end up data fork */						status = binhex_encode_next(						p_bh_encode_obj,						NULL,						0,						outbuff   + size,						buff_size - size,						real_size);						/* for the end up encoding*/		}		else		{			status = binhex_encode_next(						p_bh_encode_obj, 						p_bh_encode_obj->c,								3 - p_bh_encode_obj->state86,	/* in_size */						outbuff   + size, 						buff_size - size,						real_size);		}		size += *real_size;		}	*real_size = size;		return status;}