else if (!PL_strcasecmp(content_type+10,	"appledouble") || !PL_strcasecmp(content_type+10,	"header-set"))
else if (!nsCRT::strcasecmp(content_type+10,	"appledouble") || !nsCRT::strcasecmp(content_type+10,	"header-set"))
mime_find_class (const char *content_type, MimeHeaders *hdrs,				 MimeDisplayOptions *opts, PRBool exact_match_p){  MimeObjectClass *clazz = 0;  MimeObjectClass *tempClass = 0;  contentTypeHandlerInitStruct  ctHandlerInfo;  /*   * What we do first is check for an external content handler plugin.   * This will actually extend the mime handling by calling a routine   * which will allow us to load an external content type handler  * for specific content types. If one is not found, we will drop back  * to the default handler.  */  if ((tempClass = mime_locate_external_content_handler(content_type, &ctHandlerInfo)) != NULL)  {    clazz = (MimeObjectClass *)tempClass;  }  else  {    if (!content_type || !*content_type ||      !PL_strcasecmp(content_type, "text"))  /* with no / in the type */      clazz = (MimeObjectClass *)&mimeUntypedTextClass;          /* Subtypes of text...    */    else if (!PL_strncasecmp(content_type,			"text/", 5))    {      if      (!PL_strcasecmp(content_type+5,		"html"))        clazz = (MimeObjectClass *)&mimeInlineTextHTMLClass;      else if (!PL_strcasecmp(content_type+5,		"enriched"))        clazz = (MimeObjectClass *)&mimeInlineTextEnrichedClass;      else if (!PL_strcasecmp(content_type+5,		"richtext"))        clazz = (MimeObjectClass *)&mimeInlineTextRichtextClass;      else if (!PL_strcasecmp(content_type+5,		"plain"))        clazz = (MimeObjectClass *)&mimeInlineTextPlainClass;      else if (!exact_match_p)        clazz = (MimeObjectClass *)&mimeInlineTextPlainClass;    }        /* Subtypes of multipart...    */    else if (!PL_strncasecmp(content_type,			"multipart/", 10))    {      if      (!PL_strcasecmp(content_type+10,	"alternative"))        clazz = (MimeObjectClass *)&mimeMultipartAlternativeClass;      else if (!PL_strcasecmp(content_type+10,	"related"))        clazz = (MimeObjectClass *)&mimeMultipartRelatedClass;      else if (!PL_strcasecmp(content_type+10,	"digest"))        clazz = (MimeObjectClass *)&mimeMultipartDigestClass;      else if (!PL_strcasecmp(content_type+10,	"appledouble") ||        !PL_strcasecmp(content_type+10,	"header-set"))        clazz = (MimeObjectClass *)&mimeMultipartAppleDoubleClass;      else if (!PL_strcasecmp(content_type+10,	"parallel"))        clazz = (MimeObjectClass *)&mimeMultipartParallelClass;      else if (!PL_strcasecmp(content_type+10,	"mixed"))        clazz = (MimeObjectClass *)&mimeMultipartMixedClass;            else if (!PL_strcasecmp(content_type+10,	"signed"))      {      /* Check that the "protocol" and "micalg" parameters are ones we        know about. */        char *ct = (hdrs          ? MimeHeaders_get(hdrs, HEADER_CONTENT_TYPE,										PR_FALSE, PR_FALSE)                    : 0);        char *proto = (ct          ? MimeHeaders_get_parameter(ct, PARAM_PROTOCOL, NULL, NULL)          : 0);        char *micalg = (ct          ? MimeHeaders_get_parameter(ct, PARAM_MICALG, NULL, NULL)          : 0);        #ifdef MOZ_SECURITY        HG01444#endif                    PR_FREEIF(proto);        PR_FREEIF(micalg);        PR_FREEIF(ct);      }            if (!clazz && !exact_match_p)        /* Treat all unknown multipart subtypes as "multipart/mixed" */        clazz = (MimeObjectClass *)&mimeMultipartMixedClass;    }        /* Subtypes of message...    */    else if (!PL_strncasecmp(content_type,			"message/", 8))    {      if      (!PL_strcasecmp(content_type+8,		"rfc822") ||        !PL_strcasecmp(content_type+8,		"news"))        clazz = (MimeObjectClass *)&mimeMessageClass;      else if (!PL_strcasecmp(content_type+8,		"external-body"))        clazz = (MimeObjectClass *)&mimeExternalBodyClass;      else if (!PL_strcasecmp(content_type+8,		"partial"))        /* I guess these are most useful as externals, for now... */        clazz = (MimeObjectClass *)&mimeExternalObjectClass;      else if (!exact_match_p)        /* Treat all unknown message subtypes as "text/plain" */        clazz = (MimeObjectClass *)&mimeInlineTextPlainClass;    }        /* The magic image types which we are able to display internally...    */    else if (!PL_strcasecmp(content_type,			IMAGE_GIF)  ||      !PL_strcasecmp(content_type,			IMAGE_JPG) ||      !PL_strcasecmp(content_type,			IMAGE_PJPG) ||      !PL_strcasecmp(content_type,			IMAGE_PNG) ||      !PL_strcasecmp(content_type,			IMAGE_XBM)  ||      !PL_strcasecmp(content_type,			IMAGE_XBM2) ||      !PL_strcasecmp(content_type,			IMAGE_XBM3))      clazz = (MimeObjectClass *)&mimeInlineImageClass;    #ifdef MOZ_SECURITY    HG01555#endif          /* A few types which occur in the real world and which we would otherwise    treat as non-text types (which would be bad) without this special-case...    */    else if (!PL_strcasecmp(content_type,			APPLICATION_PGP) ||    !PL_strcasecmp(content_type,			APPLICATION_PGP2))    clazz = (MimeObjectClass *)&mimeInlineTextPlainClass;        else if (!PL_strcasecmp(content_type,			SUN_ATTACHMENT))      clazz = (MimeObjectClass *)&mimeSunAttachmentClass;          /* Everything else gets represented as a clickable link.    */    else if (!exact_match_p)      clazz = (MimeObjectClass *)&mimeExternalObjectClass;    } if (!exact_match_p)   PR_ASSERT(clazz);  if (!clazz) return 0;  /* If the `Show Attachments as Links' kludge is on, now would be the time	 to change our mind... */  if (opts && opts->no_inline_p)	{	  if (mime_subclass_p(clazz, (MimeObjectClass *)&mimeInlineTextClass))		{		  /* It's a text type.  Write it only if it's the *first* part			 that we're writing, and then only if it has no "filename"			 specified (the assumption here being, if it has a filename,			 it wasn't simply typed into the text field -- it was actually			 an attached document.) */		  if (opts->state && opts->state->first_part_written_p)			clazz = (MimeObjectClass *)&mimeExternalObjectClass;		  else			{			  /* If there's a name, then write this as an attachment. */			  char *name = (hdrs ? MimeHeaders_get_name(hdrs) : 0);			  if (name)				clazz = (MimeObjectClass *)&mimeExternalObjectClass;			  PR_FREEIF(name);			}		  if (opts->state)			opts->state->first_part_written_p = PR_TRUE;		}	  else if (mime_subclass_p(clazz,(MimeObjectClass *)&mimeContainerClass) &&			   !mime_subclass_p(clazz,(MimeObjectClass *)&mimeMessageClass))		/* Multipart subtypes are ok, except for messages; descend into		   multiparts, and defer judgement.		   Xlateed blobs are just like other containers (make the xlation		   layer invisible, and treat them as simple containers.  So there's		   no easy way to save xlated data directly to disk; it will tend		   to always be wrapped inside a message/rfc822.  That's ok.)		 */		;	  else if (opts &&			   opts->part_to_load &&			   mime_subclass_p(clazz,(MimeObjectClass *)&mimeMessageClass))		/* Descend into messages only if we're looking for a specific sub-part.		 */		;	  else		{		  /* Anything else, and display it as a link (and cause subsequent			 text parts to also be displayed as links.) */		  clazz = (MimeObjectClass *)&mimeExternalObjectClass;		  if (opts->state)			opts->state->first_part_written_p = PR_TRUE;		}	}  PR_ASSERT(clazz);  if (clazz && !clazz->class_initialized)	{	  int status = mime_classinit(clazz);	  if (status < 0) return 0;	}  return clazz;}