lstatus = MimeObject_write(obj, html, PL_strlen(html), PR_FALSE);
lstatus = MimeObject_write(obj, html, nsCRT::strlen(html), PR_FALSE);
MimeMessage_close_headers (MimeObject *obj){  MimeMessage *msg = (MimeMessage *) obj;  int status = 0;  char *ct = 0;			/* Content-Type header */  MimeObject *body;  if (msg->hdrs)	{	  PRBool outer_p = !obj->headers; /* is this the outermost message? */#ifdef MIME_DRAFTS	  if (outer_p &&		  obj->options &&          (obj->options->decompose_file_p || obj->options->caller_need_root_headers) &&		  obj->options->decompose_headers_info_fn)		{#ifdef MOZ_SECURITY	HG09091#endif /* MOZ_SECURITY */			            if (!obj->options->caller_need_root_headers || (obj == obj->options->state->root))		  	status = obj->options->decompose_headers_info_fn (												 obj->options->stream_closure,															 msg->hdrs );		}#endif /* MIME_DRAFTS */	  /* If this is the outermost message, we need to run the		 `generate_header' callback.  This happens here instead of		 in `parse_begin', because it's only now that we've parsed		 our headers.  However, since this is the outermost message,		 we have yet to write any HTML, so that's fine.	   */	  if (outer_p &&		  obj->output_p &&		  obj->options &&		  obj->options->write_html_p &&		  obj->options->generate_header_html_fn)		{		  int lstatus = 0;		  char *html = 0;		  /* The generate_header_html_fn might return HTML, so it's important			 that the output stream be set up with the proper type before we			 make the MimeObject_write() call below. */		  if (!obj->options->state->first_data_written_p)			{			  lstatus = MimeObject_output_init (obj, TEXT_HTML);			  if (lstatus < 0) return lstatus;			  PR_ASSERT(obj->options->state->first_data_written_p);			}		  html = obj->options->generate_header_html_fn(NULL,												   obj->options->html_closure,													   msg->hdrs);		  if (html)			{			  lstatus = MimeObject_write(obj, html, PL_strlen(html), PR_FALSE);			  PR_Free(html);			  if (lstatus < 0) return lstatus;			}		}	  /* Find the content-type of the body of this message.	   */	  {		PRBool ok = PR_TRUE;		char *mv = MimeHeaders_get (msg->hdrs, HEADER_MIME_VERSION,									PR_TRUE, PR_FALSE);#ifdef REQUIRE_MIME_VERSION_HEADER		/* If this is the outermost message, it must have a MIME-Version		   header with the value 1.0 for us to believe what might be in		   the Content-Type header.  If the MIME-Version header is not		   present, we must treat this message as untyped.		 */		ok = (mv && !PL_strcmp(mv, "1.0"));#else		/* #### actually, we didn't check this in Mozilla 2.0, and checking		   it now could cause some compatibility nonsense, so for now, let's		   just believe any Content-Type header we see.		 */		ok = PR_TRUE;#endif		if (ok)		  {			ct = MimeHeaders_get (msg->hdrs, HEADER_CONTENT_TYPE, PR_TRUE, PR_FALSE);			/* If there is no Content-Type header, but there is a MIME-Version			   header, then assume that this *is* in fact a MIME message.			   (I've seen messages with				  MIME-Version: 1.0				  Content-Transfer-Encoding: quoted-printable			   and no Content-Type, and we should treat those as being of type			   MimeInlineTextPlain rather than MimeUntypedText.)			 */			if (mv && !ct)			  ct = PL_strdup(TEXT_PLAIN);		  }		PR_FREEIF(mv);  /* done with this now. */	  }#ifdef MOZ_SECURITY    HG67023#endif /* MOZ_SECURITY */	  /* Emit the HTML for this message's headers.  Do this before		 creating the object representing the body.	   */	  if (obj->output_p &&		  obj->options &&		  obj->options->write_html_p)		{		  /* If citation headers are on, and this is not the outermost message,			 turn them off. */		  if (obj->options->headers == MimeHeadersCitation && !outer_p)			obj->options->headers = MimeHeadersSome;		  /* Emit a normal header block. */		  status = MimeMessage_write_headers_html(obj);		  if (status < 0) return status;		}	  else if (obj->output_p)		{		  /* Dump the headers, raw. */		  status = MimeObject_write(obj, "", 0, PR_FALSE);  /* initialize */		  if (status < 0) return status;		  status = MimeHeaders_write_raw_headers(msg->hdrs, obj->options,												 obj->options->dexlate_p);		  if (status < 0) return status;		}#ifdef XP_UNIX	  if (outer_p && obj->output_p)		/* Kludge from mimehdrs.c */		MimeHeaders_do_unix_display_hook_hack(msg->hdrs);#endif /* XP_UNIX */	}  /* Never put out a separator after a message header block. */  if (obj->options && obj->options->state)	obj->options->state->separator_suppressed_p = PR_TRUE;#ifdef MIME_DRAFTS  if ( !obj->headers &&    /* outer most message header */	   obj->options && 	   obj->options->decompose_file_p && 	   ct )	obj->options->is_multipart_msg = PL_strstr(ct, "multipart/") != NULL;#endif /* MIME_DRAFTS */  body = mime_create(ct, msg->hdrs, obj->options);  PR_FREEIF(ct);  if (!body) return MIME_OUT_OF_MEMORY;  status = ((MimeContainerClass *) obj->clazz)->add_child (obj, body);  if (status < 0)	{	  mime_free(body);	  return status;	}  /* Now that we've added this new object to our list of children,	 start its parser going. */  status = body->clazz->parse_begin(body);  if (status < 0) return status;  // Now notify the emitter if this is the outer most message, unless  // it is a part that is not the head of the message. If it's a part,   // we need to figure out the content type/charset of the part  //  PRBool outer_p = !obj->headers;	/* is this the outermost message? */  if (      (outer_p) &&      ( obj->options->part_to_load == NULL )     )  {    char  *charset = NULL;    char  *lct = MimeHeaders_get (msg->hdrs, HEADER_CONTENT_TYPE,									                PR_FALSE, PR_FALSE);		if (lct)      charset = MimeHeaders_get_parameter (lct, "charset", NULL, NULL);    char  *msgID = MimeHeaders_get (msg->hdrs, HEADER_MESSAGE_ID,									                  PR_FALSE, PR_FALSE);    char  *outCharset = NULL;    if (!obj->options->force_user_charset)  /* Only convert if the user prefs is false */      outCharset = "UTF-8";    mimeEmitterStartBody(obj->options, (obj->options->headers == MimeHeadersNone), msgID, outCharset);    PR_FREEIF(msgID);    PR_FREEIF(lct);    PR_FREEIF(charset);  }  return 0;}