From fbc7bcbf716afe07da9bb67c4f7ed0afd50655ba Mon Sep 17 00:00:00 2001 From: montulli Date: Thu, 18 Jun 1998 00:54:05 +0000 Subject: [PATCH] merge tip with montulli branch and create montulli1 git-svn-id: svn://10.0.0.236/branches/montulli1@4042 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cmd/macfe/central/msv2dsk.cp | 1 + mozilla/cmd/winfe/cxnet1.h | 1 + mozilla/cmd/winfe/cxsave.h | 1 + mozilla/cmd/winfe/feembed.cpp | 1 + mozilla/cmd/winfe/mkfiles32/mozilla.mak | 5 +- mozilla/cmd/winfe/oleview.cpp | 1 + mozilla/cmd/xfe/Makefile | 2 + mozilla/cmd/xfe/icons/Makefile | 2 +- mozilla/cmd/xfe/src/Makefile | 4 +- mozilla/config/config.mk | 2 +- mozilla/dbm/include/hash.h | 1 + mozilla/dbm/src/hash.c | 7 +- mozilla/include/libevent.h | 17 +- mozilla/include/libmocha.h | 9 +- mozilla/include/net.h | 77 - mozilla/include/proto.h | 1 - mozilla/lib/htmldlgs/Makefile | 2 +- mozilla/lib/htmldlgs/htmldlgs.c | 40 +- mozilla/lib/htmldlgs/makefile.win | 1 + mozilla/lib/layout/Makefile | 3 +- mozilla/lib/layout/edtbuf.cpp | 13 +- mozilla/lib/layout/edtsave.cpp | 1 + mozilla/lib/layout/layinfo.c | 10 +- mozilla/lib/layout/layobj.c | 1 + mozilla/lib/layout/layout.c | 9 +- mozilla/lib/layout/layout.h | 5 +- mozilla/lib/layout/layscrip.c | 3 +- mozilla/lib/layout/laytags.c | 8 +- mozilla/lib/layout/streams.cpp | 18 +- mozilla/lib/layout/streams.h | 5 +- mozilla/lib/libi18n/Makefile | 2 +- mozilla/lib/libi18n/net_junk.c | 1 + mozilla/lib/libmisc/Makefile | 2 +- mozilla/lib/libmisc/glhist.c | 17 +- mozilla/lib/libmocha/Makefile | 3 +- mozilla/lib/libmocha/et_mocha.c | 20 +- mozilla/lib/libmocha/et_moz.c | 53 +- mozilla/lib/libmocha/lm.h | 6 +- mozilla/lib/libmocha/lm_doc.c | 30 +- mozilla/lib/libmocha/lm_init.c | 12 +- mozilla/lib/libparse/Makefile | 2 +- mozilla/lib/libparse/pa_hook.c | 1 + mozilla/lib/libparse/pa_parse.c | 1 + mozilla/lib/libpwcac/Makefile | 2 +- mozilla/lib/libpwcac/pwcacapi.c | 13 +- mozilla/lib/libstyle/Makefile | 2 +- mozilla/lib/plugin/Makefile | 2 +- mozilla/lib/plugin/npglue.cpp | 1 + mozilla/lib/xp/Makefile | 4 + mozilla/modules/libfont/src/Makefile | 2 +- mozilla/modules/libfont/src/makefile.win | 6 +- mozilla/modules/libfont/src/wfStream.cpp | 2 + mozilla/modules/libimg/public/il_strm.h | 3 +- mozilla/modules/libimg/src/Makefile | 2 +- mozilla/modules/libimg/src/makefile.win | 4 +- mozilla/modules/rdf/src/Makefile | 2 +- mozilla/modules/rdf/src/es2mcf.h | 2 +- mozilla/modules/rdf/src/glue.c | 1 + mozilla/modules/rdf/src/makefile.win | 5 +- mozilla/modules/rdf/src/mcff2mcf.h | 1 + mozilla/modules/security/freenav/Makefile | 2 +- mozilla/modules/security/freenav/makefile.win | 1 + mozilla/modules/softupdt/src/softupdt.c | 1 - mozilla/modules/xml/Makefile | 2 +- mozilla/modules/xml/glue/makefile.win | 3 +- mozilla/modules/xml/glue/xmlglue.c | 1 + mozilla/modules/xml/glue/xmlss.c | 1 + mozilla/network/Makefile | 3 +- mozilla/network/cache/Makefile | 5 +- mozilla/network/cache/makefile.win | 3 +- mozilla/network/cache/mkcache.c | 16 +- mozilla/network/cache/mkextcac.c | 1 - mozilla/network/cache/mkmemcac.c | 12 +- mozilla/network/cache/mkmemcac.h | 6 - mozilla/network/client/Makefile | 2 +- mozilla/network/client/cnetinit.c | 18 +- mozilla/network/client/cnetinit.h | 18 +- mozilla/network/client/makefile.win | 1 + mozilla/network/cnvts/Makefile | 2 +- mozilla/network/cnvts/cvactive.c | 2 +- mozilla/network/cnvts/cvchunk.c | 1 + mozilla/network/cnvts/cvcolor.c | 1 + mozilla/network/cnvts/cvdisk.c | 1 + mozilla/network/cnvts/cvextcon.c | 1 + mozilla/network/cnvts/cvjscfg.c | 2 + mozilla/network/cnvts/cvmime.c | 2 +- mozilla/network/cnvts/cvpics.c | 2 +- mozilla/network/cnvts/cvproxy.c | 2 +- mozilla/network/cnvts/cvsimple.c | 1 + mozilla/network/cnvts/cvunzip.c | 2 +- mozilla/network/cnvts/cvview.c | 2 +- mozilla/network/cnvts/makefile.win | 29 +- mozilla/network/cnvts/txview.c | 2 +- mozilla/network/main/Makefile | 4 +- mozilla/network/main/jsautocf.c | 3 +- mozilla/network/main/makefile.win | 4 +- mozilla/network/main/mkautocf.c | 3 +- mozilla/network/main/mkfsort.c | 24 +- mozilla/network/main/mkfsort.h | 3 +- mozilla/network/main/mkgeturl.c | 2 +- mozilla/network/main/mkgeturl.h | 3 +- mozilla/network/main/mkhelp.c | 1 + mozilla/network/main/mkinit.c | 2 +- mozilla/network/main/mkstream.c | 1295 ++--------------- mozilla/network/main/mkstream.h | 51 +- mozilla/network/makefile.win | 1 + mozilla/network/protocol/about/Makefile | 2 +- mozilla/network/protocol/about/makefile.win | 4 + mozilla/network/protocol/about/mkabout.c | 32 +- mozilla/network/protocol/dataurl/mkdaturl.c | 24 +- mozilla/network/protocol/file/Makefile | 2 +- mozilla/network/protocol/file/fileurl.h | 4 +- mozilla/network/protocol/file/makefile.win | 2 + mozilla/network/protocol/file/mkfile.c | 57 +- mozilla/network/protocol/ftp/mkftp.c | 43 +- mozilla/network/protocol/gopher/mkgopher.c | 18 +- mozilla/network/protocol/http/Makefile | 2 +- mozilla/network/protocol/http/makefile.win | 2 + mozilla/network/protocol/http/mkhttp.c | 26 +- mozilla/network/protocol/js/Makefile | 2 +- mozilla/network/protocol/js/makefile.win | 1 + mozilla/network/protocol/js/mkmocha.c | 24 +- mozilla/nsprpub/config/UNIX.mk | 2 +- 123 files changed, 590 insertions(+), 1656 deletions(-) diff --git a/mozilla/cmd/macfe/central/msv2dsk.cp b/mozilla/cmd/macfe/central/msv2dsk.cp index d41ee0ecfb4..f0389ac7376 100644 --- a/mozilla/cmd/macfe/central/msv2dsk.cp +++ b/mozilla/cmd/macfe/central/msv2dsk.cp @@ -42,6 +42,7 @@ #include "glhist.h" #include "xlate.h" #include "prefapi.h" +#include "cstream.h" #include "BufferStream.h" #include "PascalString.h" diff --git a/mozilla/cmd/winfe/cxnet1.h b/mozilla/cmd/winfe/cxnet1.h index 4d2da923745..c40694f5398 100644 --- a/mozilla/cmd/winfe/cxnet1.h +++ b/mozilla/cmd/winfe/cxnet1.h @@ -17,6 +17,7 @@ */ #include "cxstubs.h" +#include "cstream.h" ///////////////////////////////////////////////////////////////////////////// // CNetworkCX command target diff --git a/mozilla/cmd/winfe/cxsave.h b/mozilla/cmd/winfe/cxsave.h index 247d6ad0cbb..ef1f0cd388e 100644 --- a/mozilla/cmd/winfe/cxsave.h +++ b/mozilla/cmd/winfe/cxsave.h @@ -20,6 +20,7 @@ #include "cxstubs.h" #include "widgetry.h" +#include "cstream.h" ///////////////////////////////////////////////////////////////////////////// // CSaveCX dialog diff --git a/mozilla/cmd/winfe/feembed.cpp b/mozilla/cmd/winfe/feembed.cpp index 09c1d69d9b6..7267d5cbad0 100755 --- a/mozilla/cmd/winfe/feembed.cpp +++ b/mozilla/cmd/winfe/feembed.cpp @@ -30,6 +30,7 @@ #include "il_icons.h" #include "extgen.h" #include "libevent.h" +#include "cstream.h" extern "C" int MK_DISK_FULL; // defined in allxpstr.c diff --git a/mozilla/cmd/winfe/mkfiles32/mozilla.mak b/mozilla/cmd/winfe/mkfiles32/mozilla.mak index 982972548e7..4838589f076 100644 --- a/mozilla/cmd/winfe/mkfiles32/mozilla.mak +++ b/mozilla/cmd/winfe/mkfiles32/mozilla.mak @@ -419,6 +419,7 @@ LINK_LIBS= \ $(DIST)\lib\netcnvts.lib \ $(DIST)\lib\mimetype.lib \ $(DIST)\lib\netutil.lib \ + $(DIST)\lib\cstream.lib \ $(DIST)\lib\network.lib \ $(DIST)\lib\cnetinit.lib \ !ifdef MOZ_LDAP @@ -607,8 +608,8 @@ CDISTINCLUDES2= \ /I$(XPDIST)\public\netcache \ /I$(XPDIST)\public\netlib \ /I$(XPDIST)\public\network \ - /I$(XPDIST)\public\netcnvts\ - /I$(XPDIST)\public\util + /I$(XPDIST)\public\netcnvts \ + /I$(XPDIST)\public\cstream !endif CDISTINCLUDES3= \ diff --git a/mozilla/cmd/winfe/oleview.cpp b/mozilla/cmd/winfe/oleview.cpp index 168d095cc66..94f75aa6820 100644 --- a/mozilla/cmd/winfe/oleview.cpp +++ b/mozilla/cmd/winfe/oleview.cpp @@ -22,6 +22,7 @@ #include "xp_mem.h" #include "xp_mcom.h" #include "xpassert.h" +#include "cstream.h" static unsigned int ole_view_write_ready(NET_StreamClass *stream) diff --git a/mozilla/cmd/xfe/Makefile b/mozilla/cmd/xfe/Makefile index 4bb74882974..cd04e88a5ab 100644 --- a/mozilla/cmd/xfe/Makefile +++ b/mozilla/cmd/xfe/Makefile @@ -106,6 +106,8 @@ REQUIRES =\ java \ ldap \ xfeicons \ + cstream \ + network \ $(NULL) CSRCS = \ diff --git a/mozilla/cmd/xfe/icons/Makefile b/mozilla/cmd/xfe/icons/Makefile index 9153e9de8f9..ccf017f67d3 100644 --- a/mozilla/cmd/xfe/icons/Makefile +++ b/mozilla/cmd/xfe/icons/Makefile @@ -25,7 +25,7 @@ LIBRARY_NAME = xfeicons CSRCS = $(ICONS_GEN_SRC) EXPORTS = $(ICONS_GEN_HDR) icondata.h -REQUIRES = img java jtools layer nspr util xp +REQUIRES = img java jtools layer nspr util xp cstream LOCAL_INCLUDES = -I. -I$(OBJDIR) diff --git a/mozilla/cmd/xfe/src/Makefile b/mozilla/cmd/xfe/src/Makefile index f80bd116269..d72818e2e28 100644 --- a/mozilla/cmd/xfe/src/Makefile +++ b/mozilla/cmd/xfe/src/Makefile @@ -51,7 +51,9 @@ REQUIRES =\ rdf \ xpcom \ plug \ - netcnvts + netcnvts \ + network \ + cstream CPPSRCS = \ plugin.cpp \ diff --git a/mozilla/config/config.mk b/mozilla/config/config.mk index 51374690c05..5969a610c9c 100644 --- a/mozilla/config/config.mk +++ b/mozilla/config/config.mk @@ -195,7 +195,7 @@ else JAVA_PROG = $(LOCAL_BIN)java JAVAC_ZIP = $(JAVA_LIB)/javac.zip endif -PERL = $(NS_BIN)perl +PERL = $(NS_BIN)perl5 TAR = tar EMACS = xemacs WHOAMI = /usr/bin/whoami diff --git a/mozilla/dbm/include/hash.h b/mozilla/dbm/include/hash.h index b898fe048a7..4db5d44f202 100644 --- a/mozilla/dbm/include/hash.h +++ b/mozilla/dbm/include/hash.h @@ -123,6 +123,7 @@ typedef struct htab { /* Memory resident data structure */ int save_file; /* Indicates whether we need to flush * file at * exit */ + int dirty_bit; /* has db changed */ uint32 *mapp[NCACHED]; /* Pointers to page maps */ int nmaps; /* Initial number of bitmaps */ int nbufs; /* Number of buffers left to diff --git a/mozilla/dbm/src/hash.c b/mozilla/dbm/src/hash.c index c8e9a234f16..56dd1045f56 100644 --- a/mozilla/dbm/src/hash.c +++ b/mozilla/dbm/src/hash.c @@ -161,6 +161,7 @@ __hash_open(const char *file, int flags, int mode, const HASHINFO *info, int dfl if (!(hashp = (HTAB *)calloc(1, sizeof(HTAB)))) RETURN_ERROR(ENOMEM, error0); hashp->fp = NO_FILE; + hashp->dirty_bit = 0; if(file) hashp->filename = strdup(file); @@ -611,7 +612,7 @@ flush_meta(HTAB *hashp) #endif int fp, i, wsize; - if (!hashp->save_file) + if (!hashp->save_file || !hashp->dirty_bit) return (0); hashp->MAGIC = HASHMAGIC; hashp->VERSION = HASHVERSION; @@ -695,6 +696,8 @@ hash_put( if (!hashp) return (DBM_ERROR); + hashp->dirty_bit = 1; + if (flag && flag != R_NOOVERWRITE) { hashp->dbmerrno = errno = EINVAL; return (DBM_ERROR); @@ -731,6 +734,8 @@ hash_delete( if (!hashp) return (DBM_ERROR); + hashp->dirty_bit = 1; + if (flag && flag != R_CURSOR) { hashp->dbmerrno = errno = EINVAL; return (DBM_ERROR); diff --git a/mozilla/include/libevent.h b/mozilla/include/libevent.h index 8f7906a5119..b2abc68cbed 100644 --- a/mozilla/include/libevent.h +++ b/mozilla/include/libevent.h @@ -34,6 +34,7 @@ #include "shist.h" #include "fe_proto.h" #include "lo_ele.h" +#include "netstream.h" NSPR_BEGIN_EXTERN_C @@ -271,7 +272,7 @@ ET_SendEvent(MWContext * pContext, LO_Element *pElement, JSEvent *pEvent, */ extern void ET_SendLoadEvent(MWContext * pContext, int32 type, ETVoidPtrFunc fnClosure, - NET_StreamClass *stream, int32 layer_id, Bool resize_reload); + NET_VoidStreamClass *stream, int32 layer_id, Bool resize_reload); /* * Tell the backend about a new image event. Async. No closure @@ -358,10 +359,10 @@ ET_SetActiveLayer(MWContext * pContext, int32 layer_id); ** Tell mocha where to send its output */ extern void -ET_ClearDecoderStream(MWContext * context, NET_StreamClass * old_stream); +ET_ClearDecoderStream(MWContext * context, NET_VoidStreamClass * old_stream); extern void -ET_SetDecoderStream(MWContext * context, NET_StreamClass *stream, +ET_SetDecoderStream(MWContext * context, NET_VoidStreamClass *stream, URL_Struct *url_struct, JSBool free_stream_on_close); /* @@ -584,14 +585,14 @@ ET_net_GetCookie(MWContext* context, int32 doc_id); extern char * ET_net_SetCookieString(MWContext* context, char * szCookie, int32 doc_id); -extern NET_StreamClass * +extern NET_VoidStreamClass * ET_net_CacheConverter(FO_Present_Types format, void * obj, URL_Struct *pUrl, MWContext * pContext); extern void ET_net_FindURLInCache(URL_Struct * pUrl, MWContext * pContext); -extern NET_StreamClass * +extern NET_VoidStreamClass * ET_net_StreamBuilder(FO_Present_Types format, URL_Struct *pUrl, MWContext * pContext); @@ -610,7 +611,7 @@ ET_fe_SubmitInputElement(MWContext * pContext, LO_Element * ele); * late for the intended document */ extern int -ET_lo_DoDocWrite(JSContext *cx, MWContext * context, NET_StreamClass * stream, +ET_lo_DoDocWrite(JSContext *cx, MWContext * context, NET_VoidStreamClass * stream, char * str, size_t len, int32 doc_id); @@ -687,12 +688,12 @@ ET_moz_CallAsyncAndSubEventLoop(ETVoidPtrFunc fn, void *data, MWContext *context); extern void -ET_moz_Abort(MKStreamAbortFunc fn, void * data, int status); +ET_moz_Abort(NET_VoidStreamClass *stream, int status); extern void ET_moz_SetMochaWriteStream(MochaDecoder * decoder); -extern NET_StreamClass * +extern NET_VoidStreamClass * ET_moz_DocCacheConverter(MWContext * context, URL_Struct * pUrl, char * wysiwyg_url, int32 layer_id); diff --git a/mozilla/include/libmocha.h b/mozilla/include/libmocha.h index 60629224ef6..a816882c92b 100644 --- a/mozilla/include/libmocha.h +++ b/mozilla/include/libmocha.h @@ -29,6 +29,7 @@ #include "plhash.h" #include "prthread.h" #include "jsapi.h" +#include "netstream.h" /* enable JavaScript Debugger support */ #if defined (_WIN32) || defined(XP_UNIX) || defined(powerc) || defined(__powerc) || defined(XP_OS2) @@ -53,7 +54,7 @@ typedef struct MochaDecoder { JSContext *js_context; MWContext *window_context; JSObject *window_object; - NET_StreamClass *stream; + NET_VoidStreamClass *stream; int32 stream_owner; /* id of layer that's loading the stream */ URL_Struct *url_struct; JSTimeout *timeouts; @@ -300,7 +301,7 @@ LM_DropSavedWindow(MWContext *context, void *window); * associated with the given context */ extern JSBool -LM_SetDecoderStream(MWContext * context, NET_StreamClass *stream, +LM_SetDecoderStream(MWContext * context, NET_VoidStreamClass *stream, URL_Struct *url_struct, JSBool free_stream_on_close); /* @@ -308,7 +309,7 @@ LM_SetDecoderStream(MWContext * context, NET_StreamClass *stream, * script is running on mc, the document is being generated into decoder's * window, and url_struct tells about the generator. */ -extern NET_StreamClass * +extern NET_VoidStreamClass * LM_WysiwygCacheConverter(MWContext *context, URL_Struct *url_struct, const char * wysiwyg_url, const char * base_href); @@ -555,7 +556,7 @@ LM_RegisterPrincipals(MochaDecoder *decoder, JSPrincipals *principals, */ #ifdef JSDEBUGGER -extern NET_StreamClass* +extern NET_VoidStreamClass* LM_StreamBuilder( int format_out, void *data_obj, URL_Struct *URL_s, diff --git a/mozilla/include/net.h b/mozilla/include/net.h index 644d39ba3c1..814a3584df2 100644 --- a/mozilla/include/net.h +++ b/mozilla/include/net.h @@ -477,53 +477,6 @@ struct URL_Struct_ { #define NET_URLStruct_ContentLength(S) S->content_length #define NET_URLStruct_ContentType(S) S->content_type -/* stream functions - */ -typedef unsigned int -(*MKStreamWriteReadyFunc) (NET_StreamClass *stream); - -#define MAX_WRITE_READY (((unsigned) (~0) << 1) >> 1) /* must be <= than MAXINT!!!!! */ - -typedef int -(*MKStreamWriteFunc) (NET_StreamClass *stream, const char *str, int32 len); - -typedef void -(*MKStreamCompleteFunc) (NET_StreamClass *stream); - -typedef void -(*MKStreamAbortFunc) (NET_StreamClass *stream, int status); - -/* streamclass function - */ -struct _NET_StreamClass { - - char * name; /* Just for diagnostics */ - - MWContext * window_id; /* used for progress messages, etc. */ - - void * data_object; /* a pointer to whatever - * structure you wish to have - * passed to the routines below - * during writes, etc... - * - * this data object should hold - * the document, document - * structure or a pointer to the - * document. - */ - - MKStreamWriteReadyFunc is_write_ready; /* checks to see if the stream is ready - * for writing. Returns 0 if not ready - * or the number of bytes that it can - * accept for write - */ - MKStreamWriteFunc put_block; /* writes a block of data to the stream */ - MKStreamCompleteFunc complete; /* normal end */ - MKStreamAbortFunc abort; /* abnormal end */ - - Bool is_multipart; /* is the stream part of a multipart sequence */ -}; - /*DSR040197 - new and improved position for BEGIN_PROTOS*/ XP_BEGIN_PROTOS /* @@ -873,15 +826,6 @@ extern void NET_SetTCPConnectTimeout(uint32 seconds); /* Is there a registered converter for the passed mime_type */ extern XP_Bool NET_HaveConverterForMimeType(char *content_type); -/* builds an outgoing stream and returns a stream class structure - * containing a stream function table - */ -extern NET_StreamClass * NET_StreamBuilder ( - FO_Present_Types format_out, - URL_Struct * anchor, - MWContext * window_id); - - /* bit flags for determining what we want to parse from the URL */ #define GET_ALL_PARTS 127 @@ -1041,15 +985,6 @@ extern int NET_CleanupCacheDirectory(char * dir_name, const char * prefix); */ extern Bool NET_ChangeCacheFileLock(URL_Struct *URL_s, Bool set); -/* Find an actively-loading cache file for URL_s in context, and copy the first - * nbytes of it to a new cache file. Return a cache converter stream by which - * the caller can append to the cloned cache file. - */ -extern NET_StreamClass * -NET_CloneWysiwygCacheFile(MWContext *context, URL_Struct *URL_s, - uint32 nbytes, const char * wysiwyg_url, - const char * base_href); - /* returns TRUE if the url is in the disk cache */ extern Bool NET_IsURLInDiskCache(URL_Struct *URL_s); @@ -1484,18 +1419,6 @@ extern const char * NET_ExplainError(int code); */ extern Bool NET_IsURLSecure(char * address); -/* - * NewMKStream - * Utility to create a new initialized NET_StreamClass object - */ -extern NET_StreamClass * NET_NewStream(char *, - MKStreamWriteFunc, - MKStreamCompleteFunc, - MKStreamAbortFunc, - MKStreamWriteReadyFunc, - void *, - MWContext *); - /* this should really be a FE function */ extern void NET_RegisterConverters(char * personal_file, char * global_file); diff --git a/mozilla/include/proto.h b/mozilla/include/proto.h index 0191e436ea6..62a5ff093c3 100644 --- a/mozilla/include/proto.h +++ b/mozilla/include/proto.h @@ -252,7 +252,6 @@ extern Bool LO_LocateNamedAnchor(MWContext *context, URL_Struct *url_struct, extern int32 LO_EmptyRecyclingBin(MWContext *context); extern LO_AnchorData *LO_MapXYToAreaAnchor(MWContext *context, LO_ImageStruct *image, int32 x, int32 y); -extern intn LO_DocumentInfo(MWContext *context, NET_StreamClass *stream); extern intn LO_ChangeFontSize(intn size, char *size_str); extern double LO_GetScalingFactor(int32 scaler); extern int16 LO_WindowWidthInFixedChars(MWContext *context); diff --git a/mozilla/lib/htmldlgs/Makefile b/mozilla/lib/htmldlgs/Makefile index 130ee43d121..cc1acb037b8 100644 --- a/mozilla/lib/htmldlgs/Makefile +++ b/mozilla/lib/htmldlgs/Makefile @@ -23,7 +23,7 @@ LIBRARY_NAME = htmldlgs CSRCS = htmldlgs.c -REQUIRES = security dbm nspr img util layer js +REQUIRES = security dbm nspr img util layer js network EXPORTS = htmldlgs.h diff --git a/mozilla/lib/htmldlgs/htmldlgs.c b/mozilla/lib/htmldlgs/htmldlgs.c index 64c4c2c5634..ee674af6c40 100644 --- a/mozilla/lib/htmldlgs/htmldlgs.c +++ b/mozilla/lib/htmldlgs/htmldlgs.c @@ -25,6 +25,7 @@ #include "fe_proto.h" #include "seccomon.h" #include "net.h" +#include "netstream.h" #include "htmldlgs.h" #include "xpgetstr.h" #include "shist.h" @@ -95,8 +96,9 @@ typedef struct { typedef struct _htmlDialogStream { PRCList queuedBuffers; PRArenaPool *arena; - NET_StreamClass *stream; + NET_VoidStreamClass *stream; URL_Struct *url; + MWContext *context; PRBool buffering; char *curbuf; unsigned int curlen; @@ -140,8 +142,7 @@ writeOrBuffer(HTMLDialogStream *stream) int ret; if ( ! stream->buffering ) { - cnt = (*(stream->stream)->is_write_ready) - (stream->stream); + cnt = NET_StreamIsWriteReady(stream->stream); /* if stream is clogged, then start buffering */ if ( cnt < stream->curlen ) { /* we need to copy the current contents of the reusable @@ -171,8 +172,7 @@ writeOrBuffer(HTMLDialogStream *stream) node->data = stream->curbuf; node->len = stream->curlen; } else { - ret = (*(stream->stream)->put_block) - (stream->stream, stream->curbuf, stream->curlen); + ret = NET_StreamPutBlock(stream->stream, stream->curbuf, stream->curlen); if ( ret < 0 ) { goto loser; } @@ -204,8 +204,7 @@ putStringToStream(HTMLDialogStream *stream, char *string, PRBool quote) stream->curbuf = destptr = (char *)PORT_ArenaAlloc(stream->arena, maxsize); } else { - maxsize = (*(stream->stream)->is_write_ready) - (stream->stream); + maxsize = NET_StreamIsWriteReady(stream->stream); if ( maxsize == 0 ) { /* we are switching to buffering now */ @@ -341,7 +340,7 @@ XP_PutDialogStringsToStream(HTMLDialogStream *stream, XPDialogStrings *strs, SECStatus rv; char *src, *token, *junk; int argnum; - void *proto_win = stream->stream->window_id; + void *proto_win = stream->context; src = strs->contents; while ((token = PORT_Strchr(src, '%'))) { @@ -944,7 +943,8 @@ freeHTMLDialogStream(HTMLDialogStream *stream) { if ( stream != NULL ) { if ( stream->stream != NULL ) { - PORT_Free(stream->stream); + NET_StreamFree(stream->stream); + stream->stream = NULL; } if ( stream->url != NULL ) { @@ -990,7 +990,8 @@ newHTMLDialogStream(void *cx) StrAllocCopy(stream->url->content_type, TEXT_HTML); /* make a netlib stream to display in the window */ - stream->stream = NET_StreamBuilder(FO_PRESENT, stream->url, cx); + stream->stream = NET_VoidStreamBuilder(FO_PRESENT, stream->url, cx); + stream->context = cx; if ( stream->stream == NULL ) { goto loser; } @@ -1018,14 +1019,14 @@ emptyQueues(void *arg) /* get the head node */ node = (bufferNode *)PR_LIST_HEAD(&stream->queuedBuffers); - cnt = (*(stream->stream)->is_write_ready)(stream->stream); + cnt = NET_StreamIsWriteReady(stream->stream); if ( cnt < node->len ) { /* layout hasn't unclogged yet */ break; } - ret = (*(stream->stream)->put_block)(stream->stream, + ret = NET_StreamPutBlock(stream->stream, node->data, node->len); if ( ret < 0 ) { goto loser; @@ -1036,7 +1037,7 @@ emptyQueues(void *arg) } if ( PR_CLIST_IS_EMPTY(&stream->queuedBuffers) ) { - (*stream->stream->complete) (stream->stream); + NET_StreamComplete (stream->stream); freeHTMLDialogStream(stream); } else { FE_SetTimeout(emptyQueues, (void *)stream, 100); @@ -1197,7 +1198,7 @@ xp_DrawHTMLDialog(void *cx, XPDialogInfo *dialogInfo, if ( PR_CLIST_IS_EMPTY(&stream->queuedBuffers) ) { /* complete the stream */ - (*stream->stream->complete) (stream->stream); + NET_StreamComplete(stream->stream); freeHTMLDialogStream(stream); return(SECSuccess); @@ -1212,7 +1213,7 @@ loser: /* abort the stream */ if ( stream != NULL ) { if ( stream->stream != NULL ) { - (*stream->stream->abort)(stream->stream, rv); + NET_StreamAbort(stream->stream, rv); } } @@ -1226,7 +1227,6 @@ XP_MakeHTMLDialogWithChrome(void *proto_win, XPDialogInfo *dialogInfo, int titlenum, XPDialogStrings *strings, Chrome *chrome, void *arg, PRBool utf8CharSet) { - void *cx; SECStatus rv; XPDialogState *state; PRArenaPool *arena = NULL; @@ -1358,7 +1358,7 @@ XP_RedrawRawHTMLDialog(XPDialogState *state, /* complete the stream */ if ( PR_CLIST_IS_EMPTY(&stream->queuedBuffers) ) { /* complete the stream */ - (*stream->stream->complete) (stream->stream); + NET_StreamComplete(stream->stream); freeHTMLDialogStream(stream); return((int)SECSuccess); @@ -1373,7 +1373,7 @@ loser: /* abort the stream */ if ( stream != NULL ) { if ( stream->stream != NULL ) { - (*stream->stream->abort)(stream->stream, rv); + NET_StreamAbort(stream->stream, rv); } } @@ -1582,7 +1582,7 @@ displayPanelCB(void *arg) /* complete the stream */ if ( PR_CLIST_IS_EMPTY(&stream->queuedBuffers) ) { /* complete the stream */ - (*stream->stream->complete) (stream->stream); + NET_StreamComplete(stream->stream); freeHTMLDialogStream(stream); return; @@ -1596,7 +1596,7 @@ loser: /* abort the stream */ if ( stream != NULL ) { if ( stream->stream != NULL ) { - (*stream->stream->abort)(stream->stream, rv); + NET_StreamAbort(stream->stream, rv); } } diff --git a/mozilla/lib/htmldlgs/makefile.win b/mozilla/lib/htmldlgs/makefile.win index d7b94b7e1ff..d5ad05e90c2 100644 --- a/mozilla/lib/htmldlgs/makefile.win +++ b/mozilla/lib/htmldlgs/makefile.win @@ -50,6 +50,7 @@ LINCS = -I$(PUBLIC)/nspr \ -I$(DEPTH)\include \ -I$(PUBLIC)/security \ -I$(PUBLIC)/js \ + -I$(PUBLIC)/network \ -I$(PUBLIC)/img #//------------------------------------------------------------------------ diff --git a/mozilla/lib/layout/Makefile b/mozilla/lib/layout/Makefile index 14c1ecbed9d..5b79280287c 100644 --- a/mozilla/lib/layout/Makefile +++ b/mozilla/lib/layout/Makefile @@ -51,7 +51,8 @@ CSRCS = bullet.c \ laytrav.c \ $(NULL) -REQUIRES = parse style js layer applet nspr security dbm img util jtools edtplug java hook pref libfont lay rdf network htmldlgs +REQUIRES = parse style js layer applet nspr security dbm img util \ + jtools edtplug java hook pref libfont lay rdf network htmldlg cstream include $(DEPTH)/config/config.mk diff --git a/mozilla/lib/layout/edtbuf.cpp b/mozilla/lib/layout/edtbuf.cpp index 9645100f2f1..6aa5ebaf5b6 100644 --- a/mozilla/lib/layout/edtbuf.cpp +++ b/mozilla/lib/layout/edtbuf.cpp @@ -22,6 +22,7 @@ #include "editor.h" #include "prefapi.h" #include "intl_csi.h" +#include "netstream.h" #define CONTENT_TYPE "Content-Type" @@ -9576,8 +9577,8 @@ void CEditBuffer::ReadFromBuffer(XP_HUGE_CHAR_PTR pBuffer){ } StrAllocCopy(url_s->content_type, TEXT_HTML); - NET_StreamClass *stream = - NET_StreamBuilder(FO_PRESENT, url_s, m_pContext); + NET_VoidStreamClass *stream = + NET_VoidStreamBuilder(FO_PRESENT, url_s, m_pContext); if(stream) { delete m_pRoot; m_pRoot = 0; @@ -9600,11 +9601,11 @@ void CEditBuffer::ReadFromBuffer(XP_HUGE_CHAR_PTR pBuffer){ int count = 0; for (;;) { if ((*pDest++ = *pSrc++) == 0) { - (*stream->put_block)(stream, pChunk, count); + NET_StreamPutBlock(stream, pChunk, count); break; } else if (++count == CHUNK_SIZE) { - (*stream->put_block)(stream, pChunk, count); + NET_StreamPutBlock(stream, pChunk, count); pDest = pChunk; count = 0; } @@ -9613,8 +9614,8 @@ void CEditBuffer::ReadFromBuffer(XP_HUGE_CHAR_PTR pBuffer){ else XP_ASSERT(FALSE); - (*stream->complete)(stream); - XP_FREE(stream); + NET_StreamComplete(stream); + NET_StreamFree(stream); XP_FREEIF(pChunk); } NET_FreeURLStruct(url_s); diff --git a/mozilla/lib/layout/edtsave.cpp b/mozilla/lib/layout/edtsave.cpp index 39636a3b8b8..0b7a9a79817 100644 --- a/mozilla/lib/layout/edtsave.cpp +++ b/mozilla/lib/layout/edtsave.cpp @@ -26,6 +26,7 @@ #include "editor.h" #include "streams.h" +#include "cstream.h" #include "shist.h" #include "xpgetstr.h" #include "net.h" diff --git a/mozilla/lib/layout/layinfo.c b/mozilla/lib/layout/layinfo.c index d668745d4bb..24034910830 100644 --- a/mozilla/lib/layout/layinfo.c +++ b/mozilla/lib/layout/layinfo.c @@ -37,11 +37,11 @@ extern int LAY_PAGEINFO_METHOD; extern int LAY_PAGEINFO_LAYER; #define STREAM_WRITE(Str) \ - (*stream->put_block)(stream, Str, XP_STRLEN(Str)) + NET_StreamPutBlock(stream, Str, XP_STRLEN(Str)) PRIVATE void -lo_element_info(LO_Element *ele_list, NET_StreamClass *stream) +lo_element_info(LO_Element *ele_list, NET_VoidStreamClass *stream) { LO_Element *eptr; char buf[1024]; @@ -303,7 +303,7 @@ lo_element_info(LO_Element *ele_list, NET_StreamClass *stream) PRIVATE void -lo_backdrop_info(char *backdrop_image_url, NET_StreamClass *stream) +lo_backdrop_info(char *backdrop_image_url, NET_VoidStreamClass *stream) { if (backdrop_image_url) { @@ -343,7 +343,7 @@ lo_backdrop_info(char *backdrop_image_url, NET_StreamClass *stream) PRIVATE void -lo_form_info(lo_FormData *form_list, NET_StreamClass *stream) +lo_form_info(lo_FormData *form_list, NET_VoidStreamClass *stream) { int form_num=1; @@ -442,7 +442,7 @@ lo_form_info(lo_FormData *form_list, NET_StreamClass *stream) * completly laid out and info can be found. */ PUBLIC intn -LO_DocumentInfo(MWContext *context, NET_StreamClass *stream) +LO_DocumentInfo(MWContext *context, NET_VoidStreamClass *stream) { int32 doc_id, i; lo_TopState *top_state; diff --git a/mozilla/lib/layout/layobj.c b/mozilla/lib/layout/layobj.c index 57723e8704e..964f31d3020 100644 --- a/mozilla/lib/layout/layobj.c +++ b/mozilla/lib/layout/layobj.c @@ -22,6 +22,7 @@ #include "pa_parse.h" #include "layout.h" #include "np.h" +#include "cstream.h" #ifdef JAVA #include "java.h" #endif diff --git a/mozilla/lib/layout/layout.c b/mozilla/lib/layout/layout.c index aa869f8a4c3..71c5cf40dc2 100644 --- a/mozilla/lib/layout/layout.c +++ b/mozilla/lib/layout/layout.c @@ -39,6 +39,7 @@ #include "pics.h" #include "xp_ncent.h" #include "prefetch.h" +#include "cstream.h" /* WEBFONTS are defined only in laytags.c and layout.c */ #define WEBFONTS @@ -3581,20 +3582,20 @@ lo_FreeLayoutData(MWContext *context, lo_DocState *state) void lo_CloseMochaWriteStream(lo_TopState *top_state, int mocha_event) { - NET_StreamClass *stream = top_state->mocha_write_stream; + NET_VoidStreamClass *stream = top_state->mocha_write_stream; if (stream != NULL) { top_state->mocha_write_stream = NULL; if (mocha_event == EVENT_LOAD) { - stream->complete(stream); + NET_StreamComplete(stream); } else { - stream->abort(stream, top_state->layout_status); + NET_StreamAbort(stream, top_state->layout_status); } - XP_DELETE(stream); + NET_StreamFree(stream); } } diff --git a/mozilla/lib/layout/layout.h b/mozilla/lib/layout/layout.h index 64eb39ae038..a35aa338dd1 100644 --- a/mozilla/lib/layout/layout.h +++ b/mozilla/lib/layout/layout.h @@ -34,6 +34,7 @@ #include "stystack.h" #include "libmocha.h" +#include "netstream.h" #define MEMORY_ARENAS 1 @@ -824,7 +825,7 @@ struct lo_TopState_struct { JSVersion version; uint32 mocha_loading_applets_count; uint32 mocha_loading_embeds_count; - NET_StreamClass *mocha_write_stream; + NET_VoidStreamClass *mocha_write_stream; void *scriptData; #endif @@ -1667,4 +1668,6 @@ int32 lo_GetRowSpan(LO_Element *pCellElement); int32 lo_GetColSpan(LO_Element *pCellElement); int32 lo_GetCellPadding(LO_Element *pCellElement); +extern intn LO_DocumentInfo(MWContext *context, NET_VoidStreamClass *stream); + #endif /* _Layout_h_ */ diff --git a/mozilla/lib/layout/layscrip.c b/mozilla/lib/layout/layscrip.c index ef5799fcd32..62e630c51c3 100644 --- a/mozilla/lib/layout/layscrip.c +++ b/mozilla/lib/layout/layscrip.c @@ -35,6 +35,7 @@ #include "mcom_db.h" #include "laylayer.h" #include "prefapi.h" +#include "cstream.h" static char lo_jsAllowFileSrcFromNonFile[] = "javascript.allow.file_src_from_non_file"; @@ -159,7 +160,7 @@ lo_BlockScriptTag(MWContext *context, lo_DocState *state, PA_Tag *tag) tag->lo_data = (void *)(doc_data->comment_bytes + 1); if (top_state->script_tag_count++ == 0) - ET_SetDecoderStream(context, doc_data->parser_stream, + ET_SetDecoderStream(context, NET_CStreamToVoidStream(doc_data->parser_stream), doc_data->url_struct, JS_FALSE); } diff --git a/mozilla/lib/layout/laytags.c b/mozilla/lib/layout/laytags.c index 6167cbc81d8..98e01712c69 100644 --- a/mozilla/lib/layout/laytags.c +++ b/mozilla/lib/layout/laytags.c @@ -7184,7 +7184,7 @@ void lo_PreLayoutTag(MWContext * context, lo_DocState *state, PA_Tag *tag) if (state->in_relayout == FALSE && lo_IsTagInSourcedLayer(state, tag) == FALSE) { - NET_StreamClass *stream = state->top_state->mocha_write_stream; + NET_VoidStreamClass *stream = state->top_state->mocha_write_stream; /* @@@ small bug here * if someone uses