status = MimeObject_write(obj, tmp, PL_strlen(tmp), PR_TRUE);
status = MimeObject_write(obj, tmp, nsCRT::strlen(tmp), PR_TRUE);
MimeMultipart_create_child(MimeObject *obj){  MimeMultipart *mult = (MimeMultipart *) obj;#ifdef JS_ATTACHMENT_MUMBO_JUMBO  MimeContainer *cont = (MimeContainer *) obj;#endif  int status;  char *ct = (mult->hdrs			  ? MimeHeaders_get (mult->hdrs, HEADER_CONTENT_TYPE,								 PR_TRUE, PR_FALSE)			  : 0);  const char *dct = (((MimeMultipartClass *) obj->clazz)->default_part_type);  MimeObject *body = NULL;  MimeObject *parent = NULL;  PRBool showIcon = PR_TRUE;  mult->state = MimeMultipartPartFirstLine;  /* Don't pass in NULL as the content-type (this means that the	 auto-uudecode-hack won't ever be done for subparts of a	 multipart, but only for untyped children of message/rfc822.   */  body = mime_create(((ct && *ct) ? ct : (dct ? dct: TEXT_PLAIN)),					 mult->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;	}#ifdef MIME_DRAFTS  if ( obj->options && 	   obj->options->decompose_file_p &&	   obj->options->is_multipart_msg &&	   obj->options->decompose_file_init_fn )	{	  if ( !mime_typep(obj,(MimeObjectClass*)&mimeMultipartRelatedClass) &&           !mime_typep(obj,(MimeObjectClass*)&mimeMultipartAlternativeClass) &&		   !mime_typep(obj,(MimeObjectClass*)&mimeMultipartSignedClass) &&		   !mime_typep(body, (MimeObjectClass*)&mimeMultipartRelatedClass) &&		   !mime_typep(body, (MimeObjectClass*)&mimeMultipartAlternativeClass) &&		   !mime_typep(body,(MimeObjectClass*)&mimeMultipartSignedClass) #ifdef RICHIE_VCARD       && !mime_typep(body, (MimeObjectClass*)&mimeInlineTextVCardClass)#endif       )	  {		status = obj->options->decompose_file_init_fn ( obj->options->stream_closure, mult->hdrs );		if (status < 0) return status;	  }	}#endif /* MIME_DRAFTS */  /* Now that we've added this new object to our list of children,	 start its parser going (if we want to display it.)   */  body->output_p = (((MimeMultipartClass *) obj->clazz)					->output_child_p(obj, body));  if (body->output_p)	{#ifdef JS_ATTACHMENT_MUMBO_JUMBO	  int attachment_count = 0;	  PRBool isMsgBody = PR_FALSE, isAlternativeOrRelated = PR_FALSE;#endif	  status = body->clazz->parse_begin(body);	  if (status < 0) return status;#ifdef JS_ATTACHMENT_MUMBO_JUMBO	  isMsgBody = MimeObjectChildIsMessageBody		                        (obj, &isAlternativeOrRelated); 	  if (isAlternativeOrRelated)		  attachment_count = 0;	  else if (isMsgBody)		  attachment_count = cont->nchildren - 1;	  else		  attachment_count = cont->nchildren;	  if (attachment_count &&		  obj->options && !obj->options->nice_html_only_p) {		/* This is not the first child, so it's an attachment.  Cause the		   "attachments in this message" icon(s) to become visible.		   Excluding the following types to avoid inline graphics and dull items :		   Headers: Content-Disposition: inline		   Content-Type: text/x-vcard		   Content-Type: text/html		   Content-Type: text/plain		   Content-Type: message/rfc822    */		  char *tmp = NULL;		  /* if (strncasestr(body->headers->all_headers, "DISPOSITION: INLINE", 300))		  	showIcon = PR_FALSE; */		  if (PL_strstr(body->content_type, "text/x-vcard"))			  showIcon = PR_FALSE;		  else if (PL_strstr(body->content_type, "text/html"))			  showIcon = PR_FALSE;		  else if (PL_strstr(body->content_type, "message/rfc822"))			  showIcon = PR_FALSE;		  else if (PL_strstr(body->content_type, "multipart/signed"))			  showIcon = PR_FALSE;		  else if (PL_strstr(body->content_type, "application/x-pkcs7-signature"))			  showIcon = PR_FALSE;      else if (XP_STRSTR(body->content_type, "application/pkcs7-signature"))        showIcon = PR_FALSE;			  		  else if (PL_strstr(body->content_type, "multipart/mixed"))			  showIcon = PR_FALSE;		  if (showIcon)		  {			  (obj)->showAttachmentIcon = PR_TRUE;			  parent = obj->parent;			  while (parent) {				  (parent)->showAttachmentIcon = PR_TRUE;				  parent = parent->parent;			  }		  }		  if (obj->options->attachment_icon_layer_id)		  {/* RICHIECSS      tmp = PR_smprintf("\n\<SCRIPT>\n\window.document.layers[\"noattach-%ld\"].visibility = \"hide\";\n\window.document.layers[\"attach-%ld\"].visibility = \"show\";\n\</SCRIPT>\n",*/      tmp = PR_smprintf("\n\<SCRIPT>\n\document.getElementById(\"noattach%ld\").style.display = \"none\";\n\document.getElementById(\"attach%ld\").style.display = \"\";\n\</SCRIPT>\n",              (long) obj->options->attachment_icon_layer_id,							(long) obj->options->attachment_icon_layer_id);			  if (tmp) {				status = MimeObject_write(obj, tmp, PL_strlen(tmp), PR_TRUE);				PR_Free(tmp);				if (status < 0)					return status;			  }		  }	  }#endif /* JS_ATTACHMENT_MUMBO_JUMBO */	}  return 0;}