Bug 319997 - Convert parser tests to use the frozen linkage, r=mrbkap

git-svn-id: svn://10.0.0.236/trunk@185971 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bsmedberg%covad.net
2005-12-12 20:56:37 +00:00
parent b26672902a
commit d332f10cd0
6 changed files with 22 additions and 13 deletions

View File

@@ -42,9 +42,15 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = outsinks \
grabpage \
html \
$(NULL)
DIRS = \
grabpage \
html \
$(NULL)
ifndef MOZ_ENABLE_LIBXUL
DIRS += \
outsinks \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk

View File

@@ -43,7 +43,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
PROGRAM = grabpage$(BIN_SUFFIX)
MOZILLA_INTERNAL_API = 1
REQUIRES = xpcom \
string \
@@ -53,6 +52,7 @@ REQUIRES = xpcom \
CPPSRCS = grabpage.cpp
LIBS = \
$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)

View File

@@ -37,6 +37,8 @@
#include "nsIStreamListener.h"
#include "nsIInputStream.h"
#include "nsIURL.h"
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
#include "nsNetCID.h"
#include "nsCOMPtr.h"
@@ -49,8 +51,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static nsIEventQueue* gEventQ = nsnull;
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsStringAPI.h"
#include "nsCRT.h"
#include "prprf.h"
@@ -178,7 +179,7 @@ public:
nsresult Init(nsILocalFile *aDirectory);
nsresult Grab(const nsAFlatCString& aURL);
nsresult Grab(const nsCString& aURL);
protected:
nsILocalFile* NextFile(const char* aExtension);
@@ -216,7 +217,7 @@ PageGrabber::NextFile(const char* aExtension)
}
nsresult
PageGrabber::Grab(const nsAFlatCString& aURL)
PageGrabber::Grab(const nsCString& aURL)
{
nsresult rv;
// Create the Event Queue for this thread...
@@ -240,7 +241,7 @@ PageGrabber::Grab(const nsAFlatCString& aURL)
fputs(aURL.get(), stdout);
nsAutoString path;
file->GetPath(path);
NS_ConvertUCS2toUTF8 cpath(path);
NS_ConvertUTF16toUTF8 cpath(path);
printf(" to %s\n", cpath.get());
// Create the URL object...

View File

@@ -42,8 +42,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MOZILLA_INTERNAL_API = 1
PROGRAM = TestParser$(BIN_SUFFIX)
REQUIRES = xpcom \
@@ -57,6 +55,7 @@ CPPSRCS = \
$(NULL)
LIBS = \
$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)

View File

@@ -37,10 +37,12 @@
#include "nsXPCOM.h"
#include "nsIComponentManager.h"
#include "nsComponentManagerUtils.h"
#include "nsParserCIID.h"
#include "nsIParser.h"
#include "nsILoggingSink.h"
#include "nsIInputStream.h"
#include "nsCOMPtr.h"
// Class IID's
static NS_DEFINE_CID(kParserCID, NS_PARSER_CID);
@@ -94,7 +96,7 @@ nsresult ParseData(char* anInputStream,char* anOutputStream) {
while(!done) {
length = PR_Read(in, buffer, sizeof(buffer));
if (length != 0) {
stream.AppendWithConversion(buffer, length);
stream.Append(NS_ConvertUTF8toUTF16(buffer, length));
}
else {
done=PR_TRUE;