nsIComponentManager* compMgr; rv = servMgr->GetService(kComponentManagerCID, nsIComponentManager::GetIID(), (nsISupports**)&compMgr); if (NS_FAILED(rv)) return rv;  #ifdef DEBUG printf("*** The NEW and Improved Mime being registered\n"); #endif
extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *path){  nsresult rv;  nsCOMPtr<nsIServiceManager> servMgr(do_QueryInterface(aServMgr, &rv));  if (NS_FAILED(rv)) return rv;  nsIComponentManager* compMgr;  rv = servMgr->GetService(kComponentManagerCID,                            nsIComponentManager::GetIID(),                            (nsISupports**)&compMgr);  if (NS_FAILED(rv)) return rv;#ifdef DEBUG  printf("*** The NEW and Improved Mime being registered\n");#endif  // Content type handler object class access interface  rv = compMgr->RegisterComponent(kCMimeMimeObjectClassAccessCID, NULL, NULL, path,                                   PR_TRUE, PR_TRUE);  if (NS_FAILED(rv)) goto done;  // I18N Header Conversion routines  rv = compMgr->RegisterComponent(kCMimeConverterCID, NULL, NULL, path,                                   PR_TRUE, PR_TRUE);  if (NS_FAILED(rv)) goto done;  // Message Header Parser  rv = compMgr->RegisterComponent(kCMsgHeaderParserCID,                                       "Header Parser",                                       nsnull,                                       path, PR_TRUE, PR_TRUE);  if (NS_FAILED(rv)) goto done;    // The new interface for stream conversion                                rv = compMgr->RegisterComponent(kINetPluginMIMECID, NULL, PROGRAM_ID, path,                                   PR_TRUE, PR_TRUE);  if (NS_FAILED(rv)) goto done;  // The interface for URL utils  rv = compMgr->RegisterComponent(kCIMimeURLUtilsCID, NULL, NULL, path,                                   PR_TRUE, PR_TRUE);  if (NS_FAILED(rv)) goto done;  done:  (void)servMgr->ReleaseService(kComponentManagerCID, compMgr);  return rv;}