fprintf(stderr, "Interface trouble!\n\n"); } #endif  if (NS_FAILED(rv)) {
LOG(("Interface trouble in stream land!"));
CreateInputStream(const nsAString& aFilename,                  nsIFileInputStream ** aFileInputStream,                  nsILineInputStream ** aLineInputStream,                  nsAString& aBuffer,                  PRBool * aNetscapeFormat,                  PRBool * aMore) {  nsresult rv = NS_OK;  nsCOMPtr<nsILocalFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));  if (NS_FAILED(rv))    return rv;  rv = file->InitWithPath(aFilename);  if (NS_FAILED(rv))    return rv;  nsCOMPtr<nsIFileInputStream> fileStream(do_CreateInstance(NS_LOCALFILEINPUTSTREAM_CONTRACTID, &rv));  if (NS_FAILED(rv))    return rv;  rv = fileStream->Init(file, -1, -1, PR_FALSE);  if (NS_FAILED(rv))    return rv;  nsCOMPtr<nsILineInputStream> lineStream(do_QueryInterface(fileStream, &rv));#ifdef DEBUG_bzbarsky  if (NS_FAILED(rv)) {    fprintf(stderr, "Interface trouble!\n\n");  }#endif // DEBUG_bzbarsky  if (NS_FAILED(rv)) {    return rv;  }  rv = lineStream->ReadLine(aBuffer, aMore);  if (NS_FAILED(rv)) {    fileStream->Close();    return rv;  }  *aNetscapeFormat = IsNetscapeFormat(aBuffer);  *aFileInputStream = fileStream;  NS_ADDREF(*aFileInputStream);  *aLineInputStream = lineStream;  NS_ADDREF(*aLineInputStream);  return NS_OK;}