PR_ASSERT(sig->xlation_closure);
PR_ASSERT(sig->crypto_closure);
MimeMultipartSigned_emit_child (MimeObject *obj){  MimeMultipartSigned *sig = (MimeMultipartSigned *) obj;  MimeMultipart *mult = (MimeMultipart *) obj;  MimeContainer *cont = (MimeContainer *) obj;  int status = 0;  MimeObject *body;  PR_ASSERT(sig->xlation_closure);  /* Emit some HTML saying whether the signature was cool.	 But don't emit anything if in FO_QUOTE_MESSAGE mode.   */  if (obj->options &&	  obj->options->headers != MimeHeadersCitation &&	  obj->options->write_html_p &&	  obj->options->output_fn &&	  obj->options->headers != MimeHeadersCitation &&	  sig->xlation_closure)	{	  char *html = (((MimeMultipartSignedClass *) obj->clazz)					->xlation_generate_html (sig->xlation_closure));	  if (!html) return -1; /* MIME_OUT_OF_MEMORY? */	  status = MimeObject_write(obj, html, nsCRT::strlen(html), PR_FALSE);	  PR_Free(html);	  if (status < 0) return status;	  /* Now that we have written out the xlation stamp, the outermost header		 block is well and truly closed.  If this is in fact the outermost		 message, then run the post_header_html_fn now.	   */	  if (obj->options &&		  obj->options->state &&		  obj->options->generate_post_header_html_fn &&		  !obj->options->state->post_header_html_run_p)		{		  MimeHeaders *outer_headers=nsnull;		  MimeObject *p;		  for (p = obj; p->parent; p = p->parent)			outer_headers = p->headers;		  PR_ASSERT(obj->options->state->first_data_written_p);		  html = obj->options->generate_post_header_html_fn(NULL,													obj->options->html_closure,															outer_headers);		  obj->options->state->post_header_html_run_p = PR_TRUE;		  if (html)			{			  status = MimeObject_write(obj, html, nsCRT::strlen(html), PR_FALSE);			  PR_Free(html);			  if (status < 0) return status;			}		}	}  /* Oh, this is fairly nasty.  We're skipping over our "create child" method	 and using the one our superclass defines.  Perhaps instead we should add	 a new method on this class, and initialize that method to be the	 create_child method of the superclass.  Whatever.   */  /* The superclass method expects to find the headers for the part that it's	 to create in mult->hdrs, so ensure that they're there. */  PR_ASSERT(!mult->hdrs);  if (mult->hdrs) MimeHeaders_free(mult->hdrs);  mult->hdrs = sig->body_hdrs;  sig->body_hdrs = 0;  /* Run the superclass create_child method.   */  status = (((MimeMultipartClass *)(&MIME_SUPERCLASS))->create_child(obj));  if (status < 0) return status;  /* Retrieve the child that it created.   */  PR_ASSERT(cont->nchildren == 1);  if (cont->nchildren != 1) return -1;  body = cont->children[0];  PR_ASSERT(body);  if (!body) return -1;#ifdef MIME_DRAFTS  if (body->options->decompose_file_p) {	  body->options->signed_p = PR_TRUE;	  if (!mime_typep(body, (MimeObjectClass*)&mimeMultipartClass) &&		body->options->decompose_file_init_fn)		body->options->decompose_file_init_fn ( body->options->stream_closure, body->headers );  }#endif /* MIME_DRAFTS */  /* If there's no part_buffer, this is a zero-length signed message? */  if (sig->part_buffer)	{#ifdef MIME_DRAFTS	  if (body->options->decompose_file_p &&		  !mime_typep(body, (MimeObjectClass*)&mimeMultipartClass)  &&		  body->options->decompose_file_output_fn)		  status = MimePartBufferRead (sig->part_buffer,							   /* The (nsresult (*) ...) cast is to turn the								  `void' argument into `MimeObject'. */							   ((nsresult (*) (char *, PRInt32, void *))							   body->options->decompose_file_output_fn),							   body->options->stream_closure);	  else#endif /* MIME_DRAFTS */	  status = MimePartBufferRead (sig->part_buffer,							   /* The (nsresult (*) ...) cast is to turn the								  `void' argument into `MimeObject'. */							   ((nsresult (*) (char *, PRInt32, void *))								body->clazz->parse_buffer),								body);	  if (status < 0) return status;	}  MimeMultipartSigned_cleanup(obj, PR_FALSE);  /* Done parsing. */  status = body->clazz->parse_eof(body, PR_FALSE);  if (status < 0) return status;  status = body->clazz->parse_end(body, PR_FALSE);  if (status < 0) return status;#ifdef MIME_DRAFTS  if (body->options->decompose_file_p &&	  !mime_typep(body, (MimeObjectClass*)&mimeMultipartClass)  &&	  body->options->decompose_file_close_fn)	  body->options->decompose_file_close_fn(body->options->stream_closure);#endif /* MIME_DRAFTS */  /* Put out a separator after every multipart/signed object. */  status = MimeObject_write_separator(obj);  if (status < 0) return status;  return 0;}