Compare commits

..

1996 Commits

Author SHA1 Message Date
sdv%sparc.spb.su
53866ece4f workaround for bug=30927
git-svn-id: svn://10.0.0.236/branches/M15-patch@72213 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-14 11:34:36 +00:00
(no author)
350be55313 This commit was manufactured by cvs2svn to create branch 'M15-patch'.
git-svn-id: svn://10.0.0.236/branches/M15-patch@52901 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:47:16 +00:00
dmose%mozilla.org
ce50f7d151 updated license boilerplate to xPL 1.1, a=chofmann@netscape.com,r=endico@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@52900 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:47:15 +00:00
dmose%mozilla.org
fe6a96903d updated license boilerplated to xPL 1.1, a=chofmann@netscape.com,r=endico@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@52899 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:24:22 +00:00
endico%mozilla.org
33c31375b8 temporarily disabled this while dmose lands mpl licence change
git-svn-id: svn://10.0.0.236/trunk@52898 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:21:15 +00:00
dmose%mozilla.org
4136bb9b85 updated license boilerplated to xPL 1.1, a=chofmann@netscape.com,r=endico@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@52897 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:11:51 +00:00
taek%netscape.com
502dbdb8c2 updated to use /share/builds/components
git-svn-id: svn://10.0.0.236/trunk@52895 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:11:18 +00:00
dmose%mozilla.org
fa6f75bbee updated license boilerplated to xPL 1.1, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52894 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:06:26 +00:00
endico%mozilla.org
1f4659c914 temporarily turn off bonsai while dmose lands the mpl 1.1 licence
git-svn-id: svn://10.0.0.236/trunk@52893 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:03:13 +00:00
rpotts%netscape.com
6d25185793 bug #7428. Added support for connection timeout. Now if a connection cannot be made within 35 seconds, the transport times out.
git-svn-id: svn://10.0.0.236/trunk@52892 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 01:32:34 +00:00
sspitzer%netscape.com
cffac19a5f fix for #18064, r=alecf, a=choffman.
only create the local mail account if the user migrates from imap, or if the
user creates an imap server and they don't have a local mail account.


git-svn-id: svn://10.0.0.236/trunk@52891 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 01:22:28 +00:00
pollmann%netscape.com
63b5916e8b Bug 17995: Don't reset selection when adding an option to a combobox, as it caused reframing and a crash. r=harishd a=choffman
git-svn-id: svn://10.0.0.236/trunk@52890 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 00:54:54 +00:00
drapeau%eng.sun.com
c38feba394 r=fur@netscape.com, approval=chofmann@netscape.com. Fix for bug 5369
("[PP]Crash on startup because of Java Plug-in 1.3 for Netscape
Navigator.")  Make the code more bulletproof by checking for NULL
arguments to several methods.  If JVM isn't running, jEnv arg should
be NULL.

This doesn't entirely fix the problem of a JVM gone awry in all cases;
in the case of this particular bug, the Sun JDK 1.3 Beta HotSpot VM
caused an error, and there's no way for Mozilla code to detect this
failure mode.  The fix for that half of the problem is to use the new
JDK 1.3 Early Access VM, which does not exhibit the problem.


git-svn-id: svn://10.0.0.236/trunk@52888 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 00:24:42 +00:00
selmer%netscape.com
aa6d4da1fe Only put selected components in config's build
git-svn-id: svn://10.0.0.236/trunk@52887 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 00:04:08 +00:00
joki%netscape.com
acb57210c3 Fix for bug 17835. Free JS event listeners when the JS object they're registered on goes away. a:chofmann r:vidur
git-svn-id: svn://10.0.0.236/trunk@52886 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 23:37:40 +00:00
mscott%netscape.com
334b29cffa (not part of the build)
GetProtcocolHandler needs to pass in the uri we are trying to open so the
listener can pick an appropriate p.h. based on the protocol of the uri. (if
they so choose).


git-svn-id: svn://10.0.0.236/trunk@52885 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 23:26:16 +00:00
mscott%netscape.com
fb3eea6b4a (not part of the build)
1) add OpenURIVia support.
2) reimplent DispatchContent so we ask the listener if it can handle the content. Then when (if) we find
a content listener that can handle it, call DoContent.
3) if we can't find a content listener, go to the registry and try to find a registered content handler.
This part isn't finished as eventually i need to be going to the category manager instead of forming
the progid for the content handler myself.


git-svn-id: svn://10.0.0.236/trunk@52884 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 23:06:16 +00:00
mscott%netscape.com
4eb1a093e9 Add OpenURIVia which takes a static IP address.
(not part of the build)


git-svn-id: svn://10.0.0.236/trunk@52883 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 23:03:58 +00:00
mscott%netscape.com
cc6179325b (not part of build)
Add notion of CanHandleContent. This is supposed to be a light weight method for the implementor
such that the uri loader can ask right off the top if the listener can handle a particular content
type. If it can, then later on, the uir loader may call DoContent to actually handle it.


git-svn-id: svn://10.0.0.236/trunk@52882 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:54:53 +00:00
mscott%netscape.com
ab2f6ea0db add a new line at the end of the file
(not part of the seamonkey build)


git-svn-id: svn://10.0.0.236/trunk@52881 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:53:21 +00:00
mscott%netscape.com
53828293ef (not part of the seamonkey build!)
remove CanHandleConent. I don't think we need this. Also remove notion of getting a parent
content handler. This doesn't make sense anymore for how I'm defining a content handler.
Added progid prefix for content handler.


git-svn-id: svn://10.0.0.236/trunk@52880 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:52:35 +00:00
karnaze%netscape.com
49e55fa057 bugs 17138, 17168 and others - col allocation involving colspans honors constraints; pct colspans were allocating incorrectly if pct cols existed.
git-svn-id: svn://10.0.0.236/trunk@52879 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:36:59 +00:00
karnaze%netscape.com
c5c9738319 crash on abc - calls EnsureColumns upon entering reflow if appropriate
git-svn-id: svn://10.0.0.236/trunk@52878 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:33:04 +00:00
putterman%netscape.com
4ee15a0425 Workaround for 18088. make delete toolbar button work for thread pane. reviewed by
hangas approved by chofmann.


git-svn-id: svn://10.0.0.236/trunk@52877 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:21:41 +00:00
norris%netscape.com
1996d97ba3 Unify evaluation code to improve consistency and improve code size.
git-svn-id: svn://10.0.0.236/trunk@52875 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:18:24 +00:00
slamm%netscape.com
e5f4e7c849 Fix for bug 18017, "No sidebar panels in messenger." r=hangas a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52871 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:10:29 +00:00
mjudge%netscape.com
b476111e67 fix review by sfrasier, approved choffman. simple fix to get first letter style frames/paragraphs to show their selection. simply notifies children that the selection bit should be "on"
git-svn-id: svn://10.0.0.236/trunk@52870 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 22:09:16 +00:00
fur%netscape.com
c8cc3fe9b2 Checkpoint
git-svn-id: svn://10.0.0.236/trunk@52867 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 21:58:37 +00:00
alecf%netscape.com
be87817fb0 fix for #17763 - initialize cellFrame so that if it's not found, the null check succeeds
r=hyatt
a=chofmann


git-svn-id: svn://10.0.0.236/trunk@52866 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 21:51:42 +00:00
norris%netscape.com
bef3328b2f Remove JSuncaughtExceptionLine, use an error reporter to report line number info instead.
git-svn-id: svn://10.0.0.236/trunk@52865 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 21:48:05 +00:00
norris%netscape.com
aebde57816 Improve performance of the non-error call code.
git-svn-id: svn://10.0.0.236/trunk@52862 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 21:23:10 +00:00
rpotts%netscape.com
fba1c662d5 bug #17500 (r=warren). Added code to fire an OnStopNotification to the parent load group if an active group is canceled.
git-svn-id: svn://10.0.0.236/trunk@52861 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 20:51:11 +00:00
selmer%netscape.com
a4236232dc Fixups
git-svn-id: svn://10.0.0.236/trunk@52858 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 19:18:33 +00:00
kin%netscape.com
81ed65e99b Temporary Fix for dogfood blocker bugs #18002 and #18006. With kipp's
permission, I backed out his fix for bug #1413 from
layout/html/base/src/nsContainerFrame.cpp revision 1.68.
Will re-check in kipp's fix after M11 is branched.
r=buster@netscape.com  a=chofmann


git-svn-id: svn://10.0.0.236/trunk@52857 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 17:42:21 +00:00
rjc%netscape.com
b4795254b6 Fix bug # 17675. Review: waterson. Approval: chofmann.
git-svn-id: svn://10.0.0.236/trunk@52852 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 09:28:42 +00:00
tbogard%aol.net
5fe04f058d Implemented so pretty straight forward pass through methods.
git-svn-id: svn://10.0.0.236/trunk@52851 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 09:07:57 +00:00
mscott%netscape.com
b5afeda640 (not part of the seamonkey build)
define and implement nsDocumentOpenInfo. Implement uri loader::OpenURI. This is the first pass at
my implementation it isn't complete and it doesn't use the registry for getting
 protocol handlers and content handlers yet...but it's a start


git-svn-id: svn://10.0.0.236/trunk@52849 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 06:01:40 +00:00
mscott%netscape.com
cddea4bf18 (not part of the seamonkey build)
include nsISupportsUtils.h


git-svn-id: svn://10.0.0.236/trunk@52848 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 06:01:05 +00:00
mscott%netscape.com
e1c9ba38b3 (not part of the seamonkey build!)
expanded OpenURI interface to take all the required arguments we need in order to really open the uri.
This includes adding the command, window target, event sink getter, load group and channel context.
Added dispatchContent method which is used by the doc open info's to talk back to the uri loader.
DispatchContent takes an opened channel and the uri content listener.


git-svn-id: svn://10.0.0.236/trunk@52847 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 06:00:36 +00:00
mscott%netscape.com
586a405369 (not part of the seamonkey build!)
doContent now returns a boolean called abortProcess. if the listener wants to handle the content without
 returning a stream listener, i.e. it wants the uri loader to stop doing anything else with this content,
then it returns true for abort process.


git-svn-id: svn://10.0.0.236/trunk@52846 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 05:59:42 +00:00
waterson%netscape.com
3aed471de6 Bug 18058. Remove 'commandDispatcher' from interface; obsolete, and leaky. r=hyatt, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52844 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 05:31:15 +00:00
waterson%netscape.com
ca247c028b Bug 18058. Remove 'commandDispatcher' from interface; obsolete. r=hyatt, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52843 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 05:30:56 +00:00
jefft%netscape.com
2b02c816a3 fixed bug 17928 - undo is not working for thread pane; this is the backend fix of the problem; creating TransactionManager in nsMsgWindow instead of in nsMessenger; r=bienvenu,a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52842 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 05:23:15 +00:00
brendan%mozilla.org
77646a1480 Remove nsIFrameReflow.h deadwood (r=waterson).
git-svn-id: svn://10.0.0.236/trunk@52841 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 05:00:39 +00:00
dougt%netscape.com
1cf333f618 Backing out changes due to nsCOMPtr build problems.
git-svn-id: svn://10.0.0.236/trunk@52840 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 03:32:33 +00:00
dougt%netscape.com
fced92a57e backing out changes. looks like this stuff is untested in a full build.
git-svn-id: svn://10.0.0.236/trunk@52839 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 03:31:04 +00:00
cls%seawood.org
dc0901d830 Fix for the template variable change from <T> to <nsISupports>. r=dougt
git-svn-id: svn://10.0.0.236/trunk@52838 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 03:11:03 +00:00
hangas%netscape.com
b0cc23dd32 Command updating and dispatching changes for menu items. Fixes 17848. r=hyatt, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52837 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 02:21:47 +00:00
dougt%netscape.com
8d74ce705f Changed ownership module inside xpcom/proxy to remove cached objects passed their owner's lifespan.
Removed out of band callback in xpcom/proxy
Fixed webshell leak due to xpcom/proxy. (17009)
Just about everything is now a comptr, god save us. :-)

r=jband, a=brendan.


git-svn-id: svn://10.0.0.236/trunk@52836 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 02:21:46 +00:00
dougt%netscape.com
d73bc37e66 Fix for 17842. Make nsCOMPtr<nsISupports> should not be weak typed. scc's
this change to me and since he is on vacation until monday and I need this
for an M11 bug, I am checking it in.   I am hoping it is the right
thing to do.

a=brendan.


git-svn-id: svn://10.0.0.236/trunk@52835 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 02:18:46 +00:00
alecf%netscape.com
a92195a3a9 implement EnsureRowIsVisible for bug #17763
r=scottip


git-svn-id: svn://10.0.0.236/trunk@52834 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 02:02:09 +00:00
sspitzer%netscape.com
0fdb0ed03c fix warning and fix bug #18036, r=bienvenu, a=chofmann.
prevent the infinite loop when applying filters to mail if a filter
rule uses an arbitrary header.


git-svn-id: svn://10.0.0.236/trunk@52833 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 01:58:03 +00:00
mcafee%netscape.com
5478f9dda3 Switching to use NS_WITH_SERVICE macro as specified in (5403); removing spurious clipboard service instance in nsEditorEventListeners.cpp. r=akkana, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52832 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 01:29:49 +00:00
sdagley%netscape.com
e6b6878f91 Fix to larryh's earlier checkin to implement bug #17558. Previous fix from bad diff would always result in an error trying to create a file that already existed (should only be an error in certain cases). r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52831 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 01:18:07 +00:00
waterson%netscape.com
808d64da48 Fix leak with nsCOMPtr. r=brendan, a=brendan
git-svn-id: svn://10.0.0.236/trunk@52830 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 00:52:23 +00:00
selmer%netscape.com
45c7e5cf11 Tweak prior checkin a little
git-svn-id: svn://10.0.0.236/trunk@52829 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 00:49:23 +00:00
jfrancis%netscape.com
6d48eccaa5 bug 17744; a=choffman; r=floppy moose
git-svn-id: svn://10.0.0.236/trunk@52828 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 00:46:06 +00:00
waterson%netscape.com
7335ede542 Fix leak with nsCOMPtr. r=brendan, a=brendan
git-svn-id: svn://10.0.0.236/trunk@52827 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 00:44:10 +00:00
selmer%netscape.com
c9b01acbd6 Fixups to generatelist & related handling of listbox type widgets
git-svn-id: svn://10.0.0.236/trunk@52826 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 00:36:17 +00:00
matt%netscape.com
34a8cb4799 fix for bug 18042 by adding close window tag r=mcafee
git-svn-id: svn://10.0.0.236/trunk@52825 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 00:34:48 +00:00
larryh%netscape.com
1f62cd6fa3 BugZilla 17558. PR_Open() gets PR_EXCL flag
git-svn-id: svn://10.0.0.236/trunk@52824 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 00:21:39 +00:00
despotdaemon%netscape.com
3189ded990 Pseudo-automatic update of changes made by vishy@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@52823 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-05 00:09:17 +00:00
pollmann%netscape.com
b98eecf039 Bug 17431: Clean house in form and form control destructors to allow reframing r=harishd a=choffman
git-svn-id: svn://10.0.0.236/trunk@52822 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 23:16:47 +00:00
sfraser%netscape.com
d76ff386a5 Fixes for 16723 -- fix error returns from imglib. Remove and re-add files to project to fix the case of the filenames. r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52820 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 23:11:48 +00:00
sfraser%netscape.com
c0ec1f713e Fixes for 16723 -- fix error returns from imglib. r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52819 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 23:11:11 +00:00
sfraser%netscape.com
1fcc54491d Fixes for 16723 -- fix error handling so that errors from image allocation are propogated back to imglib.. r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52818 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:47:24 +00:00
rods%netscape.com
e34b01ce89 Commented out the reset of the list when an option gets added
Fixes crashers 17836, 17852, 17965 r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@52817 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:45:10 +00:00
mcafee%netscape.com
451b1f9771 Fixing JS error when loading prefs; skipping assertion in nsPrefWindow::ChangePanel() that is not needed for prefs to function, left a comment there so we can fix that later. (14663) a=matt, r=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52816 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:39:21 +00:00
sfraser%netscape.com
b5daf46f31 Fixes for 18029 and 16723 -- fix image drawing on Mac to use GWorlds, and put in api to lock and unlock pixels. Pass a real nsDrawingSurface to the image, instead oif a cast GrafPtr. r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52815 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:36:21 +00:00
sfraser%netscape.com
db24ddd87b Fixes for 18029 and 16723 -- fix image drawing on Mac to use GWorlds, and put in api to lock and unlock pixels. r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52814 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:32:22 +00:00
sfraser%netscape.com
28261a4ca0 Fixes for 18029 and 16723 -- fix image drawing on Mac to use GWorlds, and put in api to lock and unlock pixels. Leave more free space in the heap for image (GWorld) pixels. r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52813 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:29:02 +00:00
sfraser%netscape.com
2d10f84704 Fixes for 18029 and 16723 -- fix image drawing on Mac to use GWorlds, and put in api to lock and unlock pixels. Adding new error module for libimg. r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52812 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:27:36 +00:00
sfraser%netscape.com
1cf929984f Fixes for 18029 and 16723 -- fix image drawing on Mac to use GWorlds, and put in api to lock and unlock pixels. r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52811 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:26:57 +00:00
nisheeth%netscape.com
59271d7e21 r=norris,warren,radha. a=chofmann. Fix for bug 1646. Javascript: URLS were not getting loaded properly because the webshell was changing its notion of the current document (by setting mURL and mReferrer) too eagerly. Now, it does so only after the nsDocLoader::LoadDocument() in DoLoadURL() returns successfully.
git-svn-id: svn://10.0.0.236/trunk@52809 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:09:46 +00:00
pinkerton%netscape.com
7f537da550 add "status" area to the bottom so that bottom scroll arrow on MacOS is visible (r=slamm, bug# 8266).
git-svn-id: svn://10.0.0.236/trunk@52808 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:04:17 +00:00
nisheeth%netscape.com
45eec85b6b r=norris,warren,radha. a=chofmann. Fix for 1646. Javascript: urls return NS_ERROR_DOM_RETVAL_UNDEFINED when the javascript: url evaluates into an undefined value. This error is propagated back up to nsWebShell::DoLoadURL().
git-svn-id: svn://10.0.0.236/trunk@52807 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 22:02:19 +00:00
varada%netscape.com
027697488c updating accountsetup.ini to deal with workspace
git-svn-id: svn://10.0.0.236/trunk@52805 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 21:48:32 +00:00
varada%netscape.com
fee0b89b42 updating makefile to create the WSTemplate
git-svn-id: svn://10.0.0.236/trunk@52804 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 21:47:27 +00:00
sfraser%netscape.com
df972eb658 Did a 'Remove object code and compact' on this project, and tidied up some access paths to try to eliminate the CodeWarrior hangs. a=leaf
git-svn-id: svn://10.0.0.236/trunk@52802 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 21:16:02 +00:00
valeski%netscape.com
8cf0748300 10736, r=andreas.otte@primus-online.de. Actually I'm more like the reviewer here. Andreas submitted this optimization to MakeAbsolute (it uses minimal memory routines and minimal parsing. this means performance increase by a factor of 10 for this method). I'm checking it in for him.
git-svn-id: svn://10.0.0.236/trunk@52800 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 20:31:36 +00:00
neeti%netscape.com
1fe4d7149a fix for MLK bug 15818, every ImageURLImpl leaks.r=pnunn, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52799 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 20:24:25 +00:00
selmer%netscape.com
81e77a0f71 Dynamic component checkbox initialization
git-svn-id: svn://10.0.0.236/trunk@52798 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 20:19:27 +00:00
sspitzer%netscape.com
aa210a0654 better fix for #17597, r=mscott, a=chofmann.
instead of setting the action for the url, check if we have a channel listener.
this is a cleaner fix, and now the quoting back end doesn't need to know about
the nntp url.


git-svn-id: svn://10.0.0.236/trunk@52796 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 20:02:31 +00:00
jefft%netscape.com
f295b6af47 fixed bug 15069 && 12345 -- passing in file:/// instead of file:// as the file url spec; r=bienvenu, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52795 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 19:47:21 +00:00
waterson%netscape.com
487d4b32af Bug 17953, 17959. Fix nsXULElement leaks by using nsCOMPtrs. r=warren, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52794 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 19:44:38 +00:00
waterson%netscape.com
9530e8d060 Bug 17955. Don't unnecessarily add script event listeners to temporary nodes used for overlay hookup. r=hyatt, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52793 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 19:43:43 +00:00
putterman%netscape.com
8b6bdd6f64 Fix for 17987. Approved by chofmann and reviewed by hangas.
git-svn-id: svn://10.0.0.236/trunk@52792 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 19:38:11 +00:00
kipp%netscape.com
b20b0d0a0e r=vidur; bug=17372; found a case where a trailing shy character on a line would trigger an infinite loop iff the shy character was the only piece of text after a text frame had been continued
git-svn-id: svn://10.0.0.236/trunk@52791 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 19:34:36 +00:00
waterson%netscape.com
143a89ffc8 Bug 17847. Fix 'commandupdater' hookup for master document. r=hyatt, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52790 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 18:37:58 +00:00
jefft%netscape.com
d7f7734495 fixed bug 17925 -- pop3 get all message again; restore old behavior; always set leave message on server; r=rhp, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52786 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 15:27:29 +00:00
rhp%netscape.com
2bd2bc6f06 Changes for String Bundle problem in forwarding - Bug #: 12345 - r: jefft - approved: chofmann
git-svn-id: svn://10.0.0.236/trunk@52785 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 13:59:26 +00:00
waterson%netscape.com
8c5481dd42 Bug 11501. Tree has regressed s.t. it is necessary to have a <treecol>; add it here. r=hyatt, a=jack
git-svn-id: svn://10.0.0.236/trunk@52784 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 08:57:52 +00:00
waterson%netscape.com
9f071c70b6 Bug 17946. Trees must be contained within a fixed div. r=hyatt, a=jack
git-svn-id: svn://10.0.0.236/trunk@52783 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 08:33:08 +00:00
sgehani%netscape.com
9c16ff2bfc No longer delete core file if it existed before running the installer: now only deleted if downloaded. Also, cleaned up the terminal window UI.
Only affects the standalone Install Wizard app, not the browser or mail.

[r=ssu, a=chofmann]


git-svn-id: svn://10.0.0.236/trunk@52782 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 08:23:55 +00:00
jefft%netscape.com
7ff57f52b5 partial fix for bug 12345 - unable to forward message; check for valid url before calling msg_pick_real_name() to prevent crashing; r=rhp, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52781 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 06:25:36 +00:00
beard%netscape.com
7670b1d344 moved System.exit() to end of main.
git-svn-id: svn://10.0.0.236/trunk@52780 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 06:15:55 +00:00
beard%netscape.com
a669c996d6 moved System.exit() to end of main
git-svn-id: svn://10.0.0.236/trunk@52779 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 06:07:35 +00:00
beard%netscape.com
a297c877e2 JShell properties files.
git-svn-id: svn://10.0.0.236/trunk@52778 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 06:06:40 +00:00
beard%netscape.com
09e0a51db2 factored out common code to locate a source file on lxr or bonsai
git-svn-id: svn://10.0.0.236/trunk@52777 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 06:06:13 +00:00
beard%netscape.com
881e796d98 communicates with cvsblame.cgi to assign blame to lines of a source file.
git-svn-id: svn://10.0.0.236/trunk@52776 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 06:05:52 +00:00
troy%netscape.com
66ca226b8a b=#17315. Changed DeletingFrameSubtree() to also look at the continuing
frames.


git-svn-id: svn://10.0.0.236/trunk@52775 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 05:23:11 +00:00
ducarroz%netscape.com
d3ee736373 Fix for bug 17902. Fix various FCC problems as well error display. R=alecf, A=chofmann
git-svn-id: svn://10.0.0.236/trunk@52774 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 04:58:06 +00:00
sspitzer%netscape.com
baf56f68cb fix for #17597. reply to a news article doesn't quote the body.
the problem was when we ran the nntp url to get the message we weren't
calling OnDataAvailabe() on the channel listener.  the reason is the channel
listener only got poked when ActionDisplayArticle was set as the action on
the nntp url.  but this wouldn't be the case when we got run from the Quoting backend.  I added a new action, and made sure to set it when running the url from the quoting back end, and then made sure the nntp backend did the right thing.

r=alecf, a=chofmann


git-svn-id: svn://10.0.0.236/trunk@52773 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 04:31:09 +00:00
jj%netscape.com
f66e87957c set installer target directory to "Mozilla Folder" and changed "bin" to "viewer" to reflect the Mac tree structure.
git-svn-id: svn://10.0.0.236/trunk@52771 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 03:01:29 +00:00
jj%netscape.com
2efb8c65ad . moved 'Component Registry' from [browser] to [install]
. removed 'default_prefs.js' and 'chrome:registry.rdf'
. added 'viewer:' in front of _each_ line (parser root change)


git-svn-id: svn://10.0.0.236/trunk@52770 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 03:01:25 +00:00
jj%netscape.com
498764afb0 fixed components lists for [Easy install] and variable names for module sizes.
git-svn-id: svn://10.0.0.236/trunk@52769 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 03:01:24 +00:00
beard%netscape.com
48f9184ff1 bug #17847, fix clobbering of mSlots->mAttributes in GetAttributes(). r=waterson, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52768 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 02:56:54 +00:00
slamm%netscape.com
a8fb89cee4 Do run-length encoding for the raw data option. End revision records with a period. Buffer the raw data output.
git-svn-id: svn://10.0.0.236/trunk@52767 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 02:14:56 +00:00
hyatt%netscape.com
4353fd2505 Partial fix for 17848. Part 1 of 2. 2nd part will be checked in by hangas. r=hangas, a=brendan
git-svn-id: svn://10.0.0.236/trunk@52766 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 01:59:04 +00:00
waterson%netscape.com
9d4795faed Bug 17024. Fix mClassList leak; add bloaty stats for nsClassList. r=hyatt a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52765 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 01:50:47 +00:00
waterson%netscape.com
a65db3660c Bug 15146. Don't eagerly create a <xul:menu>'s contents. r=hyatt a=brendan
git-svn-id: svn://10.0.0.236/trunk@52764 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 01:49:34 +00:00
waterson%netscape.com
744719ecdb Bug 15146. Fix charset overlay template; don't force menus to be open; r=hyatt a=brendan
git-svn-id: svn://10.0.0.236/trunk@52763 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 01:48:46 +00:00
mccabe%netscape.com
46ecd1ff3b Link fixes. Not part of the Mozilla build.
git-svn-id: svn://10.0.0.236/trunk@52762 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 00:35:31 +00:00
beard%netscape.com
396d175b3c can handle multiple inputs, now using common FileLocator class to generate blame/lxr URLs.
git-svn-id: svn://10.0.0.236/trunk@52761 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 00:24:26 +00:00
beard%netscape.com
9cc1992ed4 Uses CVS/Entries to determine the revision of a checked out file.
git-svn-id: svn://10.0.0.236/trunk@52760 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 00:10:12 +00:00
pinkerton%netscape.com
b2e6d58834 Fix bug 15276 by flushing the data to the clipboard right before app shuts down. (r=davidm).
git-svn-id: svn://10.0.0.236/trunk@52759 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 00:08:59 +00:00
rogerl%netscape.com
388bc22458 Removed - not an ECMA thing and supplanted by a different mechanism.
git-svn-id: svn://10.0.0.236/trunk@52758 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 00:01:00 +00:00
rogerl%netscape.com
859165ee97 Fix back-reference parsing from going too far in source string
git-svn-id: svn://10.0.0.236/trunk@52757 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-04 00:00:14 +00:00
rogerl%netscape.com
ec90446de8 Replaced Closure object with FunctionObject clone
git-svn-id: svn://10.0.0.236/trunk@52756 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:59:35 +00:00
rogerl%netscape.com
74b9419214 Removed NativeClosure
git-svn-id: svn://10.0.0.236/trunk@52755 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:58:51 +00:00
rogerl%netscape.com
830d037821 Fix nested finally endless loop.
Replaced Closure object with FunctionObject clone.


git-svn-id: svn://10.0.0.236/trunk@52754 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:57:56 +00:00
rogerl%netscape.com
ee745b4cbf Add closure support
git-svn-id: svn://10.0.0.236/trunk@52753 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:56:28 +00:00
rogerl%netscape.com
02ca74c760 Removing NativeClosure
git-svn-id: svn://10.0.0.236/trunk@52752 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:55:59 +00:00
mcafee%netscape.com
555440d16c ftp & http proxy settings got reversed in the UI (15165). r=slamm, a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@52751 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:53:15 +00:00
nisheeth%netscape.com
e3cf2c3428 r=harishd, a=chofmann. Fix for bugs 11992, 10563. New lines get reported in the XML document prolog. Now, JS errors in XML report correct line numbers.
git-svn-id: svn://10.0.0.236/trunk@52750 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:50:16 +00:00
slamm%netscape.com
13a4379130 Add feature for beard and his leak soup tool. Return raw data if 'data=1' is added as a parameter. Cleaned up some code too.
git-svn-id: svn://10.0.0.236/trunk@52749 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:37:44 +00:00
mcafee%netscape.com
adc6cb1f75 We were using the wrong pref to enable JS (14660). r=slamm, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52748 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:10:47 +00:00
hangas%netscape.com
99a452e913 Fix for bug 16189, which allows undo/redo to be used in the thread pane of mail/news. r-jefft a=chofmann
git-svn-id: svn://10.0.0.236/trunk@52746 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 23:03:12 +00:00
rogerl%netscape.com
aa1271a477 Not a part of SeaMonkey Build
- new LiveConnect AIX4.3 makefile for server builds


git-svn-id: svn://10.0.0.236/trunk@52745 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:55:03 +00:00
varada%netscape.com
5c09a71e2a getting rid of root variable in che file
git-svn-id: svn://10.0.0.236/trunk@52744 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:44:24 +00:00
rhp%netscape.com
8276a693be Fix for null pointer access - Bug #17597 - r: jefft - approved: chofmann
git-svn-id: svn://10.0.0.236/trunk@52743 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:35:04 +00:00
rhp%netscape.com
3f83ba7a62 Fix for null pointer access - Bug #17597 - r: jefft approved: chofmann
git-svn-id: svn://10.0.0.236/trunk@52742 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:34:30 +00:00
radha%netscape.com
8f70df6307 Fix for bug # 17893. Pass the url to nsISessionHistory::Add().Don't set
nsWebShell::mURL too early in the loading process.
r=law,nisheeth


git-svn-id: svn://10.0.0.236/trunk@52741 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:30:44 +00:00
varada%netscape.com
5908cc6076 getting rid of spaces in cck.ini
git-svn-id: svn://10.0.0.236/trunk@52740 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:27:29 +00:00
varada%netscape.com
777e334a14 getting rid of spaces in the inifiles and changing titles
git-svn-id: svn://10.0.0.236/trunk@52739 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:27:06 +00:00
varada%netscape.com
193096cba0 installing wizardmachine.ini inthe dist directory
git-svn-id: svn://10.0.0.236/trunk@52738 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:24:09 +00:00
varada%netscape.com
6663eb3602 This file will contain the nameof the application
git-svn-id: svn://10.0.0.236/trunk@52737 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:23:48 +00:00
varada%netscape.com
9d146034cd message box in interpret
git-svn-id: svn://10.0.0.236/trunk@52736 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:22:54 +00:00
varada%netscape.com
c2f62d838f getting rid of root variable from the che files
git-svn-id: svn://10.0.0.236/trunk@52735 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:22:31 +00:00
rods%netscape.com
c7fa28614d added two more tests
git-svn-id: svn://10.0.0.236/trunk@52734 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:14:42 +00:00
rods%netscape.com
17f32ce4ba Initial checkin of test
git-svn-id: svn://10.0.0.236/trunk@52733 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:14:25 +00:00
kipp%netscape.com
8fae81516b r=joki; fixed the ancient and venerable bug 1413 by noting that the code was using an optimization that wasn't always valid and that one that optimization wasn't valid, the slower path must be used...I commented the fix fairly solidly
git-svn-id: svn://10.0.0.236/trunk@52732 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:09:00 +00:00
akkana%netscape.com
7e907a0c91 Fix key event bustage: treat DOM_VK_RETURN and DOM_VK_ENTER equivalently. r=ftang,joki a=chofmann,leaf
git-svn-id: svn://10.0.0.236/trunk@52731 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 22:05:45 +00:00
kipp%netscape.com
44a7143485 updated document regardling block and line-layout operation; this is html documents that are not part of the build nor part of any install process, etc.
git-svn-id: svn://10.0.0.236/trunk@52730 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 21:11:37 +00:00
joki%netscape.com
68b221d555 Fixing dom event key set errors. bug 17887, a:chofmann
git-svn-id: svn://10.0.0.236/trunk@52729 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 20:53:13 +00:00
joki%netscape.com
e151377558 Reverting key set to previous version. Fixes 17887. a:chofmann r:brade.
git-svn-id: svn://10.0.0.236/trunk@52728 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 20:40:35 +00:00
endico%mozilla.org
0ee8ded981 fixed a bunch of typos. Also, handleCheckinMail.tc was replaced by handleCheckinMail.pl
git-svn-id: svn://10.0.0.236/trunk@52727 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 20:33:57 +00:00
blizzard%redhat.com
e72f94df90 patch to fix backspacing from quy@igelaus.com.au. a=choffman
git-svn-id: svn://10.0.0.236/trunk@52726 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 20:25:19 +00:00
alecf%netscape.com
b5de07e079 fix for blocker #17882
a=leaf


git-svn-id: svn://10.0.0.236/trunk@52723 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 19:47:17 +00:00
rogerl%netscape.com
9f777f2bad Added defn of AIX4_3 to help fix dup typedef int8,int16 etc
git-svn-id: svn://10.0.0.236/trunk@52720 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 18:56:17 +00:00
slamm%netscape.com
8fc0df1c8f Ignore a few more warnings caused by lame unix header files.
git-svn-id: svn://10.0.0.236/trunk@52719 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 18:52:13 +00:00
gagan%netscape.com
34d286f60f Last of the leftover files... that didn't include the API change.
git-svn-id: svn://10.0.0.236/trunk@52716 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 09:33:03 +00:00
gagan%netscape.com
8dc7bd557e Modified the call to match the new signature of CreateTransport. a=mcafee.
git-svn-id: svn://10.0.0.236/trunk@52715 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:52:04 +00:00
gagan%netscape.com
4ef759b3d4 Removed an extra free that cvs merge put in!
git-svn-id: svn://10.0.0.236/trunk@52714 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:21:37 +00:00
gagan%netscape.com
cb1a2aee98 Argh... speed kills. Removed this conflict that I accidently checked in.
git-svn-id: svn://10.0.0.236/trunk@52713 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:19:54 +00:00
gagan%netscape.com
8f3ae7048a Fixes 11708,15477 and partial 14610. r=warren. We now pass a print host for displaying in status messages that is different than the hostname connecting to. Also added Keep-Alive support (turned on by user_pref("network.http.keep-alive",1))We also honor the "network.proxy.type" preference to turn the proxy use on and off.
git-svn-id: svn://10.0.0.236/trunk@52712 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:17:59 +00:00
gagan%netscape.com
4ac72526b1 Fixes 11708,15477 and partial 14610. r=warren. We now pass a print host for displaying in status messages that is different than the hostname connecting to. Also added Keep-Alive support (turned on by user_pref("network.http.keep-alive",1))
git-svn-id: svn://10.0.0.236/trunk@52711 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:14:38 +00:00
gagan%netscape.com
e67319abec *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@52710 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:12:18 +00:00
gagan%netscape.com
6bf9a22c91 Added printHost parameter for use in status messages in cases where printHost is different than the connecting host (as in the case of proxies) Fixes bug 11708. r=warren.
git-svn-id: svn://10.0.0.236/trunk@52709 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:11:39 +00:00
sgehani%netscape.com
60ed9bf4bb Removing obsolete prefix files. (Replaced by nsInstallerPrefix* and mozInstallerPrefix*.)
git-svn-id: svn://10.0.0.236/trunk@52708 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:06:59 +00:00
pavlov%netscape.com
0f628926da work on nsIWidget r=alecf
git-svn-id: svn://10.0.0.236/trunk@52707 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 08:04:59 +00:00
sgehani%netscape.com
ee85b8ad76 Chnage MIW target name to Mozilla Installer [r=sfraser].
git-svn-id: svn://10.0.0.236/trunk@52706 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:54:28 +00:00
sgehani%netscape.com
9d8269b689 1> Extraction of all files rather than regexp core_*/* search.
2> Prepare installer to work off of local archives for CD scenario and Mozilla (no sdinst.dll).                                    
3> Fix build warnings.                                                    
4> Separated out Netscape and Mozilla specific targets.    
5> Separated out Netscape and Mozilla specfic resources.
                                                                                      
[r=sfraser]


git-svn-id: svn://10.0.0.236/trunk@52705 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:53:59 +00:00
mscott%netscape.com
6ade5969e3 work around for Bug 17065
for bienvenu
r=mscott


git-svn-id: svn://10.0.0.236/trunk@52704 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:53:44 +00:00
mscott%netscape.com
7b3899b763 Some work arounds to HIDE Bug #17065 which causes us to hang when parsing large imap folders on linux.
WE still have the problme where the ui thread is stealing events from the imap thread and processing them
on the ui thread.

We're just working around it so folks can use linux imap mail. This code was jointly written with bienvenu.

r=bienvenu/mscott


git-svn-id: svn://10.0.0.236/trunk@52703 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:52:45 +00:00
sgehani%netscape.com
dd18053d33 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52702 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:50:01 +00:00
dveditz%netscape.com
3f4468adf1 fixes 8271,6410,12694 and similar startup/registry problems
git-svn-id: svn://10.0.0.236/trunk@52701 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:46:38 +00:00
dveditz%netscape.com
3330477d88 shutting up copious warnings using /W4 on MSVC
git-svn-id: svn://10.0.0.236/trunk@52700 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:39:19 +00:00
dveditz%netscape.com
acf32d6fc2 Changing registry keys to a mozilla-centric name rather than netscape.
git-svn-id: svn://10.0.0.236/trunk@52699 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:36:03 +00:00
pavlov%netscape.com
c5f9102c78 work on scrolling, CSS2 native system colors, etc. r=mcafee
git-svn-id: svn://10.0.0.236/trunk@52697 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:34:50 +00:00
alecf%netscape.com
cb89931340 add open="true" to all the account
r=scottip
no bug, it's cosmetic/usability thing


git-svn-id: svn://10.0.0.236/trunk@52696 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:33:08 +00:00
mccabe%netscape.com
793e09ae44 Fix many nsInterfaceInfo leaks, thanks in part to patches provided by Patrick Beard. Fixes 15855. Some remain.
Clear up build warnings, and quiet nsInterfaceInfomanager debug output unless DEBUG_iim.  Makes startup a li'l less noisy.  Fixes 15628.

r=jband


git-svn-id: svn://10.0.0.236/trunk@52695 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:23:37 +00:00
alecf%netscape.com
e92bd577aa fix for #17214 - consolidate all username and hostname handling so that escaping/unescaping happens logically
git-svn-id: svn://10.0.0.236/trunk@52694 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:16:59 +00:00
joki%netscape.com
c6ca4a722e added files: mozilla/dom/src/events/nsJSKeyEvent.cpp
git-svn-id: svn://10.0.0.236/trunk@52693 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:12:13 +00:00
joki%netscape.com
c79e9c67d2 Changes to DOM events to accomodate the new breakdown of events into mouse and key events. This fixes a couple of bug, though the main one is 13406. Involves changes to multiple DOM generated file as well as fixing up usage of DOM event api usage in editor, rdf, and xul. r:vidur
git-svn-id: svn://10.0.0.236/trunk@52691 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:11:45 +00:00
putterman%netscape.com
ff8a8db130 return rv instead of NS_OK so that we only return null targets with NS_RDF_NO_VALUE.
This stops a bunch of assertions.  reviewed by alecf.


git-svn-id: svn://10.0.0.236/trunk@52690 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 07:09:56 +00:00
waterson%netscape.com
f4ec813667 Bug 13252. Build content for current template before recursing to build content for children. r=alecf.
git-svn-id: svn://10.0.0.236/trunk@52689 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 06:59:49 +00:00
buster%netscape.com
1115c0f4da fixed bug 17792 (text set via DOM displays in HTL password control)
r=myself, I'll take the heat if this goes bad.  It's a very simple change.
The text control optimization was turned on for single line text controls,
and turned off for text areas.  With this change, the optimization is also
turned off for password fields.  This shouldn't effect performance in any
noticable way, because there are very rarely more than one or two password
controls on a single page.  The optimization in the case of password fields
isn't worth the extra code and complexity for dealing with replacing
characters with '*'


git-svn-id: svn://10.0.0.236/trunk@52688 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 06:53:07 +00:00
sgehani%netscape.com
40645c00d1 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52687 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 06:12:10 +00:00
davidm%netscape.com
eb18a1b917 3110
r= morse
modification to get single sign on back


git-svn-id: svn://10.0.0.236/trunk@52686 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 06:07:53 +00:00
ftang%netscape.com
74098be2bc back out 1.32 to fix 17811. This will break 14914
git-svn-id: svn://10.0.0.236/trunk@52685 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:47:25 +00:00
dcone%netscape.com
6d4e070e6b Fixed a divide by zero crasher, and cleaned up borders. r=buster
git-svn-id: svn://10.0.0.236/trunk@52684 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:46:01 +00:00
dp%netscape.com
86bb1af06f Eliminating use of nsService class in preparation for making services
usable with COMPtrs.


git-svn-id: svn://10.0.0.236/trunk@52683 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:41:43 +00:00
dp%netscape.com
df73ba585b Deny GetService() requests which cause Creation of new objects on
shutdown. r=jband, r=ScottPutterman


git-svn-id: svn://10.0.0.236/trunk@52682 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:38:45 +00:00
dp%netscape.com
e537410a85 Removing nsIShutdown listener usage for ServiceManager.
git-svn-id: svn://10.0.0.236/trunk@52681 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:36:30 +00:00
danm%netscape.com
7de071230b instead of using the thread hashtable's enumerator while processing events (a Mac-specific habit), build and use a parallel linked list structure. hashtable and list want unification someday. fixes bug 16551. r:brendan@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52680 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:30:49 +00:00
davidm%netscape.com
7a25b6fe62 8673 ShutDown() should try to close all open windows.
r=sfraser
set tryToClose function and proprogate out if the close was sucessfull


git-svn-id: svn://10.0.0.236/trunk@52679 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:28:02 +00:00
davidm%netscape.com
ad7f1ff33f 8673 ShutDown() should try to close all open windows.
r= hangas


git-svn-id: svn://10.0.0.236/trunk@52678 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:26:31 +00:00
davidm%netscape.com
16e407c7ff 12539 Crash when quitting browser while bookmark properties dialog
r = saari
 nsINetPrompt implementation
r morse


git-svn-id: svn://10.0.0.236/trunk@52677 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:25:21 +00:00
davidm%netscape.com
218749a885 6552 Browser-generated forms not triggering single-signon
switch to use nsINetPrompt so that single sign lives again
r morse


git-svn-id: svn://10.0.0.236/trunk@52676 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:24:01 +00:00
davidm%netscape.com
793f6ff27d 6552 Browser-generated forms not triggering single-signon
add nsINetPrompt for single sign on
r morse


git-svn-id: svn://10.0.0.236/trunk@52675 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:21:49 +00:00
davidm%netscape.com
77cd59699a First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52674 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:19:39 +00:00
warren%netscape.com
fa66ea22fe Structural changes for MakeAbsolute performance. bug#10736 r=valeski
git-svn-id: svn://10.0.0.236/trunk@52673 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:13:44 +00:00
warren%netscape.com
c34a2941df Made nsIInputStreamChannel scriptable and constructable from component manager. bug#15294
git-svn-id: svn://10.0.0.236/trunk@52672 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 05:09:20 +00:00
warren%netscape.com
335afbc323 Fixed more bustage from gordon's checking -- missing vtable symbols for nsDNSRequest's (unused) nsIRequest interface.
git-svn-id: svn://10.0.0.236/trunk@52671 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 04:57:34 +00:00
sgehani%netscape.com
8b93319dca Fix build bustage for cathleen.
git-svn-id: svn://10.0.0.236/trunk@52670 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 04:30:14 +00:00
beard%netscape.com
afdb749e2c First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52669 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 04:26:41 +00:00
waldemar%netscape.com
50364b8107 Removed distribution restrictions because this is part of the language spec
git-svn-id: svn://10.0.0.236/trunk@52668 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:59:31 +00:00
waldemar%netscape.com
9c4cb1eacb Updated to Mozilla 1.1 license
git-svn-id: svn://10.0.0.236/trunk@52667 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:58:07 +00:00
mscott%netscape.com
9dc7572e8b (not part of the seamonkey build!!)
no longer need nsURILoaderCIDs.h


git-svn-id: svn://10.0.0.236/trunk@52666 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:55:39 +00:00
mscott%netscape.com
e59a60cd4c (not part of the seamonkey build!!!!)
name change of nsURIDispatcher to nsIURILoader


git-svn-id: svn://10.0.0.236/trunk@52665 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:53:33 +00:00
mscott%netscape.com
6ef6f80a98 one more tweak for Bug #17825
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@52664 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:51:12 +00:00
gagan%netscape.com
c1350f1279 Added file. Not in the build. Some utility code for color console messages on Unix. Using this is simple- Declare PRINTF_FOO in the scope of your printf statements where FOO is one of the colors in (YELLOW, RED, CYAN, BLUE, MAGENTA, GREEN) and any printfs in that scope will print in color. You may also start and stop colors by using STARTF00 and ENDCOLOR. So you can try something like printf(STARTRED "Red " STARTBLUE "Blue" ENDCOLOR);
git-svn-id: svn://10.0.0.236/trunk@52663 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:43:13 +00:00
pierre%netscape.com
cff215812e Fix from py8ieh=bugzilla@bath.ac.uk for bugs 12765 and 12766. Updated link/visited/out-of-date declarations for hover/focus/active. r=me
git-svn-id: svn://10.0.0.236/trunk@52662 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:19:04 +00:00
jj%netscape.com
0e29d47284 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52661 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:17:47 +00:00
bienvenu%netscape.com
5ca1658c79 add cancel method to nntp protocol r=mscott
git-svn-id: svn://10.0.0.236/trunk@52660 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:17:36 +00:00
bienvenu%netscape.com
cea102d05c add cancel method to mailbox and pop protocol r=mscott
git-svn-id: svn://10.0.0.236/trunk@52659 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:17:15 +00:00
bienvenu%netscape.com
5b5b7371ea fix build warnings, r=putterman, add cancel method to protocol r=mscott
git-svn-id: svn://10.0.0.236/trunk@52658 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:16:26 +00:00
mscott%netscape.com
a3d9d45365 Bug #17825 --> pass nsIMsgWindow into SetWindow instead of a msgStatus feedback object in order
to fix save attachements.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@52657 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:12:58 +00:00
akkana%netscape.com
9ee5feb4b3 Part of bratell@lysator.liu.se's fix to the nsHTMLToTXTSinkStream. r=akkana
git-svn-id: svn://10.0.0.236/trunk@52656 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 03:08:04 +00:00
akkana%netscape.com
8e7977a75f Contribution by Daniel Bratell <bratell@lysator.liu.se> to implement
format=flowed for mail plaintext output. r=akkana and (I think) rhp.


git-svn-id: svn://10.0.0.236/trunk@52655 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:46:16 +00:00
jj%netscape.com
f64d069264 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52654 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:44:58 +00:00
akkana%netscape.com
ec594ff4cd Contribution by Daniel Bratell <bratell@lysator.liu.se> to implement
format=flowed for mail plaintext output.  Restructures the plaintext
output wrapping code, wholly or partially fixes numerous bugs in plaintext
output (13278, 13442, 17823, 17824, 13753, 12551), makes the automated
tests work on Windows and adds some new automated tests. r=akkana.


git-svn-id: svn://10.0.0.236/trunk@52653 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:44:44 +00:00
jj%netscape.com
16fbda6ce8 File Removed.
git-svn-id: svn://10.0.0.236/trunk@52652 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:44:27 +00:00
gordon%netscape.com
1c497557b9 Fix more of my bustage: pass clientContext parameter back on callbacks from nsDNSService::Lookup(). r=warren.
git-svn-id: svn://10.0.0.236/trunk@52651 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:42:52 +00:00
danm%netscape.com
0aac10ff9d oops! Observe() was checked in flawed in 1.90. gtk may one day have noticed. r:noman@odyssey.org
git-svn-id: svn://10.0.0.236/trunk@52650 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:29:59 +00:00
varada%netscape.com
d313f9eb9b checking in right cck.che
git-svn-id: svn://10.0.0.236/trunk@52649 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:21:02 +00:00
cmanske%netscape.com
77285a1fb7 Changed Mail Compose XUL to use new comboboxes on toolbar (bug 17098).
git-svn-id: svn://10.0.0.236/trunk@52648 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:18:01 +00:00
warren%netscape.com
dc473b8de3 Fixed Gordon's wackage.
git-svn-id: svn://10.0.0.236/trunk@52647 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:18:00 +00:00
selmer%netscape.com
114c2d4d83 Stupid, remove jar_s/zlib_s since not using it!
git-svn-id: svn://10.0.0.236/trunk@52646 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:10:04 +00:00
selmer%netscape.com
662527d103 Stupid, remove ifuncns.obj since not using it!
git-svn-id: svn://10.0.0.236/trunk@52645 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:08:55 +00:00
cathleen%netscape.com
7c3533ab68 fixed bug #17774. prevent crash when UI name is passed as null.
also moved mPatchList to allocate hashtable to nsIntall::Patch().  r=dougt


git-svn-id: svn://10.0.0.236/trunk@52644 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 02:01:02 +00:00
varada%netscape.com
2c76c5f5ed changing the template name from ws_template to wstemplate
git-svn-id: svn://10.0.0.236/trunk@52643 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:58:43 +00:00
varada%netscape.com
0ccce7f199 fixing bug #6558 adding new show config info button in checklist.ini and changing text of show sum button on build page to reflect the same
git-svn-id: svn://10.0.0.236/trunk@52642 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:57:07 +00:00
selmer%netscape.com
00b336668e Big honking checkin for Install Builder
git-svn-id: svn://10.0.0.236/trunk@52641 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:51:54 +00:00
nisheeth%netscape.com
424a4cc34c r=vidur. Fix for bug 9075. Return NS_OK instead of NS_ERROR_NOT_IMPLEMENTED from nsXMLDocument::GetDocType(). This allows script parsing to continue after a document.doctype JS statement is encountered.
git-svn-id: svn://10.0.0.236/trunk@52640 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:48:54 +00:00
alecf%netscape.com
1bb6cf2186 fix message datasource so it doesn't return an error back to RDF
partial fix for #17811
r=putterman


git-svn-id: svn://10.0.0.236/trunk@52639 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:38:54 +00:00
wtc%netscape.com
fb1a3c22e8 Bugzilla bug #15906: add support for the GC leak detector. Contributed
by Patrick Beard <beard@netscape.com>.


git-svn-id: svn://10.0.0.236/trunk@52638 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:37:19 +00:00
kmcclusk%netscape.com
fe5984a76a nsIScriptableRegion instances can now be created on WIN32.
nsbug=12465; r=beard@netscape.com


git-svn-id: svn://10.0.0.236/trunk@52637 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:37:12 +00:00
wtc%netscape.com
64b8be9959 Bugzilla bug #15906: use the GC leak detector. Contributed by
Patrick Beard <beard@netscape.com>.


git-svn-id: svn://10.0.0.236/trunk@52636 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:33:03 +00:00
jj%netscape.com
ad629fba04 Added 'Component Registry' + removed 14 xpi engine files from [core] + renamed modules [xpiengine]->[install] and [core]->[browser]
git-svn-id: svn://10.0.0.236/trunk@52635 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:31:35 +00:00
gordon%netscape.com
49947504d3 Basic Mac implementation of async DNS. r=warren, patrick; part of bug:10731.
git-svn-id: svn://10.0.0.236/trunk@52634 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:24:51 +00:00
gordon%netscape.com
66130367d8 Mac specific interrupt<->thread synchronization mechanism, required for async Mac dns.
r=warren, patrick, wtc, srinivas, larryh; part of bug:10731.


git-svn-id: svn://10.0.0.236/trunk@52633 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:22:58 +00:00
rods%netscape.com
9b02da0b6f put quotes around all button i.e. type="button"
rearranged all focus,hover & active rules and put them in that order.
r=kmcclusk, part of 14951


git-svn-id: svn://10.0.0.236/trunk@52632 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 01:01:55 +00:00
cmanske%netscape.com
cabfc8b277 Fixed bugs 17098, 17808, and a lot of UI cleanup. Rewrote Image Properties dialog so More/Fewer works and layout is better. Moved image URLs from DTD to CSS files. r=brade
git-svn-id: svn://10.0.0.236/trunk@52631 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:48:26 +00:00
terry%mozilla.org
435176df52 Whoops! Was reporting ASSIGNED bugs as being closed. Also, changed
it to report the resolution of the bug instead of the word "closed".
Many thanks to dbaron@fas.harvard.edu for suggesting this change, and
reporting the bug.


git-svn-id: svn://10.0.0.236/trunk@52630 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:44:29 +00:00
kipp%netscape.com
eed8ac6824 r=troy; remove another 4 bytes from each block frame for a total of 10% today :-)
git-svn-id: svn://10.0.0.236/trunk@52629 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:42:12 +00:00
kipp%netscape.com
fbfbed8f89 r=troy; Removed old garbage code that referred to an unused symbol from nsHTMLParts.h
git-svn-id: svn://10.0.0.236/trunk@52628 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:41:42 +00:00
mstoltz%netscape.com
2656423bf8 Fixed windows breakage in standalone by adding a typedef
git-svn-id: svn://10.0.0.236/trunk@52627 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:41:20 +00:00
rogerl%netscape.com
6701db0533 Not a part of SeaMonkey Build
- added lnker option for server folks


git-svn-id: svn://10.0.0.236/trunk@52626 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:28:51 +00:00
mjudge%netscape.com
9252d81168 small fix from pierre on use of the style system. pierre reviewed.
git-svn-id: svn://10.0.0.236/trunk@52625 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:11:49 +00:00
kmcclusk%netscape.com
a30e4bc896 Removed call to mWebShell->Repaint in nsHTMLFrameInnerFrame::Reflow. This eliminates
multiple repaints of the content area in Mozilla when the content area is resized.
The mWebShell->SetBounds is sufficient since it invalidates the webshell window.
bug 16270; r= rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@52624 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:11:40 +00:00
jfrancis%netscape.com
3d0b1d674f fix for 17673;r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52623 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:07:37 +00:00
rods%netscape.com
13ee3e3b3d Add CountAllChild to count all the option and optgroup elements so lists
get sized correctly when no rows are specified
r=kmcclusk, bug=4050


git-svn-id: svn://10.0.0.236/trunk@52622 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:07:01 +00:00
rods%netscape.com
50248ce5b0 Added code to size the button appropriately when style sets the size and
make it clip for drawing.
NOTE: This is a temporary fix for bug #17474


git-svn-id: svn://10.0.0.236/trunk@52621 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:05:30 +00:00
rods%netscape.com
89ba99747a Combos now size correctly when the size is specified via style
r=kmcclusk, b=16317


git-svn-id: svn://10.0.0.236/trunk@52620 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:03:32 +00:00
kmcclusk%netscape.com
a09d34ccd1 Fixed places where SetProperty and Reset were missing the nsIPresContext argument.
This fixed 6 warnings and cases where reset and set property where not working properly for
all form elements. r = rods@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@52619 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-03 00:01:13 +00:00
rods%netscape.com
913fe3b85c removed a line that wasn't needed and caused a warning r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@52618 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:54:40 +00:00
bienvenu%netscape.com
381c484f1a turn meteors back off, per mscott's request and review
git-svn-id: svn://10.0.0.236/trunk@52617 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:46:54 +00:00
mstoltz%netscape.com
fc96225344 Created helper class nsZipRead to hold read state information. That way
one nsJAR can support multiple input streams. r=norris


git-svn-id: svn://10.0.0.236/trunk@52616 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:46:09 +00:00
norris%netscape.com
2323d5792a Fix
10194 Possible security vulnerability in "chrome:" protocol - acce
14979 "chrome" protocol allows accessing arbitrary files on the lo
r=vidur


git-svn-id: svn://10.0.0.236/trunk@52615 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:44:27 +00:00
kipp%netscape.com
29b0107f3f Fixed up comments in test file list
git-svn-id: svn://10.0.0.236/trunk@52614 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:43:25 +00:00
kipp%netscape.com
e4bab0a0e6 r=troy; Shrink block frames by 4 bytes per instance by making the overflow-lines instance variable a frame property
git-svn-id: svn://10.0.0.236/trunk@52613 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:42:52 +00:00
robinf%netscape.com
f5e6d0785f fixing M11 bug 15335
git-svn-id: svn://10.0.0.236/trunk@52612 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:42:48 +00:00
pinkerton%netscape.com
72f9201ec6 rewrote item detection code to handle the case where the toolbar isn't in a frame that is at 0,0 (like windows with the menu bar above the personal toolbar). (r=saari, bug #17800).
git-svn-id: svn://10.0.0.236/trunk@52611 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:42:16 +00:00
kipp%netscape.com
f734a9cc39 r=troy; Added a new frame property atom
git-svn-id: svn://10.0.0.236/trunk@52610 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:42:13 +00:00
pollmann%netscape.com
78899987be Bug 7554: HTML Labels now pass JS events to form element the label is for
r=harishd


git-svn-id: svn://10.0.0.236/trunk@52609 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:38:17 +00:00
jband%netscape.com
f26efbdd12 r=mccabe use NS_NewTimer stuff only on Win32 in this test code. This avoids Unix build order problems that were keeping the xpconnect test components from working at all.
git-svn-id: svn://10.0.0.236/trunk@52608 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:35:54 +00:00
cls%seawood.org
3e1a9ca95a Removed unused NECKO ifdefs.
a=leaf


git-svn-id: svn://10.0.0.236/trunk@52607 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:34:03 +00:00
jband%netscape.com
e1ba1048c5 r=mccabe make output from xpcshell's new 'dump' method go to the same place as output of 'print': stdout rather than stderr
git-svn-id: svn://10.0.0.236/trunk@52606 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:31:09 +00:00
alecf%netscape.com
79451301a6 fix for #12703 - don't hold onto XULElements after they have been removed from the tree - don't bother checking mDocument because it will be null when the content has been removed from the document
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@52605 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:30:33 +00:00
ducarroz%netscape.com
ab0bddd10c Fix for bug 17768. Set ProgID to soemething else than an empty string. R=rhp
git-svn-id: svn://10.0.0.236/trunk@52604 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:29:51 +00:00
nisheeth%netscape.com
2d91e8e29f Fix bug 15304. Added a flag to bscmake.exe. Only executed when the browse_info target is used.
git-svn-id: svn://10.0.0.236/trunk@52603 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:29:48 +00:00
sspitzer%netscape.com
baa984b1b1 fix #16457, r=mscott. if an error occurs in the SMTP protocol state machine, we may need to pop up the alert right then, and not when we get back to the url listener, because we'd loose the error text from the SMTP server. these changes
pop up the alert and set the error code so that the url listener doesn't try to
pop up another alert.  define a bunch of new error codes, and remove nsMsgTransition.h, which was defining all the MK_ error codes that were in there.
are no longer needed.


git-svn-id: svn://10.0.0.236/trunk@52602 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:27:46 +00:00
cls%seawood.org
a95990ff7f No need to generate obsolete network Makefiles
git-svn-id: svn://10.0.0.236/trunk@52601 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:27:45 +00:00
selmer%netscape.com
c4d5dc11d9 New Makefile system for builds
git-svn-id: svn://10.0.0.236/trunk@52600 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:25:41 +00:00
nhotta%netscape.com
fac05a4ebc Added a call to encoder finish, this allows encoder to write out remaining data such as escape sequences of ISO-2022-JP, bug 17805, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@52599 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:24:10 +00:00
valeski%netscape.com
f63ddf59d3 r=cyeh, forcing PR_LOGGING for ftp in release builds
git-svn-id: svn://10.0.0.236/trunk@52598 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:24:06 +00:00
bienvenu%netscape.com
c5b3a013a5 remove the imap channel from the load group when finished running r=mscott
git-svn-id: svn://10.0.0.236/trunk@52597 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 23:22:29 +00:00
akhil.arora%sun.com
38a11db343 17802 r=drapeau@eng.sun.com Workshop C++ 5.0 needs a cast
git-svn-id: svn://10.0.0.236/trunk@52596 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:57:58 +00:00
rogerl%netscape.com
9871278292 Added Kurt Westerfeld's fix for 'undefined is not a function' message.
git-svn-id: svn://10.0.0.236/trunk@52595 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:52:10 +00:00
dmose%mozilla.org
83e38c06cc updated license boilerplate to xPL v1.1
git-svn-id: svn://10.0.0.236/trunk@52594 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:43:10 +00:00
cls%seawood.org
7190f1f2a8 Use #elif not #elseif
git-svn-id: svn://10.0.0.236/trunk@52593 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:36:59 +00:00
dmose%mozilla.org
20069a7cf6 updated license boilerplate to xPL v1.1
git-svn-id: svn://10.0.0.236/trunk@52592 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:23:59 +00:00
petitta%netscape.com
5a257f75ca initailizes the dist directory
git-svn-id: svn://10.0.0.236/trunk@52590 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:21:05 +00:00
petitta%netscape.com
29a164a7ec add include file InitDist.win
git-svn-id: svn://10.0.0.236/trunk@52589 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:15:36 +00:00
terry%mozilla.org
927e36576b Due to popular request, "bug changed" mail will only report changes in
state on dependent bugs if they move from an 'open' to a 'closed'
state, or visa-versa.  Also, if there are more than 5 bugs on the
list, then we won't even try to generate the details (doing so only
generates lots of extra mail that is too hard to parse anyway.)


git-svn-id: svn://10.0.0.236/trunk@52588 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 22:14:11 +00:00
pavlov%netscape.com
a90526ccd9 add scriptable region to unix factory fixes bug 12465 r=slamm
git-svn-id: svn://10.0.0.236/trunk@52587 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:57:14 +00:00
ssu%netscape.com
857b4649d5 fixing redness on mac tinderbox. #else if doesn't work. Changed it to #elseif
git-svn-id: svn://10.0.0.236/trunk@52586 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:50:07 +00:00
pinkerton%netscape.com
21dea39deb turn off very verbose debug output. r=saari
git-svn-id: svn://10.0.0.236/trunk@52585 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:39:47 +00:00
bienvenu%netscape.com
3b1ca7dd5b more work to hook up stop button, r=mscott 17743
git-svn-id: svn://10.0.0.236/trunk@52584 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:36:59 +00:00
jfrancis%netscape.com
e109f40aa7 changed bogus node type to br to get rid of annoying space in empty editors; r=kin
git-svn-id: svn://10.0.0.236/trunk@52583 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:35:21 +00:00
rhp%netscape.com
51c892b441 Changes to remove ToCString() calls - Bug #'s: 17580 17581 - r: nhotta
git-svn-id: svn://10.0.0.236/trunk@52582 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:31:32 +00:00
pinkerton%netscape.com
3490d404ad add text/plain flavor acceptance to dragOver on personal toolbar and set canDrop on drag session so win32 uses the correct cursor feedback. (r=saari).
git-svn-id: svn://10.0.0.236/trunk@52581 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:28:14 +00:00
cata%netscape.com
f404d8e1ea Fixing typo in dtd file. Checkin for momoi, r=cata, bug=17018.
git-svn-id: svn://10.0.0.236/trunk@52580 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:27:02 +00:00
jefft%netscape.com
2c52d1343a fixed bug 16540 - 4.x Pop3 prefs not being heeded; ported over as server specific prefs, also added logging facility, less query interface, more cached capability on server; r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@52579 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:20:47 +00:00
waldemar%netscape.com
3d577f8188 Added more no-line-break constraints, simplified visibility treatment, and added named function arguments
git-svn-id: svn://10.0.0.236/trunk@52578 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:12:04 +00:00
nhotta%netscape.com
5612e1f8a8 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52577 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:09:05 +00:00
nhotta%netscape.com
5b9bc9b77b Removing a file (not part of the build), this project file was checked in as a text instead of binary.
git-svn-id: svn://10.0.0.236/trunk@52576 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:08:38 +00:00
pinkerton%netscape.com
00599502a2 set event struct type for drag events. previously uninitialized and caused random things to occur during drags (r=saari).
git-svn-id: svn://10.0.0.236/trunk@52575 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:04:40 +00:00
waterson%netscape.com
2fa1de35a2 Don't enable drag & drop on scrollbars. r=pink,hyatt
git-svn-id: svn://10.0.0.236/trunk@52574 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:03:46 +00:00
msw%gimp.org
ceb7def2a5 applied patch in 14263 to build xpconnect as a component on
Linux/alpha.  Should also fix 13601, 11847.
r=jband@netscape.com


git-svn-id: svn://10.0.0.236/trunk@52573 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 21:03:13 +00:00
ftang%netscape.com
f80890ee10 fix one typo. add new locale name for Chinese. r=nhotta
git-svn-id: svn://10.0.0.236/trunk@52572 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:58:47 +00:00
tonyr%fbdesigns.com
25d9029cf4 Fixed discovery of mail folders to import when multiple MAPI message stores are in use
git-svn-id: svn://10.0.0.236/trunk@52571 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:58:37 +00:00
harishd%netscape.com
0bce4f45ab No bug number.
Improvement to table performance by reducing
the number of context switch calls.

r=vidur


git-svn-id: svn://10.0.0.236/trunk@52570 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:58:12 +00:00
matt%netscape.com
86cd62a5d8 fix for bug 14634 r-hangas
git-svn-id: svn://10.0.0.236/trunk@52569 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:57:22 +00:00
tonyr%fbdesigns.com
873914c889 Fix to escape From lines in Outlook Express 5.0 message bodies
git-svn-id: svn://10.0.0.236/trunk@52568 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:57:21 +00:00
morse%netscape.com
9410e061b6 fix bug 17645, high-order bit on cookie character getting garbled, r=dp
git-svn-id: svn://10.0.0.236/trunk@52567 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:56:13 +00:00
waldemar%netscape.com
5123dfaa8d Fixed constraint positioning bug
git-svn-id: svn://10.0.0.236/trunk@52566 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:54:44 +00:00
matt%netscape.com
d1c10fc10e fix for bug 14634 r-bill
git-svn-id: svn://10.0.0.236/trunk@52565 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:51:29 +00:00
matt%netscape.com
c018d1acdc fix for bug 6830 and 14634 r-bill
git-svn-id: svn://10.0.0.236/trunk@52564 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:49:49 +00:00
sgehani%netscape.com
119d8e6f37 Fixed bugs 10540, 9148. Libjar now reads teh central directory headers as opposed to the local file headers. This enables us to glean permissions informationand restore file mode upon extraction. A side-effect is the bug 10540 fix where the Install.Execute() API now works on Linux since we restore the execute bits in temporarily extracted files. [r=ssu]
git-svn-id: svn://10.0.0.236/trunk@52563 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:37:28 +00:00
slamm%netscape.com
19101eea26 Bloat: Change coloring algorithm. Set the baseline every time there is a jump up or down.
git-svn-id: svn://10.0.0.236/trunk@52562 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:09:20 +00:00
rogerl%netscape.com
3ee7564f6a More RegExp back reference specification mucking about.
git-svn-id: svn://10.0.0.236/trunk@52561 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:04:57 +00:00
rogerl%netscape.com
bbab2a24a8 Fixed up for Java vs. ECMA definitions in edge cases
git-svn-id: svn://10.0.0.236/trunk@52560 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 20:04:16 +00:00
tbogard%aol.net
14fc302c46 Changed URIDispatcher to URILoader throughout.
git-svn-id: svn://10.0.0.236/trunk@52559 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 19:36:43 +00:00
mscott%netscape.com
24c042e752 Add cvsignore file for uriloader\build
git-svn-id: svn://10.0.0.236/trunk@52558 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 19:21:49 +00:00
mscott%netscape.com
3088a6720d (not part of the build!)
add .cvsignore file


git-svn-id: svn://10.0.0.236/trunk@52557 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 19:21:01 +00:00
mscott%netscape.com
ce5a53f536 this directory is not part of the build!!!
add .cvsignore file


git-svn-id: svn://10.0.0.236/trunk@52556 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 19:18:04 +00:00
mscott%netscape.com
84368cfe83 this directory isn't part of the build!!!!
add a Makefile for uriloader\build


git-svn-id: svn://10.0.0.236/trunk@52555 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 19:09:50 +00:00
mscott%netscape.com
a31f301140 (This directory isn't part of the build!!)
Add a Makefile for the uriloader base directory.


git-svn-id: svn://10.0.0.236/trunk@52554 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 19:09:15 +00:00
akhil.arora%sun.com
1c67d02237 17610 r=akhil.arora@sun.com, fix=Denis Sharypov <sdv@sparc.spb.su>
Cosmetic changes to remove warnings generated by Visual C++ compiler
Do not link with unneccessary library raptorgfx in makefile.win
Use JAVAHOME to point to JDK instead of hardcoding the path


git-svn-id: svn://10.0.0.236/trunk@52553 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 18:52:14 +00:00
akhil.arora%sun.com
5b541fa64b 17610 r=Denis Sharypov <sdv@sparc.spb.su>
Make code const correct to remove warnings from workshop 5.0 compiler


git-svn-id: svn://10.0.0.236/trunk@52552 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 18:42:53 +00:00
kipp%netscape.com
37b2efc82c r=ftang; Fixed regression in linux font rendering caused by case sensitivity being required for the character set lookups
git-svn-id: svn://10.0.0.236/trunk@52551 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 18:20:05 +00:00
kipp%netscape.com
b3604151b4 Fixed bug 17698 - prepended srcdir to each of the resources being installed
git-svn-id: svn://10.0.0.236/trunk@52550 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 15:53:17 +00:00
kipp%netscape.com
63a86eb8cd fixed bug 15316 by tweaking the html style sheet as the author of the bug suggested
git-svn-id: svn://10.0.0.236/trunk@52549 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 15:49:50 +00:00
kipp%netscape.com
941b74b495 r=troy; fixed bugs 2636 and 17636 - line layout issues for some more edge cases (nobr's with floaters in them) and handling of nbsp
git-svn-id: svn://10.0.0.236/trunk@52548 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 15:44:57 +00:00
karnaze%netscape.com
bf8bc966c9 ComputeDesiredHeight - removed potential error if first child is not a row group.
git-svn-id: svn://10.0.0.236/trunk@52547 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 15:41:38 +00:00
buster%netscape.com
2bbfb06080 bug 17727 ([dogfood] Password not showing stars for default values unless we click inside the field.)
r=brade

change is in nsGfxTextControl.cpp.  I used to just blindly set the text of the underlying text frame.
Now I check if it's a password field, and replace the display text with '*' if it is.


git-svn-id: svn://10.0.0.236/trunk@52546 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 15:12:47 +00:00
rods%netscape.com
be66a15de9 updated the tests
git-svn-id: svn://10.0.0.236/trunk@52545 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 14:51:20 +00:00
rods%netscape.com
f75283d60b initial
git-svn-id: svn://10.0.0.236/trunk@52544 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 14:44:55 +00:00
syd%netscape.com
0887d1ab7b The code doesn't check to see if commandNode is non-NULL. It actually does,
but too late.

Before:
< 	var value = commandNode.getAttribute(valueAttribute);
< 	if ( commandNode && value )
< 		commandNode.setAttribute('value', value);
It looks to see if commandNode is non-NULL *after* it uses it to get "value".
After:
> 	if ( commandNode ) {
> 		var value = commandNode.getAttribute(valueAttribute);
> 		if ( value )
> 			commandNode.setAttribute('value', value);
> 	}

r=BenB


git-svn-id: svn://10.0.0.236/trunk@52543 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 12:29:57 +00:00
ftang%netscape.com
5a4cba5ec3 fix bug 14914. r=cata (several weeks ago). change the GetEncoder/GetDecoder from a loop which create/destroy/IsEqual of nsString to use PROGID directly
git-svn-id: svn://10.0.0.236/trunk@52542 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 08:49:20 +00:00
idk%eng.sun.com
4a0f268246 17747
Added "ifdef OJI_DISABLE"
in case OJI_DISABLE we will have binaries working without oji
Apdated README


git-svn-id: svn://10.0.0.236/trunk@52541 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 08:07:09 +00:00
rpotts%netscape.com
05c908d920 bug #3469 (r=warren). Fixing nsLoadGroup::Cancel() to call cancel on all active transports and subgroups...
git-svn-id: svn://10.0.0.236/trunk@52540 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 08:00:07 +00:00
warren%netscape.com
857d05a688 Made nsHTTPEncodeStream seekable (for reposting form data). Bug #17685. r=waterson
git-svn-id: svn://10.0.0.236/trunk@52539 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 07:43:37 +00:00
mccabe%netscape.com
b3f3e6c4bc Reverting lib fix to fix impending bustage.
git-svn-id: svn://10.0.0.236/trunk@52538 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 07:39:51 +00:00
shaver%netscape.com
dd157213ab updated nsSample.js, long overdue (r=brendan)
git-svn-id: svn://10.0.0.236/trunk@52537 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 07:36:25 +00:00
valeski%netscape.com
f9329cacef adding some keyword support back in
git-svn-id: svn://10.0.0.236/trunk@52536 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 07:18:44 +00:00
dmose%mozilla.org
68d3ee8a2a updating license to xPL 1.1
git-svn-id: svn://10.0.0.236/trunk@52535 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 07:16:31 +00:00
ftang%netscape.com
202313d853 check in the patch submit by Jonas Utterstrom <jonas.utterstrom@vittran.norrnod.se in message news://news.mozilla.org/381B3757.FEC144BC%40vittran.norrnod.se fix bug 17706. r=ftang
git-svn-id: svn://10.0.0.236/trunk@52534 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 07:01:44 +00:00
dmose%mozilla.org
8135a379f0 updating license to xPL 1.1
git-svn-id: svn://10.0.0.236/trunk@52533 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:56:28 +00:00
ftang%netscape.com
b93e1edb98 add debuggin message for bug 7571. r=nhotta
git-svn-id: svn://10.0.0.236/trunk@52532 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:54:37 +00:00
mccabe%netscape.com
b13865d0da Another stab at linking with the timer static library - this time using EXTRA_DSO_LDOPTS.
r=jband


git-svn-id: svn://10.0.0.236/trunk@52531 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:53:58 +00:00
dmose%mozilla.org
c6627a15ce removing stubfe files from the trunk; these are only relevant in the MozillaClassic branch
git-svn-id: svn://10.0.0.236/trunk@52530 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:51:30 +00:00
warren%netscape.com
1d1448afe5 Made nsIUnicharStreamLoader be scriptable and deal with an xpcom observer instead of a proc pointer and void*. Part of bug#11159. r=nisheeth,kipp,pierre
git-svn-id: svn://10.0.0.236/trunk@52529 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:49:44 +00:00
valeski%netscape.com
ea48e3cc05 putting www.*.com trick back in
git-svn-id: svn://10.0.0.236/trunk@52528 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:43:19 +00:00
waterson%netscape.com
e8d88c499c Fix two more leaks that I forgot to check in.
git-svn-id: svn://10.0.0.236/trunk@52527 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:40:38 +00:00
dmose%mozilla.org
2ccab49e6d updating license boilerplate to xPL v1.1
git-svn-id: svn://10.0.0.236/trunk@52526 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:38:29 +00:00
dmose%mozilla.org
377be09812 updating license boilerplate to xPL v1.1
git-svn-id: svn://10.0.0.236/trunk@52525 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:27:30 +00:00
waterson%netscape.com
c33933dfdc remove CTOR and DTOR counters, because the descendant classes will all
account for this space. r=warren


git-svn-id: svn://10.0.0.236/trunk@52524 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:21:07 +00:00
dmose%mozilla.org
9fc7780ead updating license boilerplate to xPL v1.1
git-svn-id: svn://10.0.0.236/trunk@52523 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:20:05 +00:00
valeski%netscape.com
55265a0fbb pulling non-qualified host-to-keyword server logic
git-svn-id: svn://10.0.0.236/trunk@52522 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:18:01 +00:00
dmose%mozilla.org
630d8b77f1 updating license boilerplate
git-svn-id: svn://10.0.0.236/trunk@52521 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:13:48 +00:00
troy%netscape.com
1ab461f4c6 r=pierre@netscape.com
Fix compiler warning


git-svn-id: svn://10.0.0.236/trunk@52520 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:07:12 +00:00
troy%netscape.com
0481fd6a2b Real fix for my build bustage. Kipp had commened the offending code out to
keep the build going


git-svn-id: svn://10.0.0.236/trunk@52519 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 06:06:46 +00:00
jband%netscape.com
5cd00daf35 - Add test code for calling back via a timer on potentially other JSConetxt
to the xpconnect echo interface. This will help fix bug 17736. This includes
using nsITimer which is a pretty messed up xpcom interface w/o a factory.

- Added dump() to xpcshell to make it compatible with browsers debug
output method.

- reformat beard's leak fix to follow 80 column rule.

- Add a missing dont_AddRef to avoid a leak in some debug code.

r=mccabe


git-svn-id: svn://10.0.0.236/trunk@52518 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:55:29 +00:00
nisheeth%netscape.com
3810554e35 r=nisheeth. Fix for bug 12323. Thanks to Ian Hickson (py8ieh=bugzilla@bath.ac.uk) for the patch. Only lowercase chars are accepted in the stylesheet PI.
git-svn-id: svn://10.0.0.236/trunk@52517 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:49:57 +00:00
troy%netscape.com
8c862baf0d Changed QueryInterface() to check for nsIFrameDebug
git-svn-id: svn://10.0.0.236/trunk@52516 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:49:11 +00:00
dmose%mozilla.org
ab8bcb5065 updating license boilerplate
git-svn-id: svn://10.0.0.236/trunk@52515 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:38:33 +00:00
warren%netscape.com
54581e51ee Added some sanity assertions. r=gagan
git-svn-id: svn://10.0.0.236/trunk@52514 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:38:22 +00:00
warren%netscape.com
afd6573875 Fix for bad refcount tracing. r=buster,nisheeth
git-svn-id: svn://10.0.0.236/trunk@52513 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:37:04 +00:00
waterson%netscape.com
b2a8f1f15e Fix two leaks courtesy evaughan.
git-svn-id: svn://10.0.0.236/trunk@52512 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:36:08 +00:00
warren%netscape.com
ddf6490f7b Removed dependence on neckoutil functions. Part of bug#11159. Not in the build yet.
git-svn-id: svn://10.0.0.236/trunk@52511 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:31:56 +00:00
buster%netscape.com
b599517d9a fixed bug 17689 r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@52510 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:16:41 +00:00
tbogard%aol.net
aa0f04f201 Changed NS_ASSERTION to NS_WARN_IF_FALSE to avoid crashing people when condition is met. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@52509 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:14:27 +00:00
tbogard%aol.net
62ce3cdd71 Changed NS_NOTREACHED to be NS_WARN_IF_FALSE() so as to not crash everyone. r=sfraser.
git-svn-id: svn://10.0.0.236/trunk@52508 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:12:05 +00:00
valeski%netscape.com
8cf9738323 11869, r=warren. passing the http spec all the way into http rather than passing a simple uri into the service newChannel().
git-svn-id: svn://10.0.0.236/trunk@52507 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:05:44 +00:00
morse%netscape.com
cf72289b9d fix ui regressons in cookie viewer, code=rgoodger, r=morse
git-svn-id: svn://10.0.0.236/trunk@52506 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:04:57 +00:00
morse%netscape.com
c465ca23ff fix ui regressons in signon viewer, code=rgoodger, r=morse
git-svn-id: svn://10.0.0.236/trunk@52505 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 05:04:19 +00:00
valeski%netscape.com
52d16678ac missed a case
git-svn-id: svn://10.0.0.236/trunk@52504 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 04:22:12 +00:00
valeski%netscape.com
ff5c4380e5 16910, r=mcafee. FTP now uses thread pools. it also provides some status to the webshell. and it no longer uses the server's defualt path.
git-svn-id: svn://10.0.0.236/trunk@52503 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 04:04:23 +00:00
valeski%netscape.com
af0f3e7b0b 11869, r=mcafee. adding keyword protocol handler to the build. mac still needs to be hooked up.
git-svn-id: svn://10.0.0.236/trunk@52502 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 04:01:35 +00:00
valeski%netscape.com
43382f61e2 11869, r = travis. we no longer to the www.*.com trick as it is handled by the keyword protocol handler. we now kick qualifying requests to the keyword protocol handler.
git-svn-id: svn://10.0.0.236/trunk@52501 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 04:00:07 +00:00
hangas%netscape.com
ab9a0355a1 Progress on Command Updating and Dispatching (15127). r=scottip
git-svn-id: svn://10.0.0.236/trunk@52500 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:55:59 +00:00
pinkerton%netscape.com
35ff47ccc3 making the drop feedback be 2 pixels wide, not one (r=saari).
git-svn-id: svn://10.0.0.236/trunk@52499 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:55:44 +00:00
pinkerton%netscape.com
e182909557 fix for #16463 (crash when frames involved in a drag went away) and nsCOMPtrizing a lot of things (r=saari).
git-svn-id: svn://10.0.0.236/trunk@52498 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:55:14 +00:00
pinkerton%netscape.com
871ab8e113 add ability to have a sub-frame (such as an inner box) be the area which is where the draggable content resides.
git-svn-id: svn://10.0.0.236/trunk@52497 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:54:24 +00:00
pinkerton%netscape.com
e5be208b97 add new drop area attribute for identifying subframes of a toolbar where the real content is.
git-svn-id: svn://10.0.0.236/trunk@52496 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:53:58 +00:00
pinkerton%netscape.com
d9fc856c54 turn d&d on personal toolbar back on and clean it up after new xul file rewrite.
git-svn-id: svn://10.0.0.236/trunk@52495 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:53:30 +00:00
slamm%netscape.com
19446f1058 Partial fix for bug 17722, "No [Sidebar] Panels for mac". We should probably copy the entire directory, but adding a MANIFEST file to profile/defaults would mess up Linux and Windows. May need to add Makefiles for them too. r=pinkerton.
git-svn-id: svn://10.0.0.236/trunk@52494 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:49:14 +00:00
pollmann%netscape.com
b1d9af131b Removing null code. No bug number. r=nisheeth
git-svn-id: svn://10.0.0.236/trunk@52493 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:48:04 +00:00
pavlov%netscape.com
21d2358524 add unix makefiles for docshell r=mcafee,paulmac. also changed IDL to C++ in the two .cpp files' emacs comments and added a newline at the end of them (files not built by default)
git-svn-id: svn://10.0.0.236/trunk@52492 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:43:10 +00:00
pavlov%netscape.com
0ab35801a3 clamp down sizes < 2^15 r=dbaron@fas.harvard.edu r=paulmac ;) fixes bug 2564
git-svn-id: svn://10.0.0.236/trunk@52491 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:38:23 +00:00
bienvenu%netscape.com
e1b2ce4a78 add code for hooking up stop button,r=putterman 12016
git-svn-id: svn://10.0.0.236/trunk@52490 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 03:34:45 +00:00
slamm%netscape.com
bd6f30c5cb File dependency not needed anymore. Fix build bustage. r=mcafee.
git-svn-id: svn://10.0.0.236/trunk@52489 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 02:57:23 +00:00
mcafee%netscape.com
5a6348e661 Adding pavlov to modeless pref dialog patch, improved some assertion comments. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52488 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 02:43:04 +00:00
brendan%mozilla.org
bed10de2c0 Fixed getter/setters, pave way for brutal sharing (15146, r=shaver@mozilla.org,rogerl@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@52487 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 02:23:50 +00:00
cathleen%netscape.com
93f291a8ea adding in missing chrome and res files for mac packager
git-svn-id: svn://10.0.0.236/trunk@52486 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 02:22:50 +00:00
waterson%netscape.com
df32caa941 Fix manky nsCOMPtr asserts.
git-svn-id: svn://10.0.0.236/trunk@52485 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 02:02:27 +00:00
varada%netscape.com
9d03b5a02f fixing bug #6666 marking the readme and license checkboxes as default
git-svn-id: svn://10.0.0.236/trunk@52484 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:58:11 +00:00
rogerl%netscape.com
15318a9b2b Changed -n to regular since the error is getting detected in the code now.
git-svn-id: svn://10.0.0.236/trunk@52483 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:55:59 +00:00
mcafee%netscape.com
e555659f6b NECKO=1 is on by default now. this was removed from the Makefile name-space this past weekend and needs to be removed here. Adding necko directories by default, removing netwerk/makefiles. Adding netwerk/protocols/keyword/Makefiles for valeski. r=slamm.
git-svn-id: svn://10.0.0.236/trunk@52482 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:54:54 +00:00
alecf%netscape.com
d3116d95c6 fix bustage, forgot this file in my last checkin
git-svn-id: svn://10.0.0.236/trunk@52481 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:53:28 +00:00
dmose%mozilla.org
361fd99522 updated license boilerplate
git-svn-id: svn://10.0.0.236/trunk@52480 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:51:54 +00:00
pollmann%netscape.com
4b235a7aef Removing null code. No bug number. r=nisheeth
git-svn-id: svn://10.0.0.236/trunk@52479 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:50:15 +00:00
beard%netscape.com
9c32d2f87e need to be able to Quit viewer via AppleEvent. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52478 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:49:52 +00:00
dmose%mozilla.org
9dba8ec0b3 updating license boilerplate
git-svn-id: svn://10.0.0.236/trunk@52476 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:46:24 +00:00
waldemar%netscape.com
3cc6fe040f Added basic no-line-break constraints matching JavaScript 1.x
git-svn-id: svn://10.0.0.236/trunk@52475 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:46:05 +00:00
waldemar%netscape.com
f48012bb56 Added no-line-break constraints
git-svn-id: svn://10.0.0.236/trunk@52474 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:45:31 +00:00
waldemar%netscape.com
b6e92d2926 Fixed comment
git-svn-id: svn://10.0.0.236/trunk@52473 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:45:14 +00:00
waldemar%netscape.com
d8924f3115 Added :no-line-break
git-svn-id: svn://10.0.0.236/trunk@52472 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:44:24 +00:00
varada%netscape.com
854153ad1b fixing bug #6664 making CDlayout as the default marked checkbox in the info page
git-svn-id: svn://10.0.0.236/trunk@52471 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:44:06 +00:00
waldemar%netscape.com
82cd9877d0 Fixed annoying use of *error-output* that would always bring the listener window to the front while compiling a grammar
git-svn-id: svn://10.0.0.236/trunk@52470 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:43:52 +00:00
dp%netscape.com
1b8c8d2216 Changing use of NS_WITH_SERVICE() as GetService() to GetService(). r=warren
git-svn-id: svn://10.0.0.236/trunk@52469 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:40:46 +00:00
dp%netscape.com
3e684b542b Changing misuse of NS_WITH_SERVICE() to GetService(). r=warren
git-svn-id: svn://10.0.0.236/trunk@52468 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:40:14 +00:00
ssu%netscape.com
26a5cb95b3 Fixes bug #17562. r=sgehani. This checkin does not affect tinderbox.
The other checkin to fix this bug only affects the windows platforms.


git-svn-id: svn://10.0.0.236/trunk@52467 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:38:10 +00:00
pinkerton%netscape.com
6671a998a4 allow mouse event coordinates to be accessed with d&d events in addition to mouse events, since d&d events have the same structure as mouse events. (r=joki).
git-svn-id: svn://10.0.0.236/trunk@52466 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:38:01 +00:00
ssu%netscape.com
7c2c8f0ecb fixing bug #17562. r=sgehani
Fixes problem with not detecting xpinstall reboot return error.


git-svn-id: svn://10.0.0.236/trunk@52465 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:36:41 +00:00
pinkerton%netscape.com
64f2e921ee add rule for drop feedback on personal toolbar (r=hyatt).
git-svn-id: svn://10.0.0.236/trunk@52464 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:35:42 +00:00
pinkerton%netscape.com
7262c47353 fix for bug 17381 where leaving the frame before a drag gesture was began caused the event target to be set incorrectly. (r=saari).
git-svn-id: svn://10.0.0.236/trunk@52463 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:34:16 +00:00
rogerl%netscape.com
9259c87a92 That's much cooler - i'm putting the 0 case back then.
git-svn-id: svn://10.0.0.236/trunk@52462 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:31:45 +00:00
pavlov%netscape.com
268235e424 break in the switch, don't fall through *doh* r=duncan@be.com
git-svn-id: svn://10.0.0.236/trunk@52460 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:25:00 +00:00
cls%seawood.org
6533b90ce6 Added detection for alphaev6. Submitted by Matt Wilson <msw@redhat.com>.
git-svn-id: svn://10.0.0.236/trunk@52459 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:24:16 +00:00
nhotta%netscape.com
a468c6983c Fixed a typo in the entity definition, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@52458 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:19:19 +00:00
tbogard%aol.net
0154b52329 Second phase of changing NS_ENSURE() to NS_ENSURE_TRUE() and NS_ENSURE_NOT() to NS_ENSURE_FALSE(). r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52457 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:18:52 +00:00
nisheeth%netscape.com
add2edbda0 r=pollmann. Check local DTD directory for dtd files and, if found, load them from there.
git-svn-id: svn://10.0.0.236/trunk@52456 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:16:37 +00:00
pavlov%netscape.com
59b22727bd added .cvsignore file r=slamm
git-svn-id: svn://10.0.0.236/trunk@52455 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:16:09 +00:00
waterson%netscape.com
410ac67f93 Add 'miscellaneous' debug prefs to house 'disable XUL cache' pref UI.
git-svn-id: svn://10.0.0.236/trunk@52454 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:14:50 +00:00
waterson%netscape.com
9ba00de102 Bug 15146. Brutal sharing, Phase III. Turn on protoype, script, and style sheet caching. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52453 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:14:07 +00:00
alecf%netscape.com
54bfc70eea cleanup NS_IMPL_MODULE and friends
- define new nsModuleComponentInfo and use it instead of components_t
- use size_t instead of unsigned int
- add some docs
- allow user to define own module name


git-svn-id: svn://10.0.0.236/trunk@52452 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:12:32 +00:00
danm%netscape.com
44d6b4c7e5 removing implementation of nsIShutdownListener. it was redundant, anyway. r:dp@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52451 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:10:35 +00:00
tbogard%aol.net
c98bf7e9a6 **Not hooked up to build** Implemented Repaint. Changed document to be a readonly attribute. Added a SetDocument that takes a contentType. Implemented this. Changed all the idl methods to be lower-case.
git-svn-id: svn://10.0.0.236/trunk@52450 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:04:25 +00:00
rogerl%netscape.com
81ef7e0434 Needed string parameter in order to pass type comparison correctly.
Added missing TITLE declaration.


git-svn-id: svn://10.0.0.236/trunk@52449 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:03:52 +00:00
rogerl%netscape.com
dff3a32176 Moved nested function out - new ECMA definition.
git-svn-id: svn://10.0.0.236/trunk@52448 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:02:55 +00:00
rogerl%netscape.com
ceaebd4804 Put test case in eval statement to catch error.
git-svn-id: svn://10.0.0.236/trunk@52447 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:02:03 +00:00
rogerl%netscape.com
a027094b30 Added missing TITLE declaration
git-svn-id: svn://10.0.0.236/trunk@52446 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 01:01:34 +00:00
troy%netscape.com
aa355b810b See if the Mac is any happier with this
git-svn-id: svn://10.0.0.236/trunk@52445 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-02 00:21:47 +00:00
varada%netscape.com
cc411daf35 removing unix line endings
git-svn-id: svn://10.0.0.236/trunk@52444 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:47:43 +00:00
dmose%mozilla.org
03ec794132 updated license boilerplate
git-svn-id: svn://10.0.0.236/trunk@52443 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:33:56 +00:00
varada%netscape.com
9efe8d599f fix for bug#9097
git-svn-id: svn://10.0.0.236/trunk@52442 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:33:13 +00:00
valeski%netscape.com
9862db5a48 not in build. updating keyword protocol handler to use new api.
git-svn-id: svn://10.0.0.236/trunk@52441 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:33:05 +00:00
troy%netscape.com
c1c6ae68cd Changed GetFrameName() calls to use nsIFrameDebug interface
git-svn-id: svn://10.0.0.236/trunk@52440 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:29:27 +00:00
kipp%netscape.com
824e50d549 Fixed compilation bustage by using nsIFrameDebug to invoke list and regression data methods
git-svn-id: svn://10.0.0.236/trunk@52439 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:29:05 +00:00
troy%netscape.com
af506bd6c9 Temporary change
git-svn-id: svn://10.0.0.236/trunk@52438 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:21:20 +00:00
rogerl%netscape.com
5df87dc67e Belay that, the tests were fine, the code HAS changed.
git-svn-id: svn://10.0.0.236/trunk@52437 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:16:00 +00:00
troy%netscape.com
cf64589783 Fixed problem with GetFrameName() being defines in non-debug build
git-svn-id: svn://10.0.0.236/trunk@52436 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 23:12:32 +00:00
larryh%netscape.com
d3f1c46ba5 BugZilla 17558. Add PR_Open() PR_EXCL flag
git-svn-id: svn://10.0.0.236/trunk@52435 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:59:27 +00:00
kipp%netscape.com
d8d82e0637 r=rods; bug=17518; I updated the html.css file to select on 'a[href]' instead of 'a' so that the focus properties and related style properties would only apply to anchors with href's
git-svn-id: svn://10.0.0.236/trunk@52434 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:54:14 +00:00
tbogard%aol.net
94697e0452 Changed NS_ENSURE_NOT() to use NS_ENSURE_FALSE() per API change.
git-svn-id: svn://10.0.0.236/trunk@52433 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:54:06 +00:00
kipp%netscape.com
f8fb68c673 r=troy; fixed compiliation issue for debug builds
git-svn-id: svn://10.0.0.236/trunk@52432 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:45:20 +00:00
leaf%mozilla.org
368f25d7ee adding mozilla/uriloader for mscott
git-svn-id: svn://10.0.0.236/trunk@52431 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:43:22 +00:00
kipp%netscape.com
7ae532db2a r=troy; fixed bug 14982 - the problem was that empty continuations of an inline non-replaced element (e.g. 'span') were impact line-height calculations when they should effectively disappear
git-svn-id: svn://10.0.0.236/trunk@52430 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:38:17 +00:00
kipp%netscape.com
a98ac534c3 latest and greatest tests for block dom functions
git-svn-id: svn://10.0.0.236/trunk@52429 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:36:42 +00:00
akkana%netscape.com
1824e7ce91 Fix Sun build bustage: older gcc can't do nsCOMPtr on a forward type
git-svn-id: svn://10.0.0.236/trunk@52428 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:16:15 +00:00
troy%netscape.com
3513334988 Moved a bunch of stuff out to a nsIFrameDebug interface
git-svn-id: svn://10.0.0.236/trunk@52427 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 22:12:45 +00:00
dp%netscape.com
8a02a9884b Removing extra release happening on a service. NS_WITH_SERVICE() will
take care of this release.


git-svn-id: svn://10.0.0.236/trunk@52426 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:57:14 +00:00
akkana%netscape.com
0df1ff715c Formatting whitespace changes only
git-svn-id: svn://10.0.0.236/trunk@52425 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:53:50 +00:00
putterman%netscape.com
897d9e027c Release mNativeDragTarget to fix leaks. no bug. reviewed by rods.
git-svn-id: svn://10.0.0.236/trunk@52424 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:53:06 +00:00
sspitzer%netscape.com
07d441b61a fix for #16119. this variable is not defined out of the scope of the loop, so
it was undefined.


git-svn-id: svn://10.0.0.236/trunk@52423 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:51:16 +00:00
mscott%netscape.com
5492a19059 Don't build new uri idl interfaces in netwerk.
they've been moved to uriloader.


git-svn-id: svn://10.0.0.236/trunk@52422 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:49:55 +00:00
radha%netscape.com
d0a23025d8 Remove the extra AddRef to nsHistoryLayoutState. r=pollmann, bug #16496
git-svn-id: svn://10.0.0.236/trunk@52421 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:47:54 +00:00
mscott%netscape.com
e1c9192da5 remove these uri dispatching interfaces from netwerk.
they live in uriloader now.


git-svn-id: svn://10.0.0.236/trunk@52420 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:47:26 +00:00
alecf%netscape.com
a15001ef11 fix twisties in the thread pane and account manager by responding to GetTarget() along the child arcs like #child and #MessageChild bug #13551
r=scottip


git-svn-id: svn://10.0.0.236/trunk@52419 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:46:07 +00:00
mscott%netscape.com
099420f43e none of these interfaces were being used yet.
they've been moved into mozilla\uriloader.


git-svn-id: svn://10.0.0.236/trunk@52418 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:45:29 +00:00
tbogard%aol.net
ae3cd9e2ce Changed NS_ENSURE_NOT to NS_ENSURE_FALSE to reflect API change. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52417 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:43:56 +00:00
dveditz%netscape.com
5ed2cd7fa7 taking a crack at some ports bustage. r=pnunn
git-svn-id: svn://10.0.0.236/trunk@52416 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:35:50 +00:00
akkana%netscape.com
9dd7ffd0ef 17275, 16285, 15204: Switch to using nsISaveAsCharset for both charset and entity conversion. r=nhotta
git-svn-id: svn://10.0.0.236/trunk@52415 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:34:44 +00:00
tbogard%aol.net
46a7117699 Changed NS_ENSURE_NOT to NS_ENSURE_FALSE to reflect API change. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52414 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:27:09 +00:00
tbogard%aol.net
8d4c0ac47e Changed NS_ENSURE_NOT to NS_ENSURE_FALSE to reflect API change.
git-svn-id: svn://10.0.0.236/trunk@52413 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:25:52 +00:00
tbogard%aol.net
87358978bd Changed NS_ASSERTION to use NS_WARN_IF_FALSE. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52412 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:24:24 +00:00
dp%netscape.com
ff9db70a07 Removing release on a service as this would be taken care by the
NS_WITH_SERVICE() macro. r=danm


git-svn-id: svn://10.0.0.236/trunk@52411 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 21:16:24 +00:00
Jerry.Kirk%Nexwarecorp.com
2bc6161677 Remove call to nsIThread::SetMainThread() and clean up things a bit.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52410 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:52:52 +00:00
warren%netscape.com
933e7aa1a8 Minor cleanup
git-svn-id: svn://10.0.0.236/trunk@52409 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:50:04 +00:00
warren%netscape.com
793d674760 Eliminating netwerk/util
git-svn-id: svn://10.0.0.236/trunk@52408 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:48:12 +00:00
valeski%netscape.com
42d0478ba8 removing early xpcom proxy release change from earlier in the weekend.
git-svn-id: svn://10.0.0.236/trunk@52407 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:37:13 +00:00
varada%netscape.com
bd12ec528f fix for bug #6568 - showing summary in the first page
git-svn-id: svn://10.0.0.236/trunk@52406 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:13:16 +00:00
idk%eng.sun.com
307fe1df58 fix for 17454
changed strncmp to PL_strncasecmp


git-svn-id: svn://10.0.0.236/trunk@52405 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 20:04:57 +00:00
tbogard%aol.net
e885439545 Changed some m_* to m*.
git-svn-id: svn://10.0.0.236/trunk@52404 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:57:15 +00:00
mscott%netscape.com
2a86ddb6f8 (not part of the seamonkey build)
top level Makefile for uriloader


git-svn-id: svn://10.0.0.236/trunk@52403 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:56:25 +00:00
mscott%netscape.com
cc0ac6a407 not part of the seamonkey build
add makefile for the uriloader\build directory.


git-svn-id: svn://10.0.0.236/trunk@52402 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:52:49 +00:00
mscott%netscape.com
4f15b3e7bd not part of the seamonkey build
add CID header file and uri loader module class.


git-svn-id: svn://10.0.0.236/trunk@52401 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:52:25 +00:00
mscott%netscape.com
9cbec3ba42 not part of the seamonkey build.
add top level makefile.win for uriloader.


git-svn-id: svn://10.0.0.236/trunk@52400 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:51:45 +00:00
mscott%netscape.com
604569330e not part of the seamonkey build
remove class id and progid from the interface


git-svn-id: svn://10.0.0.236/trunk@52399 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:51:05 +00:00
mscott%netscape.com
82bbc3b0eb (not part of the seamonkey build!)
export nsURIDispatcher.h


git-svn-id: svn://10.0.0.236/trunk@52398 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:49:09 +00:00
idk%eng.sun.com
b338802f73 fix for 17449
added checkings for NULL


git-svn-id: svn://10.0.0.236/trunk@52397 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:39:26 +00:00
varada%netscape.com
13b7afe705 fixes to bug 5434
git-svn-id: svn://10.0.0.236/trunk@52396 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 19:14:29 +00:00
varada%netscape.com
56c344a8d0 cleanup code for customizationlist
git-svn-id: svn://10.0.0.236/trunk@52395 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 18:10:26 +00:00
varada%netscape.com
fb8cb373a0 cleanup code for checklist
git-svn-id: svn://10.0.0.236/trunk@52394 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 18:09:31 +00:00
briano%netscape.com
e2c9ed766a Automated update
git-svn-id: svn://10.0.0.236/trunk@52393 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:45:17 +00:00
rods%netscape.com
23778b8c16 Check to see if the option being added has the "selected" property, if it
does then the list needs to be reinitialized.
r=dcone, bug #17519


git-svn-id: svn://10.0.0.236/trunk@52392 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:41:17 +00:00
kipp%netscape.com
bac454b0b5 Added address information to the dump content diagnostic code
git-svn-id: svn://10.0.0.236/trunk@52391 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:38:05 +00:00
kipp%netscape.com
c6c74d8fe2 r=ftang (someday); fixed bug 17130 - the problem was that nbsp's were being mapped into spaces by the text-transformer which is normally good, but for the purposes of line-breaking look-ahead was bad. I added code to revert the post-transformed spaces into nbsp's before using the line-breaker
git-svn-id: svn://10.0.0.236/trunk@52390 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:36:02 +00:00
kipp%netscape.com
283a28a5d4 r=ftang (someday); fixed 17559 regression - there were a few cases where characters > 127 were leaking out without setting the mHasMultibyte flag that were triggering painting bugs on macs...
git-svn-id: svn://10.0.0.236/trunk@52389 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:32:37 +00:00
cls%seawood.org
9981b6e5e7 Tested various build options, marked some broken, unmarked others that have been fixed. Removed obsolete options.
git-svn-id: svn://10.0.0.236/trunk@52388 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:32:02 +00:00
kipp%netscape.com
2cabf1bf40 Disabled debug noise I accidently checked in (whoops!)
git-svn-id: svn://10.0.0.236/trunk@52387 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:31:04 +00:00
cls%seawood.org
aabaf48158 Remove the extra -D_XXX_SOURCE_ flags for Linux builds.
git-svn-id: svn://10.0.0.236/trunk@52386 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:29:31 +00:00
kipp%netscape.com
63ae90acca r=troy; reworked the way that blocks inside of inline elements are handled. It's all in the frame construction code now (bugs 15999, 16737)
git-svn-id: svn://10.0.0.236/trunk@52385 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:24:57 +00:00
kipp%netscape.com
333bf3d48a Added address information to the dump content diagnostic code
git-svn-id: svn://10.0.0.236/trunk@52384 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:23:06 +00:00
kipp%netscape.com
e5672a7cbf Added another frame property
git-svn-id: svn://10.0.0.236/trunk@52383 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:22:25 +00:00
jfrancis%netscape.com
8ad4c60be3 fix for bugs: 16724, 16855; r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52382 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:15:56 +00:00
jfrancis%netscape.com
53c8075ee8 fixes for bugs: 16361,12253,15696,15734; r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52381 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 15:15:35 +00:00
dp%netscape.com
a1cbbe03aa Removing double check for failure. Checking for nsresult is sufficient.
git-svn-id: svn://10.0.0.236/trunk@52380 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 08:54:06 +00:00
tbogard%aol.net
188cbf9d0b Added some checks to verify calling of the nsIDocShellFile and nsIDocShellEdit functions.
git-svn-id: svn://10.0.0.236/trunk@52379 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 07:53:24 +00:00
tbogard%aol.net
1b8869ef46 Changed NS_ENSURE to be NS_ENSURE_TRUE.
git-svn-id: svn://10.0.0.236/trunk@52378 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 07:45:38 +00:00
tbogard%aol.net
e1325fa173 Changed NS_ENSURE and NS_ENSURE_NOT occurences to be NS_ENSURE_TRUE and NS_ENSURE_FALSE respectively.
git-svn-id: svn://10.0.0.236/trunk@52377 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 07:40:19 +00:00
tbogard%aol.net
e3a1567dcc Changed NS_ENSURE to be NS_ENSURE_TRUE. Also changed NS_ENSURE_NOT to be NS_ENSURE_FALSE. Left NS_ENSURE and NS_ENSURE_NOT, but they will soon be going away.
git-svn-id: svn://10.0.0.236/trunk@52376 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 06:59:16 +00:00
rpotts%netscape.com
6a0e6b0b2d bug #16418 (r=warren,gagan). When redirecting a URL only copy the Ref to the new URL (not the Param and Query).
git-svn-id: svn://10.0.0.236/trunk@52375 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 06:00:55 +00:00
dougt%netscape.com
908f338b00 Adding a set accessor to the permissions functions. Needed by the xpinstall
folks.


git-svn-id: svn://10.0.0.236/trunk@52374 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 04:44:56 +00:00
tbogard%aol.net
fe0b504eac Added comment around frame stuff to explain lack of ref-counting.
git-svn-id: svn://10.0.0.236/trunk@52373 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 04:03:03 +00:00
tbogard%aol.net
2766610a72 Implemented GetZoom and SetZoom. Removed some left over comment code.
git-svn-id: svn://10.0.0.236/trunk@52372 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 04:02:24 +00:00
troy%netscape.com
5143eb0b1d Added nsIFrameDebug interface
git-svn-id: svn://10.0.0.236/trunk@52371 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 03:34:43 +00:00
bienvenu%netscape.com
0828780018 fix updating of folders after imap/moves r=mscott bug 12491
git-svn-id: svn://10.0.0.236/trunk@52370 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 01:10:08 +00:00
bienvenu%netscape.com
b3ee9d6099 add support for pending counts for imap folders r=mscott
git-svn-id: svn://10.0.0.236/trunk@52369 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 01:06:29 +00:00
mscott%netscape.com
059b0b18ff remove shut down listener stuff.
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@52368 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 00:57:49 +00:00
mscott%netscape.com
c3e35b09e6 remove shutdown listener stuff.
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@52367 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 00:56:19 +00:00
mscott%netscape.com
3c8f842dd1 remove shutdown listener code.
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@52366 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 00:55:06 +00:00
tonyr%fbdesigns.com
f0bafa3901 Added Outlook mail and address book import functionality
git-svn-id: svn://10.0.0.236/trunk@52365 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-01 00:46:18 +00:00
bienvenu%netscape.com
90413c1803 add method to find out if folder is in open window r=putterman
git-svn-id: svn://10.0.0.236/trunk@52364 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 22:21:55 +00:00
tbogard%aol.net
86bf83a5cb Changed NS_IMETHOD to NS_IMETHODIMP on implemented function.
git-svn-id: svn://10.0.0.236/trunk@52363 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 07:38:44 +00:00
beard%netscape.com
46857947de made more robust with partial output.
git-svn-id: svn://10.0.0.236/trunk@52362 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 06:05:09 +00:00
dp%netscape.com
76860bfac3 Removing use of nsIShutdownListener r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52361 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 05:02:55 +00:00
troy%netscape.com
3300906c1f b=15742. Changed Reflow() to invalidate the child's bounds if we're forced
to do a second reflow because we didn't correctly predict whether the vertical
scrollbar was needed. Because the second reflow changes the display width we
need to repaint


git-svn-id: svn://10.0.0.236/trunk@52360 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 04:04:32 +00:00
troy%netscape.com
c53de3fb2f b=17507. Changed Reflow() to use "available height" instead of "computed
height" when reflowing child frames. What was happening was that the child
table frame didn't fit and was trying to split. That should only happen when
we're paginated


git-svn-id: svn://10.0.0.236/trunk@52359 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 03:39:24 +00:00
troy%netscape.com
248afe72e1 b=17573. Changed mRowIndex to be signed integer (was unsigned integer) but
field. This allows it be negative, which some of the table code is depending
on


git-svn-id: svn://10.0.0.236/trunk@52358 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 03:15:52 +00:00
brendan%mozilla.org
9c83cbc655 Gross workaround for VC5 bug.
git-svn-id: svn://10.0.0.236/trunk@52357 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 03:04:02 +00:00
jband%netscape.com
9a6507c902 fix typo that was causing bustage on some compilers
git-svn-id: svn://10.0.0.236/trunk@52356 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 03:02:43 +00:00
dmose%mozilla.org
5c49b2dcfa removing qtfe files from the tip, since qtfe is only ever destined to build on the MozillaClassic branch; approved=arnt@troll.no
git-svn-id: svn://10.0.0.236/trunk@52355 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:29:26 +00:00
beard%netscape.com
fdd0b24390 changed the CID for "component://netscape/gfx/region" to use new NS_SCRIPTABLEREGION_CID. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52354 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:28:32 +00:00
beard%netscape.com
f871d649af switched to NS_IMPL_ISUPPORTS1, no longer supports QI to nsIRegion. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52353 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:26:10 +00:00
beard%netscape.com
8070950a1a removed scriptable region hackery, switched to NS_IMPLE_ISUPPORTS1. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52352 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:26:06 +00:00
beard%netscape.com
2f5831d91f cleaned up factory to use nsCOMPtrs, modern NS_IMPL* macros, support for creating scriptable regions. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52351 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:26:03 +00:00
beard%netscape.com
48e85583a8 added NS_SCRIPTABLE_REGION_CID. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52350 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:25:59 +00:00
tbogard%aol.net
74d906dbdf Fixed changes to use the GetPresShell rather than using the now removed member variable.
git-svn-id: svn://10.0.0.236/trunk@52348 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 02:05:21 +00:00
brendan%mozilla.org
f980be0221 (13163, r=alecf, scc, waterson, others; names available on request)
- Fix most of bug 13163 (see TODO for rest).  This entails adding a version-string argument to nsIScriptContext::EvaluateString and passing it around lots of places in content sinks. 

- Fix leaks and confusion about mSecurityManager and mNameSpaceManager in nsJSEnvironment.cpp.  These still need to move from nsJSContext to nsGlobalWindow or thereabouts, jband and vidur are looking at that. 

- Added comments and expanded tabs in nsJSEnvironment.cpp, esp. to EvaluateString.  Also changed various nsresult vars to be named rv.  Also restored brace/style conformity to nsJSProtocolHandler.cpp. 

- Factored CompileFunction from AddScriptEventListener to pave the way for brutal sharing of compiled JS event handlers via JS_CloneFunctionObject. 

- Lots of nsCOMPtr uses added.  I'm using one for mNameSpaceManager.  Hold mSecurityManager as a service explicitly, on the other hand (awaiting scc's fix to allow comptrs for services), and release in nsJSContext's dtor (fixing a leak).  These two managers should be moved to the window object -- TODO item below. 

- Hold JSRuntimeService along with JSRuntime for live of nsJSEnvironment, fix for shaver. 

- Fix window.setTimeout etc. so the filename and line number of the timeout expr is propagated.  This meant factoring nsJSUtils.cpp code. 

- Fix all content sinks to use the same, and up-to-date JavaScript version parsing (whether for script type or for old language attribute); also fix SplitMimeType clones to strip whitespace. 

- With waterson, fix bug in brutal-sharing version of XUL content sink: script src= should not evaluate the inline content of its tag.


git-svn-id: svn://10.0.0.236/trunk@52347 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:43:30 +00:00
scc%netscape.com
65b7cd0c03 changed the mechanism underlying |do_QueryInterface| to decouple |nsCOMPtr| from services, |nsIWeakReference|, etc. This change fixes bug #17364, and paves the way for making |nsCOMPtr| cooperate with services. r=valeski (additional builds done by dmose and syd)
git-svn-id: svn://10.0.0.236/trunk@52346 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:35:48 +00:00
scc%netscape.com
3872148e22 removed incorrect use of private class name in favor of |do_QueryInterface|, part of the fix for bug #17364, r=valeski (additional builds done by dmose, and syd)
git-svn-id: svn://10.0.0.236/trunk@52345 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:32:15 +00:00
syd%netscape.com
dc0e84da8f Add xpcom.dll to link line so test will link with scc changes make about this time. r=scc
git-svn-id: svn://10.0.0.236/trunk@52344 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:22:53 +00:00
pavlov%netscape.com
e4422a7744 better fix for twips rounding problems patch_from=dbaron@fas.harvard.edu r=me
git-svn-id: svn://10.0.0.236/trunk@52343 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-31 00:09:52 +00:00
sgehani%netscape.com
1a10f1bfca Turning on Mac Install Wizard. [r=ssu]
git-svn-id: svn://10.0.0.236/trunk@52342 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 23:04:41 +00:00
sgehani%netscape.com
42a5d3afe8 *** NOT PART OF BUILD ***
Added "About..." box.


git-svn-id: svn://10.0.0.236/trunk@52341 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:29:26 +00:00
sgehani%netscape.com
2eefd82de8 Changes to accomodate ASEncoder for bug 17096 (new interfaces: GUI and AppleScript to accept folders to decode and encode). [r=dveditz]
git-svn-id: svn://10.0.0.236/trunk@52340 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:24:09 +00:00
sgehani%netscape.com
c148d9293b First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52339 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:21:38 +00:00
sgehani%netscape.com
1d98e513a5 *** NOT PART OF BUILD ***
Fixes for bug 17096. New interfaces (GUI and AppleScript) that accept folders to encode and decode.


git-svn-id: svn://10.0.0.236/trunk@52338 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:21:28 +00:00
sgehani%netscape.com
9318031900 Fixing static targets to be usable by MIW once again: removed new nsJARInputStream from the static targets. For real this time...
git-svn-id: svn://10.0.0.236/trunk@52337 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:18:31 +00:00
sgehani%netscape.com
66089af9ca Backed out change temporarily.
git-svn-id: svn://10.0.0.236/trunk@52336 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 22:03:46 +00:00
sgehani%netscape.com
43165f999b Fixing static targets to be usable by MIW once again: removed new nsJARInputStream from the statis targets.
git-svn-id: svn://10.0.0.236/trunk@52335 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 21:56:51 +00:00
beard%netscape.com
95ab15987f MLK: fix device context leak, bug=15380, r=scc
git-svn-id: svn://10.0.0.236/trunk@52334 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 20:18:31 +00:00
beard%netscape.com
7eff69da6d MLK: fixed nsICSSDeclaration leak, bug=15380, r=kipp
git-svn-id: svn://10.0.0.236/trunk@52333 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 20:17:40 +00:00
dp%netscape.com
ab8b41ac6e Fixing viewer starup assert on SetMainThread() happening twice.
git-svn-id: svn://10.0.0.236/trunk@52332 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 17:17:12 +00:00
troy%netscape.com
bf93831e8b Removed call to SetMainThread() because it was triggering an assert. Turns
out NS_InitXPCOM() does it so we don't need to do it twice


git-svn-id: svn://10.0.0.236/trunk@52331 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:44:04 +00:00
buster%netscape.com
33e56d70f4 huge performance work for text controls
we now display the content of a single line text control using a child pseudo frame
until the text control first gets focus.  at that time, a webshell and editor are created on the fly.
fixed bug bug 14727
r=rods


git-svn-id: svn://10.0.0.236/trunk@52330 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:33:00 +00:00
buster%netscape.com
12d91fc204 added pseudo style for single line text controls
bug 14727
r=rods


git-svn-id: svn://10.0.0.236/trunk@52329 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:31:11 +00:00
buster%netscape.com
2da450442d added DOM notification up to frame system for text control value changes
part of  bug 14727
r=rods


git-svn-id: svn://10.0.0.236/trunk@52328 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:30:33 +00:00
buster%netscape.com
2669825bf4 added pseudo-style for single line text controls. bug 14727
git-svn-id: svn://10.0.0.236/trunk@52327 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:29:32 +00:00
troy%netscape.com
23e130e01b Added nsHTMLReflowState.h
git-svn-id: svn://10.0.0.236/trunk@52326 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 16:16:45 +00:00
alecf%netscape.com
78d06b8fcf make buttons class="push"
only a test, not part of product


git-svn-id: svn://10.0.0.236/trunk@52325 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:39:07 +00:00
alecf%netscape.com
225dbf24eb update debug menu to reflect new DOMViewer location
(debug only not part of product)


git-svn-id: svn://10.0.0.236/trunk@52324 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:38:12 +00:00
alecf%netscape.com
20afa40ad0 fix a warning
r=pavlov


git-svn-id: svn://10.0.0.236/trunk@52323 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:32:23 +00:00
alecf%netscape.com
4eaeb0af68 move DOM viewer into chrome so that DOM security doesn't f us up again
only a test, not part of the product


git-svn-id: svn://10.0.0.236/trunk@52322 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:23:07 +00:00
alecf%netscape.com
4c4a69c07f more tweaks for boehm to catch up with the nsILeakDetector work
git-svn-id: svn://10.0.0.236/trunk@52321 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 07:06:26 +00:00
dp%netscape.com
0b96f92229 Removing shutdown listener. Releasing gCaseConv on XPCOM Shutdown r=kipp
git-svn-id: svn://10.0.0.236/trunk@52320 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 06:45:45 +00:00
beard%netscape.com
015fa0cad4 fixed up -blame option to use line marking.
git-svn-id: svn://10.0.0.236/trunk@52319 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:59:02 +00:00
alecf%netscape.com
1cd1d3967c more adding of class="dialog" to dialogs
git-svn-id: svn://10.0.0.236/trunk@52318 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:55:15 +00:00
beard%netscape.com
2300c27a4f fix nsIInterfaceInfoManager leak. bug=15380, r=jband
git-svn-id: svn://10.0.0.236/trunk@52317 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:48:07 +00:00
alecf%netscape.com
2dd3c4eacc add class="dialog" to mailnews prefs panes
this and last checkin r=rgoodger@ihug.co.nz


git-svn-id: svn://10.0.0.236/trunk@52316 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:46:04 +00:00
alecf%netscape.com
75c3ca9e17 add class="dialog" to all pref window dialogs
enable languages pane and fix XUL
disable smart_browsing pane (because it was crashing)


git-svn-id: svn://10.0.0.236/trunk@52315 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 05:44:23 +00:00
beard%netscape.com
ceb9cf186d changed gInstanceClassName from char[256] to const char* to save space. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52314 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 04:02:54 +00:00
beard%netscape.com
9a3ae339ee changed gInstanceClassName from char[256] to const char* to save space. added NS_IF_RELEASE(mFontMetrics) to destructor to fix memory leak. bug=15380, r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52313 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 04:02:50 +00:00
danm%netscape.com
cd569b141a insert cast necessary on one of the "other" platforms
git-svn-id: svn://10.0.0.236/trunk@52312 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 03:13:55 +00:00
troy%netscape.com
6210745a33 Updated to not export nsIFrameReflow.h
git-svn-id: svn://10.0.0.236/trunk@52311 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:53:36 +00:00
troy%netscape.com
19db355c46 Changed to not export nsIFrameReflow.h
git-svn-id: svn://10.0.0.236/trunk@52310 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:52:43 +00:00
troy%netscape.com
88c4d96e2c Folded reflow functions into nsIFrame and eliminated nsIFrameReflow and
nsIHTMLReflow. This saves 4 bytes per frame and cleans things up


git-svn-id: svn://10.0.0.236/trunk@52309 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:52:11 +00:00
tbogard%aol.net
f5d99c2cec Removed mPresShell and mPresContext from the base class. Added internal getter function GetPresShell to retrieve presShell objects. Added a pointer to mContentViewer. Changed LoadURI* to take a presContext. Changed SetDocument to take a presContext. Changed the attribute presContext to be read only.
git-svn-id: svn://10.0.0.236/trunk@52308 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:30:13 +00:00
akhil.arora%sun.com
4e94fff191 r=akhil.arora@sun.com, fix by Denis Sharypov <sdv@sparc.spb.su>
13271: the wrong method was being called in ProcessingInstructionImpl.cpp
13338: handle null input arguments gracefully without crashing


git-svn-id: svn://10.0.0.236/trunk@52307 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 02:14:28 +00:00
beard%netscape.com
85fd5baad4 moved call to nsIThread::SetMainThread() to NS_InitXPCOM. r=warren
git-svn-id: svn://10.0.0.236/trunk@52306 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:53:03 +00:00
beard%netscape.com
7cf4142599 added call to nsIThread::SetMainThread(), to ensure users of XPCOM get a main thread mapped. r=warren
git-svn-id: svn://10.0.0.236/trunk@52305 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:52:55 +00:00
nisheeth%netscape.com
2d10931ddb Fix for bug 17540. Uncommented the call to nsFrameManager::CantRenderReplacedElement().
git-svn-id: svn://10.0.0.236/trunk@52303 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:31:49 +00:00
beard%netscape.com
15bc1a40b1 Removed statically constructed nsAutoString LinkCommand, moved inside nsWebShell::LoadURL(). This prevents calling printf before main runs on MacOS, which messes up the console window. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52302 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:23:01 +00:00
waterson%netscape.com
89a8c47740 '#if 0' DOM crawling code in toolbar frame to avoid over-eager generation of content model from RDF. GetElementsByTagName() is evil! r=pinkerton,hyatt
git-svn-id: svn://10.0.0.236/trunk@52301 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:21:44 +00:00
beard%netscape.com
20f6524e69 Fix proxied objects leak. r=sfraser, bug=15380
git-svn-id: svn://10.0.0.236/trunk@52300 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 01:17:24 +00:00
tbogard%aol.net
7b140eafb2 Removed zoom now that it has been moved out of the nsIGenericWindow interface.
git-svn-id: svn://10.0.0.236/trunk@52299 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:53:41 +00:00
tbogard%aol.net
069e0c0ab7 Moved zoom attribute from nsIGenericWindow to nsIDocShell. Updated zoom documentation.
git-svn-id: svn://10.0.0.236/trunk@52298 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:52:57 +00:00
hangas%netscape.com
bd127b8712 Fixed OK/Cancel button appearance by using globalOverlay.xul r=mscott
git-svn-id: svn://10.0.0.236/trunk@52297 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:14:52 +00:00
hangas%netscape.com
273c3a1673 Image transparency problem fixed by Andrew Niese.
git-svn-id: svn://10.0.0.236/trunk@52296 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:07:21 +00:00
tbogard%aol.net
945c6841ea Removed mDocument in favor of the preferred way of getting the document from the content viewer.
git-svn-id: svn://10.0.0.236/trunk@52295 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-30 00:02:38 +00:00
tbogard%aol.net
bc6a15f81a Changed a call to QueryInterface to use CallQueryInterface which helps with type checking.
git-svn-id: svn://10.0.0.236/trunk@52294 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:59:20 +00:00
valeski%netscape.com
0e08363c68 warning fixes, again :(
git-svn-id: svn://10.0.0.236/trunk@52293 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:35:06 +00:00
evaughan%netscape.com
1f41bc5a41 Fixed bug in example. -r hyatt
git-svn-id: svn://10.0.0.236/trunk@52292 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:27:26 +00:00
Jerry.Kirk%Nexwarecorp.com
95ed3035d3 Fixing FillPolygon code in nsRenderingPh.cpp
Adding debug code in nsDrawingSurfacePh  to find the crash.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52291 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:18:16 +00:00
Jerry.Kirk%Nexwarecorp.com
7d754fa3e8 Changing mClipSibling to False in preparation to popup change
Pavlov is working on/thinking about... I'm sure he will see it my
way eventually...
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52290 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:16:57 +00:00
mjudge%netscape.com
c750a7c32d reviewed by hyatt bug of someone elses but in my code. dont know number. simple check for null
git-svn-id: svn://10.0.0.236/trunk@52289 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:12:44 +00:00
mjudge%netscape.com
2dee462ae3 i cannot find the bug# it is for selecting inside forms. we need to turn off selection in certain frames based on the style. this sets up it to work once we figure out the style rule to set.
git-svn-id: svn://10.0.0.236/trunk@52288 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:07:07 +00:00
colin%theblakes.com
a3feb440b1 Only define MDCPUCFG if HOST_NSPR_MDCPUCFG is defined. r=cls
git-svn-id: svn://10.0.0.236/trunk@52287 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:03:15 +00:00
rogerl%netscape.com
b817d51d4b I changed the exepcted value for object.toString() calls on the empty
object - There's no clear documentation of the result, but the source
code unambiguously calls 'js_obj_toSource', which inserts the extra '()'
under the version1_2 flag, so I believe this is the correct result.


git-svn-id: svn://10.0.0.236/trunk@52286 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:02:17 +00:00
valeski%netscape.com
2eefe93ceb 17521, r = mscott. FTP authentication dialogs we're looping if canceled. I also changed a bunch of string getter routines to take XPIDLCStrings. there was speculation during the reveiw that there might be some casting problems on other platforms. if this is the case either case the XPIDLCString to (const char *) or call me and I'll do it.
git-svn-id: svn://10.0.0.236/trunk@52285 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 23:00:52 +00:00
edburns%acm.org
31ca3266f1 r=marklin
#17358
approver=edburns
author=edburns

This fix enables webclient to work with the latest mozilla.  For now.


git-svn-id: svn://10.0.0.236/trunk@52284 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:51:06 +00:00
rogerl%netscape.com
b16f4bc0c7 Changed to account for latest ECMA spec on back-references vs. octal
git-svn-id: svn://10.0.0.236/trunk@52283 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:50:43 +00:00
rogerl%netscape.com
fa193f41c1 New ECMA spec for no argument calls to max & min - should return +/- Inf
git-svn-id: svn://10.0.0.236/trunk@52282 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:48:33 +00:00
brendan%mozilla.org
ba803ea225 Add JS_VersionToString and JS_StringToVersion, updated Impl. Version (13163, r=shaver@mozilla.org).
git-svn-id: svn://10.0.0.236/trunk@52281 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:44:35 +00:00
akkana%netscape.com
d167106925 Remove one GDK_question. Trivial one-line fix
git-svn-id: svn://10.0.0.236/trunk@52280 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:37:18 +00:00
cmanske%netscape.com
1095535469 Fixed Composer UI to adjust to latest global CSS changes. Mostly needed to add appropriate class to titled buttons. Change editorshell to stop throbber animation even if editor fails to initialize. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52279 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:33:34 +00:00
jefft%netscape.com
01d415eebe fixed bug 12131 -- message counts not updated after a move/copy; call UpdateFolder() after move/copy is done; r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@52278 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:28:55 +00:00
rogerl%netscape.com
8760c5b5e8 r=norris
Change for ECMA spec. - String.charCodeAt, etc call ToInteger on index.
Ditto - String.match(re) was constructing /undefined/ instead of empty
regexp.


git-svn-id: svn://10.0.0.236/trunk@52277 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:27:33 +00:00
rogerl%netscape.com
853e43bd31 r=norris
Opinion was that Script.exec() should execute in global scope, not caller.


git-svn-id: svn://10.0.0.236/trunk@52276 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:25:25 +00:00
rogerl%netscape.com
dcacacf7d7 r=norris
Fixed accidental eating of exceptions (match loop didn't terminate on
failure). New ECMA definition (again) of back reference format.


git-svn-id: svn://10.0.0.236/trunk@52275 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:23:36 +00:00
rogerl%netscape.com
e8f1c05ca6 r=norris
New ECMA behaviour for max & min.


git-svn-id: svn://10.0.0.236/trunk@52274 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:21:54 +00:00
rogerl%netscape.com
2ed88ba80b r=norris
Upgrading to new ECMA - conversionError subsumed by TypeError.


git-svn-id: svn://10.0.0.236/trunk@52273 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:20:23 +00:00
rogerl%netscape.com
69933e9f74 r=norris, Bug#16984
New error message for function.apply arguments.


git-svn-id: svn://10.0.0.236/trunk@52272 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:19:04 +00:00
rpotts%netscape.com
021f44ae53 Fixed crash during error condition in END_WRITE... (r=warren)
git-svn-id: svn://10.0.0.236/trunk@52271 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:14:52 +00:00
evaughan%netscape.com
0fa061c765 Made tabs us visibility instead of shrinking their children to 0,0.
Made it possible to change the look for the selected tab.


git-svn-id: svn://10.0.0.236/trunk@52270 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:13:57 +00:00
waterson%netscape.com
0d6ebd6b12 Pull script object and event listener list out of slots and into delegate to avoid faulting a heavyweight element. Fix EnsureSlots() to _not_ do a bunch of extra work that is already being done when we create an element from its prototype. Use nsCOMPtr's in nsXULAttributes to avoid leak of nsIStyleRule. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52269 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 22:09:20 +00:00
varada%netscape.com
b1f24224b8 fix for bug #14012 viewfile function to open the files and open url to open html
git-svn-id: svn://10.0.0.236/trunk@52268 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:57:00 +00:00
rchen%netscape.com
604931010d Add Localization Notes
git-svn-id: svn://10.0.0.236/trunk@52267 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:53:20 +00:00
mscott%netscape.com
29d7ee003b first created.
git-svn-id: svn://10.0.0.236/trunk@52266 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:49:19 +00:00
mscott%netscape.com
6ad3ce8ee3 Moving URI dispatching code into its new home in mozilla\uriloader. I'll be removing
the existing files that I put in netwerk very soon.


git-svn-id: svn://10.0.0.236/trunk@52265 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:46:18 +00:00
rchen%netscape.com
6be0ffb4ca Add localization notes
git-svn-id: svn://10.0.0.236/trunk@52264 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:40:07 +00:00
rchen%netscape.com
89f810c614 Add Localization Notes
git-svn-id: svn://10.0.0.236/trunk@52263 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:37:43 +00:00
bienvenu%netscape.com
fa7e1e0f1e fix body filters, r=sspitzer 17058
git-svn-id: svn://10.0.0.236/trunk@52262 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:33:44 +00:00
rchen%netscape.com
beb892e3f0 Add Localization notes
git-svn-id: svn://10.0.0.236/trunk@52261 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:27:41 +00:00
rogerl%netscape.com
338c55ea1d New, spawned from AIX4.2.mk.
git-svn-id: svn://10.0.0.236/trunk@52260 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:14:31 +00:00
rchen%netscape.com
394244ab39 Add Localization notes
git-svn-id: svn://10.0.0.236/trunk@52259 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:12:26 +00:00
alecf%netscape.com
ea62024583 fix a broken class= r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52258 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:11:06 +00:00
alecf%netscape.com
ee5415192d add class="dialog push" to the profile wizard UI r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52257 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:10:53 +00:00
alecf%netscape.com
928787debd add class="dialog push" to all pref windows r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52256 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 21:01:41 +00:00
rchen%netscape.com
e6e52fc833 Add localization notes
git-svn-id: svn://10.0.0.236/trunk@52255 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:58:42 +00:00
rchen%netscape.com
280221ed46 Add Localization notes
git-svn-id: svn://10.0.0.236/trunk@52254 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:52:42 +00:00
alecf%netscape.com
52ddc97b98 fix titledbutton class to "dialog push"
r=shaver


git-svn-id: svn://10.0.0.236/trunk@52253 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:51:41 +00:00
valeski%netscape.com
7559ac64c5 15590 - build warnings prompted some variable name changes. Also replaced nsVoidArray usage w/ nsCStringArrays. Added some null checks. converted some raw ptrs to com ptrs.
16968 - bugzilla wasn't progress through bug lists via "next" "prev" links. we now set cookie headers from within x-multi-mixed-replace data.


git-svn-id: svn://10.0.0.236/trunk@52252 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:50:06 +00:00
karnaze%netscape.com
7868fc24c7 new regression test
git-svn-id: svn://10.0.0.236/trunk@52251 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:47:33 +00:00
valeski%netscape.com
85c426971e 15590, r=kipp. added a nsCStringArray class so the cool string array functionality could be used for CStrings too. this checkin is *part* of a fix to the bug
git-svn-id: svn://10.0.0.236/trunk@52250 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:47:17 +00:00
putterman%netscape.com
9c5e4137a1 Fix for 17556. Reviewed by alecf. Newsgroups show abbreviated name in folder pane.
git-svn-id: svn://10.0.0.236/trunk@52249 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:46:15 +00:00
cata%netscape.com
324e2f56a7 Fix for bug #17018, r=cata, checkin for momoi.
git-svn-id: svn://10.0.0.236/trunk@52248 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:41:21 +00:00
despotdaemon%netscape.com
e9ccfad854 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@52247 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:41:01 +00:00
cata%netscape.com
eb0df2c879 Fix for bug #16186 build warnings; eliminating unused var.
git-svn-id: svn://10.0.0.236/trunk@52246 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:32:00 +00:00
cata%netscape.com
b855e5dd72 Fix for bug #15706; r=nhotta
git-svn-id: svn://10.0.0.236/trunk@52245 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:29:40 +00:00
rchen%netscape.com
bca34cf5da Add Localization Notes
git-svn-id: svn://10.0.0.236/trunk@52244 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:28:18 +00:00
karnaze%netscape.com
b2c6378cf2 bug 17375 - better checks and casting before calling DidAppendRow
git-svn-id: svn://10.0.0.236/trunk@52243 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:25:13 +00:00
rchen%netscape.com
a74e27b3f5 Add localization notes
git-svn-id: svn://10.0.0.236/trunk@52242 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 20:24:48 +00:00
harishd%netscape.com
bb63ac5e3f Fix fof bug 15674 - Putting back char* buffer.
r=akkana


git-svn-id: svn://10.0.0.236/trunk@52241 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:59:09 +00:00
akkana%netscape.com
1645b0ed7a Only output the xif.xif debug file if DEBUG_XIF is defined. Requested by sfraser
git-svn-id: svn://10.0.0.236/trunk@52240 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:36:30 +00:00
akkana%netscape.com
e367bbd2be 17305: Add ? to the list of fakie-shifted keycodes. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52239 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:33:57 +00:00
morse%netscape.com
e3e9faf88f fix bug 14932, mozilla asserts if client-wallet is disabled, r=neeti
git-svn-id: svn://10.0.0.236/trunk@52238 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:31:30 +00:00
jefft%netscape.com
5b125a705f partial fix for bug 17034; decode encoded words prior setting to the composition fields; r=nhotta,rhp
git-svn-id: svn://10.0.0.236/trunk@52237 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:23:29 +00:00
slamm%netscape.com
3b0382f6c1 Use tb_find_build_record() instead of find_build_record().
git-svn-id: svn://10.0.0.236/trunk@52236 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:20:53 +00:00
slamm%netscape.com
3fd6cb1d50 Fix 17347. Initialize the 'View | Sidebar' menu to the correct state. r=mozbot.
git-svn-id: svn://10.0.0.236/trunk@52235 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:17:22 +00:00
slamm%netscape.com
45e93dc267 Get min heights correct so that the sidebar will collapse. r=evaughan.
git-svn-id: svn://10.0.0.236/trunk@52234 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:16:38 +00:00
slamm%netscape.com
8769efefd3 Add license.
git-svn-id: svn://10.0.0.236/trunk@52233 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:13:42 +00:00
vidur%netscape.com
a595e9b30a Fix for double frame creation for scripts that document.write content that causes sink context creation. Fix that allows the last children of a body to be flushed. R=harishd
git-svn-id: svn://10.0.0.236/trunk@52232 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:07:24 +00:00
slamm%netscape.com
0e1f052c66 Spit and polish. Take 2. Do not put 'undef' in 'my' list.
git-svn-id: svn://10.0.0.236/trunk@52231 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 19:01:14 +00:00
slamm%netscape.com
4c48633d37 Somethings not working. Backup
git-svn-id: svn://10.0.0.236/trunk@52230 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:54:32 +00:00
pnunn%netscape.com
66c14dd8b7 part of fix for bug#15817. r: akkana. strong suggestion by kipp. Do the right
thing in image container destructor.


git-svn-id: svn://10.0.0.236/trunk@52229 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:53:03 +00:00
slamm%netscape.com
731c45ad0c Clean up global names. Spit and polish. Fix '-w' warnings.
git-svn-id: svn://10.0.0.236/trunk@52228 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:52:04 +00:00
pnunn%netscape.com
f742f7e4fd fix for bug#17076. r: akkana. Puts data stream mime check before component
loading instead of after a component load failure.


git-svn-id: svn://10.0.0.236/trunk@52227 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:51:09 +00:00
ducarroz%netscape.com
e83ba4c213 Fix for bug 17493, We need to cleanup any GCI commands from the URI when generating a file name. R=rhp
git-svn-id: svn://10.0.0.236/trunk@52226 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:50:05 +00:00
warren%netscape.com
dfe868a09a Fixed round-off error computing bloat total.
git-svn-id: svn://10.0.0.236/trunk@52225 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:48:37 +00:00
varada%netscape.com
3e9b7b7fb2 fix for bug #17459 by adding another depend function onnext
git-svn-id: svn://10.0.0.236/trunk@52224 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:36:52 +00:00
varada%netscape.com
4f3ab7cb05 fix for bug #17459 as well as some clean up
git-svn-id: svn://10.0.0.236/trunk@52223 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:35:58 +00:00
sspitzer%netscape.com
db726a6afc fix for #17555. get all the default files, including panels.rdf
git-svn-id: svn://10.0.0.236/trunk@52222 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:29:07 +00:00
buster%netscape.com
3fe2b88255 more implementation
some nits to conform more to seamonkey coding conventions.


git-svn-id: svn://10.0.0.236/trunk@52221 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:25:57 +00:00
warren%netscape.com
7e5a7e1258 Fixed parsing of bloat log when value was nan, or class contained ::.
git-svn-id: svn://10.0.0.236/trunk@52220 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 18:05:09 +00:00
warren%netscape.com
a237edb9e7 Made the leak/bloat baseline only be the min over the last 5 entries.
git-svn-id: svn://10.0.0.236/trunk@52219 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 17:19:54 +00:00
kipp%netscape.com
363a93452d Fixed solaris build bustage
git-svn-id: svn://10.0.0.236/trunk@52218 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 15:20:20 +00:00
troy%netscape.com
de2a95b57c Space reduction. We now save 8 bytes per row frame by eliminating the max
top/bottom margin data members which are no longer needed


git-svn-id: svn://10.0.0.236/trunk@52217 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:40:58 +00:00
kipp%netscape.com
aaabce0894 r=troy; bugs 12958 and 12760; reworked the way that first-letter frames are created and updated. We now support incremental content changes even when first-letter style applies.
git-svn-id: svn://10.0.0.236/trunk@52216 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:39:48 +00:00
kipp%netscape.com
96da767847 r=troy; fixed a crash bug in the debug logic found while fixing 12958
git-svn-id: svn://10.0.0.236/trunk@52215 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:36:00 +00:00
kipp%netscape.com
5f8b23824a r=troy; api changes for 12958, 12760 and preperations for 17377
git-svn-id: svn://10.0.0.236/trunk@52214 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:35:36 +00:00
kipp%netscape.com
f35516791b r=troy; cleaned up resize reflow optimization logic and prepared it for fixing bug #17737 (not yet fixed!)
git-svn-id: svn://10.0.0.236/trunk@52213 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:34:53 +00:00
kipp%netscape.com
5a0f716ef3 r=troy; fixed letter frame logic to use the line layout to flow frames so that white-space trimming, for example, would work right
git-svn-id: svn://10.0.0.236/trunk@52212 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:34:01 +00:00
kipp%netscape.com
b3ecfed51c r=troy; updated api slightly to support fixes to bug 12760, 12958 and some resize-reflow optimization bugs
git-svn-id: svn://10.0.0.236/trunk@52211 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:33:26 +00:00
kipp%netscape.com
a2f8cba30c r=troy; use new line-layout api to help with some resize-reflow optimization bugs
git-svn-id: svn://10.0.0.236/trunk@52210 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 14:32:11 +00:00
rods%netscape.com
c01e8f06c0 Allows radiobuttons to remove themselves from the named radio group
when deleted factored the code
r=kmcclusk, bug 17418


git-svn-id: svn://10.0.0.236/trunk@52209 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 13:56:30 +00:00
rods%netscape.com
24bb2c855d removes itself from the radio group when it is destructed
r=kmcclusk, bug 17418


git-svn-id: svn://10.0.0.236/trunk@52208 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 13:54:58 +00:00
rods%netscape.com
38a193d9b4 clears the the checked item on removal
r=kmcclusk,bug 17418


git-svn-id: svn://10.0.0.236/trunk@52207 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 13:53:50 +00:00
kin%netscape.com
5fae6982e3 Fix for bug #16176: [DOGFOOD] need to annotate line frames with whitespace trim
layout/base/src/nsCaret.cpp
        - Modified DrawCaretWithContext so that we only
          adjust the caret position if we are within the
          frame's bounds.

    layout/html/base/src/nsTextFrame.cpp
        - Modified GetPointFromOffset() to add the width
          of a space if the offset is after a trailing space
          and it was trimmed off the frame.

r=sfraser@netscape.com


git-svn-id: svn://10.0.0.236/trunk@52206 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 13:43:11 +00:00
Jerry.Kirk%Nexwarecorp.com
e08673c042 Fixes for drawing the new Chrome. Had to explicitly call PgFlush
to flush the draw stream from the memory context into the off screen
buffer. I think this is a bug in Photon, but for now this is the fix.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52205 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 12:53:58 +00:00
pavlov%netscape.com
f24c85975a remove some tabs and add a check for null (bug 17252) r=syd
git-svn-id: svn://10.0.0.236/trunk@52204 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 09:03:53 +00:00
pavlov%netscape.com
385f05a7b1 fix for bugs 17234,17416 r=tor,bruce
git-svn-id: svn://10.0.0.236/trunk@52203 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 08:36:47 +00:00
pavlov%netscape.com
594fc96d9f fix for 15942 and some performance tests/code r=syd
git-svn-id: svn://10.0.0.236/trunk@52202 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 08:24:09 +00:00
danm%netscape.com
8dd72754a2 treat the return key, like enter, as if the default dialog button had been pressed. part of fix for bug 17529. r:saari@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52201 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 06:17:07 +00:00
danm%netscape.com
12fd34f1ce dialog now uses okCancelButtons overlay. partial fix for bug 17529 r:hangas@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52200 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 06:12:26 +00:00
cmanske%netscape.com
d779af105f Changed hover style for FormatToolbar for consistency with new UI
git-svn-id: svn://10.0.0.236/trunk@52199 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 06:04:48 +00:00
beard%netscape.com
73ee8b0ee5 added transitive closure size computation.
git-svn-id: svn://10.0.0.236/trunk@52198 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 06:04:01 +00:00
jband%netscape.com
d8b2fc8146 r=shaver@mozilla.org
- Fix for bug 13419 - xpconnect calls wrapped JS objects on wrong JSContext.
Added code to use the nsThreadJSContextStack in order to call wrapped
JS object on the JSContext that is current for the running thread.

We've made the rule that xpconnect only supports one JSRuntime. We
partially enforce that here by enforcing that the JSContext on which
we will run code hails from the same JSRuntime as the JSContext on
which the wrapper for the JS code was built.

Because it is perfectly legal for the nsThreadJSContextStack to be empty
if a wrapped JS object is being called from code other than a DOM event,
this system will lazily create a JSContext for the current thread and
maintain it in TLS. This JSContext is used as necessary. If it uses such
a JSContext that was not already on the nsThreadJSContextStack then the
system will temporarily push that JSContext onto the nsThreadJSContextStack
during the course of the function call being performed. This is all managed
my a new auto class: AutoPushCompatibleJSContext. This is used in the two
places where wrapped JS code is called from native code.

[the two places where this system is invoked are currently disabled due to
the fact that the DOM code makes bad assumptions about the JSContext on
which DOM objects can be accessed. We are working to fix that and then this
code will be enabled.]

- Add #ifdef XPC_DETECT_LEADING_UPPERCASE_ACCESS_ERRORS code that will help
users when we do things like fix bug 14460. As soon as we make more of the
idl declarations of methods leadingLowercase then we will have
LeadingUppercase calls from JS breaking at runtime. It is expected that this
will especially be a problem for coders working with the same interfaces
from both C++ and JS (since from C++ an interface has LeadingUpper methods and
the *same* interface seen from JS has leadingLowecase names). This code
(as suggested by shaver) will print out an informative error message when
it detects the misuse. This is currently enabled for DEBUG builds only.

- Copy code from xpcshell to TestXPC to use the JSRuntimeSerivce.

r=norris@netscape.com
- Check to see if a wrapped JS object has a QueryInterface property before
trying to call that method. This is a speed optimization. It also and makes
norris happy because his perrenial breakpoint in jsReportErrorNumber is not
getting hit (even though the old code was safe).


git-svn-id: svn://10.0.0.236/trunk@52197 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 05:42:41 +00:00
mcafee%netscape.com
b3a2df9860 Updating legend to match new output format.
git-svn-id: svn://10.0.0.236/trunk@52196 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 05:02:00 +00:00
troy%netscape.com
58248e0de3 Fix for bug #16649. Didn't actually change anything. Just restored some
code that was clobbered by revision 3.153


git-svn-id: svn://10.0.0.236/trunk@52195 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:57:02 +00:00
morse%netscape.com
4f5d2bc5d5 get ready for integration with http/ftp authentication, r=davidm
git-svn-id: svn://10.0.0.236/trunk@52194 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:51:27 +00:00
sspitzer%netscape.com
1bb663bbef fix for #8717. performance is good enough to bump this back to 500.
still more work to be done, as this is a per-server pref now, I think.


git-svn-id: svn://10.0.0.236/trunk@52193 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:49:41 +00:00
mcafee%netscape.com
dbd1674956 No spaces so units don't go on next line.
git-svn-id: svn://10.0.0.236/trunk@52192 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:45:52 +00:00
sspitzer%netscape.com
e36c5874dc fix it so that if you have something selected, and you hit enter, it starts with that profile.
git-svn-id: svn://10.0.0.236/trunk@52191 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:40:20 +00:00
bienvenu%netscape.com
9187011a29 changes to use nsIMsgWindow r=putterman
git-svn-id: svn://10.0.0.236/trunk@52190 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:39:06 +00:00
mcafee%netscape.com
d977243f6d oops left out b units
git-svn-id: svn://10.0.0.236/trunk@52189 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:36:17 +00:00
mcafee%netscape.com
d2807b6f90 Better units, r=brendan
git-svn-id: svn://10.0.0.236/trunk@52188 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:30:56 +00:00
morse%netscape.com
6bc4bb23b5 provide compatibility with single signon, r=davidm
git-svn-id: svn://10.0.0.236/trunk@52187 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:30:38 +00:00
cmanske%netscape.com
55b30027eb Reduced size of Named Anchor proxy icon used in editor page to minimize layout disturbance when present. Changed colors.
git-svn-id: svn://10.0.0.236/trunk@52186 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:23:36 +00:00
sspitzer%netscape.com
3441bfea68 fix for #16231, r=mscott. make the file locator know about panels.rdf.
if <profile>/panels.rdf doesn't exist, copy the default to that location.


git-svn-id: svn://10.0.0.236/trunk@52185 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:02:25 +00:00
sspitzer%netscape.com
61aed8f307 fix for #16231, r=mscott. use the file locator (which caches the profile directory) instead of going through the profile service.
git-svn-id: svn://10.0.0.236/trunk@52184 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:02:20 +00:00
sspitzer%netscape.com
fc22d0aa61 remove the GetCurrentProfileDirFromJS() method from the nsIProfile interface. the only one using it was the sidebar js, but now that uses the fileLocator. r=mscott.
git-svn-id: svn://10.0.0.236/trunk@52183 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 04:01:22 +00:00
rginda%ndcico.com
0da4aac936 ** NOT PART OF THE SEAMONKEY DEFAULT BUILD **
* xul/tests/index.html
Content update.

* xul/tests/test3-output-loud.css
Added ugly style.

* Makefile.in, makefile.win
Updated to install new style.


git-svn-id: svn://10.0.0.236/trunk@52182 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:33:01 +00:00
warren%netscape.com
74b069723b Moved purify stuff into xpcom/base for the benefit of all.
git-svn-id: svn://10.0.0.236/trunk@52181 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:28:22 +00:00
warren%netscape.com
1fae170c08 Adding pure.h pure_api.c to the build. bug#16695
git-svn-id: svn://10.0.0.236/trunk@52180 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:26:50 +00:00
warren%netscape.com
3e59dc9845 Took out bogus error message.
git-svn-id: svn://10.0.0.236/trunk@52179 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:19:11 +00:00
waterson%netscape.com
4c9f59d49c Fix SizeOf() operation.
git-svn-id: svn://10.0.0.236/trunk@52178 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 03:07:38 +00:00
cmanske%netscape.com
941b2da9d7 Style adjustment for Composer DisplayMode toolbar
git-svn-id: svn://10.0.0.236/trunk@52177 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:58:37 +00:00
cmanske%netscape.com
f320760ce4 Color adjustment for Composer DisplayMode toolbar
git-svn-id: svn://10.0.0.236/trunk@52176 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:47:47 +00:00
warren%netscape.com
d4cac369ff Printed out TOTAL line for showbuilds.cgi
git-svn-id: svn://10.0.0.236/trunk@52175 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:39:10 +00:00
cathleen%netscape.com
7754b4e90e update unix packaging list for missing chrome and res files (editor, xpinstall... )
git-svn-id: svn://10.0.0.236/trunk@52174 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:37:27 +00:00
cmanske%netscape.com
aa538bb21b Added 'Throbber' to Composer - more UI adjustments for new skin. Tweaked new toolbar images. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52173 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:33:51 +00:00
kipp%netscape.com
877bf64923 Implement the LIBMALLOC_NOFREE flag; add in support for memory fill count which increases the malloc by N and fills it with a pattern to help detect overruns and random memory corruptions
git-svn-id: svn://10.0.0.236/trunk@52172 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:19:25 +00:00
kipp%netscape.com
71e57e9bc0 Disabled some of my own debugging noise
git-svn-id: svn://10.0.0.236/trunk@52171 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:17:55 +00:00
rhp%netscape.com
aa26800137 Fix for message display - Bug #17481 - r: jefft
git-svn-id: svn://10.0.0.236/trunk@52170 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:17:10 +00:00
ssu%netscape.com
a9a91fcc7c fixing bugs #16935 and #11581. r=dvedtiz.
The first fix reverses the way xpinstall aborts/cleans up itself.  The
correct way is to undo the commands it ran in backwards order.

The second fixes problem with a install.js script not having called
finalizeInstall() yet still installing files.


git-svn-id: svn://10.0.0.236/trunk@52169 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:15:56 +00:00
kipp%netscape.com
87ff88fc08 nuked another silly warning because I got tired of seeing it
git-svn-id: svn://10.0.0.236/trunk@52168 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:06:33 +00:00
kipp%netscape.com
f748008a0b I added logic to the viewers browser window to disable javascript initiated popups during web crawling; I also fixed the web crawler to only initiate a new load after a previous document ends not a subdocument (again!)
git-svn-id: svn://10.0.0.236/trunk@52167 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:06:09 +00:00
kipp%netscape.com
20e3748d92 I added logic to the viewers browser window to disable javascript initiated popups during web crawling
git-svn-id: svn://10.0.0.236/trunk@52166 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 02:05:16 +00:00
gagan%netscape.com
213f166414 Fixed bug 17393. We were firing an OnStopRequest for redirect's response completion. That messes up imagelib which starts to reset/abort streams. r=waterson
git-svn-id: svn://10.0.0.236/trunk@52165 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:55:58 +00:00
kipp%netscape.com
0f8e430077 r=troy; fixed code to properly remove reflowc ommands when cancelling
git-svn-id: svn://10.0.0.236/trunk@52164 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:53:56 +00:00
wtc%netscape.com
407de78336 Need to set the reuseaddr socket option before PR_Bind, now that
PR_Bind no longer sets that option automatically (see Bugzilla #17184).


git-svn-id: svn://10.0.0.236/trunk@52163 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:41:34 +00:00
wtc%netscape.com
4adfa873d2 Bugzilla bug #15858: fixed compiler warnings.
git-svn-id: svn://10.0.0.236/trunk@52162 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:33:54 +00:00
jj%netscape.com
0410c9f36b added [xpiengine] module and rename 'ChromeRegistry' to 'ChomeRegistry' to be consistent with this typo across the tree.
git-svn-id: svn://10.0.0.236/trunk@52161 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:25:51 +00:00
waterson%netscape.com
6d0e00cdd4 Bug 15146. Brutal content model sharing, Phase II. XUL content sink now constructs prototype documents; 'real' content model constructed from walking prototype. Landed XUL_SHARING_19991027_BRANCH (derived from XUL_SHARING_19991022_BRANCH). See branch comments for details. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@52160 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:21:15 +00:00
mcafee%netscape.com
19573259fb typo, r=slamm
git-svn-id: svn://10.0.0.236/trunk@52159 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:21:06 +00:00
waterson%netscape.com
5a02e1350c Bug 15146. Remove usage of nsIXUL[Child|Parent]Document, nsIXULDocumentInfo. Now obsolete with brutal sharing. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@52158 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:19:20 +00:00
dougt%netscape.com
72ec0f3079 adding license.
git-svn-id: svn://10.0.0.236/trunk@52157 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 01:10:00 +00:00
kipp%netscape.com
e8cc21c4c3 New tests (not part of any build)
git-svn-id: svn://10.0.0.236/trunk@52156 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:59:41 +00:00
warren%netscape.com
e6e16569fb Added 1k fudge factor.
git-svn-id: svn://10.0.0.236/trunk@52155 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:40:04 +00:00
sspitzer%netscape.com
695d6778d8 don't specify the height and width, let it size to content. otherwise, the buttons on the bottom don't show up.
git-svn-id: svn://10.0.0.236/trunk@52154 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:26:43 +00:00
mccabe%netscape.com
5124ea8599 adding comments
git-svn-id: svn://10.0.0.236/trunk@52153 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:26:19 +00:00
sspitzer%netscape.com
e8194ccfb1 cleaning up comments
git-svn-id: svn://10.0.0.236/trunk@52152 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-29 00:09:27 +00:00
mcafee%netscape.com
af1c129e99 Reverted to mozilla.org url because of problems with loading resource:
git-svn-id: svn://10.0.0.236/trunk@52151 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:32:13 +00:00
nhotta%netscape.com
978eb5faf1 Adding entity property files to packages, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@52150 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:31:30 +00:00
putterman%netscape.com
2df3525f9d More work on 17376. reviewed by bienvenu. Store open folder and keep array of msgWindows.
git-svn-id: svn://10.0.0.236/trunk@52149 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:27:21 +00:00
harishd%netscape.com
3d1723b618 Fix for bugs
1312   - Mapped all  HTML 4.0x FPIs to NOQUIRKS mode.
2749   - Tweaked strict comment handling code. -> r=rickg
17148 - Making sure that BeginContext() is ended only by EndContext()
17113, 1262 - Made AddLeaf(), in DTD,  to be cautious in handling text tokens.

Using bit-wise search  for IsContainer() instead of looping. ( nsElementTable )

Fixed warnings.

r=pollmann


git-svn-id: svn://10.0.0.236/trunk@52148 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:25:59 +00:00
mcafee%netscape.com
a6b5e55d70 Fixed extra my's that break in some versions of perl
git-svn-id: svn://10.0.0.236/trunk@52147 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:24:39 +00:00
sspitzer%netscape.com
a19b0a701f only show profiles that haven't been migrated in the Profile Selection dialog.
git-svn-id: svn://10.0.0.236/trunk@52146 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:24:05 +00:00
sspitzer%netscape.com
139ca8b52d adding "Mozilla Select Profile" (aka -SelectProfile) for the mac.
git-svn-id: svn://10.0.0.236/trunk@52145 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:19:02 +00:00
mcafee%netscape.com
14b918a812 Adding bloat formatting, baseline mechanism. warren/mcafee
git-svn-id: svn://10.0.0.236/trunk@52144 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:18:50 +00:00
sspitzer%netscape.com
9b563bc4a7 adding -SelectProfile for the mac.
git-svn-id: svn://10.0.0.236/trunk@52143 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:17:44 +00:00
sspitzer%netscape.com
761883462c checking in ben goodger's (rgoodger@ihug.co.nz) profile selection UI.
r=sspitzer

I made changes so that:

1)  exit quits the app, and doesn't start up app with the last current profile
2)  fix a spelling error (personalisation -> personalization), this is en-US, not en-UK
3)  fix it so start actually starts the selected profile.
4)  -SelectProfile launches this new dialog
5)  if the user starts with no command line, and they have more than one profile, they get -SelectProfile, and not -installer.


git-svn-id: svn://10.0.0.236/trunk@52142 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:08:46 +00:00
mcafee%netscape.com
cb42bc5347 switching to static pages.
git-svn-id: svn://10.0.0.236/trunk@52141 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:02:49 +00:00
mcafee%netscape.com
5d276fc49d fixing log rename problem. code=warren
git-svn-id: svn://10.0.0.236/trunk@52140 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 23:02:10 +00:00
sspitzer%netscape.com
39084ddb75 add support for SelectProfile
git-svn-id: svn://10.0.0.236/trunk@52139 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:56:00 +00:00
ftang%netscape.com
725ca86a3c fix bustage.
git-svn-id: svn://10.0.0.236/trunk@52138 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:38:58 +00:00
warren%netscape.com
25f7059c43 Fixed the fact that all pdb files get called default.pdb (which made it hard to debug when there was more than one test file in a directory). r=cyeh
git-svn-id: svn://10.0.0.236/trunk@52137 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:36:22 +00:00
rbs%maths.uq.edu.au
cdfb86c649 Catching up with recent changes of the nsIFrame API
git-svn-id: svn://10.0.0.236/trunk@52136 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:30:28 +00:00
waterson%netscape.com
ed6d691c92 Remove unused references to nsIXULChildDocument and nsIXULParentDocument.
git-svn-id: svn://10.0.0.236/trunk@52135 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:18:21 +00:00
pepper%netscape.com
856f1ee86f Added a newline to the end of file so that AIX and HP compilers are happy.
r=mgleeson


git-svn-id: svn://10.0.0.236/trunk@52134 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:17:43 +00:00
rbs%maths.uq.edu.au
4ea4c2ba26 Adding Dave Fiddes' patch for a MOZ_MATHML CFLAGS
git-svn-id: svn://10.0.0.236/trunk@52133 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:17:13 +00:00
waterson%netscape.com
c13911024a Remove redundant registration of well-formed DTD. r=rickg
git-svn-id: svn://10.0.0.236/trunk@52132 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:15:18 +00:00
waterson%netscape.com
0509ac6c24 Put column headers back in to folder pane. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@52131 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:14:14 +00:00
mccabe%netscape.com
c568cf9bed Add an API entry point for building JS Date objects from millisecond values.
Patches courtesy Chris Houck.  r=mccabe.


git-svn-id: svn://10.0.0.236/trunk@52130 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:11:41 +00:00
rhp%netscape.com
b3f1a34e11 Fix for sending plain text as binary files - Bug #16393 - r: mscott
git-svn-id: svn://10.0.0.236/trunk@52129 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:09:27 +00:00
norris%netscape.com
a825f1738a work on bug 7270.
r=mstoltz.
Implement netscape.security.PrivilegeManager callbacks.


git-svn-id: svn://10.0.0.236/trunk@52128 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:09:03 +00:00
mscott%netscape.com
58da4d1cc2 part of url dispatching framework.
build nsURLDispatcher.cpp


git-svn-id: svn://10.0.0.236/trunk@52127 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:08:57 +00:00
ftang%netscape.com
949f26b1d9 remove nsIDOMTextRange.h nsIDOMTextRangeList.h. fix bug 12756. r=tague
git-svn-id: svn://10.0.0.236/trunk@52126 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:05:42 +00:00
wtc%netscape.com
2989da583b Bugzilla bug #17486: need parentheses around a & operator in an expression
git-svn-id: svn://10.0.0.236/trunk@52125 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 22:03:08 +00:00
srinivas%netscape.com
894660c683 Export version descriptor. Bugzilla 4742
git-svn-id: svn://10.0.0.236/trunk@52123 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:28:46 +00:00
bienvenu%netscape.com
7a179cfe09 fix mac build bustage
git-svn-id: svn://10.0.0.236/trunk@52122 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:20:40 +00:00
mcafee%netscape.com
4a058b42d1 Ignore tree directories.
git-svn-id: svn://10.0.0.236/trunk@52120 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:16:44 +00:00
dmose%mozilla.org
0d77d490d6 script to update license boilerplate in source files
git-svn-id: svn://10.0.0.236/trunk@52119 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:16:29 +00:00
rpotts%netscape.com
4626597396 cleanup - removed unnecessary code checking that mRequest != nsnull. Now the mRequest is allocated at channel construction and the channel is deleted if the request allocation fails...
git-svn-id: svn://10.0.0.236/trunk@52118 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:15:56 +00:00
ssu%netscape.com
cc23cb4fd5 added new resource string. This is related to bug #17391. r=dbragg.
Affects only windows platforms.


git-svn-id: svn://10.0.0.236/trunk@52117 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:13:28 +00:00
alecf%netscape.com
32ed46c795 fix casting problem on solaris
git-svn-id: svn://10.0.0.236/trunk@52116 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:13:06 +00:00
ssu%netscape.com
da07ac32b1 fixing bug #17391. r=dbragg.
Fixes problem with calculating available disk space under
Win95/win98.  Affects only windows platforms.


git-svn-id: svn://10.0.0.236/trunk@52115 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:12:24 +00:00
warren%netscape.com
052c27feff Fixed thing that chops off final digit.
git-svn-id: svn://10.0.0.236/trunk@52114 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:06:36 +00:00
racham%netscape.com
8f6655fb4a r=gayatrib. Fix for Bug 16414. If the profile dir is deleted it always gets rebuilt based on the path it gets from registry
git-svn-id: svn://10.0.0.236/trunk@52113 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 21:05:26 +00:00
dp%netscape.com
f2caaa1890 Converting to module. r=kipp
git-svn-id: svn://10.0.0.236/trunk@52112 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:59:49 +00:00
dp%netscape.com
b3499577af Convering to nsIModule. r=kipp
git-svn-id: svn://10.0.0.236/trunk@52111 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:57:29 +00:00
dp%netscape.com
da7c33e34c Remove delete on nsISupports. r=kipp
git-svn-id: svn://10.0.0.236/trunk@52110 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:44:45 +00:00
nhotta%netscape.com
b6d38ed4f7 Check input for the null pointer and empty string, bug 17287, r=ducarroz,jefft.
git-svn-id: svn://10.0.0.236/trunk@52109 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:41:45 +00:00
nisheeth%netscape.com
ce3c186894 r=nisheeth. Fix for bug 17237 from Rick Gessner (rickg@netscape.com). Thanks, Rick.
git-svn-id: svn://10.0.0.236/trunk@52108 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:40:08 +00:00
mscott%netscape.com
33fe7bdd57 Build new uri dispatching interfaces on the Mac.
git-svn-id: svn://10.0.0.236/trunk@52107 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:38:16 +00:00
mscott%netscape.com
1e3a7c2073 export uri dispatching interfaces.
git-svn-id: svn://10.0.0.236/trunk@52106 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:37:58 +00:00
despotdaemon%netscape.com
a82717bab8 Pseudo-automatic update of changes made by yueheng.xu@intel.com.
git-svn-id: svn://10.0.0.236/trunk@52105 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:34:51 +00:00
rods%netscape.com
189a26e941 Listboxes now obey CSS specifed sizes
r=kmcclusk,related to bug 16317


git-svn-id: svn://10.0.0.236/trunk@52104 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:31:23 +00:00
radha%netscape.com
ca4f530508 Fix for form values not maintained while going forward. bug # 16377. r=law
git-svn-id: svn://10.0.0.236/trunk@52103 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:29:43 +00:00
akhil.arora%sun.com
1aa54f66ab updated list of things todo, removing stuff that has been done
git-svn-id: svn://10.0.0.236/trunk@52102 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:28:20 +00:00
akhil.arora%sun.com
d6ca20f368 r=akhil.arora@sun.com By Igor Nekrestyanov <nis@sparc.spb.su>
Minor changes to handle unicode strings properly


git-svn-id: svn://10.0.0.236/trunk@52101 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:26:27 +00:00
sspitzer%netscape.com
3a3c45b57c fix warnings. r=valeski
git-svn-id: svn://10.0.0.236/trunk@52100 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:25:43 +00:00
kmcclusk%netscape.com
89bd3d196e Removed stray semi-colon after NS_DECL_ISUPPORTS bug=17235 r=rods@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52099 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:24:19 +00:00
alecf%netscape.com
5ecb0c11b3 prepare to consolidate server URI creation - create a new property of incoming servers, the local store type, and construct the URL from there.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@52098 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:22:06 +00:00
alecf%netscape.com
2e274875d3 more cleanup work - now retrieve the server at URI creation time, so that GetServer() is really fast, and just forward calls to GetUsername and GetPassword() to the server. r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@52097 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:19:57 +00:00
terry%mozilla.org
7d80bedb81 Back out last change -- specific to mozilla.org, not to general consumers of bugzilla.
git-svn-id: svn://10.0.0.236/trunk@52096 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:18:03 +00:00
bienvenu%netscape.com
f488902f5d work on body filters and search r=mscott
git-svn-id: svn://10.0.0.236/trunk@52095 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:13:22 +00:00
valeski%netscape.com
b853096819 16968, r=gagan. Changed the way HTTP header notification occurs. now the channel does the notification. Also added SetREsponseHeaders() to the nsIHTTPChannel iface which allows outside users to add response headers (such as nsMultiMIMEConv/bugzilla) and have the new headers perculate to observers. also fixed HTTP handler leak, r=dp on that one.
git-svn-id: svn://10.0.0.236/trunk@52094 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:12:59 +00:00
endico%mozilla.org
9b799b1100 Try to herd netscape communicator users away from bugzilla. "if your browser has a blue N logo go report the bug to netscape". This wording may be wrong later on but it works for now.
git-svn-id: svn://10.0.0.236/trunk@52093 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 20:12:52 +00:00
mcafee%netscape.com
296f21777f Updating legend for C, bloaty stats.
git-svn-id: svn://10.0.0.236/trunk@52092 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 19:47:47 +00:00
varada%netscape.com
b921af7d24 fix for bug #12715 import feature for nci files
git-svn-id: svn://10.0.0.236/trunk@52091 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 19:26:35 +00:00
varada%netscape.com
7a333b1d09 fix for change in copydir function
git-svn-id: svn://10.0.0.236/trunk@52090 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 19:25:56 +00:00
warren%netscape.com
16156488f8 Enhanced delta report. Breakdown by what's new, what's changed, etc.
git-svn-id: svn://10.0.0.236/trunk@52089 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 18:57:37 +00:00
despotdaemon%netscape.com
04b5eac48c Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@52088 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 17:59:13 +00:00
norris%netscape.com
0d74bb8fa4 Fix spelling of contributor's name.
git-svn-id: svn://10.0.0.236/trunk@52087 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 17:43:43 +00:00
troy%netscape.com
aa66ccecfa Elimninated compiler warning
git-svn-id: svn://10.0.0.236/trunk@52086 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:46:41 +00:00
ftang%netscape.com
bd4b9fbaf5 fix two comment after brade review and point out my error in prev checkin. r=brade
git-svn-id: svn://10.0.0.236/trunk@52085 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:46:37 +00:00
troy%netscape.com
3cb8f38164 Eliminated compiler warning
git-svn-id: svn://10.0.0.236/trunk@52084 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:46:06 +00:00
troy%netscape.com
5149a61f62 Added more diagnostic code
git-svn-id: svn://10.0.0.236/trunk@52083 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:38:14 +00:00
kipp%netscape.com
1786d79429 bug=17320; Fixed a purify warning
git-svn-id: svn://10.0.0.236/trunk@52082 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:33:34 +00:00
ftang%netscape.com
85c96d612c move all end of line # comment to the previous line. Remove all end of line tab and whitespace. Need this to fix Trad Chinese IME. Somehow our property file reader do not treat # as start of comment in a key value pair line. r=brade
git-svn-id: svn://10.0.0.236/trunk@52081 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:28:22 +00:00
vidur%netscape.com
1173466bfc Added a version of window.close, which when alled from script that defers actual closure if it is invoked from the script context of the window itself. Fixes bug 15261. R=joki.
git-svn-id: svn://10.0.0.236/trunk@52080 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:12:56 +00:00
ftang%netscape.com
c3b0a312fc remove unnecessary #ifdef USE_XIM. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52079 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 13:16:07 +00:00
Jerry.Kirk%Nexwarecorp.com
4385e8d68e Call PtAppAddFd instead of PtAppAddFdPri because of redraw bugs it
was causing.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@52078 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 12:43:46 +00:00
dp%netscape.com
f06f488185 Removing use of mRefCnt directly. Also, removed all use of refcounted
variable as creations were always refcounted. r=kipp


git-svn-id: svn://10.0.0.236/trunk@52077 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 11:42:15 +00:00
srinivas%netscape.com
a6569800ce Include system files for BeOS; checkin for <duncan@be.com>.
git-svn-id: svn://10.0.0.236/trunk@52076 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 11:40:33 +00:00
rickg%netscape.com
7d94513269 fixed bug17387 (pre-constructing DTD's). r=warren
git-svn-id: svn://10.0.0.236/trunk@52075 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 09:26:19 +00:00
cmanske%netscape.com
450e220228 More changes to Composer for new skin (mostly new images).
git-svn-id: svn://10.0.0.236/trunk@52073 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 08:42:30 +00:00
warren%netscape.com
afff9da3ba Fixed bug in calculating leak total.
git-svn-id: svn://10.0.0.236/trunk@52072 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 08:35:53 +00:00
warren%netscape.com
4677dd631f Changed file transport to facilitate jar: protocol -- parameterized by nsIFileSystem. Bug#12579 r=gagan,gayatrib
git-svn-id: svn://10.0.0.236/trunk@52070 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 08:02:07 +00:00
rickg%netscape.com
b14a509c76 fixed bug17388, dtd leak; r=mscott
git-svn-id: svn://10.0.0.236/trunk@52069 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 07:53:21 +00:00
tbogard%aol.net
cd2764bb20 Changes made to reflect changes in nsIGenericWindow and nsIScrollable.
git-svn-id: svn://10.0.0.236/trunk@52068 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 07:52:08 +00:00
tbogard%aol.net
8e4af380cc Removed RemoveFocus() from nsIGenericWindow. Moved SizeToContent() to nsIHTMLDocShell. Added setCurScrollPosEx and setScrollRangeEx to nsIScrollable. Moved a bunch of code from nsHTMLDocShell into the base class. Commented out some stuff. Everything should compile now.
git-svn-id: svn://10.0.0.236/trunk@52067 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 07:51:10 +00:00
mscott%netscape.com
3587a59aa7 build mime before compose so we can make sure nsIMimeStreamConverter.idl has been exported
before compose IDL files try to use it.


git-svn-id: svn://10.0.0.236/trunk@52066 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 07:23:20 +00:00
dougt%netscape.com
32412a1f03 Fix for this mornings crasher (17352) r=pavlov, mscott
git-svn-id: svn://10.0.0.236/trunk@52065 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 06:44:36 +00:00
ducarroz%netscape.com
a282d4acf9 another Mac bustage fix. Caught before it appears
git-svn-id: svn://10.0.0.236/trunk@52064 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 06:01:43 +00:00
ducarroz%netscape.com
d4df792c85 Fix Mac bustage for mscott.
Add build instruction for mozilla:mailnews:mime:public:MANIFEST_IDL.


git-svn-id: svn://10.0.0.236/trunk@52063 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:45:22 +00:00
mscott%netscape.com
1bac65d756 Remove incorrect export of nsIMimeStreamConverter.idl
git-svn-id: svn://10.0.0.236/trunk@52062 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:42:15 +00:00
mscott%netscape.com
1b39aa1dd7 more work to try to fix the mac build.
git-svn-id: svn://10.0.0.236/trunk@52061 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:39:14 +00:00
ducarroz%netscape.com
eaa801e49e Fix for bug 17405. We need to skip entry that aren't valid during the search. R=mscott (he has also approved the fact I checking despite a red tree)
git-svn-id: svn://10.0.0.236/trunk@52060 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:34:07 +00:00
mscott%netscape.com
dbf6bce997 Fix windows build breakage. Try to build mime before compose so the IDL files
get exported first.


git-svn-id: svn://10.0.0.236/trunk@52058 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 05:08:36 +00:00
mscott%netscape.com
5c68fcaafc fix mac build by exporting nsIMimeStreamConverter.idl
git-svn-id: svn://10.0.0.236/trunk@52057 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:56:12 +00:00
waterson%netscape.com
31deb6a74d Unix filenames are case-sensitive.
git-svn-id: svn://10.0.0.236/trunk@52056 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:36:04 +00:00
mscott%netscape.com
888899af25 Bug #16927 --> when quoting a message, don't try to force a message URI into a protcol url. Convert the rdf uri
into a url and use that instead. For quoting the msg, use NS_NewChannel and AsyncOpen. some cleanup to fix
some ref counting stuff including supporting a new interface. Using the component manager
to create the quote listener instead of using new.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52055 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:22:08 +00:00
mscott%netscape.com
1bc43aaac4 Use nsCOMPtr. Add nsIMsgQuoteListener support, remove some extra member variables that we didn't need.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52054 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:21:30 +00:00
mscott%netscape.com
5daada9f2c Bug #16927 add nsIMsgQuoteListener interface
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52053 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:21:02 +00:00
mscott%netscape.com
08f1d9c5a8 Bug #16927 --> add msg quote listener to module.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52052 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:20:41 +00:00
mscott%netscape.com
3b5d377a59 Bug #16927 --> add class id for msg quote listener
r=rhp


git-svn-id: svn://10.0.0.236/trunk@52051 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:19:59 +00:00
karnaze%netscape.com
15d92465ad simplified caching of column frames. split out collapsing border processing into nsBorderCollapser (checked in previously). r=troy
git-svn-id: svn://10.0.0.236/trunk@52050 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:09:39 +00:00
karnaze%netscape.com
0ddb8bf0bc added files: mozilla/layout/html/table/src/nsTableBorderCollapser.cpp
git-svn-id: svn://10.0.0.236/trunk@52049 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 04:06:36 +00:00
karnaze%netscape.com
b363aea0eb new class for collapsing borders, extracted from nsTableFrame, r=troy
git-svn-id: svn://10.0.0.236/trunk@52045 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 03:51:55 +00:00
braddr%puremagic.com
d8fb5871d7 Move all nsIEnumerator usage over to NS_ENUMERATOR_FALSE from NS_COMFALSE in anticipation of nixing NS_COMFALSE in the near future.
r=scc


git-svn-id: svn://10.0.0.236/trunk@52044 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 03:16:48 +00:00
brendan%mozilla.org
da68e2dcd8 Fix bogus assertion (r=shaver@mozilla.org) found by chouck@geocast.com.
git-svn-id: svn://10.0.0.236/trunk@52043 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:50:15 +00:00
fur%netscape.com
50f46042f0 Removed unused variable declaration to eliminate warning
git-svn-id: svn://10.0.0.236/trunk@52042 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:48:32 +00:00
srinivas%netscape.com
bc406e3e1e Add PR_Block/Unblock_Interrupt functions. Bugzilla 17055
git-svn-id: svn://10.0.0.236/trunk@52041 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:48:01 +00:00
fur%netscape.com
dbcd581b59 Eliminated references to long-dead jsaddr.[ch].
Note: These files only used in standalone JS, not SeaMonkey build.


git-svn-id: svn://10.0.0.236/trunk@52040 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:45:01 +00:00
fur%netscape.com
e969fa7f4f Removed unused files - they have been dead for years
git-svn-id: svn://10.0.0.236/trunk@52039 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:42:49 +00:00
tbogard%aol.net
d9cd4dc3b8 Pushed many of the method implementations done by buster from nsHTMLDocShell into the base class.
git-svn-id: svn://10.0.0.236/trunk@52038 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:20:44 +00:00
mscott%netscape.com
5bfc03c26e part of url dispatching.
export the uri dispatching interfaces.
no reviewer for this makefile change.


git-svn-id: svn://10.0.0.236/trunk@52037 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 02:05:12 +00:00
danm%netscape.com
d5cb9410ae moving initial content focus from OnEndDocumentLoad to Show. Reinstating SetSizeFromXUL. reduces new window flashing and allows gtk windows to size from JS. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52036 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:52:49 +00:00
mscott%netscape.com
df0cb24c86 Checking this in for hangas. Fixes the grey menus in the compose window.
r=mscott


git-svn-id: svn://10.0.0.236/trunk@52035 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:52:13 +00:00
cmanske%netscape.com
c0c0bb47c7 Fixed bugs 16690, 16991. Also made UI changes to adjust for new 'skin' r=sfraser
git-svn-id: svn://10.0.0.236/trunk@52034 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:51:07 +00:00
nisheeth%netscape.com
151090fbb2 r=nisheeth. Fix for bug 9781 submitted by Johnny Stenbeck (jst@citec.fi). Thanks Johnny.
git-svn-id: svn://10.0.0.236/trunk@52033 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:50:37 +00:00
hangas%netscape.com
9c4609c831 Fixed throbber id, bug 17271. r=german
git-svn-id: svn://10.0.0.236/trunk@52032 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:44:29 +00:00
law%netscape.com
85c96d1199 Bug #14999; remove last vestiges of app core usage; r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52031 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:41:16 +00:00
law%netscape.com
41c8a495f1 Bug #14999, removing last vestiges of app core usage; r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52030 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:39:33 +00:00
nisheeth%netscape.com
f341433a7c r=dp. Fix for bug 17411. Commenting out the call to nsFrameManager::CantRenderReplacedElement for now. This should let us open up the tree while dp and pnunn figure out the right fix.
git-svn-id: svn://10.0.0.236/trunk@52029 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 01:20:34 +00:00
tbogard%aol.net
f996be0ecd Changed nativeWindow* parentNativeWindow back to nativeWindow parentNativeWindow.
git-svn-id: svn://10.0.0.236/trunk@52028 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 00:45:13 +00:00
despotdaemon%netscape.com
20ec29f713 Pseudo-automatic update of changes made by andreww@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@52027 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 00:11:01 +00:00
hoa.nguyen%intel.com
a56d99d249 Initialize cookie manager. Allows cgi scripts to set and retrieve cookies through viewer. r=edburns@acm.org
git-svn-id: svn://10.0.0.236/trunk@52026 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:58:49 +00:00
buster%netscape.com
1f5101db18 added a bunch of initial implementation. does not compile yet, but that's ok because docshell isn't part of the build yet.
git-svn-id: svn://10.0.0.236/trunk@52025 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:50:19 +00:00
jfrancis%netscape.com
f4bfa77ae5 fix for 17056: making a list in empty doc didnt work; also making a new list item didn't work. r=floppy moose
git-svn-id: svn://10.0.0.236/trunk@52024 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:44:33 +00:00
sfraser%netscape.com
3b974396c6 Add the various menu-related arrow gifs. fixes bug 17368. r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@52023 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:40:51 +00:00
jj%netscape.com
adfe3c048e First Checked In.
git-svn-id: svn://10.0.0.236/trunk@52022 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:39:46 +00:00
putterman%netscape.com
7e1db2ef27 This should stop build bustage for clobber builds.
git-svn-id: svn://10.0.0.236/trunk@52021 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:39:15 +00:00
locka%iol.ie
74ff2dc2f4 Fixed some bugs in the copy to clipboard operation.
Control now calls NS_ShutdownXPCOM during destruction


git-svn-id: svn://10.0.0.236/trunk@52020 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:19:27 +00:00
locka%iol.ie
7eff36db02 Added a menu to the dialog.
Implemented tests for cut, copy, paste, select all


git-svn-id: svn://10.0.0.236/trunk@52019 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:17:51 +00:00
cata%netscape.com
1bb10c65f4 I'm checking in for momoi, r=cata, bug #17018, Charset Menu usability workaround.
git-svn-id: svn://10.0.0.236/trunk@52018 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:10:51 +00:00
ftang%netscape.com
657f0d5580 fix the delete last IME text problem. bug13494 . There are another fix in nsHTMLEditRules.cpp related this but I forget to put the bug # there. r=tague
git-svn-id: svn://10.0.0.236/trunk@52017 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:05:24 +00:00
troy%netscape.com
c96591767e b=6674, r=karnaze@netscape.com
Changed Paint() to set the clip rect only when the collapse offset isn't
(0, 0)


git-svn-id: svn://10.0.0.236/trunk@52016 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:01:21 +00:00
kipp%netscape.com
3a2fe236a8 r=troy; fixed bug #17346 - the nsTextFormatter self test code found a bug in the nsTextFragment ctor code...
git-svn-id: svn://10.0.0.236/trunk@52015 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:01:16 +00:00
hangas%netscape.com
5fb3a93517 Cleaned up bad style rules in global.css - should result in noticable performance improvement. Converted <titledbutton> rules to all use a class, this way we can be specific about how each type of button should look. Added line between columns in tree headers. Indented treecell contents. Cleaned up mail and AB toolbars. Fixed reflow and other drawing issues with toolbar buttons on new skins. Fixed problems in results tree on AB window. Other misc visual changes. Fixed bug 16530, changing the word Messenger to Mail. r=german/hyatt
git-svn-id: svn://10.0.0.236/trunk@52014 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 23:01:09 +00:00
cathleen%netscape.com
c249ccc29e adding missing editor chrome file to mac packaging list
git-svn-id: svn://10.0.0.236/trunk@52013 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:59:04 +00:00
ftang%netscape.com
c31d69ed3f add debugging code. fix remove last uncomited IMEText. r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@52012 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:56:36 +00:00
akkana%netscape.com
018a1629cf 17305: Fix ? handling. Also add myself to a debug ifdef. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@52011 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:53:52 +00:00
tague%netscape.com
282a0d9dcf Fixed bug #16463 - can't create profile with Danish version of Mozilla. I modified the locale mapping code to correct a bug where DA was getting mapped to LANG_DUTCH. r=nhotta@netscape.com
git-svn-id: svn://10.0.0.236/trunk@52010 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:52:56 +00:00
bienvenu%netscape.com
d6e604a886 turn on date filters, r=mscott 10416
git-svn-id: svn://10.0.0.236/trunk@52009 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:45:18 +00:00
nisheeth%netscape.com
fa55e685cc r=pollmann, troy. Fix for bug 10564. Added some error checking code to prevent crashes reported on low memory configurations.
git-svn-id: svn://10.0.0.236/trunk@52008 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:45:05 +00:00
sdagley%netscape.com
41a1603c9d __MD_GetEnv now calls standard C's getenv if environment variable not in NSPR's table. r=beard
git-svn-id: svn://10.0.0.236/trunk@52007 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:44:48 +00:00
sspitzer%netscape.com
637de3c1b6 fix for #17285 and #17397. r=mscott.
properly migrate pop and nntp servers from 4.x that were not on the default ports (110 and 119, respectively).
also, set the default port pref to be -1, so that if we don't set the port, it gets set to -1.


git-svn-id: svn://10.0.0.236/trunk@52006 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:44:34 +00:00
morse%netscape.com
af16ae652b bug 17339, document.cookie throwing exception, r=neeti
git-svn-id: svn://10.0.0.236/trunk@52005 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:43:49 +00:00
rginda%ndcico.com
dece5d007f **NOT PART OF THE SEAMONKEY DEFAULT BUILD**
* xul/tests/test3-output-loud.css
Added css for "loud" style.

* xul/tests/blue_rock.gif
Added pic for new default style, from Eterm background collection.

* makefile.win, Makefile.in
Add blue_rock.gif to install files.

* js/lib/irc.js
Strip \r characters from input.

* xul/tests/index.html
Updated content.

* xul/tests/test3-handlers.js
Create userlist object onJoin if it isnt already there.

* xul/tests/test3-output-default.css
New default style.

* xul/tests/test3-static.js
Added irc.freei.net server to top of EFNet network.  This server does not
require the ident service, which is blocked by the NS firewall.

* xul/tests/test3.xul
Added "loud" style to menu (old default style.)


git-svn-id: svn://10.0.0.236/trunk@52004 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:42:47 +00:00
morse%netscape.com
cfdf03bc1a bug 17120, can't startup if cookie dll missing, r=valeski
git-svn-id: svn://10.0.0.236/trunk@52003 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:41:36 +00:00
putterman%netscape.com
32be2053bd Added nsIMsgWindow.idl and nsIMsgRDFDataSource.idl
git-svn-id: svn://10.0.0.236/trunk@52002 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:40:34 +00:00
putterman%netscape.com
dd42c6ee85 Added nsMsgWindow.cpp
git-svn-id: svn://10.0.0.236/trunk@52001 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:39:37 +00:00
morse%netscape.com
0eb9ff94e0 part of bug 8227, dereferencing problems, r=rickg
git-svn-id: svn://10.0.0.236/trunk@52000 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:38:48 +00:00
putterman%netscape.com
ff9a018c1e Started work on 17376. reviewed by bienvenu. create an object that knows about
mailnews window data and pass it through backend.


git-svn-id: svn://10.0.0.236/trunk@51999 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:38:47 +00:00
cathleen%netscape.com
59a2f543c7 adding missing editor chrome files
git-svn-id: svn://10.0.0.236/trunk@51998 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:35:37 +00:00
matt%netscape.com
e180142807 fix for bug 15169 r-morse
git-svn-id: svn://10.0.0.236/trunk@51997 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:33:35 +00:00
matt%netscape.com
5077a5368d 17218 r-mcafee
git-svn-id: svn://10.0.0.236/trunk@51996 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:31:58 +00:00
rogerl%netscape.com
2bfa05205d Changed commandline option for classpath to 'classpath' instead of 'cp'
git-svn-id: svn://10.0.0.236/trunk@51995 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:22:56 +00:00
bienvenu%netscape.com
f3513af6e6 fix a couple ref-counting problems on news dbs, reviewed last week by sspitzer
git-svn-id: svn://10.0.0.236/trunk@51994 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:19:42 +00:00
bienvenu%netscape.com
6b1312845e fix off by one error computing display name from naked email address
git-svn-id: svn://10.0.0.236/trunk@51993 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:18:12 +00:00
rogerl%netscape.com
f891c9ebb9 Error message for apply argument type
git-svn-id: svn://10.0.0.236/trunk@51992 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:17:44 +00:00
rogerl%netscape.com
f3ae1fcf7a ECMA handling of undefined args for call & apply.
git-svn-id: svn://10.0.0.236/trunk@51991 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:17:05 +00:00
rogerl%netscape.com
7a5d5c9ad9 Handle LINE & SOURCEFILE in dumpIcode
Fix bug in multiple try/catch clauses after a catch - the tryStackTop was
being decremented twice.


git-svn-id: svn://10.0.0.236/trunk@51990 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:16:15 +00:00
rogerl%netscape.com
a8627f0cf6 Handle missing arg in match_or_replace
git-svn-id: svn://10.0.0.236/trunk@51989 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:14:46 +00:00
bienvenu%netscape.com
6b7fd317c4 turn on history ab collection for msg sending r=jefft, bug 14447
git-svn-id: svn://10.0.0.236/trunk@51988 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:14:37 +00:00
rhp%netscape.com
e735146e7c Fix for Unicode quoting to plain text compose - Bug: 15465 r: bienvenu
git-svn-id: svn://10.0.0.236/trunk@51987 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:11:51 +00:00
rogerl%netscape.com
89da4b6f9b ECMA specified handling of NaN inputs for max & min
git-svn-id: svn://10.0.0.236/trunk@51986 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:11:43 +00:00
rogerl%netscape.com
800a7e2800 Subsumed ConversionError into TypeError
git-svn-id: svn://10.0.0.236/trunk@51985 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:10:36 +00:00
mscott%netscape.com
e2730e12e8 Bug #17352 --> temporarily hide this crasher by inserting an extra
ref count of the event queue. this is horrible since we are introducing
a leak. we need to examine the ownership model of event queues for the app
shell. I'm going to get pavlov to help me look at fixing this bug for real.
r=dougt
a=gramps,granrose


git-svn-id: svn://10.0.0.236/trunk@51984 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 22:00:54 +00:00
dmose%mozilla.org
1710bfc387 updating license boilerplate in all files; checkin approved by leif@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51980 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 21:02:40 +00:00
braddr%puremagic.com
1dde1a4f56 Ooops.. tree closed, better back these out for now. Sorry.
git-svn-id: svn://10.0.0.236/trunk@51979 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 21:01:37 +00:00
larryh%netscape.com
dfb30043a3 BugZilla 17374. Add PROffset types
git-svn-id: svn://10.0.0.236/trunk@51978 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 20:29:22 +00:00
braddr%puremagic.com
7767d9393b Move all nsIEnumerator usage over to NS_ENUMERATOR_FALSE from NS_COMFALSE
in anticipation of nixing NS_COMFALSE in the near future.
r=scc (please contact him should there be any build issues)


git-svn-id: svn://10.0.0.236/trunk@51977 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 20:24:21 +00:00
bienvenu%netscape.com
642710bf52 fix race condition opening imap folder r=mscott, build stopper
git-svn-id: svn://10.0.0.236/trunk@51976 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 19:15:20 +00:00
kipp%netscape.com
0637f2c48a Backed out chris's accidental checkin (don't ask)
git-svn-id: svn://10.0.0.236/trunk@51973 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 15:57:35 +00:00
karnaze%netscape.com
03e8200f99 hello
git-svn-id: svn://10.0.0.236/trunk@51972 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 15:55:31 +00:00
vidur%netscape.com
48577bac14 Update mNumFlushed counts when we do a synchronous notification (in scripts, for example). This is so that a call to FlushTags while we're executing a script sees the context stack in an updated state. Fixes bug 14042. R=joki.
git-svn-id: svn://10.0.0.236/trunk@51971 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 14:03:15 +00:00
Jerry.Kirk%Nexwarecorp.com
a4c99c7c93 Finished implementing ListenToEventQueue.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@51970 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 11:36:21 +00:00
idk%eng.sun.com
3b03dc263a bugId 17329
Added PlugletSecurityContext class.
Set ProxyJNI security context to PlugletSecurityContext
(see 15902)


git-svn-id: svn://10.0.0.236/trunk@51969 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 09:33:06 +00:00
hyatt%netscape.com
a036d65c5c working on theme switching r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51966 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 09:24:23 +00:00
idk%eng.sun.com
ab0a4a932c bugId 17316
Added 4 demo pluglets
a = laa@sparc.spb.su
r = idk@eng.sun.com


git-svn-id: svn://10.0.0.236/trunk@51965 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 09:10:36 +00:00
nisheeth%netscape.com
cd137af4d4 Fix for bug 15633. Fixing build warning with the patch submitted by James Clark (jjc@jclark.com). r=nisheeth
git-svn-id: svn://10.0.0.236/trunk@51964 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:39:57 +00:00
briano%netscape.com
3387e5dd13 Automated update
git-svn-id: svn://10.0.0.236/trunk@51962 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:15:10 +00:00
nisheeth%netscape.com
74d8a9e437 Added --enable-detec-webshell-leaks autoconf flag.
git-svn-id: svn://10.0.0.236/trunk@51961 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:14:42 +00:00
nisheeth%netscape.com
0ca61f6f5c Added --enable-detect-webshell-leaks autoconf flag.
git-svn-id: svn://10.0.0.236/trunk@51960 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:13:48 +00:00
mcafee%netscape.com
dc2ef44aa6 switching to absolute leak/bloat numbers.
git-svn-id: svn://10.0.0.236/trunk@51959 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 07:02:25 +00:00
rpotts%netscape.com
d54c2a54d9 bug #13054. r=mscott,warren. Reworked how data is written to the network. I consolidated the writing of nsIBufferInputStreams and nsIInputStreams and limited the amount of data being wrtten at once to MAX_IO_TRANSFER_SIZE...
git-svn-id: svn://10.0.0.236/trunk@51957 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:51:12 +00:00
mscott%netscape.com
26a5e7abea Bug #14928 --> url dispatching. Adding initial scaffolding for the uri dispatcher service.
(not part of the build yet)


git-svn-id: svn://10.0.0.236/trunk@51956 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:49:42 +00:00
rpotts%netscape.com
207123458e bug #16897. Consolidated the firing of OnStopRequest into the nsHTTPChannel. This is also called if a transport fails to be created...
git-svn-id: svn://10.0.0.236/trunk@51955 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:48:53 +00:00
sfraser%netscape.com
e025da23ff Ooops, maybe we do need one of those paths after all. r=floppy
git-svn-id: svn://10.0.0.236/trunk@51954 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:48:35 +00:00
mscott%netscape.com
c438ffca68 added a url dispatching comment.
git-svn-id: svn://10.0.0.236/trunk@51953 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:48:19 +00:00
sfraser%netscape.com
5258fa6070 Another teeny project fix -- remove obsolete lib/xp paths in the two static targets (which are not built anyway). r=moose
git-svn-id: svn://10.0.0.236/trunk@51952 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:44:44 +00:00
sfraser%netscape.com
f825fcb394 Fix the output file (RDF.header -> chrome.headers) so that .h file generation dependencies work properly. Fixes the red tree. r=mscott
git-svn-id: svn://10.0.0.236/trunk@51951 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:42:07 +00:00
rpotts%netscape.com
072f7a0e0b These are pollmanns changes for bug #8209 and other related POSTing bugs r=rpotts
git-svn-id: svn://10.0.0.236/trunk@51950 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:35:03 +00:00
mcafee%netscape.com
f3b4ca8e81 switching to absolute leak/bloat numbers.
git-svn-id: svn://10.0.0.236/trunk@51949 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:34:28 +00:00
sfraser%netscape.com
e48c7f6f32 Really change to using the NSComponent library. the opt target still had NSStartup. r=moose.
git-svn-id: svn://10.0.0.236/trunk@51948 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 06:31:40 +00:00
pavlov%netscape.com
30d2acfd1b check for null r=alecf
git-svn-id: svn://10.0.0.236/trunk@51944 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 05:51:05 +00:00
putterman%netscape.com
6263816942 Fix for 17277. reviewed by mscott. Delete selects next message instead of previous.
git-svn-id: svn://10.0.0.236/trunk@51942 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 04:46:12 +00:00
bienvenu%netscape.com
226d2a5c5f add accessor for load group on doc loader r=rpotts
git-svn-id: svn://10.0.0.236/trunk@51941 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 04:44:42 +00:00
troy%netscape.com
fd1d6fc2a3 Changed view to be stored as a frame property instead of a member data
of nsFrame


git-svn-id: svn://10.0.0.236/trunk@51940 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 03:56:14 +00:00
mccabe%netscape.com
f192186834 Undo overly-hasty backout. This reinstates part of my recent checkin.
git-svn-id: svn://10.0.0.236/trunk@51939 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 03:44:38 +00:00
saari%netscape.com
a9ec68967c Making popups not steal activation on MacOS. r: pinkerton, no bug number that I'm aware of
git-svn-id: svn://10.0.0.236/trunk@51938 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 03:32:35 +00:00
tbogard%aol.net
1d0ea94a3d Create an initialization structure to hold data until window created. Added a lot of implementation for many of the accessors. Filled in a lot of other first cut implementation.
git-svn-id: svn://10.0.0.236/trunk@51936 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:45:49 +00:00
tbogard%aol.net
144854adac For some reason to get an nsRect implementation you have to link with gfx. Yeah, that's componentized!
git-svn-id: svn://10.0.0.236/trunk@51935 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:44:49 +00:00
beard%netscape.com
98fb6ecb62 make warnings not terminate build. fix bustage, r=mccabe
git-svn-id: svn://10.0.0.236/trunk@51934 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:44:34 +00:00
tbogard%aol.net
d23ee135fa Boundary checking.
git-svn-id: svn://10.0.0.236/trunk@51933 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:44:01 +00:00
tbogard%aol.net
7c66962d85 A little more documentation.
git-svn-id: svn://10.0.0.236/trunk@51932 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:43:37 +00:00
hyatt%netscape.com
4639154a7f making the chrome registry work with dynamic overlays r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51931 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 02:21:05 +00:00
mccabe%netscape.com
8522d5db78 Debust mac-specific \r-related tree breakage.
git-svn-id: svn://10.0.0.236/trunk@51927 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 01:28:59 +00:00
troy%netscape.com
c04dab44f6 Change to some assertions in debug mode
git-svn-id: svn://10.0.0.236/trunk@51925 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:53:15 +00:00
mccabe%netscape.com
cde9269c1b Various fixes to xpidl. Note that this checkin will cause a rebuild of everything that depends on nsISupports.h. Fixes courtesy Mike Shaver, with small tweaks by McCabe. r=shaver, r=mccabe.
- Fix to bug 17013; have xpidl produce an error when encountering a native declaration without an associated (c++-name).

- remove many DEBUG_shaver lines.

- provide xpidl_tree_warning as a fallback for libIDL versions for which IDL_tree warning is bad, and NULL-proof our message callback function.  Also remove a 1k buffer limit from the message callback function.

- make enum in IDL files an error.  We don't support it, and love consts instead.

- Fix to 12684; don't allow [retval] parameter + return or multiple [retval] parameters.

- Fix to 13390; make non-{short,long} const a fatal error.


git-svn-id: svn://10.0.0.236/trunk@51924 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:37:39 +00:00
hangas%netscape.com
825694f714 Fixed the order of the stop and reload buttons on the browser. r=german
git-svn-id: svn://10.0.0.236/trunk@51923 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:17:16 +00:00
ftang%netscape.com
94bc1e8092 add debugging code. change code so we won't call MapDBCSAttributeArrayToUnicodeOffsets when we are not composition. Sent length == 0 TextEvent if we got nothhing in IME_COMPOSITION. This is needed to delete the last unconverted text in IME. r=tague
git-svn-id: svn://10.0.0.236/trunk@51922 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:14:46 +00:00
ftang%netscape.com
1a8b9b5ddb implement input method highlight. r=tague
git-svn-id: svn://10.0.0.236/trunk@51921 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:10:03 +00:00
jj%netscape.com
e14a41074a workaround to accept wildcards on Mac -- granrose. r=jj
git-svn-id: svn://10.0.0.236/trunk@51918 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-27 00:03:54 +00:00
rods%netscape.com
beb6aa3e8b At kipp's suggestion I added a EnterReflowLock before and a ExitReflowLock
after my AppendReflowCommand. The reflow command gets "kicked off"
and it is now fixed. r=kipp, b=14771


git-svn-id: svn://10.0.0.236/trunk@51916 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:34:46 +00:00
sspitzer%netscape.com
71d282e592 fix for #17212, r=mscott.
migrate imap servers that have the port in the name (like nsmail-2:143)


git-svn-id: svn://10.0.0.236/trunk@51915 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:34:30 +00:00
rods%netscape.com
d8ca5cd972 removed an unused variable and an extra decl and call to remove two warnings
r=none


git-svn-id: svn://10.0.0.236/trunk@51914 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:28:51 +00:00
mccabe%netscape.com
2cdb9d67e3 Fix IDL to use native <idl-name>(<C++-name>); instead of just native <idl-name>; This is prep to make the tree compile with a new error mode landing in xpidl shortly.
Preperatory to a fix to 17013; I'm doing this as a separate checkin to avoid any checkin-skew danger.

r=shaver.


git-svn-id: svn://10.0.0.236/trunk@51913 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:26:28 +00:00
rods%netscape.com
bdb148b62f changed param in the initializer to aContent instead of nsnull
r=kmcclusk,b=17015


git-svn-id: svn://10.0.0.236/trunk@51912 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:21:14 +00:00
gagan%netscape.com
22e24a8da0 Fixed bugs 11677 (perf) 13837 (spaces) 14380 (leading spaces) 14707 (-1) 15069 (file://) r=valeski
git-svn-id: svn://10.0.0.236/trunk@51911 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:16:34 +00:00
cmanske%netscape.com
3054ed7de9 Fixed bugs 6278, 9758, 17014, 17071, 17160. r=sfraser,mjudge
git-svn-id: svn://10.0.0.236/trunk@51910 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:13:00 +00:00
mcafee%netscape.com
214b95844f Clear alarm from AliveTest, this was causing alternating green/orange status. Thanks to alecf/slamm for debugging help.
git-svn-id: svn://10.0.0.236/trunk@51909 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:10:35 +00:00
cmanske%netscape.com
f92e65e679 Part of fix for 17160, remove TextEditor from Tasks menu. r=mjudge
git-svn-id: svn://10.0.0.236/trunk@51908 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:07:41 +00:00
rhp%netscape.com
013f4b1591 Cleaning up some comments.
git-svn-id: svn://10.0.0.236/trunk@51907 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 23:06:27 +00:00
tbogard%aol.net
bb01dd252a Implemented the Destroy() method.... Which basically boils down to us returning out that we don't support the method. :)
git-svn-id: svn://10.0.0.236/trunk@51905 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:59:33 +00:00
wtc%netscape.com
f6437b73b9 Bugzilla bug #17188: NSPR should not automatically set the SO_KEEPALIVE
socket option on a new TCP socket. The HAVE_SOCKET_KEEPALIVE macro is
obsolete. r=srinivas@netscape.com.
Modified files: _beos.h, _os2.h, _unixos.h, _win16.h, _win95.h, _winnt.h,
prsocket.c, and ptio.c.


git-svn-id: svn://10.0.0.236/trunk@51902 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:58:55 +00:00
tbogard%aol.net
9e1e7d7a18 Implemented a number of methods for the doc shell attributes. Setup and Init structure which is used to accept the settings of attributes until Create() is called.
git-svn-id: svn://10.0.0.236/trunk@51900 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:56:59 +00:00
rhp%netscape.com
428cbd6498 Update changes for Mac project...again
git-svn-id: svn://10.0.0.236/trunk@51898 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:56:18 +00:00
tbogard%aol.net
0701f384c9 Updated some of the documentation.
git-svn-id: svn://10.0.0.236/trunk@51895 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:54:26 +00:00
rhp%netscape.com
3aa41ccbdf Update changes for Mac project
git-svn-id: svn://10.0.0.236/trunk@51894 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:47:55 +00:00
norris%netscape.com
0949cbb8b9 Fix 16836 "Security error accessing DOM elements inside an IFrame"
r=vidur@netscape.com
Also, bug 16536 "Security disallows opening resource URL" no longer occurs after this fix.


git-svn-id: svn://10.0.0.236/trunk@51893 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:45:32 +00:00
rhp%netscape.com
0d96648b4a Changes for better text display and format flowed - Bug #16507 - r: rhp since this is externally contributed
git-svn-id: svn://10.0.0.236/trunk@51892 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:43:25 +00:00
pinkerton%netscape.com
ae7c4c1605 File Removed.
git-svn-id: svn://10.0.0.236/trunk@51891 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:38:54 +00:00
pinkerton%netscape.com
884c5020ad use new chrome idl project instead of generated header file (r=hyatt).
git-svn-id: svn://10.0.0.236/trunk@51890 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:38:40 +00:00
pinkerton%netscape.com
3ef9a724a2 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51889 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:37:45 +00:00
slamm%netscape.com
50be5003d6 Add entity for bookmarks menu on personal toolbar
git-svn-id: svn://10.0.0.236/trunk@51888 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:10:15 +00:00
varada%netscape.com
2c49380653 fixes for bug #8977 9097
git-svn-id: svn://10.0.0.236/trunk@51887 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:07:57 +00:00
valeski%netscape.com
89e72a3976 fixing bustage
git-svn-id: svn://10.0.0.236/trunk@51886 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 22:07:50 +00:00
jj%netscape.com
699e8eca27 File Removed.
git-svn-id: svn://10.0.0.236/trunk@51885 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:53:43 +00:00
dougt%netscape.com
d11e61e41f People will not like to see my debugging info about object retention. Remov
ing #define.


git-svn-id: svn://10.0.0.236/trunk@51884 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:44:02 +00:00
brade%netscape.com
f6a4506783 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51883 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:27:05 +00:00
terry%mozilla.org
02502d0c41 Fixed perl warning.
git-svn-id: svn://10.0.0.236/trunk@51882 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:14:01 +00:00
varada%netscape.com
abe68f9fc4 fixing string.ini for online help from show example
git-svn-id: svn://10.0.0.236/trunk@51881 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:13:16 +00:00
varada%netscape.com
c1d12e4258 fixing checklist.ini for online help
git-svn-id: svn://10.0.0.236/trunk@51880 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:12:56 +00:00
varada%netscape.com
ff6e49dbb9 fix for bug#10810 if Help=Online;url is included in the ini file then the online help is launched with that url
git-svn-id: svn://10.0.0.236/trunk@51879 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 21:10:39 +00:00
valeski%netscape.com
f94df2ee59 17270, r=dougt@netscape.com. These changes move FTP from interface pointers to COMptrs. There is also a variable name change, mUrl -> mURL. Also some extraneous pipe code has been removed.
git-svn-id: svn://10.0.0.236/trunk@51878 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:55:50 +00:00
mstoltz%netscape.com
c48a5396a0 Fixed Windows breakage from converting const nsZIpItem* to nsZipItem*. r=dveditz
git-svn-id: svn://10.0.0.236/trunk@51877 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:45:21 +00:00
mscott%netscape.com
a29d572364 Bug #14928 -- > url dispatching. Change DoContent to return a stream listener instead of
a nsIContentViewer.
r=travis


git-svn-id: svn://10.0.0.236/trunk@51876 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:35:21 +00:00
rogerl%netscape.com
1aa494ee2b Changed from pic to PIC for Solaris build per Vishy.
git-svn-id: svn://10.0.0.236/trunk@51875 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:34:55 +00:00
pinkerton%netscape.com
9cbdc1b888 add case for unicode flavor, which i guess was forgotten before. now apps that request unicode get unicode. bug# 16267 r=hyatt/pav. thanks to VYV03354@nifty.ne.jp for pointing this out.
git-svn-id: svn://10.0.0.236/trunk@51874 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:33:30 +00:00
pinkerton%netscape.com
3490b579c3 Cleaned up the code and fixed a bug where data was not being null terminated on winNT.
partial fix for bug #16267 (r=hyatt/pav).


git-svn-id: svn://10.0.0.236/trunk@51873 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:31:54 +00:00
ftang%netscape.com
4c6ccd7e59 change #ifdef DEBUG_tague to #if defined(DEBUG_tague) || defined(DEBUG_ftang)
git-svn-id: svn://10.0.0.236/trunk@51872 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:17:36 +00:00
nhotta%netscape.com
643eb34912 Unicode encoder related change for unmapped characters.
If unicode encoder cannot map a character to the target encoding, it returns used unicode length including the unmapped character.
That is true for all encoder except ISO-2022-JP (bug #15706). Changed the callers to match the encoder behavior. bug 8865, r=cata.


git-svn-id: svn://10.0.0.236/trunk@51871 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:16:11 +00:00
ftang%netscape.com
a72076d654 fix IME assertion problem . r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@51870 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 20:04:47 +00:00
putterman%netscape.com
8189fffdfb No bug. reviewed by bienvenu. OnKeyDeleted wasn't sending the correct parent
thread value because the message was being deleted before we saved off the parent.


git-svn-id: svn://10.0.0.236/trunk@51869 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:52:20 +00:00
slamm%netscape.com
861592dd89 Tweak sidebar styles. r=german.
git-svn-id: svn://10.0.0.236/trunk@51868 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:45:25 +00:00
dougt%netscape.com
f769dc5560 merging FILESEP and DIRECTORY_SEPARATOR. they both do the same thing.
git-svn-id: svn://10.0.0.236/trunk@51867 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:45:18 +00:00
slamm%netscape.com
595ab124a0 Use real separator on personal toolbar menus. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51866 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:44:22 +00:00
slamm%netscape.com
7d6ce80686 Add bookmarks button (bug #14502) to personal toolbar. Fix spacing of buttons on personal toolbar. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51865 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:43:32 +00:00
mstoltz%netscape.com
ea05167e43 Added GetInputStream function to nsJAR in order to extract files into memory rather than to disk. Created nsJARInputStream to carry this data. Most of the code for this change went into nsZipArchive, which now handles either file output or output to memory. bug=16077 r=dveditz
git-svn-id: svn://10.0.0.236/trunk@51864 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:43:26 +00:00
dougt%netscape.com
94bbe207a4 Cleanup.
Removing convertTo* routines

Not hooked up to build yet.


git-svn-id: svn://10.0.0.236/trunk@51863 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:34:56 +00:00
dougt%netscape.com
c10be2aa21 1) Change ownership model internally. (17009)
2) Fixed IMAP password dialog problems by adding a PR_SLEEP() in
   nested event loop.
3) Now using a pushed event loop.

r=valeski, mscott.


git-svn-id: svn://10.0.0.236/trunk@51862 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:30:50 +00:00
valeski%netscape.com
6f9e12e047 17144. api change to nsIIOService.idl made last night missed the javascript caller in here
git-svn-id: svn://10.0.0.236/trunk@51861 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:08:10 +00:00
nhotta%netscape.com
b6cdf6cb47 Added charset propertiy files so the charset conversion to work properly (for win and mac, unix didn't have the problem), 17254, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@51860 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 19:06:41 +00:00
jfrancis%netscape.com
bb138b3c5c reworking editor IME supoprt; r=kin; bugs: 13576, 11878, 11994, 13494, 16432
git-svn-id: svn://10.0.0.236/trunk@51859 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 18:54:47 +00:00
rhp%netscape.com
b4e2e646cf Just adding new files...NOT PART OF THE BUILD!
git-svn-id: svn://10.0.0.236/trunk@51858 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 18:50:08 +00:00
despotdaemon%netscape.com
cceb1924b6 Pseudo-automatic update of changes made by mcs@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@51857 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 17:55:28 +00:00
norris%netscape.com
e544596aa2 Remove method duplication in NativeGlobal.
Add javadoc comments to EcmaError.


git-svn-id: svn://10.0.0.236/trunk@51856 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 17:22:23 +00:00
norris%netscape.com
9be2ae4e35 Get filename and line number into uncaught exception reports.
git-svn-id: svn://10.0.0.236/trunk@51855 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 17:06:12 +00:00
slamm%netscape.com
0f3c71a001 Need path to gunzip. This should be configured.
git-svn-id: svn://10.0.0.236/trunk@51854 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 16:56:00 +00:00
terry%mozilla.org
4f2f6dae6d Update version to 1.3 (which means unstable, tip-of-CVS version).
git-svn-id: svn://10.0.0.236/trunk@51853 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 15:49:58 +00:00
terry%mozilla.org
8f7faa2f78 Fixed perl error caused by previous change.
git-svn-id: svn://10.0.0.236/trunk@51852 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 15:48:25 +00:00
terry%mozilla.org
abfa77727b Make version number be 1.2, we will be spinning a tarball.
git-svn-id: svn://10.0.0.236/trunk@51850 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 15:37:12 +00:00
vidur%netscape.com
1291c59ad4 Replaced delete operator calls with Recycle(). R=joki
git-svn-id: svn://10.0.0.236/trunk@51849 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:56:41 +00:00
vidur%netscape.com
252d9255a6 Switched HTML content sink to be more incremental in content creation. Fixes bugs 11141, 854, et. al. R=kipp
git-svn-id: svn://10.0.0.236/trunk@51848 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:55:51 +00:00
dcone%netscape.com
73c37400ce Added a clip for the borders and fixed how they are rendered. r=karnaze
bugs:10311,8737,14566


git-svn-id: svn://10.0.0.236/trunk@51847 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:34:17 +00:00
rods%netscape.com
e181f8b3fa addedmore tests
git-svn-id: svn://10.0.0.236/trunk@51846 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:16:15 +00:00
rods%netscape.com
6c5ee72d6b initial add
git-svn-id: svn://10.0.0.236/trunk@51845 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:15:51 +00:00
rods%netscape.com
aaced0b882 The button "active" state needed one more pixel width in the border
r=dcone,b=17154


git-svn-id: svn://10.0.0.236/trunk@51844 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 14:05:49 +00:00
warren%netscape.com
7230bc55ee Fixed NewChannel to pass null for new originalURL argument.
git-svn-id: svn://10.0.0.236/trunk@51843 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 10:37:37 +00:00
hyatt%netscape.com
2d7de08a49 more stubbing out of dynamic overlays r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51842 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 10:03:13 +00:00
tbogard%aol.net
ca83b4534f Added a CanHandleContentType to identify if a given instantiated docShell can handle the requested document type.
git-svn-id: svn://10.0.0.236/trunk@51841 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 09:51:36 +00:00
warren%netscape.com
b9f22ce6f8 Fixed missed change to NewInputStreamChannel
git-svn-id: svn://10.0.0.236/trunk@51840 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 09:51:01 +00:00
warren%netscape.com
fe1c294273 Added nsIChannel::GetOriginalURI so that we can get back to the original chrome file (bug#17144). r=rpotts,mscott
git-svn-id: svn://10.0.0.236/trunk@51839 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 09:16:24 +00:00
endico%mozilla.org
7ecb2f45fd make the grep for server error not so noisy 2>&1
git-svn-id: svn://10.0.0.236/trunk@51838 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 08:37:07 +00:00
hyatt%netscape.com
1ca2484933 change from strings to URIs r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51837 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 08:21:32 +00:00
hyatt%netscape.com
f54d64efad stubbing out dynamic overlay loading and converting chrome registry to IDL r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51836 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 08:13:25 +00:00
mscott%netscape.com
2e56fd5c66 Bug #14928 --> url dispatching. convert nsIContentHandler.idl, nsIURIDispatcher.idl and nsIContentListener.idl
into .h files.
no reviewer yet. the code review for url dispatching will come later.


git-svn-id: svn://10.0.0.236/trunk@51835 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 07:11:44 +00:00
mscott%netscape.com
bd9b666efc Bug #14928 --> first pass at several key interfaces for url dispatching.
Not part of the build and no reviewer yet. The review will come later on when we review url dispatching


git-svn-id: svn://10.0.0.236/trunk@51834 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 07:10:27 +00:00
slamm%netscape.com
a174cc125d New sidebar ui. One panel open at a time. No bug (yet...). r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51832 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 05:46:00 +00:00
ramiro%fateware.com
2f58cc8fd3 Fix the invocation of regxpcom.
git-svn-id: svn://10.0.0.236/trunk@51831 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 05:42:33 +00:00
rpotts%netscape.com
58b6be1d08 Cleanup - changed setter/getter methods to an attribute.
git-svn-id: svn://10.0.0.236/trunk@51830 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:49:56 +00:00
rpotts%netscape.com
4c6919a678 Added CancelPendingChannel(...) which allows a nsHTTPChannel to remove itself from the list of pending requests if it is cancelled... This was causing a leak :-(
git-svn-id: svn://10.0.0.236/trunk@51829 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:49:23 +00:00
rpotts%netscape.com
1d93a7a7ae Cleanup - Moved the PostData stream from the nsHTTPChannel to the nsHTTPRequest... The PostStream is now released once the request has been sent to the server since it is no longer useful. Fixed up Cancel to remove the channel from the list of pending requests if necessary.
git-svn-id: svn://10.0.0.236/trunk@51828 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:48:26 +00:00
rpotts%netscape.com
dc04d4b53b Cleanup - Removed NSPIPE2 ifdefs. Fixed up the nsHTTPResponse constructor which no longer takes a nsIInputStream.
git-svn-id: svn://10.0.0.236/trunk@51827 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:45:03 +00:00
troy%netscape.com
bd46e7911f Changed SetView/GetView to take an additional argument which is the
pres context


git-svn-id: svn://10.0.0.236/trunk@51822 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:44:41 +00:00
rpotts%netscape.com
a3b472c211 Cleanup - Removed unused methods and members. Changed char* member to nsCString
git-svn-id: svn://10.0.0.236/trunk@51821 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:43:19 +00:00
rods%netscape.com
3c48aa841c minor changes to previous checkin to handle css sizing like NavQuirks
b=6695,r=none


git-svn-id: svn://10.0.0.236/trunk@51820 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:29:20 +00:00
mcafee%netscape.com
3b76676f40 Moved process killing stuff into killproc(), added alarm timeout for bloattest. code=alecf, r=mcafee
git-svn-id: svn://10.0.0.236/trunk@51819 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 04:07:03 +00:00
rods%netscape.com
8aef13e868 Completely rewrote the the Reflow for gfx text controls, factored out separate
reflow paths for NavQuirks and Standard mode. Also, Standard mode reflow now obeys
cols rows etc. Although there may be a little code bloat, this will make maintaining
the input text and textarea much much easier.
r=kmcclusk, b=6695,7461


git-svn-id: svn://10.0.0.236/trunk@51818 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 03:46:18 +00:00
pollmann%netscape.com
052a729260 Bug 17079: URL encoding of form element values should convert + to %2B and / as needed: r=nisheeth
git-svn-id: svn://10.0.0.236/trunk@51817 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 03:08:17 +00:00
morse%netscape.com
4b5a4b8e5d code cleanup, r=rickg
git-svn-id: svn://10.0.0.236/trunk@51816 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:46:34 +00:00
nisheeth%netscape.com
aea3ade8fe Follow-up to fix for bug 10456. I made the earlier changes to the non-Necko part of the code! Making the same changes to the ifdef NECKO part.
git-svn-id: svn://10.0.0.236/trunk@51815 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:42:23 +00:00
tbogard%aol.net
2e96f47e2e Changed nsIProgress::addListener and nsIWebBrowser::addListener to be addProgressListener and addWebBrowserListener respectively. This is to avoid confusing name conflicts. Implemented nsIWebBrowser::GetDocument() and nsIWebBrowser::GetDocShell().
git-svn-id: svn://10.0.0.236/trunk@51814 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:37:14 +00:00
tbogard%aol.net
254fe24a86 Removed nsIWebBrowserListener in favor of the new more generic nsIInterfaceRequestor. Added some interface boundary parameter validation. Added implementation for add and remove listener.
git-svn-id: svn://10.0.0.236/trunk@51813 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:26:57 +00:00
tbogard%aol.net
566e36cc10 Added some documentation.
git-svn-id: svn://10.0.0.236/trunk@51812 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:23:38 +00:00
sgehani%netscape.com
499a258aa7 Fixes bug 11209: we now detect free space larger than 2^32 bytes in the Install Wizard. [r=cathleen]
git-svn-id: svn://10.0.0.236/trunk@51811 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:12:00 +00:00
sgehani%netscape.com
95d88cbf7b Fixes bug 17190: extract only core_*/* files to obtain the XPInstall engine run by the Install Wizard. [r=cathleen]
git-svn-id: svn://10.0.0.236/trunk@51810 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:08:56 +00:00
wtc%netscape.com
f8f5eb822d Added missing function declarations to eliminate compiler warnings.
Checked in on behalf of Colin Blakes <colin@theblakes.com>.


git-svn-id: svn://10.0.0.236/trunk@51809 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 02:01:38 +00:00
nisheeth%netscape.com
aef9243c78 Bugs 10456, 15027, 11948. r=harishd. We no longer try to load up external DTD files unless those DTD files are referred to via a chrome url.
git-svn-id: svn://10.0.0.236/trunk@51808 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:58:41 +00:00
wtc%netscape.com
be5e5badd8 Bugzilla bug #17184: PR_Bind should not set the SO_REUSEADDR socket
option.  The HAVE_SOCKET_REUSEADDR macro is now obsolete.  Tests
that depended on the old PR_Bind behavior needs to call PR_SetSocketOption
before PR_Bind.
Modified files: _beos.h, _os2.h, _unixos.h, _win16.h, _win95.h, _winnt.h,
prsocket.c, ptio.c, accept.c, acceptread.c, sel_spd.c, servr_kk.c,
servr_ku.c, servr_uk.c, and servr_uu.c.


git-svn-id: svn://10.0.0.236/trunk@51807 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:58:10 +00:00
pavlov%netscape.com
bca7914d4c merge some changes that got dropped somehow during the landing r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51806 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:54:39 +00:00
tbogard%aol.net
67f77212c6 Updated to use new nsDocShellBase class. Removed a bunch of code from this level so it instead can be pulled from the base class.
git-svn-id: svn://10.0.0.236/trunk@51802 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:46:22 +00:00
tbogard%aol.net
2541c54b1d Added basedocshell library to the list of bound libraries.
git-svn-id: svn://10.0.0.236/trunk@51801 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:45:11 +00:00
tbogard%aol.net
97c0df855a Created a base class library that will provide the shared docShell implmentation.
git-svn-id: svn://10.0.0.236/trunk@51800 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:44:00 +00:00
slamm%netscape.com
10813277ec Fix typo.
git-svn-id: svn://10.0.0.236/trunk@51799 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:40:23 +00:00
tbogard%aol.net
04e0ba7204 added files: mozilla/xpcom/base/nsIInterfaceRequestor.idl
git-svn-id: svn://10.0.0.236/trunk@51798 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:37:45 +00:00
tbogard%aol.net
67b737d3e4 Adding nsIInterfaceRequestor.idl to the list of built IDL files.
git-svn-id: svn://10.0.0.236/trunk@51797 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:37:29 +00:00
waqar%netscape.com
17e91e8ab8 # 15904
r vidur
d fixes a problem where first character of the comment was being destroyed.


git-svn-id: svn://10.0.0.236/trunk@51796 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:30:55 +00:00
edburns%acm.org
4dcff0c574 r=edburns@acm.org
author=idk@eng.sun.com
#16149
approver=edburns@acm.org


git-svn-id: svn://10.0.0.236/trunk@51795 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:29:09 +00:00
mccabe%netscape.com
0683dd99f5 Initial checkin of mozbot code-reviewing functionality.
git-svn-id: svn://10.0.0.236/trunk@51794 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:22:00 +00:00
Jerry.Kirk%Nexwarecorp.com
d6610d45df Trying to fix complex clipping to reduce redraws in apprunner.
Also fixed key handling for CTRL-keys.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@51793 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 01:13:20 +00:00
scc%netscape.com
6f74b3fb2f Don't |delete| interface pointers. Use |AddRef()| and |Release()| instead. Bug #16762, r=pinkerton.
git-svn-id: svn://10.0.0.236/trunk@51792 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:49:33 +00:00
Jerry.Kirk%Nexwarecorp.com
18c97ff34d Fixing problem with &nbsp; being put into empty text fields
This is relly more of a hack, not a fix.
Bug 16886	r=kedl


git-svn-id: svn://10.0.0.236/trunk@51791 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:45:24 +00:00
Jerry.Kirk%Nexwarecorp.com
b7f540b9f2 Pulling out changes that made nsAppShell inherit from nsIObserver
that danm thought I should make cause he changed his mind.
r=kedl


git-svn-id: svn://10.0.0.236/trunk@51790 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:42:08 +00:00
hangas%netscape.com
08883ca9a8 new ui. r=pavlov,german,hyatt
git-svn-id: svn://10.0.0.236/trunk@51789 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:39:19 +00:00
sgehani%netscape.com
7eccb655b3 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51788 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:35:41 +00:00
sgehani%netscape.com
bf1287cb0c *** NOT PART OF BUILD ***
Added ASEncoder tool -- AppleSingle encoder and decoder -- with two interfaces: 

1> Menu and file selector based GUI
2> AppleScript interface (or callable from any OSA compliant scriptable component)

Fixes bug: 16947.


git-svn-id: svn://10.0.0.236/trunk@51787 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:34:40 +00:00
pinkerton%netscape.com
a5ef534d81 fix leak of grippy structs when toolbox went away. (r=bienvenu).
git-svn-id: svn://10.0.0.236/trunk@51786 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:22:48 +00:00
ducarroz%netscape.com
6d43e18270 Checking it again as for reason, the file I've checked in last time is corrupted.
git-svn-id: svn://10.0.0.236/trunk@51785 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:16:33 +00:00
jefft%netscape.com
002757422d fixed bug 17176 -- [DOGFOOD] [Reqression] Can't save attachment; we are not generating message uri correctly; r=mscott
git-svn-id: svn://10.0.0.236/trunk@51784 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-26 00:07:27 +00:00
bienvenu%netscape.com
b361c28994 turn off meteors and spinning barber pole for now r=mscott
git-svn-id: svn://10.0.0.236/trunk@51783 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:45:19 +00:00
ssu%netscape.com
719cf747d3 updated/added/removed install error values to accomodate the fileop
routines checked in over the weekend. r=sgehani.


git-svn-id: svn://10.0.0.236/trunk@51782 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:44:09 +00:00
ducarroz%netscape.com
e45bf9a654 Fix build bustage for nhotta
git-svn-id: svn://10.0.0.236/trunk@51781 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:29:24 +00:00
nhotta%netscape.com
bcc540225b Changed unicode conversion for mail send.
Added a fallback for unmapped characters, moved entity conversion after the unicode conversion as the fallback, avoided to convert twice for text/html case, part of bug fix 15475, r=rhp.


git-svn-id: svn://10.0.0.236/trunk@51780 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:21:30 +00:00
ssu%netscape.com
879c9f145f fixed parameter problem during compilation for sgehani. r=sgehani
git-svn-id: svn://10.0.0.236/trunk@51779 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:16:46 +00:00
kipp%netscape.com
3cbf0c252a Added missing resources
git-svn-id: svn://10.0.0.236/trunk@51778 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:06:05 +00:00
sgehani%netscape.com
32a0978c7e Fix for bug 17137: added complete and abort routines for mac alias creation XPInstall API. [r=ssu]
git-svn-id: svn://10.0.0.236/trunk@51777 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:05:44 +00:00
kipp%netscape.com
60ea075c3f Reduce the number of cases that trigger noisy debug noise
git-svn-id: svn://10.0.0.236/trunk@51776 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:05:31 +00:00
kipp%netscape.com
dfe78df5d9 Turned off some more debug noise
git-svn-id: svn://10.0.0.236/trunk@51775 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:05:15 +00:00
kipp%netscape.com
4bb755ead2 r=ftang,brade, bug=16886,9101 - the text transformer was letting some nbsp's through in a few special cases; the text transformer also squelches shy characters now (9101)
git-svn-id: svn://10.0.0.236/trunk@51774 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:04:51 +00:00
kipp%netscape.com
ae6b64e566 r=troy, bug=10497; we now support min/max width/height for image elements
git-svn-id: svn://10.0.0.236/trunk@51773 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:03:50 +00:00
kipp%netscape.com
df248f10b1 Quieted down some debug noise and added a missing newline to a printf
git-svn-id: svn://10.0.0.236/trunk@51772 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:02:43 +00:00
law%netscape.com
6f73e6604a Bug #14999; last holdout that was using toolkit app core - changed to use OpenDialog; r=davidm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51771 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 23:02:05 +00:00
dougt%netscape.com
11d905c2a9 ack! what was I thinking.
#ifdef'ing not including!!


git-svn-id: svn://10.0.0.236/trunk@51770 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:57:40 +00:00
morse%netscape.com
8bd629f104 fix bug 17172 -- wrong cookie is displayed, r=goodsger
git-svn-id: svn://10.0.0.236/trunk@51769 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:56:24 +00:00
kmcclusk%netscape.com
9bb05775e0 Register nsFormProcessor service to exercise nsIFormProcessor interface.
bug 17060. r=karnaze@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51768 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:54:12 +00:00
karnaze%netscape.com
f98a03f3ac bug 16284, 14159 nested auto table with percent cells was not growing auto table. nested coord or percent table was only getting min size.
git-svn-id: svn://10.0.0.236/trunk@51767 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:49:51 +00:00
dougt%netscape.com
bb554f06d2 adding nsIFile to nsXPComInit. Currently it is #ifdef'ed off.
bug 13320


git-svn-id: svn://10.0.0.236/trunk@51766 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:48:44 +00:00
kmcclusk%netscape.com
2f7a2a20da Call nsIFormProcessor service if it has been registered for each value submitted.
bug=17060 r=karnaze@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51765 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:48:43 +00:00
dougt%netscape.com
49cd195acc changed license.
git-svn-id: svn://10.0.0.236/trunk@51764 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:45:56 +00:00
dougt%netscape.com
ea0c601803 Initial checkin of nsIFile test. bug 13320. r=dougt
Not hooked up to build, yet.


git-svn-id: svn://10.0.0.236/trunk@51763 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:45:12 +00:00
dougt%netscape.com
a2ec5f969a Initial checkin of nsIFile windows implementation. bug 13320. r=dougt
Not hooked up to build, yet.


git-svn-id: svn://10.0.0.236/trunk@51762 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:44:42 +00:00
akhil.arora%sun.com
bb01f7852c 15579 r=akhil.arora@sun.com Checkin by Igor Nekrestyanov <nis@sparc.spb.su>
Implementation of DOM Events from the W3c DOM Level 2 current working draft


git-svn-id: svn://10.0.0.236/trunk@51761 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:42:40 +00:00
dougt%netscape.com
6c8ce03672 adding a progID and className. r=me.
NOT PART OF THE BUILD, YET


git-svn-id: svn://10.0.0.236/trunk@51760 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:33:55 +00:00
dougt%netscape.com
6839959ccf Change net module notification to make proxies lazy. r=dveditz, mozbot.
This reduces memory overhead.


git-svn-id: svn://10.0.0.236/trunk@51759 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:31:59 +00:00
tbogard%aol.net
ae51cb2bce Added new nsIInterfaceRequestor interface. r=dp
git-svn-id: svn://10.0.0.236/trunk@51758 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:31:40 +00:00
law%netscape.com
168d68ed9c Bug #14999; use OpenDialog instead of toolkit app core; r=radha@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51757 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:30:40 +00:00
kmcclusk%netscape.com
64e09df2b9 Export nsIFormProcessor.h on Mac. bug=17060; r=karnaze@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51756 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:29:22 +00:00
norris%netscape.com
a6a5735f6c Fix 11963 Need security controls on javascript: urls
r=mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51755 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:23:25 +00:00
norris%netscape.com
68023d9210 Use NS_GET_IID, remove dead code, clean up error conditions for XPConnect security calls.
r=jband


git-svn-id: svn://10.0.0.236/trunk@51754 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:22:16 +00:00
norris%netscape.com
2c73987122 Expose referrer from web shell.
r=travis
needed for bug 11963.


git-svn-id: svn://10.0.0.236/trunk@51753 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:20:10 +00:00
ftang%netscape.com
80f773ac31 fix not enough gap between IME selection problem. r=erik
git-svn-id: svn://10.0.0.236/trunk@51752 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:18:41 +00:00
ftang%netscape.com
13ed9a026b delete nsTextRange array after dispatch the text event. fix wrong array indexing. Fix platform to NS attribute mapping problem. r=tague
git-svn-id: svn://10.0.0.236/trunk@51751 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:17:09 +00:00
rods%netscape.com
2c0b3223a2 Export nsIFormProcessor.h on Linux. bug=17060 r=karnaze@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51750 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:14:21 +00:00
rhp%netscape.com
a2e9eb0c8e Fix for extra conversion - r: nhotta
git-svn-id: svn://10.0.0.236/trunk@51749 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:13:39 +00:00
akkana%netscape.com
b3f6f6906c 15463: Re-enable XIM code, add keycode mappings for shifted characters
git-svn-id: svn://10.0.0.236/trunk@51748 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:11:23 +00:00
putterman%netscape.com
2a9fdcf10a Fixes 12894. Messages show up bold again if they are unread. reviewed by bienvenu.
git-svn-id: svn://10.0.0.236/trunk@51747 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:10:32 +00:00
alecf%netscape.com
6436fc3afa fix for #17187 - return NS_RDF_NO_VALUE when any particular GetTarget() calls fail
r=bienvenu


git-svn-id: svn://10.0.0.236/trunk@51746 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:09:07 +00:00
kmcclusk%netscape.com
cee3171b28 Removed build warning caused by overloaded GetDesiredSize. bug=15575. r=buster@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51745 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:06:41 +00:00
nhotta%netscape.com
58f8c6d8d9 Added MsgUtil.lib and MsgUtilDebug.lib to the project, part of bug fix 15475.
git-svn-id: svn://10.0.0.236/trunk@51744 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:04:23 +00:00
nhotta%netscape.com
b5fc1e2670 Changed MIME header encoder in unicode conversion. Instead of skipping unmapped characters,
call the fallback funcion (puts a question mark for an unmapped char), part of bug fix 15475, r=rhp.


git-svn-id: svn://10.0.0.236/trunk@51743 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:03:09 +00:00
putterman%netscape.com
c473237102 Fix 17107. A bunch of view navigation bugs. Reviewed by bienvenu. It fixes:
1.  Next message with no selection finds the next message
2.  It no longer redisplays current message if Next Message finds no next message.
3.  Next/Previous message works if last/first message is selected.


git-svn-id: svn://10.0.0.236/trunk@51742 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:02:58 +00:00
kmcclusk%netscape.com
3a21a346ef Export nsIFormProcessor.h. bug=17060. r=karnaze@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51741 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 22:01:19 +00:00
kmcclusk%netscape.com
389e1be499 First time checked in. Used to provide data during form submission. bug 17060. r=karnaze@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51740 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 21:59:39 +00:00
brade%netscape.com
b77f113bda fix plain text editor (r=cmanske@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@51739 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 21:57:11 +00:00
brade%netscape.com
56be896120 fix plain text editor (r=cmanske@netscape.com, jfrancis@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@51738 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 21:56:37 +00:00
nisheeth%netscape.com
427d3f559c Ongoing work to get macros for timing modules up and running. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@51737 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 20:59:35 +00:00
jefft%netscape.com
86ba1460c9 fixed bug 17179 -- [dogfood] [BLOCKER] Sending a message does not work; escape the recipient list fixes the problem; r=mscott, a=granrose
git-svn-id: svn://10.0.0.236/trunk@51735 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 20:17:01 +00:00
brendan%mozilla.org
b3a1017637 - Chouck's changes to grow a JSIdArray if necessary in JS_Enumerate, with my
code review and fixes (r=chouck@geocast.com).  He needs this cuz he has no
  knowledge of exact number of properties before new-style enumerating them.
- Patch up jsdbgapi.c a bit -- it needs to use OBJ_GET_ATTRIBUTES and new APIs
  to do a better job describing properties to a debugger.
- Add JSMSG_CANT_DESCRIBE_PROPS for bogus non-native error case in jsdbgapi.c.
- Fix "Inappropriate" => "invalid" in JSMSG_BAD_ARRAY_LENGTH message.


git-svn-id: svn://10.0.0.236/trunk@51734 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 19:24:03 +00:00
wtc%netscape.com
50b0c89090 Bugzilla bug #17093: made plevent.c independent of any internal NSPR
headers (primpl.h in particular).  Tested on Linux, Solaris, Win32,
and Mac. r=srinivas@netscape.com
Modified files: lib/ds/Makefile, lib/ds/Makefile.in, lib/ds/plevent.c


git-svn-id: svn://10.0.0.236/trunk@51733 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 19:20:58 +00:00
rhp%netscape.com
b8a92b1146 Fix for composition quoting and cleanup for dogfood - Bug# 16703 16907 7518 - r: bienvenu
git-svn-id: svn://10.0.0.236/trunk@51732 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 19:04:56 +00:00
rhp%netscape.com
2624eb5719 Fix for attachments not visible and display crashers - Bug #: 16367 16786 - r: bienvenu
git-svn-id: svn://10.0.0.236/trunk@51731 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 19:02:39 +00:00
slamm%netscape.com
3ea969fa03 Need double quotes instead of single quotes to get variable values (fix bloat.pl).
git-svn-id: svn://10.0.0.236/trunk@51730 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 18:02:06 +00:00
norris%netscape.com
10dca74c3e Add contributors.
git-svn-id: svn://10.0.0.236/trunk@51729 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 17:52:48 +00:00
norris%netscape.com
32c0c98b21 Add license text.
git-svn-id: svn://10.0.0.236/trunk@51728 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 17:41:49 +00:00
norris%netscape.com
0034cf42f1 Add license boilerplate.
git-svn-id: svn://10.0.0.236/trunk@51727 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 17:36:20 +00:00
slamm%netscape.com
c6ce018a7f Need to 'require' treedata.pl to get warnings and bloat pattern strings.
git-svn-id: svn://10.0.0.236/trunk@51726 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 17:31:39 +00:00
norris%netscape.com
72dc3d0896 Should get ReferenceError exception for name not found.
git-svn-id: svn://10.0.0.236/trunk@51723 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 16:41:24 +00:00
norris%netscape.com
f8261501a4 Add contributors.
git-svn-id: svn://10.0.0.236/trunk@51722 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 16:40:30 +00:00
pavlov%netscape.com
36aeea55b5 don't install registry.rdf r=ramiro
git-svn-id: svn://10.0.0.236/trunk@51718 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 14:57:24 +00:00
pavlov%netscape.com
e70752a644 makefile changes for the Editor to editor.css change r=hyatt,ramiro
git-svn-id: svn://10.0.0.236/trunk@51717 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 14:56:35 +00:00
kin%netscape.com
d9ba7b42e8 Fix for bug #16701: Editor API Log playback of Insert HRule crashes in DOM code
and     bug #16848: DOM Crash
  - Removed extra NS_RELEASE(attrPrivate) call that was releasing
    attrPrivate one too many times, and causing nsDOMAttributeMap::SetNamedItem() to crash.
r=vidur@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51716 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 14:15:34 +00:00
morse%netscape.com
abe3c3c6c8 fixed typos, no code review
git-svn-id: svn://10.0.0.236/trunk@51715 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 13:13:48 +00:00
rods%netscape.com
8df8f94df3 added some more tests
git-svn-id: svn://10.0.0.236/trunk@51714 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 13:03:47 +00:00
duncan%be.com
5cabd411f1 Fix build under BeOS. r=dveditz
git-svn-id: svn://10.0.0.236/trunk@51713 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 06:22:43 +00:00
nisheeth%netscape.com
341cd407a6 Macros for doing performance analysis of modules in Mozilla. This file is not part of the build yet.
git-svn-id: svn://10.0.0.236/trunk@51712 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 05:29:20 +00:00
varada%netscape.com
70051f68b3 clearing up some code
git-svn-id: svn://10.0.0.236/trunk@51711 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 05:14:12 +00:00
tbogard%aol.net
58ff9e6cc4 Added build directory to build a DLL for various docShells.
git-svn-id: svn://10.0.0.236/trunk@51710 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:53:13 +00:00
tbogard%aol.net
34c9d3fa3e Clarified some documentation.
git-svn-id: svn://10.0.0.236/trunk@51709 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:51:59 +00:00
tbogard%aol.net
4cab253cb0 Fixed a Caps problem.
git-svn-id: svn://10.0.0.236/trunk@51708 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:51:15 +00:00
tbogard%aol.net
14fc92dac1 Framed out the nsHTMLDocShell implementation. Setup to build a library.
git-svn-id: svn://10.0.0.236/trunk@51707 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:50:22 +00:00
tbogard%aol.net
671fe34afb Defined what nsCHTMLDocShell implements and included the appropriate header files.
git-svn-id: svn://10.0.0.236/trunk@51706 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:48:14 +00:00
karnaze%netscape.com
46cade08ac bug 5799 - considers percentage width of multiple cells when figuring width of auto table.
git-svn-id: svn://10.0.0.236/trunk@51705 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:34:28 +00:00
karnaze%netscape.com
18a5e00d6a new regression tests
git-svn-id: svn://10.0.0.236/trunk@51704 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 04:30:54 +00:00
tbogard%aol.net
9fa90714c2 Just added support for an NS_IMPL_ISUPPORTS 7 - 10.
git-svn-id: svn://10.0.0.236/trunk@51703 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 03:42:10 +00:00
varada%netscape.com
55871f81f5 fix for bug #17011 create copy (for config)invokes a window with text relevant to copy in it
git-svn-id: svn://10.0.0.236/trunk@51702 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 03:26:48 +00:00
gagan%netscape.com
e14999de24 Added profiling info for measuring performance when doing -all. Test case only.
git-svn-id: svn://10.0.0.236/trunk@51701 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 02:22:30 +00:00
varada%netscape.com
27f90cbea7 fix for bug 16977 - only edit fields showing up in the show summary button
git-svn-id: svn://10.0.0.236/trunk@51700 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 01:54:32 +00:00
dp%netscape.com
5871c388a1 bug# 15513 Removing dlldeps.cpp from RDF unix build. Patch from
waterson r=dp


git-svn-id: svn://10.0.0.236/trunk@51699 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 00:37:24 +00:00
sdagley%netscape.com
737d3b892e Pre-emptive fix for Mac (and possibly some ports) build bustage - if you're going to use a variable to contain a debug output file name it helps if the variable is declared on all platforms the code compiles for.
git-svn-id: svn://10.0.0.236/trunk@51698 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-25 00:29:15 +00:00
rickg%netscape.com
0aa148382a fixed FMM (in debug code); r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@51697 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 23:48:00 +00:00
mcafee%netscape.com
15b4b203b5 Adding XPCOM_MEM_BLOAT_LOG=1 for RunBloatTest.
git-svn-id: svn://10.0.0.236/trunk@51696 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 22:37:34 +00:00
gagan%netscape.com
bd175bcc62 Fixed bug 15963. Host: headers were not including port numbers. r=mozbot,a=self. (/msg mozbot do these diffs look ok to you? Should I continue with my checkin? <CR> mozbot: That is interesting. Please continue. )
git-svn-id: svn://10.0.0.236/trunk@51695 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 22:20:52 +00:00
warren%netscape.com
c9c3ab2262 Fixed up dll loading for Windows. It was silently failing.
git-svn-id: svn://10.0.0.236/trunk@51694 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 22:01:09 +00:00
dp%netscape.com
ccb30ad195 bug#16742 Fixing delete on nsISupports. Thanks for patch from
<heikki@citec.fi> Plus using IMPL_ and DECL_ macros and removing
operating on refcnt directly. r=troy r=dp


git-svn-id: svn://10.0.0.236/trunk@51693 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 16:19:42 +00:00
tonyr%fbdesigns.com
c9b397be49 Updated address book cls id names that changed
git-svn-id: svn://10.0.0.236/trunk@51692 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 16:09:21 +00:00
rods%netscape.com
5926a49df7 added more tests
git-svn-id: svn://10.0.0.236/trunk@51691 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 16:04:17 +00:00
rods%netscape.com
a16142db50 updated test
git-svn-id: svn://10.0.0.236/trunk@51690 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 15:07:41 +00:00
rods%netscape.com
26d3fe5556 added file
git-svn-id: svn://10.0.0.236/trunk@51689 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 15:07:25 +00:00
rods%netscape.com
6579bbdd80 added more tests
git-svn-id: svn://10.0.0.236/trunk@51688 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 14:05:44 +00:00
ramiro%fateware.com
b15a17bfcb Simplify the package list file.
git-svn-id: svn://10.0.0.236/trunk@51687 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 13:44:34 +00:00
pavlov%netscape.com
185c67ee12 remove registry.rdf r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51686 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 09:57:49 +00:00
pavlov%netscape.com
f346c3e821 fix build problems on linux r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51685 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 09:20:49 +00:00
warren%netscape.com
b9ca6db5fa Fixed logic for XPCOM_MEM_LOG_CLASSES case.
git-svn-id: svn://10.0.0.236/trunk@51684 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 09:13:52 +00:00
hyatt%netscape.com
68f0c59d3a chrome registry can now be dynamically built from RDF fragments t=pavlov
git-svn-id: svn://10.0.0.236/trunk@51683 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 09:00:41 +00:00
hyatt%netscape.com
e3d0859994 making chrome registry not be a single uber datasource anymore r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51682 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:27:12 +00:00
rpotts%netscape.com
c275b7fca5 Backing out the fix for bug #15560. This fixes the editor regression - bug #16937
git-svn-id: svn://10.0.0.236/trunk@51681 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:26:54 +00:00
pavlov%netscape.com
697deffc1d rename PrefsWindow.xul so that it can be better friends with the chrome registry r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51679 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:16:45 +00:00
pavlov%netscape.com
35c3e18a5e rename to be happy with the chrome registry r=hyatt
git-svn-id: svn://10.0.0.236/trunk@51678 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:07:04 +00:00
pavlov%netscape.com
17d1767696 renaming file to be consistant with chrome registry
git-svn-id: svn://10.0.0.236/trunk@51677 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 07:00:53 +00:00
hyatt%netscape.com
f44eb6e877 make registry work without needing an rdf datasource r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51676 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 06:59:30 +00:00
hyatt%netscape.com
dd85258734 renaming skin.css to global.css r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51675 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 06:58:38 +00:00
dp%netscape.com
5f7aa39be5 bug#16742 Fixing delete on nsISupports. Thanks for patch from <heikki@citec.fi> Plus using IMPL_ and DECL_ macros and removing operating on refcnt directly. r=dp
git-svn-id: svn://10.0.0.236/trunk@51674 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 04:41:17 +00:00
beard%netscape.com
b500a68477 changed GC_abort() to call ExitToShell() rather than abort(). bug=15906
git-svn-id: svn://10.0.0.236/trunk@51673 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 03:26:10 +00:00
rods%netscape.com
d0c68ca52f Simple changed from COLOR_DESKTOP to COLOR_APPWORKSPACE for appworkspace enum
for css 2 color setting
fixes bug 16853,r=none


git-svn-id: svn://10.0.0.236/trunk@51672 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 03:03:38 +00:00
beard%netscape.com
964164ffe9 removed obsolete access paths. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@51671 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 02:45:17 +00:00
varada%netscape.com
676eaa791f fix to bug #16981 changed Text field to editbox so that value can be enterred
git-svn-id: svn://10.0.0.236/trunk@51670 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 02:23:44 +00:00
varada%netscape.com
de47ad8dca fix to bug#16973 - nci file editor field is made dynamic text - can be changed only using file browsing
git-svn-id: svn://10.0.0.236/trunk@51669 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 02:18:17 +00:00
varada%netscape.com
66774f2d49 fix for bug #7850 - have to call function depend on the Next button on the ini file
git-svn-id: svn://10.0.0.236/trunk@51668 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 02:04:37 +00:00
ssu%netscape.com
2aa8ec93a3 fixes bugs #15394, #15603, part of #15644, and #15487. r=sgehani. The
xpinstall fileops functions have been updated to perform error detection
as much as it can prior to executing the command.


git-svn-id: svn://10.0.0.236/trunk@51667 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-24 01:07:45 +00:00
mscott%netscape.com
684b3cc1bb Bug #16927 add GetMessageUrlFromUri to nsIMsgMessageService
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51666 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 23:39:57 +00:00
mscott%netscape.com
0b058cd771 Bug #16927 implement GetMessageUrlFromUri
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51665 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 23:39:28 +00:00
troy%netscape.com
d79892b99d Changed nsTextFrame to be derived from nsFrame instead of nsSplittableFrame.
nsTextFrame now has only a next-in-flow pointer and no prev-in-flow pointer.
Subclass nsContinuingTextFrame is used for continuing text frames; it has a
prev-in-flow pointer. This saves 4 bytes


git-svn-id: svn://10.0.0.236/trunk@51664 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 23:19:14 +00:00
troy%netscape.com
5859acba05 Space reductions for nsTableRowFrame. Changed mInitializedChildren to be a
frame state bit, and changed mMinRowSpan and mRowIndex to be packed into
one 32-bit field. Total savings of 8 bytes per row frame


git-svn-id: svn://10.0.0.236/trunk@51663 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 23:08:30 +00:00
dp%netscape.com
1e5c5df64f bug#16742 Fixing delete on nsISupports. Thanks for patch from
<heikki@citec.fi> r=dp


git-svn-id: svn://10.0.0.236/trunk@51662 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 17:34:55 +00:00
dp%netscape.com
b534e205fe bug#16742 Fixing delete on nsISupports. Thanks for patch from <heikki@citec.fi> Plus using IMPL_ and DECL_ macros and removing operating on refcnt directly. r=dp
git-svn-id: svn://10.0.0.236/trunk@51661 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 17:33:29 +00:00
duncan%be.com
5ebdcee645 Make profile manager build under BeOS.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51660 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 17:13:55 +00:00
beard%netscape.com
8678f1bdd7 never consider code offsets greater than the offset of the instruction, which ensures that the returned file offset is always correct. bug=15906
git-svn-id: svn://10.0.0.236/trunk@51659 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 15:57:31 +00:00
tbogard%aol.net
ac565dc536 Framed out nsWebBrowser implementation. Basically just added all the interface functions. Code now has a place to live.
git-svn-id: svn://10.0.0.236/trunk@51658 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 07:56:27 +00:00
tbogard%aol.net
92612afa70 Added some includes of the interfaces that make up nsCWebBrowser
git-svn-id: svn://10.0.0.236/trunk@51657 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 07:55:39 +00:00
tbogard%aol.net
e9e6e9c241 Just changed some comments and function ordering.
git-svn-id: svn://10.0.0.236/trunk@51656 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 07:51:45 +00:00
jband%netscape.com
d7cf1d350b r=mccabe
Primarily fixes to properly handle nsIXPCSecurityManager vetos of
xpconnect activities.

- The code was not propagating security manager vetos of native wrapping up
through xpconnect internals. So, xpconnect was erroneously masking the
security exception with its own 'failed to convert param' exception.
This effects the signatures of nsXPCWrappedNative::GetNewOrUsedWrapper
and nsXPCWrappedJSClass::GetNewOrUsedClass.

- This propagation also helps with the problem that sometimes interfaces
are not set as [scriptable] and we did not make that clear as the source
of xpconnect's failure to convert a param in calling a method. Now this
specific class of exceptions is indicated in the JS exception object when
this happens.

- Added an explicit call to js_ForceGC on shutdown of xpcshell to aid in
avoiding 'false positives' in leak detection

- Return JS_FALSE rather than JS_TRUE when an exception is thrown in
xpcjsid to make the jsengine notices the exception.

- Move #includes that others added in xpcmodule.cpp to xpcprivate.h in
order to maintain the include conventions of this module.

- Avoid throwing an exception if it represents a security manager veto
and the security manager set an exception already.

- Replace uses of nsCOMTypeInfo<> added by scc with NS_GET_IID macros.

- Fixed a methodname misspelling because reviewers care about stuff
like that :)


git-svn-id: svn://10.0.0.236/trunk@51655 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 07:20:04 +00:00
tbogard%aol.net
398c14c4d0 Just added support for an NS_IMPL_ISUPPORTS6.
git-svn-id: svn://10.0.0.236/trunk@51654 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 06:55:45 +00:00
dp%netscape.com
40ee849701 bug# 16742 Fixing delete on nsISupports Thanks for patch from <heikki@citec.fi>. r=dp
git-svn-id: svn://10.0.0.236/trunk@51639 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 06:15:31 +00:00
dp%netscape.com
cc26158c98 bug#16742 Fixing delete on nsISupports. Thanks for patch from
<heikki@citec.fi> Plus using IMPL_ and DECL_ macros and removing
operating on refcnt directly. r=dp


git-svn-id: svn://10.0.0.236/trunk@51638 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 05:45:41 +00:00
dp%netscape.com
259487cdf7 bug#16762 Removing delete on a nsISupports. Thanks to
<heikki@citec.fi> Plus changes to use DECL_ and IMPL_ macros and not
hand define mrefcnt. r=dp


git-svn-id: svn://10.0.0.236/trunk@51637 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 05:31:46 +00:00
ducarroz%netscape.com
6a5732fdec Bug 14258, implement Send Page, R=alecf
git-svn-id: svn://10.0.0.236/trunk@51636 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 04:51:40 +00:00
dougt%netscape.com
9544338359 Modification based on design review.
(THIS IS NOT PART OF THE BUILD YET)


git-svn-id: svn://10.0.0.236/trunk@51635 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 04:51:35 +00:00
ducarroz%netscape.com
798afa71eb Bug 14258, implement Send Page. R=alecf
git-svn-id: svn://10.0.0.236/trunk@51634 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 04:50:20 +00:00
varada%netscape.com
35cf097c8a fix for bug #10806
git-svn-id: svn://10.0.0.236/trunk@51633 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:41:41 +00:00
varada%netscape.com
fd98dc9090 fix for bug #5987
git-svn-id: svn://10.0.0.236/trunk@51632 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:30:43 +00:00
warren%netscape.com
95063f0074 Fixed warnings.
git-svn-id: svn://10.0.0.236/trunk@51631 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:16:27 +00:00
warren%netscape.com
dc65f370b6 Extended docs to talk about new env vars, and how to read bloat logs.
git-svn-id: svn://10.0.0.236/trunk@51630 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:16:23 +00:00
warren%netscape.com
c8d6aed234 Cleaned up nsTraceRefcnt environment variables. r=kipp,beard
git-svn-id: svn://10.0.0.236/trunk@51629 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:16:19 +00:00
troy%netscape.com
c16f001bc8 Changed Run() to give priority to system messages when pumping
messsages. These are the same changes that I made to viewer's message
pump on 9/13/99


git-svn-id: svn://10.0.0.236/trunk@51628 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:09:30 +00:00
rickg%netscape.com
a553c7ea86 fixed infinite-loop bug 17045 by conditioning control loop. r=buster
git-svn-id: svn://10.0.0.236/trunk@51627 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:06:19 +00:00
troy%netscape.com
feca3d387f Changed Clear() to check for a shared node arena
git-svn-id: svn://10.0.0.236/trunk@51626 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 03:04:21 +00:00
troy%netscape.com
3972c8f69a Removed a comment
git-svn-id: svn://10.0.0.236/trunk@51624 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 02:27:07 +00:00
nisheeth%netscape.com
b6ce91bcb5 r=troy. Siblings of frames get traversed iteratively during capturing/restoring of state. Earlier they were traversed recursively which was causing the call stack to grow too large.
git-svn-id: svn://10.0.0.236/trunk@51623 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:43:49 +00:00
slamm%netscape.com
7c904e3aa8 Add bloat processing. Cleanup tacky code.
git-svn-id: svn://10.0.0.236/trunk@51622 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:43:28 +00:00
slamm%netscape.com
1cd3dc4f49 Take out debug statement.
git-svn-id: svn://10.0.0.236/trunk@51621 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:35:40 +00:00
beard%netscape.com
4d41f52154 added line hiliting in -blame mode.
git-svn-id: svn://10.0.0.236/trunk@51619 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:33:42 +00:00
sspitzer%netscape.com
cfadbaffa1 remove pref-select.html, it is obsolete.
git-svn-id: svn://10.0.0.236/trunk@51616 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:29:09 +00:00
sspitzer%netscape.com
992247191f remove PrefsWindow.html, it is obsolete.
git-svn-id: svn://10.0.0.236/trunk@51615 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:26:07 +00:00
slamm%netscape.com
e95f03bd55 Parse build logs for bloat data from warren@netscape.com's bloat tool.
git-svn-id: svn://10.0.0.236/trunk@51614 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:22:41 +00:00
selmer%netscape.com
2cee86d35e Include IB into the wizard
git-svn-id: svn://10.0.0.236/trunk@51613 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:21:09 +00:00
slamm%netscape.com
4d6f026b73 Load bloat data. Clean up load_who().
git-svn-id: svn://10.0.0.236/trunk@51612 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:18:25 +00:00
slamm%netscape.com
5b100726d8 Add bloat data to tree cells that have it.
git-svn-id: svn://10.0.0.236/trunk@51611 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:18:04 +00:00
pavlov%netscape.com
da0e9ca233 add ScrollRect method to nsIWidget -- implimented on linux and stubbed in nsBaseWidget for mac and windows. Added ifdef'd scrolling code that makes scrolling really fast on linux. Updated nsIWidget.idl (not built) to merge some changes from a branch and added ScrollRect. Added ifdefs for using gtk_fixed instead of gtk_layout as part of the new scrolling code.
git-svn-id: svn://10.0.0.236/trunk@51610 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:17:20 +00:00
bienvenu%netscape.com
b9244d6491 cleanup dbs at shutdown, r=mscott
git-svn-id: svn://10.0.0.236/trunk@51609 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:13:10 +00:00
morse%netscape.com
6045d43774 fix bug 16753, memory leak, r=rjc
git-svn-id: svn://10.0.0.236/trunk@51608 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 01:01:58 +00:00
gagan%netscape.com
e5e1218aae Post requests are now only read upto the specified amount. Not in the build.
git-svn-id: svn://10.0.0.236/trunk@51607 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:47:24 +00:00
varada%netscape.com
91451df7a3 fixes to bug#14014
git-svn-id: svn://10.0.0.236/trunk@51606 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:38:51 +00:00
varada%netscape.com
5ea1cd0e4c fixes to bug #2794
git-svn-id: svn://10.0.0.236/trunk@51605 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:38:06 +00:00
beard%netscape.com
d7abad5a6c fixing breakage by #undef BlockAllocCat
git-svn-id: svn://10.0.0.236/trunk@51604 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:21:17 +00:00
ramiro%fateware.com
0816082384 Add lots of comments. Deal with %dir. Deal with duplicate entries.
Properly call regxpcom each time components get installed.
Not part of SeaMonkey.


git-svn-id: svn://10.0.0.236/trunk@51603 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:15:23 +00:00
selmer%netscape.com
17b7d985c2 Fixups to makefile system for globals dll
git-svn-id: svn://10.0.0.236/trunk@51602 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:12:13 +00:00
selmer%netscape.com
a1f6f3c1a3 Feeble first DLL for IB
git-svn-id: svn://10.0.0.236/trunk@51601 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:10:24 +00:00
pnunn%netscape.com
efe6dfa795 fix for mac bustage. pnunn.
git-svn-id: svn://10.0.0.236/trunk@51600 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-23 00:10:14 +00:00
selmer%netscape.com
52de2be8a7 adding globals
git-svn-id: svn://10.0.0.236/trunk@51598 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:46:35 +00:00
selmer%netscape.com
36e4eb89ff globalizing includes
git-svn-id: svn://10.0.0.236/trunk@51597 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:45:20 +00:00
dmose%mozilla.org
d924535fa1 cmd/winfe lives on in the MozillaClassic branch only. removing from the trunk. a=leaf@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@51596 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:44:52 +00:00
selmer%netscape.com
5b578df427 globals into a dll
git-svn-id: svn://10.0.0.236/trunk@51595 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:42:02 +00:00
sspitzer%netscape.com
1668a389f4 make the xul look pretty by using html fieldsets and legends.
git-svn-id: svn://10.0.0.236/trunk@51593 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:31:05 +00:00
ramiro%fateware.com
295053baa2 Dont put the static rdfutil thing inside the FORCE_ALL block. r=alecf.
git-svn-id: svn://10.0.0.236/trunk@51592 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:28:30 +00:00
selmer%netscape.com
00ffb48018 Globals implementation
git-svn-id: svn://10.0.0.236/trunk@51591 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:28:27 +00:00
sspitzer%netscape.com
54b8cc865e changes for correctness and to make the pref ui look better.
git-svn-id: svn://10.0.0.236/trunk@51590 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:27:43 +00:00
sspitzer%netscape.com
aaff3bbf7e make the xul look pretty by using html fieldsets and legends.
fix #17078:  fix the xul so that pref-messages.xul stops asserting like mad or crashing.


git-svn-id: svn://10.0.0.236/trunk@51589 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:25:18 +00:00
sspitzer%netscape.com
17aab81855 make the xul look pretty by using html fieldsets and legends.
git-svn-id: svn://10.0.0.236/trunk@51588 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:22:52 +00:00
endico%mozilla.org
bb01bac34c improve error message mailed when cvs update dies
git-svn-id: svn://10.0.0.236/trunk@51587 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 23:07:44 +00:00
beard%netscape.com
f0acfa932d #include "xp_mcom.h" to fix link breakage.
git-svn-id: svn://10.0.0.236/trunk@51586 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:58:28 +00:00
radha%netscape.com
3139e13324 Turning off debug flag that got set in my previous checkin
git-svn-id: svn://10.0.0.236/trunk@51585 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:58:16 +00:00
beard%netscape.com
fb7e21676d MLK: Fixed implementations of QueryInterface, AddRef, and Release to perform correct reference counting. bug=15380, r=evaughan
git-svn-id: svn://10.0.0.236/trunk@51584 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:50:01 +00:00
pnunn%netscape.com
0ac69a866f To fix mac bustage. pnunn.
git-svn-id: svn://10.0.0.236/trunk@51583 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:48:04 +00:00
beard%netscape.com
2a64a10c92 synched.
git-svn-id: svn://10.0.0.236/trunk@51582 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:39:51 +00:00
beard%netscape.com
5d5cc2a548 changed SharedGlobal.java to Global.java
git-svn-id: svn://10.0.0.236/trunk@51581 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:39:23 +00:00
norris%netscape.com
986ea91e68 Changes for improved errors-as-exceptions handling.
git-svn-id: svn://10.0.0.236/trunk@51578 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:02:58 +00:00
norris%netscape.com
92ab48d1d8 Use simpler, more widely applicable structure for global. Also avoids test failure for Function called as a function.
git-svn-id: svn://10.0.0.236/trunk@51577 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 22:00:21 +00:00
endico%mozilla.org
9b64c7df39 cvs error notification was busted
git-svn-id: svn://10.0.0.236/trunk@51576 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:59:10 +00:00
norris%netscape.com
a59a557d7d A NativeString object shouldn't be unwrapped to a primitive.
git-svn-id: svn://10.0.0.236/trunk@51575 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:58:54 +00:00
pnunn%netscape.com
4791c61ec9 bug#16785: forgot to checkin the include file change. Removing old, obsolete get image type call.
pnunn.


git-svn-id: svn://10.0.0.236/trunk@51574 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:46:56 +00:00
danm%netscape.com
abe94c118b set window title using multibyte. submitted by jamestoder@yahoo.com. r:ftang@netscape.com, by lack of timely objection.
git-svn-id: svn://10.0.0.236/trunk@51573 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:45:19 +00:00
sspitzer%netscape.com
35c39da3d2 fix typo. #17087.
"I think about the education that I missed.  but then my homework was never quite like this.  Got it bad, got it bad, got it bad..."


git-svn-id: svn://10.0.0.236/trunk@51572 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:41:13 +00:00
danm%netscape.com
0750508062 making GetACPString parameter const. part of submission from jamestoder@yahoo.com. r:me
git-svn-id: svn://10.0.0.236/trunk@51571 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:41:04 +00:00
akkana%netscape.com
e9db800eb8 Update a few of the standalone tests. Not part of the build
git-svn-id: svn://10.0.0.236/trunk@51570 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:35:16 +00:00
gagan%netscape.com
78b44f58d8 a dummy post request file for testing post requests in HTTP. not in the build.
git-svn-id: svn://10.0.0.236/trunk@51569 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:27:38 +00:00
gagan%netscape.com
6955bb58c9 Added /post test as well. Not in the build.
git-svn-id: svn://10.0.0.236/trunk@51568 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:24:57 +00:00
gagan%netscape.com
ce76e5ae7d Added stuff to the test server to handle post requests as well. Not in the build.
git-svn-id: svn://10.0.0.236/trunk@51567 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:21:30 +00:00
ftang%netscape.com
59e649828f fix locale mapping for CLE. r=ftang
git-svn-id: svn://10.0.0.236/trunk@51566 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:11:50 +00:00
bienvenu%netscape.com
0ef6e9d38d one more news leak fix r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@51565 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:11:17 +00:00
alecf%netscape.com
31378ed4eb update status
git-svn-id: svn://10.0.0.236/trunk@51564 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:06:59 +00:00
pnunn%netscape.com
c4d7a55705 bug#16785. r:neeti@netscape.com. Clean up after changing mime handling in imglib.
git-svn-id: svn://10.0.0.236/trunk@51563 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:06:28 +00:00
alecf%netscape.com
ba7f0a4cb5 prefwindow is now a service thanks to nsIModule conversion
git-svn-id: svn://10.0.0.236/trunk@51562 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:06:26 +00:00
srinivas%netscape.com
2068a5408d OpenVMS updates by colin@theblakes.com
git-svn-id: svn://10.0.0.236/trunk@51561 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:06:08 +00:00
alecf%netscape.com
450ceda4e0 convert nsPrefWindow to a module
prefwindow was doing it's own singleton management, so changed it to use getService()


git-svn-id: svn://10.0.0.236/trunk@51560 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:05:31 +00:00
bienvenu%netscape.com
16ace9def7 one more addrbook memory leak fix r=mscott
git-svn-id: svn://10.0.0.236/trunk@51559 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:04:45 +00:00
pnunn%netscape.com
42f2519c84 bug#15585. r:neeti@netscape.com. Fix build warnings.
git-svn-id: svn://10.0.0.236/trunk@51558 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:04:28 +00:00
pnunn%netscape.com
4be52ad659 Bug#13505: r:neeti@netscape.com. Replace str()'s with nsCRT()'s & nspr()'s.
git-svn-id: svn://10.0.0.236/trunk@51556 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:03:52 +00:00
akkana%netscape.com
10a4fb8f22 16988: filter out BR type=_moz, which the editor inserts. r=syd
git-svn-id: svn://10.0.0.236/trunk@51555 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:03:29 +00:00
scc%netscape.com
866732108c File Removed.
git-svn-id: svn://10.0.0.236/trunk@51554 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:02:15 +00:00
srinivas%netscape.com
bf8979df4c PR_SetThreadPriority should set the priority unconditionally.
git-svn-id: svn://10.0.0.236/trunk@51553 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:01:51 +00:00
racham%netscape.com
3f91090fc5 r=sspitzer. Fix for bug 16209. This checkin fixes mozregistry entries to avoid crashes from M9 or builds prior to that
git-svn-id: svn://10.0.0.236/trunk@51552 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:00:53 +00:00
jefft%netscape.com
8f8c3afe28 fixed bug 11892 - [dogfood] When Name or Address of a recipient includes 8-bit characters address is incorrectly formed; not quoting name part of an email address; calling GetPath() instead of GetFileName() for all recipients; r=rhp, mscott
git-svn-id: svn://10.0.0.236/trunk@51551 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 21:00:07 +00:00
srinivas%netscape.com
d303858686 Fixed typo in debug statement.
git-svn-id: svn://10.0.0.236/trunk@51550 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:59:34 +00:00
srinivas%netscape.com
fe52fa5602 Defined _MD_PIPEAVAILABLE; checkin for "Duncan Wilcox" <duncan@be.com>.
git-svn-id: svn://10.0.0.236/trunk@51549 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:58:00 +00:00
srinivas%netscape.com
46e9b52597 Map the SO_BROADCAST option to invalid option, when not supported by the
system.


git-svn-id: svn://10.0.0.236/trunk@51548 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:56:25 +00:00
jband%netscape.com
d8c9cc6cae commiting patch from Duncan Wilcox <duncan@be.com> to get prototype right in prep for inline assembly call - some pick compilers didn't like unsigned int when it was really uint32. r=jband
git-svn-id: svn://10.0.0.236/trunk@51547 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:53:05 +00:00
jefft%netscape.com
5dd4804e4c fixed bug 17069 - Save As...File format list for saving a selected message shows a .hml for the HTML format; fix typo; r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@51546 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:52:56 +00:00
srinivas%netscape.com
1a74d3549b Add PR_SendFile to the PRIOMethods tables to enable use in layered FDs.
Bugzilla #17012.


git-svn-id: svn://10.0.0.236/trunk@51545 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:49:19 +00:00
radha%netscape.com
a285ab741e Clean up of Session History apis. Corresponding changes to the users of SH. r=mcafee. No bug #.
git-svn-id: svn://10.0.0.236/trunk@51544 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:48:07 +00:00
ducarroz%netscape.com
b21e040071 Fix for bug 15201. We need to convert back the result from UTF-8 to Unicode. R=mscott, bienvenu
git-svn-id: svn://10.0.0.236/trunk@51543 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:37:42 +00:00
bienvenu%netscape.com
8ce16092ef fix leaks in news/nntp r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@51542 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:33:04 +00:00
bienvenu%netscape.com
598ff07fea fix memory leaks in vcard and calendar factories r=rhp
git-svn-id: svn://10.0.0.236/trunk@51541 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:32:02 +00:00
mcafee%netscape.com
0f2352836a Fixing some mis-use error cases, adding comments. Added --testonly flag. code=slamm, r=mcafee
git-svn-id: svn://10.0.0.236/trunk@51540 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 20:31:56 +00:00
slamm%netscape.com
085f841b9d Fix typo.
git-svn-id: svn://10.0.0.236/trunk@51539 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 19:16:40 +00:00
slamm%netscape.com
cb3e8e41cc Add some comments. Describe data structures. Tidy up a bit.
git-svn-id: svn://10.0.0.236/trunk@51538 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 18:53:56 +00:00
norris%netscape.com
ee5e7e9f37 Shouldn't test for equality against the message string, which is implementation independent.
git-svn-id: svn://10.0.0.236/trunk@51537 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 18:33:46 +00:00
slamm%netscape.com
5c43a70394 Add filter for long long constants. Make sure summary table includes everyone (fix off by one error).
git-svn-id: svn://10.0.0.236/trunk@51536 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 17:34:16 +00:00
norris%netscape.com
484a8455bd Don't print out control characters that break the driver.
git-svn-id: svn://10.0.0.236/trunk@51535 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 17:31:59 +00:00
norris%netscape.com
38e1413a00 Fix formatting.
git-svn-id: svn://10.0.0.236/trunk@51534 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 16:58:30 +00:00
norris%netscape.com
e763168909 Fix javadoc
git-svn-id: svn://10.0.0.236/trunk@51533 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 16:56:56 +00:00
jmas%softcatala.org
85ccdaf936 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@51532 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 15:53:29 +00:00
troy%netscape.com
d16381b6f3 Removed 5 convenience functions from nsIFrame
git-svn-id: svn://10.0.0.236/trunk@51531 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 14:53:52 +00:00
kipp%netscape.com
2ed3a3fc6a Removed some more warnings
git-svn-id: svn://10.0.0.236/trunk@51530 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 14:51:41 +00:00
dcone%netscape.com
fd397214fb Fixed warning.
git-svn-id: svn://10.0.0.236/trunk@51529 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 13:29:06 +00:00
srinivas%netscape.com
be42687878 PL_ProcessPendingEvents() dispatches only those events currently on the
queue. Added a static helper function (_pl_GetEventCount) that locks the
monitor and counts the number of events in the queue. Checkin for troy.


git-svn-id: svn://10.0.0.236/trunk@51528 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 13:28:39 +00:00
dcone%netscape.com
d23e143664 Fixed the rounding on some transform math. r=kmkclusky
git-svn-id: svn://10.0.0.236/trunk@51527 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 13:28:22 +00:00
rods%netscape.com
285da5c5be adding test cases for form controls
git-svn-id: svn://10.0.0.236/trunk@51526 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 12:46:13 +00:00
braddr%puremagic.com
2e3aacd5dd Change NS_COMFALSE to NS_ERROR_INVALID_ARG. Every caller of LookupName
tests explicitly for NS_OK currently.
r=sleestack


git-svn-id: svn://10.0.0.236/trunk@51525 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 08:03:15 +00:00
briano%netscape.com
3e0f0a58b5 Automated update
git-svn-id: svn://10.0.0.236/trunk@51524 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 07:15:11 +00:00
ramiro%fateware.com
a5d3f6cc70 Removing the badly rotten MOZ_STRIP_NOT_EXPORTED hack. We now have a better
way to accomplish the same thing using linker version scripts.
r=cls@seawood.org


git-svn-id: svn://10.0.0.236/trunk@51521 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 07:11:43 +00:00
braddr%puremagic.com
5d7d8cded2 Change NS_COMFALSE to NS_ERROR_ABORT throughout the space manager.
r=smfr for these two files, and r=scc for the previous file


git-svn-id: svn://10.0.0.236/trunk@51520 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 06:49:50 +00:00
dp%netscape.com
7162f4cdbb bug# 9221 Fixing autoreg terminating on bad aliases. We now let it go
as far as possible ignoring errors. r=sfraser


git-svn-id: svn://10.0.0.236/trunk@51519 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 06:32:26 +00:00
rpotts%netscape.com
c6e185762b Fix build bustage on platforms that require full infor for nsCOMPtrs...
git-svn-id: svn://10.0.0.236/trunk@51518 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:56:19 +00:00
ramiro%fateware.com
4b4d193abc More rpm work in progress. Work around some bugs in rules.mk.
git-svn-id: svn://10.0.0.236/trunk@51517 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:55:29 +00:00
braddr%puremagic.com
ef38d2fd9c Change NS_COMFALSE instances to NS_ERROR_ABORT's
git-svn-id: svn://10.0.0.236/trunk@51516 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:32:31 +00:00
wtc%netscape.com
e83d506ed5 Removed temporary depend:clean hack.
git-svn-id: svn://10.0.0.236/trunk@51515 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:29:48 +00:00
rpotts%netscape.com
99e00aec99 bug #13054 (r=warren,gagan). Reworked the way requests are sent to the server. Now requests can be of an arbitrary size...
git-svn-id: svn://10.0.0.236/trunk@51514 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:13:01 +00:00
ramiro%fateware.com
dbec4b872f Link in raptorgfx dynamically to make the component properly loadable.
regxpcom was breaking on this one.  r=valeski


git-svn-id: svn://10.0.0.236/trunk@51513 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 05:06:39 +00:00
valeski%netscape.com
aedd1c1253 fixing build warning
git-svn-id: svn://10.0.0.236/trunk@51512 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:56:24 +00:00
valeski%netscape.com
3f594fbcb6 fixing build warning
git-svn-id: svn://10.0.0.236/trunk@51511 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:48:31 +00:00
dp%netscape.com
7da3eadc15 beautify...
git-svn-id: svn://10.0.0.236/trunk@51510 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:47:14 +00:00
valeski%netscape.com
5310cb0ddc removing last reference to nsFtpStreamListenerEvent.h. Actually it was a commented out line.
git-svn-id: svn://10.0.0.236/trunk@51508 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:33:19 +00:00
valeski%netscape.com
3d07f98f12 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@51507 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:32:18 +00:00
sfraser%netscape.com
f90deff3a6 Fixing Mac FTP projects for valeski
git-svn-id: svn://10.0.0.236/trunk@51506 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:24:08 +00:00
valeski%netscape.com
5f29d72129 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@51505 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:22:54 +00:00
valeski%netscape.com
d1271b7aa4 adding connection cache interface
git-svn-id: svn://10.0.0.236/trunk@51504 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:11:12 +00:00
valeski%netscape.com
455aa3e358 14659, r=dougt. FTP now uses xpcom proxies to send stream listener notifications back to the channel thread. it also uses them to access connections from the protocol handler cache.
git-svn-id: svn://10.0.0.236/trunk@51503 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:10:46 +00:00
valeski%netscape.com
77339b5eec 17039, r=dougt. Releasing QI'd proxy object was causing a crash. this is a temp work around.
git-svn-id: svn://10.0.0.236/trunk@51502 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:07:53 +00:00
troy%netscape.com
3a327d90e7 Fixed compiler warning about unused variable
git-svn-id: svn://10.0.0.236/trunk@51501 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 04:01:23 +00:00
rods%netscape.com
f690c63c37 Changed the parameter of the CalcNavQuirksSize to take the input spec instead of the length
not it properly calculates the number of cols and rows when in NavQuiks mode
r=kmcclusk, part of bug 7461


git-svn-id: svn://10.0.0.236/trunk@51498 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 03:14:03 +00:00
ramiro%fateware.com
21e92e4270 Made the spec file actually work. Not part of SeaMonkey.
git-svn-id: svn://10.0.0.236/trunk@51497 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:55:21 +00:00
ramiro%fateware.com
36b1b32126 Fixed the mozilla script. Not part of anything.
git-svn-id: svn://10.0.0.236/trunk@51496 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:54:23 +00:00
kipp%netscape.com
1a6f5307c4 r=pavlov; fixed up prioritization of the plevent queue so that it's lower than the normal priority; this fixes UI starvation on long document loads AND lets timers through so that painting works (bugs 7455, 6048, etc.)
git-svn-id: svn://10.0.0.236/trunk@51495 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:47:02 +00:00
tbogard%aol.net
e68aa79d1d Added building of the DLL.
git-svn-id: svn://10.0.0.236/trunk@51494 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:36:35 +00:00
tbogard%aol.net
1709ffcde6 Framed out nsWebBrowser. Added nsCWebBrowser definition. Setup to build library.
git-svn-id: svn://10.0.0.236/trunk@51493 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:35:18 +00:00
tbogard%aol.net
e598aadeba Fixed some syntax errors.
git-svn-id: svn://10.0.0.236/trunk@51492 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:32:28 +00:00
tbogard%aol.net
b577f2a1bc Framed out nsWebBrowserSetup. Added nsCWebBrowserSetup specification. Setup building of the library.
git-svn-id: svn://10.0.0.236/trunk@51491 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:30:51 +00:00
tbogard%aol.net
6408004f20 Fixed the naming.... Added some comments.
git-svn-id: svn://10.0.0.236/trunk@51490 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:29:29 +00:00
tbogard%aol.net
ee49ae552f Added nsCHTMLDocShell.
git-svn-id: svn://10.0.0.236/trunk@51489 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:27:42 +00:00
tbogard%aol.net
3dc8aba7a4 Added a C++ include of nsIPresContext.h
git-svn-id: svn://10.0.0.236/trunk@51488 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:26:35 +00:00
sspitzer%netscape.com
6eb15ceb38 add pref-mailnews.js, which has the necessary (but currently not working) JS for the color picker.
rewrite the xul so that the html select heeds the quote prefs.  (#15230)

use a color picker instead of an empty html select.


git-svn-id: svn://10.0.0.236/trunk@51487 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:10:49 +00:00
sspitzer%netscape.com
0cfb0a45bd make the PrefWindow work for html select dom elements, instead of just html input dom elements.
right now, it only works for int prefs.  fix #15230, heed and reflect the quoted style and quoted size prefs
in the html select widget in pref-mailnews.xul.

rewrite the html select elements in the pref xul, to work correctly.
remove unused, commented out xul to avoid confusion.

add new option for "yesterday" for the news offline download pref.
use nsCOMPtr. use PR_snprintf() to avoid potential buffer overruns.
use #defines to clean up the code.  use PR_sscanf instead of sscanf.

r=mscott


git-svn-id: svn://10.0.0.236/trunk@51486 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:09:18 +00:00
troy%netscape.com
54572af2e6 r=karnaze@netscape.com
Save 8 bytes per table cell frame by eliminating mCollapseOffset and
using a frame property instead.


git-svn-id: svn://10.0.0.236/trunk@51485 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 02:06:22 +00:00
bienvenu%netscape.com
de04e9ade9 always update folders when clicking on them r=putterman
git-svn-id: svn://10.0.0.236/trunk@51484 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:59:50 +00:00
amusil%netscape.com
d522c5e798 Changed FALSE to XP PR_FALSE
git-svn-id: svn://10.0.0.236/trunk@51483 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:54:36 +00:00
brendan%mozilla.org
9ef594d4bf Avoid gratuitous initialization and extra sets of ok (r=shaver@mozilla.org).
git-svn-id: svn://10.0.0.236/trunk@51482 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:44:47 +00:00
scc%netscape.com
ef634d5f6b remove nsIVariant.h and nsVariant.cpp as per bug #16987 and changes already in for Unix (thanks brad) and Mac, r=danm
git-svn-id: svn://10.0.0.236/trunk@51481 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:33:03 +00:00
endico%mozilla.org
49ce32b0ec oops forgot to add the newsbot directory to the path "../newsbot/newsbot.html",
git-svn-id: svn://10.0.0.236/trunk@51480 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:32:59 +00:00
alecf%netscape.com
11dd83ae66 update status
git-svn-id: svn://10.0.0.236/trunk@51479 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:27:08 +00:00
slamm%netscape.com
242640cfa1 Get the relative prefix for the static page correct.
git-svn-id: svn://10.0.0.236/trunk@51478 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:23:48 +00:00
amusil%netscape.com
547d0559fa Address book fix. DB file now gets closed in the destructor. Reviewed by bienvenu.
git-svn-id: svn://10.0.0.236/trunk@51477 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:18:42 +00:00
wtc%netscape.com
89df62c930 Bugsplat bug #366500: use the default, PRLock-based atomic stack
implementation on OSF1. r=larryh,srinivas@netscape.com.
Modified files: _osf1.h, osf1.c.


git-svn-id: svn://10.0.0.236/trunk@51476 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:10:00 +00:00
alecf%netscape.com
ab99f0ec36 nsIModulize mime emitters - porkjockey work, r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@51475 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:05:04 +00:00
dp%netscape.com
f7af54f40f bug# 15046 Preventing deletion of dll when getfactory fails. r=shaver,kipp
git-svn-id: svn://10.0.0.236/trunk@51474 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:04:16 +00:00
dp%netscape.com
51386ed041 Fixed warning of unused variable.
git-svn-id: svn://10.0.0.236/trunk@51473 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:02:29 +00:00
alecf%netscape.com
6b7dfaa5e0 start to consolidate URL and URI parsing into the base classes: remove a whole bunch of protocol-specific code in favor of generalization
basically, more fixes for #14437
r=scottip


git-svn-id: svn://10.0.0.236/trunk@51471 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 01:02:08 +00:00
dougt%netscape.com
a0ac058370 fix for bug 13894. Hooks up the notification from necko. r=cathleen.
git-svn-id: svn://10.0.0.236/trunk@51470 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:53:01 +00:00
endico%mozilla.org
596192f62c the names of the files to be wrapped must be given relative to the root of the tree. in this case: "../newsbot/newsbot.html"
git-svn-id: svn://10.0.0.236/trunk@51469 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:45:56 +00:00
evaughan%netscape.com
997f5f6291 Fixed bug 9442. reviewed by Hyatt.
git-svn-id: svn://10.0.0.236/trunk@51468 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:38:22 +00:00
mjudge%netscape.com
64c9150aab massive checkin for underlying implementation of key handling from javascript and home/end breakage and.. selecting around NON-text frames. like arrowing around an image for example. 16636,16655 and another i cannot find. r=kin r=hyatt a=me
git-svn-id: svn://10.0.0.236/trunk@51467 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:19:18 +00:00
endico%mozilla.org
6cb5db5eff escape quotes around ALIGN=\"right\"
git-svn-id: svn://10.0.0.236/trunk@51466 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:14:43 +00:00
kipp%netscape.com
845644f460 Alloc another iid
git-svn-id: svn://10.0.0.236/trunk@51465 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:12:31 +00:00
scc%netscape.com
9d0d4095c3 remove "nsVariant.cpp" from the project, and "nsIVariant.h" from the MANIFEST, as per bug #16987, r=sfraser
git-svn-id: svn://10.0.0.236/trunk@51464 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:12:03 +00:00
kipp%netscape.com
b9ad416be8 Clean up other dirt
git-svn-id: svn://10.0.0.236/trunk@51463 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:11:54 +00:00
kipp%netscape.com
7944188008 Whoops, missed this during my checkin :-(
git-svn-id: svn://10.0.0.236/trunk@51462 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:11:31 +00:00
davidm%netscape.com
302f64fb59 2425 [PP] Mac: Apprunner doesn't gracefully quit at shutdown or r
r = sdagley


git-svn-id: svn://10.0.0.236/trunk@51461 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-22 00:01:45 +00:00
beard%netscape.com
56b367cb81 added parent links, so you can go to the objects referring to a given link.
git-svn-id: svn://10.0.0.236/trunk@51460 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:58:28 +00:00
beard%netscape.com
dfaa46c552 broke out from leaksoup.java so it can be used by tracesoup.
git-svn-id: svn://10.0.0.236/trunk@51459 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:55:25 +00:00
beard%netscape.com
f8e8fae5ce annotates refcount traces with blame/lxr URLs
git-svn-id: svn://10.0.0.236/trunk@51458 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:54:39 +00:00
endico%mozilla.org
62819eff8a align bottom row to the right. <TR ALIGN="right"> doesn't seem to work in mozilla
git-svn-id: svn://10.0.0.236/trunk@51457 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:52:41 +00:00
terry%mozilla.org
575dc47298 Make "checkins in last 7 days" link work better in worlds with
multiple repositories.


git-svn-id: svn://10.0.0.236/trunk@51454 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:42:39 +00:00
nisheeth%netscape.com
9888b796b2 Fixing Unix warnings. r=harishd
git-svn-id: svn://10.0.0.236/trunk@51452 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:27:02 +00:00
akkana%netscape.com
0ab9b94827 Fix a runtime error message -- r= (and suggested by) dp
git-svn-id: svn://10.0.0.236/trunk@51451 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 23:12:31 +00:00
karnaze%netscape.com
9ecfbb54e1 new regression tests
git-svn-id: svn://10.0.0.236/trunk@51450 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:52:00 +00:00
terry%mozilla.org
2df0186c7f Wasn't working right with multiple repositories.
git-svn-id: svn://10.0.0.236/trunk@51449 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:51:50 +00:00
wtc%netscape.com
096120daf6 Fixed a small mistake in the previous checkin.
git-svn-id: svn://10.0.0.236/trunk@51448 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:51:06 +00:00
danm%netscape.com
4e8be85212 removing (unused) references to nsIWebShell.h. requested by buster@netscape.com, bug 16510, r:me
git-svn-id: svn://10.0.0.236/trunk@51447 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:47:50 +00:00
leaf%mozilla.org
b541cbb7e8 adding !endif to complete !if
git-svn-id: svn://10.0.0.236/trunk@51446 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:40:16 +00:00
endico%mozilla.org
a85345a59b get rid of the <DIV>s and <SPAN>s since we have the rdf file now. the <SPAN> around the article link was messing up the link because they were intertwined <SPAN><A></SPAN>text</A>
git-svn-id: svn://10.0.0.236/trunk@51445 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:38:21 +00:00
wtc%netscape.com
358dfee800 Bugsplat bug #365031: moved the definition of PRStack from pratom.h
to primpl.h so that it is not exported.
Bugsplat bug #364813: declare 'prstk_head' volatile, to prevent compiler
from optimizing away references in a loop.
r=larryh,srinivas@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51444 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:36:35 +00:00
karnaze%netscape.com
a2ae4b6656 bug 5799 - width of auto width table considers percentage cells when they are small relative to the rest of the table. r=dcone
git-svn-id: svn://10.0.0.236/trunk@51443 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:36:21 +00:00
karnaze%netscape.com
ed05316f46 bug 12012 - RemoveFrame was using stale style display. r=dcone
git-svn-id: svn://10.0.0.236/trunk@51442 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:33:30 +00:00
mscott%netscape.com
83fec44fd6 Bug #16538 --> FetchMessage takes a stream listener and we should try to create a necko channel for the url,
and call AsyncRead on the channel, passing in the stream listener instead of trying to run the imap url
through the normal means. This fixes the problem where the channel wasn't properly initialized when
copying a imap message to a local folder.
r=jefft,bienvenu


git-svn-id: svn://10.0.0.236/trunk@51441 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:33:24 +00:00
wtc%netscape.com
646d7cec23 Temporary depend:clean hack.
git-svn-id: svn://10.0.0.236/trunk@51440 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:32:14 +00:00
mscott%netscape.com
fb7a12a36e Bug #16538 --> we need to add nsIStreamObserver to the QI method for this class in order to avoid an assertion
with my fix to bug #16538. I also replaced the handle rolled QueryInterface method with macro.
r=jefft,bienvenu


git-svn-id: svn://10.0.0.236/trunk@51438 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:31:27 +00:00
wtc%netscape.com
c2f76119ac Bugzilla bug #16994: fixed compilation problems on platforms without
long longs. r=larryh@netscape.com.  Thanks to Chris Seawood
<cls@seawood.org> for the bug report.


git-svn-id: svn://10.0.0.236/trunk@51437 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:28:14 +00:00
cata%netscape.com
dd434afd5e bug #16754, r=erik, fixing memory leak
git-svn-id: svn://10.0.0.236/trunk@51436 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:25:44 +00:00
braddr%puremagic.com
8c0a2f84e7 Remove references to nsVariant.cpp and nsIVariant.h.
r=scc


git-svn-id: svn://10.0.0.236/trunk@51435 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:24:17 +00:00
bienvenu%netscape.com
f52e7bdb86 fix syncing of imap flags change to db r=mscott,16839
git-svn-id: svn://10.0.0.236/trunk@51434 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:23:25 +00:00
pnunn%netscape.com
62438f020b bug#13505. Replacing str functions with nsCRT functions, nspr functions.
pnunn@netscape.com  r:jfrancis@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51433 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:23:24 +00:00
rods%netscape.com
c33c65e90f changed the padding so it is adding in the correct left right instead of top bottom
r=kmcclusk, Bug #16936


git-svn-id: svn://10.0.0.236/trunk@51432 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:22:32 +00:00
bienvenu%netscape.com
612130b82a check for null when marking header read, r=mscott
git-svn-id: svn://10.0.0.236/trunk@51431 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:22:07 +00:00
jst%citec.fi
953ba7bb6a Make printing use only enabled stylesheets. No bug, r=kipp@netscape.com and dcone@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@51430 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:20:37 +00:00
rogerl%netscape.com
605c46e143 Loop from 1 instead of 0 since the test result parsing gets messed up by
the null strings not containing 'PASSED'. The 0 case isn't all that
important for upperCase testing.


git-svn-id: svn://10.0.0.236/trunk@51429 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:18:52 +00:00
terry%mozilla.org
3b70db325d Add some more debugging output.
git-svn-id: svn://10.0.0.236/trunk@51428 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:04:13 +00:00
ftang%netscape.com
908e81fe11 change the input method highligh code from 2 style to 4 styles. r=mjudge
git-svn-id: svn://10.0.0.236/trunk@51427 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 22:01:18 +00:00
jevering%netscape.com
1e20da8f66 Enabling boehm leak detector, r=dp bug#15906
git-svn-id: svn://10.0.0.236/trunk@51426 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:59:15 +00:00
jevering%netscape.com
42df555a0b Enabling GC detector, r=dp, bug #15906
git-svn-id: svn://10.0.0.236/trunk@51425 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:56:47 +00:00
srinivas%netscape.com
52c617580c Invoke the native acknowledge notify routine only when queue is non-empty.
Checkin for kipp@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@51424 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:52:02 +00:00
akkana%netscape.com
e6c9a60dab 16706: Call the rules code to delete the bogus node before inserting html, to fix the new mail reply code. r=jfrancis
git-svn-id: svn://10.0.0.236/trunk@51423 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:51:47 +00:00
kipp%netscape.com
adc0fff019 Added two new tests
git-svn-id: svn://10.0.0.236/trunk@51422 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:46:52 +00:00
endico%mozilla.org
f535016cde oops use '&', not '%'
git-svn-id: svn://10.0.0.236/trunk@51421 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:44:39 +00:00
cata%netscape.com
6499857292 bug #15690, r=ftang, removing bogus rules which were affecting the menu template
git-svn-id: svn://10.0.0.236/trunk@51420 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:42:40 +00:00
danm%netscape.com
5ecf5615a7 observe EventQueue creation and deletion. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51419 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:36:25 +00:00
ramiro%fateware.com
1a2e9974f2 Use "(NSINSTALL) -D" instead of direct "mkdir" r=shaver.
git-svn-id: svn://10.0.0.236/trunk@51418 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:35:37 +00:00
danm%netscape.com
49ae6251f8 adding method ListenToEventQueue (moving EventQueue observation from appshells to appshellservice) r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51417 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:34:57 +00:00
dp%netscape.com
32ccfffb02 bug#14656 Circular release problem of component manager. Fixed by
adding shutdown() method that gets called before the last
release. Enabled only for dp & shaver until we resolve js coredump.


git-svn-id: svn://10.0.0.236/trunk@51416 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:34:39 +00:00
dp%netscape.com
a87080011d Making sample better by using COMPtr r=waterson
git-svn-id: svn://10.0.0.236/trunk@51415 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:32:17 +00:00
dp%netscape.com
480412f60c Addding xpcom init and shutdown. r=waterson
git-svn-id: svn://10.0.0.236/trunk@51414 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:31:53 +00:00
nisheeth%netscape.com
dd57891add Install util.lib to the dist directory in the libs phase rather than the install phase.
git-svn-id: svn://10.0.0.236/trunk@51413 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:31:26 +00:00
endico%mozilla.org
35cedcf521 html escape gt and lt symbols in the View Article url
git-svn-id: svn://10.0.0.236/trunk@51412 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:22:44 +00:00
rhp%netscape.com
7889a5e148 Fix for duplicate body text in Multipart related message - Bug #16992 - r: mscott
git-svn-id: svn://10.0.0.236/trunk@51411 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:18:54 +00:00
mcafee%netscape.com
220ec361b8 Fixing evaughan's last change. r=law
git-svn-id: svn://10.0.0.236/trunk@51410 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:14:59 +00:00
brade%netscape.com
1706386f49 add nsTextContentDataChange.cpp a=leaf@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@51409 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:14:19 +00:00
ramiro%fateware.com
5244db774f More rpm packaging work in progress. Not part of anything.
git-svn-id: svn://10.0.0.236/trunk@51408 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:12:50 +00:00
edburns%acm.org
24e8fb82df Bug: 15606
r=shaver
approver=av

I would like to take the time to personally thank Mike Shaver for all the hard
work he has done to make this bugfix possible.


git-svn-id: svn://10.0.0.236/trunk@51407 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:09:21 +00:00
rickg%netscape.com
3e6139004b changed default font-size for viewsource; r=none;
git-svn-id: svn://10.0.0.236/trunk@51406 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:05:17 +00:00
mcafee%netscape.com
e9e6fdee20 Backing out evaughan's change which broke linux/solaris. a=mcafee
git-svn-id: svn://10.0.0.236/trunk@51405 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 21:05:02 +00:00
troy%netscape.com
46c5c77d91 Removed unused 4-byte "mMaxElementSize" member data
git-svn-id: svn://10.0.0.236/trunk@51404 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:51:04 +00:00
kipp%netscape.com
e4442e8177 r=troy; added nsTextContentChangeData to the build
git-svn-id: svn://10.0.0.236/trunk@51403 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:48:43 +00:00
kipp%netscape.com
1e9fb71c5d Support navigators built-in image types internal-gopher-*
git-svn-id: svn://10.0.0.236/trunk@51402 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:48:04 +00:00
kipp%netscape.com
e5f0e5328b Fixed percolation of nbsp's into the transformed buffer (bug 16886)
git-svn-id: svn://10.0.0.236/trunk@51401 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:47:36 +00:00
kipp%netscape.com
c54e23defe r=troy; Optimize append text reflows to only reflow the new part of the text
git-svn-id: svn://10.0.0.236/trunk@51400 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:46:05 +00:00
kipp%netscape.com
fee0551895 moved debug logic for dumping reflow commands so that we can dump them without requiring the incremental reflow verification logic to run
git-svn-id: svn://10.0.0.236/trunk@51399 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:45:39 +00:00
kipp%netscape.com
6b290bc673 r=troy; bug: 15153; fixed problem with style-change reflows not being propogated properly
git-svn-id: svn://10.0.0.236/trunk@51398 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:44:58 +00:00
kipp%netscape.com
57dac66f2e r=troy; bugs: 13196; fixed floating table reflow issues found in 13196 by storing floater max-element-size for later retrieval
git-svn-id: svn://10.0.0.236/trunk@51397 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:44:22 +00:00
locka%iol.ie
9ff1e618b5 Changed scope of some helper methods
git-svn-id: svn://10.0.0.236/trunk@51396 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:44:06 +00:00
kipp%netscape.com
88d3d6afe1 r=troy; bugs: 15153, 13196; fixed problem with style-change reflows not being propogated properly; also fixed floating table reflow issues found in 13196 by storing floater max-element-size for later retrieval
git-svn-id: svn://10.0.0.236/trunk@51395 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:43:48 +00:00
kipp%netscape.com
6156c0fb7a Export the gopher images
git-svn-id: svn://10.0.0.236/trunk@51394 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:42:18 +00:00
kipp%netscape.com
199585b860 Use nsTextContentChangeData to pass down to the reflow logic the effect on the text
git-svn-id: svn://10.0.0.236/trunk@51393 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:40:51 +00:00
kipp%netscape.com
6ef7b73278 new file for text reflow optimiziation
git-svn-id: svn://10.0.0.236/trunk@51392 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:40:25 +00:00
bienvenu%netscape.com
90299835ef fix addrbook mem leaks and mismatched delete r=mscott\
git-svn-id: svn://10.0.0.236/trunk@51391 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:36:02 +00:00
bienvenu%netscape.com
9b4f0c0032 fix msg compose and send mem leaks, ipw, and mismatched delete r=mscott
git-svn-id: svn://10.0.0.236/trunk@51390 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:35:26 +00:00
rickg%netscape.com
eb5f25dfe9 changed default font-size for viewsource; r=none;
git-svn-id: svn://10.0.0.236/trunk@51389 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:34:02 +00:00
locka%iol.ie
f4438b41e1 Added support for drag and drop of Internet Shortcut files
git-svn-id: svn://10.0.0.236/trunk@51388 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:32:52 +00:00
kipp%netscape.com
90d4423420 r=troy; Added a property for max-element-size storage for fixing bug 13196
git-svn-id: svn://10.0.0.236/trunk@51387 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:23:05 +00:00
kipp%netscape.com
4fe7cefb4a r=troy; Added nsITextContetChangeData to help optimize modifications of large text elements
git-svn-id: svn://10.0.0.236/trunk@51386 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:22:02 +00:00
evaughan%netscape.com
f1d7499417 Fixed some warnings: reviewed -hyatt
git-svn-id: svn://10.0.0.236/trunk@51385 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 20:17:51 +00:00
ramiro%fateware.com
0fed380744 Fix #ifdef DEBUG_ramiro build bustage.
git-svn-id: svn://10.0.0.236/trunk@51384 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 19:56:05 +00:00
matt%netscape.com
426f9c3ea3 Adding manual proxies -r by bill
git-svn-id: svn://10.0.0.236/trunk@51383 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 19:53:19 +00:00
ssu%netscape.com
f923fbd1b1 fixed bug #15309. r=dbragg. it now creates an empty Plugins directory within Seamonkey. Not part of tinderbox. would only affect windows.
git-svn-id: svn://10.0.0.236/trunk@51382 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 19:50:36 +00:00
ramiro%fateware.com
ced5d07b70 Fix #ifdef DEBUG_ramiro build bustage.
git-svn-id: svn://10.0.0.236/trunk@51381 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 19:30:29 +00:00
selmer%netscape.com
206cd25152 Fix enabling when last NCIfile is deleted
git-svn-id: svn://10.0.0.236/trunk@51379 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 18:39:26 +00:00
terry%mozilla.org
49666a52cb Fix perl warning.
git-svn-id: svn://10.0.0.236/trunk@51378 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 18:19:48 +00:00
kipp%netscape.com
da5a072040 new
git-svn-id: svn://10.0.0.236/trunk@51374 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 16:20:53 +00:00
briano%netscape.com
363f0cb92d Automated update
git-svn-id: svn://10.0.0.236/trunk@51373 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 15:00:22 +00:00
ramiro%fateware.com
a3613fc446 Work in progress to add reasonable rpm packaging support for the beast.
NOT PART OF THE SEAMONKEY BUILD.


git-svn-id: svn://10.0.0.236/trunk@51372 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 14:57:38 +00:00
ssu%netscape.com
d5686c3a21 fixing bug #16470. Not part of Tinderbox. Not part of seamonkey core code. r=pavlov. Would affect only windows.
git-svn-id: svn://10.0.0.236/trunk@51371 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 07:24:46 +00:00
tbogard%aol.net
8cf4ca3ed6 Added changes from buster.
git-svn-id: svn://10.0.0.236/trunk@51370 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 06:59:48 +00:00
ssu%netscape.com
ef19fe31d7 removing editor from install build process. Not part of Tinderbox. Not part of seamonkey code. Would affect only windows platforms.
git-svn-id: svn://10.0.0.236/trunk@51369 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 06:44:27 +00:00
tbogard%aol.net
2f9603aabc Added nsITextScroll.idl.
git-svn-id: svn://10.0.0.236/trunk@51368 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 06:41:03 +00:00
pierre%netscape.com
2123a4d227 Fix build bustage
git-svn-id: svn://10.0.0.236/trunk@51367 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 06:40:00 +00:00
tbogard%aol.net
75207bcf9a More changes from buster.
git-svn-id: svn://10.0.0.236/trunk@51366 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:52:54 +00:00
pierre%netscape.com
6b7990dcc7 Enabled MOZ_PERF_METRICS in the Mac build:
- updated DefinesMozilla.h
- fixed stopwatch.cpp
- created libutilIDL.mcp
- added StopWatch exports to libutil.exp
- added xpcom.shlb to libutil.mcp
- added libutil.shlb to htmlparser.mcp, layout.mcp, webshell.mcp


git-svn-id: svn://10.0.0.236/trunk@51365 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:41:45 +00:00
sfraser%netscape.com
68467cb1bb File Removed.
git-svn-id: svn://10.0.0.236/trunk@51364 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:37:53 +00:00
sfraser%netscape.com
7bac435457 Removed nsEditorFactory.cpp and nsEditorShellFactory.cpp which are no longer needed. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@51363 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:37:04 +00:00
sfraser%netscape.com
a627d5676e Removal of calls to PR_MumbleMonitor, which were way too heavy-handed for the job. Replaced with PR_AtomicInc/Decrement. part of module sweep, r=morse, pavlov
git-svn-id: svn://10.0.0.236/trunk@51362 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:36:21 +00:00
pierre%netscape.com
1e94740a0f First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51361 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:35:26 +00:00
mcafee%netscape.com
ca26c9bcab Moved to mozilla/tools/tinderbox (client-side script).
git-svn-id: svn://10.0.0.236/trunk@51360 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:20:02 +00:00
mcafee%netscape.com
f7f718532b Added bloat test. Also added --testonly to skip building process. Fixed bloatdiff to put its output to stdout. r=warren
git-svn-id: svn://10.0.0.236/trunk@51359 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:16:54 +00:00
troy%netscape.com
dced08401d r=kipp@netscape.com
Added API to get/set properties on frames. Also changed nsContainerFrame
to use a property to implement the frame overflow list. This saves 4 bytes
per container frames


git-svn-id: svn://10.0.0.236/trunk@51358 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 05:11:43 +00:00
waterson%netscape.com
41c3d0afa5 Fix solaris (and other unsupported platforms).
git-svn-id: svn://10.0.0.236/trunk@51357 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 04:28:07 +00:00
waterson%netscape.com
a8195254ae Change nsTraceRefCnt::WalkTheStack() to accept stream.
git-svn-id: svn://10.0.0.236/trunk@51355 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:45:38 +00:00
sfraser%netscape.com
aed61fd72a Removed an errant semicolon in a IID declaration. r=floppy moose
git-svn-id: svn://10.0.0.236/trunk@51354 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:45:20 +00:00
waterson%netscape.com
035b04b87b Change nsTraceRefcnt::WalkTheStack() to accept stream.
git-svn-id: svn://10.0.0.236/trunk@51353 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:45:12 +00:00
waterson%netscape.com
21abead461 Modify nsTraceRefcnt::WalkTheStack() to accept a stream. Other misc formatting fixup. work really done by beard, r=waterson.
git-svn-id: svn://10.0.0.236/trunk@51352 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:44:37 +00:00
tbogard%aol.net
ce03f0d9f0 More additions suggested by buster. Not all final, still working out the interfaces.
git-svn-id: svn://10.0.0.236/trunk@51351 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:23:31 +00:00
tbogard%aol.net
c8d824834b More changes to the interface. Merging in changes from buster.
git-svn-id: svn://10.0.0.236/trunk@51350 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:01:33 +00:00
tbogard%aol.net
619f3992f7 Added new nsIDocShellContainer.idl to the build list.
git-svn-id: svn://10.0.0.236/trunk@51349 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:01:10 +00:00
tbogard%aol.net
3b01cf0bec First Check-in.
git-svn-id: svn://10.0.0.236/trunk@51348 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 03:00:07 +00:00
nisheeth%netscape.com
205adceff6 Should not affect build. Include stopwatch object code if MOZ_PERF is defined.
git-svn-id: svn://10.0.0.236/trunk@51347 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:47:56 +00:00
dveditz%netscape.com
7d2157e059 mac bustage
git-svn-id: svn://10.0.0.236/trunk@51346 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:46:21 +00:00
nisheeth%netscape.com
569e1a2fb1 Fixed warnings. Enabled code to build on UNIX. r=pollmann
git-svn-id: svn://10.0.0.236/trunk@51345 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:32:01 +00:00
endico%mozilla.org
8f060eb994 remove the full path names on newsbot.html and wrapped.html so wrap.pl doesn't add "../" to everything. communicator doesn't mind this but it breaks msie and probably mozilla
git-svn-id: svn://10.0.0.236/trunk@51344 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:30:21 +00:00
briano%netscape.com
4f1d9b3a36 Automated update
git-svn-id: svn://10.0.0.236/trunk@51343 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:15:10 +00:00
nisheeth%netscape.com
3871dd508d Will not affect build. Add support for --enable-perf-metrics autoconf flag that will switch on the reporting of timing information about gecko's layout processes.
git-svn-id: svn://10.0.0.236/trunk@51342 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 02:01:49 +00:00
varada%netscape.com
6475343232 changing all edit fields with browse buttons to non editable scripts
git-svn-id: svn://10.0.0.236/trunk@51341 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:56:54 +00:00
dveditz%netscape.com
92654b5840 Missed a test
git-svn-id: svn://10.0.0.236/trunk@51340 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:47:28 +00:00
selmer%netscape.com
bea6cdd46f Don't need -MDd in CFLAGS
git-svn-id: svn://10.0.0.236/trunk@51339 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:42:48 +00:00
bienvenu%netscape.com
4e7faff324 fix memory leaks and mismatched frees r=jefft
git-svn-id: svn://10.0.0.236/trunk@51338 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:42:00 +00:00
bienvenu%netscape.com
4392913cc3 fix mismatched free
git-svn-id: svn://10.0.0.236/trunk@51337 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:40:08 +00:00
bienvenu%netscape.com
10931ccb41 another memory leak fix for mime
git-svn-id: svn://10.0.0.236/trunk@51336 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:37:03 +00:00
beard%netscape.com
6bfc31a469 fix :: bustage.
git-svn-id: svn://10.0.0.236/trunk@51334 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 01:07:50 +00:00
dveditz%netscape.com
6b0912645b Changing nsFileSpec Copy and Move function names to match their
functionality, and also to free up the namespace for a *real* Copy
and Move that allow renaming the leaf name rather than just copying
into different directories (i.e. to make backup files). r=ssu


git-svn-id: svn://10.0.0.236/trunk@51333 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:40:39 +00:00
hoa.nguyen%intel.com
ed3c26548f Optimized decoder. Removed warnings.
git-svn-id: svn://10.0.0.236/trunk@51332 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:17:48 +00:00
beard%netscape.com
a27e6a0c95 when GC_DEBUG is off, try to use GC_malloc_ignore_off_page for large blocks. Since GC_MALLOC always returns cleared blocks, don't bother clearning. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51331 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:17:28 +00:00
dp%netscape.com
af64d101fa Fixed crash on -f file on quit by using async proxy post event as
opposed to calling quit directly. r=dougt


git-svn-id: svn://10.0.0.236/trunk@51330 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:15:30 +00:00
beard%netscape.com
72a36eba4b use nsILeakDetector service. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51329 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:13:07 +00:00
karnaze%netscape.com
fb5466f5e4 bug 14915 - fix crash.
git-svn-id: svn://10.0.0.236/trunk@51328 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:11:55 +00:00
beard%netscape.com
b582d5259b added GC_address_to_source, MWUnmangle exports. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51327 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:09:14 +00:00
beard%netscape.com
eb87b84391 added nsEnvironment.cpp. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51326 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:08:13 +00:00
rods%netscape.com
3133a0f78a removed the PR_MAX forcing the y offset to be zero or greater. Not sure why it was doing this.
r=kmcclusk Bug #16152


git-svn-id: svn://10.0.0.236/trunk@51325 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:06:23 +00:00
beard%netscape.com
abf884842d added GC_address_to_source, MWUnmangle stubs. r=gordon, bug=15906
git-svn-id: svn://10.0.0.236/trunk@51324 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:06:13 +00:00
sspitzer%netscape.com
81245102fa fix for #15231, r=mscott. get the fixed_width pref to stick.
the problem was we had it as an int pref, when it was a bool pref.


git-svn-id: svn://10.0.0.236/trunk@51323 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:05:50 +00:00
hoa.nguyen%intel.com
4b7e9a7a5a Optimized decoder.
git-svn-id: svn://10.0.0.236/trunk@51322 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:05:16 +00:00
beard%netscape.com
b12276db98 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51321 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:05:05 +00:00
hoa.nguyen%intel.com
b52252a4aa Correctly check for the HZ converter engine state.
git-svn-id: svn://10.0.0.236/trunk@51320 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-21 00:03:52 +00:00
nhotta%netscape.com
dbcb2cc74d Fix a warning, it was assigning NULL to char type, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@51319 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:55:31 +00:00
nhotta%netscape.com
3e99f5b0b8 Adding a wrapper function for a new i18n interface, part of bug fix 15475, r=rhp.
git-svn-id: svn://10.0.0.236/trunk@51318 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:51:25 +00:00
cmanske%netscape.com
661bf267b9 Fixed bug 16923. r=mjudge
git-svn-id: svn://10.0.0.236/trunk@51317 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:50:20 +00:00
rods%netscape.com
dd80c9dd09 added check for null frame. The child frame can be null when a comment node exists as
one of the children of the select. r=kmcclusk, Bug #16355


git-svn-id: svn://10.0.0.236/trunk@51316 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:35:38 +00:00
endico%mozilla.org
48d6ca301e clairify that the 'mozilla' module contains the entire 'current' repository, not everything including all the branches.
git-svn-id: svn://10.0.0.236/trunk@51315 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:30:50 +00:00
pierre%netscape.com
a7cee2ccb1 #15636 "Cleanup build warnings". Some compilers issued a "hidden virtual method" warning because only one of the two implementations of GetDesiredSize() was overridden. r=slamm.
git-svn-id: svn://10.0.0.236/trunk@51314 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:30:29 +00:00
hoa.nguyen%intel.com
cfe11b1fd4 Changed from char types to PRUint8.
git-svn-id: svn://10.0.0.236/trunk@51313 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:21:56 +00:00
wtc%netscape.com
e0c8d6770c Made comments match code.
git-svn-id: svn://10.0.0.236/trunk@51312 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:19:31 +00:00
harishd%netscape.com
6cd114ddff Fix for the bustage.
r=pollmann


git-svn-id: svn://10.0.0.236/trunk@51311 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:14:50 +00:00
wtc%netscape.com
eacb3c22ae Bugsplat bug #366840: PR_StringToNetAddr needs to set the address family
field of the PRNetAddr structure. Added a new test str2addr.c for this
bug. r=larryh@netscape.com
Modified files: prnetdb.c, pr/tests/runtests.ksh, pr/tests/Makefile,
    pr/tests/Makefile.in
Added file: pr/tests/str2addr.c


git-svn-id: svn://10.0.0.236/trunk@51310 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 23:07:38 +00:00
mcafee%netscape.com
9fa424b571 Moving bloatdiff.pl from webtools/tinderbox (server) to here (client).
git-svn-id: svn://10.0.0.236/trunk@51309 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:35:48 +00:00
harishd%netscape.com
676f148787 Fixed Bug 16285 - Replaced char* with nsCAutoString for mBuffer.
This fixes the crash on doing Ctrl-c in editor.

r=akkana


git-svn-id: svn://10.0.0.236/trunk@51308 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:35:12 +00:00
harishd%netscape.com
8cccb6a457 Fixed Bug 16014 - Rectifed a glitch in illegal-content handling code.
r=pollmann


git-svn-id: svn://10.0.0.236/trunk@51307 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:32:10 +00:00
alecf%netscape.com
e0db5266e6 turn news into a nsIModule
r=sspitzer
(porkjockey work)


git-svn-id: svn://10.0.0.236/trunk@51306 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:30:02 +00:00
akkana%netscape.com
49f4e5d7aa 16726: don't print the doctype information in plaintext output. r=cmanske
git-svn-id: svn://10.0.0.236/trunk@51305 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:27:14 +00:00
edburns%acm.org
25735aa125 bug: 16842
reviewer: edburns
approver: edburns

Changed raptor to gk in makefile as appropriate.


git-svn-id: svn://10.0.0.236/trunk@51304 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 22:02:34 +00:00
rods%netscape.com
54bbcb0dfd added code to the destructor to make sure the list get rolled up.
r=kmcclusk bug 15912


git-svn-id: svn://10.0.0.236/trunk@51303 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:59:04 +00:00
alecf%netscape.com
8d5865d224 clean up nsIMsgFolder API in preparation for fixing a number of bugs, most importantly #14437
r=scottip


git-svn-id: svn://10.0.0.236/trunk@51302 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:58:21 +00:00
dmose%mozilla.org
9cdfa509fd macfe lives on in the MozillaClassic branch, but there's no longer a need for it on the trunk. a=smfr@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51301 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:53:27 +00:00
endico%mozilla.org
47e168172c add m10 tree for the Design Patterns contest
git-svn-id: svn://10.0.0.236/trunk@51300 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:52:08 +00:00
endico%mozilla.org
3d25df00ed merge old changes from when we moved to komodo
git-svn-id: svn://10.0.0.236/trunk@51299 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:48:49 +00:00
mscott%netscape.com
2faa0c76f6 optimize nsImapBuildMessageURI to use a nsCAutoString. This saves us an extra allocation of the string later on.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51298 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:41:18 +00:00
scc%netscape.com
a83d58083d Now InstallFromManifest "xpcom/components/MANIFEST_COMPONENTS" to get some javascript installed in the apps "Components" directory. This corresponds to work shaver has already done on the other platforms. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@51297 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:31:46 +00:00
srinivas%netscape.com
ecb0569df7 The "-mno-486" compiler option is no longer relevant and not supported
in new gcc compilers (v2.95). Bug #15975.


git-svn-id: svn://10.0.0.236/trunk@51296 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:19:53 +00:00
bienvenu%netscape.com
0169c2df6e more memory leak fixes, r=mscott
git-svn-id: svn://10.0.0.236/trunk@51295 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:18:25 +00:00
bienvenu%netscape.com
3d780d6859 fix rdf resource value leaks r=jefft
git-svn-id: svn://10.0.0.236/trunk@51294 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:12:00 +00:00
scc%netscape.com
b029ca73a2 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51293 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:03:21 +00:00
mscott%netscape.com
899ebce13b Bug #16814 --> i found a problem which may be causing us to block in the imap protocol when downloading larger
attachments or images. Basically, the nsMsgLineStreamBuffer class had a fence post bug when determining
if it had enough room to read in more bytes. If the # of free bytes in the stream buffer was 1 byte and we
had just one byte of data left to read in from the incoming stream, we would fail to read in that one byte.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51292 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:01:58 +00:00
ftang%netscape.com
c683bbd987 do not do TypedText if the character code is 0. r=brade. Fix bug 16570 and 16811
git-svn-id: svn://10.0.0.236/trunk@51291 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:01:20 +00:00
bienvenu%netscape.com
d6cfea3e69 fix mime memory leaks, mostly strings, r=rhp
git-svn-id: svn://10.0.0.236/trunk@51290 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 21:00:02 +00:00
waldemar%netscape.com
28941388eb Changed bottom expressions to syntax error throws
git-svn-id: svn://10.0.0.236/trunk@51289 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:58:07 +00:00
waldemar%netscape.com
8a4ea2ca19 Added upper-case Greek letters
git-svn-id: svn://10.0.0.236/trunk@51288 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:57:37 +00:00
danm%netscape.com
fe06bcf74b no longer used
git-svn-id: svn://10.0.0.236/trunk@51287 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:51:16 +00:00
bienvenu%netscape.com
21c7cb6d78 fix memory leaks of uri's and a progress string r=mscott
git-svn-id: svn://10.0.0.236/trunk@51286 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:49:45 +00:00
briano%netscape.com
bd0b8a085b Automated update
git-svn-id: svn://10.0.0.236/trunk@51285 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:45:41 +00:00
bienvenu%netscape.com
004de2f422 fix memory leaks in address book r=mscott
git-svn-id: svn://10.0.0.236/trunk@51284 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:41:27 +00:00
mcafee%netscape.com
8d734dfcc2 Adding support for --enable-logrefcnt; off by default in optimized builds, we need this for tinderbox. code=dp, r=mcafee
git-svn-id: svn://10.0.0.236/trunk@51283 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:40:01 +00:00
law%netscape.com
64d7ceb5a2 Fix for bug #9131; add dependent=yes feature on find dialog so it behaves properly; r=matt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51282 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:36:08 +00:00
bienvenu%netscape.com
f1140e8c6e fix memory leak of notification uri r=dougt
git-svn-id: svn://10.0.0.236/trunk@51281 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:30:42 +00:00
akkana%netscape.com
b05d4de40d 15777: Don't declare the same function-static symbol twice in the same file, because some versions of gcc can't deal with it. r=mcafee
git-svn-id: svn://10.0.0.236/trunk@51280 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:20:38 +00:00
mcafee%netscape.com
f097b7a2a4 Reviewing and applying pavlov's fix for extra row in color palette. (14315)
git-svn-id: svn://10.0.0.236/trunk@51279 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:14:13 +00:00
akkana%netscape.com
2a83eeebf7 16795: Make arrow keys work again.
The gtk event for arrow keys has length=0, but we still need to generate
KeyDown, KeyPress, etc. events for these keys.  r=pavlov


git-svn-id: svn://10.0.0.236/trunk@51277 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:04:40 +00:00
dougt%netscape.com
48fd2584d2 removing an extra release (16832)
Now doing a QI when getting a proxy so that the IID matches the |in| real
object.

r=jud


git-svn-id: svn://10.0.0.236/trunk@51276 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:04:20 +00:00
akkana%netscape.com
60d8465f63 16844: modifier key presses shouldn't insert anything into the editor. r=brade
git-svn-id: svn://10.0.0.236/trunk@51275 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 20:02:44 +00:00
varada%netscape.com
459ff2f953 fixes for bug #14014 changed EditBox types to Text in the widgets
git-svn-id: svn://10.0.0.236/trunk@51274 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 19:59:00 +00:00
putterman%netscape.com
3a0d0bf033 Fixes 15771 and 10603. Scrolling up in tree widget doesn't lose treeitems. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@51273 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 19:48:58 +00:00
bienvenu%netscape.com
6b88f85516 fix memory leak of literal string creating rdf node r=scottip
git-svn-id: svn://10.0.0.236/trunk@51272 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 19:06:53 +00:00
scc%netscape.com
0d129de64e eliminate warnings, r=shaver
git-svn-id: svn://10.0.0.236/trunk@51271 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:59:00 +00:00
waterson%netscape.com
95123cee1f Bug 15146. Factor nsXULElement's members into prototype and optional 'slots' for heavyweight elements. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@51270 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:55:32 +00:00
cmanske%netscape.com
353d58e800 Fixed bug 16868. r=brade
git-svn-id: svn://10.0.0.236/trunk@51269 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:43:56 +00:00
nisheeth%netscape.com
ddb8cb8f28 Changes should not affect build. Ongoing work to make the stopwatch code build on Unix.
git-svn-id: svn://10.0.0.236/trunk@51268 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:43:34 +00:00
bienvenu%netscape.com
b205486bc1 fix memory leak of default pref dir file spec r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@51267 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:42:30 +00:00
bienvenu%netscape.com
09d199c08a fix memory leaks with mime string bundles and v-cards r=rhp
git-svn-id: svn://10.0.0.236/trunk@51266 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:41:49 +00:00
sspitzer%netscape.com
ee0c7447a5 fix for #16820, #16821. r=alecf, a=leaf. fix the pre-select the compose "From" identity
based on the selection in the folder pane.  it broken when I removed the FindServerUsingURI()
method a few days ago.  all better now.


git-svn-id: svn://10.0.0.236/trunk@51265 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 18:31:26 +00:00
leila.garin%eng.sun.com
74762b6d76 Added BWTestThread.java in makefiles, removed print stmt. from TestLoader
git-svn-id: svn://10.0.0.236/trunk@51264 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 17:21:23 +00:00
terry%mozilla.org
3e3cacb732 Ignore the "shadow" and "temp" directories.
git-svn-id: svn://10.0.0.236/trunk@51263 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 16:26:04 +00:00
kipp%netscape.com
deab3a6af2 new
git-svn-id: svn://10.0.0.236/trunk@51262 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 15:31:51 +00:00
kipp%netscape.com
aecc167cc9 Use local images
git-svn-id: svn://10.0.0.236/trunk@51261 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 15:31:26 +00:00
kipp%netscape.com
d4e0127173 Made test run locally without a net
git-svn-id: svn://10.0.0.236/trunk@51260 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 15:31:11 +00:00
terry%mozilla.org
970e03fe63 Fix perl warning.
git-svn-id: svn://10.0.0.236/trunk@51259 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 15:17:37 +00:00
dcone%netscape.com
9abd146c48 Fixed the rounded border rendering code to obey solid, and none style types.
Also bumped all the rounded rects onto pixel boundaries before rendering.


git-svn-id: svn://10.0.0.236/trunk@51258 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:46:27 +00:00
law%netscape.com
df6e65595b Fix for bug #?????; Avoid false positive on check for -f cmd line option; r=warren@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51257 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:40:25 +00:00
karnaze%netscape.com
6418d90654 Remove caching cell spacing as margin on cells, reducing 16 bytes and avoiding potentially unique style contexts; simplified cell margin calculations; r=troy
git-svn-id: svn://10.0.0.236/trunk@51256 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:18:56 +00:00
cmanske%netscape.com
5e0a77611f Fixed bugs 12515, 16493,16494,16495,16692,16794,most of 9758. Replaced old 'target' icon with interim 'anchor' icon. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@51255 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:15:25 +00:00
terry%mozilla.org
bf28c3efd8 Fix perl warning.
git-svn-id: svn://10.0.0.236/trunk@51254 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 14:12:43 +00:00
mscott%netscape.com
2f8bc8e00f Bug #16843 and #16832 where we were crashing when dismissing dialogs. this may not be the final
fix but in an earlier change to this file today, this class stopped addreffing an event queue member variable.
But the dtor still released a reference to the event queue that it didn't have!
The eventual fix may be to put the addref back in there but I need to talk to dougt about this.

this is real danm's fix. i'm the reviewer.


git-svn-id: svn://10.0.0.236/trunk@51253 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 08:35:36 +00:00
danm%netscape.com
f98e5e2bc8 fixing obvious flaw in Unlink. r:waterson@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51252 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 08:35:04 +00:00
tbogard%aol.net
501277d9f2 Integrated some changes made by buster. Still talking some them over, but here for now.
git-svn-id: svn://10.0.0.236/trunk@51251 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 07:37:37 +00:00
cls%seawood.org
47d0316267 Some compilers complain if you declare variables after a potential goto call so move the declarations to the top of the function. Should fix the linux libc5 SM-Ports tinderbox & gcc 2.95 builds.
a=mscott


git-svn-id: svn://10.0.0.236/trunk@51250 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 05:40:05 +00:00
cls%seawood.org
31fb034e97 Use PRBool instead of bool as some compilers do not understand bool. Should fix a couple of SM-Ports tinderboxen.
r=sfraser a=mscott


git-svn-id: svn://10.0.0.236/trunk@51249 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 05:37:18 +00:00
waldemar%netscape.com
e9e8df96c5 Removed types from bottom expressions
git-svn-id: svn://10.0.0.236/trunk@51245 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 02:27:53 +00:00
waldemar%netscape.com
ed5c56be64 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51244 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 02:27:34 +00:00
law%netscape.com
95fc4f832f Fixes for bug #16789; permit OpenDialog to work on hidden window even if document load has not completed yet; r=norris@netscape.com, r=danm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51243 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 01:25:41 +00:00
cmanske%netscape.com
a978b9e92b Changed a comment. This and last checkin were reviewed by mjudge
git-svn-id: svn://10.0.0.236/trunk@51241 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 01:06:05 +00:00
cmanske%netscape.com
22bf05aebd Adding menu item to start Composer from Browser debug menu as workaround for bug 16789 (can't start editor on command line). Also removed editor init page from code that's not even run?
git-svn-id: svn://10.0.0.236/trunk@51240 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 01:03:39 +00:00
edburns%acm.org
8af706c11b Added Swing webclient test code and windows makefile mods.
Author=Ann Sunhachawee
r=edburns@acm.org
Approver=edburns@acm.org
Bug=http://bugzilla.mozilla.org/show_bug.cgi?id=16842


git-svn-id: svn://10.0.0.236/trunk@51239 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:49:28 +00:00
waldemar%netscape.com
cc0c52492a Changed syntax of getters and setters to "get name" and "set name". Relaxed grammar constraints on definitions. Changed over to colon syntax for types. Added local visibility and block modifiers.
git-svn-id: svn://10.0.0.236/trunk@51238 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:46:31 +00:00
evaughan%netscape.com
e5f071ac53 fixed numerous warnings. Reviewed by Hyatt.
git-svn-id: svn://10.0.0.236/trunk@51237 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:46:21 +00:00
waldemar%netscape.com
83bc932793 Removed octal escapes. Replaced bottom by throw of syntax error.
git-svn-id: svn://10.0.0.236/trunk@51236 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:43:58 +00:00
waldemar%netscape.com
db1c1b6e5e Removed octals. Removed rational-to-integer, which was replaced by semantic subtyping. Replaced bottom by throw of syntax error.
git-svn-id: svn://10.0.0.236/trunk@51235 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:43:22 +00:00
waldemar%netscape.com
11aeb1c87d Removed rational-to-integer and types in bottom calls, which were replaced by semantic subtyping
git-svn-id: svn://10.0.0.236/trunk@51234 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:42:17 +00:00
waldemar%netscape.com
f02f9a2f0c Removed rational-to-integer, which was replaced by semantic subtyping
git-svn-id: svn://10.0.0.236/trunk@51233 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:41:59 +00:00
waldemar%netscape.com
1234934b00 Added semantic subtyping, throw, and catch
git-svn-id: svn://10.0.0.236/trunk@51232 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:40:55 +00:00
waldemar%netscape.com
bc5b327059 Fixed bug that would sometimes emit a newline between a backslash and its following escaped character
git-svn-id: svn://10.0.0.236/trunk@51231 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:40:04 +00:00
terry%mozilla.org
60beb90ee5 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51230 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:27:16 +00:00
alecf%netscape.com
30aa1d1d5c remove old gifs
git-svn-id: svn://10.0.0.236/trunk@51229 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:19:23 +00:00
alecf%netscape.com
ba963eb07e remove old gif
git-svn-id: svn://10.0.0.236/trunk@51228 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:18:32 +00:00
alecf%netscape.com
1bfdda92a8 remove unused images
git-svn-id: svn://10.0.0.236/trunk@51227 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:15:50 +00:00
mcafee%netscape.com
fcf9fe791f minor whitespace
git-svn-id: svn://10.0.0.236/trunk@51226 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:14:23 +00:00
larryh%netscape.com
2efaf6b409 BugSplat 367096
git-svn-id: svn://10.0.0.236/trunk@51225 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:12:37 +00:00
norris%netscape.com
b2e9644e2b Work on 1646 [DOGFOOD] javascript: URLs aren't working
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@51224 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:12:04 +00:00
alecf%netscape.com
59c413637f remove old gifs
git-svn-id: svn://10.0.0.236/trunk@51223 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:11:46 +00:00
larryh%netscape.com
eb823e8216 BugSplat 367096
git-svn-id: svn://10.0.0.236/trunk@51222 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:07:01 +00:00
terry%mozilla.org
11426df64d Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51221 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:06:41 +00:00
kipp%netscape.com
7903586ee4 Removed some silly warnings
git-svn-id: svn://10.0.0.236/trunk@51220 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-20 00:06:12 +00:00
despotdaemon%netscape.com
4f6f8b68b0 Pseudo-automatic update of changes made by jmas@softcatala.org.
git-svn-id: svn://10.0.0.236/trunk@51219 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:58:29 +00:00
kipp%netscape.com
32b2148862 Added new test
git-svn-id: svn://10.0.0.236/trunk@51218 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:53:31 +00:00
despotdaemon%netscape.com
fc8c4bd300 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@51217 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:51:38 +00:00
pollmann%netscape.com
e0757a21ca Bug 15729: Fall back to content when getting text value; r=vidur
git-svn-id: svn://10.0.0.236/trunk@51216 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:43:58 +00:00
selmer%netscape.com
b2360b9a85 fix for crash on cancel newconfig dialog
git-svn-id: svn://10.0.0.236/trunk@51215 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:43:13 +00:00
alecf%netscape.com
959275c4ac return null identity on null or empty key
no bug
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@51214 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:37:54 +00:00
dveditz%netscape.com
c097cd276c reenabling 6986-fix for the mac, r-dougt
git-svn-id: svn://10.0.0.236/trunk@51213 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:17:54 +00:00
despotdaemon%netscape.com
efa03bb824 Pseudo-automatic update of changes made by jmas@softcatala.org.
git-svn-id: svn://10.0.0.236/trunk@51212 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:13:07 +00:00
leaf%mozilla.org
843c7df9fb adding mozilla/embedding and mozilla/docshell to SeaMonkeyCore
git-svn-id: svn://10.0.0.236/trunk@51211 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:09:34 +00:00
kipp%netscape.com
3096ad4a52 r=ftang; fixed off by one error that made return value oPrev inconsistent
git-svn-id: svn://10.0.0.236/trunk@51210 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:06:27 +00:00
kipp%netscape.com
4befc8fe5e Added more tests
git-svn-id: svn://10.0.0.236/trunk@51209 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:04:55 +00:00
kipp%netscape.com
2d9044ac40 new
git-svn-id: svn://10.0.0.236/trunk@51208 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:04:33 +00:00
kipp%netscape.com
9c72c46de9 Fixed O(N^2) debug logic bug; speed up paint loop by avoiding painting too much now that we have combined-area (bug 7455, 12297)
git-svn-id: svn://10.0.0.236/trunk@51207 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:04:19 +00:00
kipp%netscape.com
bbbab95269 update to new nsTextTransformer api
git-svn-id: svn://10.0.0.236/trunk@51206 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:01:58 +00:00
kipp%netscape.com
6b051cc38a r=ftang; rewrite to fix 16656, parts of 7455
git-svn-id: svn://10.0.0.236/trunk@51205 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:01:45 +00:00
kipp%netscape.com
d6884c9b41 Init text-transformer during module setup to save cycles (bug 7455)
git-svn-id: svn://10.0.0.236/trunk@51204 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 23:01:23 +00:00
amusil%netscape.com
1d95656844 Fixed bug in editing anonymous attributes in database. Now all attributes get modified instead
of only the first.


git-svn-id: svn://10.0.0.236/trunk@51203 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:46:29 +00:00
tbogard%aol.net
c820ac974d More documentation and clean-up of the interfaces.
git-svn-id: svn://10.0.0.236/trunk@51202 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:40:28 +00:00
tbogard%aol.net
e5684d8a64 Added some documentation.
git-svn-id: svn://10.0.0.236/trunk@51201 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:39:57 +00:00
nisheeth%netscape.com
fedd700745 Checkin does not affect build. If MOZ_PERF is set to 1 define the compiler define MOZ_PERF_METRICS for the windows build.
git-svn-id: svn://10.0.0.236/trunk@51200 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:37:53 +00:00
valeski%netscape.com
cc447b7234 14659, r=gagan&warren&dougt
Misc. FTP changes:
*increased FTP buffer read/write size from 4k to 8k.
*removed un-needed (for now) SetPASV() for FTP connection thread
*string optimizations
*FTP Connection thread now uses the NS_IMPL_ISUPPORTS4 macro for addref, rel, and QI methods.
*connection cache key api consolidation (Get()/Remove() combo turned into Remove(key)).

Authentication dialog changes:
*Authentication dialog now includes host name the user is trying to connect to.

nsIRequest support:
*FTP Connection thread now maintains a member variable pointing to it's event queue. It also pumps the event queue in the main loop.
*FTP Connection thread now implemented the nsIRequest interface (never called directly; only via the nsFTPChannel api)
*FTP Channel now uses an xpcom proxy object to make the nsIRequest api calls on the FTP Connection thread.

FTP protocol interpretation changes:
*FTP now handles servers that send multi-line greetings in the first Read() (we blocked indefinately before)
*FTP now parses the parent working directory properly (used to always treat it as '/')


git-svn-id: svn://10.0.0.236/trunk@51199 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:37:47 +00:00
dougt%netscape.com
0377b9291c Fix for bug 16818. xpcom proxy does not handle classes with two or more
interfaces correctly.  What happens is the real object is addref
incorrectly and will never be deleted.

r=jud


git-svn-id: svn://10.0.0.236/trunk@51198 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:35:54 +00:00
dp%netscape.com
fabbeba48e Fixed warnings. r=pam nunn
git-svn-id: svn://10.0.0.236/trunk@51197 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:28:38 +00:00
nisheeth%netscape.com
b7fab4e31c Changes should not affect the build. Renaming the RAPTOR_PERF_METRICS ifdef to MOZ_PERF_METRICS.
git-svn-id: svn://10.0.0.236/trunk@51196 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:27:20 +00:00
dp%netscape.com
bf856b8053 Converting implementations of QueryInterface() to the std one. This
fixes bugs in the previous implementation that caused unbalanced
refcounts and premature releases. Thanks for rpotts for the heads
up. r=pam nunn


git-svn-id: svn://10.0.0.236/trunk@51195 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:27:08 +00:00
cathleen%netscape.com
1f3c5b3ef3 add txmgr.xpt to core list, like the rest of the editor files.
also removed a couple of obsolete files from the list


git-svn-id: svn://10.0.0.236/trunk@51194 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:03:29 +00:00
pnunn%netscape.com
c88ef4fe6e clean up associated with bug#15817, gif decoder. r: dp@netscape.com.
Removing obsolete file.


git-svn-id: svn://10.0.0.236/trunk@51193 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:02:49 +00:00
warren%netscape.com
077b0c94d4 Added 'PageCycler' code so that we can iterate through URL loads (by calling mozilla.exe -f <file-of-urls>). We need this for adding bloat/leaks info to tinderbox. r=law
git-svn-id: svn://10.0.0.236/trunk@51192 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:01:28 +00:00
danm%netscape.com
855118ba4a retire event queues even on Windows when they're no longer used. part of bug 15856. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51191 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 22:00:12 +00:00
rods%netscape.com
2a900deed8 The code that checked to see whether it should explicitly set focus on the gfx's containing widget
now uget the new focused content's frame instead of using the mCurrentTarget. The mCurrentTarget
is correct for a mouse down but incorrect for a "tab". This is because the mCurrentTarget points at
the currently focused content for a tab event, instead of the new content.
r=joki, bug 11162


git-svn-id: svn://10.0.0.236/trunk@51190 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:57:43 +00:00
pnunn%netscape.com
cc3d6490a5 bug# 16785. r: dp, valeski, neeti. Send mimetype info from channel to imglib.
If no decoder, sniff data stream for mime info.


git-svn-id: svn://10.0.0.236/trunk@51189 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:49:20 +00:00
alla%lysator.liu.se
cba2b194ce Update the GtkMozilla widget so it works. Also updated the streaming interface
so that it works with Necko. Small cleanups.
Fixes 16576 and 14975. r=shaver


git-svn-id: svn://10.0.0.236/trunk@51188 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:46:33 +00:00
norris%netscape.com
0b51721d30 Remove references to unsupported JVM_ calls. Needed for bug 16577.
r=shaver


git-svn-id: svn://10.0.0.236/trunk@51187 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:45:29 +00:00
dp%netscape.com
41b9a6b713 Removing prototype of NS_NewDocumentElementFrame. r=evaughan
git-svn-id: svn://10.0.0.236/trunk@51186 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:40:54 +00:00
locka%iol.ie
1e319234e1 Implemented ShowContextMenu so that CBrowse can display custom popup menus in response to right mouse clicks
git-svn-id: svn://10.0.0.236/trunk@51185 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:39:42 +00:00
tbogard%aol.net
ab0c88be9a Ooops, last night removing one warning uncovered another. r=gimpy
git-svn-id: svn://10.0.0.236/trunk@51184 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:34:21 +00:00
terry%mozilla.org
d1fca29577 Need to value_quote() things that go into VALUE attributes in HTML.
git-svn-id: svn://10.0.0.236/trunk@51183 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:27:41 +00:00
despotdaemon%netscape.com
a0b1fe8617 Pseudo-automatic update of changes made by paw@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@51182 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:26:55 +00:00
endico%mozilla.org
2e29901945 align "edit products" at the top so its not lost 3 screens down in the products list.
git-svn-id: svn://10.0.0.236/trunk@51181 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:26:39 +00:00
bienvenu%netscape.com
bad04c3403 fix nsImapProtocol leaks r=mscott, no bug #
git-svn-id: svn://10.0.0.236/trunk@51180 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:24:31 +00:00
pierre%netscape.com
9264bc9c89 added stopwatch.cpp to the mac build for nisheeth
git-svn-id: svn://10.0.0.236/trunk@51179 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:12:14 +00:00
slamm%netscape.com
4481922240 Handle clicks properly. Fix for 14857 and 11986. r=rjc
git-svn-id: svn://10.0.0.236/trunk@51178 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:11:39 +00:00
cathleen%netscape.com
2d960ed1c1 additional cleanup, and previous checked in added wallet chrome files, partial fix for bug 15220
git-svn-id: svn://10.0.0.236/trunk@51177 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:09:04 +00:00
rogerl%netscape.com
4e16b4e094 r=norris
Delayed functionDef from creating property until after the body parses
succesfully.


git-svn-id: svn://10.0.0.236/trunk@51176 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:07:45 +00:00
mscott%netscape.com
2fc150a6c8 no bug number. I found that we were making an extra copy of the message body before writing it to the stream.
I was able to fix this by using a nsCString instead of an nsString for the message body. Also, audited the file
to use nsCAutoString instead of nsString to save some extra copying. Used NS_WITH_SERVICE macros for componenet
mananager and register service. Added some com ptr useage too.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@51175 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:06:42 +00:00
rogerl%netscape.com
d0725e4d4e r=norris
Fixed bug #12951 - var if for..in statement should always be of type
string.


git-svn-id: svn://10.0.0.236/trunk@51174 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:06:03 +00:00
neeti%netscape.com
ee6aa2ffd0 updating status
git-svn-id: svn://10.0.0.236/trunk@51172 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:03:33 +00:00
cathleen%netscape.com
0fffda37f6 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@51170 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:02:43 +00:00
mscott%netscape.com
6823e8565b Bug #16538 --> pass the emitter into NS_NewPipe as a pipe observer.
r=jefft


git-svn-id: svn://10.0.0.236/trunk@51169 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:02:27 +00:00
mscott%netscape.com
7524389c82 Bug #16538 --> the emitter now supports nsIPipeObserver and we'll now flush our output stream when we are told
it is full. This fixes the problem where large attachements were truncated at 32K.
r=jefft


git-svn-id: svn://10.0.0.236/trunk@51168 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 21:01:54 +00:00
Jerry.Kirk%Nexwarecorp.com
c40a73a776 Fixes to correct lots of extra drawing because of incorrectly clipped regions
Bug #16698 r=kedl


git-svn-id: svn://10.0.0.236/trunk@51167 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 20:50:17 +00:00
selmer%netscape.com
2ff1cb0969 CheckListBox supports descriptions (bug #4884)
git-svn-id: svn://10.0.0.236/trunk@51166 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 20:30:18 +00:00
norris%netscape.com
d201925571 7261 Connect XPConnect visibility filter to query principals
Reviewed by mstoltz.


git-svn-id: svn://10.0.0.236/trunk@51165 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 20:28:24 +00:00
rods%netscape.com
15f62c11c2 cleaned up warning, result hidding another, r=kmcclusk, (no bug)
git-svn-id: svn://10.0.0.236/trunk@51164 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:59:06 +00:00
rods%netscape.com
959963c9b8 fixed several warning and fixed setting the wrap property enum to off r=kmcclusk, bug 16770
git-svn-id: svn://10.0.0.236/trunk@51163 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:58:07 +00:00
rods%netscape.com
88de486c18 removed comma after last enum, warning clean up, r=kmcclusk (no bug)
git-svn-id: svn://10.0.0.236/trunk@51162 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:56:35 +00:00
varada%netscape.com
0d2cedd9ae setting focus in edit boxes in dialog boxeson init
git-svn-id: svn://10.0.0.236/trunk@51161 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:53:40 +00:00
beard%netscape.com
45cf1dc448 for JBindery runner, added System.exit()
git-svn-id: svn://10.0.0.236/trunk@51160 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:43:31 +00:00
rpotts%netscape.com
0f75f32b71 bug #15560. Changed the LoadGroup to fire notifications via PLEvents to stop reenterency.
git-svn-id: svn://10.0.0.236/trunk@51159 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:42:55 +00:00
terry%mozilla.org
d49cc3e1d1 Fixed perl warning.
git-svn-id: svn://10.0.0.236/trunk@51158 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:42:49 +00:00
rpotts%netscape.com
cd23316388 bug #15560. Changed the LoadGroup to fire notifications via PLEvents to stop reenterency.
git-svn-id: svn://10.0.0.236/trunk@51157 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:36:07 +00:00
danm%netscape.com
88e77696a0 added CreateFromIThread. r:valeski@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51156 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:18:27 +00:00
troy%netscape.com
36419b7094 b=16781, r=vidur@netscape.com
Re-ordered destructor to delete maps after destroying the frame hierarchy


git-svn-id: svn://10.0.0.236/trunk@51154 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:06:37 +00:00
locka%iol.ie
1468b5f4ac Updated to include new registry entries
git-svn-id: svn://10.0.0.236/trunk@51153 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:06:31 +00:00
selmer%netscape.com
3fd4887790 Removing Recede...
git-svn-id: svn://10.0.0.236/trunk@51152 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:06:29 +00:00
selmer%netscape.com
5bdff5a335 Putting button names back
git-svn-id: svn://10.0.0.236/trunk@51151 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:04:11 +00:00
shaver%netscape.com
2d88ea3522 corrected assembly, from Ulrich Drepper <drepper@cygnus.com> (16612, r=shaver)
git-svn-id: svn://10.0.0.236/trunk@51150 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:03:01 +00:00
pollmann%netscape.com
7c466fda74 Bug 16725: Enable align attribute for iframe; r=harishd
git-svn-id: svn://10.0.0.236/trunk@51149 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 19:01:49 +00:00
selmer%netscape.com
7dac51627e Interpret functions moved to interpret.cpp; memory allocations cleaned up
git-svn-id: svn://10.0.0.236/trunk@51148 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 18:58:38 +00:00
leila.garin%eng.sun.com
46abc39ebf New perl automated script.
git-svn-id: svn://10.0.0.236/trunk@51147 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 18:48:53 +00:00
despotdaemon%netscape.com
494eaeb121 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@51146 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 17:34:13 +00:00
despotdaemon%netscape.com
8b64d99548 Pseudo-automatic update of changes made by exv@randomc.com.
git-svn-id: svn://10.0.0.236/trunk@51145 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 17:20:25 +00:00
terry%mozilla.org
9195dc1900 Fixed perl warnings.
git-svn-id: svn://10.0.0.236/trunk@51144 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 16:41:40 +00:00
norris%netscape.com
bd1c7245f6 Fixed bug. We weren't loading classes in bottom-up dependency order.
Subject:
            Re: another getClassLoader exception
       Date:
            Mon, 18 Oct 1999 22:01:24 -0400
      From:
            Andrew Wason <aw@softcom.com>
        To:
            norris@netscape.com (Norris Boyd)
        CC:
            Howard Lin <howard@softcom.com>
 References:
            1 , 2




At 05:03 PM 10/18/99 -0700, Norris Boyd wrote:
>Are you still seeing this problem?


Yes.  I just did a CVS update to get the latest stuff and we still have
this problem.

I wrote a standalone sample program that duplicates the problem.  Run
JSSupport and you should get this exception:

defineClass org.mozilla.javascript.gen.c2
Exception in thread "main" java.lang.NoClassDefFoundError:
org/mozilla/javascript/gen/c1
         at java.lang.ClassLoader.resolveClass0(Native Method)
         at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
         at
JSSupport$MySecuritySupport$DataClassLoader.loadClass(JSSupport.java:89)
         at JSSupport$MySecuritySupport.defineClass(JSSupport.java:47)
         at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
Compiled Code)
         at org.mozilla.javascript.Context.compile(Context.java:1761)
         at org.mozilla.javascript.Context.compile(Context.java:1691)
         at org.mozilla.javascript.Context.compileReader(Context.java:810)
         at org.mozilla.javascript.Context.evaluateReader(Context.java:725)
         at org.mozilla.javascript.Context.evaluateString(Context.java:692)
         at JSSupport.<init>(JSSupport.java:20)
         at JSSupport.main(JSSupport.java:9)



Andrew



>--N
>
>Andrew Wason wrote:
>
> > At 04:54 PM 10/12/99 -0700, Norris Boyd wrote:
> > >I just checked in changes so that the class calling ScriptRuntime (c5
> in your
> > >case) will load the class itself using the normal Java classloading
> mechanism
> > >rather than an explicit call to the class loader. I pushed the bits up
> to the
> > >ftp site, but it takes a bit to propagate.
> >
> > I get this exception now (debugging statements are from my code):
> >
> > SecuritySupport.defineClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c4
> > using default loader com.softcom.realjava.PluginClassLoader@da9486a0
> > java.lang.NoClassDefFoundError: org/mozilla/javascript/gen/c4
> >          at java.lang.ClassLoader.resolveClass0(Native Method)
> >          at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
> >          at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport$Da
> > taClassLoader.loadClass(RealJavaScript.java:410)
> >          at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport.de
> > fineClass(RealJavaScript.java:352)
> >          at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
> > Compiled Code)
> >          at org.mozilla.javascript.Context.compile(Context.java:1761)
> >          at org.mozilla.javascript.Context.compile(Context.java:1691)
> >          at org.mozilla.javascript.Context.compileReader(Context.java:810)
> >
> > So when c5 is being loaded by my SecuritySupport, it also needs to load c4.
> > I decompiled org.mozilla.javascript.gen.c5 and it's constant pool
> > references CLASS org.mozilla.javascript.gen.c4, so c5 is dependent on c4
> > being loadable.  Is the problem that c5 is being loaded before the
> > optimizer has defined c4?
> >
> > I get the above exception for some classes and not others.  It seems
> > consistent that I always get it for classes with dependencies on other
> > optimizer classes that haven't been generated yet.
> >
> > Andrew
> >
> > --
> > Andrew Wason
> > SoftCom, Inc.
> > aw@softcom.com

--
Andrew Wason
SoftCom, Inc.
aw@softcom.com



   JSSupport.java

                  Name:
                         JSSupport.java
                   Type:
                         Java Source File (text/java)
                Encoding:
                         base64


git-svn-id: svn://10.0.0.236/trunk@51143 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 16:38:23 +00:00
terry%mozilla.org
c94f0dfbd5 Fixed perl warnings.
git-svn-id: svn://10.0.0.236/trunk@51142 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 16:33:06 +00:00
terry%mozilla.org
4d41190cf3 This was using complicated perl features I don't understand, so I simplified it and it works now...
git-svn-id: svn://10.0.0.236/trunk@51141 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 16:24:48 +00:00
terry%mozilla.org
fae1be4423 Fixed perl warning.
git-svn-id: svn://10.0.0.236/trunk@51140 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 15:07:27 +00:00
terry%mozilla.org
c51e515d06 Fix perl warnings.
git-svn-id: svn://10.0.0.236/trunk@51139 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 15:05:16 +00:00
brade%netscape.com
736ea51be4 add images from Dan Haddix (r=pavlov@pavlov.net)
git-svn-id: svn://10.0.0.236/trunk@51138 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 14:53:55 +00:00
bienvenu%netscape.com
22abb4e345 fix ref count logging on nsMimeImpl r=warren
git-svn-id: svn://10.0.0.236/trunk@51137 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 14:50:09 +00:00
brade%netscape.com
d885aed29d add images from Dan Haddix (r=rods@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@51136 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 14:44:01 +00:00
troy%netscape.com
0bdf9140d7 Changes to frame property API (code's not being used yet)
git-svn-id: svn://10.0.0.236/trunk@51135 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 14:41:55 +00:00
rods%netscape.com
186216cd35 changed font-family and margin settings for input text and textareas
r-kmcclusk, Bug #4072


git-svn-id: svn://10.0.0.236/trunk@51134 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 13:39:59 +00:00
brade%netscape.com
f27c8ca4ba function for image map editor added (contributed by Dan Haddix)
git-svn-id: svn://10.0.0.236/trunk@51133 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 13:34:34 +00:00
brade%netscape.com
156010fda2 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@51132 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 13:32:22 +00:00
brade%netscape.com
2eaffc0b34 add images for Dan Haddix (image map editor)
git-svn-id: svn://10.0.0.236/trunk@51131 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 13:31:25 +00:00
rods%netscape.com
d3a58b07b8 Changed the sizing comparison for NavQuirks in debug mode to get the font family and size
for the input text  and textarea, I also changed the border calc for only when the
the size is explicitly set.
r=kmcclusk, Bug #3040,11285


git-svn-id: svn://10.0.0.236/trunk@51130 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:59:01 +00:00
rods%netscape.com
701a5f632f Moved GetWrapProperty to nsFormControlHelper
Changed add the added of scrollbar sizes for Standard mode
r=kmcclusk, Bug #3040,11285


git-svn-id: svn://10.0.0.236/trunk@51129 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:58:53 +00:00
rods%netscape.com
94117fe06b Added methods for getting a frame's current font and
for calculating the nsIFormControlFrame's NavQuirks size
Added two methods for getting the "wrap" property and andded a new enum
for for testing against instead of a string
Added a method for calculating the size when in NavQuirks modes, this currently
duplicates the algorithms for for input text and textareas
r=kmcclusk, Bug #3040,11285


git-svn-id: svn://10.0.0.236/trunk@51128 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:58:50 +00:00
rods%netscape.com
4df3a52095 Removed old commented out code and unused comments. r=kmcclusk, (no bug)
git-svn-id: svn://10.0.0.236/trunk@51127 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:35:17 +00:00
rods%netscape.com
7df83f9c8c Added a method in the debug build to return the Navigator size for a given
for control for a given font family and size. Used for NavQuirks testing only.
r=kmcclusk, Bugs #3040, 4072


git-svn-id: svn://10.0.0.236/trunk@51126 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 11:34:00 +00:00
rickg%netscape.com
6dafd0deac fixed bug 16584; CRCRLF not handled correctly. r=syd
git-svn-id: svn://10.0.0.236/trunk@51125 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 08:52:30 +00:00
tbogard%aol.net
b70777ae81 Removed the last of gimpy's warnings. r=gimpy.
git-svn-id: svn://10.0.0.236/trunk@51124 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 08:03:11 +00:00
jband%netscape.com
88ae89c00d trivial fix to get rid of warning from copy/paste error - was passing unused argument to printf
git-svn-id: svn://10.0.0.236/trunk@51123 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 08:00:29 +00:00
tbogard%aol.net
4d16c8e921 Another warning. r=gimpy.
git-svn-id: svn://10.0.0.236/trunk@51122 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 07:59:20 +00:00
tbogard%aol.net
b17c3685f5 Fixed a few more of gimpy's warnings..... Oh, we found a bug there. r=gimpy Total warnings now under 200!
git-svn-id: svn://10.0.0.236/trunk@51121 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 07:57:51 +00:00
tbogard%aol.net
8b7f08fbc0 Removing gimpy's warnings. r=gimpy. This brings us down to 200. :)
git-svn-id: svn://10.0.0.236/trunk@51120 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 07:50:55 +00:00
tbogard%aol.net
ceae1958d8 Removed border from the XUL browser, editor, and iframe tags. This allows content coming up in chromeless pop-up windows not be visually cluttered with a needless border. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@51119 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 07:40:44 +00:00
cls%seawood.org
beb3488154 Add newline at end of file for broken compilers.
git-svn-id: svn://10.0.0.236/trunk@51118 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 06:40:25 +00:00
beard%netscape.com
8af0179bfb changed NSLibraryStartup.o to NSComponentStartup.o, since it's really a component. r=jband
git-svn-id: svn://10.0.0.236/trunk@51117 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 06:31:49 +00:00
jband%netscape.com
defd5464f8 fixing brendan's copy/paste bug that broke gc. r=shaver
git-svn-id: svn://10.0.0.236/trunk@51116 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:58:07 +00:00
dp%netscape.com
ab76ab5c8c Fixing warning. Moved declaration into if 0 block.
git-svn-id: svn://10.0.0.236/trunk@51115 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:49:04 +00:00
cls%seawood.org
8644b9e14b Use PR_TRUE instead of c++ keyword "true" in case of broken/out-of-date compilers.
r=syd


git-svn-id: svn://10.0.0.236/trunk@51114 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:38:27 +00:00
cls%seawood.org
0d7e9393fb Syncing Makefile.ins with srinivas' previous checkin.
r=shaver


git-svn-id: svn://10.0.0.236/trunk@51113 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:30:36 +00:00
troy%netscape.com
85565b9667 Changed a comment
git-svn-id: svn://10.0.0.236/trunk@51112 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 05:00:30 +00:00
troy%netscape.com
670fa6c8d6 Change to code that's not currently being used. Before it gets used it
will get code reviewed


git-svn-id: svn://10.0.0.236/trunk@51111 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 04:52:33 +00:00
troy%netscape.com
a34fdc41e1 Didn't actually change anything. Just moved two functions up higher in the
file to make the Solaris compiler happy...


git-svn-id: svn://10.0.0.236/trunk@51110 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 04:50:34 +00:00
selmer%netscape.com
727f93afc4 Minor cleanup
git-svn-id: svn://10.0.0.236/trunk@51109 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:46:54 +00:00
alecf%netscape.com
5e8b124880 event targets for checkboxes now reflect reality
(just a test, not part of product)


git-svn-id: svn://10.0.0.236/trunk@51108 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:16:45 +00:00
jefft%netscape.com
668bbc4967 removed obsolete menubar xul tag; fixed bug 16145; r=rhp, ducarroz; a=dp
git-svn-id: svn://10.0.0.236/trunk@51107 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:08:43 +00:00
waterson%netscape.com
6a8fd22671 Obsolete.
git-svn-id: svn://10.0.0.236/trunk@51106 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:05:25 +00:00
beard%netscape.com
de43edf0b2 fixed histogram sorting.
git-svn-id: svn://10.0.0.236/trunk@51105 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:03:12 +00:00
pierre%netscape.com
bdfce7679a Fix build in Mac embedding apps after last week's changes in nsIWebShell.
git-svn-id: svn://10.0.0.236/trunk@51104 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:02:01 +00:00
pierre%netscape.com
f1aa92ba58 Fix a crash in Mac embedding apps: HasGfxScrollBars() checks for null pointer after calling GetPrefs().
git-svn-id: svn://10.0.0.236/trunk@51103 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 03:00:47 +00:00
alecf%netscape.com
de2e6cfb95 land new DOMViewer branch
no reviewer, not part of product, just a test


git-svn-id: svn://10.0.0.236/trunk@51102 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:46:45 +00:00
selmer%netscape.com
7f47a31e88 Fixes to make enable/disable work in checklist.ini
git-svn-id: svn://10.0.0.236/trunk@51100 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:41:48 +00:00
Jerry.Kirk%Nexwarecorp.com
9518fbd96c moving Push/PopThreadEventQueue to nsIEventQueueService.
This is required to get anythinbg to work now...
r=danm@netscape.com


git-svn-id: svn://10.0.0.236/trunk@51099 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:26:53 +00:00
endico%mozilla.org
b6decda29b search patterns are limited to 29 characters due to the -n option in glimpse
git-svn-id: svn://10.0.0.236/trunk@51098 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:14:09 +00:00
despotdaemon%netscape.com
77a9ed2910 Pseudo-automatic update of changes made by pfong@julian.uwo.ca.
git-svn-id: svn://10.0.0.236/trunk@51097 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:04:40 +00:00
alecf%netscape.com
6557db6b98 Start to land DOMViewer branch (extension - not part of product)
git-svn-id: svn://10.0.0.236/trunk@51096 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 02:01:40 +00:00
selmer%netscape.com
e654e9fdbb Changed interpretation & initialization to use onInit and onCommand INI file directives
git-svn-id: svn://10.0.0.236/trunk@51094 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:30:18 +00:00
slamm%netscape.com
0bbf0c1cfd Fix build bustage
git-svn-id: svn://10.0.0.236/trunk@51093 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:29:44 +00:00
sspitzer%netscape.com
ed6cbe944d other part of fix for #15235. fix send later. r=alecf
git-svn-id: svn://10.0.0.236/trunk@51092 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:24:25 +00:00
sspitzer%netscape.com
a8b4e077c5 part of fix for #15235. get send later to work again. r=alecf
git-svn-id: svn://10.0.0.236/trunk@51091 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:23:54 +00:00
despotdaemon%netscape.com
49bc011b9b Pseudo-automatic update of changes made by jfalzon@julian.uwo.ca.
git-svn-id: svn://10.0.0.236/trunk@51090 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:11:16 +00:00
dougt%netscape.com
fa7e2137bd Fix for bug 14784. Moved pref item up. r=cathleen.
git-svn-id: svn://10.0.0.236/trunk@51089 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 01:01:51 +00:00
despotdaemon%netscape.com
569c5aba2d Pseudo-automatic update of changes made by scosta@julian.uwo.ca.
git-svn-id: svn://10.0.0.236/trunk@51088 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:51:34 +00:00
srinivas%netscape.com
263860675d Update with post-3.5 fixes on the tip
git-svn-id: svn://10.0.0.236/trunk@51087 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:40:39 +00:00
pierre%netscape.com
51196f76b4 Fix #12737 "-moz-fixed should be compat mode only". Overwrites the fixed font family with the normal font family in navQuirks mode only. r=pollmann.
git-svn-id: svn://10.0.0.236/trunk@51086 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:31:45 +00:00
Jerry.Kirk%Nexwarecorp.com
3b650617aa Removed some hacks that were no longer necessary because of fixes made
on GFX side to fix nsRegion and the double buffer routines. Also
removed the DOUBLE_CLICK messages as directed by someone, I forget now who.
Bug 16698 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@51085 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:29:33 +00:00
Jerry.Kirk%Nexwarecorp.com
03c368d1b3 Various fixes to correct bugs in nsRegionPh and to correct clipping
done by the double buffer routines.
Bug# 16698 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@51084 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:27:56 +00:00
selmer%netscape.com
a711824bea Enable/Disable for Network builds
git-svn-id: svn://10.0.0.236/trunk@51083 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:27:21 +00:00
terry%mozilla.org
c4afb2ebc0 Fixed perl warning.
git-svn-id: svn://10.0.0.236/trunk@51082 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:25:42 +00:00
terry%mozilla.org
42d190d77d Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51081 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:20:52 +00:00
terry%mozilla.org
877a31dd8a Fix potential security hole (and I think some perl warnings.)
git-svn-id: svn://10.0.0.236/trunk@51080 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:17:54 +00:00
larryh%netscape.com
a6a41c799e BugZilla 16566
git-svn-id: svn://10.0.0.236/trunk@51079 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:15:05 +00:00
terry%mozilla.org
2249323ac8 Fixed perl warnings -- this module no longer defines its own "die" routine.
git-svn-id: svn://10.0.0.236/trunk@51078 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:07:23 +00:00
despotdaemon%netscape.com
4654177ca6 Pseudo-automatic update of changes made by jhuntley@julian.uwo.ca.
git-svn-id: svn://10.0.0.236/trunk@51077 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:05:52 +00:00
terry%mozilla.org
a4508fd4ea Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51076 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:04:59 +00:00
nhotta%netscape.com
a310c234a4 Fixing the linux build bustage.
git-svn-id: svn://10.0.0.236/trunk@51075 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:03:57 +00:00
edburns%acm.org
d2f14fa650 r=neeti@netscape.com
bug: 16679
approved by: neeti@netscape.com

Return NS_ERROR_FAILURE when a cookie is not found.


git-svn-id: svn://10.0.0.236/trunk@51074 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:03:33 +00:00
terry%mozilla.org
35043c37a6 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51073 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-19 00:02:42 +00:00
terry%mozilla.org
282909ff22 Fixed stupid perl warnings.
git-svn-id: svn://10.0.0.236/trunk@51072 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:57:58 +00:00
despotdaemon%netscape.com
0f0eb4c9e6 Pseudo-automatic update of changes made by shaver@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@51070 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:53:02 +00:00
srinivas%netscape.com
fcf52e9477 Initial version
git-svn-id: svn://10.0.0.236/trunk@51068 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:46:10 +00:00
jband%netscape.com
039dd4adee checking in code to fix bug 12768 submitted by Dan.Oscarsson@trab.se. Needed a 'const char*' tmp varible to work with a 'const char*' buffer that was passed in. The same problem is in both js.c and xpcshell.cpp. r=jband
git-svn-id: svn://10.0.0.236/trunk@51066 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:45:39 +00:00
terry%mozilla.org
f8f7d2f6fc Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51065 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:42:25 +00:00
terry%mozilla.org
565f556bd3 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51064 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:35:57 +00:00
alecf%netscape.com
bd2182e45d add big comment describing how this dialog works
(no reviewer, no bug, just comments)


git-svn-id: svn://10.0.0.236/trunk@51063 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:35:53 +00:00
alecf%netscape.com
dd194c9fb7 fix for #15685
r=sspitzer
rdf: prefix on XML attributes was confusing the template


git-svn-id: svn://10.0.0.236/trunk@51062 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:35:22 +00:00
nhotta%netscape.com
fc73fd2088 Checking in a fix for the linux build bastage,
git-svn-id: svn://10.0.0.236/trunk@51061 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:32:45 +00:00
terry%mozilla.org
94c58cd2a0 Oops; fixed perl error.
git-svn-id: svn://10.0.0.236/trunk@51060 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:32:03 +00:00
terry%mozilla.org
6856a7ee21 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51059 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:23:08 +00:00
jband%netscape.com
fb63cac2a5 checking in bug 16629 fix to cbegle's xpconnect tests submitted by green@FreeBSD.org. This fixes screwy longlong test methods. r=jband
git-svn-id: svn://10.0.0.236/trunk@51058 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:20:16 +00:00
alecf%netscape.com
88779549b8 fix typedef so this compiles with boehm's own makefile or mozilla's makefile.in
git-svn-id: svn://10.0.0.236/trunk@51057 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:17:02 +00:00
alecf%netscape.com
35edd9a187 we should actually be using generic threads so unhide this stuff
git-svn-id: svn://10.0.0.236/trunk@51056 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:15:44 +00:00
briano%netscape.com
2f40b34ffb Automated update
git-svn-id: svn://10.0.0.236/trunk@51055 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:15:10 +00:00
alecf%netscape.com
ad85636e7f build boehm when flag is used r=sspitzer
(last checkin also r=sspitzer)


git-svn-id: svn://10.0.0.236/trunk@51054 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:14:16 +00:00
alecf%netscape.com
a6598d4a1c add flag for boehm (doesn't quite work yet)
git-svn-id: svn://10.0.0.236/trunk@51053 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:13:47 +00:00
waterson%netscape.com
ffa36fb99e Move nsXULElement declaration into the header file.
git-svn-id: svn://10.0.0.236/trunk@51052 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:05:35 +00:00
terry%mozilla.org
8662f77243 Fixed stupid perl warning.
git-svn-id: svn://10.0.0.236/trunk@51051 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 23:04:40 +00:00
terry%mozilla.org
93cd29ad2b Massive spank to put "use strict" in all Bonsai code.
git-svn-id: svn://10.0.0.236/trunk@51050 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:55:01 +00:00
alecf%netscape.com
36d234884e remove makefiles that arent' part of the module anymore
git-svn-id: svn://10.0.0.236/trunk@51049 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:49:05 +00:00
rickg%netscape.com
217ed89f11 fixed bug16624; r=buster. Buffer used to translate unicode entities in forms wasn't being truncated.
git-svn-id: svn://10.0.0.236/trunk@51048 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:39:58 +00:00
ducarroz%netscape.com
4f836323d6 Fix for bug 15313 & 15536. .txt files are now interpreted as XML document. Therefore we need to load a .html file even if it content is purely plain text. R=rhp
git-svn-id: svn://10.0.0.236/trunk@51047 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:38:54 +00:00
sspitzer%netscape.com
01d0e55136 fix for #16259, r=alecf. use the right line endings on the mac. now, instead of putting the LINEBREAK in every string, and then
writing every string to the stream, we do the line ending when we write to the stream.


git-svn-id: svn://10.0.0.236/trunk@51046 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:38:53 +00:00
slamm%netscape.com
3981b8f2c8 Update checkout target. Add logging. Stop on conflicts. r=dougt
git-svn-id: svn://10.0.0.236/trunk@51045 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:33:32 +00:00
nhotta%netscape.com
25c87328ce Changed interface and implementation of nsIEntityConverter,
more entity support (before Latin1 only), added a string based interface. Bug fix 8865, r=ftang.


git-svn-id: svn://10.0.0.236/trunk@51044 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:33:14 +00:00
cata%netscape.com
76ebba554f Conversion to Module. Reviewed by dp. Bug #15589.
git-svn-id: svn://10.0.0.236/trunk@51043 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:23:28 +00:00
troy%netscape.com
c8965f4626 r=kipp@netscape.com Moved ownership of root frame (and frame hierarchy) over to
the frame manager


git-svn-id: svn://10.0.0.236/trunk@51042 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:20:37 +00:00
ftang%netscape.com
2476a575cf fix bug 16656, change the test condiction for NS_PRECONDICTION. also add some error checking code for null ptr. r=erik
git-svn-id: svn://10.0.0.236/trunk@51041 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:17:16 +00:00
waterson%netscape.com
911c570602 Remove nsRDFElement.cpp
git-svn-id: svn://10.0.0.236/trunk@51040 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:08:39 +00:00
waterson%netscape.com
7a9241890d Rename nsRDFElement to nsXULElement; rename nsXULElement to nsXULAggregateElement.
git-svn-id: svn://10.0.0.236/trunk@51039 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:08:15 +00:00
waterson%netscape.com
ce617a2441 Rename nsRDFElement to nsXULElement.
git-svn-id: svn://10.0.0.236/trunk@51038 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:07:36 +00:00
rhp%netscape.com
eff48efacc Change for separating inline attachments - Bug #16367 - r: bienvenu
git-svn-id: svn://10.0.0.236/trunk@51037 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 22:07:02 +00:00
buster%netscape.com
a8ec8337df some extremely minor cleanup of bugs found by ftang. Thanks, frank.
git-svn-id: svn://10.0.0.236/trunk@51036 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:59:19 +00:00
akhil.arora%sun.com
b931259907 16427 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
Found some more instances where the DOM spec says that it is not an error
  to return a NULL. Do not throw exceptions in these cases.


git-svn-id: svn://10.0.0.236/trunk@51035 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:53:20 +00:00
pavlov%netscape.com
b8fadf3327 clean up wizard code a bit
git-svn-id: svn://10.0.0.236/trunk@51034 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:52:03 +00:00
rods%netscape.com
ef34fa6834 Links will now scroll into view when they get focus and anchors now respond
to the .focus call from script. r=kmcclusk, Bug #15198


git-svn-id: svn://10.0.0.236/trunk@51033 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:49:38 +00:00
rods%netscape.com
a1a74387d0 Move code to handle focus event into the correct switch statement
r=kmcclusk, bug 7133


git-svn-id: svn://10.0.0.236/trunk@51032 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:47:31 +00:00
akhil.arora%sun.com
479581e81f 16488 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
Copy/Paste error- createEntityReference was calling the wrong coreDOM method


git-svn-id: svn://10.0.0.236/trunk@51031 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:44:57 +00:00
pavlov%netscape.com
9bfe6151f6 new files
git-svn-id: svn://10.0.0.236/trunk@51030 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:44:15 +00:00
law%netscape.com
25e63cd81a Bug #14999; stop using toolkit app core; r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51029 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:39:18 +00:00
law%netscape.com
45245a0e3f Bug #14999; stop using toolkit app core (added JavaScript[Debug].shlb to this project); r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51028 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:36:57 +00:00
norris%netscape.com
cb1dcdbdc6 Part of bug 7261 "Connect XPConnect visibility filter to query principals"
Reviewed by rhp@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@51027 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:35:52 +00:00
waterson%netscape.com
08c93a00f3 Bug 15558. Fix personal toolbar style rules (patch courtesy dbaron@fas.harvard.edu). r=matt
git-svn-id: svn://10.0.0.236/trunk@51026 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:35:28 +00:00
law%netscape.com
c4ca3de4e5 Bug #14999; stop using toolkit app core; r=davidm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51025 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:33:29 +00:00
pavlov%netscape.com
329e721fff update file list
git-svn-id: svn://10.0.0.236/trunk@51024 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:30:40 +00:00
law%netscape.com
1c3ac7d8fe Bug #14999; stop using toolkit app core; r=ducarroz@netscape.com
git-svn-id: svn://10.0.0.236/trunk@51023 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:29:54 +00:00
bienvenu%netscape.com
cf9daf3b34 change shutdown code to go through nsMessengerBootstrap instead of relying on service shutdown listener or destructors getting called r=alecf
git-svn-id: svn://10.0.0.236/trunk@51022 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:16:23 +00:00
ssu%netscape.com
ef93fdf802 fixing bug #16694. fixes crash bug in the select components dialog in the windows installer. r=sgehani. Affects only windows platform.
git-svn-id: svn://10.0.0.236/trunk@51021 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 21:15:09 +00:00
dp%netscape.com
068b895d74 Removing extra backslashes at the end of the install lines. Fixing
build.


git-svn-id: svn://10.0.0.236/trunk@51020 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:43:11 +00:00
sspitzer%netscape.com
80c75c7ae1 fix warnings. following alecf's recommendations, remove the FindServerUsingURI() method from the nsIMsgAccountManager, remove CreateFolderInDatasource() from nsIMsgFolder, change several methods in nsMsgCopy to return nsresult, and have nsIMsgFolder ** as an outparam, use GetResource() instead of CreateFolderInDatasource(). use NS_SUCCEEDED() instead of comparing against NS_OK directly.
git-svn-id: svn://10.0.0.236/trunk@51019 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:42:06 +00:00
brade%netscape.com
f24babcd8f make doEditor create an html editor rather than the plaintext editor. (bug #16681; r=sfraser@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@51018 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:27:14 +00:00
harishd%netscape.com
cd72403513 Fix for Bug 16126 -- Error message was not getting propagated
to the parser ( CNavDTD::AddLeaf() )
Related to bug 16578 - Throwing userdefined tags to the floor
( what we used to do before ). This will avoid people from being
blocked.   Will work on a fix later.

r=nisheeth


git-svn-id: svn://10.0.0.236/trunk@51017 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:23:27 +00:00
selmer%netscape.com
f641e35434 Enable BoldText type
git-svn-id: svn://10.0.0.236/trunk@51016 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:22:21 +00:00
troy%netscape.com
16faac45a3 Removed delete operators (they had no implementation, they were private so
they wern't accidently called), because HP compiler generated an error if
new operator was public but delete operator was private


git-svn-id: svn://10.0.0.236/trunk@51015 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:16:49 +00:00
nhotta%netscape.com
83699f202b Add new propertie files for html entity, part of bug fix 8865, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@51014 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 20:02:20 +00:00
tonyr%fbdesigns.com
b46af177f3 Added string bundles for the mailnews import tools
git-svn-id: svn://10.0.0.236/trunk@51013 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:58:07 +00:00
dougt%netscape.com
921610c409 Fix for 16700. Isolating CreateTransport into new function.
r=gagan.


git-svn-id: svn://10.0.0.236/trunk@51012 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:43:34 +00:00
warren%netscape.com
895b2679fc Made bloatdiff distinguish between no change in leaks, and infinite leakage (no leak before, but leak now).
git-svn-id: svn://10.0.0.236/trunk@51011 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:43:29 +00:00
selmer%netscape.com
ef18489b86 Corrected tab sort order
git-svn-id: svn://10.0.0.236/trunk@51010 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:39:42 +00:00
Jerry.Kirk%Nexwarecorp.com
614348b081 Installed our own PtMainLoop() function that can be exited to allow
the Create Profile Manager to display a dialog, then exit the GUI and display
a different dialog.
Bug# 16667 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@51009 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:34:07 +00:00
selmer%netscape.com
fb6169fb87 Temporary fixes for tab ordering
git-svn-id: svn://10.0.0.236/trunk@51008 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:23:11 +00:00
warren%netscape.com
91a872ec09 Took out redundant MOZ_COUNT_CTOR/DTOR calls.
git-svn-id: svn://10.0.0.236/trunk@51007 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:21:53 +00:00
slamm%netscape.com
900a118dd2 Landing of SIDEBAR_19991007_BRANCH. r=waterson
git-svn-id: svn://10.0.0.236/trunk@51006 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:21:52 +00:00
radha%netscape.com
b1aa689e2b Mail news regresion with replying to a message. r=mscott bug # 16550
git-svn-id: svn://10.0.0.236/trunk@51005 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:09:27 +00:00
warren%netscape.com
0ae271237a Made it implement nsIURL as well as nsIURI.
git-svn-id: svn://10.0.0.236/trunk@51004 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:07:16 +00:00
warren%netscape.com
671c8baf13 Cleanup to use nsCOMPtrs.
git-svn-id: svn://10.0.0.236/trunk@51003 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:06:57 +00:00
warren%netscape.com
a270067a3a Took out redundant MOZ_COUNT_CTOR/DTOR calls.
git-svn-id: svn://10.0.0.236/trunk@51002 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:06:21 +00:00
troy%netscape.com
a431ec5d07 b=16615. Two line change. Added check for case of root node being a leaf.
The rest of the changes are NOT yet in use. They willbe reviewed by Kipp before
they're turned on


git-svn-id: svn://10.0.0.236/trunk@51001 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:02:09 +00:00
akkana%netscape.com
ae4dba7c09 Remove two ifdef DEBUG_akkana lines that were left in when someone
changed the implementation of ConvertContentToXIF, so that I can
compile again.  This won't affect anyone but me.  r=kipp


git-svn-id: svn://10.0.0.236/trunk@51000 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:01:56 +00:00
troy%netscape.com
3a3c120af6 b=16652, r=troy@netscape.com
Patch from Johnny Stenback that breaks a weak link reference


git-svn-id: svn://10.0.0.236/trunk@50999 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:00:49 +00:00
shaver%netscape.com
408093c6c7 fix // comment in C file (r=brade)
git-svn-id: svn://10.0.0.236/trunk@50998 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 19:00:18 +00:00
rogerl%netscape.com
b4ac2f29ae Changed tests for ECMA 3 definition of array.length handling.
git-svn-id: svn://10.0.0.236/trunk@50995 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 16:55:44 +00:00
pavlov%netscape.com
2a38ab0914 revert some key code to pre branch landing so that typing works correctly
git-svn-id: svn://10.0.0.236/trunk@50993 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 16:08:16 +00:00
danm%netscape.com
21960bf642 adding PR_LOGging to event queue handling. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50992 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:09:50 +00:00
danm%netscape.com
c4ec5e4d7e moving Push/PopThreadEventQueue to nsIEventQueueService. r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50991 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:08:45 +00:00
danm%netscape.com
5bb4aa8eb3 synching with nsWebShellWindow 1.219 (nsIModalWindowSupport removed). r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50990 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:06:38 +00:00
danm%netscape.com
2d0400db89 removing nsIModalWindowSupport r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50989 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:05:17 +00:00
danm%netscape.com
8e456a4690 moving Push/PopThreadEventQueue to nsIEventQueueService r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50988 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:04:18 +00:00
danm%netscape.com
1dff151de6 patch nsEventQueue leak in GetProxyObject r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50987 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 15:01:40 +00:00
danm%netscape.com
0b71323316 event queues own and delete themselves when they're done. bug 15856 r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50986 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 14:59:57 +00:00
danm%netscape.com
e200e99d65 new r:hyatt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50985 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 14:57:07 +00:00
ftang%netscape.com
c18bf1d357 1. add asserting code to check null ptr
2. add if code and return NS_ERROR_NULL_POINTER if the ptr is null
3. add code to check return value 
r=myself


git-svn-id: svn://10.0.0.236/trunk@50984 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 14:48:41 +00:00
karnaze%netscape.com
905268d150 added #ifdef for debug printing.
git-svn-id: svn://10.0.0.236/trunk@50983 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 13:48:19 +00:00
karnaze%netscape.com
0b5271c1c7 bug 15958(partial) - uses mComputedWidth instead of availableSize.width. r=buster; asked hook for permission, got no response.
git-svn-id: svn://10.0.0.236/trunk@50982 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 13:47:01 +00:00
karnaze%netscape.com
aef57f8136 bug 15993 - in quirks mode allocates space for a 1 pixel border if the content is empty and the table has a border. It was incorrectly, doing this even if the content was not empty. r=buster; asked permission from hook and got no response.
git-svn-id: svn://10.0.0.236/trunk@50981 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 13:45:41 +00:00
dveditz%netscape.com
038ada687d stopgap for mysterious Mac bustage
git-svn-id: svn://10.0.0.236/trunk@50980 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 12:58:58 +00:00
dveditz%netscape.com
ddf8086d83 generate unique regkeys (6986)
git-svn-id: svn://10.0.0.236/trunk@50979 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 12:06:19 +00:00
srinivas%netscape.com
e8fb19a369 Include fcntl.h always. Bugizlla #16630.
git-svn-id: svn://10.0.0.236/trunk@50978 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 11:13:23 +00:00
dveditz%netscape.com
48a1d530ed variable name change to silence warning
git-svn-id: svn://10.0.0.236/trunk@50977 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 08:35:39 +00:00
dveditz%netscape.com
64356116f8 cleaning up warnings 15626; removing RegisterService/UnregisterService calls per request from dp
git-svn-id: svn://10.0.0.236/trunk@50976 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 05:56:15 +00:00
rickg%netscape.com
756b010b94 another WIP for bug 13536; added charset notification back in; r=harish
git-svn-id: svn://10.0.0.236/trunk@50975 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 05:14:38 +00:00
buster%netscape.com
7653742295 fixed bug 16486, r=brade@netscape.com
windows widget code handles control-key combinations correctly.


git-svn-id: svn://10.0.0.236/trunk@50974 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 03:39:48 +00:00
jband%netscape.com
8013d6bb78 fix typo in comment
git-svn-id: svn://10.0.0.236/trunk@50972 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 02:54:26 +00:00
jband%netscape.com
0a174a879e r=mccabe (I'll be adding more comments to the headers as requested)
Implement nsIXPCNativeCallContext to meet user feature
requirements. This allows simpler implementation of reflection of
native classes into JavaScript in cases where they need to
support legacy interfaces that include optional parameters and
method name overloading. This also provides a general mechanism
for native methods to discover if they were called from JS code,
exactly what JS parameters were passed, explicitly return jsvals,
and throw explicit jsvals without interference from xpconnect.
With test cases.


git-svn-id: svn://10.0.0.236/trunk@50971 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 02:53:04 +00:00
mcafee%netscape.com
6d347761bd Adding perl-path to match other tinderbox files.
git-svn-id: svn://10.0.0.236/trunk@50970 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 01:34:45 +00:00
rickg%netscape.com
c1b9043596 forgot to check this in for viewsource; bug13536; r=harish
git-svn-id: svn://10.0.0.236/trunk@50969 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-18 00:46:33 +00:00
dveditz%netscape.com
57ed2f138a hoping this fixes the mac bustage
git-svn-id: svn://10.0.0.236/trunk@50968 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 23:55:56 +00:00
pavlov%netscape.com
0d172a490d work around for not being able to type in text fields on unix without them closing your apps.
16564 and 16542 r=smfr


git-svn-id: svn://10.0.0.236/trunk@50966 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 23:27:50 +00:00
karnaze%netscape.com
a06cb090a4 new regression tests. does not affect build.
git-svn-id: svn://10.0.0.236/trunk@50965 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 23:26:02 +00:00
bienvenu%netscape.com
3f482a5e18 fix leak of profile dir in addr book session
git-svn-id: svn://10.0.0.236/trunk@50964 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 22:16:32 +00:00
shaver%netscape.com
b2f619e9fa fixing build by removing leftover #endif
git-svn-id: svn://10.0.0.236/trunk@50963 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 22:15:34 +00:00
dveditz%netscape.com
ea80c313d6 Added NR_RegFlush (14909, required for 16283/16600); warning cleanup (15626) r=shaver
git-svn-id: svn://10.0.0.236/trunk@50962 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:47:53 +00:00
karnaze%netscape.com
cf41a16010 new regression test, doesn't affect build.
git-svn-id: svn://10.0.0.236/trunk@50961 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:46:13 +00:00
dveditz%netscape.com
9d59534945 Added nsIRegistry::Flush (bug 16283, required for 16600), r=shaver
git-svn-id: svn://10.0.0.236/trunk@50960 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:45:53 +00:00
morse%netscape.com
04d5d271eb fix bug 16319, stop assertion failure, r=dp
git-svn-id: svn://10.0.0.236/trunk@50959 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:41:50 +00:00
shaver%netscape.com
8c73db21d3 make View->Use Stylesheet use type=radio. (r=hyatt)
git-svn-id: svn://10.0.0.236/trunk@50958 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:38:21 +00:00
shaver%netscape.com
f2a09249da Added support for type="radio" (pick-one) XP menus.
Cleaned up nsFrame class declaration a bit.
Added some API entries to nsIMenuFrame in support of type="radio"'s
pick-one behaviour.
Renamed UpdateMenuChecked to UpdateMenuSpecialState.
Removed stale string-splitting code in CreateAnonymousContent.
(r=hyatt,mcafee)


git-svn-id: svn://10.0.0.236/trunk@50957 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 21:37:37 +00:00
mscott%netscape.com
ee5e86e569 Bug #16394 --> no longer need to call intialize after creating a url
r=jefft


git-svn-id: svn://10.0.0.236/trunk@50956 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 20:04:59 +00:00
mscott%netscape.com
e396ccade3 Bug #16394 --> extract user name from the url spec. Don't force us to pass it in on initialize.
r=jefft


git-svn-id: svn://10.0.0.236/trunk@50955 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 20:04:40 +00:00
mscott%netscape.com
79e9036238 Bug #16394 --> Initialize now has no arguments.
r=jefft


git-svn-id: svn://10.0.0.236/trunk@50954 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 20:04:08 +00:00
mscott%netscape.com
71ebac111b Bug #16394 --> call Initialize function on url after we create one
r=jefft


git-svn-id: svn://10.0.0.236/trunk@50953 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 20:03:37 +00:00
briano%netscape.com
81d0f9cde9 Automated update
git-svn-id: svn://10.0.0.236/trunk@50952 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 15:30:18 +00:00
cls%seawood.org
3f3f4e0c22 r=pavlov
Add temporary --enable-nspr-autoconf option to allow platforms to test the newly added autoconf setup for nspr (bug 11893) before turning it on as default.


git-svn-id: svn://10.0.0.236/trunk@50951 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 15:16:47 +00:00
cls%seawood.org
5e7ffdc098 Bug 11893. r=shaver
Sync the autoconf Makefile.ins.


git-svn-id: svn://10.0.0.236/trunk@50950 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 15:12:41 +00:00
warren%netscape.com
a53c95056f Added .txt to delta file name.
git-svn-id: svn://10.0.0.236/trunk@50949 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:57:45 +00:00
warren%netscape.com
a0fc33207e Changed format slightly.
git-svn-id: svn://10.0.0.236/trunk@50948 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:52:19 +00:00
warren%netscape.com
990cda09f3 Changed format slightly.
git-svn-id: svn://10.0.0.236/trunk@50947 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:50:09 +00:00
warren%netscape.com
6a7c1e6176 Added bloat log diffing program.
git-svn-id: svn://10.0.0.236/trunk@50946 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:42:27 +00:00
warren%netscape.com
bc35fd61d0 Accidently got added in the wrong directory.
git-svn-id: svn://10.0.0.236/trunk@50945 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:30:25 +00:00
rickg%netscape.com
d16fa469ea removed warnings; no material code affected
git-svn-id: svn://10.0.0.236/trunk@50944 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 07:01:10 +00:00
karnaze%netscape.com
c96e8acd42 new regression test. does not affect code.
git-svn-id: svn://10.0.0.236/trunk@50943 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 05:17:41 +00:00
karnaze%netscape.com
0ee3058ec4 new regression test
git-svn-id: svn://10.0.0.236/trunk@50942 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 03:42:37 +00:00
troy%netscape.com
c04a6a88dc r=karnaze@netscape.com Cc'd hyatt@netscape.com
Space optimization. mBorderEdges is no longer an embedded object. Now it's
allocated when needed (for collapsing border model tables only). This saves
80 bytes per table cell frame for the normal HTML case of adjacent border
model


git-svn-id: svn://10.0.0.236/trunk@50941 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 03:30:11 +00:00
karnaze%netscape.com
84d23e1d2e bug 11321 - Renamed kidMaxElementSize to localKidMaxElementSize and renamed pKidMaxElementSize to kidMaxElementSize and fixed the incorrect usage.
git-svn-id: svn://10.0.0.236/trunk@50940 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 03:17:53 +00:00
karnaze%netscape.com
906709b8b6 bug 11321 - the frame constructor sets the primary frame when an anonymous table or row group frame is involved.
git-svn-id: svn://10.0.0.236/trunk@50939 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 03:15:13 +00:00
rickg%netscape.com
1a6a40a3c6 Fix (perf) bug 13536 dealing with viewsource; r=kmcclusk.
Viewsource is now based on XML. These changes make viewsource 2X faster,
30% smaller (in obj code), and uses between 30-60% less markup overhead.
This update also enables stylesheet usage on viewsource, which is controlled
by the viewsource namespace  in html.css.

Also, note that viewsource remains (and always has been) fully incremental.
Remaining performance issues are in contentsink as shown in quantify runs.


git-svn-id: svn://10.0.0.236/trunk@50938 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 02:50:38 +00:00
rickg%netscape.com
7f8bd4a5fc improve debug timing code for ongoing perf work; not enabled in normal build. r=peterl
git-svn-id: svn://10.0.0.236/trunk@50937 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 02:45:26 +00:00
sgehani%netscape.com
9868a31060 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50936 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 01:39:40 +00:00
sgehani%netscape.com
0c1e14a45f File Removed.
git-svn-id: svn://10.0.0.236/trunk@50935 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 01:36:14 +00:00
warren%netscape.com
c81e025f6f Added bloat log diffing program.
git-svn-id: svn://10.0.0.236/trunk@50934 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-17 00:19:29 +00:00
morse%netscape.com
f4c14fbc7e remove build warning, r=jar
git-svn-id: svn://10.0.0.236/trunk@50933 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 23:37:28 +00:00
morse%netscape.com
2464d177c4 fix bug 15137, open->openDialog, r=jar
git-svn-id: svn://10.0.0.236/trunk@50932 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 23:36:22 +00:00
bienvenu%netscape.com
65fd934be9 fix memory leak of user name r=mscott
git-svn-id: svn://10.0.0.236/trunk@50931 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 22:44:55 +00:00
bienvenu%netscape.com
170bb762af fix leaks in mime xul emitters r=rhp
git-svn-id: svn://10.0.0.236/trunk@50930 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 20:49:06 +00:00
bienvenu%netscape.com
a6a7ff9957 fix memory leak in install notifier r=dougt
git-svn-id: svn://10.0.0.236/trunk@50929 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 20:48:36 +00:00
morse%netscape.com
051b2edf1a fix bug 10434, memory leak detection, r=sfraser
git-svn-id: svn://10.0.0.236/trunk@50928 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 19:34:10 +00:00
rickg%netscape.com
b03845b337 updated FAQ section of nsString documentation
git-svn-id: svn://10.0.0.236/trunk@50927 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 18:45:18 +00:00
rickg%netscape.com
3169a02cfa WIP bug13536; r=peterl; this code is not used yet
git-svn-id: svn://10.0.0.236/trunk@50926 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 18:22:24 +00:00
bienvenu%netscape.com
21e8b134dc fix build bustage
git-svn-id: svn://10.0.0.236/trunk@50925 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 18:16:21 +00:00
bienvenu%netscape.com
0ddfb1fd70 remove unused all threads table r=davidmc
git-svn-id: svn://10.0.0.236/trunk@50924 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 17:55:59 +00:00
troy%netscape.com
3e862c4fc9 Space optimization, r=karnaze@netscape.com Cc'd hyatt@netscape.com
Save 4 bytes by eliminating the mCalculated data member which wasn't being used


git-svn-id: svn://10.0.0.236/trunk@50923 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 16:17:07 +00:00
bienvenu%netscape.com
74fc660d77 fix memory leaks r=mscott
git-svn-id: svn://10.0.0.236/trunk@50922 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 15:43:26 +00:00
karnaze%netscape.com
60203265cd added 2 additional file lists to regression tests to work around new javascript bug.
git-svn-id: svn://10.0.0.236/trunk@50921 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 05:26:22 +00:00
peterl%netscape.com
be312e3eea Made style rules work against nsIMutableStyleContext
r=troy


git-svn-id: svn://10.0.0.236/trunk@50920 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 04:06:04 +00:00
peterl%netscape.com
f3c05f912b Added new style data accessors.
Added nsIMutableStyleContext interface.
Made style rules work against nsIMutableStyleContext
r=troy


git-svn-id: svn://10.0.0.236/trunk@50919 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 04:05:59 +00:00
neeti%netscape.com
a279c2f778 updating status
git-svn-id: svn://10.0.0.236/trunk@50918 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 03:07:59 +00:00
neeti%netscape.com
f3b4c01e52 Converted dll to use nsIModule - bug 14034, r=dp
git-svn-id: svn://10.0.0.236/trunk@50916 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 03:05:55 +00:00
neeti%netscape.com
a87ba00c59 Converted dll to use nsIModule -bug 14034, r=jband
git-svn-id: svn://10.0.0.236/trunk@50915 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 03:04:16 +00:00
rhp%netscape.com
5839f11126 Changes to display when a message is coming from a 5.0 client - Bug #7518 - r: mscott
git-svn-id: svn://10.0.0.236/trunk@50914 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 02:38:24 +00:00
selmer%netscape.com
347b70512d CheckListBox used
git-svn-id: svn://10.0.0.236/trunk@50913 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 02:01:01 +00:00
selmer%netscape.com
9a7f96144c CheckListBox incorporated
git-svn-id: svn://10.0.0.236/trunk@50912 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 02:00:18 +00:00
warren%netscape.com
5cf514e9ae Added total/summary information to bloat log. Made LogNewXPCOM/LogDeleteXPCOM only be needed for losing architectures.
git-svn-id: svn://10.0.0.236/trunk@50911 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:57:18 +00:00
jevering%netscape.com
70a261fb73 The nsLeakDetector.cpp file now requires a few extra header files which weren't being exported on win
git-svn-id: svn://10.0.0.236/trunk@50910 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:44:52 +00:00
jevering%netscape.com
f66066c2c8 Removed a define I shouldn't have checked in.
git-svn-id: svn://10.0.0.236/trunk@50909 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:41:14 +00:00
varada%netscape.com
6f328194ff fixes to bug#7717 on exiting the wizard you get a message stating that data has been saved
git-svn-id: svn://10.0.0.236/trunk@50908 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:40:06 +00:00
jevering%netscape.com
6660a0bc5b Hooking up the Boehm collector.
Can we please call this thing the Bone Collector?  That would be much cooler.
Thank you drive through.


git-svn-id: svn://10.0.0.236/trunk@50907 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 01:22:01 +00:00
troy%netscape.com
6722de88b9 Added some new code that's not in use yet
git-svn-id: svn://10.0.0.236/trunk@50906 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:55:48 +00:00
rickg%netscape.com
85a81f49a8 WIP for bug13536; r=plinss
git-svn-id: svn://10.0.0.236/trunk@50905 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:39:24 +00:00
varada%netscape.com
54ba582bb1 new struct in header file
git-svn-id: svn://10.0.0.236/trunk@50904 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:16:36 +00:00
beard%netscape.com
7bd68dd578 added code to initialize/shutdown the leak detector. bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50903 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:06:37 +00:00
beard%netscape.com
774e39f024 renamed NSInitGarbageCollector/NSShutdownGarbageCollector to NS_, and returning nsresult. Moved leak report file to nsLeakDetector.cpp. bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50902 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:06:36 +00:00
beard%netscape.com
371afc89ab added nsLeakDetector.cpp to build. bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50901 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:03:45 +00:00
beard%netscape.com
a743954b5c maded entire file conditionally compile #if defined(GC_LEAK_DETECTOR). bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50900 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-16 00:02:26 +00:00
jevering%netscape.com
f820994c06 More windows porting of the boehm collector.
git-svn-id: svn://10.0.0.236/trunk@50899 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:45:47 +00:00
bienvenu%netscape.com
7ce48293df fix memory leak of registry location r=warren
git-svn-id: svn://10.0.0.236/trunk@50898 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:45:45 +00:00
cyeh%netscape.com
942579f723 proxy checkin for terry@mozilla.org. quiet warnings about uninitialized
variables at runtime


git-svn-id: svn://10.0.0.236/trunk@50897 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:43:52 +00:00
nisheeth%netscape.com
c916cc6da1 Changes do not get built in regular build. Fix timing hooks in the parser.
git-svn-id: svn://10.0.0.236/trunk@50896 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:42:09 +00:00
kipp%netscape.com
66125fa907 r=troy; revised nsITextContent api to simplify it and the consumers; this is done as prep work for bug 9101
git-svn-id: svn://10.0.0.236/trunk@50895 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:36:07 +00:00
sdagley%netscape.com
8916be1144 Fix #15740 - now check for immediate errors from async i/o calls. Also ensure that io_pending flag for the thread is cleared if we complete the async call before calling WaitOnThisThread(). r=sfraser
git-svn-id: svn://10.0.0.236/trunk@50894 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:35:27 +00:00
kipp%netscape.com
a1aaea4959 r=troy; fixed bug 7093 by carefully pre-computed the collapsed top margin before reflowing the child block and then using that value to properly acquire the available space; In addition, I had to fix an incremental reflow bug associated with this problem
git-svn-id: svn://10.0.0.236/trunk@50893 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:35:10 +00:00
terry%mozilla.org
6f2641b237 Fixed what I believe is just a stupid typo. (This code really needs to have
"use strict" added to it all, and with all the resulting cleanup.)


git-svn-id: svn://10.0.0.236/trunk@50892 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:31:22 +00:00
kipp%netscape.com
17b485a261 Wiped out another warning
git-svn-id: svn://10.0.0.236/trunk@50891 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:29:21 +00:00
kipp%netscape.com
ae469e66fe new
git-svn-id: svn://10.0.0.236/trunk@50890 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:25:02 +00:00
peterl%netscape.com
e8a5d2e937 Added namespace ID to the AttributeChanged notification
Part of the fix for Bug 15153
r=troy


git-svn-id: svn://10.0.0.236/trunk@50889 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:17:53 +00:00
peterl%netscape.com
bba68903df Added namespace ID to the AttributeChanged notification
Part fo the fix for Bug 15153
r=troy


git-svn-id: svn://10.0.0.236/trunk@50888 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:16:45 +00:00
terry%mozilla.org
762178f097 Fixed a bunch of "undefined variable" warnings.
git-svn-id: svn://10.0.0.236/trunk@50887 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:16:32 +00:00
peterl%netscape.com
5e2e0d9a32 Changed reported namespace of attributes from HTML to None.
r=vidur
Also added namespace ID to the AttributeChanged method
Part of the fix for Bug 15153
r=troy


git-svn-id: svn://10.0.0.236/trunk@50886 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:15:17 +00:00
peterl%netscape.com
48baad18a6 Added code to detect generated content that depends on attributes and reflow when the attribute changes
Fix for Bug 15153
r=pierre
Also added namespace ID to the AttributeChanged method
r=troy


git-svn-id: svn://10.0.0.236/trunk@50885 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 23:14:44 +00:00
varada%netscape.com
d237a54c3d fixes to bug #5987 changed the values of the buttons in the ini files
git-svn-id: svn://10.0.0.236/trunk@50884 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:56:37 +00:00
varada%netscape.com
15123c9a18 fixing bug #5987 - introduced three new fields in VARS in the ini files - cancel back and next - use those to change the text on the buttons
git-svn-id: svn://10.0.0.236/trunk@50883 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:55:06 +00:00
troy%netscape.com
52071cf0b1 Added some new code that isn't being used
git-svn-id: svn://10.0.0.236/trunk@50882 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:53:24 +00:00
gagan%netscape.com
7c5bb7d019 Added "resolving host" status notification for eSocketState_Created. No bug number. r=law.
git-svn-id: svn://10.0.0.236/trunk@50881 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:47:24 +00:00
jefft%netscape.com
f34b34e8a2 back out unneed changes which cause downloading messages to hang; bug 16338, r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@50880 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:26:32 +00:00
sfraser%netscape.com
a529a81529 Added nsJSXULEditorElement and nsXULEditorElement for travis. r=travis.
git-svn-id: svn://10.0.0.236/trunk@50879 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:21:43 +00:00
waqar%netscape.com
2e88f3fb20 #9777
r vidur@netscape.com
d The issue was resolved by DOM commitie to allow SplitText to give an error
only on if the start of split is larger than the length. If it is same lenght
it is allowed.


git-svn-id: svn://10.0.0.236/trunk@50878 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:18:23 +00:00
beard%netscape.com
b457512e99 added nsLeakDetector.idl. bug=15906, r=alecf
git-svn-id: svn://10.0.0.236/trunk@50877 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:17:53 +00:00
cmanske%netscape.com
d3b17dbcb9 Fixed bugs 16316, 16494, 16495, all relating to editor file open, saving, and window title issues. r=law
git-svn-id: svn://10.0.0.236/trunk@50876 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 22:06:41 +00:00
tbogard%aol.net
a7ed2ac01b Changed TextEditorAppShell.xul to use the new XUL editor tag instead of html:iframe. Changed EditorStartup to take an element. Changed EditorStartup to request the EditorShell from the editorElement rather than doing a createInstance and QI. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50875 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:58:49 +00:00
jevering%netscape.com
19f7cec6df Windows makefile for boehm collector.
git-svn-id: svn://10.0.0.236/trunk@50874 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:57:31 +00:00
jevering%netscape.com
7a40245954 Forget continuation line - boehm collector work.
git-svn-id: svn://10.0.0.236/trunk@50873 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:56:51 +00:00
tbogard%aol.net
2aa2164659 Changed html:iframe to the new XUL editor tag. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50872 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:54:42 +00:00
norris%netscape.com
0ad2206225 Fix 16166 setTimeout() security problem
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@50871 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:52:37 +00:00
cls%seawood.org
84b2db2829 Files not used by build. Attempting to resolve cvs checkin problem. a=srinivas,leaf
git-svn-id: svn://10.0.0.236/trunk@50870 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:42:20 +00:00
Jerry.Kirk%Nexwarecorp.com
777d2a990a Fix for viewer bustage on Neutrino. Added call to nsIThread::SetMainThread
in main() of viewer so that it can retrieved in other cases. R=vidur


git-svn-id: svn://10.0.0.236/trunk@50869 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:39:30 +00:00
fur%netscape.com
1242a2627f Renamed variable to avoid a compiler warning. R: mccabe
git-svn-id: svn://10.0.0.236/trunk@50868 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:38:04 +00:00
shaver%netscape.com
a8a9b25086 Make View->Sidebar a type=checkbox menuitem (r=slamm)
git-svn-id: svn://10.0.0.236/trunk@50867 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:37:53 +00:00
cls%seawood.org
b8f8ee7596 Files not used by build. Attempting to resolve cvs checkin problem. a=srinivas,leaf
git-svn-id: svn://10.0.0.236/trunk@50866 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:36:53 +00:00
beard%netscape.com
c69becfcc9 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50865 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:36:04 +00:00
bienvenu%netscape.com
cb256a41dc fix shutdown leak by resetting host session list r=jefft
git-svn-id: svn://10.0.0.236/trunk@50864 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:35:55 +00:00
beard%netscape.com
ef31ca76db using dumpMemoryLeaks() instead of about:bloat?leaks. bug=15906, r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50863 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:35:18 +00:00
beard%netscape.com
202835974e added dumpMemoryLeaks(). bug=15906, r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50862 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:35:11 +00:00
akhil.arora%sun.com
e3af9ebeab 13260 r=akhil.arora@sun.com Fixed by Denis Sharypov <sdv@sparc.spb.su>
Added checks for integer arguments being outside of legal range and
  throw exceptions if not.


git-svn-id: svn://10.0.0.236/trunk@50861 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:25:56 +00:00
cmanske%netscape.com
b3ffd2ef95 Fixed bug 15442 - use about:blank for empty doc URL for editor. r=law
git-svn-id: svn://10.0.0.236/trunk@50860 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:24:45 +00:00
mccabe%netscape.com
dc9018f2ee Fix line editing support for the standalone XPCOM-enabled JavaScript shell. To aid debugging on unix platforms.
To use, define JS_READLINE when compiling mozilla/js/src/xpconnect/shell.

r=shaver


git-svn-id: svn://10.0.0.236/trunk@50859 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:23:53 +00:00
tbogard%aol.net
bb54504747 Adding support for retrieving the EditorShell from editor element. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50858 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:21:10 +00:00
brade%netscape.com
cb5f04d59d use the proper function calls to get the status for alt, shift and meta keys. bug #16486. reviewed valeski@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50857 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:20:57 +00:00
kipp%netscape.com
6b0a23c77d Nuke some more warnings
git-svn-id: svn://10.0.0.236/trunk@50855 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:18:32 +00:00
scc%netscape.com
38a4215c26 Bug #15292, r=dp. Made the component manager inherit from |nsSupportsWeakReference|, fixed its |QueryInterface()| appropriately, and added casts in two places that became ambiguous now that the component manager had multiple |nsISupports| in it. Now one can hold a weak reference to the component manager using |nsIWeakReference|.
git-svn-id: svn://10.0.0.236/trunk@50853 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:14:43 +00:00
law%netscape.com
d169b3d37b Fix for bugs #16525 and #16527, Remove menu separator when not link or frame, add back in missing items; r=matt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50850 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:13:31 +00:00
shaver%netscape.com
130160f659 Add support for type="checkbox" in <menuitem>.
Converted small pile of PRBool to PRPackedBool for space savings.
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@50849 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:13:24 +00:00
law%netscape.com
fbce7337a4 Fix for bug #16269, add resizable feature to view-source window, r=danm@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50848 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:11:22 +00:00
Jerry.Kirk%Nexwarecorp.com
bee1ad520f Handles KeyEvents the new way, not completely finished...
Bug # 16539 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@50847 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:10:36 +00:00
vidur%netscape.com
6fb05929c2 Fix for viewer bustage on Windows. Added call to nsIThread::SetMainThread in main() of viewer so that it can retrieved in other cases. R=kipp
git-svn-id: svn://10.0.0.236/trunk@50846 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:09:46 +00:00
tbogard%aol.net
a469976da4 Adding support for retrieving the EditorShell from editor element. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50845 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:07:27 +00:00
jefft%netscape.com
ce92446784 remove the size limit for downloading Pop3 message; bug 16338; r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@50844 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 21:02:27 +00:00
waterson%netscape.com
d6562a99e8 Darnit. Didn't mean to FORCE_PR_LOG. Removing that #define.
git-svn-id: svn://10.0.0.236/trunk@50843 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:55:54 +00:00
tbogard%aol.net
a4dcc5f6fe First Check-in.
git-svn-id: svn://10.0.0.236/trunk@50842 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:51:58 +00:00
shaver%netscape.com
82e40a8366 Fix case and return value in nsIModule.idl.
Add deleteCategoryEntry and deleteCategory to nsICategoryManager.
Update nsCategoryManager.js to use new nsIModule case, and talk to the registry.
r=brendan


git-svn-id: svn://10.0.0.236/trunk@50841 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:51:38 +00:00
ssu%netscape.com
2c8714f0fe fixes bugs #15884 and #16220. r=dbragg. fixes Install.FileExecute for the
1 parameter format and also the function gets logged correctly in
install.log.


git-svn-id: svn://10.0.0.236/trunk@50840 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:50:49 +00:00
waterson%netscape.com
55b0508a7b Bug 9764. Fix HTML templates to ensure that attribute adding is namespace-agnostic. Add local variable for isUnique so that BuildContentFromTemplate will work if resource- and non-resource elements are siblings in a template. Add logging capability for debug. r=rjc.
git-svn-id: svn://10.0.0.236/trunk@50839 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:47:19 +00:00
ssu%netscape.com
8be86d2e54 fixes bug #6408 and #15393. r=dbragg. fixes windows installer xpinstall
error detection.  Windows platform only"


git-svn-id: svn://10.0.0.236/trunk@50838 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:47:15 +00:00
despotdaemon%netscape.com
3ff30eed90 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@50837 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 20:06:46 +00:00
kipp%netscape.com
54422e686a Eliminate need for networked loaded images
git-svn-id: svn://10.0.0.236/trunk@50836 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 19:44:09 +00:00
slamm%netscape.com
5203f99e62 Need to quote parentheses in ignore pattern.
git-svn-id: svn://10.0.0.236/trunk@50835 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 18:42:27 +00:00
despotdaemon%netscape.com
4e198d349e Pseudo-automatic update of changes made by jst@citec.fi.
git-svn-id: svn://10.0.0.236/trunk@50834 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 17:14:41 +00:00
kipp%netscape.com
93d0d8d38f nuked
git-svn-id: svn://10.0.0.236/trunk@50833 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 16:58:21 +00:00
bienvenu%netscape.com
bc725fb9b5 fix crash reading messages with new profiles
git-svn-id: svn://10.0.0.236/trunk@50831 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 16:09:49 +00:00
beard%netscape.com
4afa5bff04 improved report format, included root list
git-svn-id: svn://10.0.0.236/trunk@50830 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 15:56:05 +00:00
brade%netscape.com
6f185f7761 fixes to handle for control keys (off by 1) (bug #15693) r=kin@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50829 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 14:56:33 +00:00
brade%netscape.com
a7ee842442 don't allow other modifiers when cut/copy/pasting (bug #15693); this missed the keyEvent branch. r=kin@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50828 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 14:52:45 +00:00
kipp%netscape.com
a41c4bbacd Removed old netlib code; changed url loading when crawling to use the event queue to fix some re-entrancy issues somewhat
git-svn-id: svn://10.0.0.236/trunk@50827 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 14:09:19 +00:00
kipp%netscape.com
f3b0bfeedb Added sorting to the debug dump data for show-frame-size and show-content-size
git-svn-id: svn://10.0.0.236/trunk@50826 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 14:08:14 +00:00
buster%netscape.com
34185693a8 bug 12221 [Dogfood] Gfx text controls need to notify on mouse events
r=rods@netscape.com
also did some associated performance work, factoring code and collapsing multiple listener
objects down to 1.  This saves a few allocations and about 60 bytes per text control.

bug 11803 Need new event for text value changing
r=hyatt@netscape.com
not dogfood approved, but the fix has been sitting in my tree for 2 weeks


git-svn-id: svn://10.0.0.236/trunk@50825 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:38:29 +00:00
buster%netscape.com
4225108b72 bug 11803 Need new event for text value changing
r=hyatt@netscape.com
not dogfood approved, but the fix has been sitting in my tree for 2 weeks


git-svn-id: svn://10.0.0.236/trunk@50824 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:37:06 +00:00
buster%netscape.com
dc3e971a7e bug 11803 Need new event for text value changing
r=hyatt@netscape.com
not dogfood, but the fix has been sitting in my tree for 2 weeks


git-svn-id: svn://10.0.0.236/trunk@50823 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:36:23 +00:00
buster%netscape.com
ab0550c29d no bug number, part of webshell cleanup. nsIWebShell.h was needlessly included, so I removed it
trivial change, no reviewer.


git-svn-id: svn://10.0.0.236/trunk@50822 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:34:45 +00:00
rods%netscape.com
a38b9c0061 Fixed focus processing, this new code is very close to version 1.54 but more robust,
this fixes bug #7133. It has been compiled and tested on Win, Mac, and Linux.
r=buster,dcone


git-svn-id: svn://10.0.0.236/trunk@50821 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 13:20:32 +00:00
despotdaemon%netscape.com
b4b7016433 Pseudo-automatic update of changes made by tomk@mitre.org.
git-svn-id: svn://10.0.0.236/trunk@50820 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 11:54:29 +00:00
hyatt%netscape.com
6c5c58d1e8 Fix for 16479. r=waterson
git-svn-id: svn://10.0.0.236/trunk@50819 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:54:43 +00:00
tbogard%aol.net
f56f56047f Fixed a couple of typos.
git-svn-id: svn://10.0.0.236/trunk@50818 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:52:50 +00:00
varada%netscape.com
818b65a0d4 inform function has been changed to take in two parameters to show the filename as well as the directory with absolute path
git-svn-id: svn://10.0.0.236/trunk@50817 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:45:20 +00:00
varada%netscape.com
23669a0409 changes from relative path to absolute path in interpret.cpp and validation of empty entry in ncidialog
git-svn-id: svn://10.0.0.236/trunk@50816 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:43:57 +00:00
jevering%netscape.com
e8deb39b49 Adding boehm collector to windows.
(not part of the build yet)


git-svn-id: svn://10.0.0.236/trunk@50815 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:41:54 +00:00
jevering%netscape.com
8c8649671d Adding boehm collector linkages to the windows build.
(not part of the build yet)


git-svn-id: svn://10.0.0.236/trunk@50813 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:40:13 +00:00
tbogard%aol.net
8fef749953 Changed the nativeWindowParent's to be a nativeWindow instead of a long. nativeWindow is a typedef'd voidStar.
git-svn-id: svn://10.0.0.236/trunk@50807 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:31:28 +00:00
tbogard%aol.net
9565067a46 First landing.
git-svn-id: svn://10.0.0.236/trunk@50805 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:23:53 +00:00
dp%netscape.com
8b5b037caf bug# 5085 Eliminating some checks at autoreg time to improve startup
performance. r=sfraser


git-svn-id: svn://10.0.0.236/trunk@50803 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:12:08 +00:00
waterson%netscape.com
9f70f9cb52 Add xpcnativecallcontext.cpp for jband.
git-svn-id: svn://10.0.0.236/trunk@50802 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 07:08:15 +00:00
varada%netscape.com
1882311d32 removing relative paths and evaluating absolute ones
git-svn-id: svn://10.0.0.236/trunk@50801 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 06:51:03 +00:00
dveditz%netscape.com
20b7b8aa72 expose libreg ability to delete named values in nsIRegistry. Patch from
Jonas Utterström <jonas.utterstrom@vittran.norrnod.se>, r=dveditz


git-svn-id: svn://10.0.0.236/trunk@50800 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 06:47:58 +00:00
rjc%netscape.com
9621ab20bf Fix leak in nsXULSortService (found by Boehm GC). Also, remove CTOR_COUNT stuff. Review: waterson@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50798 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 06:27:02 +00:00
brendan%mozilla.org
f2330eb459 1. Fixed missing JS_LOCK_GC in JS_YieldRequest, commented other badness there.
2.  Cleaned up ugly JS_GC_Flag typedef name and put XXXbe comment in there for
    next time: someone seems to have patched around a deadlock that has since
    bit chouck@geocast.com.
3.  Fixed gcDisabled by moving it from cx to rt and updating it atomically.
4.  Fixed ECMA violation where for (var i, j in o) ... was permitted; only one
    variable is allowed.
(Item 4 was a bug on rogerl's list, since closed?  r=shaver@mozilla.org.)


git-svn-id: svn://10.0.0.236/trunk@50795 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 05:46:42 +00:00
sspitzer%netscape.com
37928e864b fix possible solaris bustage by including the nsIFoo.h files when we have nsCOMPtr<nsIFoo> foo;
git-svn-id: svn://10.0.0.236/trunk@50794 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 05:10:28 +00:00
jband%netscape.com
32f352bb68 adding new empty placeholder file to the build. Will also add it to Mac project via camelot and put real stuff in it after all is stable. r=jband :)
git-svn-id: svn://10.0.0.236/trunk@50793 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 05:09:08 +00:00
sspitzer%netscape.com
b3c21470de more fixes to get copies and sent folder prefs to work right.
now, mailbox:// urls work.
change the logic of LocateMessageFolder() to be:

if (the target folder is not "anyfolder://") then {
	find the folder and return it if your find it.
	if you can't find it, create it in the datasource and return the folder.  see bug #14591
}
else {
	look for the default folder in any server associated with the current identity.
	if you find it, return it.
}


git-svn-id: svn://10.0.0.236/trunk@50790 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 05:03:03 +00:00
waterson%netscape.com
daa650308d Unclutter stuff by using nsCOMPtr in the nsElementMap::ContentListItem. Add leakenmacros to ContentListItem. Fix a leak in the the internal enumerator routine. Comment the internal enumerator routine since it's kinda funky. Add 'tag name' to the log messages.
git-svn-id: svn://10.0.0.236/trunk@50789 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:45:43 +00:00
sspitzer%netscape.com
f6806b13d3 remove unused variablable to fix a couple warnings.
git-svn-id: svn://10.0.0.236/trunk@50788 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:33:21 +00:00
shaver%netscape.com
103a22ed8e fix obj_getCount to property destroy state and propagate error (r=jband)
git-svn-id: svn://10.0.0.236/trunk@50787 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:32:46 +00:00
kin%netscape.com
9af25b17a4 Fix for bug #15360: Drag Selecting, Clicking, then Clicking leaves caret cruft.
r=troy@netscape.com,kipp@netscape.com,evaughan@netscape.com,beard@netscape.com

layout/html/base/src/nsGfxScrollFrame.cpp
    - Renamed all occurrences of ScrollPositionChanged() to
      to ScrollPositionDidChange() to match changes made
      to nsIScrollPositionListener.
    - Added ScrollPositionWillChange() stub method.

layout/html/base/src/nsPresShell.cpp
    - Added PresShellViewEventListener class that implements the
      nsIScrollPositionListener and nsICompositeListener view
      interfaces. This allows us to turn caret rendering on and off
      when scrolling and repainting to prevent leaving caret cruft
      on the screen.
    - PresShellViewEventListener is created in InitialReflow(), and
      released in ~PresShell().

view/public/Makefile.in
view/public/makefile.win
view/public/MANIFEST
    - Added nsICompositeListener to list of files to be exported.

view/public/nsICompositeListener.h
    - New file. Implementers of this interface can register themselves
      with the view manager to receive notification before and after
      a view is composited/refreshed.

view/public/nsIScrollPositionListener.h
    - Added a ScrollPositionWillChange() method.
    - Changed ScrollPositionChanged() to ScrollPositionDidChange().

view/public/nsIViewManager.h
    - Added AddCompositeListener() and RemoveCompositeListener methods.

view/src/nsScrollingView.cpp
view/src/nsScrollingView.h
    - Added NotifyScrollPositionWillChange() and
      NotifyScrollPositionDidChange() methods.
    - Modified HandleScrollEvent() to call NotifyScrollPositionWill/DidChange()
      methods. Added temporary offsetX and offsetY variables to allow us
      to calculate new offsets without changing mOffsetX and mOffsetY before
      notifications are sent out.

view/src/nsScrollPortView.cpp
    - Changed ScrollPositionChanged() to ScrollPositionDidChange().
    - Modified ScrollTo() to call the listener's ScrollPositionWillChange()
      method.

view/src/nsViewManager.cpp
view/src/nsViewManager.h
    - Added AddCompositeListener() and RemoveCompositeListener() methods.
    - Added support for CompositeListener notifications in the Refresh()
      methods for regions and rects.
    - Fix for bug #15901: [DOGFOOD] Selected text does not clear when you type
      Modified UpdateView() so that rects with zero width and height are
      no longer added to our damage region.
      r=beard@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50786 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:29:30 +00:00
karnaze%netscape.com
dcf8e1f205 new regression test.
git-svn-id: svn://10.0.0.236/trunk@50785 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:29:09 +00:00
waterson%netscape.com
033d3bbd40 Fix compiler warning; r=rjc.
git-svn-id: svn://10.0.0.236/trunk@50784 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:26:46 +00:00
neeti%netscape.com
34b93b8117 updating status
git-svn-id: svn://10.0.0.236/trunk@50783 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:20:40 +00:00
karnaze%netscape.com
ef61c5a72c pass2 reflow doesn't request max element sizes to help with bug 14855. Reviewers didn't respond.
git-svn-id: svn://10.0.0.236/trunk@50782 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:09:22 +00:00
brendan%mozilla.org
7c13a9f3b1 Rename ToSource to uneval (r=shaver@mozilla.org,terry@geocast.com).
git-svn-id: svn://10.0.0.236/trunk@50781 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:07:59 +00:00
neeti%netscape.com
898eb50d34 Converted to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=sspitzer
git-svn-id: svn://10.0.0.236/trunk@50780 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:06:43 +00:00
neeti%netscape.com
6b6c7716c8 Converted to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=alecf
git-svn-id: svn://10.0.0.236/trunk@50779 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:06:14 +00:00
neeti%netscape.com
351b6ca2c6 Converted to use nsIModule to prepare for memory leaks fixing. Bug# 14034. r=waterson
git-svn-id: svn://10.0.0.236/trunk@50778 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 04:05:22 +00:00
beard%netscape.com
08cd03a169 fixed 2 string memory leaks (bug #15380). r=saari
git-svn-id: svn://10.0.0.236/trunk@50777 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:57:45 +00:00
radha%netscape.com
d7784c7d67 Send out OnStartDocumentLoad(0 notifications for visits to
anchors in a page. bug # 11631 15441. r=law. Got clearance from travis too


git-svn-id: svn://10.0.0.236/trunk@50776 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:50:47 +00:00
bienvenu%netscape.com
78b763db4d more of addrbook memory leak fixes r=mscott
git-svn-id: svn://10.0.0.236/trunk@50774 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:50:21 +00:00
radha%netscape.com
d6dbd3db1f fixing session history for frames. I accidently broke the behavior in
my monday's checkin. No bug #. r=law


git-svn-id: svn://10.0.0.236/trunk@50773 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:49:29 +00:00
troy%netscape.com
be2abd7a2c Patch from jst@citec.fi r=troy@netscape.com
Part of a fix for crash when expanding/collapsing toolbars. Change to
DeletingFrameSubtree() to make sure it examines the additional child
list as well as the principal child list


git-svn-id: svn://10.0.0.236/trunk@50772 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:37:10 +00:00
waterson%netscape.com
1464bedb39 Bug 16402. Make sure that literals addref (and release) the RDF service. Make sure to deal with edge Unregister[Resource|Literal] conditions; e.g., being called to unregister a literal when none was ever registered. r=rjc
git-svn-id: svn://10.0.0.236/trunk@50771 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:36:04 +00:00
jband%netscape.com
df5ae28aef r=shaver
- Fixed two similar cases where code was missing one level of
pointer dereference in terminating a copied string. Was trashing
data further up the stack.
- Use 'nsAllocator::Free' in two similar cases where 'delete' was
mistakenly used. Error pointed out by Purify.


git-svn-id: svn://10.0.0.236/trunk@50770 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:31:09 +00:00
rhp%netscape.com
2caa1592a8 Fix for email names with embedded &'s - Bug #16383 r=jefft
git-svn-id: svn://10.0.0.236/trunk@50769 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:27:33 +00:00
troy%netscape.com
8ec1b4ee83 Space savings. r=kipp@netscape.com
Re-implemented DST code to use separate objects for leaf nodes and
internal nodes. This reduces the per node size from 16 bytes to (on
average) 13 bytes per node


git-svn-id: svn://10.0.0.236/trunk@50768 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:18:28 +00:00
troy%netscape.com
9c1337b86f Space savings. r=karnaze@netscape.com Cc'd hyatt@netscape.com
Eliminated member data mIsContentEmpty and now we use a frame state bit
instead. This saves 4 bytes of space per table cell frame


git-svn-id: svn://10.0.0.236/trunk@50767 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:14:59 +00:00
shaver%netscape.com
9a4de938e7 make xpcshell use jsrtsvc, and let jsrtsvc handle JS_Shutdown (r=jband)
git-svn-id: svn://10.0.0.236/trunk@50766 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 03:05:48 +00:00
bienvenu%netscape.com
0eddf3358e fix memory leak of nsIURI in Set and GetAttribute r=waterson
git-svn-id: svn://10.0.0.236/trunk@50765 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:59:37 +00:00
srinivas%netscape.com
cc0b044bfe Autoconf for NSPR. Checkin for cls@seawood.org. Bugzilla #11893.
git-svn-id: svn://10.0.0.236/trunk@50764 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:42:36 +00:00
srinivas%netscape.com
6f136bc3f5 Autoconf for NSPR. Checkin for cls@seawood.org. Bugzilla #11893.
git-svn-id: svn://10.0.0.236/trunk@50763 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:36:40 +00:00
peterl%netscape.com
06471a021a moved toggle and tri-state from user-modify to user-select to stay in sync with CSS3
no bug #
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50762 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:11:09 +00:00
cls%seawood.org
e381009988 Fix for bug #13412. r=shaver
If configured using --with-extensions or --with-extension=all, enable all of the non-default extensions rather than extension "yes" or "all".


git-svn-id: svn://10.0.0.236/trunk@50761 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 02:04:09 +00:00
akhil.arora%sun.com
047329ce0a 16426 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
The class java.lang.RuntimeException was not being pinned


git-svn-id: svn://10.0.0.236/trunk@50760 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:47:04 +00:00
akhil.arora%sun.com
4e04c99aad 16427 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
Check before dereferencing a NULL pointer.


git-svn-id: svn://10.0.0.236/trunk@50759 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:43:24 +00:00
varada%netscape.com
b2e2e2a6bc change from relative to absolute path
git-svn-id: svn://10.0.0.236/trunk@50758 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:39:32 +00:00
sspitzer%netscape.com
0d6acc8491 fix for #14892, automatically migrate if we only have one 4.x profile and no 5.0 profiles.
r=mscott.


git-svn-id: svn://10.0.0.236/trunk@50757 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:38:54 +00:00
akhil.arora%sun.com
0e030fdb50 16424 r=akhil.arora@sun.com fixed by Denis Sharypov <sdv@sparc.spb.su>
Fix two problems that kept the code from compiling on Win32


git-svn-id: svn://10.0.0.236/trunk@50756 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:38:42 +00:00
varada%netscape.com
cbaf31ef98 getting rid of relative paths in wizardmachine.cpp and wizardui.cpp for generate lists
git-svn-id: svn://10.0.0.236/trunk@50755 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:38:25 +00:00
varada%netscape.com
0e04699ad6 getting rid of relative paths in accountsetup and checklist inifiles
git-svn-id: svn://10.0.0.236/trunk@50754 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 01:19:25 +00:00
despotdaemon%netscape.com
6e4309cd35 Pseudo-automatic update of changes made by endico@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@50753 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:57:31 +00:00
wtc%netscape.com
ef278f909e Bugsplat bug #358401: created a separate .rc file for each DLL. The
product name is "Netscape Portable Runtime" and the file descriptions
are "NSPR Library", "PLDS Library", "PLC Library", and "PRSTRMS Library".
A debug build is indicated in the file description.  The copyright years
changed to 1996-1999.
Modified files: rules.mk, lib/ds/Makefile, lib/ds/Makefile.in,
lib/libc/src/Makefile, lib/libc/src/Makefile.in,
lib/prstreams/Makefile, lib/prstreams/Makefile.in,
prinit.h, nspr.rc
Added files: plds.rc, plc.rc, prstrms.rc
Removed file: resource.h


git-svn-id: svn://10.0.0.236/trunk@50752 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:51:41 +00:00
mcafee%netscape.com
981a0b415a Add #status option so you don't have to scroll down to the tree status.
git-svn-id: svn://10.0.0.236/trunk@50751 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:50:58 +00:00
sspitzer%netscape.com
13ef2ec53a more fixes to the 4.x uri -> 5.0 uri (copies and folders) code, for windows and mac.
#14951.  r=mscott


git-svn-id: svn://10.0.0.236/trunk@50750 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:50:34 +00:00
rpotts%netscape.com
fa27c68f3e bug #16328. Share a single nsToolkit instance among all widgets.
git-svn-id: svn://10.0.0.236/trunk@50749 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:49:11 +00:00
fur%netscape.com
69272dcfcd Initial version of net data cache APIs
git-svn-id: svn://10.0.0.236/trunk@50748 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:46:41 +00:00
kipp%netscape.com
f23d12f0ae Removed two more warnings
git-svn-id: svn://10.0.0.236/trunk@50747 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:29:28 +00:00
leaf%mozilla.org
1388fcf255 adding lib/mac/embedding for pierre -leaf
git-svn-id: svn://10.0.0.236/trunk@50746 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:19:06 +00:00
cathleen%netscape.com
1ba2750fb6 adds jsurl.xpt and html.css to windows packager list
git-svn-id: svn://10.0.0.236/trunk@50745 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:14:44 +00:00
wtc%netscape.com
974a9a3d5c Backed out the Windows resource file stuff checked in in the autoconf
branch merge.  It has two problems: 1. RESOBJ is not being used.  It
has the same meaning as the existing variable RES.  2. $(RES) is added
to OBJS twice on Win32.


git-svn-id: svn://10.0.0.236/trunk@50744 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:14:09 +00:00
nhotta%netscape.com
0cbcded17a Hooking up nsISaveAsCharset to the build, part of bug fix 8865, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@50743 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:13:00 +00:00
bienvenu%netscape.com
f9c5bba278 fix memory leaks opening and closing dbs r=mscott
git-svn-id: svn://10.0.0.236/trunk@50742 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:11:58 +00:00
nhotta%netscape.com
dbcdcc135b Changed to get a charset name from a locale instead of hard code, also fixed a memory leak, bug=10816, r=tague
git-svn-id: svn://10.0.0.236/trunk@50741 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:11:38 +00:00
nhotta%netscape.com
54747068e8 Additional fallback for not charset labeled input, bug=15766, r=rhp
git-svn-id: svn://10.0.0.236/trunk@50740 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:08:42 +00:00
nhotta%netscape.com
58752631d9 Hooking up nsISaveAsCharset to the build, part of bug fix 8865, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@50739 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:05:23 +00:00
bienvenu%netscape.com
284cea9db5 fix mork linked list which was disabling more than one table change from getting recorded r=davidmc
git-svn-id: svn://10.0.0.236/trunk@50738 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-15 00:05:10 +00:00
shaver%netscape.com
62dca335b0 Fix for 15480 (menu reflow from content change).
Use <titledbutton>, not <div>, for accelerator text to fix alignment
and improve performance _ever_ so slightly.
Initial support for checked menus (needs more magic).
(r=hyatt)


git-svn-id: svn://10.0.0.236/trunk@50737 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:59:18 +00:00
wtc%netscape.com
ad9bb8908b Removed the rule for $(PURE_LIBRARY), which was accidentally
resurrected in the autoconf checkin.


git-svn-id: svn://10.0.0.236/trunk@50736 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:55:27 +00:00
146 changed files with 105 additions and 54442 deletions

View File

@@ -1,617 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsAVLTree.h"
enum eLean {eLeft,eNeutral,eRight};
struct NS_COM nsAVLNode {
public:
nsAVLNode(void* aValue) {
mLeft=0;
mRight=0;
mSkew=eNeutral;
mValue=aValue;
}
nsAVLNode* mLeft;
nsAVLNode* mRight;
eLean mSkew;
void* mValue;
};
/************************************************************
Now begin the tree class. Don't forget that the comparison
between nodes must occur via the comparitor function,
otherwise all you're testing is pointer addresses.
************************************************************/
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
nsAVLTree::nsAVLTree(nsAVLNodeComparitor& aComparitor,
nsAVLNodeFunctor* aDeallocator) :
mComparitor(aComparitor), mDeallocator(aDeallocator) {
mRoot=0;
mCount=0;
}
static void
avlDeleteTree(nsAVLNode* aNode){
if (aNode) {
avlDeleteTree(aNode->mLeft);
avlDeleteTree(aNode->mRight);
delete aNode;
}
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
nsAVLTree::~nsAVLTree(){
if (mDeallocator) {
ForEachDepthFirst(*mDeallocator);
}
avlDeleteTree(mRoot);
}
class CDoesntExist: public nsAVLNodeFunctor {
public:
CDoesntExist(const nsAVLTree& anotherTree) : mOtherTree(anotherTree) {
}
virtual void* operator()(void* anItem) {
void* result=mOtherTree.FindItem(anItem);
if(result)
return nsnull;
return anItem;
}
protected:
const nsAVLTree& mOtherTree;
};
/**
* This method compares two trees (members by identity).
* @update gess12/27/98
* @param tree to compare against
* @return true if they are identical (contain same stuff).
*/
PRBool nsAVLTree::operator==(const nsAVLTree& aCopy) const{
CDoesntExist functor(aCopy);
void* theItem=FirstThat(functor);
PRBool result=PRBool(!theItem);
return result;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateRight(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mRight;
if(ptr2->mSkew==eRight) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mLeft;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(ptr3->mSkew==eLeft)
ptr2->mSkew=eRight;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eRight)
aRootNode->mSkew=eLeft;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateLeft(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mLeft;
if(ptr2->mSkew==eLeft) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mRight;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(ptr3->mSkew==eRight)
ptr2->mSkew=eLeft;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eLeft)
aRootNode->mSkew=eRight;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlInsert(nsAVLNode*& aRootNode, nsAVLNode* aNewNode,
nsAVLNodeComparitor& aComparitor) {
eAVLStatus result=eAVL_unknown;
if(!aRootNode) {
aRootNode = aNewNode;
return eAVL_ok;
}
if(aNewNode==aRootNode->mValue) {
return eAVL_duplicate;
}
PRInt32 theCompareResult=aComparitor(aRootNode->mValue,aNewNode->mValue);
if(0 < theCompareResult) { //if(anItem<aRootNode->mValue)
result=avlInsert(aRootNode->mLeft,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
avlRotateLeft(aRootNode);
result=eAVL_fail;
break;
case eRight:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
break;
} //switch
}//if
} //if
else {
result=avlInsert(aRootNode->mRight,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eRight:
avlRotateRight(aRootNode);
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eRight;
break;
} //switch
}
} //if
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceLeft(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
ptr2=aRootNode->mLeft;
balnc2=ptr2->mSkew;
if(balnc2!=eRight) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eLeft;
ptr2->mSkew=eRight;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mRight;
balnc3=ptr3->mSkew;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(balnc3==eRight) {
ptr2->mSkew=eLeft;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eLeft) {
aRootNode->mSkew=eRight;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eRight:
aRootNode->mSkew=eNeutral;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceRight(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
break;
case eRight:
ptr2=aRootNode->mRight;
balnc2=ptr2->mSkew;
if(balnc2!=eLeft) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eRight;
ptr2->mSkew=eLeft;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mLeft;
balnc3=ptr3->mSkew;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(balnc3==eLeft) {
ptr2->mSkew=eRight;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eRight) {
aRootNode->mSkew=eLeft;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eNeutral:
aRootNode->mSkew=eRight;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemoveChildren(nsAVLNode*& aRootNode,nsAVLNode*& anotherNode, PRBool& delOk){
eAVLStatus result=eAVL_ok;
if(!anotherNode->mRight){
aRootNode->mValue=anotherNode->mValue; //swap
anotherNode=anotherNode->mLeft;
delOk=PR_TRUE;
}
else{
avlRemoveChildren(aRootNode,anotherNode->mRight,delOk);
if(delOk)
avlBalanceLeft(anotherNode,delOk);
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemove(nsAVLNode*& aRootNode, void* anItem, PRBool& delOk,
nsAVLNodeComparitor& aComparitor){
eAVLStatus result=eAVL_ok;
if(!aRootNode)
delOk=PR_FALSE;
else {
PRInt32 cmp=aComparitor(anItem,aRootNode->mValue);
if(cmp<0){
avlRemove(aRootNode->mLeft,anItem,delOk,aComparitor);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
else if(cmp>0){
avlRemove(aRootNode->mRight,anItem,delOk,aComparitor);
if(delOk)
avlBalanceLeft(aRootNode,delOk);
}
else{ //they match...
nsAVLNode* temp=aRootNode;
if(!aRootNode->mRight) {
aRootNode=aRootNode->mLeft;
delOk=PR_TRUE;
delete temp;
}
else if(!aRootNode->mLeft) {
aRootNode=aRootNode->mRight;
delOk=PR_TRUE;
delete temp;
}
else {
avlRemoveChildren(aRootNode,aRootNode->mLeft,delOk);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
}
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
eAVLStatus
nsAVLTree::AddItem(void* anItem){
eAVLStatus result=eAVL_ok;
nsAVLNode* theNewNode=new nsAVLNode(anItem);
result=avlInsert(mRoot,theNewNode,mComparitor);
if(eAVL_duplicate!=result)
mCount++;
else {
delete theNewNode;
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
void* nsAVLTree::FindItem(void* aValue) const{
nsAVLNode* result=mRoot;
PRInt32 count=0;
while(result) {
count++;
PRInt32 cmp=mComparitor(aValue,result->mValue);
if(0==cmp) {
//we matched...
break;
}
else if(0>cmp){
//theNode was greater...
result=result->mLeft;
}
else {
//aValue is greater...
result=result->mRight;
}
}
if(result) {
return result->mValue;
}
return nsnull;
}
/**
*
* @update gess12/30/98
* @param
* @return
*/
eAVLStatus
nsAVLTree::RemoveItem(void* aValue){
PRBool delOk=PR_TRUE;
eAVLStatus result=avlRemove(mRoot,aValue,delOk,mComparitor);
if(eAVL_ok==result)
mCount--;
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEachDepthFirst(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor){
if(aNode) {
avlForEachDepthFirst(aNode->mLeft,aFunctor);
avlForEachDepthFirst(aNode->mRight,aFunctor);
aFunctor(aNode->mValue);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const{
::avlForEachDepthFirst(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEach(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
if(aNode) {
avlForEach(aNode->mLeft,aFunctor);
aFunctor(aNode->mValue);
avlForEach(aNode->mRight,aFunctor);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEach(nsAVLNodeFunctor& aFunctor) const{
::avlForEach(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void*
avlFirstThat(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
void* result=nsnull;
if(aNode) {
result = avlFirstThat(aNode->mLeft,aFunctor);
if (result) {
return result;
}
result = aFunctor(aNode->mValue);
if (result) {
return result;
}
result = avlFirstThat(aNode->mRight,aFunctor);
}
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void*
nsAVLTree::FirstThat(nsAVLNodeFunctor& aFunctor) const{
return ::avlFirstThat(mRoot,aFunctor);
}

View File

@@ -1,74 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsAVLTree_h___
#define nsAVLTree_h___
#include "nscore.h"
enum eAVLStatus {eAVL_unknown,eAVL_ok,eAVL_fail,eAVL_duplicate};
struct nsAVLNode;
/**
*
* @update gess12/26/98
* @param anObject1 is the first object to be compared
* @param anObject2 is the second object to be compared
* @return -1,0,1 if object1 is less, equal, greater than object2
*/
class NS_COM nsAVLNodeComparitor {
public:
virtual PRInt32 operator()(void* anItem1,void* anItem2)=0;
};
class NS_COM nsAVLNodeFunctor {
public:
virtual void* operator()(void* anItem)=0;
};
class NS_COM nsAVLTree {
public:
nsAVLTree(nsAVLNodeComparitor& aComparitor, nsAVLNodeFunctor* aDeallocator);
~nsAVLTree(void);
PRBool operator==(const nsAVLTree& aOther) const;
PRInt32 GetCount(void) const {return mCount;}
//main functions...
eAVLStatus AddItem(void* anItem);
eAVLStatus RemoveItem(void* anItem);
void* FindItem(void* anItem) const;
void ForEach(nsAVLNodeFunctor& aFunctor) const;
void ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const;
void* FirstThat(nsAVLNodeFunctor& aFunctor) const;
protected:
nsAVLNode* mRoot;
PRInt32 mCount;
nsAVLNodeComparitor& mComparitor;
nsAVLNodeFunctor* mDeallocator;
};
#endif /* nsAVLTree_h___ */

View File

@@ -0,0 +1,105 @@
/*
The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is mozilla.org code.
The Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are
Copyright (C) 1999 Sun Microsystems, Inc. All
Rights Reserved.
Contributor(s):
*/
#ifndef __JavaDOMGlobals_h__
#define __JavaDOMGlobals_h__
#include "jni.h"
#include "prclist.h"
#include "nsError.h"
#ifdef ERROR
#undef ERROR
#endif
class nsISupports;
class nsIDOMNode;
struct PRLogModuleInfo;
struct PRLock;
class JavaDOMGlobals {
public:
static jclass attrClass;
static jclass cDataSectionClass;
static jclass commentClass;
static jclass documentClass;
static jclass documentFragmentClass;
static jclass documentTypeClass;
static jclass domImplementationClass;
static jclass elementClass;
static jclass entityClass;
static jclass entityReferenceClass;
static jclass namedNodeMapClass;
static jclass nodeClass;
static jclass nodeListClass;
static jclass notationClass;
static jclass processingInstructionClass;
static jclass textClass;
static jfieldID nodePtrFID;
static jfieldID nodeListPtrFID;
static jfieldID domImplementationPtrFID;
static jfieldID nodeTypeAttributeFID;
static jfieldID nodeTypeCDataSectionFID;
static jfieldID nodeTypeCommentFID;
static jfieldID nodeTypeDocumentFragmentFID;
static jfieldID nodeTypeDocumentFID;
static jfieldID nodeTypeDocumentTypeFID;
static jfieldID nodeTypeElementFID;
static jfieldID nodeTypeEntityFID;
static jfieldID nodeTypeEntityReferenceFID;
static jfieldID nodeTypeNotationFID;
static jfieldID nodeTypeProcessingInstructionFID;
static jfieldID nodeTypeTextFID;
static jclass domExceptionClass;
static jmethodID domExceptionInitMID;
static jclass runtimeExceptionClass;
static jmethodID runtimeExceptionInitMID;
static const char* const DOM_EXCEPTION_MESSAGE[];
typedef enum ExceptionType { EXCEPTION_RUNTIME,
EXCEPTION_DOM } ExceptionType;
static PRLogModuleInfo* log;
static PRCList garbage;
static PRLock* garbageLock;
static PRInt32 javaMaxInt;
static void Initialize(JNIEnv *env);
static void Destroy(JNIEnv *env);
static jobject CreateNodeSubtype(JNIEnv *env,
nsIDOMNode *node);
static void AddToGarbage(nsISupports* domObject);
static void TakeOutGarbage();
static void ThrowException(JNIEnv *env,
const char * message = NULL,
nsresult rv = NS_OK,
ExceptionType exceptionType = EXCEPTION_RUNTIME);
};
#endif /* __JavaDOMGlobals_h__ */

View File

@@ -1,617 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsAVLTree.h"
enum eLean {eLeft,eNeutral,eRight};
struct NS_COM nsAVLNode {
public:
nsAVLNode(void* aValue) {
mLeft=0;
mRight=0;
mSkew=eNeutral;
mValue=aValue;
}
nsAVLNode* mLeft;
nsAVLNode* mRight;
eLean mSkew;
void* mValue;
};
/************************************************************
Now begin the tree class. Don't forget that the comparison
between nodes must occur via the comparitor function,
otherwise all you're testing is pointer addresses.
************************************************************/
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
nsAVLTree::nsAVLTree(nsAVLNodeComparitor& aComparitor,
nsAVLNodeFunctor* aDeallocator) :
mComparitor(aComparitor), mDeallocator(aDeallocator) {
mRoot=0;
mCount=0;
}
static void
avlDeleteTree(nsAVLNode* aNode){
if (aNode) {
avlDeleteTree(aNode->mLeft);
avlDeleteTree(aNode->mRight);
delete aNode;
}
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
nsAVLTree::~nsAVLTree(){
if (mDeallocator) {
ForEachDepthFirst(*mDeallocator);
}
avlDeleteTree(mRoot);
}
class CDoesntExist: public nsAVLNodeFunctor {
public:
CDoesntExist(const nsAVLTree& anotherTree) : mOtherTree(anotherTree) {
}
virtual void* operator()(void* anItem) {
void* result=mOtherTree.FindItem(anItem);
if(result)
return nsnull;
return anItem;
}
protected:
const nsAVLTree& mOtherTree;
};
/**
* This method compares two trees (members by identity).
* @update gess12/27/98
* @param tree to compare against
* @return true if they are identical (contain same stuff).
*/
PRBool nsAVLTree::operator==(const nsAVLTree& aCopy) const{
CDoesntExist functor(aCopy);
void* theItem=FirstThat(functor);
PRBool result=PRBool(!theItem);
return result;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateRight(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mRight;
if(ptr2->mSkew==eRight) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mLeft;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(ptr3->mSkew==eLeft)
ptr2->mSkew=eRight;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eRight)
aRootNode->mSkew=eLeft;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateLeft(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mLeft;
if(ptr2->mSkew==eLeft) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mRight;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(ptr3->mSkew==eRight)
ptr2->mSkew=eLeft;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eLeft)
aRootNode->mSkew=eRight;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlInsert(nsAVLNode*& aRootNode, nsAVLNode* aNewNode,
nsAVLNodeComparitor& aComparitor) {
eAVLStatus result=eAVL_unknown;
if(!aRootNode) {
aRootNode = aNewNode;
return eAVL_ok;
}
if(aNewNode==aRootNode->mValue) {
return eAVL_duplicate;
}
PRInt32 theCompareResult=aComparitor(aRootNode->mValue,aNewNode->mValue);
if(0 < theCompareResult) { //if(anItem<aRootNode->mValue)
result=avlInsert(aRootNode->mLeft,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
avlRotateLeft(aRootNode);
result=eAVL_fail;
break;
case eRight:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
break;
} //switch
}//if
} //if
else {
result=avlInsert(aRootNode->mRight,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eRight:
avlRotateRight(aRootNode);
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eRight;
break;
} //switch
}
} //if
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceLeft(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
ptr2=aRootNode->mLeft;
balnc2=ptr2->mSkew;
if(balnc2!=eRight) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eLeft;
ptr2->mSkew=eRight;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mRight;
balnc3=ptr3->mSkew;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(balnc3==eRight) {
ptr2->mSkew=eLeft;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eLeft) {
aRootNode->mSkew=eRight;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eRight:
aRootNode->mSkew=eNeutral;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceRight(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
break;
case eRight:
ptr2=aRootNode->mRight;
balnc2=ptr2->mSkew;
if(balnc2!=eLeft) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eRight;
ptr2->mSkew=eLeft;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mLeft;
balnc3=ptr3->mSkew;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(balnc3==eLeft) {
ptr2->mSkew=eRight;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eRight) {
aRootNode->mSkew=eLeft;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eNeutral:
aRootNode->mSkew=eRight;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemoveChildren(nsAVLNode*& aRootNode,nsAVLNode*& anotherNode, PRBool& delOk){
eAVLStatus result=eAVL_ok;
if(!anotherNode->mRight){
aRootNode->mValue=anotherNode->mValue; //swap
anotherNode=anotherNode->mLeft;
delOk=PR_TRUE;
}
else{
avlRemoveChildren(aRootNode,anotherNode->mRight,delOk);
if(delOk)
avlBalanceLeft(anotherNode,delOk);
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemove(nsAVLNode*& aRootNode, void* anItem, PRBool& delOk,
nsAVLNodeComparitor& aComparitor){
eAVLStatus result=eAVL_ok;
if(!aRootNode)
delOk=PR_FALSE;
else {
PRInt32 cmp=aComparitor(anItem,aRootNode->mValue);
if(cmp<0){
avlRemove(aRootNode->mLeft,anItem,delOk,aComparitor);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
else if(cmp>0){
avlRemove(aRootNode->mRight,anItem,delOk,aComparitor);
if(delOk)
avlBalanceLeft(aRootNode,delOk);
}
else{ //they match...
nsAVLNode* temp=aRootNode;
if(!aRootNode->mRight) {
aRootNode=aRootNode->mLeft;
delOk=PR_TRUE;
delete temp;
}
else if(!aRootNode->mLeft) {
aRootNode=aRootNode->mRight;
delOk=PR_TRUE;
delete temp;
}
else {
avlRemoveChildren(aRootNode,aRootNode->mLeft,delOk);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
}
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
eAVLStatus
nsAVLTree::AddItem(void* anItem){
eAVLStatus result=eAVL_ok;
nsAVLNode* theNewNode=new nsAVLNode(anItem);
result=avlInsert(mRoot,theNewNode,mComparitor);
if(eAVL_duplicate!=result)
mCount++;
else {
delete theNewNode;
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
void* nsAVLTree::FindItem(void* aValue) const{
nsAVLNode* result=mRoot;
PRInt32 count=0;
while(result) {
count++;
PRInt32 cmp=mComparitor(aValue,result->mValue);
if(0==cmp) {
//we matched...
break;
}
else if(0>cmp){
//theNode was greater...
result=result->mLeft;
}
else {
//aValue is greater...
result=result->mRight;
}
}
if(result) {
return result->mValue;
}
return nsnull;
}
/**
*
* @update gess12/30/98
* @param
* @return
*/
eAVLStatus
nsAVLTree::RemoveItem(void* aValue){
PRBool delOk=PR_TRUE;
eAVLStatus result=avlRemove(mRoot,aValue,delOk,mComparitor);
if(eAVL_ok==result)
mCount--;
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEachDepthFirst(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor){
if(aNode) {
avlForEachDepthFirst(aNode->mLeft,aFunctor);
avlForEachDepthFirst(aNode->mRight,aFunctor);
aFunctor(aNode->mValue);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const{
::avlForEachDepthFirst(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEach(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
if(aNode) {
avlForEach(aNode->mLeft,aFunctor);
aFunctor(aNode->mValue);
avlForEach(aNode->mRight,aFunctor);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEach(nsAVLNodeFunctor& aFunctor) const{
::avlForEach(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void*
avlFirstThat(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
void* result=nsnull;
if(aNode) {
result = avlFirstThat(aNode->mLeft,aFunctor);
if (result) {
return result;
}
result = aFunctor(aNode->mValue);
if (result) {
return result;
}
result = avlFirstThat(aNode->mRight,aFunctor);
}
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void*
nsAVLTree::FirstThat(nsAVLNodeFunctor& aFunctor) const{
return ::avlFirstThat(mRoot,aFunctor);
}

View File

@@ -1,74 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsAVLTree_h___
#define nsAVLTree_h___
#include "nscore.h"
enum eAVLStatus {eAVL_unknown,eAVL_ok,eAVL_fail,eAVL_duplicate};
struct nsAVLNode;
/**
*
* @update gess12/26/98
* @param anObject1 is the first object to be compared
* @param anObject2 is the second object to be compared
* @return -1,0,1 if object1 is less, equal, greater than object2
*/
class NS_COM nsAVLNodeComparitor {
public:
virtual PRInt32 operator()(void* anItem1,void* anItem2)=0;
};
class NS_COM nsAVLNodeFunctor {
public:
virtual void* operator()(void* anItem)=0;
};
class NS_COM nsAVLTree {
public:
nsAVLTree(nsAVLNodeComparitor& aComparitor, nsAVLNodeFunctor* aDeallocator);
~nsAVLTree(void);
PRBool operator==(const nsAVLTree& aOther) const;
PRInt32 GetCount(void) const {return mCount;}
//main functions...
eAVLStatus AddItem(void* anItem);
eAVLStatus RemoveItem(void* anItem);
void* FindItem(void* anItem) const;
void ForEach(nsAVLNodeFunctor& aFunctor) const;
void ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const;
void* FirstThat(nsAVLNodeFunctor& aFunctor) const;
protected:
nsAVLNode* mRoot;
PRInt32 mCount;
nsAVLNodeComparitor& mComparitor;
nsAVLNodeFunctor* mDeallocator;
};
#endif /* nsAVLTree_h___ */

View File

@@ -1,717 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/******************************************************************************************
MODULE NOTES:
This file contains the nsStr data structure.
This general purpose buffer management class is used as the basis for our strings.
It's benefits include:
1. An efficient set of library style functions for manipulating nsStrs
2. Support for 1 and 2 byte character strings (which can easily be increased to n)
3. Unicode awareness and interoperability.
*******************************************************************************************/
#include "nsStr.h"
#include "bufferRoutines.h"
#include "stdio.h" //only used for printf
#include "nsCRT.h"
#include "nsDeque.h"
//static const char* kCallFindChar = "For better performance, call FindChar() for targets whose length==1.";
//static const char* kCallRFindChar = "For better performance, call RFindChar() for targets whose length==1.";
static const PRUnichar gCommonEmptyBuffer[1] = {0};
/**
* This method initializes all the members of the nsStr structure
*
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Initialize(nsStr& aDest,eCharSize aCharSize) {
aDest.mStr=(char*)gCommonEmptyBuffer;
aDest.mLength=0;
aDest.mCapacity=0;
aDest.mCharSize=aCharSize;
aDest.mOwnsBuffer=0;
}
/**
* This method initializes all the members of the nsStr structure
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Initialize(nsStr& aDest,char* aCString,PRUint32 aCapacity,PRUint32 aLength,eCharSize aCharSize,PRBool aOwnsBuffer){
aDest.mStr=(aCString) ? aCString : (char*)gCommonEmptyBuffer;
aDest.mLength=aLength;
aDest.mCapacity=aCapacity;
aDest.mCharSize=aCharSize;
aDest.mOwnsBuffer=aOwnsBuffer;
}
/**
* This member destroys the memory buffer owned by an nsStr object (if it actually owns it)
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Destroy(nsStr& aDest) {
if((aDest.mStr) && (aDest.mStr!=(char*)gCommonEmptyBuffer)) {
Free(aDest);
}
}
/**
* This method gets called when the internal buffer needs
* to grow to a given size. The original contents are not preserved.
* @update gess 3/30/98
* @param aNewLength -- new capacity of string in charSize units
* @return void
*/
PRBool nsStr::EnsureCapacity(nsStr& aString,PRUint32 aNewLength) {
PRBool result=PR_TRUE;
if(aNewLength>aString.mCapacity) {
result=Realloc(aString,aNewLength);
if(aString.mStr)
AddNullTerminator(aString);
}
return result;
}
/**
* This method gets called when the internal buffer needs
* to grow to a given size. The original contents ARE preserved.
* @update gess 3/30/98
* @param aNewLength -- new capacity of string in charSize units
* @return void
*/
PRBool nsStr::GrowCapacity(nsStr& aDest,PRUint32 aNewLength) {
PRBool result=PR_TRUE;
if(aNewLength>aDest.mCapacity) {
nsStr theTempStr;
nsStr::Initialize(theTempStr,aDest.mCharSize);
result=EnsureCapacity(theTempStr,aNewLength);
if(result) {
if(aDest.mLength) {
Append(theTempStr,aDest,0,aDest.mLength);
}
Free(aDest);
aDest.mStr = theTempStr.mStr;
theTempStr.mStr=0; //make sure to null this out so that you don't lose the buffer you just stole...
aDest.mLength=theTempStr.mLength;
aDest.mCapacity=theTempStr.mCapacity;
aDest.mOwnsBuffer=theTempStr.mOwnsBuffer;
}
}
return result;
}
/**
* Replaces the contents of aDest with aSource, up to aCount of chars.
* @update gess10/30/98
* @param aDest is the nsStr that gets changed.
* @param aSource is where chars are copied from
* @param aCount is the number of chars copied from aSource
*/
void nsStr::Assign(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount){
if(&aDest!=&aSource){
Truncate(aDest,0);
Append(aDest,aSource,anOffset,aCount);
}
}
/**
* This method appends the given nsStr to this one. Note that we have to
* pay attention to the underlying char-size of both structs.
* @update gess10/30/98
* @param aDest is the nsStr to be manipulated
* @param aSource is where char are copied from
* @aCount is the number of bytes to be copied
*/
void nsStr::Append(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount){
if(anOffset<aSource.mLength){
PRUint32 theRealLen=(aCount<0) ? aSource.mLength : MinInt(aCount,aSource.mLength);
PRUint32 theLength=(anOffset+theRealLen<aSource.mLength) ? theRealLen : (aSource.mLength-anOffset);
if(0<theLength){
PRBool isBigEnough=PR_TRUE;
if(aDest.mLength+theLength > aDest.mCapacity) {
isBigEnough=GrowCapacity(aDest,aDest.mLength+theLength);
}
if(isBigEnough) {
//now append new chars, starting at offset
(*gCopyChars[aSource.mCharSize][aDest.mCharSize])(aDest.mStr,aDest.mLength,aSource.mStr,anOffset,theLength);
aDest.mLength+=theLength;
AddNullTerminator(aDest);
}
}
}
}
/**
* This method inserts up to "aCount" chars from a source nsStr into a dest nsStr.
* @update gess10/30/98
* @param aDest is the nsStr that gets changed
* @param aDestOffset is where in aDest the insertion is to occur
* @param aSource is where chars are copied from
* @param aSrcOffset is where in aSource chars are copied from
* @param aCount is the number of chars from aSource to be inserted into aDest
*/
void nsStr::Insert( nsStr& aDest,PRUint32 aDestOffset,const nsStr& aSource,PRUint32 aSrcOffset,PRInt32 aCount){
//there are a few cases for insert:
// 1. You're inserting chars into an empty string (assign)
// 2. You're inserting onto the end of a string (append)
// 3. You're inserting onto the 1..n-1 pos of a string (the hard case).
if(0<aSource.mLength){
if(aDest.mLength){
if(aDestOffset<aDest.mLength){
PRInt32 theRealLen=(aCount<0) ? aSource.mLength : MinInt(aCount,aSource.mLength);
PRInt32 theLength=(aSrcOffset+theRealLen<aSource.mLength) ? theRealLen : (aSource.mLength-aSrcOffset);
if(aSrcOffset<aSource.mLength) {
//here's the only new case we have to handle.
//chars are really being inserted into our buffer...
if(aDest.mLength+theLength > aDest.mCapacity) {
nsStr theTempStr;
nsStr::Initialize(theTempStr,aDest.mCharSize);
PRBool isBigEnough=EnsureCapacity(theTempStr,aDest.mLength+theLength); //grow the temp buffer to the right size
if(isBigEnough) {
if(aDestOffset) {
Append(theTempStr,aDest,0,aDestOffset); //first copy leftmost data...
}
Append(theTempStr,aSource,0,aSource.mLength); //next copy inserted (new) data
PRUint32 theRemains=aDest.mLength-aDestOffset;
if(theRemains) {
Append(theTempStr,aDest,aDestOffset,theRemains); //next copy rightmost data
}
Free(aDest);
aDest.mStr = theTempStr.mStr;
theTempStr.mStr=0; //make sure to null this out so that you don't lose the buffer you just stole...
aDest.mCapacity=theTempStr.mCapacity;
aDest.mOwnsBuffer=theTempStr.mOwnsBuffer;
}
}
else {
//shift the chars right by theDelta...
(*gShiftChars[aDest.mCharSize][KSHIFTRIGHT])(aDest.mStr,aDest.mLength,aDestOffset,theLength);
//now insert new chars, starting at offset
(*gCopyChars[aSource.mCharSize][aDest.mCharSize])(aDest.mStr,aDestOffset,aSource.mStr,aSrcOffset,theLength);
}
//finally, make sure to update the string length...
aDest.mLength+=theLength;
AddNullTerminator(aDest);
}//if
//else nothing to do!
}
else Append(aDest,aSource,0,aCount);
}
else Append(aDest,aSource,0,aCount);
}
}
/**
* This method deletes up to aCount chars from aDest
* @update gess10/30/98
* @param aDest is the nsStr to be manipulated
* @param aDestOffset is where in aDest deletion is to occur
* @param aCount is the number of chars to be deleted in aDest
*/
void nsStr::Delete(nsStr& aDest,PRUint32 aDestOffset,PRUint32 aCount){
if(aDestOffset<aDest.mLength){
PRUint32 theDelta=aDest.mLength-aDestOffset;
PRUint32 theLength=(theDelta<aCount) ? theDelta : aCount;
if(aDestOffset+theLength<aDest.mLength) {
//if you're here, it means we're cutting chars out of the middle of the string...
//so shift the chars left by theLength...
(*gShiftChars[aDest.mCharSize][KSHIFTLEFT])(aDest.mStr,aDest.mLength,aDestOffset,theLength);
aDest.mLength-=theLength;
AddNullTerminator(aDest);
}
else Truncate(aDest,aDestOffset);
}//if
}
/**
* This method truncates the given nsStr at given offset
* @update gess10/30/98
* @param aDest is the nsStr to be truncated
* @param aDestOffset is where in aDest truncation is to occur
*/
void nsStr::Truncate(nsStr& aDest,PRUint32 aDestOffset){
if(aDestOffset<aDest.mLength){
aDest.mLength=aDestOffset;
AddNullTerminator(aDest);
}
}
/**
* This method forces the given string to upper or lowercase
* @update gess1/7/99
* @param aDest is the string you're going to change
* @param aToUpper: if TRUE, then we go uppercase, otherwise we go lowercase
* @return
*/
void nsStr::ChangeCase(nsStr& aDest,PRBool aToUpper) {
// somehow UnicharUtil return failed, fallback to the old ascii only code
gCaseConverters[aDest.mCharSize](aDest.mStr,aDest.mLength,aToUpper);
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::Trim(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing){
if((aDest.mLength>0) && aSet){
PRInt32 theIndex=-1;
PRInt32 theMax=aDest.mLength;
PRInt32 theSetLen=nsCRT::strlen(aSet);
if(aEliminateLeading) {
while(++theIndex<=theMax) {
PRUnichar theChar=GetCharAt(aDest,theIndex);
PRInt32 thePos=gFindChars[eOneByte](aSet,theSetLen,0,theChar,PR_FALSE);
if(kNotFound==thePos)
break;
}
if(0<theIndex) {
if(theIndex<theMax) {
Delete(aDest,0,theIndex);
}
else Truncate(aDest,0);
}
}
if(aEliminateTrailing) {
theIndex=aDest.mLength;
PRInt32 theNewLen=theIndex;
while(--theIndex>0) {
PRUnichar theChar=GetCharAt(aDest,theIndex); //read at end now...
PRInt32 thePos=gFindChars[eOneByte](aSet,theSetLen,0,theChar,PR_FALSE);
if(kNotFound<thePos)
theNewLen=theIndex;
else break;
}
if(theNewLen<theMax) {
Truncate(aDest,theNewLen);
}
}
}
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::CompressSet(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing){
Trim(aDest,aSet,aEliminateLeading,aEliminateTrailing);
PRUint32 aNewLen=gCompressChars[aDest.mCharSize](aDest.mStr,aDest.mLength,aSet);
aDest.mLength=aNewLen;
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::StripChars(nsStr& aDest,const char* aSet){
if((0<aDest.mLength) && (aSet)) {
PRUint32 aNewLen=gStripChars[aDest.mCharSize](aDest.mStr,aDest.mLength,aSet);
aDest.mLength=aNewLen;
}
}
/**************************************************************
Searching methods...
**************************************************************/
/**
* This searches aDest for a given substring
*
* @update gess 3/25/98
* @param aDest string to search
* @param aTarget is the substring you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) {
// NS_PRECONDITION(aTarget.mLength!=1,kCallFindChar);
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRInt32 theMax=aDest.mLength-aTarget.mLength;
PRInt32 index=(0<=anOffset) ? anOffset : 0;
if((aDest.mLength>=aTarget.mLength) && (aTarget.mLength>0) && (index>=0)){
PRInt32 theTargetMax=aTarget.mLength;
while(index<=theMax) {
PRInt32 theSubIndex=-1;
PRBool matches=PR_TRUE;
while((++theSubIndex<theTargetMax) && (matches)){
PRUnichar theChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aDest,index+theSubIndex)) : GetCharAt(aDest,index+theSubIndex);
PRUnichar theTargetChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aTarget,theSubIndex)) : GetCharAt(aTarget,theSubIndex);
matches=PRBool(theChar==theTargetChar);
}
if(matches) {
result=index;
break;
}
index++;
} //while
}//if
}//if
return result;
}
/**
* This searches aDest for a given character
*
* @update gess 3/25/98
* @param aDest string to search
* @param char is the character you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset) {
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRUint32 index=(0<=anOffset) ? (PRUint32)anOffset : 0;
result=gFindChars[aDest.mCharSize](aDest.mStr,aDest.mLength,index,aChar,aIgnoreCase);
}
return result;
}
/**
* This searches aDest for a character found in aSet.
*
* @update gess 3/25/98
* @param aDest string to search
* @param aSet contains a list of chars to be searched for
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aSet.mLength!=1,kCallFindChar);
PRInt32 index=(0<=anOffset) ? anOffset-1 : -1;
PRInt32 thePos;
//Note that the search is inverted here. We're scanning aDest, one char at a time
//but doing the search against the given set. That's why we use 0 as the offset below.
if((0<aDest.mLength) && (0<aSet.mLength)){
while(++index<(PRInt32)aDest.mLength) {
PRUnichar theChar=GetCharAt(aDest,index);
thePos=gFindChars[aSet.mCharSize](aSet.mStr,aSet.mLength,0,theChar,aIgnoreCase);
if(kNotFound!=thePos)
return index;
} //while
}
return kNotFound;
}
/**************************************************************
Reverse Searching methods...
**************************************************************/
/**
* This searches aDest (in reverse) for a given substring
*
* @update gess 3/25/98
* @param aDest string to search
* @param aTarget is the substring you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search (counting from left)
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aTarget.mLength!=1,kCallRFindChar);
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRInt32 index=(0<=anOffset) ? anOffset : aDest.mLength-1;
if((aDest.mLength>=aTarget.mLength) && (aTarget.mLength>0) && (index>=0)){
nsStr theCopy;
nsStr::Initialize(theCopy,eOneByte);
nsStr::Assign(theCopy,aTarget,0,aTarget.mLength);
if(aIgnoreCase){
nsStr::ChangeCase(theCopy,PR_FALSE); //force to lowercase
}
PRInt32 theTargetMax=theCopy.mLength;
while(index>=0) {
PRInt32 theSubIndex=-1;
PRBool matches=PR_FALSE;
if(index+theCopy.mLength<=aDest.mLength) {
matches=PR_TRUE;
while((++theSubIndex<theTargetMax) && (matches)){
PRUnichar theDestChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aDest,index+theSubIndex)) : GetCharAt(aDest,index+theSubIndex);
PRUnichar theTargetChar=GetCharAt(theCopy,theSubIndex);
matches=PRBool(theDestChar==theTargetChar);
} //while
} //if
if(matches) {
result=index;
break;
}
index--;
} //while
nsStr::Destroy(theCopy);
}//if
}//if
return result;
}
/**
* This searches aDest (in reverse) for a given character
*
* @update gess 3/25/98
* @param aDest string to search
* @param char is the character you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset) {
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRUint32 index=(0<=anOffset) ? anOffset : aDest.mLength-1;
result=gRFindChars[aDest.mCharSize](aDest.mStr,aDest.mLength,index,aChar,aIgnoreCase);
}
return result;
}
/**
* This searches aDest (in reverese) for a character found in aSet.
*
* @update gess 3/25/98
* @param aDest string to search
* @param aSet contains a list of chars to be searched for
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aSet.mLength!=1,kCallRFindChar);
PRInt32 index=(0<=anOffset) ? anOffset : aDest.mLength;
PRInt32 thePos;
//note that the search is inverted here. We're scanning aDest, one char at a time
//but doing the search against the given set. That's why we use 0 as the offset below.
if(0<aDest.mLength) {
while(--index>=0) {
PRUnichar theChar=GetCharAt(aDest,index);
thePos=gFindChars[aSet.mCharSize](aSet.mStr,aSet.mLength,0,theChar,aIgnoreCase);
if(kNotFound!=thePos)
return index;
} //while
}
return kNotFound;
}
/**
* Compare source and dest strings, up to an (optional max) number of chars
* @param aDest is the first str to compare
* @param aSource is the second str to compare
* @param aCount -- if (-1), then we use length of longer string; if (0<aCount) then it gives the max # of chars to compare
* @param aIgnorecase tells us whether to search with case sensitivity
* @return aDest<aSource=-1;aDest==aSource==0;aDest>aSource=1
*/
PRInt32 nsStr::Compare(const nsStr& aDest,const nsStr& aSource,PRInt32 aCount,PRBool aIgnoreCase) {
PRInt32 result=0;
if(aCount) {
PRInt32 minlen=(aSource.mLength<aDest.mLength) ? aSource.mLength : aDest.mLength;
if(0==minlen) {
if ((aDest.mLength == 0) && (aSource.mLength == 0))
return 0;
if (aDest.mLength == 0)
return -1;
return 1;
}
PRInt32 maxlen=(aSource.mLength<aDest.mLength) ? aDest.mLength : aSource.mLength;
aCount = (aCount<0) ? maxlen : MinInt(aCount,maxlen);
result=(*gCompare[aDest.mCharSize][aSource.mCharSize])(aDest.mStr,aSource.mStr,aCount,aIgnoreCase);
}
return result;
}
//----------------------------------------------------------------------------------------
PRBool nsStr::Alloc(nsStr& aDest,PRUint32 aCount) {
static int mAllocCount=0;
mAllocCount++;
//we're given the acount value in charunits; now scale up to next multiple.
PRUint32 theNewCapacity=kDefaultStringSize;
while(theNewCapacity<aCount){
theNewCapacity<<=1;
}
aDest.mCapacity=theNewCapacity++;
PRUint32 theSize=(theNewCapacity<<aDest.mCharSize);
aDest.mStr = (char*)nsAllocator::Alloc(theSize);
PRBool result=PR_FALSE;
if(aDest.mStr) {
aDest.mOwnsBuffer=1;
result=PR_TRUE;
}
return result;
}
PRBool nsStr::Free(nsStr& aDest){
if(aDest.mStr){
if(aDest.mOwnsBuffer){
nsAllocator::Free(aDest.mStr);
}
aDest.mStr=0;
aDest.mOwnsBuffer=0;
return PR_TRUE;
}
return PR_FALSE;
}
PRBool nsStr::Realloc(nsStr& aDest,PRUint32 aCount){
nsStr temp;
memcpy(&temp,&aDest,sizeof(aDest));
PRBool result=Alloc(temp,aCount);
if(result) {
Free(aDest);
aDest.mStr=temp.mStr;
aDest.mCapacity=temp.mCapacity;
aDest.mOwnsBuffer=temp.mOwnsBuffer;
}
return result;
}
//----------------------------------------------------------------------------------------
CBufDescriptor::CBufDescriptor(char* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=aString;
mCharSize=eOneByte;
mStackBased=aStackBased;
mIsConst=PR_FALSE;
mLength=mCapacity=0;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(const char* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eOneByte;
mStackBased=aStackBased;
mIsConst=PR_TRUE;
mLength=mCapacity=0;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eTwoByte;
mStackBased=aStackBased;
mLength=mCapacity=0;
mIsConst=PR_FALSE;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? nsCRT::strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(const PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eTwoByte;
mStackBased=aStackBased;
mLength=mCapacity=0;
mIsConst=PR_TRUE;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? nsCRT::strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
//----------------------------------------------------------------------------------------

View File

@@ -1,450 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
1. There are two philosophies to building string classes:
A. Hide the underlying buffer & offer API's allow indirect iteration
B. Reveal underlying buffer, risk corruption, but gain performance
We chose the option B for performance reasons.
2 Our internal buffer always holds capacity+1 bytes.
The nsStr struct is a simple structure (no methods) that contains
the necessary info to be described as a string. This simple struct
is manipulated by the static methods provided in this class.
(Which effectively makes this a library that works on structs).
There are also object-based versions called nsString and nsAutoString
which use nsStr but makes it look at feel like an object.
***********************************************************************/
/***********************************************************************
ASSUMPTIONS:
1. nsStrings and nsAutoString are always null terminated.
2. If you try to set a null char (via SetChar()) a new length is set
3. nsCStrings can be upsampled into nsString without data loss
4. Char searching is faster than string searching. Use char interfaces
if your needs will allow it.
5. It's easy to use the stack for nsAutostring buffer storage (fast too!).
See the CBufDescriptor class in this file.
6. It's ONLY ok to provide non-null-terminated buffers to Append() and Insert()
provided you specify a 0<n value for the optional count argument.
7. Downsampling from nsString to nsCString is lossy -- avoid it if possible!
8. Calls to ToNewCString() and ToNewUnicode() should be matched with calls to Recycle().
***********************************************************************/
/**********************************************************************************
AND NOW FOR SOME GENERAL DOCUMENTATION ON STRING USAGE...
The fundamental datatype in the string library is nsStr. It's a structure that
provides the buffer storage and meta-info. It also provides a C-style library
of functions for direct manipulation (for those of you who prefer K&R to Bjarne).
Here's a diagram of the class hierarchy:
nsStr
|___nsString
| |
| ------nsAutoString
|
|___nsCString
|
------nsCAutoString
Why so many string classes? The 4 variants give you the control you need to
determine the best class for your purpose. There are 2 dimensions to this
flexibility: 1) stack vs. heap; and 2) 1-byte chars vs. 2-byte chars.
Note: While nsAutoString and nsCAutoString begin life using stack-based storage,
they may not stay that way. Like all nsString classes, autostrings will
automatically grow to contain the data you provide. When autostrings
grow beyond their intrinsic buffer, they switch to heap based allocations.
(We avoid alloca to avoid considerable platform difficulties; see the
GNU documentation for more details).
I should also briefly mention that all the string classes use a "memory agent"
object to perform memory operations. This class proxies the standard nsAllocator
for actual memory calls, but knows the structure of nsStr making heap operations
more localized.
CHOOSING A STRING CLASS:
In order to choose a string class for you purpose, use this handy table:
heap-based stack-based
-----------------------------------
ascii data | nsCString nsCAutoString |
|----------------------------------
unicode data | nsString nsAutoString |
-----------------------------------
Note: The i18n folks will stenuously object if we get too carried away with the
use of nsCString's that pass interface boundaries. Try to limit your
use of these to external interfaces that demand them, or for your own
private purposes in cases where they'll never be seen by humans.
PERFORMANCE CONSIDERATIONS:
Here are a few tricks to know in order to get better string performance:
1) Try to limit conversions between ascii and unicode; By sticking with nsString
wherever possible your code will be i18n-compliant.
2) Preallocating your string buffer cuts down trips to the allocator. So if you
have need for an arbitrarily large buffer, pre-size it like this:
{
nsString mBuffer;
mBuffer.SetCapacity(aReasonableSize);
}
3) Allocating nsAutoString or nsCAutoString on the heap is memory inefficient
(after all, the whole point is to avoid a heap allocation of the buffer).
4) Consider using an autoString to write into your arbitrarily-sized stack buffers, rather
than it's own buffers.
For example, let's say you're going to call printf() to emit pretty-printed debug output
of your object. You know from experience that the pretty-printed version of your object
exceeds the capacity of an autostring. Ignoring memory considerations, you could simply
use nsCString, appending the stringized version of each of your class's data members.
This will probably result in calls to the heap manager.
But there's a way to do this without necessarily having to call the heap manager.
All you do is declare a stack based buffer and instruct nsCString to use that instead
of it's own internal buffer by using the CBufDescriptor class:
{
char theBuffer[256];
CBufDescritor theBufDecriptor( theBuffer, PR_TRUE, sizeof(theBuffer), 0);
nsCAutoString s3( theBufDescriptor );
s3="HELLO, my name is inigo montoya, you killed my father, prepare to die!.";
}
The assignment statment to s3 will cause the given string to be written to your
stack-based buffer via the normal nsString/nsCString interfaces. Cool, huh?
Note however that just like any other nsStringXXX use, if you write more data
than will fit in the buffer, a visit to the heap manager will be in order.
**********************************************************************************/
#ifndef _nsStr
#define _nsStr
#include "nscore.h"
#include "nsIAllocator.h"
#include <string.h>
//----------------------------------------------------------------------------------------
enum eCharSize {eOneByte=0,eTwoByte=1};
#define kDefaultCharSize eTwoByte
#define kRadix10 (10)
#define kRadix16 (16)
#define kAutoDetect (100)
#define kRadixUnknown (kAutoDetect+1)
const PRInt32 kDefaultStringSize = 64;
const PRInt32 kNotFound = -1;
//----------------------------------------------------------------------------------------
class NS_COM CBufDescriptor {
public:
CBufDescriptor(char* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(const char* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(PRUnichar* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(const PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
char* mBuffer;
eCharSize mCharSize;
PRUint32 mCapacity;
PRInt32 mLength;
PRBool mStackBased;
PRBool mIsConst;
};
//----------------------------------------------------------------------------------------
struct NS_COM nsStr {
//----------------------------------------------------------------------------------------
nsStr() {
MOZ_COUNT_CTOR(nsStr);
}
~nsStr() {
MOZ_COUNT_DTOR(nsStr);
}
/**
* This method initializes an nsStr for use
*
* @update gess 01/04/99
* @param aString is the nsStr to be initialized
* @param aCharSize tells us the requested char size (1 or 2 bytes)
*/
static void Initialize(nsStr& aDest,eCharSize aCharSize);
/**
* This method initializes an nsStr for use
*
* @update gess 01/04/99
* @param aString is the nsStr to be initialized
* @param aCharSize tells us the requested char size (1 or 2 bytes)
*/
static void Initialize(nsStr& aDest,char* aCString,PRUint32 aCapacity,PRUint32 aLength,eCharSize aCharSize,PRBool aOwnsBuffer);
/**
* This method destroys the given nsStr, and *MAY*
* deallocate it's memory depending on the setting
* of the internal mOwnsBUffer flag.
*
* @update gess 01/04/99
* @param aString is the nsStr to be manipulated
* @param anAgent is the allocator to be used to the nsStr
*/
static void Destroy(nsStr& aDest);
/**
* These methods are where memory allocation/reallocation occur.
*
* @update gess 01/04/99
* @param aString is the nsStr to be manipulated
* @param anAgent is the allocator to be used on the nsStr
* @return
*/
static PRBool EnsureCapacity(nsStr& aString,PRUint32 aNewLength);
static PRBool GrowCapacity(nsStr& aString,PRUint32 aNewLength);
/**
* These methods are used to append content to the given nsStr
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aSource is the buffer to be copied from
* @param anOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to copy
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Append(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount);
/**
* These methods are used to assign contents of a source string to dest string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aSource is the buffer to be copied from
* @param anOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to copy
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Assign(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount);
/**
* These methods are used to insert content from source string to the dest nsStr
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aDestOffset tells us where in dest to start insertion
* @param aSource is the buffer to be copied from
* @param aSrcOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to insert
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Insert( nsStr& aDest,PRUint32 aDestOffset,const nsStr& aSource,PRUint32 aSrcOffset,PRInt32 aCount);
/**
* This method deletes chars from the given str.
* The given allocator may choose to resize the str as well.
*
* @update gess 01/04/99
* @param aDest is the nsStr to be deleted from
* @param aDestOffset tells us where in dest to start deleting
* @param aCount tells us the (max) # of chars to delete
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Delete(nsStr& aDest,PRUint32 aDestOffset,PRUint32 aCount);
/**
* This method is used to truncate the given string.
* The given allocator may choose to resize the str as well (but it's not likely).
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aDestOffset tells us where in dest to start insertion
* @param aSource is the buffer to be copied from
* @param aSrcOffset tells us where in source to start copying
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Truncate(nsStr& aDest,PRUint32 aDestOffset);
/**
* This method is used to perform a case conversion on the given string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be case shifted
* @param toUpper tells us to go upper vs. lower
*/
static void ChangeCase(nsStr& aDest,PRBool aToUpper);
/**
* This method trims chars (given in aSet) from the edges of given buffer
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to remove from given buffer
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void Trim(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing);
/**
* This method compresses duplicate runs of a given char from the given buffer
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to compress from given buffer
* @param aChar is the replacement char
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void CompressSet(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing);
/**
* This method removes all occurances of chars in given set from aDest
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to compress from given buffer
* @param aChar is the replacement char
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void StripChars(nsStr& aDest,const char* aSet);
/**
* This method compares the data bewteen two nsStr's
*
* @update gess 01/04/99
* @param aStr1 is the first buffer to be compared
* @param aStr2 is the 2nd buffer to be compared
* @param aCount is the number of chars to compare
* @param aIgnorecase tells us whether to use a case-sensitive comparison
* @return -1,0,1 depending on <,==,>
*/
static PRInt32 Compare(const nsStr& aDest,const nsStr& aSource,PRInt32 aCount,PRBool aIgnoreCase);
/**
* These methods scan the given string for 1 or more chars in a given direction
*
* @update gess 01/04/99
* @param aDest is the nsStr to be searched to
* @param aSource (or aChar) is the substr we're looking to find
* @param aIgnoreCase tells us whether to search in a case-sensitive manner
* @param anOffset tells us where in the dest string to start searching
* @return the index of the source (substr) in dest, or -1 (kNotFound) if not found.
*/
static PRInt32 FindSubstr(const nsStr& aDest,const nsStr& aSource, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 FindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindSubstr(const nsStr& aDest,const nsStr& aSource, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset);
PRUint32 mLength;
PRUint32 mCapacity;
eCharSize mCharSize;
PRBool mOwnsBuffer;
union {
char* mStr;
PRUnichar* mUStr;
};
private:
static PRBool Alloc(nsStr& aString,PRUint32 aCount);
static PRBool Realloc(nsStr& aString,PRUint32 aCount);
static PRBool Free(nsStr& aString);
};
/**************************************************************
A couple of tiny helper methods used in the string classes.
**************************************************************/
inline PRInt32 MinInt(PRInt32 anInt1,PRInt32 anInt2){
return (anInt1<anInt2) ? anInt1 : anInt2;
}
inline PRInt32 MaxInt(PRInt32 anInt1,PRInt32 anInt2){
return (anInt1<anInt2) ? anInt2 : anInt1;
}
inline void AddNullTerminator(nsStr& aDest) {
if(eTwoByte==aDest.mCharSize)
aDest.mUStr[aDest.mLength]=0;
else aDest.mStr[aDest.mLength]=0;
}
/**
* Return the given buffer to the heap manager. Calls allocator::Free()
* @return string length
*/
inline void Recycle( char* aBuffer) { nsAllocator::Free(aBuffer); }
inline void Recycle( PRUnichar* aBuffer) { nsAllocator::Free(aBuffer); }
/**
* This method is used to access a given char in the given string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param anIndex tells us where in dest to get the char from
* @return the given char, or 0 if anIndex is out of range
*/
inline PRUnichar GetCharAt(const nsStr& aDest,PRUint32 anIndex){
if(anIndex<aDest.mLength) {
return (eTwoByte==aDest.mCharSize) ? aDest.mUStr[anIndex] : aDest.mStr[anIndex];
}//if
return 0;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,747 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
See nsStr.h for a more general description of string classes.
This version of the nsString class offers many improvements over the
original version:
1. Wide and narrow chars
2. Allocators
3. Much smarter autostrings
4. Subsumable strings
***********************************************************************/
#ifndef _nsCString_
#define _nsCString_
#include "nsString2.h"
#include "prtypes.h"
#include "nscore.h"
#include <stdio.h>
#include "nsStr.h"
#include "nsIAtom.h"
class NS_COM nsSubsumeCStr;
class NS_COM nsCString : public nsStr {
public:
/**
* Default constructor.
*/
nsCString();
/**
* This constructor accepts an isolatin string
* @param aCString is a ptr to a 1-byte cstr
*/
nsCString(const char* aCString,PRInt32 aLength=-1);
/**
* This constructor accepts a unichar string
* @param aCString is a ptr to a 2-byte cstr
*/
nsCString(const PRUnichar* aString,PRInt32 aLength=-1);
/**
* This is a copy constructor that accepts an nsStr
* @param reference to another nsCString
*/
nsCString(const nsStr&);
/**
* This is our copy constructor
* @param reference to another nsCString
*/
nsCString(const nsCString& aString);
/**
* This constructor takes a subsumestr
* @param reference to subsumestr
*/
nsCString(nsSubsumeCStr& aSubsumeStr);
/**
* Destructor
*
*/
virtual ~nsCString();
/**
* Retrieve the length of this string
* @return string length
*/
inline PRInt32 Length() const { return (PRInt32)mLength; }
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
/**
* Call this method if you want to force a different string capacity
* @update gess7/30/98
* @param aLength -- contains new length for mStr
* @return
*/
void SetLength(PRUint32 aLength) {
Truncate(aLength);
}
/**
* Sets the new length of the string.
* @param aLength is new string length.
* @return nada
*/
void SetCapacity(PRUint32 aLength);
/**
* This method truncates this string to given length.
*
* @param anIndex -- new length of string
* @return nada
*/
void Truncate(PRInt32 anIndex=0);
/**
* Determine whether or not the characters in this
* string are in sorted order.
*
* @return TRUE if ordered.
*/
PRBool IsOrdered(void) const;
/**
* Determine whether or not this string has a length of 0
*
* @return TRUE if empty.
*/
PRBool IsEmpty(void) const {
return PRBool(0==mLength);
}
/**********************************************************************
Accessor methods...
*********************************************************************/
/**
* Retrieve const ptr to internal buffer; DO NOT TRY TO FREE IT!
*/
const char* GetBuffer(void) const;
/**
* Get nth character.
*/
PRUnichar operator[](PRUint32 anIndex) const;
PRUnichar CharAt(PRUint32 anIndex) const;
PRUnichar First(void) const;
PRUnichar Last(void) const;
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
/**********************************************************************
String creation methods...
*********************************************************************/
/**
* Create a new string by appending given string to this
* @param aString -- 2nd string to be appended
* @return new string
*/
nsSubsumeCStr operator+(const nsCString& aString);
/**
* create a new string by adding this to the given char*.
* @param aCString is a ptr to cstring to be added to this
* @return newly created string
*/
nsSubsumeCStr operator+(const char* aCString);
/**
* create a new string by adding this to the given char.
* @param aChar is a char to be added to this
* @return newly created string
*/
nsSubsumeCStr operator+(PRUnichar aChar);
nsSubsumeCStr operator+(char aChar);
/**********************************************************************
Lexomorphic transforms...
*********************************************************************/
/**
* Converts chars in this to lowercase
* @update gess 7/27/98
*/
void ToLowerCase();
/**
* Converts chars in this to lowercase, and
* stores them in aOut
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToLowerCase(nsCString& aString) const;
/**
* Converts chars in this to uppercase
* @update gess 7/27/98
*/
void ToUpperCase();
/**
* Converts chars in this to lowercase, and
* stores them in a given output string
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToUpperCase(nsCString& aString) const;
/**
* This method is used to remove all occurances of the
* characters found in aSet from this string.
*
* @param aSet -- characters to be cut from this
* @return *this
*/
nsCString& StripChars(const char* aSet);
nsCString& StripChar(char aChar);
/**
* This method strips whitespace throughout the string
*
* @return this
*/
nsCString& StripWhitespace();
/**
* swaps occurence of 1 string for another
*
* @return this
*/
nsCString& ReplaceChar(PRUnichar aOldChar,PRUnichar aNewChar);
nsCString& ReplaceChar(const char* aSet,PRUnichar aNewChar);
PRInt32 CountChar(PRUnichar aChar);
/**
* This method trims characters found in aTrimSet from
* either end of the underlying string.
*
* @param aTrimSet -- contains chars to be trimmed from
* both ends
* @return this
*/
nsCString& Trim(const char* aSet,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsCString& CompressSet(const char* aSet, PRUnichar aChar,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsCString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**********************************************************************
string conversion methods...
*********************************************************************/
operator char*() {return mStr;}
operator const char*() const {return (const char*)mStr;}
/**
* This method constructs a new nsCString that is a clone
* of this string.
*
*/
nsCString* ToNewString() const;
/**
* Creates an ISOLatin1 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewCString() const;
/**
* Creates a unicode clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new unicode string
*/
PRUnichar* ToNewUnicode() const;
/**
* Copies data from internal buffer onto given char* buffer
* NOTE: This only copies as many chars as will fit in given buffer (clips)
* @param aBuf is the buffer where data is stored
* @param aBuflength is the max # of chars to move to buffer
* @return ptr to given buffer
*/
char* ToCString(char* aBuf,PRUint32 aBufLength,PRUint32 anOffset=0) const;
/**
* Perform string to float conversion.
* @param aErrorCode will contain error if one occurs
* @return float rep of string value
*/
float ToFloat(PRInt32* aErrorCode) const;
/**
* Try to derive the radix from the value contained in this string
* @return kRadix10, kRadix16 or kAutoDetect (meaning unknown)
*/
PRUint32 DetermineRadix(void);
/**
* Perform string to int conversion.
* @param aErrorCode will contain error if one occurs
* @return int rep of string value
*/
PRInt32 ToInteger(PRInt32* aErrorCode,PRUint32 aRadix=kRadix10) const;
/**********************************************************************
String manipulation methods...
*********************************************************************/
/**
* Functionally equivalent to assign or operator=
*
*/
nsCString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsCString& SetString(const nsStr& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
/**
* assign given string to this string
* @param aStr: buffer to be assigned to this
* @param alength is the length of the given str (or -1)
if you want me to determine its length
* @return this
*/
nsCString& Assign(const nsStr& aString,PRInt32 aCount=-1);
nsCString& Assign(const char* aString,PRInt32 aCount=-1);
nsCString& Assign(const PRUnichar* aString,PRInt32 aCount=-1);
nsCString& Assign(PRUnichar aChar);
nsCString& Assign(char aChar);
/**
* here come a bunch of assignment operators...
* @param aString: string to be added to this
* @return this
*/
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsCString& operator=(char aChar) {return Assign(aChar);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
nsCString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsCString& operator=(const nsSubsumeCStr& aSubsumeString); // AIX requires a const here
#else
nsCString& operator=(nsSubsumeCStr& aSubsumeString);
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsCString& operator+=(const nsCString& aString){return Append(aString,aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
nsCString& operator+=(PRUnichar aChar){return Append(aChar);}
nsCString& operator+=(char aChar){return Append(aChar);}
/*
* Appends n characters from given string to this,
* This version computes the length of your given string
*
* @param aString is the source to be appended to this
* @return number of chars copied
*/
nsCString& Append(const nsCString& aString) {return Append(aString,aString.mLength);}
/*
* Appends n characters from given string to this,
*
* @param aString is the source to be appended to this
* @param aCount -- number of chars to copy; -1 tells us to compute the strlen for you
* @return number of chars copied
*/
nsCString& Append(const nsCString& aString,PRInt32 aCount);
nsCString& Append(const nsStr& aString,PRInt32 aCount=-1);
nsCString& Append(const char* aString,PRInt32 aCount=-1);
nsCString& Append(PRUnichar aChar);
nsCString& Append(char aChar);
nsCString& Append(PRInt32 aInteger,PRInt32 aRadix=10); //radix=8,10 or 16
nsCString& Append(float aFloat);
/*
* Copies n characters from this string to given string,
* starting at the leftmost offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Left(nsCString& aCopy,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at the given offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @param anOffset -- position where copying begins
* @return number of chars copied
*/
PRUint32 Mid(nsCString& aCopy,PRUint32 anOffset,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at rightmost char.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Right(nsCString& aCopy,PRInt32 aCount) const;
/*
* This method inserts n chars from given string into this
* string at str[anOffset].
*
* @param aCopy -- String to be inserted into this
* @param anOffset -- insertion position within this str
* @param aCount -- number of chars to be copied from aCopy
* @return number of chars inserted into this.
*/
nsCString& Insert(const nsCString& aCopy,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a given string into this string at
* a specified offset.
*
* @param aString* to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsCString& Insert(const char* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a single char into this string at
* a specified offset.
*
* @param character to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsCString& Insert(PRUnichar aChar,PRUint32 anOffset);
nsCString& Insert(char aChar,PRUint32 anOffset);
/*
* This method is used to cut characters in this string
* starting at anOffset, continuing for aCount chars.
*
* @param anOffset -- start pos for cut operation
* @param aCount -- number of chars to be cut
* @return *this
*/
nsCString& Cut(PRUint32 anOffset,PRInt32 aCount);
/**********************************************************************
Searching methods...
*********************************************************************/
/**
* Search for given character within this string.
* This method does so by using a binary search,
* so your string HAD BETTER BE ORDERED!
*
* @param aChar is the unicode char to be found
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
*
* @param aString is substring to be sought in this
* @param aIgnoreCase selects case sensitivity
* @param anOffset tells us where in this strig to start searching
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 Find(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the first character
* found in the given charset
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 FindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**
* This methods scans the string backwards, looking for the given string
* @param aString is substring to be sought in this
* @param aIgnoreCase tells us whether or not to do caseless compare
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the last character
* found in the given string
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**********************************************************************
Comparison methods...
*********************************************************************/
/**
* Compares a given string type to this string.
* @update gess 7/27/98
* @param S is the string to be compared
* @param aIgnoreCase tells us how to treat case
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
virtual PRInt32 Compare(const nsStr &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
/**
* These methods compare a given string type to this one
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator==(const nsStr &aString) const;
PRBool operator==(const char* aString) const;
PRBool operator==(const PRUnichar* aString) const;
/**
* These methods perform a !compare of a given string type to this
* @param aString is the string to be compared to this
* @return TRUE
*/
PRBool operator!=(const nsStr &aString) const;
PRBool operator!=(const char* aString) const;
PRBool operator!=(const PRUnichar* aString) const;
/**
* These methods test if a given string is < than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<(const nsStr &aString) const;
PRBool operator<(const char* aString) const;
PRBool operator<(const PRUnichar* aString) const;
/**
* These methods test if a given string is > than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>(const nsStr &S) const;
PRBool operator>(const char* aString) const;
PRBool operator>(const PRUnichar* aString) const;
/**
* These methods test if a given string is <= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<=(const nsStr &S) const;
PRBool operator<=(const char* aString) const;
PRBool operator<=(const PRUnichar* aString) const;
/**
* These methods test if a given string is >= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>=(const nsStr &S) const;
PRBool operator>=(const char* aString) const;
PRBool operator>=(const PRUnichar* aString) const;
/**
* Compare this to given string; note that we compare full strings here.
* The optional length argument just lets us know how long the given string is.
* If you provide a length, it is compared to length of this string as an
* optimization.
*
* @param aString -- the string to compare to this
* @param aCount -- number of chars in given string you want to compare
* @return TRUE if equal
*/
PRBool Equals(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(const nsStr& aString) const;
PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(const PRUnichar* aString,PRInt32 aCount=-1) const;
static void Recycle(nsCString* aString);
static nsCString* CreateString(void);
};
extern NS_COM int fputs(const nsCString& aString, FILE* out);
//ostream& operator<<(ostream& aStream,const nsCString& aString);
//virtual void DebugDump(ostream& aStream) const;
/**************************************************************
Here comes the AutoString class which uses internal memory
(typically found on the stack) for its default buffer.
If the buffer needs to grow, it gets reallocated on the heap.
**************************************************************/
class NS_COM nsCAutoString : public nsCString {
public:
nsCAutoString();
nsCAutoString(const char* aString,PRInt32 aLength=-1);
nsCAutoString(const CBufDescriptor& aBuffer);
nsCAutoString(const PRUnichar* aString,PRInt32 aLength=-1);
nsCAutoString(const nsStr& aString);
nsCAutoString(const nsCAutoString& aString);
#ifdef AIX
nsCAutoString(const nsSubsumeCStr& aSubsumeStr); // AIX requires a const
#else
nsCAutoString(nsSubsumeCStr& aSubsumeStr);
#endif // AIX
nsCAutoString(PRUnichar aChar);
virtual ~nsCAutoString();
nsCAutoString& operator=(const nsCString& aString) {nsCString::Assign(aString); return *this;}
nsCAutoString& operator=(const char* aCString) {nsCString::Assign(aCString); return *this;}
nsCAutoString& operator=(PRUnichar aChar) {nsCString::Assign(aChar); return *this;}
nsCAutoString& operator=(char aChar) {nsCString::Assign(aChar); return *this;}
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
char mBuffer[kDefaultStringSize];
};
/***************************************************************
The subsumestr class is very unusual.
It differs from a normal string in that it doesn't use normal
copy semantics when another string is assign to this.
Instead, it "steals" the contents of the source string.
This is very handy for returning nsString classes as part of
an operator+(...) for example, in that it cuts down the number
of copy operations that must occur.
You should probably not use this class unless you really know
what you're doing.
***************************************************************/
class NS_COM nsSubsumeCStr : public nsCString {
public:
nsSubsumeCStr(nsStr& aString);
nsSubsumeCStr(PRUnichar* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
nsSubsumeCStr(char* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,840 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
See nsStr.h for a more general description of string classes.
This version of the nsString class offers many improvements over the
original version:
1. Wide and narrow chars
2. Allocators
3. Much smarter autostrings
4. Subsumable strings
***********************************************************************/
#ifndef _nsString_
#define _nsString_
#include "prtypes.h"
#include "nscore.h"
#include <stdio.h>
#include "nsString.h"
#include "nsIAtom.h"
#include "nsStr.h"
#include "nsCRT.h"
class nsISizeOfHandler;
#define nsString2 nsString
#define nsAutoString2 nsAutoString
class NS_COM nsSubsumeStr;
class NS_COM nsString : public nsStr {
public:
/**
* Default constructor.
*/
nsString();
/**
* This constructor accepts an isolatin string
* @param aCString is a ptr to a 1-byte cstr
*/
nsString(const char* aCString);
/**
* This constructor accepts a unichar string
* @param aCString is a ptr to a 2-byte cstr
*/
nsString(const PRUnichar* aString);
/**
* This is a copy constructor that accepts an nsStr
* @param reference to another nsString
*/
nsString(const nsStr&);
/**
* This is our copy constructor
* @param reference to another nsString
*/
nsString(const nsString& aString);
/**
* This constructor takes a subsumestr
* @param reference to subsumestr
*/
nsString(nsSubsumeStr& aSubsumeStr);
/**
* Destructor
*
*/
virtual ~nsString();
/**
* Retrieve the length of this string
* @return string length
*/
inline PRInt32 Length() const { return (PRInt32)mLength; }
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
/**
* Call this method if you want to force a different string length
* @update gess7/30/98
* @param aLength -- contains new length for mStr
* @return
*/
void SetLength(PRUint32 aLength) {
Truncate(aLength);
}
/**
* Sets the new length of the string.
* @param aLength is new string length.
* @return nada
*/
void SetCapacity(PRUint32 aLength);
/**
* This method truncates this string to given length.
*
* @param anIndex -- new length of string
* @return nada
*/
void Truncate(PRInt32 anIndex=0);
/**
* Determine whether or not the characters in this
* string are in sorted order.
*
* @return TRUE if ordered.
*/
PRBool IsOrdered(void) const;
/**
* Determine whether or not the characters in this
* string are in store as 1 or 2 byte (unicode) strings.
*
* @return TRUE if ordered.
*/
PRBool IsUnicode(void) const {
PRBool result=PRBool(mCharSize==eTwoByte);
return result;
}
/**
* Determine whether or not this string has a length of 0
*
* @return TRUE if empty.
*/
PRBool IsEmpty(void) const {
return PRBool(0==mLength);
}
/**********************************************************************
Getters/Setters...
*********************************************************************/
/**
* Retrieve const ptr to internal buffer; DO NOT TRY TO FREE IT!
*/
const char* GetBuffer(void) const;
const PRUnichar* GetUnicode(void) const;
/**
* Get nth character.
*/
PRUnichar operator[](PRUint32 anIndex) const;
PRUnichar CharAt(PRUint32 anIndex) const;
PRUnichar First(void) const;
PRUnichar Last(void) const;
/**
* Set nth character.
*/
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
/**********************************************************************
String concatenation methods...
*********************************************************************/
/**
* Create a new string by appending given string to this
* @param aString -- 2nd string to be appended
* @return new subsumable string
*/
nsSubsumeStr operator+(const nsStr& aString);
nsSubsumeStr operator+(const nsString& aString);
/**
* create a new string by adding this to the given cstring
* @param aCString is a ptr to cstring to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(const char* aCString);
/**
* create a new string by adding this to the given prunichar*.
* @param aString is a ptr to UC-string to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(const PRUnichar* aString);
/**
* create a new string by adding this to the given char.
* @param aChar is a char to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(char aChar);
/**
* create a new string by adding this to the given char.
* @param aChar is a unichar to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(PRUnichar aChar);
/**********************************************************************
Lexomorphic transforms...
*********************************************************************/
/**
* Converts chars in this to lowercase
* @update gess 7/27/98
*/
void ToLowerCase();
/**
* Converts chars in this to lowercase, and
* stores them in aOut
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToLowerCase(nsString& aString) const;
/**
* Converts chars in this to uppercase
* @update gess 7/27/98
*/
void ToUpperCase();
/**
* Converts chars in this to lowercase, and
* stores them in a given output string
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToUpperCase(nsString& aString) const;
/**
* This method is used to remove all occurances of the
* characters found in aSet from this string.
*
* @param aSet -- characters to be cut from this
* @return *this
*/
nsString& StripChars(const char* aSet);
nsString& StripChar(char aChar);
/**
* This method strips whitespace throughout the string
*
* @return this
*/
nsString& StripWhitespace();
/**
* swaps occurence of 1 string for another
*
* @return this
*/
nsString& ReplaceChar(PRUnichar anOldChar,PRUnichar aNewChar);
nsString& ReplaceChar(const char* aSet,PRUnichar aNewChar);
PRInt32 CountChar(PRUnichar aChar);
/**
* This method trims characters found in aTrimSet from
* either end of the underlying string.
*
* @param aTrimSet -- contains chars to be trimmed from
* both ends
* @return this
*/
nsString& Trim(const char* aSet,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsString& CompressSet(const char* aSet, PRUnichar aChar,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**********************************************************************
string conversion methods...
*********************************************************************/
/**
* This method constructs a new nsString is a clone of this string.
*
*/
nsString* ToNewString() const;
/**
* Creates an ISOLatin1 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewCString() const;
/**
* Creates an UTF8 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewUTF8String() const;
/**
* Creates a unicode clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new unicode string
*/
PRUnichar* ToNewUnicode() const;
/**
* Copies data from internal buffer onto given char* buffer
* NOTE: This only copies as many chars as will fit in given buffer (clips)
* @param aBuf is the buffer where data is stored
* @param aBuflength is the max # of chars to move to buffer
* @return ptr to given buffer
*/
char* ToCString(char* aBuf,PRUint32 aBufLength,PRUint32 anOffset=0) const;
/**
* Perform string to float conversion.
* @param aErrorCode will contain error if one occurs
* @return float rep of string value
*/
float ToFloat(PRInt32* aErrorCode) const;
/**
* Try to derive the radix from the value contained in this string
* @return kRadix10, kRadix16 or kAutoDetect (meaning unknown)
*/
PRUint32 DetermineRadix(void);
/**
* Perform string to int conversion.
* @param aErrorCode will contain error if one occurs
* @return int rep of string value
*/
PRInt32 ToInteger(PRInt32* aErrorCode,PRUint32 aRadix=kRadix10) const;
/**********************************************************************
String manipulation methods...
*********************************************************************/
/**
* Functionally equivalent to assign or operator=
*
*/
nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
/**
* assign given string to this string
* @param aStr: buffer to be assigned to this
* @param alength is the length of the given str (or -1)
if you want me to determine its length
* @return this
*/
nsString& Assign(const nsStr& aString,PRInt32 aCount=-1);
nsString& Assign(const char* aString,PRInt32 aCount=-1);
nsString& Assign(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Assign(char aChar);
nsString& Assign(PRUnichar aChar);
/**
* here come a bunch of assignment operators...
* @param aString: string to be added to this
* @return this
*/
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(char aChar) {return Assign(aChar);}
nsString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsString& operator=(const char* aCString) {return Assign(aCString);}
nsString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsString& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here
#else
nsString& operator=(nsSubsumeStr& aSubsumeString);
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsString& operator+=(const nsStr& aString){return Append(aString,aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,aString.mLength);}
nsString& operator+=(const char* aCString) {return Append(aCString);}
//nsString& operator+=(char aChar){return Append(aChar);}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
nsString& operator+=(PRUnichar aChar){return Append(aChar);}
/*
* Appends n characters from given string to this,
* This version computes the length of your given string
*
* @param aString is the source to be appended to this
* @return number of chars copied
*/
nsString& Append(const nsStr& aString) {return Append(aString,aString.mLength);}
nsString& Append(const nsString& aString) {return Append(aString,aString.mLength);}
/*
* Appends n characters from given string to this,
*
* @param aString is the source to be appended to this
* @param aCount -- number of chars to copy; -1 tells us to compute the strlen for you
* @return number of chars copied
*/
nsString& Append(const nsStr& aString,PRInt32 aCount);
nsString& Append(const nsString& aString,PRInt32 aCount);
nsString& Append(const char* aString,PRInt32 aCount=-1);
nsString& Append(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Append(char aChar);
nsString& Append(PRUnichar aChar);
nsString& Append(PRInt32 aInteger,PRInt32 aRadix=10); //radix=8,10 or 16
nsString& Append(float aFloat);
/*
* Copies n characters from this string to given string,
* starting at the leftmost offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Left(nsString& aCopy,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at the given offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @param anOffset -- position where copying begins
* @return number of chars copied
*/
PRUint32 Mid(nsString& aCopy,PRUint32 anOffset,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at rightmost char.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Right(nsString& aCopy,PRInt32 aCount) const;
/*
* This method inserts n chars from given string into this
* string at str[anOffset].
*
* @param aCopy -- String to be inserted into this
* @param anOffset -- insertion position within this str
* @param aCount -- number of chars to be copied from aCopy
* @return number of chars inserted into this.
*/
nsString& Insert(const nsString& aCopy,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a given string into this string at
* a specified offset.
*
* @param aString* to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsString& Insert(const char* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
nsString& Insert(const PRUnichar* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a single char into this string at
* a specified offset.
*
* @param character to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
//nsString& Insert(char aChar,PRUint32 anOffset);
nsString& Insert(PRUnichar aChar,PRUint32 anOffset);
/*
* This method is used to cut characters in this string
* starting at anOffset, continuing for aCount chars.
*
* @param anOffset -- start pos for cut operation
* @param aCount -- number of chars to be cut
* @return *this
*/
nsString& Cut(PRUint32 anOffset,PRInt32 aCount);
/**********************************************************************
Searching methods...
*********************************************************************/
/**
* Search for given character within this string.
* This method does so by using a binary search,
* so your string HAD BETTER BE ORDERED!
*
* @param aChar is the unicode char to be found
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
*
* @param aString is substring to be sought in this
* @param aIgnoreCase selects case sensitivity
* @param anOffset tells us where in this strig to start searching
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 Find(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
//PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const;
PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the first character
* found in the given charset
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 FindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**
* This methods scans the string backwards, looking for the given string
* @param aString is substring to be sought in this
* @param aIgnoreCase tells us whether or not to do caseless compare
* @param anOffset tells us where in this strig to start searching (counting from left)
*/
PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching (counting from left)
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
//PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const;
PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the last character
* found in the given string
* @param aString contains set of chars to be found
* @param anOffset tells us where in this strig to start searching (counting from left)
* @return -1 if not found, else the offset in this
*/
PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**********************************************************************
Comparison methods...
*********************************************************************/
/**
* Compares a given string type to this string.
* @update gess 7/27/98
* @param S is the string to be compared
* @param aIgnoreCase tells us how to treat case
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
virtual PRInt32 Compare(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const nsStr &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
/**
* These methods compare a given string type to this one
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator==(const nsString &aString) const;
PRBool operator==(const nsStr &aString) const;
PRBool operator==(const char *aString) const;
PRBool operator==(const PRUnichar* aString) const;
/**
* These methods perform a !compare of a given string type to this
* @param aString is the string to be compared to this
* @return TRUE
*/
PRBool operator!=(const nsString &aString) const;
PRBool operator!=(const nsStr &aString) const;
PRBool operator!=(const char* aString) const;
PRBool operator!=(const PRUnichar* aString) const;
/**
* These methods test if a given string is < than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<(const nsString &aString) const;
PRBool operator<(const nsStr &aString) const;
PRBool operator<(const char* aString) const;
PRBool operator<(const PRUnichar* aString) const;
/**
* These methods test if a given string is > than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>(const nsString &aString) const;
PRBool operator>(const nsStr &S) const;
PRBool operator>(const char* aString) const;
PRBool operator>(const PRUnichar* aString) const;
/**
* These methods test if a given string is <= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<=(const nsString &aString) const;
PRBool operator<=(const nsStr &S) const;
PRBool operator<=(const char* aString) const;
PRBool operator<=(const PRUnichar* aString) const;
/**
* These methods test if a given string is >= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>=(const nsString &aString) const;
PRBool operator>=(const nsStr &S) const;
PRBool operator>=(const char* aString) const;
PRBool operator>=(const PRUnichar* aString) const;
/**
* Compare this to given string; note that we compare full strings here.
* The optional length argument just lets us know how long the given string is.
* If you provide a length, it is compared to length of this string as an
* optimization.
*
* @param aString -- the string to compare to this
* @param aCount -- number of chars to be compared.
* @return TRUE if equal
*/
PRBool Equals(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const;
PRBool Equals(const PRUnichar* s1, const PRUnichar* s2,PRBool aIgnoreCase=PR_FALSE) const;
PRBool EqualsIgnoreCase(const nsString& aString) const;
PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(/*FIX: const */nsIAtom *aAtom) const;
PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const;
/**
* Determine if given buffer is plain ascii
*
* @param aBuffer -- if null, then we test *this, otherwise we test given buffer
* @return TRUE if is all ascii chars or if strlen==0
*/
PRBool IsASCII(const PRUnichar* aBuffer=0);
/**
* Determine if given char is a valid space character
*
* @param aChar is character to be tested
* @return TRUE if is valid space char
*/
static PRBool IsSpace(PRUnichar ch);
/**
* Determine if given char in valid alpha range
*
* @param aChar is character to be tested
* @return TRUE if in alpha range
*/
static PRBool IsAlpha(PRUnichar ch);
/**
* Determine if given char is valid digit
*
* @param aChar is character to be tested
* @return TRUE if char is a valid digit
*/
static PRBool IsDigit(PRUnichar ch);
static void Recycle(nsString* aString);
static nsString* CreateString(void);
};
extern NS_COM int fputs(const nsString& aString, FILE* out);
//ostream& operator<<(ostream& aStream,const nsString& aString);
//virtual void DebugDump(ostream& aStream) const;
/**************************************************************
Here comes the AutoString class which uses internal memory
(typically found on the stack) for its default buffer.
If the buffer needs to grow, it gets reallocated on the heap.
**************************************************************/
class NS_COM nsAutoString : public nsString {
public:
nsAutoString();
nsAutoString(const char* aCString,PRInt32 aLength=-1);
nsAutoString(const PRUnichar* aString,PRInt32 aLength=-1);
nsAutoString(const CBufDescriptor& aBuffer);
nsAutoString(const nsStr& aString);
nsAutoString(const nsAutoString& aString);
#ifdef AIX
nsAutoString(const nsSubsumeStr& aSubsumeStr); // AIX requires a const
#else
nsAutoString(nsSubsumeStr& aSubsumeStr);
#endif // AIX
nsAutoString(PRUnichar aChar);
virtual ~nsAutoString();
nsAutoString& operator=(const nsStr& aString) {nsString::Assign(aString); return *this;}
nsAutoString& operator=(const nsAutoString& aString) {nsString::Assign(aString); return *this;}
nsAutoString& operator=(const char* aCString) {nsString::Assign(aCString); return *this;}
nsAutoString& operator=(char aChar) {nsString::Assign(aChar); return *this;}
nsAutoString& operator=(const PRUnichar* aBuffer) {nsString::Assign(aBuffer); return *this;}
nsAutoString& operator=(PRUnichar aChar) {nsString::Assign(aChar); return *this;}
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
char mBuffer[kDefaultStringSize<<eTwoByte];
};
/***************************************************************
The subsumestr class is very unusual.
It differs from a normal string in that it doesn't use normal
copy semantics when another string is assign to this.
Instead, it "steals" the contents of the source string.
This is very handy for returning nsString classes as part of
an operator+(...) for example, in that it cuts down the number
of copy operations that must occur.
You should probably not use this class unless you really know
what you're doing.
***************************************************************/
class NS_COM nsSubsumeStr : public nsString {
public:
nsSubsumeStr(nsStr& aString);
nsSubsumeStr(PRUnichar* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
nsSubsumeStr(char* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
};
#endif

View File

@@ -1,179 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsDebug.h"
#include "nsIAllocator.h"
#include "nsXPIDLString.h"
#include "plstr.h"
// If the allocator changes, fix it here.
#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsAllocator::Alloc((__len) * sizeof(PRUnichar)))
#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsAllocator::Alloc((__len) * sizeof(char)))
#define XPIDL_FREE(__ptr) (nsAllocator::Free(__ptr))
////////////////////////////////////////////////////////////////////////
// nsXPIDLString
nsXPIDLString::nsXPIDLString()
: mBuf(0),
mBufOwner(PR_FALSE)
{
}
nsXPIDLString::~nsXPIDLString()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
}
nsXPIDLString::operator const PRUnichar*()
{
return mBuf;
}
PRUnichar*
nsXPIDLString::Copy(const PRUnichar* aString)
{
NS_ASSERTION(aString, "null ptr");
if (! aString)
return 0;
PRInt32 len = 0;
{
const PRUnichar* p = aString;
while (*p++)
len++;
}
PRUnichar* result = XPIDL_STRING_ALLOC(len + 1);
if (result) {
PRUnichar* q = result;
while (*aString) {
*q = *aString;
q++;
aString++;
}
*q = '\0';
}
return result;
}
PRUnichar**
nsXPIDLString::StartAssignmentByValue()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_TRUE;
return &mBuf;
}
const PRUnichar**
nsXPIDLString::StartAssignmentByReference()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_FALSE;
return (const PRUnichar**) &mBuf;
}
////////////////////////////////////////////////////////////////////////
// nsXPIDLCString
nsXPIDLCString::nsXPIDLCString()
: mBuf(0),
mBufOwner(PR_FALSE)
{
}
nsXPIDLCString::~nsXPIDLCString()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
}
nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString)
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = Copy(aCString);
mBufOwner = PR_TRUE;
return *this;
}
nsXPIDLCString::operator const char*()
{
return mBuf;
}
char*
nsXPIDLCString::Copy(const char* aCString)
{
NS_ASSERTION(aCString, "null ptr");
if (! aCString)
return 0;
PRInt32 len = PL_strlen(aCString);
char* result = XPIDL_CSTRING_ALLOC(len + 1);
if (result)
PL_strcpy(result, aCString);
return result;
}
char**
nsXPIDLCString::StartAssignmentByValue()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_TRUE;
return &mBuf;
}
const char**
nsXPIDLCString::StartAssignmentByReference()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_FALSE;
return (const char**) &mBuf;
}

View File

@@ -1,302 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
A set of string wrapper classes that ease transition to use of XPIDL
interfaces. nsXPIDLString and nsXPIDLCString are to XPIDL `wstring'
and `string' out params as nsCOMPtr is to generic XPCOM interface
pointers. They help you deal with object ownership.
Consider the following interface:
interface nsIFoo {
attribute string Bar;
};
This will generate the following C++ header file:
class nsIFoo {
NS_IMETHOD SetBar(const PRUnichar* aValue);
NS_IMETHOD GetBar(PRUnichar* *aValue);
};
The GetBar() method will allocate a copy of the nsIFoo object's
"bar" attribute, and leave you to deal with freeing it:
nsIFoo* aFoo; // assume we get this somehow
PRUnichar* bar;
aFoo->GetFoo(&bar);
// Use bar here...
printf("bar is %s!\n", bar);
nsAllocator::Free(bar);
This makes your life harder, because you need to convolute your code
to ensure that you don't leak `bar'.
Enter nsXPIDLString, which manages the ownership of the allocated
string, and automatically destroys it when the nsXPIDLString goes
out of scope:
nsIFoo* aFoo;
nsXPIDLString bar;
aFoo->GetFoo( getter_Copies(bar) );
// Use bar here...
printf("bar is %s!\n", (const char*) bar);
// no need to remember to nsAllocator::Free().
Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it
painfully clear exactly what the code expects. You need to wrap an
nsXPIDLString object with either `getter_Copies()' or
`getter_Shares()' before passing it to a getter: these tell the
nsXPIDLString how ownership is being handled.
In the case of `getter_Copies()', the callee is allocating a copy
(which is usually the case). In the case of `getter_Shares()', the
callee is returning a const reference to `the real deal' (this can
be done using the [shared] attribute in XPIDL).
*/
#ifndef nsXPIDLString_h__
#define nsXPIDLString_h__
#include "nsCom.h"
#include "prtypes.h"
#ifndef __PRUNICHAR__
#define __PRUNICHAR__
typedef PRUint16 PRUnichar;
#endif /* __PRUNICHAR__ */
////////////////////////////////////////////////////////////////////////
// nsXPIDLString
//
// A wrapper for Unicode strings. With the |getter_Copies()| and
// |getter_Shares()| helper functions, this can be used instead of
// the "naked" |PRUnichar*| interface for |wstring| parameters in
// XPIDL interfaces.
//
class NS_COM nsXPIDLString {
private:
PRUnichar* mBuf;
PRBool mBufOwner;
PRUnichar** StartAssignmentByValue();
const PRUnichar** StartAssignmentByReference();
public:
/**
* Construct a new, uninitialized wrapper for a Unicode string.
*/
nsXPIDLString();
virtual ~nsXPIDLString();
/**
* Return a reference to the immutable Unicode string.
*/
operator const PRUnichar*();
/**
* Make a copy of the Unicode string. Use this function in the
* callee to ensure that the correct memory allocator is used.
*/
static PRUnichar* Copy(const PRUnichar* aString);
// A helper class for assignment-by-value. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterCopies {
private:
nsXPIDLString& mXPIDLString;
public:
GetterCopies(nsXPIDLString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator PRUnichar**() {
return mXPIDLString.StartAssignmentByValue();
}
friend GetterCopies getter_Copies(nsXPIDLString& aXPIDLString);
};
friend class GetterCopies;
// A helper class for assignment-by-reference. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterShares {
private:
nsXPIDLString& mXPIDLString;
public:
GetterShares(nsXPIDLString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator const PRUnichar**() {
return mXPIDLString.StartAssignmentByReference();
}
friend GetterShares getter_Shares(nsXPIDLString& aXPIDLString);
};
friend class GetterShares;
private:
// not to be implemented
nsXPIDLString(nsXPIDLString& /* aXPIDLString */) {}
nsXPIDLString& operator =(nsXPIDLString& /* aXPIDLString */) { return *this; }
};
/**
* Use this function to "wrap" the nsXPIDLString object that is to
* receive an |out| value.
*/
inline nsXPIDLString::GetterCopies
getter_Copies(nsXPIDLString& aXPIDLString)
{
return nsXPIDLString::GetterCopies(aXPIDLString);
}
/**
* Use this function to "wrap" the nsXPIDLString object that is to
* receive a |[shared] out| value.
*/
inline nsXPIDLString::GetterShares
getter_Shares(nsXPIDLString& aXPIDLString)
{
return nsXPIDLString::GetterShares(aXPIDLString);
}
////////////////////////////////////////////////////////////////////////
// nsXPIDLCString
//
// A wrapper for Unicode strings. With the |getter_Copies()| and
// |getter_Shares()| helper functions, this can be used instead of
// the "naked" |char*| interface for |string| parameters in XPIDL
// interfaces.
//
class NS_COM nsXPIDLCString {
private:
char* mBuf;
PRBool mBufOwner;
char** StartAssignmentByValue();
const char** StartAssignmentByReference();
public:
/**
* Construct a new, uninitialized wrapper for a single-byte string.
*/
nsXPIDLCString();
virtual ~nsXPIDLCString();
/**
* Assign a single-byte string to this wrapper. Copies and owns the result.
*/
nsXPIDLCString& operator =(const char* aString);
/**
* Return a reference to the immutable single-byte string.
*/
operator const char*();
/**
* Make a copy of the single-byte string. Use this function in the
* callee to ensure that the correct memory allocator is used.
*/
static char* Copy(const char* aString);
// A helper class for assignment-by-value. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterCopies {
private:
nsXPIDLCString& mXPIDLString;
public:
GetterCopies(nsXPIDLCString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator char**() {
return mXPIDLString.StartAssignmentByValue();
}
friend GetterCopies getter_Copies(nsXPIDLCString& aXPIDLString);
};
friend class GetterCopies;
// A helper class for assignment-by-reference. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterShares {
private:
nsXPIDLCString& mXPIDLString;
public:
GetterShares(nsXPIDLCString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator const char**() {
return mXPIDLString.StartAssignmentByReference();
}
friend GetterShares getter_Shares(nsXPIDLCString& aXPIDLString);
};
friend class GetterShares;
private:
// not to be implemented
nsXPIDLCString(nsXPIDLCString& /* aXPIDLString */) {}
nsXPIDLCString& operator =(nsXPIDLCString& /* aXPIDLCString */) { return *this; }
};
/**
* Use this function to "wrap" the nsXPIDLCString object that is to
* receive an |out| value.
*/
inline nsXPIDLCString::GetterCopies
getter_Copies(nsXPIDLCString& aXPIDLString)
{
return nsXPIDLCString::GetterCopies(aXPIDLString);
}
/**
* Use this function to "wrap" the nsXPIDLCString object that is to
* receive a |[shared] out| value.
*/
inline nsXPIDLCString::GetterShares
getter_Shares(nsXPIDLCString& aXPIDLString)
{
return nsXPIDLCString::GetterShares(aXPIDLString);
}
#endif // nsXPIDLString_h__

View File

@@ -1,30 +0,0 @@
nsAVLTree.h
nsCppSharedAllocator.h
nsCRT.h
nsDeque.h
nsEnumeratorUtils.h
nsHashtable.h
nsHashtableEnumerator.h
nsIArena.h
nsIBuffer.h
nsIByteBuffer.h
nsIObserverList.h
nsIPageManager.h
nsIProperties.h
nsISimpleEnumerator.h
nsISizeOfHandler.h
nsIUnicharBuffer.h
nsIVariant.h
nsInt64.h
nsQuickSort.h
nsStr.h
nsString.h
nsString2.h
nsSupportsPrimitives.h
nsTime.h
nsUnitConversion.h
nsVector.h
nsVoidArray.h
nsXPIDLString.h
plvector.h
nsTextFormater.h

View File

@@ -1,6 +0,0 @@
nsIAtom.idl
nsICollection.idl
nsIEnumerator.idl
nsIObserver.idl
nsIObserverService.idl
nsISupportsArray.idl

View File

@@ -1,113 +0,0 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = xpcom
XPIDL_MODULE = xpcom_ds
LIBRARY_NAME = xpcomds_s
REQUIRES = xpcom uconv unicharutil
CPPSRCS = \
nsArena.cpp \
nsAtomTable.cpp \
nsAVLTree.cpp \
nsByteBuffer.cpp \
nsCRT.cpp \
nsConjoiningEnumerator.cpp \
nsDeque.cpp \
nsEmptyEnumerator.cpp \
nsEnumeratorUtils.cpp \
nsHashtable.cpp \
nsHashtableEnumerator.cpp \
nsObserver.cpp \
nsObserverList.cpp \
nsObserverService.cpp \
nsProperties.cpp \
nsQuickSort.cpp \
nsSizeOfHandler.cpp \
nsStr.cpp \
nsString.cpp \
nsString2.cpp \
nsSupportsArray.cpp \
nsSupportsArrayEnumerator.cpp \
nsSupportsPrimitives.cpp \
nsUnicharBuffer.cpp \
nsVariant.cpp \
nsVoidArray.cpp \
nsXPIDLString.cpp \
plvector.cpp \
nsTextFormater.cpp \
$(NULL)
EXPORTS = \
nsAVLTree.h \
nsCppSharedAllocator.h \
nsCRT.h \
nsDeque.h \
nsEnumeratorUtils.h \
nsHashtable.h \
nsHashtableEnumerator.h \
nsIArena.h \
nsIByteBuffer.h \
nsIObserverList.h \
nsIProperties.h \
nsISimpleEnumerator.h \
nsISizeOfHandler.h \
nsIUnicharBuffer.h \
nsIVariant.h \
nsInt64.h \
nsQuickSort.h \
nsStr.h \
nsString.h \
nsString2.h \
nsSupportsPrimitives.h \
nsTime.h \
nsUnitConversion.h \
nsVector.h \
nsVoidArray.h \
nsXPIDLString.h \
plvector.h \
nsTextFormater.h \
$(NULL)
XPIDLSRCS = \
nsIAtom.idl \
nsICollection.idl \
nsIEnumerator.idl \
nsIObserver.idl \
nsIObserverService.idl \
nsISupportsArray.idl \
nsISupportsPrimitives.idl \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
# we don't want the shared lib, but we want to force the creation of a static lib.
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
include $(topsrcdir)/config/rules.mk
DEFINES += -D_IMPL_NS_COM -D_IMPL_NS_BASE

View File

@@ -1,758 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/******************************************************************************************
MODULE NOTES:
This file contains the workhorse copy and shift functions used in nsStrStruct.
Ultimately, I plan to make the function pointers in this system available for
use by external modules. They'll be able to install their own "handlers".
Not so, today though.
*******************************************************************************************/
#ifndef _BUFFERROUTINES_H
#define _BUFFERROUTINES_H
#include "nsCRT.h"
#ifndef RICKG_TESTBED
#include "nsUnicharUtilCIID.h"
#include "nsIServiceManager.h"
#include "nsICaseConversion.h"
#endif
#define KSHIFTLEFT (0)
#define KSHIFTRIGHT (1)
inline PRUnichar GetUnicharAt(const char* aString,PRUint32 anIndex) {
return ((PRUnichar*)aString)[anIndex];
}
inline PRUnichar GetCharAt(const char* aString,PRUint32 anIndex) {
return (PRUnichar)aString[anIndex];
}
//----------------------------------------------------------------------------------------
//
// This set of methods is used to shift the contents of a char buffer.
// The functions are differentiated by shift direction and the underlying charsize.
//
/**
* This method shifts single byte characters left by a given amount from an given offset.
* @update gess 01/04/99
* @param aDest is a ptr to a cstring where left-shift is to be performed
* @param aLength is the known length of aDest
* @param anOffset is the index into aDest where shifting shall begin
* @param aCount is the number of chars to be "cut"
*/
void ShiftCharsLeft(char* aDest,PRUint32 aLength,PRUint32 anOffset,PRUint32 aCount) {
char* dst = aDest+anOffset;
char* src = aDest+anOffset+aCount;
memmove(dst,src,aLength-(aCount+anOffset));
}
/**
* This method shifts single byte characters right by a given amount from an given offset.
* @update gess 01/04/99
* @param aDest is a ptr to a cstring where the shift is to be performed
* @param aLength is the known length of aDest
* @param anOffset is the index into aDest where shifting shall begin
* @param aCount is the number of chars to be "inserted"
*/
void ShiftCharsRight(char* aDest,PRUint32 aLength,PRUint32 anOffset,PRUint32 aCount) {
char* src = aDest+anOffset;
char* dst = aDest+anOffset+aCount;
memmove(dst,src,aLength-anOffset);
}
/**
* This method shifts unicode characters by a given amount from an given offset.
* @update gess 01/04/99
* @param aDest is a ptr to a cstring where the shift is to be performed
* @param aLength is the known length of aDest
* @param anOffset is the index into aDest where shifting shall begin
* @param aCount is the number of chars to be "cut"
*/
void ShiftDoubleCharsLeft(char* aDest,PRUint32 aLength,PRUint32 anOffset,PRUint32 aCount) {
PRUnichar* root=(PRUnichar*)aDest;
PRUnichar* dst = root+anOffset;
PRUnichar* src = root+anOffset+aCount;
memmove(dst,src,(aLength-(aCount+anOffset))*sizeof(PRUnichar));
}
/**
* This method shifts unicode characters by a given amount from an given offset.
* @update gess 01/04/99
* @param aDest is a ptr to a cstring where the shift is to be performed
* @param aLength is the known length of aDest
* @param anOffset is the index into aDest where shifting shall begin
* @param aCount is the number of chars to be "inserted"
*/
void ShiftDoubleCharsRight(char* aDest,PRUint32 aLength,PRUint32 anOffset,PRUint32 aCount) {
PRUnichar* root=(PRUnichar*)aDest;
PRUnichar* src = root+anOffset;
PRUnichar* dst = root+anOffset+aCount;
memmove(dst,src,sizeof(PRUnichar)*(aLength-anOffset));
}
typedef void (*ShiftChars)(char* aDest,PRUint32 aLength,PRUint32 anOffset,PRUint32 aCount);
ShiftChars gShiftChars[2][2]= {
{&ShiftCharsLeft,&ShiftCharsRight},
{&ShiftDoubleCharsLeft,&ShiftDoubleCharsRight}
};
//----------------------------------------------------------------------------------------
//
// This set of methods is used to copy one buffer onto another.
// The functions are differentiated by the size of source and dest character sizes.
// WARNING: Your destination buffer MUST be big enough to hold all the source bytes.
// We don't validate these ranges here (this should be done in higher level routines).
//
/**
* Going 1 to 1 is easy, since we assume ascii. No conversions are necessary.
* @update gess 01/04/99
* @param aDest is the destination buffer
* @param aDestOffset is the pos to start copy to in the dest buffer
* @param aSource is the source buffer
* @param anOffset is the offset to start copying from in the source buffer
* @param aCount is the (max) number of chars to copy
*/
void CopyChars1To1(char* aDest,PRInt32 anDestOffset,const char* aSource,PRUint32 anOffset,PRUint32 aCount) {
char* dst = aDest+anDestOffset;
char* src = (char*)aSource+anOffset;
memcpy(dst,src,aCount);
}
/**
* Going 1 to 2 requires a conversion from ascii to unicode. This can be expensive.
* @param aDest is the destination buffer
* @param aDestOffset is the pos to start copy to in the dest buffer
* @param aSource is the source buffer
* @param anOffset is the offset to start copying from in the source buffer
* @param aCount is the (max) number of chars to copy
*/
void CopyChars1To2(char* aDest,PRInt32 anDestOffset,const char* aSource,PRUint32 anOffset,PRUint32 aCount) {
PRUnichar* theDest=(PRUnichar*)aDest;
PRUnichar* to = theDest+anDestOffset;
const unsigned char* first= (const unsigned char*)aSource+anOffset;
const unsigned char* last = first+aCount;
//now loop over characters, shifting them left...
while(first<last) {
*to=(PRUnichar)(*first);
to++;
first++;
}
}
/**
* Going 2 to 1 requires a conversion from unicode down to ascii. This can be lossy.
* @update gess 01/04/99
* @param aDest is the destination buffer
* @param aDestOffset is the pos to start copy to in the dest buffer
* @param aSource is the source buffer
* @param anOffset is the offset to start copying from in the source buffer
* @param aCount is the (max) number of chars to copy
*/
void CopyChars2To1(char* aDest,PRInt32 anDestOffset,const char* aSource,PRUint32 anOffset,PRUint32 aCount) {
char* to = aDest+anDestOffset;
PRUnichar* theSource=(PRUnichar*)aSource;
const PRUnichar* first= theSource+anOffset;
const PRUnichar* last = first+aCount;
//now loop over characters, shifting them left...
while(first<last) {
if(*first<256)
*to=(char)*first;
else *to='.';
to++;
first++;
}
}
/**
* Going 2 to 2 is fast and efficient.
* @update gess 01/04/99
* @param aDest is the destination buffer
* @param aDestOffset is the pos to start copy to in the dest buffer
* @param aSource is the source buffer
* @param anOffset is the offset to start copying from in the source buffer
* @param aCount is the (max) number of chars to copy
*/
void CopyChars2To2(char* aDest,PRInt32 anDestOffset,const char* aSource,PRUint32 anOffset,PRUint32 aCount) {
PRUnichar* theDest=(PRUnichar*)aDest;
PRUnichar* to = theDest+anDestOffset;
PRUnichar* theSource=(PRUnichar*)aSource;
PRUnichar* from= theSource+anOffset;
memcpy((void*)to,(void*)from,aCount*sizeof(PRUnichar));
}
//--------------------------------------------------------------------------------------
typedef void (*CopyChars)(char* aDest,PRInt32 anDestOffset,const char* aSource,PRUint32 anOffset,PRUint32 aCount);
CopyChars gCopyChars[2][2]={
{&CopyChars1To1,&CopyChars1To2},
{&CopyChars2To1,&CopyChars2To2}
};
//----------------------------------------------------------------------------------------
//
// This set of methods is used to search a buffer looking for a char.
//
/**
* This methods cans the given buffer for the given char
*
* @update gess 3/25/98
* @param aDest is the buffer to be searched
* @param aLength is the size (in char-units, not bytes) of the buffer
* @param anOffset is the start pos to begin searching
* @param aChar is the target character we're looking for
* @param aIgnorecase tells us whether to use a case sensitive search
* @return index of pos if found, else -1 (kNotFound)
*/
inline PRInt32 FindChar1(const char* aDest,PRUint32 aLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) {
if(aIgnoreCase) {
char theChar=(char)nsCRT::ToUpper(aChar);
const char* ptr=aDest+(anOffset-1);
const char* last=aDest+aLength;
while(++ptr<last){
if(nsCRT::ToUpper(*ptr)==theChar)
return ptr-aDest;
}
}
else {
const char* ptr = aDest+anOffset;
char theChar=(char)aChar;
const char* result=(const char*)memchr(ptr, theChar,aLength-anOffset);
if(result) {
return result-aDest;
}
}
return kNotFound;
}
/**
* This methods cans the given buffer for the given char
*
* @update gess 3/25/98
* @param aDest is the buffer to be searched
* @param aLength is the size (in char-units, not bytes) of the buffer
* @param anOffset is the start pos to begin searching
* @param aChar is the target character we're looking for
* @param aIgnorecase tells us whether to use a case sensitive search
* @return index of pos if found, else -1 (kNotFound)
*/
inline PRInt32 FindChar2(const char* aDest,PRUint32 aLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) {
const PRUnichar* root=(PRUnichar*)aDest;
const PRUnichar* ptr=root+(anOffset-1);
const PRUnichar* last=root+aLength;
if(aIgnoreCase) {
PRUnichar theChar=nsCRT::ToUpper(aChar);
while(++ptr<last){
if(nsCRT::ToUpper(*ptr)==theChar)
return ptr-root;
}
}
else {
while(++ptr<last){
if(*ptr==aChar)
return (ptr-root);
}
}
return kNotFound;
}
/**
* This methods cans the given buffer (in reverse) for the given char
*
* @update gess 3/25/98
* @param aDest is the buffer to be searched
* @param aLength is the size (in char-units, not bytes) of the buffer
* @param anOffset is the start pos to begin searching
* @param aChar is the target character we're looking for
* @param aIgnorecase tells us whether to use a case sensitive search
* @return index of pos if found, else -1 (kNotFound)
*/
inline PRInt32 RFindChar1(const char* aDest,PRUint32 aDestLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) {
PRInt32 theIndex=0;
if(aIgnoreCase) {
PRUnichar theChar=nsCRT::ToUpper(aChar);
for(theIndex=(PRInt32)anOffset;theIndex>=0;theIndex--){
if(nsCRT::ToUpper(aDest[theIndex])==theChar)
return theIndex;
}
}
else {
for(theIndex=(PRInt32)anOffset;theIndex>=0;theIndex--){
if(aDest[theIndex]==aChar)
return theIndex;
}
}
return kNotFound;
}
/**
* This methods cans the given buffer for the given char
*
* @update gess 3/25/98
* @param aDest is the buffer to be searched
* @param aLength is the size (in char-units, not bytes) of the buffer
* @param anOffset is the start pos to begin searching
* @param aChar is the target character we're looking for
* @param aIgnorecase tells us whether to use a case sensitive search
* @return index of pos if found, else -1 (kNotFound)
*/
inline PRInt32 RFindChar2(const char* aDest,PRUint32 aDestLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) {
PRInt32 theIndex=0;
PRUnichar* theBuf=(PRUnichar*)aDest;
if(aIgnoreCase) {
PRUnichar theChar=nsCRT::ToUpper(aChar);
for(theIndex=(PRInt32)anOffset;theIndex>=0;theIndex--){
if(nsCRT::ToUpper(theBuf[theIndex])==theChar)
return theIndex;
}
}
else {
for(theIndex=(PRInt32)anOffset;theIndex>=0;theIndex--){
if(theBuf[theIndex]==aChar)
return theIndex;
}
}
return kNotFound;
}
typedef PRInt32 (*FindChars)(const char* aDest,PRUint32 aDestLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase);
FindChars gFindChars[]={&FindChar1,&FindChar2};
FindChars gRFindChars[]={&RFindChar1,&RFindChar2};
//----------------------------------------------------------------------------------------
//
// This set of methods is used to compare one buffer onto another.
// The functions are differentiated by the size of source and dest character sizes.
// WARNING: Your destination buffer MUST be big enough to hold all the source bytes.
// We don't validate these ranges here (this should be done in higher level routines).
//
/**
* This method compares the data in one buffer with another
* @update gess 01/04/99
* @param aStr1 is the first buffer to be compared
* @param aStr2 is the 2nd buffer to be compared
* @param aCount is the number of chars to compare
* @param aIgnorecase tells us whether to use a case-sensitive comparison
* @return -1,0,1 depending on <,==,>
*/
PRInt32 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){
PRInt32 result=0;
if(aIgnoreCase)
result=nsCRT::strncasecmp(aStr1,aStr2,aCount);
else result=strncmp(aStr1,aStr2,aCount);
return result;
}
/**
* This method compares the data in one buffer with another
* @update gess 01/04/99
* @param aStr1 is the first buffer to be compared
* @param aStr2 is the 2nd buffer to be compared
* @param aCount is the number of chars to compare
* @param aIgnorecase tells us whether to use a case-sensitive comparison
* @return -1,0,1 depending on <,==,>
*/
PRInt32 Compare2To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){
PRInt32 result=0;
if(aIgnoreCase)
result=nsCRT::strncasecmp((PRUnichar*)aStr1,(PRUnichar*)aStr2,aCount);
else result=nsCRT::strncmp((PRUnichar*)aStr1,(PRUnichar*)aStr2,aCount);
return result;
}
/**
* This method compares the data in one buffer with another
* @update gess 01/04/99
* @param aStr1 is the first buffer to be compared
* @param aStr2 is the 2nd buffer to be compared
* @param aCount is the number of chars to compare
* @param aIgnorecase tells us whether to use a case-sensitive comparison
* @return -1,0,1 depending on <,==,>
*/
PRInt32 Compare2To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){
PRInt32 result;
if(aIgnoreCase)
result=nsCRT::strncasecmp((PRUnichar*)aStr1,aStr2,aCount);
else result=nsCRT::strncmp((PRUnichar*)aStr1,aStr2,aCount);
return result;
}
/**
* This method compares the data in one buffer with another
* @update gess 01/04/99
* @param aStr1 is the first buffer to be compared
* @param aStr2 is the 2nd buffer to be compared
* @param aCount is the number of chars to compare
* @param aIgnorecase tells us whether to use a case-sensitive comparison
* @return -1,0,1 depending on <,==,>
*/
PRInt32 Compare1To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){
PRInt32 result;
if(aIgnoreCase)
result=nsCRT::strncasecmp((PRUnichar*)aStr2,aStr1,aCount)*-1;
else result=nsCRT::strncmp((PRUnichar*)aStr2,aStr1,aCount)*-1;
return result;
}
typedef PRInt32 (*CompareChars)(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase);
CompareChars gCompare[2][2]={
{&Compare1To1,&Compare1To2},
{&Compare2To1,&Compare2To2},
};
//----------------------------------------------------------------------------------------
//
// This set of methods is used to convert the case of strings...
//
/**
* This method performs a case conversion the data in the given buffer
*
* @update gess 01/04/99
* @param aString is the buffer to be case shifted
* @param aCount is the number of chars to compare
* @param aToUpper tells us whether to convert to upper or lower
* @return 0
*/
PRInt32 ConvertCase1(char* aString,PRUint32 aCount,PRBool aToUpper){
PRInt32 result=0;
typedef char chartype;
chartype* cp = (chartype*)aString;
chartype* end = cp + aCount-1;
while (cp <= end) {
chartype ch = *cp;
if(aToUpper) {
if ((ch >= 'a') && (ch <= 'z')) {
*cp = 'A' + (ch - 'a');
}
}
else {
if ((ch >= 'A') && (ch <= 'Z')) {
*cp = 'a' + (ch - 'A');
}
}
cp++;
}
return result;
}
//----------------------------------------------------------------------------------------
#ifndef RICKG_TESTBED
class HandleCaseConversionShutdown3 : public nsIShutdownListener {
public :
NS_IMETHOD OnShutdown(const nsCID& cid, nsISupports* service);
HandleCaseConversionShutdown3(void) { NS_INIT_REFCNT(); }
virtual ~HandleCaseConversionShutdown3(void) {}
NS_DECL_ISUPPORTS
};
static NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
static NS_DEFINE_IID(kICaseConversionIID, NS_ICASECONVERSION_IID);
static NS_DEFINE_IID(kIShutdownListenerIID, NS_ISHUTDOWNLISTENER_IID);
static nsICaseConversion * gCaseConv = 0;
NS_IMPL_ISUPPORTS(HandleCaseConversionShutdown3, kIShutdownListenerIID);
nsresult HandleCaseConversionShutdown3::OnShutdown(const nsCID& cid, nsISupports* service) {
if (cid.Equals(kUnicharUtilCID)) {
NS_ASSERTION(service == gCaseConv, "wrong service!");
if(gCaseConv){
gCaseConv->Release();
gCaseConv = 0;
}
}
return NS_OK;
}
class CCaseConversionServiceInitializer {
public:
CCaseConversionServiceInitializer(){
mListener = new HandleCaseConversionShutdown3();
if(mListener){
mListener->AddRef();
nsServiceManager::GetService(kUnicharUtilCID, kICaseConversionIID,(nsISupports**) &gCaseConv, mListener);
}
}
protected:
HandleCaseConversionShutdown3* mListener;
};
#endif
//----------------------------------------------------------------------------------------
/**
* This method performs a case conversion the data in the given buffer
*
* @update gess 01/04/99
* @param aString is the buffer to be case shifted
* @param aCount is the number of chars to compare
* @param aToUpper tells us whether to convert to upper or lower
* @return 0
*/
PRInt32 ConvertCase2(char* aString,PRUint32 aCount,PRBool aToUpper){
PRUnichar* cp = (PRUnichar*)aString;
PRUnichar* end = cp + aCount-1;
PRInt32 result=0;
#ifndef RICKG_TESTBED
static CCaseConversionServiceInitializer gCaseConversionServiceInitializer;
// I18N code begin
if(gCaseConv) {
nsresult err=(aToUpper) ? gCaseConv->ToUpper(cp, cp, aCount) : gCaseConv->ToLower(cp, cp, aCount);
if(NS_SUCCEEDED(err))
return 0;
}
// I18N code end
#endif
while (cp <= end) {
PRUnichar ch = *cp;
if(aToUpper) {
if ((ch >= 'a') && (ch <= 'z')) {
*cp = 'A' + (ch - 'a');
}
}
else {
if ((ch >= 'A') && (ch <= 'Z')) {
*cp = 'a' + (ch - 'A');
}
}
cp++;
}
return result;
}
typedef PRInt32 (*CaseConverters)(char*,PRUint32,PRBool);
CaseConverters gCaseConverters[]={&ConvertCase1,&ConvertCase2};
//----------------------------------------------------------------------------------------
//
// This set of methods is used compress char sequences in a buffer...
//
/**
* This method compresses duplicate runs of a given char from the given buffer
*
* @update gess 01/04/99
* @param aString is the buffer to be manipulated
* @param aLength is the length of the buffer
* @param aSet tells us which chars to compress from given buffer
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
* @return the new length of the given buffer
*/
PRInt32 CompressChars1(char* aString,PRUint32 aLength,const char* aSet){
typedef char chartype;
chartype* from = aString;
chartype* end = aString + aLength-1;
chartype* to = from;
//this code converts /n, /t, /r into normal space ' ';
//it also compresses runs of whitespace down to a single char...
if(aSet && aString && (0 < aLength)){
PRUint32 aSetLen=strlen(aSet);
while (from <= end) {
chartype theChar = *from++;
if(kNotFound!=FindChar1(aSet,aSetLen,0,theChar,PR_FALSE)){
*to++=theChar;
while (from <= end) {
theChar = *from++;
if(kNotFound==FindChar1(aSet,aSetLen,0,theChar,PR_FALSE)){
*to++ = theChar;
break;
}
}
} else {
*to++ = theChar;
}
}
*to = 0;
}
return to - (chartype*)aString;
}
/**
* This method compresses duplicate runs of a given char from the given buffer
*
* @update gess 01/04/99
* @param aString is the buffer to be manipulated
* @param aLength is the length of the buffer
* @param aSet tells us which chars to compress from given buffer
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
* @return the new length of the given buffer
*/
PRInt32 CompressChars2(char* aString,PRUint32 aLength,const char* aSet){
typedef PRUnichar chartype;
chartype* from = (chartype*)aString;
chartype* end = from + aLength-1;
chartype* to = from;
//this code converts /n, /t, /r into normal space ' ';
//it also compresses runs of whitespace down to a single char...
if(aSet && aString && (0 < aLength)){
PRUint32 aSetLen=strlen(aSet);
while (from <= end) {
chartype theChar = *from++;
if(kNotFound!=FindChar1(aSet,aSetLen,0,theChar,PR_FALSE)){
*to++=theChar;
while (from <= end) {
theChar = *from++;
if(kNotFound==FindChar1(aSet,aSetLen,0,theChar,PR_FALSE)){
*to++ = theChar;
break;
}
}
} else {
*to++ = theChar;
}
}
*to = 0;
}
return to - (chartype*)aString;
}
typedef PRInt32 (*CompressChars)(char* aString,PRUint32 aCount,const char* aSet);
CompressChars gCompressChars[]={&CompressChars1,&CompressChars2};
/**
* This method strips chars in a given set from the given buffer
*
* @update gess 01/04/99
* @param aString is the buffer to be manipulated
* @param aLength is the length of the buffer
* @param aSet tells us which chars to compress from given buffer
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
* @return the new length of the given buffer
*/
PRInt32 StripChars1(char* aString,PRUint32 aLength,const char* aSet){
typedef char chartype;
chartype* to = aString;
chartype* from = aString-1;
chartype* end = aString + aLength;
if(aSet && aString && (0 < aLength)){
PRUint32 aSetLen=strlen(aSet);
while (++from < end) {
chartype theChar = *from;
if(kNotFound==FindChar1(aSet,aSetLen,0,theChar,PR_FALSE)){
*to++ = theChar;
}
}
*to = 0;
}
return to - (chartype*)aString;
}
/**
* This method strips chars in a given set from the given buffer
*
* @update gess 01/04/99
* @param aString is the buffer to be manipulated
* @param aLength is the length of the buffer
* @param aSet tells us which chars to compress from given buffer
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
* @return the new length of the given buffer
*/
PRInt32 StripChars2(char* aString,PRUint32 aLength,const char* aSet){
typedef PRUnichar chartype;
chartype* to = (chartype*)aString;
chartype* from = (chartype*)aString-1;
chartype* end = to + aLength;
if(aSet && aString && (0 < aLength)){
PRUint32 aSetLen=strlen(aSet);
while (++from < end) {
chartype theChar = *from;
if(kNotFound==FindChar1(aSet,aSetLen,0,theChar,PR_FALSE)){
*to++ = theChar;
}
}
*to = 0;
}
return to - (chartype*)aString;
}
typedef PRInt32 (*StripChars)(char* aString,PRUint32 aCount,const char* aSet);
StripChars gStripChars[]={&StripChars1,&StripChars2};
#endif

View File

@@ -1,120 +0,0 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH=..\..
MODULE = xpcom
################################################################################
## exports
EXPORTS = \
nsTextFormater.h \
nsAVLTree.h \
nsCppSharedAllocator.h \
nsCRT.h \
nsDeque.h \
nsEnumeratorUtils.h \
nsHashtable.h \
nsHashtableEnumerator.h \
nsIArena.h \
nsIByteBuffer.h \
nsIObserverList.h \
nsIProperties.h \
nsISimpleEnumerator.h \
nsISizeOfHandler.h \
nsIUnicharBuffer.h \
nsIVariant.h \
nsInt64.h \
nsQuickSort.h \
nsStr.h \
nsString.h \
nsString2.h \
nsSupportsPrimitives.h \
nsTime.h \
nsUnitConversion.h \
nsVector.h \
nsVoidArray.h \
nsXPIDLString.h \
plvector.h \
$(NULL)
XPIDL_MODULE = xpcom_ds
XPIDLSRCS = \
.\nsIAtom.idl \
.\nsICollection.idl \
.\nsIEnumerator.idl \
.\nsIObserver.idl \
.\nsIObserverService.idl \
.\nsISupportsArray.idl \
.\nsISupportsPrimitives.idl \
$(NULL)
################################################################################
## library
LIBRARY_NAME=xpcomds_s
LINCS = \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\uconv \
-I$(PUBLIC)\unicharutil \
$(NULL)
LCFLAGS = -D_IMPL_NS_COM -D_IMPL_NS_BASE -DWIN32_LEAN_AND_MEAN
CPP_OBJS = \
.\$(OBJDIR)\nsTextFormater.obj \
.\$(OBJDIR)\nsArena.obj \
.\$(OBJDIR)\nsAtomTable.obj \
.\$(OBJDIR)\nsAVLTree.obj \
.\$(OBJDIR)\nsByteBuffer.obj \
.\$(OBJDIR)\nsCRT.obj \
.\$(OBJDIR)\nsConjoiningEnumerator.obj \
.\$(OBJDIR)\nsDeque.obj \
.\$(OBJDIR)\nsEmptyEnumerator.obj \
.\$(OBJDIR)\nsEnumeratorUtils.obj \
.\$(OBJDIR)\nsHashtable.obj \
.\$(OBJDIR)\nsHashtableEnumerator.obj \
.\$(OBJDIR)\nsObserver.obj \
.\$(OBJDIR)\nsObserverList.obj \
.\$(OBJDIR)\nsObserverService.obj \
.\$(OBJDIR)\nsProperties.obj \
.\$(OBJDIR)\nsQuickSort.obj \
.\$(OBJDIR)\nsSizeOfHandler.obj \
.\$(OBJDIR)\nsStr.obj \
.\$(OBJDIR)\nsString.obj \
.\$(OBJDIR)\nsString2.obj \
.\$(OBJDIR)\nsSupportsArray.obj \
.\$(OBJDIR)\nsSupportsArrayEnumerator.obj \
.\$(OBJDIR)\nsSupportsPrimitives.obj \
.\$(OBJDIR)\nsUnicharBuffer.obj \
.\$(OBJDIR)\nsVariant.obj \
.\$(OBJDIR)\nsVoidArray.obj \
.\$(OBJDIR)\nsXPIDLString.obj \
.\$(OBJDIR)\plvector.obj \
$(NULL)
include <$(DEPTH)\config\rules.mak>
libs:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

View File

@@ -1,617 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsAVLTree.h"
enum eLean {eLeft,eNeutral,eRight};
struct NS_COM nsAVLNode {
public:
nsAVLNode(void* aValue) {
mLeft=0;
mRight=0;
mSkew=eNeutral;
mValue=aValue;
}
nsAVLNode* mLeft;
nsAVLNode* mRight;
eLean mSkew;
void* mValue;
};
/************************************************************
Now begin the tree class. Don't forget that the comparison
between nodes must occur via the comparitor function,
otherwise all you're testing is pointer addresses.
************************************************************/
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
nsAVLTree::nsAVLTree(nsAVLNodeComparitor& aComparitor,
nsAVLNodeFunctor* aDeallocator) :
mComparitor(aComparitor), mDeallocator(aDeallocator) {
mRoot=0;
mCount=0;
}
static void
avlDeleteTree(nsAVLNode* aNode){
if (aNode) {
avlDeleteTree(aNode->mLeft);
avlDeleteTree(aNode->mRight);
delete aNode;
}
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
nsAVLTree::~nsAVLTree(){
if (mDeallocator) {
ForEachDepthFirst(*mDeallocator);
}
avlDeleteTree(mRoot);
}
class CDoesntExist: public nsAVLNodeFunctor {
public:
CDoesntExist(const nsAVLTree& anotherTree) : mOtherTree(anotherTree) {
}
virtual void* operator()(void* anItem) {
void* result=mOtherTree.FindItem(anItem);
if(result)
return nsnull;
return anItem;
}
protected:
const nsAVLTree& mOtherTree;
};
/**
* This method compares two trees (members by identity).
* @update gess12/27/98
* @param tree to compare against
* @return true if they are identical (contain same stuff).
*/
PRBool nsAVLTree::operator==(const nsAVLTree& aCopy) const{
CDoesntExist functor(aCopy);
void* theItem=FirstThat(functor);
PRBool result=PRBool(!theItem);
return result;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateRight(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mRight;
if(ptr2->mSkew==eRight) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mLeft;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(ptr3->mSkew==eLeft)
ptr2->mSkew=eRight;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eRight)
aRootNode->mSkew=eLeft;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateLeft(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mLeft;
if(ptr2->mSkew==eLeft) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mRight;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(ptr3->mSkew==eRight)
ptr2->mSkew=eLeft;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eLeft)
aRootNode->mSkew=eRight;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlInsert(nsAVLNode*& aRootNode, nsAVLNode* aNewNode,
nsAVLNodeComparitor& aComparitor) {
eAVLStatus result=eAVL_unknown;
if(!aRootNode) {
aRootNode = aNewNode;
return eAVL_ok;
}
if(aNewNode==aRootNode->mValue) {
return eAVL_duplicate;
}
PRInt32 theCompareResult=aComparitor(aRootNode->mValue,aNewNode->mValue);
if(0 < theCompareResult) { //if(anItem<aRootNode->mValue)
result=avlInsert(aRootNode->mLeft,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
avlRotateLeft(aRootNode);
result=eAVL_fail;
break;
case eRight:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
break;
} //switch
}//if
} //if
else {
result=avlInsert(aRootNode->mRight,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eRight:
avlRotateRight(aRootNode);
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eRight;
break;
} //switch
}
} //if
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceLeft(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
ptr2=aRootNode->mLeft;
balnc2=ptr2->mSkew;
if(balnc2!=eRight) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eLeft;
ptr2->mSkew=eRight;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mRight;
balnc3=ptr3->mSkew;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(balnc3==eRight) {
ptr2->mSkew=eLeft;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eLeft) {
aRootNode->mSkew=eRight;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eRight:
aRootNode->mSkew=eNeutral;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceRight(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
break;
case eRight:
ptr2=aRootNode->mRight;
balnc2=ptr2->mSkew;
if(balnc2!=eLeft) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eRight;
ptr2->mSkew=eLeft;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mLeft;
balnc3=ptr3->mSkew;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(balnc3==eLeft) {
ptr2->mSkew=eRight;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eRight) {
aRootNode->mSkew=eLeft;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eNeutral:
aRootNode->mSkew=eRight;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemoveChildren(nsAVLNode*& aRootNode,nsAVLNode*& anotherNode, PRBool& delOk){
eAVLStatus result=eAVL_ok;
if(!anotherNode->mRight){
aRootNode->mValue=anotherNode->mValue; //swap
anotherNode=anotherNode->mLeft;
delOk=PR_TRUE;
}
else{
avlRemoveChildren(aRootNode,anotherNode->mRight,delOk);
if(delOk)
avlBalanceLeft(anotherNode,delOk);
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemove(nsAVLNode*& aRootNode, void* anItem, PRBool& delOk,
nsAVLNodeComparitor& aComparitor){
eAVLStatus result=eAVL_ok;
if(!aRootNode)
delOk=PR_FALSE;
else {
PRInt32 cmp=aComparitor(anItem,aRootNode->mValue);
if(cmp<0){
avlRemove(aRootNode->mLeft,anItem,delOk,aComparitor);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
else if(cmp>0){
avlRemove(aRootNode->mRight,anItem,delOk,aComparitor);
if(delOk)
avlBalanceLeft(aRootNode,delOk);
}
else{ //they match...
nsAVLNode* temp=aRootNode;
if(!aRootNode->mRight) {
aRootNode=aRootNode->mLeft;
delOk=PR_TRUE;
delete temp;
}
else if(!aRootNode->mLeft) {
aRootNode=aRootNode->mRight;
delOk=PR_TRUE;
delete temp;
}
else {
avlRemoveChildren(aRootNode,aRootNode->mLeft,delOk);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
}
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
eAVLStatus
nsAVLTree::AddItem(void* anItem){
eAVLStatus result=eAVL_ok;
nsAVLNode* theNewNode=new nsAVLNode(anItem);
result=avlInsert(mRoot,theNewNode,mComparitor);
if(eAVL_duplicate!=result)
mCount++;
else {
delete theNewNode;
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
void* nsAVLTree::FindItem(void* aValue) const{
nsAVLNode* result=mRoot;
PRInt32 count=0;
while(result) {
count++;
PRInt32 cmp=mComparitor(aValue,result->mValue);
if(0==cmp) {
//we matched...
break;
}
else if(0>cmp){
//theNode was greater...
result=result->mLeft;
}
else {
//aValue is greater...
result=result->mRight;
}
}
if(result) {
return result->mValue;
}
return nsnull;
}
/**
*
* @update gess12/30/98
* @param
* @return
*/
eAVLStatus
nsAVLTree::RemoveItem(void* aValue){
PRBool delOk=PR_TRUE;
eAVLStatus result=avlRemove(mRoot,aValue,delOk,mComparitor);
if(eAVL_ok==result)
mCount--;
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEachDepthFirst(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor){
if(aNode) {
avlForEachDepthFirst(aNode->mLeft,aFunctor);
avlForEachDepthFirst(aNode->mRight,aFunctor);
aFunctor(aNode->mValue);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const{
::avlForEachDepthFirst(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEach(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
if(aNode) {
avlForEach(aNode->mLeft,aFunctor);
aFunctor(aNode->mValue);
avlForEach(aNode->mRight,aFunctor);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEach(nsAVLNodeFunctor& aFunctor) const{
::avlForEach(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void*
avlFirstThat(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
void* result=nsnull;
if(aNode) {
result = avlFirstThat(aNode->mLeft,aFunctor);
if (result) {
return result;
}
result = aFunctor(aNode->mValue);
if (result) {
return result;
}
result = avlFirstThat(aNode->mRight,aFunctor);
}
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void*
nsAVLTree::FirstThat(nsAVLNodeFunctor& aFunctor) const{
return ::avlFirstThat(mRoot,aFunctor);
}

View File

@@ -1,74 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsAVLTree_h___
#define nsAVLTree_h___
#include "nscore.h"
enum eAVLStatus {eAVL_unknown,eAVL_ok,eAVL_fail,eAVL_duplicate};
struct nsAVLNode;
/**
*
* @update gess12/26/98
* @param anObject1 is the first object to be compared
* @param anObject2 is the second object to be compared
* @return -1,0,1 if object1 is less, equal, greater than object2
*/
class NS_COM nsAVLNodeComparitor {
public:
virtual PRInt32 operator()(void* anItem1,void* anItem2)=0;
};
class NS_COM nsAVLNodeFunctor {
public:
virtual void* operator()(void* anItem)=0;
};
class NS_COM nsAVLTree {
public:
nsAVLTree(nsAVLNodeComparitor& aComparitor, nsAVLNodeFunctor* aDeallocator);
~nsAVLTree(void);
PRBool operator==(const nsAVLTree& aOther) const;
PRInt32 GetCount(void) const {return mCount;}
//main functions...
eAVLStatus AddItem(void* anItem);
eAVLStatus RemoveItem(void* anItem);
void* FindItem(void* anItem) const;
void ForEach(nsAVLNodeFunctor& aFunctor) const;
void ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const;
void* FirstThat(nsAVLNodeFunctor& aFunctor) const;
protected:
nsAVLNode* mRoot;
PRInt32 mCount;
nsAVLNodeComparitor& mComparitor;
nsAVLNodeFunctor* mDeallocator;
};
#endif /* nsAVLTree_h___ */

View File

@@ -1,97 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsArena.h"
#include "nsCRT.h"
ArenaImpl::ArenaImpl(void)
: mInitialized(PR_FALSE)
{
NS_INIT_REFCNT();
nsCRT::memset(&mPool, 0, sizeof(PLArenaPool));
}
NS_IMETHODIMP
ArenaImpl::Init(PRUint32 aBlockSize)
{
if (aBlockSize < NS_MIN_ARENA_BLOCK_SIZE) {
aBlockSize = NS_DEFAULT_ARENA_BLOCK_SIZE;
}
PL_INIT_ARENA_POOL(&mPool, "nsIArena", aBlockSize);
mBlockSize = aBlockSize;
mInitialized = PR_TRUE;
return NS_OK;
}
NS_IMPL_ISUPPORTS1(ArenaImpl, nsIArena)
ArenaImpl::~ArenaImpl()
{
if (mInitialized)
PL_FinishArenaPool(&mPool);
mInitialized = PR_FALSE;
}
NS_IMETHODIMP_(void*)
ArenaImpl::Alloc(PRUint32 size)
{
// Adjust size so that it's a multiple of sizeof(double)
PRUint32 align = size & (sizeof(double) - 1);
if (0 != align) {
size += sizeof(double) - align;
}
void* p;
PL_ARENA_ALLOCATE(p, &mPool, size);
return p;
}
NS_METHOD
ArenaImpl::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
ArenaImpl* it = new ArenaImpl();
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = it->QueryInterface(aIID, aResult);
NS_RELEASE(it);
return rv;
}
NS_COM nsresult NS_NewHeapArena(nsIArena** aInstancePtrResult,
PRUint32 aArenaBlockSize)
{
nsresult rv;
nsIArena* arena;
rv = ArenaImpl::Create(NULL, nsIArena::GetIID(), (void**)&arena);
if (NS_FAILED(rv)) return rv;
rv = arena->Init(aArenaBlockSize);
if (NS_FAILED(rv)) {
NS_RELEASE(arena);
return rv;
}
*aInstancePtrResult = arena;
return rv;
}

View File

@@ -1,50 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsArena_h__
#define nsArena_h__
#include "nsIArena.h"
#define PL_ARENA_CONST_ALIGN_MASK 7
#include "plarena.h"
// Simple arena implementation layered on plarena
class ArenaImpl : public nsIArena {
public:
ArenaImpl(void);
virtual ~ArenaImpl();
NS_DECL_ISUPPORTS
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
NS_IMETHOD Init(PRUint32 arenaBlockSize);
NS_IMETHOD_(void*) Alloc(PRUint32 size);
protected:
PLArenaPool mPool;
PRUint32 mBlockSize;
private:
PRBool mInitialized;
};
#endif // nsArena_h__

View File

@@ -1,172 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsAtomTable.h"
#include "nsString.h"
#include "nsCRT.h"
#include "plhash.h"
#include "nsISizeOfHandler.h"
/**
* The shared hash table for atom lookups.
*/
static nsrefcnt gAtoms;
static struct PLHashTable* gAtomHashTable;
#if defined(DEBUG) && (defined(XP_UNIX) || defined(XP_PC))
static PRIntn
DumpAtomLeaks(PLHashEntry *he, PRIntn index, void *arg)
{
AtomImpl* atom = (AtomImpl*) he->value;
if (atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, stdout);
fputs("\n", stdout);
}
return HT_ENUMERATE_NEXT;
}
#endif
NS_COM void NS_PurgeAtomTable(void)
{
if (gAtomHashTable) {
#if defined(DEBUG) && (defined(XP_UNIX) || defined(XP_PC))
if (gAtoms) {
if (getenv("MOZ_DUMP_ATOM_LEAKS")) {
printf("*** leaking %d atoms\n", gAtoms);
PL_HashTableEnumerateEntries(gAtomHashTable, DumpAtomLeaks, 0);
}
}
#endif
PL_HashTableDestroy(gAtomHashTable);
gAtomHashTable = nsnull;
}
}
AtomImpl::AtomImpl()
{
NS_INIT_REFCNT();
// Every live atom holds a reference on the atom hashtable
gAtoms++;
}
AtomImpl::~AtomImpl()
{
NS_PRECONDITION(nsnull != gAtomHashTable, "null atom hashtable");
if (nsnull != gAtomHashTable) {
PL_HashTableRemove(gAtomHashTable, mString);
nsrefcnt cnt = --gAtoms;
if (0 == cnt) {
// When the last atom is destroyed, the atom arena is destroyed
NS_ASSERTION(0 == gAtomHashTable->nentries, "bad atom table");
PL_HashTableDestroy(gAtomHashTable);
gAtomHashTable = nsnull;
}
}
}
NS_IMPL_ISUPPORTS1(AtomImpl, nsIAtom)
void* AtomImpl::operator new(size_t size, const PRUnichar* us, PRInt32 uslen)
{
size = size + uslen * sizeof(PRUnichar);
AtomImpl* ii = (AtomImpl*) ::operator new(size);
nsCRT::memcpy(ii->mString, us, uslen * sizeof(PRUnichar));
ii->mString[uslen] = 0;
return ii;
}
NS_IMETHODIMP
AtomImpl::ToString(nsString& aBuf) /*FIX: const */
{
aBuf.SetLength(0);
aBuf.Append(mString, nsCRT::strlen(mString));
return NS_OK;
}
NS_IMETHODIMP
AtomImpl::GetUnicode(const PRUnichar **aResult) /*FIX: const */
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mString;
return NS_OK;
}
NS_IMETHODIMP
AtomImpl::SizeOf(nsISizeOfHandler* aHandler, PRUint32* _retval) /*FIX: const */
{
NS_ENSURE_ARG_POINTER(_retval);
PRUint32 sum = sizeof(*this) + nsCRT::strlen(mString) * sizeof(PRUnichar);
*_retval = sum;
return NS_OK;
}
//----------------------------------------------------------------------
static PLHashNumber HashKey(const PRUnichar* k)
{
return (PLHashNumber) nsCRT::HashValue(k);
}
static PRIntn CompareKeys(const PRUnichar* k1, const PRUnichar* k2)
{
return nsCRT::strcmp(k1, k2) == 0;
}
NS_COM nsIAtom* NS_NewAtom(const char* isolatin1)
{
nsAutoString tmp(isolatin1);
return NS_NewAtom(tmp.GetUnicode());
}
NS_COM nsIAtom* NS_NewAtom(const nsString& aString)
{
return NS_NewAtom(aString.GetUnicode());
}
NS_COM nsIAtom* NS_NewAtom(const PRUnichar* us)
{
if (nsnull == gAtomHashTable) {
gAtomHashTable = PL_NewHashTable(8, (PLHashFunction) HashKey,
(PLHashComparator) CompareKeys,
(PLHashComparator) nsnull,
nsnull, nsnull);
}
PRUint32 uslen;
PRUint32 hashCode = nsCRT::HashValue(us, &uslen);
PLHashEntry** hep = PL_HashTableRawLookup(gAtomHashTable, hashCode, us);
PLHashEntry* he = *hep;
if (nsnull != he) {
nsIAtom* id = (nsIAtom*) he->value;
NS_ADDREF(id);
return id;
}
AtomImpl* id = new(us, uslen) AtomImpl();
PL_HashTableRawAdd(gAtomHashTable, hep, hashCode, id->mString, id);
NS_ADDREF(id);
return id;
}
NS_COM nsrefcnt NS_GetNumberOfAtoms(void)
{
if (nsnull != gAtomHashTable) {
NS_PRECONDITION(nsrefcnt(gAtomHashTable->nentries) == gAtoms, "bad atom table");
}
return gAtoms;
}

View File

@@ -1,43 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsAtomTable_h__
#define nsAtomTable_h__
#include "nsIAtom.h"
class AtomImpl : public nsIAtom {
public:
AtomImpl();
virtual ~AtomImpl();
NS_DECL_ISUPPORTS
NS_DECL_NSIATOM
void* operator new(size_t size, const PRUnichar* us, PRInt32 uslen);
void operator delete(void* ptr) {
::operator delete(ptr);
}
// Actually more; 0 terminated. This slot is reserved for the
// terminating zero.
PRUnichar mString[1];
};
#endif // nsAtomTable_h__

View File

@@ -1,723 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsBuffer.h"
#include "nsAutoLock.h"
#include "nsCRT.h"
#include "nsIInputStream.h"
#include "nsIServiceManager.h"
#include "nsIPageManager.h"
////////////////////////////////////////////////////////////////////////////////
nsBuffer::nsBuffer()
: mGrowBySize(0),
mMaxSize(0),
mAllocator(nsnull),
mObserver(nsnull),
mBufferSize(0),
mReadSegment(nsnull),
mReadCursor(0),
mWriteSegment(nsnull),
mWriteCursor(0),
mReaderClosed(PR_FALSE),
mCondition(NS_OK)
{
NS_INIT_REFCNT();
PR_INIT_CLIST(&mSegments);
}
NS_IMETHODIMP
nsBuffer::Init(PRUint32 growBySize, PRUint32 maxSize,
nsIBufferObserver* observer, nsIAllocator* allocator)
{
NS_ASSERTION(sizeof(PRCList) <= SEGMENT_OVERHEAD,
"need to change SEGMENT_OVERHEAD size");
NS_ASSERTION(growBySize > SEGMENT_OVERHEAD, "bad growBySize");
mGrowBySize = growBySize;
mMaxSize = maxSize;
mObserver = observer;
NS_IF_ADDREF(mObserver);
mAllocator = allocator;
NS_ADDREF(mAllocator);
return NS_OK;
}
nsBuffer::~nsBuffer()
{
// Free any allocated pages...
while (!PR_CLIST_IS_EMPTY(&mSegments)) {
PRCList* header = (PRCList*)mSegments.next;
char* segment = (char*)header;
PR_REMOVE_LINK(header); // unlink from mSegments
(void) mAllocator->Free(segment);
}
NS_IF_RELEASE(mObserver);
NS_IF_RELEASE(mAllocator);
}
NS_IMPL_ISUPPORTS1(nsBuffer, nsIBuffer)
NS_METHOD
nsBuffer::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
nsBuffer* buf = new nsBuffer();
if (buf == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(buf);
nsresult rv = buf->QueryInterface(aIID, aResult);
NS_RELEASE(buf);
return rv;
}
////////////////////////////////////////////////////////////////////////////////
nsresult
nsBuffer::PushWriteSegment()
{
nsAutoCMonitor mon(this); // protect mSegments
if (mBufferSize >= mMaxSize) {
if (mObserver) {
nsresult rv = mObserver->OnFull(this);
if (NS_FAILED(rv)) return rv;
}
return NS_BASE_STREAM_WOULD_BLOCK;
}
// allocate a new segment to write into
PRCList* header;
header = (PRCList*)mAllocator->Alloc(mGrowBySize);
if (header == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
mBufferSize += mGrowBySize;
PR_INSERT_BEFORE(header, &mSegments); // insert at end
// initialize the write segment
mWriteSegment = header;
mWriteSegmentEnd = (char*)mWriteSegment + mGrowBySize;
mWriteCursor = (char*)mWriteSegment + sizeof(PRCList);
return NS_OK;
}
nsresult
nsBuffer::PopReadSegment()
{
nsresult rv;
nsAutoCMonitor mon(this); // protect mSegments
PRCList* header = (PRCList*)mSegments.next;
char* segment = (char*)header;
NS_ASSERTION(mReadSegment == header, "wrong segment");
// make sure that the writer isn't still in this segment (that the
// reader is removing)
NS_ASSERTION(!(segment <= mWriteCursor && mWriteCursor < segment + mGrowBySize),
"removing writer's segment");
PR_REMOVE_LINK(header); // unlink from mSegments
mBufferSize -= mGrowBySize;
rv = mAllocator->Free(segment);
if (NS_FAILED(rv)) return rv;
// initialize the read segment
if (PR_CLIST_IS_EMPTY(&mSegments)) {
mReadSegment = nsnull;
mReadSegmentEnd = nsnull;
mReadCursor = nsnull;
if (mObserver) {
rv = mObserver->OnEmpty(this);
if (NS_FAILED(rv)) return rv;
}
return NS_BASE_STREAM_WOULD_BLOCK;
}
else {
mReadSegment = mSegments.next;
mReadSegmentEnd = (char*)mReadSegment + mGrowBySize;
mReadCursor = (char*)mReadSegment + sizeof(PRCList);
}
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIBuffer methods:
NS_IMETHODIMP
nsBuffer::ReadSegments(nsWriteSegmentFun writer, void* closure, PRUint32 count,
PRUint32 *readCount)
{
NS_ASSERTION(!mReaderClosed, "state change error");
nsAutoCMonitor mon(this);
nsresult rv = NS_OK;
PRUint32 readBufferLen;
const char* readBuffer;
*readCount = 0;
while (count > 0) {
rv = GetReadSegment(0, &readBuffer, &readBufferLen);
if (NS_FAILED(rv) || readBufferLen == 0) {
return *readCount == 0 ? rv : NS_OK;
}
readBufferLen = PR_MIN(readBufferLen, count);
while (readBufferLen > 0) {
PRUint32 writeCount;
rv = writer(closure, readBuffer, *readCount, readBufferLen, &writeCount);
NS_ASSERTION(rv != NS_BASE_STREAM_EOF, "Write should not return EOF");
if (rv == NS_BASE_STREAM_WOULD_BLOCK || NS_FAILED(rv) || writeCount == 0) {
// if we failed to write just report what we were
// able to read so far
return *readCount == 0 ? rv : NS_OK;
}
NS_ASSERTION(writeCount <= readBufferLen, "writer returned bad writeCount");
readBuffer += writeCount;
readBufferLen -= writeCount;
*readCount += writeCount;
count -= writeCount;
if (mReadCursor + writeCount == mReadSegmentEnd) {
rv = PopReadSegment();
if (NS_FAILED(rv)) {
return *readCount == 0 ? rv : NS_OK;
}
}
else {
mReadCursor += writeCount;
}
}
}
return NS_OK;
}
static NS_METHOD
nsWriteToRawBuffer(void* closure,
const char* fromRawSegment,
PRUint32 offset,
PRUint32 count,
PRUint32 *writeCount)
{
char* toBuf = (char*)closure;
nsCRT::memcpy(&toBuf[offset], fromRawSegment, count);
*writeCount = count;
return NS_OK;
}
NS_IMETHODIMP
nsBuffer::Read(char* toBuf, PRUint32 bufLen, PRUint32 *readCount)
{
return ReadSegments(nsWriteToRawBuffer, toBuf, bufLen, readCount);
}
NS_IMETHODIMP
nsBuffer::GetReadSegment(PRUint32 segmentLogicalOffset,
const char* *resultSegment,
PRUint32 *resultSegmentLen)
{
nsAutoCMonitor mon(this);
// set the read segment and cursor if not already set
if (mReadSegment == nsnull) {
if (PR_CLIST_IS_EMPTY(&mSegments)) {
*resultSegmentLen = 0;
*resultSegment = nsnull;
return mCondition;
}
else {
mReadSegment = mSegments.next;
mReadSegmentEnd = (char*)mReadSegment + mGrowBySize;
mReadCursor = (char*)mReadSegment + sizeof(PRCList);
}
}
// now search for the segment starting from segmentLogicalOffset and return it
PRCList* curSeg = mReadSegment;
char* curSegStart = mReadCursor;
char* curSegEnd = mReadSegmentEnd;
PRInt32 amt;
PRInt32 offset = (PRInt32)segmentLogicalOffset;
while (offset >= 0) {
// snapshot the write cursor into a local variable -- this allows
// a writer to freely change it while we're reading while avoiding
// using a lock
char* snapshotWriteCursor = mWriteCursor; // atomic
// next check if the write cursor is in our segment
if (curSegStart <= snapshotWriteCursor &&
snapshotWriteCursor < curSegEnd) {
// same segment -- read up to the snapshotWriteCursor
curSegEnd = snapshotWriteCursor;
amt = curSegEnd - curSegStart;
if (offset < amt) {
// segmentLogicalOffset is in this segment, so read up to its end
*resultSegmentLen = amt - offset;
*resultSegment = curSegStart + offset;
return NS_OK;
}
else {
// don't continue past the write segment
*resultSegmentLen = 0;
*resultSegment = nsnull;
return mCondition;
}
}
else {
amt = curSegEnd - curSegStart;
if (offset < amt) {
// segmentLogicalOffset is in this segment, so read up to its end
*resultSegmentLen = amt - offset;
*resultSegment = curSegStart + offset;
return NS_OK;
}
else {
curSeg = PR_NEXT_LINK(curSeg);
if (curSeg == mReadSegment) {
// been all the way around
*resultSegmentLen = 0;
*resultSegment = nsnull;
return mCondition;
}
curSegEnd = (char*)curSeg + mGrowBySize;
curSegStart = (char*)curSeg + sizeof(PRCList);
offset -= amt;
}
}
}
NS_NOTREACHED("nsBuffer::GetReadSegment failed");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsBuffer::GetReadableAmount(PRUint32 *result)
{
NS_ASSERTION(!mReaderClosed, "state change error");
nsAutoCMonitor mon(this);
*result = 0;
// first set the read segment and cursor if not already set
if (mReadSegment == nsnull) {
if (PR_CLIST_IS_EMPTY(&mSegments)) {
return NS_OK;
}
else {
mReadSegment = mSegments.next;
mReadSegmentEnd = (char*)mReadSegment + mGrowBySize;
mReadCursor = (char*)mReadSegment + sizeof(PRCList);
}
}
// now search for the segment starting from segmentLogicalOffset and return it
PRCList* curSeg = mReadSegment;
char* curSegStart = mReadCursor;
char* curSegEnd = mReadSegmentEnd;
PRInt32 amt;
while (PR_TRUE) {
// snapshot the write cursor into a local variable -- this allows
// a writer to freely change it while we're reading while avoiding
// using a lock
char* snapshotWriteCursor = mWriteCursor; // atomic
// next check if the write cursor is in our segment
if (curSegStart <= snapshotWriteCursor &&
snapshotWriteCursor < curSegEnd) {
// same segment -- read up to the snapshotWriteCursor
curSegEnd = snapshotWriteCursor;
amt = curSegEnd - curSegStart;
*result += amt;
return NS_OK;
}
else {
amt = curSegEnd - curSegStart;
*result += amt;
curSeg = PR_NEXT_LINK(curSeg);
if (curSeg == mReadSegment) {
// been all the way around
return NS_OK;
}
curSegEnd = (char*)curSeg + mGrowBySize;
curSegStart = (char*)curSeg + sizeof(PRCList);
}
}
return NS_ERROR_FAILURE;
}
#define COMPARE(s1, s2, i) ignoreCase ? nsCRT::strncasecmp((const char *)s1, (const char *)s2, (PRUint32)i) : nsCRT::strncmp((const char *)s1, (const char *)s2, (PRUint32)i)
NS_IMETHODIMP
nsBuffer::Search(const char* string, PRBool ignoreCase,
PRBool *found, PRUint32 *offsetSearchedTo)
{
NS_ASSERTION(!mReaderClosed, "state change error");
nsresult rv;
const char* bufSeg1;
PRUint32 bufSegLen1;
PRUint32 segmentPos = 0;
PRUint32 strLen = nsCRT::strlen(string);
rv = GetReadSegment(segmentPos, &bufSeg1, &bufSegLen1);
if (NS_FAILED(rv) || bufSegLen1 == 0) {
*found = PR_FALSE;
*offsetSearchedTo = segmentPos;
return NS_OK;
}
while (PR_TRUE) {
PRUint32 i;
// check if the string is in the buffer segment
for (i = 0; i < bufSegLen1 - strLen + 1; i++) {
if (COMPARE(&bufSeg1[i], string, strLen) == 0) {
*found = PR_TRUE;
*offsetSearchedTo = segmentPos + i;
return NS_OK;
}
}
// get the next segment
const char* bufSeg2;
PRUint32 bufSegLen2;
segmentPos += bufSegLen1;
rv = GetReadSegment(segmentPos, &bufSeg2, &bufSegLen2);
if (NS_FAILED(rv) || bufSegLen2 == 0) {
*found = PR_FALSE;
if (mCondition != NS_OK) // XXX NS_FAILED?
*offsetSearchedTo = segmentPos - bufSegLen1;
else
*offsetSearchedTo = segmentPos - bufSegLen1 - strLen + 1;
return NS_OK;
}
// check if the string is straddling the next buffer segment
PRUint32 limit = PR_MIN(strLen, bufSegLen2 + 1);
for (i = 0; i < limit; i++) {
PRUint32 strPart1Len = strLen - i - 1;
PRUint32 strPart2Len = strLen - strPart1Len;
const char* strPart2 = &string[strLen - strPart2Len];
PRUint32 bufSeg1Offset = bufSegLen1 - strPart1Len;
if (COMPARE(&bufSeg1[bufSeg1Offset], string, strPart1Len) == 0 &&
COMPARE(bufSeg2, strPart2, strPart2Len) == 0) {
*found = PR_TRUE;
*offsetSearchedTo = segmentPos - strPart1Len;
return NS_OK;
}
}
// finally continue with the next buffer
bufSeg1 = bufSeg2;
bufSegLen1 = bufSegLen2;
}
NS_NOTREACHED("can't get here");
return NS_ERROR_FAILURE; // keep compiler happy
}
NS_IMETHODIMP
nsBuffer::ReaderClosed()
{
nsresult rv = NS_OK;
nsAutoCMonitor mon(this); // protect mSegments
// first prevent any more writing
mReaderClosed = PR_TRUE;
// then free any unread segments...
// first set the read segment and cursor if not already set
if (mReadSegment == nsnull) {
if (!PR_CLIST_IS_EMPTY(&mSegments)) {
mReadSegment = mSegments.next;
mReadSegmentEnd = (char*)mReadSegment + mGrowBySize;
mReadCursor = (char*)mReadSegment + sizeof(PRCList);
}
}
while (mReadSegment) {
// snapshot the write cursor into a local variable -- this allows
// a writer to freely change it while we're reading while avoiding
// using a lock
char* snapshotWriteCursor = mWriteCursor; // atomic
// next check if the write cursor is in our segment
if (mReadCursor <= snapshotWriteCursor &&
snapshotWriteCursor < mReadSegmentEnd) {
// same segment -- we've discarded all the unread segments we
// can, so just updatethe read cursor
mReadCursor = mWriteCursor;
break;
}
// else advance to the next segment, freeing this one
rv = PopReadSegment();
if (NS_FAILED(rv)) break;
}
#ifdef DEBUG
PRUint32 amt;
const char* buf;
rv = GetReadSegment(0, &buf, &amt);
NS_ASSERTION(rv == NS_BASE_STREAM_EOF ||
(NS_SUCCEEDED(rv) && amt == 0), "ReaderClosed failed");
#endif
return rv;
}
NS_IMETHODIMP
nsBuffer::GetCondition(nsresult *result)
{
*result = mCondition;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
NS_IMETHODIMP
nsBuffer::WriteSegments(nsReadSegmentFun reader, void* closure, PRUint32 count,
PRUint32 *writeCount)
{
nsresult rv = NS_OK;
nsAutoCMonitor mon(this);
*writeCount = 0;
if (mReaderClosed) {
rv = NS_BASE_STREAM_CLOSED;
goto done;
}
if (NS_FAILED(mCondition)) {
rv = mCondition;
goto done;
}
while (count > 0) {
PRUint32 writeBufLen;
char* writeBuf;
rv = GetWriteSegment(&writeBuf, &writeBufLen);
if (NS_FAILED(rv) || writeBufLen == 0) {
// if we failed to allocate a new segment, we're probably out
// of memory, but we don't care -- just report what we were
// able to write so far
rv = (*writeCount == 0) ? rv : NS_OK;
goto done;
}
writeBufLen = PR_MIN(writeBufLen, count);
while (writeBufLen > 0) {
PRUint32 readCount = 0;
rv = reader(closure, writeBuf, *writeCount, writeBufLen, &readCount);
if (rv == NS_BASE_STREAM_WOULD_BLOCK || readCount == 0) {
// if the place we're putting the data would block (probably ran
// out of room) just return what we were able to write so far
rv = (*writeCount == 0) ? rv : NS_OK;
goto done;
}
if (NS_FAILED(rv)) {
// save the failure condition so that we can get it again later
nsresult rv2 = SetCondition(rv);
NS_ASSERTION(NS_SUCCEEDED(rv2), "SetCondition failed");
// if we failed to read just report what we were
// able to write so far
rv = (*writeCount == 0) ? rv : NS_OK;
goto done;
}
NS_ASSERTION(readCount <= writeBufLen, "reader returned bad readCount");
writeBuf += readCount;
writeBufLen -= readCount;
*writeCount += readCount;
count -= readCount;
// set the write cursor after the data is valid
if (mWriteCursor + readCount == mWriteSegmentEnd) {
mWriteSegment = nsnull; // allocate a new segment next time around
mWriteSegmentEnd = nsnull;
mWriteCursor = nsnull;
}
else
mWriteCursor += readCount;
}
}
done:
if (mObserver && *writeCount) {
mObserver->OnWrite(this, *writeCount);
}
return rv;
}
static NS_METHOD
nsReadFromRawBuffer(void* closure,
char* toRawSegment,
PRUint32 offset,
PRUint32 count,
PRUint32 *readCount)
{
const char* fromBuf = (const char*)closure;
nsCRT::memcpy(toRawSegment, &fromBuf[offset], count);
*readCount = count;
return NS_OK;
}
NS_IMETHODIMP
nsBuffer::Write(const char* fromBuf, PRUint32 bufLen, PRUint32 *writeCount)
{
return WriteSegments(nsReadFromRawBuffer, (void*)fromBuf, bufLen, writeCount);
}
static NS_METHOD
nsReadFromInputStream(void* closure,
char* toRawSegment,
PRUint32 offset,
PRUint32 count,
PRUint32 *readCount)
{
nsIInputStream* fromStream = (nsIInputStream*)closure;
return fromStream->Read(toRawSegment, count, readCount);
}
NS_IMETHODIMP
nsBuffer::WriteFrom(nsIInputStream* fromStream, PRUint32 count, PRUint32 *writeCount)
{
return WriteSegments(nsReadFromInputStream, fromStream, count, writeCount);
}
NS_IMETHODIMP
nsBuffer::GetWriteSegment(char* *resultSegment,
PRUint32 *resultSegmentLen)
{
nsAutoCMonitor mon(this);
if (mReaderClosed)
return NS_BASE_STREAM_CLOSED;
nsresult rv;
*resultSegmentLen = 0;
*resultSegment = nsnull;
if (mWriteSegment == nsnull) {
rv = PushWriteSegment();
if (NS_FAILED(rv) || rv == NS_BASE_STREAM_WOULD_BLOCK) return rv;
NS_ASSERTION(mWriteSegment != nsnull, "failed to allocate segment");
}
*resultSegmentLen = mWriteSegmentEnd - mWriteCursor;
*resultSegment = mWriteCursor;
NS_ASSERTION(*resultSegmentLen > 0, "Failed to get write segment.");
return NS_OK;
}
NS_IMETHODIMP
nsBuffer::GetWritableAmount(PRUint32 *amount)
{
if (mReaderClosed)
return NS_BASE_STREAM_CLOSED;
nsresult rv;
PRUint32 readableAmount;
rv = GetReadableAmount(&readableAmount);
if (NS_FAILED(rv)) return rv;
*amount = mMaxSize - readableAmount;
return NS_OK;
}
NS_IMETHODIMP
nsBuffer::GetReaderClosed(PRBool *result)
{
*result = mReaderClosed;
return NS_OK;
}
NS_IMETHODIMP
nsBuffer::SetCondition(nsresult condition)
{
nsAutoCMonitor mon(this);
if (mReaderClosed)
return NS_BASE_STREAM_CLOSED;
mCondition = condition;
mWriteSegment = nsnull; // allows reader to free last segment w/o asserting
mWriteSegmentEnd = nsnull;
// don't reset mWriteCursor here -- we need it for the EOF point in the buffer
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
static NS_DEFINE_CID(kAllocatorCID, NS_ALLOCATOR_CID);
NS_COM nsresult
NS_NewBuffer(nsIBuffer* *result,
PRUint32 growBySize, PRUint32 maxSize,
nsIBufferObserver* observer)
{
nsresult rv;
NS_WITH_SERVICE(nsIAllocator, alloc, kAllocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
nsBuffer* buf;
rv = nsBuffer::Create(NULL, nsIBuffer::GetIID(), (void**)&buf);
if (NS_FAILED(rv)) return rv;
rv = buf->Init(growBySize, maxSize, observer, alloc);
if (NS_FAILED(rv)) {
NS_RELEASE(buf);
return rv;
}
*result = buf;
return NS_OK;
}
static NS_DEFINE_CID(kPageManagerCID, NS_PAGEMANAGER_CID);
NS_COM nsresult
NS_NewPageBuffer(nsIBuffer* *result,
PRUint32 growBySize, PRUint32 maxSize,
nsIBufferObserver* observer)
{
nsresult rv;
NS_WITH_SERVICE(nsIAllocator, alloc, kPageManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
nsBuffer* buf;
rv = nsBuffer::Create(NULL, nsIBuffer::GetIID(), (void**)&buf);
if (NS_FAILED(rv)) return rv;
rv = buf->Init(growBySize, maxSize, observer, alloc);
if (NS_FAILED(rv)) {
NS_RELEASE(buf);
return rv;
}
*result = buf;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,87 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsBuffer_h___
#define nsBuffer_h___
#include "nsIBuffer.h"
#include "nscore.h"
#include "prclist.h"
#include "nsIAllocator.h"
class nsBuffer : public nsIBuffer {
public:
NS_DECL_ISUPPORTS
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
// nsIBuffer methods:
NS_IMETHOD Init(PRUint32 growBySize, PRUint32 maxSize,
nsIBufferObserver* observer, nsIAllocator* allocator);
NS_IMETHOD Read(char* toBuf, PRUint32 bufLen, PRUint32 *readCount);
NS_IMETHOD ReadSegments(nsWriteSegmentFun writer, void* closure, PRUint32 count,
PRUint32 *readCount);
NS_IMETHOD GetReadSegment(PRUint32 segmentLogicalOffset,
const char* *resultSegment,
PRUint32 *resultSegmentLen);
NS_IMETHOD GetReadableAmount(PRUint32 *amount);
NS_IMETHOD Search(const char* forString, PRBool ignoreCase,
PRBool *found, PRUint32 *offsetSearchedTo);
NS_IMETHOD ReaderClosed(void);
NS_IMETHOD GetCondition(nsresult *result);
NS_IMETHOD Write(const char* fromBuf, PRUint32 bufLen, PRUint32 *writeCount);
NS_IMETHOD WriteFrom(nsIInputStream* fromStream, PRUint32 count, PRUint32 *writeCount);
NS_IMETHOD WriteSegments(nsReadSegmentFun reader, void* closure, PRUint32 count,
PRUint32 *writeCount);
NS_IMETHOD GetWriteSegment(char* *resultSegment,
PRUint32 *resultSegmentLen);
NS_IMETHOD GetWritableAmount(PRUint32 *amount);
NS_IMETHOD GetReaderClosed(PRBool *result);
NS_IMETHOD SetCondition(nsresult condition);
// nsBuffer methods:
nsBuffer();
virtual ~nsBuffer();
nsresult PushWriteSegment();
nsresult PopReadSegment();
protected:
PRUint32 mGrowBySize;
PRUint32 mMaxSize;
nsIAllocator* mAllocator;
nsIBufferObserver* mObserver;
PRCList mSegments;
PRUint32 mBufferSize;
PRCList* mReadSegment;
char* mReadSegmentEnd;
char* mReadCursor;
PRCList* mWriteSegment;
char* mWriteSegmentEnd;
char* mWriteCursor;
PRBool mReaderClosed;
nsresult mCondition;
};
#endif // nsBuffer_h___

View File

@@ -1,40 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsBufferPoolService_h___
#define nsBufferPoolService_h___
#include "nsIBufferPoolService.h"
class nsBufferPoolService : public nsIBufferPoolService {
public:
NS_DECL_ISUPPORTS
// nsIBufferPoolService methods:
NS_IMETHOD NewBuffer(PRUint32 minSize, PRUint32 maxSize,
nsIByteBuffer* *result);
// nsBufferPoolService methods:
nsBufferPoolService();
virtual ~nsBufferPoolService();
protected:
};
#endif // nsBufferPoolService_h___

View File

@@ -1,151 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsByteBuffer.h"
#include "nsIInputStream.h"
#include "nsCRT.h"
#define MIN_BUFFER_SIZE 32
ByteBufferImpl::ByteBufferImpl(void)
: mBuffer(NULL), mSpace(0), mLength(0)
{
NS_INIT_REFCNT();
}
NS_IMETHODIMP
ByteBufferImpl::Init(PRUint32 aBufferSize)
{
if (aBufferSize < MIN_BUFFER_SIZE) {
aBufferSize = MIN_BUFFER_SIZE;
}
mSpace = aBufferSize;
mLength = 0;
mBuffer = new char[aBufferSize];
return mBuffer ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
NS_IMPL_ISUPPORTS1(ByteBufferImpl,nsIByteBuffer)
ByteBufferImpl::~ByteBufferImpl()
{
if (nsnull != mBuffer) {
delete[] mBuffer;
mBuffer = nsnull;
}
mLength = 0;
}
NS_METHOD
ByteBufferImpl::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
ByteBufferImpl* it = new ByteBufferImpl();
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = it->QueryInterface(aIID, (void**)aResult);
NS_RELEASE(it);
return rv;
}
NS_IMETHODIMP_(PRUint32)
ByteBufferImpl::GetLength(void) const
{
return mLength;
}
NS_IMETHODIMP_(PRUint32)
ByteBufferImpl::GetBufferSize(void) const
{
return mSpace;
}
NS_IMETHODIMP_(char*)
ByteBufferImpl::GetBuffer(void) const
{
return mBuffer;
}
NS_IMETHODIMP_(PRBool)
ByteBufferImpl::Grow(PRUint32 aNewSize)
{
if (aNewSize < MIN_BUFFER_SIZE) {
aNewSize = MIN_BUFFER_SIZE;
}
char* newbuf = new char[aNewSize];
if (nsnull != newbuf) {
if (0 != mLength) {
nsCRT::memcpy(newbuf, mBuffer, mLength);
}
delete[] mBuffer;
mBuffer = newbuf;
return PR_TRUE;
}
return PR_FALSE;
}
NS_IMETHODIMP_(PRInt32)
ByteBufferImpl::Fill(nsresult* aErrorCode, nsIInputStream* aStream,
PRUint32 aKeep)
{
NS_PRECONDITION(nsnull != aStream, "null stream");
NS_PRECONDITION(aKeep <= mLength, "illegal keep count");
if ((nsnull == aStream) || (PRUint32(aKeep) > PRUint32(mLength))) {
// whoops
*aErrorCode = NS_BASE_STREAM_ILLEGAL_ARGS;
return -1;
}
if (0 != aKeep) {
// Slide over kept data
nsCRT::memmove(mBuffer, mBuffer + (mLength - aKeep), aKeep);
}
// Read in some new data
mLength = aKeep;
PRUint32 nb;
*aErrorCode = aStream->Read(mBuffer + aKeep, mSpace - aKeep, &nb);
if (NS_SUCCEEDED(*aErrorCode)) {
mLength += nb;
}
else
nb = 0;
return nb;
}
NS_COM nsresult NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult,
nsISupports* aOuter,
PRUint32 aBufferSize)
{
nsresult rv;
nsIByteBuffer* buf;
rv = ByteBufferImpl::Create(aOuter, nsIByteBuffer::GetIID(), (void**)&buf);
if (NS_FAILED(rv)) return rv;
rv = buf->Init(aBufferSize);
if (NS_FAILED(rv)) {
NS_RELEASE(buf);
return rv;
}
*aInstancePtrResult = buf;
return rv;
}

View File

@@ -1,47 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsByteBuffer_h__
#define nsByteBuffer_h__
#include "nsIByteBuffer.h"
class ByteBufferImpl : public nsIByteBuffer {
public:
ByteBufferImpl(void);
virtual ~ByteBufferImpl();
NS_DECL_ISUPPORTS
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
NS_IMETHOD Init(PRUint32 aBufferSize);
NS_IMETHOD_(PRUint32) GetLength(void) const;
NS_IMETHOD_(PRUint32) GetBufferSize(void) const;
NS_IMETHOD_(char*) GetBuffer() const;
NS_IMETHOD_(PRBool) Grow(PRUint32 aNewSize);
NS_IMETHOD_(PRInt32) Fill(nsresult* aErrorCode, nsIInputStream* aStream,
PRUint32 aKeep);
char* mBuffer;
PRUint32 mSpace;
PRUint32 mLength;
};
#endif // nsByteBuffer_h__

View File

@@ -1,555 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/**
* MODULE NOTES:
* @update gess7/30/98
*
* Much as I hate to do it, we were using string compares wrong.
* Often, programmers call functions like strcmp(s1,s2), and pass
* one or more null strings. Rather than blow up on these, I've
* added quick checks to ensure that cases like this don't cause
* us to fail.
*
* In general, if you pass a null into any of these string compare
* routines, we simply return 0.
*/
#include "nsCRT.h"
#include "nsUnicharUtilCIID.h"
#include "nsIServiceManager.h"
#include "nsICaseConversion.h"
// XXX Bug: These tables don't lowercase the upper 128 characters properly
// This table maps uppercase characters to lower case characters;
// characters that are neither upper nor lower case are unaffected.
static const unsigned char kUpper2Lower[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64,
// upper band mapped to lower [A-Z] => [a-z]
97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
112,113,114,115,116,117,118,119,120,121,122,
91, 92, 93, 94, 95,
96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
};
static const unsigned char kLower2Upper[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96,
// lower band mapped to upper [a-z] => [A-Z]
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
};
// XXX bug: this doesn't map 0x80 to 0x9f properly
const PRUnichar kIsoLatin1ToUCS2[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
};
//----------------------------------------------------------------------
#define TOLOWER(_ucs2) \
(((_ucs2) < 128) ? PRUnichar(kUpper2Lower[_ucs2]) : _ToLower(_ucs2))
#define TOUPPER(_ucs2) \
(((_ucs2) < 128) ? PRUnichar(kLower2Upper[_ucs2]) : _ToUpper(_ucs2))
class HandleCaseConversionShutdown : public nsIShutdownListener {
public :
NS_IMETHOD OnShutdown(const nsCID& cid, nsISupports* service);
HandleCaseConversionShutdown(void) { NS_INIT_REFCNT(); }
virtual ~HandleCaseConversionShutdown(void) {}
NS_DECL_ISUPPORTS
};
static NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
static nsICaseConversion * gCaseConv = NULL;
NS_IMPL_ISUPPORTS1(HandleCaseConversionShutdown, nsIShutdownListener)
nsresult
HandleCaseConversionShutdown::OnShutdown(const nsCID& cid,
nsISupports* aService)
{
if (cid.Equals(kUnicharUtilCID)) {
NS_ASSERTION(aService == gCaseConv, "wrong service!");
gCaseConv->Release();
gCaseConv = NULL;
}
return NS_OK;
}
static HandleCaseConversionShutdown* gListener = NULL;
static void StartUpCaseConversion()
{
nsresult err;
if ( NULL == gListener )
{
gListener = new HandleCaseConversionShutdown();
gListener->AddRef();
}
err = nsServiceManager::GetService(kUnicharUtilCID, NS_GET_IID(nsICaseConversion),
(nsISupports**) &gCaseConv, gListener);
}
static void CheckCaseConversion()
{
if(NULL == gCaseConv )
StartUpCaseConversion();
NS_ASSERTION( gCaseConv != NULL , "cannot obtain UnicharUtil");
}
static PRUnichar _ToLower(PRUnichar aChar)
{
PRUnichar oLower;
CheckCaseConversion();
nsresult err = gCaseConv->ToLower(aChar, &oLower);
NS_ASSERTION( NS_SUCCEEDED(err), "failed to communicate to UnicharUtil");
return ( NS_SUCCEEDED(err) ) ? oLower : aChar ;
}
static PRUnichar _ToUpper(PRUnichar aChar)
{
nsresult err;
PRUnichar oUpper;
CheckCaseConversion();
err = gCaseConv->ToUpper(aChar, &oUpper);
NS_ASSERTION( NS_SUCCEEDED(err), "failed to communicate to UnicharUtil");
return ( NS_SUCCEEDED(err) ) ? oUpper : aChar ;
}
//----------------------------------------------------------------------
PRUnichar nsCRT::ToUpper(PRUnichar aChar)
{
return TOUPPER(aChar);
}
PRUnichar nsCRT::ToLower(PRUnichar aChar)
{
return TOLOWER(aChar);
}
PRBool nsCRT::IsUpper(PRUnichar aChar)
{
return aChar != nsCRT::ToLower(aChar);
}
PRBool nsCRT::IsLower(PRUnichar aChar)
{
return aChar != nsCRT::ToUpper(aChar);
}
////////////////////////////////////////////////////////////////////////////////
// My lovely strtok routine
#define IS_DELIM(m, c) ((m)[(c) >> 3] & (1 << ((c) & 7)))
#define SET_DELIM(m, c) ((m)[(c) >> 3] |= (1 << ((c) & 7)))
#define DELIM_TABLE_SIZE 32
char* nsCRT::strtok(char* string, const char* delims, char* *newStr)
{
NS_ASSERTION(string, "Unlike regular strtok, the first argument cannot be null.");
char delimTable[DELIM_TABLE_SIZE];
PRUint32 i;
char* result;
char* str = string;
for (i = 0; i < DELIM_TABLE_SIZE; i++)
delimTable[i] = '\0';
for (i = 0; i < DELIM_TABLE_SIZE && delims[i]; i++) {
SET_DELIM(delimTable, delims[i]);
}
NS_ASSERTION(delims[i] == '\0', "too many delimiters");
// skip to beginning
while (*str && IS_DELIM(delimTable, *str)) {
str++;
}
result = str;
// fix up the end of the token
while (*str) {
if (IS_DELIM(delimTable, *str)) {
*str++ = '\0';
break;
}
str++;
}
*newStr = str;
return str == result ? NULL : result;
}
////////////////////////////////////////////////////////////////////////////////
PRUint32 nsCRT::strlen(const PRUnichar* s)
{
PRUint32 len = 0;
if(s) {
while (*s++ != 0) {
len++;
}
}
return len;
}
/**
* Compare unichar string ptrs, stopping at the 1st null
* NOTE: If both are null, we return 0.
* @update gess7/30/98
* @param s1 and s2 both point to unichar strings
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
*/
PRInt32 nsCRT::strcmp(const PRUnichar* s1, const PRUnichar* s2)
{
if(s1 && s2) {
for (;;) {
PRUnichar c1 = *s1++;
PRUnichar c2 = *s2++;
if (c1 != c2) {
if (c1 < c2) return -1;
return 1;
}
if ((0==c1) || (0==c2)) break;
}
}
return 0;
}
/**
* Compare unichar string ptrs, stopping at the 1st null or nth char.
* NOTE: If either is null, we return 0.
* @update gess7/30/98
* @param s1 and s2 both point to unichar strings
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
*/
PRInt32 nsCRT::strncmp(const PRUnichar* s1, const PRUnichar* s2, PRUint32 n)
{
if(s1 && s2) {
if(n != 0) {
do {
PRUnichar c1 = *s1++;
PRUnichar c2 = *s2++;
if (c1 != c2) {
if (c1 < c2) return -1;
return 1;
}
if ((0==c1) || (0==c2)) break;
} while (--n != 0);
}
}
return 0;
}
/**
* Compare unichar string ptrs without regard to case
* NOTE: If both are null, we return 0.
* @update gess7/30/98
* @param s1 and s2 both point to unichar strings
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
*/
PRInt32 nsCRT::strcasecmp(const PRUnichar* s1, const PRUnichar* s2)
{
if(s1 && s2) {
for (;;) {
PRUnichar c1 = *s1++;
PRUnichar c2 = *s2++;
if (c1 != c2) {
c1 = TOLOWER(c1);
c2 = TOLOWER(c2);
if (c1 != c2) {
if (c1 < c2) return -1;
return 1;
}
}
if ((0==c1) || (0==c2)) break;
}
}
return 0;
}
/**
* Compare unichar string ptrs, stopping at the 1st null or nth char;
* also ignoring the case of characters.
* NOTE: If both are null, we return 0.
* @update gess7/30/98
* @param s1 and s2 both point to unichar strings
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
*/
PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const PRUnichar* s2, PRUint32 n)
{
if(s1 && s2) {
if(n != 0){
do {
PRUnichar c1 = *s1++;
PRUnichar c2 = *s2++;
if (c1 != c2) {
c1 = TOLOWER(c1);
c2 = TOLOWER(c2);
if (c1 != c2) {
if (c1 < c2) return -1;
return 1;
}
}
if ((0==c1) || (0==c2)) break;
} while (--n != 0);
}
}
return 0;
}
/**
* Compare a unichar string ptr to cstring.
* NOTE: If both are null, we return 0.
* @update gess7/30/98
* @param s1 points to unichar string
* @param s2 points to cstring
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
*/
PRInt32 nsCRT::strcmp(const PRUnichar* s1, const char* s2)
{
if(s1 && s2) {
for (;;) {
PRUnichar c1 = *s1++;
PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++];
if (c1 != c2) {
if (c1 < c2) return -1;
return 1;
}
if ((0==c1) || (0==c2)) break;
}
}
return 0;
}
/**
* Compare a unichar string ptr to cstring, up to N chars.
* NOTE: If both are null, we return 0.
* @update gess7/30/98
* @param s1 points to unichar string
* @param s2 points to cstring
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
*/
PRInt32 nsCRT::strncmp(const PRUnichar* s1, const char* s2, PRUint32 n)
{
if(s1 && s2) {
if(n != 0){
do {
PRUnichar c1 = *s1++;
PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++];
if (c1 != c2) {
if (c1 < c2) return -1;
return 1;
}
if ((0==c1) || (0==c2)) break;
} while (--n != 0);
}
}
return 0;
}
/**
* Compare a unichar string ptr to cstring without regard to case
* NOTE: If both are null, we return 0.
* @update gess7/30/98
* @param s1 points to unichar string
* @param s2 points to cstring
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
*/
PRInt32 nsCRT::strcasecmp(const PRUnichar* s1, const char* s2)
{
if(s1 && s2) {
for (;;) {
PRUnichar c1 = *s1++;
PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++];
if (c1 != c2) {
c1 = TOLOWER(c1);
c2 = TOLOWER(c2);
if (c1 != c2) {
if (c1 < c2) return -1;
return 1;
}
}
if ((0==c1) || (0==c2)) break;
}
}
return 0;
}
/**
* Caseless compare up to N chars between unichar string ptr to cstring.
* NOTE: If both are null, we return 0.
* @update gess7/30/98
* @param s1 points to unichar string
* @param s2 points to cstring
* @return 0 if they match, -1 if s1<s2; 1 if s1>s2
*/
PRInt32 nsCRT::strncasecmp(const PRUnichar* s1, const char* s2, PRUint32 n)
{
if(s1 && s2){
if(n != 0){
do {
PRUnichar c1 = *s1++;
PRUnichar c2 = kIsoLatin1ToUCS2[*(const unsigned char*)s2++];
if (c1 != c2) {
c1 = TOLOWER(c1);
c2 = TOLOWER(c2);
if (c1 != c2) {
if (c1 < c2) return -1;
return 1;
}
}
if (c1 == 0) break;
} while (--n != 0);
}
}
return 0;
}
PRUnichar* nsCRT::strdup(const PRUnichar* str)
{
PRUint32 len = nsCRT::strlen(str) + 1; // add one for null
nsCppSharedAllocator<PRUnichar> shared_allocator;
PRUnichar* rslt = shared_allocator.allocate(len);
// PRUnichar* rslt = new PRUnichar[len];
if (rslt == NULL) return NULL;
nsCRT::memcpy(rslt, str, len * sizeof(PRUnichar));
return rslt;
}
PRUint32 nsCRT::HashValue(const char* us)
{
PRUint32 rv = 0;
if(us) {
char ch;
while ((ch = *us++) != 0) {
// FYI: rv = rv*37 + ch
rv = ((rv << 5) + (rv << 2) + rv) + ch;
}
}
return rv;
}
PRUint32 nsCRT::HashValue(const char* us, PRUint32* uslenp)
{
PRUint32 rv = 0;
PRUint32 len = 0;
char ch;
while ((ch = *us++) != 0) {
// FYI: rv = rv*37 + ch
rv = ((rv << 5) + (rv << 2) + rv) + ch;
len++;
}
*uslenp = len;
return rv;
}
PRUint32 nsCRT::HashValue(const PRUnichar* us)
{
PRUint32 rv = 0;
if(us) {
PRUnichar ch;
while ((ch = *us++) != 0) {
// FYI: rv = rv*37 + ch
rv = ((rv << 5) + (rv << 2) + rv) + ch;
}
}
return rv;
}
PRUint32 nsCRT::HashValue(const PRUnichar* us, PRUint32* uslenp)
{
PRUint32 rv = 0;
PRUint32 len = 0;
PRUnichar ch;
while ((ch = *us++) != 0) {
// FYI: rv = rv*37 + ch
rv = ((rv << 5) + (rv << 2) + rv) + ch;
len++;
}
*uslenp = len;
return rv;
}
PRInt32 nsCRT::atoi( const PRUnichar *string )
{
return atoi(string);
}

View File

@@ -1,239 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsCRT_h___
#define nsCRT_h___
#include <stdlib.h>
#include <string.h>
#include "plstr.h"
#include "nscore.h"
#include "prtypes.h"
#include "nsCppSharedAllocator.h"
#define CR '\015'
#define LF '\012'
#define VTAB '\013'
#define FF '\014'
#define TAB '\011'
#define CRLF "\015\012" /* A CR LF equivalent string */
#ifdef XP_MAC
# define NS_LINEBREAK "\015"
# define NS_LINEBREAK_LEN 1
#else
# ifdef XP_PC
# define NS_LINEBREAK "\015\012"
# define NS_LINEBREAK_LEN 2
# else
# if defined(XP_UNIX) || defined(XP_BEOS)
# define NS_LINEBREAK "\012"
# define NS_LINEBREAK_LEN 1
# endif /* XP_UNIX */
# endif /* XP_PC */
#endif /* XP_MAC */
extern const PRUnichar kIsoLatin1ToUCS2[256];
// This macro can be used in a class declaration for classes that want
// to ensure that their instance memory is zeroed.
#define NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW \
void* operator new(size_t sz) { \
void* rv = ::operator new(sz); \
if (rv) { \
nsCRT::zero(rv, sz); \
} \
return rv; \
} \
void operator delete(void* ptr) { \
::operator delete(ptr); \
}
// This macro works with the next macro to declare a non-inlined
// version of the above.
#define NS_DECL_ZEROING_OPERATOR_NEW \
void* operator new(size_t sz); \
void operator delete(void* ptr);
#define NS_IMPL_ZEROING_OPERATOR_NEW(_class) \
void* _class::operator new(size_t sz) { \
void* rv = ::operator new(sz); \
if (rv) { \
nsCRT::zero(rv, sz); \
} \
return rv; \
} \
void _class::operator delete(void* ptr) { \
::operator delete(ptr); \
}
// Freeing helper
#define CRTFREEIF(x) if (x) { nsCRT::free(x); x = 0; }
/// This is a wrapper class around all the C runtime functions.
class NS_COM nsCRT {
public:
/** Copy bytes from aSrc to aDest.
@param aDest the destination address
@param aSrc the source address
@param aCount the number of bytes to copy
*/
static void memcpy(void* aDest, const void* aSrc, PRUint32 aCount) {
::memcpy(aDest, aSrc, (size_t)aCount);
}
static void memmove(void* aDest, const void* aSrc, PRUint32 aCount) {
::memmove(aDest, aSrc, (size_t)aCount);
}
static void memset(void* aDest, PRUint8 aByte, PRUint32 aCount) {
::memset(aDest, aByte, aCount);
}
static void zero(void* aDest, PRUint32 aCount) {
::memset(aDest, 0, (size_t)aCount);
}
/** Compute the string length of s
@param s the string in question
@return the length of s
*/
static PRUint32 strlen(const char* s) {
return PRUint32(::strlen(s));
}
/// Compare s1 and s2.
static PRInt32 strcmp(const char* s1, const char* s2) {
return PRUint32(PL_strcmp(s1, s2));
}
static PRInt32 strncmp(const char* s1, const char* s2,
PRUint32 aMaxLen) {
return PRInt32(PL_strncmp(s1, s2, aMaxLen));
}
/// Case-insensitive string comparison.
static PRInt32 strcasecmp(const char* s1, const char* s2) {
return PRInt32(PL_strcasecmp(s1, s2));
}
/// Case-insensitive string comparison with length
static PRInt32 strncasecmp(const char* s1, const char* s2, PRUint32 aMaxLen) {
return PRInt32(PL_strncasecmp(s1, s2, aMaxLen));
}
static PRInt32 strncmp(const char* s1, const char* s2, PRInt32 aMaxLen) {
// inline the first test (assumes strings are not null):
PRInt32 diff = ((const unsigned char*)s1)[0] - ((const unsigned char*)s2)[0];
if (diff != 0) return diff;
return PRInt32(PL_strncmp(s1,s2,aMaxLen));
}
static char* strdup(const char* str) {
return PL_strdup(str);
}
static void free(char* str) {
PL_strfree(str);
}
/**
How to use this fancy (thread-safe) version of strtok:
void main( void ) {
printf( "%s\n\nTokens:\n", string );
// Establish string and get the first token:
char* newStr;
token = nsCRT::strtok( string, seps, &newStr );
while( token != NULL ) {
// While there are tokens in "string"
printf( " %s\n", token );
// Get next token:
token = nsCRT::strtok( newStr, seps, &newStr );
}
}
* WARNING - STRTOK WHACKS str THE FIRST TIME IT IS CALLED *
* MAKE A COPY OF str IF YOU NEED TO USE IT AFTER strtok() *
*/
static char* strtok(char* str, const char* delims, char* *newStr);
/// Like strlen except for ucs2 strings
static PRUint32 strlen(const PRUnichar* s);
/// Like strcmp except for ucs2 strings
static PRInt32 strcmp(const PRUnichar* s1, const PRUnichar* s2);
/// Like strcmp except for ucs2 strings
static PRInt32 strncmp(const PRUnichar* s1, const PRUnichar* s2,
PRUint32 aMaxLen);
/// Like strcasecmp except for ucs2 strings
static PRInt32 strcasecmp(const PRUnichar* s1, const PRUnichar* s2);
/// Like strncasecmp except for ucs2 strings
static PRInt32 strncasecmp(const PRUnichar* s1, const PRUnichar* s2,
PRUint32 aMaxLen);
/// Like strcmp with a char* and a ucs2 string
static PRInt32 strcmp(const PRUnichar* s1, const char* s2);
/// Like strncmp with a char* and a ucs2 string
static PRInt32 strncmp(const PRUnichar* s1, const char* s2,
PRUint32 aMaxLen);
/// Like strcasecmp with a char* and a ucs2 string
static PRInt32 strcasecmp(const PRUnichar* s1, const char* s2);
/// Like strncasecmp with a char* and a ucs2 string
static PRInt32 strncasecmp(const PRUnichar* s1, const char* s2,
PRUint32 aMaxLen);
// Note: uses new[] to allocate memory, so you must use delete[] to
// free the memory
static PRUnichar* strdup(const PRUnichar* str);
static void free(PRUnichar* str) {
nsCppSharedAllocator<PRUnichar> shared_allocator;
shared_allocator.deallocate(str, 0 /*we never new or kept the size*/);
}
/// Compute a hashcode for a C string
static PRUint32 HashValue(const char* s1);
/// Same as above except that we return the length in s1len
static PRUint32 HashValue(const char* s1, PRUint32* s1len);
/// Compute a hashcode for a ucs2 string
static PRUint32 HashValue(const PRUnichar* s1);
/// Same as above except that we return the length in s1len
static PRUint32 HashValue(const PRUnichar* s1, PRUint32* s1len);
/// String to integer.
static PRInt32 atoi( const PRUnichar *string );
static PRUnichar ToUpper(PRUnichar aChar);
static PRUnichar ToLower(PRUnichar aChar);
static PRBool IsUpper(PRUnichar aChar);
static PRBool IsLower(PRUnichar aChar);
};
#endif /* nsCRT_h___ */

View File

@@ -1,365 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsIEnumerator.h"
////////////////////////////////////////////////////////////////////////////////
// Intersection Enumerators
////////////////////////////////////////////////////////////////////////////////
class nsConjoiningEnumerator : public nsIBidirectionalEnumerator
{
public:
NS_DECL_ISUPPORTS
// nsIEnumerator methods:
NS_DECL_NSIENUMERATOR
// nsIBidirectionalEnumerator methods:
NS_DECL_NSIBIDIRECTIONALENUMERATOR
// nsConjoiningEnumerator methods:
nsConjoiningEnumerator(nsIEnumerator* first, nsIEnumerator* second);
virtual ~nsConjoiningEnumerator(void);
protected:
nsIEnumerator* mFirst;
nsIEnumerator* mSecond;
nsIEnumerator* mCurrent;
};
nsConjoiningEnumerator::nsConjoiningEnumerator(nsIEnumerator* first, nsIEnumerator* second)
: mFirst(first), mSecond(second), mCurrent(first)
{
NS_ADDREF(mFirst);
NS_ADDREF(mSecond);
}
nsConjoiningEnumerator::~nsConjoiningEnumerator(void)
{
NS_RELEASE(mFirst);
NS_RELEASE(mSecond);
}
NS_IMPL_ISUPPORTS2(nsConjoiningEnumerator, nsIBidirectionalEnumerator, nsIEnumerator)
NS_IMETHODIMP
nsConjoiningEnumerator::First(void)
{
mCurrent = mFirst;
return mCurrent->First();
}
NS_IMETHODIMP
nsConjoiningEnumerator::Next(void)
{
nsresult rv = mCurrent->Next();
if (NS_FAILED(rv) && mCurrent == mFirst) {
mCurrent = mSecond;
rv = mCurrent->First();
}
return rv;
}
NS_IMETHODIMP
nsConjoiningEnumerator::CurrentItem(nsISupports **aItem)
{
return mCurrent->CurrentItem(aItem);
}
NS_IMETHODIMP
nsConjoiningEnumerator::IsDone(void)
{
return (mCurrent == mFirst && mCurrent->IsDone() == NS_OK)
|| (mCurrent == mSecond && mCurrent->IsDone() == NS_OK)
? NS_OK : NS_COMFALSE;
}
////////////////////////////////////////////////////////////////////////////////
NS_IMETHODIMP
nsConjoiningEnumerator::Last(void)
{
nsresult rv;
nsIBidirectionalEnumerator* be;
rv = mSecond->QueryInterface(nsIBidirectionalEnumerator::GetIID(), (void**)&be);
if (NS_FAILED(rv)) return rv;
mCurrent = mSecond;
rv = be->Last();
NS_RELEASE(be);
return rv;
}
NS_IMETHODIMP
nsConjoiningEnumerator::Prev(void)
{
nsresult rv;
nsIBidirectionalEnumerator* be;
rv = mCurrent->QueryInterface(nsIBidirectionalEnumerator::GetIID(), (void**)&be);
if (NS_FAILED(rv)) return rv;
rv = be->Prev();
NS_RELEASE(be);
if (NS_FAILED(rv) && mCurrent == mSecond) {
rv = mFirst->QueryInterface(nsIBidirectionalEnumerator::GetIID(), (void**)&be);
if (NS_FAILED(rv)) return rv;
mCurrent = mFirst;
rv = be->Last();
NS_RELEASE(be);
}
return rv;
}
////////////////////////////////////////////////////////////////////////////////
extern "C" NS_COM nsresult
NS_NewConjoiningEnumerator(nsIEnumerator* first, nsIEnumerator* second,
nsIBidirectionalEnumerator* *aInstancePtrResult)
{
if (aInstancePtrResult == 0)
return NS_ERROR_NULL_POINTER;
nsConjoiningEnumerator* e = new nsConjoiningEnumerator(first, second);
if (e == 0)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(e);
*aInstancePtrResult = e;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
static nsresult
nsEnumeratorContains(nsIEnumerator* e, nsISupports* item)
{
nsresult rv;
for (e->First(); e->IsDone() != NS_OK; e->Next()) {
nsISupports* other;
rv = e->CurrentItem(&other);
if (NS_FAILED(rv)) return rv;
if (item == other) {
NS_RELEASE(other);
return NS_OK; // true -- exists in enumerator
}
NS_RELEASE(other);
}
return NS_COMFALSE; // false -- doesn't exist
}
////////////////////////////////////////////////////////////////////////////////
// Intersection Enumerators
////////////////////////////////////////////////////////////////////////////////
class nsIntersectionEnumerator : public nsIEnumerator
{
public:
NS_DECL_ISUPPORTS
// nsIEnumerator methods:
NS_DECL_NSIENUMERATOR
// nsIntersectionEnumerator methods:
nsIntersectionEnumerator(nsIEnumerator* first, nsIEnumerator* second);
virtual ~nsIntersectionEnumerator(void);
protected:
nsIEnumerator* mFirst;
nsIEnumerator* mSecond;
};
nsIntersectionEnumerator::nsIntersectionEnumerator(nsIEnumerator* first, nsIEnumerator* second)
: mFirst(first), mSecond(second)
{
NS_ADDREF(mFirst);
NS_ADDREF(mSecond);
}
nsIntersectionEnumerator::~nsIntersectionEnumerator(void)
{
NS_RELEASE(mFirst);
NS_RELEASE(mSecond);
}
NS_IMPL_ISUPPORTS1(nsIntersectionEnumerator, nsIEnumerator)
NS_IMETHODIMP
nsIntersectionEnumerator::First(void)
{
nsresult rv = mFirst->First();
if (NS_FAILED(rv)) return rv;
return Next();
}
NS_IMETHODIMP
nsIntersectionEnumerator::Next(void)
{
nsresult rv;
// find the first item that exists in both
for (; mFirst->IsDone() != NS_OK; mFirst->Next()) {
nsISupports* item;
rv = mFirst->CurrentItem(&item);
if (NS_FAILED(rv)) return rv;
// see if it also exists in mSecond
rv = nsEnumeratorContains(mSecond, item);
if (NS_FAILED(rv)) return rv;
NS_RELEASE(item);
if (rv == NS_OK) {
// found in both, so return leaving it as the current item of mFirst
return NS_OK;
}
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsIntersectionEnumerator::CurrentItem(nsISupports **aItem)
{
return mFirst->CurrentItem(aItem);
}
NS_IMETHODIMP
nsIntersectionEnumerator::IsDone(void)
{
return mFirst->IsDone();
}
////////////////////////////////////////////////////////////////////////////////
extern "C" NS_COM nsresult
NS_NewIntersectionEnumerator(nsIEnumerator* first, nsIEnumerator* second,
nsIEnumerator* *aInstancePtrResult)
{
if (aInstancePtrResult == 0)
return NS_ERROR_NULL_POINTER;
nsIntersectionEnumerator* e = new nsIntersectionEnumerator(first, second);
if (e == 0)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(e);
*aInstancePtrResult = e;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// Union Enumerators
////////////////////////////////////////////////////////////////////////////////
class nsUnionEnumerator : public nsIEnumerator
{
public:
NS_DECL_ISUPPORTS
// nsIEnumerator methods:
NS_DECL_NSIENUMERATOR
// nsUnionEnumerator methods:
nsUnionEnumerator(nsIEnumerator* first, nsIEnumerator* second);
virtual ~nsUnionEnumerator(void);
protected:
nsIEnumerator* mFirst;
nsIEnumerator* mSecond;
};
nsUnionEnumerator::nsUnionEnumerator(nsIEnumerator* first, nsIEnumerator* second)
: mFirst(first), mSecond(second)
{
NS_ADDREF(mFirst);
NS_ADDREF(mSecond);
}
nsUnionEnumerator::~nsUnionEnumerator(void)
{
NS_RELEASE(mFirst);
NS_RELEASE(mSecond);
}
NS_IMPL_ISUPPORTS1(nsUnionEnumerator, nsIEnumerator)
NS_IMETHODIMP
nsUnionEnumerator::First(void)
{
nsresult rv = mFirst->First();
if (NS_FAILED(rv)) return rv;
return Next();
}
NS_IMETHODIMP
nsUnionEnumerator::Next(void)
{
nsresult rv;
// find the first item that exists in both
for (; mFirst->IsDone() != NS_OK; mFirst->Next()) {
nsISupports* item;
rv = mFirst->CurrentItem(&item);
if (NS_FAILED(rv)) return rv;
// see if it also exists in mSecond
rv = nsEnumeratorContains(mSecond, item);
if (NS_FAILED(rv)) return rv;
NS_RELEASE(item);
if (rv != NS_OK) {
// if it didn't exist in mSecond, return, making it the current item
return NS_OK;
}
// each time around, make sure that mSecond gets reset to the beginning
// so that when mFirst is done, we'll be ready to enumerate mSecond
rv = mSecond->First();
if (NS_FAILED(rv)) return rv;
}
return mSecond->Next();
}
NS_IMETHODIMP
nsUnionEnumerator::CurrentItem(nsISupports **aItem)
{
if (mFirst->IsDone() != NS_OK)
return mFirst->CurrentItem(aItem);
else
return mSecond->CurrentItem(aItem);
}
NS_IMETHODIMP
nsUnionEnumerator::IsDone(void)
{
return (mFirst->IsDone() == NS_OK && mSecond->IsDone() == NS_OK)
? NS_OK : NS_COMFALSE;
}
////////////////////////////////////////////////////////////////////////////////
extern "C" NS_COM nsresult
NS_NewUnionEnumerator(nsIEnumerator* first, nsIEnumerator* second,
nsIEnumerator* *aInstancePtrResult)
{
if (aInstancePtrResult == 0)
return NS_ERROR_NULL_POINTER;
nsUnionEnumerator* e = new nsUnionEnumerator(first, second);
if (e == 0)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(e);
*aInstancePtrResult = e;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,122 +0,0 @@
#ifndef nsCppSharedAllocator_h__
#define nsCppSharedAllocator_h__
#include "nsIAllocator.h" // for |nsAllocator|
#include "nscore.h" // for |NS_XXX_CAST|
#include <new.h> // to allow placement |new|
// under Metrowerks (Mac), we don't have autoconf yet
#ifdef __MWERKS__
#define HAVE_CPP_MEMBER_TEMPLATES
#define HAVE_CPP_NUMERIC_LIMITS
#endif
#ifdef HAVE_CPP_NUMERIC_LIMITS
#include <limits>
#else
#include <limits.h>
#endif
template <class T>
class nsCppSharedAllocator
/*
...allows Standard Library containers, et al, to use our global shared
(XP)COM-aware allocator.
*/
{
public:
typedef T value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
nsCppSharedAllocator() { }
#ifdef HAVE_CPP_MEMBER_TEMPLATES
template <class U>
nsCppSharedAllocator( const nsCppSharedAllocator<U>& ) { }
#endif
~nsCppSharedAllocator() { }
pointer
address( reference r ) const
{
return &r;
}
const_pointer
address( const_reference r ) const
{
return &r;
}
pointer
allocate( size_type n, const void* /*hint*/=0 )
{
return NS_REINTERPRET_CAST(pointer, nsAllocator::Alloc(NS_STATIC_CAST(PRUint32, n*sizeof(T))));
}
void
deallocate( pointer p, size_type /*n*/ )
{
nsAllocator::Free(p);
}
void
construct( pointer p, const T& val )
{
new (p) T(val);
}
void
destroy( pointer p )
{
p->~T();
}
size_type
max_size() const
{
#ifdef HAVE_CPP_NUMERIC_LIMITS
return numeric_limits<size_type>::max() / sizeof(T);
#else
return ULONG_MAX / sizeof(T);
#endif
}
#ifdef HAVE_CPP_MEMBER_TEMPLATES
template <class U>
struct rebind
{
typedef nsCppSharedAllocator<U> other;
};
#endif
};
template <class T>
PRBool
operator==( const nsCppSharedAllocator<T>&, const nsCppSharedAllocator<T>& )
{
return PR_TRUE;
}
template <class T>
PRBool
operator!=( const nsCppSharedAllocator<T>&, const nsCppSharedAllocator<T>& )
{
return PR_FALSE;
}
#endif /* !defined(nsCppSharedAllocator_h__) */

View File

@@ -1,594 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsDeque.h"
#include "nsCRT.h"
#include <stdio.h>
//#define _SELFTEST_DEQUE 1
#undef _SELFTEST_DEQUE
/**
* Standard constructor
* @update gess4/18/98
* @return new deque
*/
nsDeque::nsDeque(nsDequeFunctor* aDeallocator) {
mDeallocator=aDeallocator;
mOrigin=mSize=0;
mData=mBuffer; // don't allocate space until you must
mCapacity=sizeof(mBuffer)/sizeof(mBuffer[0]);
nsCRT::zero(mData,mCapacity*sizeof(mBuffer[0]));
}
/**
* Destructor
* @update gess4/18/98
*/
nsDeque::~nsDeque() {
#if 0
char buffer[30];
printf("Capacity: %i\n",mCapacity);
static int mCaps[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
switch(mCapacity) {
case 4: mCaps[0]++; break;
case 8: mCaps[1]++; break;
case 16: mCaps[2]++; break;
case 32: mCaps[3]++; break;
case 64: mCaps[4]++; break;
case 128: mCaps[5]++; break;
case 256: mCaps[6]++; break;
case 512: mCaps[7]++; break;
case 1024: mCaps[8]++; break;
case 2048: mCaps[9]++; break;
case 4096: mCaps[10]++; break;
default:
break;
}
#endif
Erase();
if(mData && (mData!=mBuffer))
delete [] mData;
mData=0;
if(mDeallocator) {
delete mDeallocator;
}
mDeallocator=0;
}
/**
*
* @update gess4/18/98
* @param
* @return
*/
void nsDeque::SetDeallocator(nsDequeFunctor* aDeallocator){
if(mDeallocator) {
delete mDeallocator;
}
mDeallocator=aDeallocator;
}
/**
* Remove all items from container without destroying them.
*
* @update gess4/18/98
* @param
* @return
*/
nsDeque& nsDeque::Empty() {
if((0<mCapacity) && (mData)) {
nsCRT::zero(mData,mCapacity*sizeof(mData));
}
mSize=0;
mOrigin=0;
return *this;
}
/**
* Remove and delete all items from container
*
* @update gess4/18/98
* @return this
*/
nsDeque& nsDeque::Erase() {
if(mDeallocator && mSize) {
ForEach(*mDeallocator);
}
return Empty();
}
/**
* This method adds an item to the end of the deque.
* This operation has the potential to cause the
* underlying buffer to resize.
*
* @update gess4/18/98
* @param anItem: new item to be added to deque
* @return nada
*/
nsDeque& nsDeque::GrowCapacity(void) {
PRInt32 theNewSize = mCapacity<<2;
void** temp=new void*[theNewSize];
//Here's the interesting part: You can't just move the elements
//directy (in situ) from the old buffer to the new one.
//Since capacity has changed, the old origin doesn't make
//sense anymore. It's better to resequence the elements now.
if(mData) {
int tempi=0;
int i=0;
int j=0;
for(i=mOrigin;i<mCapacity;i++) temp[tempi++]=mData[i]; //copy the leading elements...
for(j=0;j<mOrigin;j++) temp[tempi++]=mData[j]; //copy the trailing elements...
if(mData!=mBuffer)
delete [] mData;
}
mCapacity=theNewSize;
mOrigin=0; //now realign the origin...
mData=temp;
return *this;
}
/**
* This method adds an item to the end of the deque.
* This operation has the potential to cause the
* underlying buffer to resize.
*
* @update gess4/18/98
* @param anItem: new item to be added to deque
* @return nada
*/
nsDeque& nsDeque::Push(void* anItem) {
if(mSize==mCapacity) {
GrowCapacity();
}
int offset=mOrigin+mSize;
if(offset<mCapacity)
mData[offset]=anItem;
else mData[offset-mCapacity]=anItem;
mSize++;
return *this;
}
/**
* This method adds an item to the front of the deque.
* This operation has the potential to cause the
* underlying buffer to resize.
*
* @update gess4/18/98
* @param anItem: new item to be added to deque
* @return nada
*/
nsDeque& nsDeque::PushFront(void* anItem) {
if(mSize==mCapacity) {
GrowCapacity();
}
if(0==mOrigin){ //case1: [xxx..]
//mOrigin=mCapacity-1-mSize++;
mOrigin=mCapacity-1;
mData[mOrigin]=anItem;
}
else {// if(mCapacity==(mOrigin+mSize-1)){ //case2: [..xxx] and case3: [.xxx.]
mData[--mOrigin]=anItem;
}
mSize++;
return *this;
}
/**
* Remove and return the last item in the container.
*
* @update gess4/18/98
* @param none
* @return ptr to last item in container
*/
void* nsDeque::Pop(void) {
void* result=0;
if(mSize>0) {
int offset=mOrigin+mSize-1;
if(offset>=mCapacity)
offset-=mCapacity;
result=mData[offset];
mData[offset]=0;
mSize--;
if(0==mSize)
mOrigin=0;
}
return result;
}
/**
* This method gets called you want to remove and return
* the first member in the container.
*
* @update gess4/18/98
* @param nada
* @return last item in container
*/
void* nsDeque::PopFront() {
void* result=0;
if(mSize>0) {
NS_ASSERTION(mOrigin<mCapacity,"Error: Bad origin");
result=mData[mOrigin];
mData[mOrigin++]=0; //zero it out for debugging purposes.
mSize--;
if(mCapacity==mOrigin) //you popped off the end, so cycle back around...
mOrigin=0;
if(0==mSize)
mOrigin=0;
}
return result;
}
/**
* This method gets called you want to peek at the topmost
* member without removing it.
*
* @update gess4/18/98
* @param nada
* @return last item in container
*/
void* nsDeque::Peek() {
void* result=0;
if(mSize>0) {
result=mData[mOrigin];
}
return result;
}
/**
* Call this to retrieve the ith element from this container.
* Keep in mind that accessing the underlying elements is
* done in a relative fashion. Object 0 is not necessarily
* the first element (the first element is at mOrigin).
*
* @update gess4/18/98
* @param anIndex : 0 relative offset of item you want
* @return void* or null
*/
void* nsDeque::ObjectAt(PRInt32 anIndex) const {
void* result=0;
if((anIndex>=0) && (anIndex<mSize))
{
if(anIndex<(mCapacity-mOrigin)) {
result=mData[mOrigin+anIndex];
}
else {
result=mData[anIndex-(mCapacity-mOrigin)];
}
}
return result;
}
/**
* Create and return an iterator pointing to
* the beginning of the queue. Note that this
* takes the circular buffer semantics into account.
*
* @update gess4/18/98
* @return new deque iterator, init'ed to 1st item
*/
nsDequeIterator nsDeque::Begin(void) const{
return nsDequeIterator(*this,0);
}
/**
* Create and return an iterator pointing to
* the last of the queue. Note that this
* takes the circular buffer semantics into account.
*
* @update gess4/18/98
* @return new deque iterator, init'ed to last item
*/
nsDequeIterator nsDeque::End(void) const{
return nsDequeIterator(*this,mSize);
}
/**
* Call this method when you wanto to iterate all the
* members of the container, passing a functor along
* to call your code.
*
* @update gess4/20/98
* @param aFunctor object to call for each member
* @return *this
*/
void nsDeque::ForEach(nsDequeFunctor& aFunctor) const{
int i=0;
for(i=0;i<mSize;i++){
void* obj=ObjectAt(i);
obj=aFunctor(obj);
}
}
/**
* Call this method when you wanto to iterate all the
* members of the container, passing a functor along
* to call your code. Iteration continues until your
* functor returns a non-null.
*
* @update gess4/20/98
* @param aFunctor object to call for each member
* @return *this
*/
const void* nsDeque::FirstThat(nsDequeFunctor& aFunctor) const{
int i=0;
for(i=0;i<mSize;i++){
void* obj=ObjectAt(i);
obj=aFunctor(obj);
if(obj)
return obj;
}
return 0;
}
/******************************************************
* Here comes the nsDequeIterator class...
******************************************************/
/**
* DequeIterator is an object that knows how to iterate (forward and backward)
* a Deque. Normally, you don't need to do this, but there are some special
* cases where it is pretty handy, so here you go.
*
* This is a standard dequeiterator constructor
*
* @update gess4/18/98
* @param aQueue is the deque object to be iterated
* @param anIndex is the starting position for your iteration
*/
nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mIndex(anIndex), mDeque(aQueue) {
}
/**
* Copy construct a new iterator beginning with given
*
* @update gess4/20/98
* @param aCopy is another iterator to copy from
* @return
*/
nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) : mIndex(aCopy.mIndex), mDeque(aCopy.mDeque) {
}
/**
* Moves iterator to first element in deque
* @update gess4/18/98
* @return this
*/
nsDequeIterator& nsDequeIterator::First(void){
mIndex=0;
return *this;
}
/**
* Standard assignment operator for dequeiterator
*
* @update gess4/18/98
* @param aCopy is an iterator to be copied from
* @return *this
*/
nsDequeIterator& nsDequeIterator::operator=(const nsDequeIterator& aCopy) {
//queue's are already equal.
mIndex=aCopy.mIndex;
return *this;
}
/**
* preform ! operation against to iterators to test for equivalence
* (or lack thereof)!
*
* @update gess4/18/98
* @param anIter is the object to be compared to
* @return TRUE if NOT equal.
*/
PRBool nsDequeIterator::operator!=(nsDequeIterator& anIter) {
return PRBool(!this->operator==(anIter));
}
/**
* Compare 2 iterators for equivalence.
*
* @update gess4/18/98
* @param anIter is the other iterator to be compared to
* @return TRUE if EQUAL
*/
PRBool nsDequeIterator::operator<(nsDequeIterator& anIter) {
return PRBool(((mIndex<anIter.mIndex) && (&mDeque==&anIter.mDeque)));
}
/**
* Compare 2 iterators for equivalence.
*
* @update gess4/18/98
* @param anIter is the other iterator to be compared to
* @return TRUE if EQUAL
*/
PRBool nsDequeIterator::operator==(nsDequeIterator& anIter) {
return PRBool(((mIndex==anIter.mIndex) && (&mDeque==&anIter.mDeque)));
}
/**
* Compare 2 iterators for equivalence.
*
* @update gess4/18/98
* @param anIter is the other iterator to be compared to
* @return TRUE if EQUAL
*/
PRBool nsDequeIterator::operator>=(nsDequeIterator& anIter) {
return PRBool(((mIndex>=anIter.mIndex) && (&mDeque==&anIter.mDeque)));
}
/**
* Pre-increment operator
*
* @update gess4/18/98
* @return object at preincremented index
*/
void* nsDequeIterator::operator++() {
return mDeque.ObjectAt(++mIndex);
}
/**
* Post-increment operator
*
* @update gess4/18/98
* @param param is ignored
* @return object at post-incremented index
*/
void* nsDequeIterator::operator++(int) {
return mDeque.ObjectAt(mIndex++);
}
/**
* Pre-decrement operator
*
* @update gess4/18/98
* @return object at pre-decremented index
*/
void* nsDequeIterator::operator--() {
return mDeque.ObjectAt(--mIndex);
}
/**
* Post-decrement operator
*
* @update gess4/18/98
* @param param is ignored
* @return object at post-decremented index
*/
void* nsDequeIterator::operator--(int) {
return mDeque.ObjectAt(mIndex--);
}
/**
* Dereference operator
*
* @update gess4/18/98
* @return object at ith index
*/
void* nsDequeIterator::GetCurrent(void) {
return mDeque.ObjectAt(mIndex);
}
/**
* Call this method when you wanto to iterate all the
* members of the container, passing a functor along
* to call your code.
*
* @update gess4/20/98
* @param aFunctor object to call for each member
* @return *this
*/
void nsDequeIterator::ForEach(nsDequeFunctor& aFunctor) const{
mDeque.ForEach(aFunctor);
}
/**
* Call this method when you wanto to iterate all the
* members of the container, passing a functor along
* to call your code.
*
* @update gess4/20/98
* @param aFunctor object to call for each member
* @return *this
*/
const void* nsDequeIterator::FirstThat(nsDequeFunctor& aFunctor) const{
return mDeque.FirstThat(aFunctor);
}
#ifdef _SELFTEST_DEQUE
/**************************************************************
Now define the token deallocator class...
**************************************************************/
class _SelfTestDeallocator: public nsDequeFunctor{
public:
_SelfTestDeallocator::_SelfTestDeallocator() {
nsDeque::SelfTest();
}
virtual void* operator()(void* anObject) {
return 0;
}
};
static _SelfTestDeallocator gDeallocator;
#endif
/**
* conduct automated self test for this class
*
* @update gess4/18/98
* @param
* @return
*/
void nsDeque::SelfTest(void) {
#ifdef _SELFTEST_DEQUE
{
nsDeque theDeque(gDeallocator); //construct a simple one...
int ints[200];
int count=sizeof(ints)/sizeof(int);
int i=0;
for(i=0;i<count;i++){ //initialize'em
ints[i]=10*(1+i);
}
for(i=0;i<70;i++){
theDeque.Push(&ints[i]);
}
for(i=0;i<56;i++){
int* temp=(int*)theDeque.Pop();
}
for(i=0;i<55;i++){
theDeque.Push(&ints[i]);
}
for(i=0;i<35;i++){
int* temp=(int*)theDeque.Pop();
}
for(i=0;i<35;i++){
theDeque.Push(&ints[i]);
}
for(i=0;i<38;i++){
int* temp=(int*)theDeque.Pop();
}
}
int x;
x=10;
#endif
}

View File

@@ -1,410 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/**
* MODULE NOTES:
* @update gess 4/15/98 (tax day)
*
* The Deque is a very small, very efficient container object
* than can hold elements of type void*, offering the following features:
* It's interface supports pushing and poping of children.
* It can iterate (via an interator class) it's children.
* When full, it can efficently resize dynamically.
*
*
* NOTE: The only bit of trickery here is that this deque is
* built upon a ring-buffer. Like all ring buffers, the first
* element may not be at index[0]. The mOrigin member determines
* where the first child is. This point is quietly hidden from
* customers of this class.
*
*/
#ifndef _NSDEQUE
#define _NSDEQUE
#include "nscore.h"
/**
* The nsDequefunctor class is used when you want to create
* callbacks between the deque and your generic code.
* Use these objects in a call to ForEach();
*
* @update gess4/20/98
*/
class NS_COM nsDequeFunctor{
public:
virtual void* operator()(void* anObject)=0;
};
/******************************************************
* Here comes the nsDeque class itself...
******************************************************/
/**
* The deque (double-ended queue) class is a common container type,
* whose behavior mimics a line in your favorite checkout stand.
* Classic CS describes the common behavior of a queue as FIFO.
* A Deque allows items to be added and removed from either end of
* the queue.
*
* @update gess4/20/98
*/
class NS_COM nsDeque {
friend class nsDequeIterator;
public:
nsDeque(nsDequeFunctor* aDeallocator);
~nsDeque();
/**
* Returns the number of elements currently stored in
* this deque.
*
* @update gess4/18/98
* @param
* @return int contains element count
*/
inline PRInt32 GetSize() const { return mSize;}
/**
* Pushes new member onto the end of the deque
*
* @update gess4/18/98
* @param ptr to object to store
* @return *this
*/
nsDeque& Push(void* anItem);
/**
* Pushes new member onto the front of the deque
*
* @update gess4/18/98
* @param ptr to object to store
* @return *this
*/
nsDeque& PushFront(void* anItem);
/**
* Remove and return the first item in the container.
*
* @update gess4/18/98
* @param none
* @return ptr to first item in container
*/
void* Pop(void);
/**
* Remove and return the first item in the container.
*
* @update gess4/18/98
* @param none
* @return ptr to first item in container
*/
void* PopFront(void);
/**
* Return topmost item without removing it.
*
* @update gess4/18/98
* @param none
* @return ptr to first item in container
*/
void* Peek(void);
/**
* method used to retrieve ptr to
* ith member in container. DOesn't remove
* that item.
*
* @update gess4/18/98
* @param index of desired item
* @return ptr to ith element in list
*/
void* ObjectAt(int anIndex) const;
/**
* Remove all items from container without destroying them
*
* @update gess4/18/98
* @param
* @return
*/
nsDeque& Empty();
/**
* Remove and delete all items from container
*
* @update gess4/18/98
* @param
* @return
*/
nsDeque& Erase();
/**
* Creates a new iterator, init'ed to start of container
*
* @update gess4/18/98
* @return new dequeIterator
*/
nsDequeIterator Begin() const;
/**
* Creates a new iterator, init'ed to end of container
*
* @update gess4/18/98
* @return new dequeIterator
*/
nsDequeIterator End() const;
/**
* Call this method when you wanto to iterate all the
* members of the container, passing a functor along
* to call your code.
*
* @update gess4/20/98
* @param aFunctor object to call for each member
* @return *this
*/
void ForEach(nsDequeFunctor& aFunctor) const;
/**
* Call this method when you wanto to iterate all the
* members of the container, passing a functor along
* to call your code. This process will interupt if
* your function returns a null to this iterator.
*
* @update gess4/20/98
* @param aFunctor object to call for each member
* @return *this
*/
const void* FirstThat(nsDequeFunctor& aFunctor) const;
void SetDeallocator(nsDequeFunctor* aDeallocator);
/**
* Perform automated selftest on the deque
*
* @update gess4/18/98
* @param
* @return
*/
static void SelfTest();
protected:
PRInt32 mSize;
PRInt32 mCapacity;
PRInt32 mOrigin;
nsDequeFunctor* mDeallocator;
void* mBuffer[8];
void** mData;
private:
/**
* Simple default constructor (PRIVATE)
*
* @update gess4/18/98
* @param
* @return
*/
nsDeque();
/**
* Copy constructor (PRIVATE)
*
* @update gess4/18/98
* @param
* @return
*/
nsDeque(const nsDeque& other);
/**
* Deque assignment operator (PRIVATE)
*
* @update gess4/18/98
* @param another deque
* @return *this
*/
nsDeque& operator=(const nsDeque& anOther);
nsDeque& GrowCapacity(void);
};
/******************************************************
* Here comes the nsDequeIterator class...
******************************************************/
class NS_COM nsDequeIterator {
public:
/**
* DequeIterator is an object that knows how to iterate (forward and backward)
* a Deque. Normally, you don't need to do this, but there are some special
* cases where it is pretty handy, so here you go.
*
* @update gess4/18/98
* @param aQueue is the deque object to be iterated
* @param anIndex is the starting position for your iteration
*/
nsDequeIterator(const nsDeque& aQueue,int anIndex=0);
/**
* DequeIterator is an object that knows how to iterate (forward and backward)
* a Deque. Normally, you don't need to do this, but there are some special
* cases where it is pretty handy, so here you go.
*
* @update gess4/18/98
* @param aQueue is the deque object to be iterated
* @param anIndex is the starting position for your iteration
*/
nsDequeIterator(const nsDequeIterator& aCopy);
/**
* Moves iterator to first element in deque
* @update gess4/18/98
* @return this
*/
nsDequeIterator& First(void);
/**
* Standard assignment operator for deque
* @update gess4/18/98
* @param
* @return
*/
nsDequeIterator& operator=(const nsDequeIterator& aCopy);
/**
* preform ! operation against to iterators to test for equivalence
* (or lack thereof)!
*
* @update gess4/18/98
* @param anIter is the object to be compared to
* @return TRUE if NOT equal.
*/
PRBool operator!=(nsDequeIterator& anIter);
/**
* Compare 2 iterators for equivalence.
*
* @update gess4/18/98
* @param anIter is the other iterator to be compared to
* @return TRUE if EQUAL
*/
PRBool operator<(nsDequeIterator& anIter);
/**
* Compare 2 iterators for equivalence.
*
* @update gess4/18/98
* @param anIter is the other iterator to be compared to
* @return TRUE if EQUAL
*/
PRBool operator==(nsDequeIterator& anIter);
/**
* Compare 2 iterators for equivalence.
*
* @update gess4/18/98
* @param anIter is the other iterator to be compared to
* @return TRUE if EQUAL
*/
PRBool operator>=(nsDequeIterator& anIter);
/**
* Pre-increment operator
*
* @update gess4/18/98
* @return object at preincremented index
*/
void* operator++();
/**
* Post-increment operator
*
* @update gess4/18/98
* @param param is ignored
* @return object at post-incremented index
*/
void* operator++(int);
/**
* Pre-decrement operator
*
* @update gess4/18/98
* @return object at pre-decremented index
*/
void* operator--();
/**
* Post-decrement operator
*
* @update gess4/18/98
* @param param is ignored
* @return object at post-decremented index
*/
void* operator--(int);
/**
* Retrieve the ptr to the iterators notion of current node
*
* @update gess4/18/98
* @return object at ith index
*/
void* GetCurrent(void);
/**
* Call this method when you wanto to iterate all the
* members of the container, passing a functor along
* to call your code.
*
* @update gess4/20/98
* @param aFunctor object to call for each member
* @return *this
*/
void ForEach(nsDequeFunctor& aFunctor) const;
/**
* Call this method when you wanto to iterate all the
* members of the container, passing a functor along
* to call your code.
*
* @update gess4/20/98
* @param aFunctor object to call for each member
* @return *this
*/
const void* FirstThat(nsDequeFunctor& aFunctor) const;
protected:
PRInt32 mIndex;
const nsDeque& mDeque;
};
#endif

View File

@@ -1,75 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
An empty enumerator.
*/
#include "nsIEnumerator.h"
////////////////////////////////////////////////////////////////////////
class EmptyEnumeratorImpl : public nsISimpleEnumerator
{
public:
EmptyEnumeratorImpl(void) {};
virtual ~EmptyEnumeratorImpl(void) {};
// nsISupports interface
NS_IMETHOD_(nsrefcnt) AddRef(void) {
return 2;
}
NS_IMETHOD_(nsrefcnt) Release(void) {
return 1;
}
NS_IMETHOD QueryInterface(REFNSIID iid, void** result) {
if (! result)
return NS_ERROR_NULL_POINTER;
if (iid.Equals(nsISimpleEnumerator::GetIID()) ||
iid.Equals(NS_GET_IID(nsISupports))) {
*result = (nsISimpleEnumerator*) this;
NS_ADDREF(this);
return NS_OK;
}
return NS_NOINTERFACE;
}
// nsISimpleEnumerator
NS_IMETHOD HasMoreElements(PRBool* aResult) {
*aResult = PR_FALSE;
return NS_OK;
}
NS_IMETHOD GetNext(nsISupports** aResult) {
return NS_ERROR_UNEXPECTED;
}
};
extern "C" NS_COM nsresult
NS_NewEmptyEnumerator(nsISimpleEnumerator** aResult)
{
static EmptyEnumeratorImpl gEmptyEnumerator;
*aResult = &gEmptyEnumerator;
return NS_OK;
}

View File

@@ -1,228 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsEnumeratorUtils.h"
nsArrayEnumerator::nsArrayEnumerator(nsISupportsArray* aValueArray)
: mValueArray(aValueArray),
mIndex(0)
{
NS_INIT_REFCNT();
NS_IF_ADDREF(mValueArray);
}
nsArrayEnumerator::~nsArrayEnumerator(void)
{
NS_IF_RELEASE(mValueArray);
}
NS_IMPL_ISUPPORTS1(nsArrayEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP
nsArrayEnumerator::HasMoreElements(PRBool* aResult)
{
NS_PRECONDITION(aResult != 0, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
PRUint32 cnt;
nsresult rv = mValueArray->Count(&cnt);
if (NS_FAILED(rv)) return rv;
*aResult = (mIndex < (PRInt32) cnt);
return NS_OK;
}
NS_IMETHODIMP
nsArrayEnumerator::GetNext(nsISupports** aResult)
{
NS_PRECONDITION(aResult != 0, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
PRUint32 cnt;
nsresult rv = mValueArray->Count(&cnt);
if (NS_FAILED(rv)) return rv;
if (mIndex >= (PRInt32) cnt)
return NS_ERROR_UNEXPECTED;
*aResult = mValueArray->ElementAt(mIndex++);
return NS_OK;
}
extern "C" NS_COM nsresult
NS_NewArrayEnumerator(nsISimpleEnumerator* *result,
nsISupportsArray* array)
{
nsArrayEnumerator* enumer = new nsArrayEnumerator(array);
if (enumer == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(enumer);
*result = enumer;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
nsSingletonEnumerator::nsSingletonEnumerator(nsISupports* aValue)
: mValue(aValue)
{
NS_INIT_REFCNT();
NS_IF_ADDREF(mValue);
mConsumed = (mValue ? PR_FALSE : PR_TRUE);
}
nsSingletonEnumerator::~nsSingletonEnumerator()
{
NS_IF_RELEASE(mValue);
}
NS_IMPL_ISUPPORTS1(nsSingletonEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP
nsSingletonEnumerator::HasMoreElements(PRBool* aResult)
{
NS_PRECONDITION(aResult != 0, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
*aResult = !mConsumed;
return NS_OK;
}
NS_IMETHODIMP
nsSingletonEnumerator::GetNext(nsISupports** aResult)
{
NS_PRECONDITION(aResult != 0, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (mConsumed)
return NS_ERROR_UNEXPECTED;
mConsumed = PR_TRUE;
NS_ADDREF(mValue);
*aResult = mValue;
return NS_OK;
}
extern "C" NS_COM nsresult
NS_NewSingletonEnumerator(nsISimpleEnumerator* *result,
nsISupports* singleton)
{
nsSingletonEnumerator* enumer = new nsSingletonEnumerator(singleton);
if (enumer == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(enumer);
*result = enumer;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
nsAdapterEnumerator::nsAdapterEnumerator(nsIEnumerator* aEnum)
: mEnum(aEnum), mCurrent(0), mStarted(PR_FALSE)
{
NS_INIT_REFCNT();
NS_ADDREF(mEnum);
}
nsAdapterEnumerator::~nsAdapterEnumerator()
{
NS_RELEASE(mEnum);
NS_IF_RELEASE(mCurrent);
}
NS_IMPL_ISUPPORTS1(nsAdapterEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP
nsAdapterEnumerator::HasMoreElements(PRBool* aResult)
{
nsresult rv;
if (mCurrent) {
*aResult = PR_TRUE;
return NS_OK;
}
if (! mStarted) {
mStarted = PR_TRUE;
rv = mEnum->First();
if (rv == NS_OK) {
mEnum->CurrentItem(&mCurrent);
*aResult = PR_TRUE;
}
else {
*aResult = PR_FALSE;
}
}
else {
*aResult = PR_FALSE;
rv = mEnum->IsDone();
if (rv != NS_OK) {
// We're not done. Advance to the next one.
rv = mEnum->Next();
if (rv == NS_OK) {
mEnum->CurrentItem(&mCurrent);
*aResult = PR_TRUE;
}
}
}
return NS_OK;
}
NS_IMETHODIMP
nsAdapterEnumerator::GetNext(nsISupports** aResult)
{
nsresult rv;
PRBool hasMore;
rv = HasMoreElements(&hasMore);
if (NS_FAILED(rv)) return rv;
if (! hasMore)
return NS_ERROR_UNEXPECTED;
// No need to addref, we "transfer" the ownership to the caller.
*aResult = mCurrent;
mCurrent = 0;
return NS_OK;
}
extern "C" NS_COM nsresult
NS_NewAdapterEnumerator(nsISimpleEnumerator* *result,
nsIEnumerator* enumerator)
{
nsAdapterEnumerator* enumer = new nsAdapterEnumerator(enumerator);
if (enumer == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(enumer);
*result = enumer;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,97 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsEnumeratorUtils_h__
#define nsEnumeratorUtils_h__
#include "nsIEnumerator.h"
#include "nsISupportsArray.h"
class NS_COM nsArrayEnumerator : public nsISimpleEnumerator
{
public:
// nsISupports interface
NS_DECL_ISUPPORTS
// nsISimpleEnumerator interface
NS_IMETHOD HasMoreElements(PRBool* aResult);
NS_IMETHOD GetNext(nsISupports** aResult);
// nsRDFArrayEnumerator methods
nsArrayEnumerator(nsISupportsArray* aValueArray);
virtual ~nsArrayEnumerator(void);
protected:
nsISupportsArray* mValueArray;
PRInt32 mIndex;
};
extern "C" NS_COM nsresult
NS_NewArrayEnumerator(nsISimpleEnumerator* *result,
nsISupportsArray* array);
////////////////////////////////////////////////////////////////////////////////
class NS_COM nsSingletonEnumerator : public nsISimpleEnumerator
{
public:
NS_DECL_ISUPPORTS
// nsISimpleEnumerator methods
NS_IMETHOD HasMoreElements(PRBool* aResult);
NS_IMETHOD GetNext(nsISupports** aResult);
nsSingletonEnumerator(nsISupports* aValue);
virtual ~nsSingletonEnumerator();
protected:
nsISupports* mValue;
PRBool mConsumed;
};
extern "C" NS_COM nsresult
NS_NewSingletonEnumerator(nsISimpleEnumerator* *result,
nsISupports* singleton);
////////////////////////////////////////////////////////////////////////////////
class NS_COM nsAdapterEnumerator : public nsISimpleEnumerator
{
public:
NS_DECL_ISUPPORTS
// nsISimpleEnumerator methods
NS_IMETHOD HasMoreElements(PRBool* aResult);
NS_IMETHOD GetNext(nsISupports** aResult);
nsAdapterEnumerator(nsIEnumerator* aEnum);
virtual ~nsAdapterEnumerator();
protected:
nsIEnumerator* mEnum;
nsISupports* mCurrent;
PRBool mStarted;
};
extern "C" NS_COM nsresult
NS_NewAdapterEnumerator(nsISimpleEnumerator* *result,
nsIEnumerator* enumerator);
////////////////////////////////////////////////////////////////////////
#endif /* nsEnumeratorUtils_h__ */

View File

@@ -1,67 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIArena_h___
#define nsIArena_h___
#include "nscore.h"
#include "nsISupports.h"
#define NS_MIN_ARENA_BLOCK_SIZE 64
#define NS_DEFAULT_ARENA_BLOCK_SIZE 4096
/// Interface IID for nsIArena
#define NS_IARENA_IID \
{ 0xa24fdad0, 0x93b4, 0x11d1, \
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
#define NS_ARENA_PROGID "component://netscape/arena"
#define NS_ARENA_CLASSNAME "Arena"
/** Interface to a memory arena abstraction. Arena's use large blocks
* of memory to allocate smaller objects. Arena's provide no free
* operator; instead, all of the objects in the arena are deallocated
* by deallocating the arena (e.g. when it's reference count goes to
* zero)
*/
class nsIArena : public nsISupports {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IARENA_IID; return iid; }
NS_IMETHOD Init(PRUint32 arenaBlockSize) = 0;
NS_IMETHOD_(void*) Alloc(PRUint32 size) = 0;
};
/**
* Create a new arena using the desired block size for allocating the
* underlying memory blocks. The underlying memory blocks are allocated
* using the PR heap.
*/
extern NS_COM nsresult NS_NewHeapArena(nsIArena** aInstancePtrResult,
PRUint32 aArenaBlockSize = 0);
#define NS_ARENA_CID \
{ /* 9832ec80-0d6b-11d3-9331-00104ba0fd40 */ \
0x9832ec80, \
0x0d6b, \
0x11d3, \
{0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#endif /* nsIArena_h___ */

View File

@@ -1,82 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
*
*/
#include "nsISupports.idl"
interface nsISizeOfHandler;
[ref] native nsStringRef(nsString);
%{ C++
class nsString;
%}
[uuid(3d1b15b0-93b4-11d1-895b-006008911b81)]
interface nsIAtom : nsISupports
{
/**
* Translate the unicode string into the stringbuf.
*/
void ToString(in nsStringRef aString);
/**
* Return a pointer to a zero terminated unicode string.
*/
void GetUnicode([shared, retval] out wstring aResult);
/**
* Get the size, in bytes, of the atom.
*/
PRUint32 SizeOf(in nsISizeOfHandler aHandler);
};
%{C++
/**
* Find an atom that matches the given iso-latin1 C string. The
* C string is translated into it's unicode equivalent.
*/
extern NS_COM nsIAtom* NS_NewAtom(const char* isolatin1);
/**
* Find an atom that matches the given unicode string. The string is assumed
* to be zero terminated.
*/
extern NS_COM nsIAtom* NS_NewAtom(const PRUnichar* unicode);
/**
* Find an atom that matches the given string.
*/
extern NS_COM nsIAtom* NS_NewAtom(const nsString& aString);
/**
* Return a count of the total number of atoms currently
* alive in the system.
*/
extern NS_COM nsrefcnt NS_GetNumberOfAtoms(void);
extern NS_COM void NS_PurgeAtomTable(void);
%}

View File

@@ -1,312 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIBuffer_h___
#define nsIBuffer_h___
/**
* nsIBuffer is something that we use to implement pipes (buffered
* input/output stream pairs). It might be useful to you for other
* purposes, but if not, oh well.
*
* One of the important things to understand about pipes is how
* they work with respect to EOF and result values. The following
* table describes:
*
* | empty & not EOF | full | reader closed | writer closed |
* -------------------------------------------------------------------------------------------------------------
* buffer Read | readCount == 0 | readCount == N | N/A | readCount == N, return NS_OK -or- |
* operations | return WOULD_BLOCK | return NS_OK | | readCount == 0, return EOF |
* -------------------------------------------------------------------------------------------------------------
* buffer Write | writeCount == N | writeCount == 0 | N/A | assertion! |
* operations | return NS_OK | return WOULD_BLOCK | | |
* -------------------------------------------------------------------------------------------------------------
* input stream | readCount == 0 | readCount == N | assertion! | readCount == N, return NS_OK -or- |
* Read ops | return WOULD_BLOCK | return NS_OK | | readCount == 0, return EOF |
* -------------------------------------------------------------------------------------------------------------
* output stream | writeCount == N | writeCount == 0 | return | assertion! |
* Write ops | return NS_OK | return WOULD_BLOCK | STREAM_CLOSED | |
* -------------------------------------------------------------------------------------------------------------
*/
#include "nsISupports.h"
#include "nscore.h"
class nsIInputStream;
class nsIAllocator;
class nsIBufferInputStream;
class nsIBufferOutputStream;
class nsIBufferObserver;
#define NS_IBUFFER_IID \
{ /* 1eebb300-fb8b-11d2-9324-00104ba0fd40 */ \
0x1eebb300, \
0xfb8b, \
0x11d2, \
{0x93, 0x24, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#define NS_BUFFER_CID \
{ /* 5dbe4de0-fbab-11d2-9324-00104ba0fd40 */ \
0x5dbe4de0, \
0xfbab, \
0x11d2, \
{0x93, 0x24, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#define NS_BUFFER_PROGID "component://netscape/buffer"
#define NS_BUFFER_CLASSNAME "Buffer"
/**
* The signature for the reader function passed to WriteSegment. This
* specifies where the data should come from that gets written into the buffer.
* Implementers should return the following:
* @return NS_OK and readCount - if successfully read something
* @return NS_BASE_STREAM_EOF - if no more to read
* @return NS_BASE_STREAM_WOULD_BLOCK - if there is currently no data (in
* a non-blocking mode)
* @return <other-error> - on failure
*/
typedef NS_CALLBACK(nsReadSegmentFun)(void* closure,
char* toRawSegment,
PRUint32 fromOffset,
PRUint32 count,
PRUint32 *readCount);
/**
* The signature of the writer function passed to ReadSegments. This
* specifies where the data should go that gets read from the buffer.
* Implementers should return the following:
* @return NS_OK and writeCount - if successfully wrote something
* @return NS_BASE_STREAM_CLOSED - if no more can be written
* @return NS_BASE_STREAM_WOULD_BLOCK - if there is currently space to write (in
* a non-blocking mode)
* @return <other-error> - on failure
*/
typedef NS_CALLBACK(nsWriteSegmentFun)(void* closure,
const char* fromRawSegment,
PRUint32 toOffset,
PRUint32 count,
PRUint32 *writeCount);
class nsIBuffer : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IBUFFER_IID);
/**
* The segment overhead is the amount of space chopped out of each
* segment for implementation purposes. The remainder of the segment
* is available for data, e.g.:
* segmentDataSize = growBySize - SEGMENT_OVERHEAD;
*/
enum { SEGMENT_OVERHEAD = 8 };
/**
* Initializes a buffer. The segment size (including overhead) will
* start from and increment by the growBySize, until reaching maxSize.
* The size of the data that can fit in a segment will be the growBySize
* minus SEGMENT_OVERHEAD bytes.
*/
NS_IMETHOD Init(PRUint32 growBySize, PRUint32 maxSize,
nsIBufferObserver* observer, nsIAllocator* allocator) = 0;
////////////////////////////////////////////////////////////////////////////
// Methods for Readers
/**
* Reads from the read cursor into a char buffer up to a specified length.
*/
NS_IMETHOD Read(char* toBuf, PRUint32 bufLen, PRUint32 *readCount) = 0;
/**
* This read method allows you to pass a callback function that gets called
* repeatedly for each buffer segment until the entire amount is read.
* This avoids the need to copy data to/from and intermediate buffer.
*/
NS_IMETHOD ReadSegments(nsWriteSegmentFun writer, void* closure, PRUint32 count,
PRUint32 *readCount) = 0;
/**
* Returns the raw char buffer segment and its length available for reading.
* @param segmentLogicalOffset - The offset from the current read cursor for
* the segment to be returned. If this is beyond the available written area,
* NULL is returned for the resultSegment.
* @param resultSegment - The resulting read segment.
* @param resultSegmentLength - The resulting read segment length.
*
* @return NS_OK - if a read segment is successfully returned, or if
* the requested offset is at or beyond the write cursor (in which case
* the resultSegment will be nsnull and the resultSegmentLen will be 0)
* @return NS_BASE_STREAM_WOULD_BLOCK - if the buffer size becomes 0
* @return any error set by SetCondition if the requested offset is at
* or beyond the write cursor (in which case the resultSegment will be
* nsnull and the resultSegmentLen will be 0). Note that NS_OK will be
* returned if SetCondition has not been called.
* @return any error returned by OnEmpty
*/
NS_IMETHOD GetReadSegment(PRUint32 segmentLogicalOffset,
const char* *resultSegment,
PRUint32 *resultSegmentLen) = 0;
/**
* Returns the amount of data currently in the buffer available for reading.
*/
NS_IMETHOD GetReadableAmount(PRUint32 *amount) = 0;
/**
* Searches for a string in the buffer. Since the buffer has a notion
* of EOF, it is possible that the string may at some time be in the
* buffer, but is is not currently found up to some offset. Consequently,
* both the found and not found cases return an offset:
* if found, return offset where it was found
* if not found, return offset of the first byte not searched
* In the case the buffer is at EOF and the string is not found, the first
* byte not searched will correspond to the length of the buffer.
*/
NS_IMETHOD Search(const char* forString, PRBool ignoreCase,
PRBool *found, PRUint32 *offsetSearchedTo) = 0;
/**
* Sets that the reader has closed their end of the stream.
*/
NS_IMETHOD ReaderClosed(void) = 0;
/**
* Tests whether EOF marker is set. Note that this does not necessarily mean that
* all the data in the buffer has yet been consumed.
*/
NS_IMETHOD GetCondition(nsresult *result) = 0;
////////////////////////////////////////////////////////////////////////////
// Methods for Writers
/**
* Writes from a char buffer up to a specified length.
* @param writeCount - The amount that could be written. If the buffer becomes full,
* this could be less then the specified bufLen.
*/
NS_IMETHOD Write(const char* fromBuf, PRUint32 bufLen, PRUint32 *writeCount) = 0;
/**
* Writes from an input stream up to a specified count of bytes.
* @param writeCount - The amount that could be written. If the buffer becomes full,
* this could be less then the specified count.
*/
NS_IMETHOD WriteFrom(nsIInputStream* fromStream, PRUint32 count, PRUint32 *writeCount) = 0;
/**
* This write method allows you to pass a callback function that gets called
* repeatedly for each buffer segment until the entire amount is written.
* This avoids the need to copy data to/from and intermediate buffer.
*/
NS_IMETHOD WriteSegments(nsReadSegmentFun reader, void* closure, PRUint32 count,
PRUint32 *writeCount) = 0;
/**
* Returns the raw char buffer segment and its length available for writing.
* @param resultSegment - The resulting write segment.
* @param resultSegmentLength - The resulting write segment length.
*
* @return NS_OK - if there is a segment available to write to
* @return NS_BASE_STREAM_CLOSED - if ReaderClosed has been called
* @return NS_BASE_STREAM_WOULD_BLOCK - if the max buffer size is exceeded
* @return NS_ERROR_OUT_OF_MEMORY - if a new segment could not be allocated
* @return any error returned by OnFull
*/
NS_IMETHOD GetWriteSegment(char* *resultSegment,
PRUint32 *resultSegmentLen) = 0;
/**
* Returns the amount of space currently in the buffer available for writing.
*/
NS_IMETHOD GetWritableAmount(PRUint32 *amount) = 0;
/**
* Returns whether the reader has closed their end of the stream.
*/
NS_IMETHOD GetReaderClosed(PRBool *result) = 0;
/**
* Sets an EOF marker (typcially done by the writer) so that a reader can be informed
* when all the data in the buffer is consumed. After the EOF marker has been
* set, all subsequent calls to the above write methods will return NS_BASE_STREAM_EOF.
*/
NS_IMETHOD SetCondition(nsresult condition) = 0;
};
////////////////////////////////////////////////////////////////////////////////
#define NS_IBUFFEROBSERVER_IID \
{ /* 0c18bef0-22a8-11d3-9349-00104ba0fd40 */ \
0x0c18bef0, \
0x22a8, \
0x11d3, \
{0x93, 0x49, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
/**
* A buffer observer is used to detect when the buffer becomes completely full
* or completely empty.
*/
class nsIBufferObserver : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IBUFFEROBSERVER_IID);
NS_IMETHOD OnFull(nsIBuffer* buffer) = 0;
NS_IMETHOD OnWrite(nsIBuffer*, PRUint32 amount) = 0;
NS_IMETHOD OnEmpty(nsIBuffer* buffer) = 0;
};
////////////////////////////////////////////////////////////////////////////////
/**
* Creates a new buffer.
* @param observer - may be null
*/
extern NS_COM nsresult
NS_NewBuffer(nsIBuffer* *result,
PRUint32 growBySize, PRUint32 maxSize,
nsIBufferObserver* observer);
/**
* Creates a new buffer, allocating segments from virtual memory pages.
*/
extern NS_COM nsresult
NS_NewPageBuffer(nsIBuffer* *result,
PRUint32 growBySize, PRUint32 maxSize,
nsIBufferObserver* observer);
extern NS_COM nsresult
NS_NewBufferInputStream(nsIBufferInputStream* *result,
nsIBuffer* buffer, PRBool blocking = PR_FALSE);
extern NS_COM nsresult
NS_NewBufferOutputStream(nsIBufferOutputStream* *result,
nsIBuffer* buffer, PRBool blocking = PR_FALSE);
extern NS_COM nsresult
NS_NewPipe(nsIBufferInputStream* *inStrResult,
nsIBufferOutputStream* *outStrResult,
PRUint32 growBySize, PRUint32 maxSize,
PRBool blocking, nsIBufferObserver* observer);
////////////////////////////////////////////////////////////////////////////////
#endif // nsIBuffer_h___

View File

@@ -1,76 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIByteBuffer_h___
#define nsIByteBuffer_h___
#include "nscore.h"
#include "nsISupports.h"
class nsIInputStream;
#define NS_IBYTE_BUFFER_IID \
{ 0xe4a6e4b0, 0x93b4, 0x11d1, \
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
#define NS_IBYTEBUFFER_IID \
{ 0xe4a6e4b0, 0x93b4, 0x11d1, \
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
#define NS_BYTEBUFFER_PROGID "component://netscape/byte-buffer"
#define NS_BYTEBUFFER_CLASSNAME "Byte Buffer"
/** Interface to a buffer that holds bytes */
class nsIByteBuffer : public nsISupports {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IBYTEBUFFER_IID; return iid; }
NS_IMETHOD Init(PRUint32 aBufferSize) = 0;
/** @return length of buffer, i.e. how many bytes are currently in it. */
NS_IMETHOD_(PRUint32) GetLength(void) const = 0;
/** @return number of bytes allocated in the buffer */
NS_IMETHOD_(PRUint32) GetBufferSize(void) const = 0;
/** @return the buffer */
NS_IMETHOD_(char*) GetBuffer(void) const = 0;
/** Grow buffer to aNewSize bytes. */
NS_IMETHOD_(PRBool) Grow(PRUint32 aNewSize) = 0;
/** Fill the buffer with data from aStream. Don't grow the buffer, only
* read until length of buffer equals buffer size. */
NS_IMETHOD_(PRInt32) Fill(nsresult* aErrorCode, nsIInputStream* aStream,
PRUint32 aKeep) = 0;
};
#define NS_BYTEBUFFER_CID \
{ /* a49d5280-0d6b-11d3-9331-00104ba0fd40 */ \
0xa49d5280, \
0x0d6b, \
0x11d3, \
{0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
/** Create a new byte buffer using the given buffer size. */
extern NS_COM nsresult
NS_NewByteBuffer(nsIByteBuffer** aInstancePtrResult,
nsISupports* aOuter,
PRUint32 aBufferSize = 0);
#endif /* nsIByteBuffer_h___ */

View File

@@ -1,38 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
#include "nsIEnumerator.idl"
[scriptable, uuid(83b6019c-cbc4-11d2-8cca-0060b0fc14a3)]
interface nsICollection : nsISupports
{
PRUint32 Count();
nsISupports GetElementAt(in PRUint32 index);
void QueryElementAt(in PRUint32 index, in nsIIDRef uuid,
[iid_is(uuid),retval] out nsQIResult result);
void SetElementAt(in PRUint32 index, in nsISupports item);
void AppendElement(in nsISupports item);
void RemoveElement(in nsISupports item);
nsIEnumerator Enumerate();
void Clear();
};

View File

@@ -1,95 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
[scriptable, uuid(D1899240-F9D2-11D2-BDD6-000064657374)]
interface nsISimpleEnumerator : nsISupports {
boolean HasMoreElements();
nsISupports GetNext();
};
/*
* DO NOT USE THIS INTERFACE. IT IS HORRIBLY BROKEN, USES NS_COMFALSE
* AND IS BASICALLY IMPOSSIBLE TO USE CORRECTLY THROUGH PROXIES OR
* XPCONNECT. IF YOU SEE NEW USES OF THIS INTERFACE IN CODE YOU ARE
* REVIEWING, YOU SHOULD INSIST ON nsISimpleEnumerator.
*
* DON'T MAKE ME COME OVER THERE.
*/
[scriptable, uuid(ad385286-cbc4-11d2-8cca-0060b0fc14a3)]
interface nsIEnumerator : nsISupports {
/** First will reset the list. will return NS_FAILED if no items
*/
void first();
/** Next will advance the list. will return failed if already at end
*/
void next();
/** CurrentItem will return the CurrentItem item it will fail if the
* list is empty
*/
nsISupports currentItem();
/** return if the collection is at the end. that is the beginning following
* a call to Prev and it is the end of the list following a call to next
*/
void isDone();
};
[uuid(75f158a0-cadd-11d2-8cca-0060b0fc14a3)]
interface nsIBidirectionalEnumerator : nsIEnumerator {
/** Last will reset the list to the end. will return NS_FAILED if no items
*/
void Last();
/** Prev will decrement the list. will return failed if already at beginning
*/
void Prev();
};
%{C++
extern "C" NS_COM nsresult
NS_NewEmptyEnumerator(nsISimpleEnumerator** aResult);
// Construct and return an implementation of a "conjoining enumerator." This
// enumerator lets you string together two other enumerators into one sequence.
// The result is an nsIBidirectionalEnumerator, but if either input is not
// also bidirectional, the Last and Prev operations will fail.
extern "C" NS_COM nsresult
NS_NewConjoiningEnumerator(nsIEnumerator* first, nsIEnumerator* second,
nsIBidirectionalEnumerator* *aInstancePtrResult);
// Construct and return an implementation of a "union enumerator." This
// enumerator will only return elements that are found in both constituent
// enumerators.
extern "C" NS_COM nsresult
NS_NewUnionEnumerator(nsIEnumerator* first, nsIEnumerator* second,
nsIEnumerator* *aInstancePtrResult);
// Construct and return an implementation of an "intersection enumerator." This
// enumerator will return elements that are found in either constituent
// enumerators, eliminating duplicates.
extern "C" NS_COM nsresult
NS_NewIntersectionEnumerator(nsIEnumerator* first, nsIEnumerator* second,
nsIEnumerator* *aInstancePtrResult);
%}

View File

@@ -1,44 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
[scriptable, uuid(DB242E01-E4D9-11d2-9DDE-000064657374)]
interface nsIObserver : nsISupports {
/*------------------------------- Observe ----------------------------------
| Called when aTopic changes for aSubject (presumably; it is actually |
| called whenever anyone calls nsIObserverService::Notify for aTopic). |
| |
| Implement this in your class to handle the event appropriately. If |
| your observer objects can respond to multiple topics and/or subjects, |
| then you will have to filter accordingly. |
--------------------------------------------------------------------------*/
void Observe( in nsISupports aSubject,
in wstring aTopic,
in wstring someData );
};
%{C++
#define NS_OBSERVER_PROGID "component://netscape/xpcom/observer"
#define NS_OBSERVER_CLASSNAME "Observer"
%}

View File

@@ -1,48 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIObserverList_h__
#define nsIObserverList_h__
#include "nsISupports.h"
#include "nsIObserver.h"
#include "nsIEnumerator.h"
#include "nscore.h"
// {E777D482-E6E3-11d2-8ACD-00105A1B8860}
#define NS_IOBSERVERLIST_IID \
{ 0xe777d482, 0xe6e3, 0x11d2, { 0x8a, 0xcd, 0x0, 0x10, 0x5a, 0x1b, 0x88, 0x60 } }
// {E777D484-E6E3-11d2-8ACD-00105A1B8860}
#define NS_OBSERVERLIST_CID \
{ 0xe777d484, 0xe6e3, 0x11d2, { 0x8a, 0xcd, 0x0, 0x10, 0x5a, 0x1b, 0x88, 0x60 } }
class nsIObserverList : public nsISupports {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IOBSERVERLIST_IID; return iid; }
NS_IMETHOD AddObserver(nsIObserver** anObserver) = 0;
NS_IMETHOD RemoveObserver(nsIObserver** anObserver) = 0;
NS_IMETHOD EnumerateObserverList(nsIEnumerator** anEnumerator) = 0;
};
extern NS_COM nsresult NS_NewObserverList(nsIObserverList** anObserverList);
#endif /* nsIObserverList_h__ */

View File

@@ -1,41 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
#include "nsIObserver.idl"
#include "nsIEnumerator.idl"
[scriptable, uuid(D07F5192-E3D1-11d2-8ACD-00105A1B8860)]
interface nsIObserverService : nsISupports {
void AddObserver( in nsIObserver anObserver, in wstring aTopic );
void RemoveObserver( in nsIObserver anObserver, in wstring nsString );
nsIEnumerator EnumerateObserverList( in wstring aTopic );
void Notify( in nsISupports aSubject,
in wstring aTopic,
in wstring someData );
};
%{C++
#define NS_OBSERVERSERVICE_PROGID "component://netscape/observer-service"
#define NS_OBSERVERSERVICE_CLASSNAME "Observer Service"
%}

View File

@@ -1,57 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIPageManager_h__
#define nsIPageManager_h__
#include "nsISupports.h"
#define NS_PAGEMGR_PAGE_BITS 12 // 4k pages
#define NS_PAGEMGR_PAGE_SIZE (1 << NS_PAGEMGR_PAGE_BITS)
#define NS_PAGEMGR_PAGE_MASK (NS_PAGEMGR_PAGE_SIZE - 1)
#define NS_PAGEMGR_PAGE_COUNT(bytes) (((bytes) + NS_PAGEMGR_PAGE_MASK) >> NS_PAGEMGR_PAGE_BITS)
#define NS_IPAGEMANAGER_IID \
{ /* bea98210-fb7b-11d2-9324-00104ba0fd40 */ \
0xbea98210, \
0xfb7b, \
0x11d2, \
{0x93, 0x24, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#define NS_PAGEMANAGER_CID \
{ /* cac907e0-fb7b-11d2-9324-00104ba0fd40 */ \
0xcac907e0, \
0xfb7b, \
0x11d2, \
{0x93, 0x24, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#define NS_PAGEMANAGER_PROGID "component://netscape/page-manager"
#define NS_PAGEMANAGER_CLASSNAME "Page Manager"
class nsIPageManager : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPAGEMANAGER_IID);
NS_IMETHOD AllocPages(PRUint32 pageCount, void* *result) = 0;
NS_IMETHOD DeallocPages(PRUint32 pageCount, void* pages) = 0;
};
#endif // nsIPageManager_h__

View File

@@ -1,150 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIProperties_h___
#define nsIProperties_h___
#include "nsISupports.h"
#include "nsIEnumerator.h"
#include "nsISupportsArray.h"
#define NS_IPROPERTIES_IID \
{ /* f42bc870-dc17-11d2-9311-00e09805570f */ \
0xf42bc870, \
0xdc17, \
0x11d2, \
{0x93, 0x11, 0x00, 0xe0, 0x98, 0x05, 0x57, 0x0f} \
}
#define NS_PROPERTIES_CID \
{ /* b3efe4d0-0d6b-11d3-9331-00104ba0fd40 */ \
0xb3efe4d0, \
0x0d6b, \
0x11d3, \
{0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#define NS_PROPERTIES_PROGID "component://netscape/properties"
#define NS_PROPERTIES_CLASSNAME "Properties"
class nsIProperties : public nsISupports {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IPROPERTIES_IID; return iid; }
/**
* Defines a new property.
* @return NS_ERROR_FAILURE if a property is already defined.
*/
NS_IMETHOD DefineProperty(const char* prop, nsISupports* initialValue) = 0;
/**
* Undefines a property.
* @return NS_ERROR_FAILURE if a property is not already defined.
*/
NS_IMETHOD UndefineProperty(const char* prop) = 0;
/**
* Gets a property.
* @return NS_ERROR_FAILURE if a property is not already defined.
*/
NS_IMETHOD GetProperty(const char* prop, nsISupports* *result) = 0;
/**
* Sets a property.
* @return NS_ERROR_FAILURE if a property is not already defined.
*/
NS_IMETHOD SetProperty(const char* prop, nsISupports* value) = 0;
/**
* @return NS_OK if the property exists with the specified value
* @return NS_COMFALSE if the property does not exist, or doesn't have
* the specified value (values are compared with ==)
*/
NS_IMETHOD HasProperty(const char* prop, nsISupports* value) = 0;
};
// Returns a default implementation of an nsIProperties object.
extern nsresult
NS_NewIProperties(nsIProperties* *result);
////////////////////////////////////////////////////////////////////////////////
#include "nsID.h"
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsString.h"
// {1A180F60-93B2-11d2-9B8B-00805F8A16D9}
#define NS_IPERSISTENTPROPERTIES_IID \
{ 0x1a180f60, 0x93b2, 0x11d2, \
{ 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9 } }
// {2245E573-9464-11d2-9B8B-00805F8A16D9}
NS_DECLARE_ID(kPersistentPropertiesCID,
0x2245e573, 0x9464, 0x11d2, 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9);
#define NS_PERSISTENTPROPERTIES_PROGID "component://netscape/persistent-properties"
#define NS_PERSISTENTPROPERTIES_CLASSNAME "Persistent Properties"
class nsIPersistentProperties : public nsIProperties
{
public:
static const nsIID& GetIID() { static nsIID iid = NS_IPERSISTENTPROPERTIES_IID; return iid; }
NS_IMETHOD Load(nsIInputStream* aIn) = 0;
NS_IMETHOD Save(nsIOutputStream* aOut, const nsString& aHeader) = 0;
NS_IMETHOD Subclass(nsIPersistentProperties* aSubclass) = 0;
/**
* Enumerates the properties in the supplied enumerator.
* @return NS_ERROR_FAILURE if no properties to enumerate
*/
NS_IMETHOD EnumerateProperties(nsIBidirectionalEnumerator** aResult) = 0;
// XXX these 2 methods will be subsumed by the ones from
// nsIProperties once we figure this all out
NS_IMETHOD GetStringProperty(const nsString& aKey, nsString& aValue) = 0;
NS_IMETHOD SetStringProperty(const nsString& aKey, nsString& aNewValue,
nsString& aOldValue) = 0;
};
////////////////////////////////////////////////////////////////////////////////
// {C23C10B3-0E1A-11d3-A430-0060B0EB5963}
#define NS_IPROPERTYELEMENT_IID \
{ 0xc23c10b3, 0xe1a, 0x11d3, \
{ 0xa4, 0x30, 0x0, 0x60, 0xb0, 0xeb, 0x59, 0x63 } }
// {579C0568-0E1B-11d3-A430-0060B0EB5963}
NS_DECLARE_ID(kPropertyElementCID,
0x579c0568, 0xe1b, 0x11d3, 0xa4, 0x30, 0x0, 0x60, 0xb0, 0xeb, 0x59, 0x63);
class nsIPropertyElement : public nsISupports
{
public:
static const nsIID& GetIID() { static nsIID iid = NS_IPROPERTYELEMENT_IID; return iid; }
NS_IMETHOD SetKey(nsString* aKey) = 0;
NS_IMETHOD SetValue(nsString* aValue) = 0;
NS_IMETHOD GetKey(nsString** aReturnKey) = 0;
NS_IMETHOD GetValue(nsString** aReturnValue) = 0;
};
////////////////////////////////////////////////////////////////////////////////
#endif // nsIProperties_h___

View File

@@ -1,26 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsISimpleEnumerator_h__
#define nsISimpleEnumerator_h__
// This file is needed to pacify the xpidl-generated header files.
#include "nsIEnumerator.h"
#endif // nsISimpleEnumerator_h__

View File

@@ -1,100 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsISizeOfHandler_h___
#define nsISizeOfHandler_h___
#include "nscore.h"
#include "nsISupports.h"
/* c028d1f0-fc9e-11d1-89e4-006008911b81 */
#define NS_ISIZEOF_HANDLER_IID \
{ 0xc028d1f0, 0xfc9e, 0x11d1, {0x89, 0xe4, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81}}
class nsIAtom;
class nsISizeOfHandler;
/**
* Function used by the Report method to report data gathered during
* a collection of data.
*/
typedef void (*nsISizeofReportFunc)(nsISizeOfHandler* aHandler,
nsIAtom* aKey,
PRUint32 aCount,
PRUint32 aTotalSize,
PRUint32 aMinSize,
PRUint32 aMaxSize,
void* aArg);
/**
* An API to managing a sizeof computation of an arbitrary graph.
* The handler is responsible for remembering which objects have been
* seen before (using RecordObject). Note that the handler doesn't
* hold references to nsISupport's objects; the assumption is that the
* objects being sized are stationary and will not be modified during
* the sizing computation and therefore do not need an extra reference
* count.
*
* Users of this API are responsible for the actual graph/tree walking.
*/
class nsISizeOfHandler : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISIZEOF_HANDLER_IID)
/**
* Initialize the handler for a new collection of data. This empties
* out the object prescence table and the keyed size table.
*/
NS_IMETHOD Init() = 0;
/**
* Record the sizing status of a given object. The first time
* aObject is recorded, aResult will be PR_FALSE. Subsequent times,
* aResult will be PR_TRUE.
*/
NS_IMETHOD RecordObject(void* aObject, PRBool* aResult) = 0;
/**
* Add size information to the running size data. The atom is used
* as a key to keep type specific running totals of size
* information. This increments the total count and the total size
* as well as updates the minimum, maximum and total size for aKey's
* type.
*/
NS_IMETHOD AddSize(nsIAtom* aKey, PRUint32 aSize) = 0;
/**
* Enumerate data collected for each type and invoke the
* reporting function with the data gathered.
*/
NS_IMETHOD Report(nsISizeofReportFunc aFunc, void* aArg) = 0;
/**
* Get the current totals - the number of total objects sized (not
* necessarily anything to do with RecordObject's tracking of
* objects) and the total number of bytes that those object use. The
* counters are not reset by this call (use Init to reset
* everything).
*/
NS_IMETHOD GetTotals(PRUint32* aTotalCountResult,
PRUint32* aTotalSizeResult) = 0;
};
extern NS_COM nsresult
NS_NewSizeOfHandler(nsISizeOfHandler** aInstancePtrResult);
#endif /* nsISizeofHandler_h___ */

View File

@@ -1,104 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.idl"
#include "nsICollection.idl"
native nsISupportsArrayEnumFunc(nsISupportsArrayEnumFunc);
%{C++
class nsIBidirectionalEnumerator;
#define NS_SUPPORTSARRAY_CID \
{ /* bda17d50-0d6b-11d3-9331-00104ba0fd40 */ \
0xbda17d50, \
0x0d6b, \
0x11d3, \
{0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#define NS_SUPPORTSARRAY_PROGID "component://netscape/supports-array"
#define NS_SUPPORTSARRAY_CLASSNAME "Supports Array"
// Enumerator callback function. Return PR_FALSE to stop
typedef PRBool (*nsISupportsArrayEnumFunc)(nsISupports* aElement, void *aData);
%}
[scriptable, uuid(791eafa0-b9e6-11d1-8031-006008159b5a)]
interface nsISupportsArray : nsICollection {
[notxpcom] boolean Equals([const] in nsISupportsArray other);
[notxpcom] nsISupports ElementAt(in unsigned long aIndex);
[notxpcom] long IndexOf([const] in nsISupports aPossibleElement);
[notxpcom] long IndexOfStartingAt([const] in nsISupports aPossibleElement,
in unsigned long aStartIndex);
[notxpcom] long LastIndexOf([const] in nsISupports aPossibleElement);
// xpcom-compatible versions
long GetIndexOf(in nsISupports aPossibleElement);
long GetIndexOfStartingAt(in nsISupports aPossibleElement,
in unsigned long aStartIndex);
long GetLastIndexOf(in nsISupports aPossibleElement);
[notxpcom] boolean InsertElementAt(in nsISupports aElement,
in unsigned long aIndex);
[notxpcom] boolean ReplaceElementAt(in nsISupports aElement,
in unsigned long aIndex);
[notxpcom] boolean RemoveElementAt(in unsigned long aIndex);
[notxpcom] boolean RemoveLastElement([const] in nsISupports aElement);
// xpcom-compatible versions
void DeleteLastElement(in nsISupports aElement);
void DeleteElementAt(in unsigned long aIndex);
[notxpcom] boolean AppendElements(in nsISupportsArray aElements);
void Compact();
[notxpcom, noscript]
boolean EnumerateForwards(in nsISupportsArrayEnumFunc aFunc,
in voidStar aData);
[notxpcom, noscript]
boolean EnumerateBackwards(in nsISupportsArrayEnumFunc aFunc,
in voidStar aData);
%{C++
private:
// NS_IMETHOD_(nsISupportsArray&) operator=(const nsISupportsArray& other) = 0;
NS_IMETHOD_(PRBool) operator==(const nsISupportsArray& other) = 0;
NS_IMETHOD_(nsISupports*) operator[](PRUint32 aIndex) = 0;
%}
};
%{C++
// Construct and return a default implementation of nsISupportsArray:
extern NS_COM nsresult
NS_NewISupportsArray(nsISupportsArray** aInstancePtrResult);
// Construct and return a default implementation of an enumerator for nsISupportsArrays:
extern NS_COM nsresult
NS_NewISupportsArrayEnumerator(nsISupportsArray* array,
nsIBidirectionalEnumerator* *aInstancePtrResult);
%}

View File

@@ -1,263 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* nsISupports wrappers for single primitive pieces of data. */
#include "nsISupports.idl"
/**
* These first three are pointer types and do data copying
* using the nsIAllocator. Be careful!
*/
[scriptable, uuid(d18290a0-4a1c-11d3-9890-006008962422)]
interface nsISupportsID : nsISupports
{
attribute nsIDPtr data;
string toString();
};
[scriptable, uuid(d65ff270-4a1c-11d3-9890-006008962422)]
interface nsISupportsString : nsISupports
{
attribute string data;
string toString();
};
[scriptable, uuid(d79dc970-4a1c-11d3-9890-006008962422)]
interface nsISupportsWString : nsISupports
{
attribute wstring data;
wstring toString();
};
/**
* The rest are truly primitive and are passed by value
*/
[scriptable, uuid(ddc3b490-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRBool : nsISupports
{
attribute PRBool data;
string toString();
};
[scriptable, uuid(dec2e4e0-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRUint8 : nsISupports
{
attribute PRUint8 data;
string toString();
};
[scriptable, uuid(dfacb090-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRUint16 : nsISupports
{
attribute PRUint16 data;
string toString();
};
[scriptable, uuid(e01dc470-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRUint32 : nsISupports
{
attribute PRUint32 data;
string toString();
};
[scriptable, uuid(e13567c0-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRUint64 : nsISupports
{
attribute PRUint64 data;
string toString();
};
[scriptable, uuid(e2563630-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRTime : nsISupports
{
attribute PRTime data;
string toString();
};
[scriptable, uuid(e2b05e40-4a1c-11d3-9890-006008962422)]
interface nsISupportsChar : nsISupports
{
attribute char data;
string toString();
};
[scriptable, uuid(e30d94b0-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRInt16 : nsISupports
{
attribute PRInt16 data;
string toString();
};
[scriptable, uuid(e36c5250-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRInt32 : nsISupports
{
attribute PRInt32 data;
string toString();
};
[scriptable, uuid(e3cb0ff0-4a1c-11d3-9890-006008962422)]
interface nsISupportsPRInt64 : nsISupports
{
attribute PRInt64 data;
string toString();
};
[scriptable, uuid(abeaa390-4ac0-11d3-baea-00805f8a5dd7)]
interface nsISupportsFloat : nsISupports
{
attribute float data;
string toString();
};
[scriptable, uuid(b32523a0-4ac0-11d3-baea-00805f8a5dd7)]
interface nsISupportsDouble : nsISupports
{
attribute double data;
string toString();
};
[scriptable, uuid(464484f0-568d-11d3-baf8-00805f8a5dd7)]
interface nsISupportsVoid : nsISupports
{
/*
* This would be: "[noscript] attribute voidStar data;" but for...
* http://bugzilla.mozilla.org/show_bug.cgi?id=11454
*/
[noscript] void GetData([shared,retval] out voidStar aData);
[noscript] void SetData(in voidStar aData);
string toString();
};
/////////////////////////////////////////////////////////////////////////
%{C++
// {ACF8DC40-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_ID_CID \
{ 0xacf8dc40, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_ID_PROGID "component://netscape/supports-id"
#define NS_SUPPORTS_ID_CLASSNAME "Supports ID"
// {ACF8DC41-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_STRING_CID \
{ 0xacf8dc41, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_STRING_PROGID "component://netscape/supports-string"
#define NS_SUPPORTS_STRING_CLASSNAME "Supports String"
// {ACF8DC42-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_WSTRING_CID \
{ 0xacf8dc42, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_WSTRING_PROGID "component://netscape/supports-wstring"
#define NS_SUPPORTS_WSTRING_CLASSNAME "Supports WString"
// {ACF8DC43-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRBOOL_CID \
{ 0xacf8dc43, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRBOOL_PROGID "component://netscape/supports-PRBool"
#define NS_SUPPORTS_PRBOOL_CLASSNAME "Supports PRBool"
// {ACF8DC44-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRUINT8_CID \
{ 0xacf8dc44, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRUINT8_PROGID "component://netscape/supports-PRUint8"
#define NS_SUPPORTS_PRUINT8_CLASSNAME "Supports PRUint8"
// {ACF8DC46-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRUINT16_CID \
{ 0xacf8dc46, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRUINT16_PROGID "component://netscape/supports-PRUint16"
#define NS_SUPPORTS_PRUINT16_CLASSNAME "Supports PRUint16"
// {ACF8DC47-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRUINT32_CID \
{ 0xacf8dc47, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRUINT32_PROGID "component://netscape/supports-PRUint32"
#define NS_SUPPORTS_PRUINT32_CLASSNAME "Supports PRUint32"
// {ACF8DC48-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRUINT64_CID \
{ 0xacf8dc48, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRUINT64_PROGID "component://netscape/supports-PRUint64"
#define NS_SUPPORTS_PRUINT64_CLASSNAME "Supports PRUint64"
// {ACF8DC49-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRTIME_CID \
{ 0xacf8dc49, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRTIME_PROGID "component://netscape/supports-PRTime"
#define NS_SUPPORTS_PRTIME_CLASSNAME "Supports PRTime"
// {ACF8DC4A-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_CHAR_CID \
{ 0xacf8dc4a, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_CHAR_PROGID "component://netscape/supports-char"
#define NS_SUPPORTS_CHAR_CLASSNAME "Supports Char"
// {ACF8DC4B-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRINT16_CID \
{ 0xacf8dc4b, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRINT16_PROGID "component://netscape/supports-PRInt16"
#define NS_SUPPORTS_PRINT16_CLASSNAME "Supports PRInt16"
// {ACF8DC4C-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRINT32_CID \
{ 0xacf8dc4c, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRINT32_PROGID "component://netscape/supports-PRInt32"
#define NS_SUPPORTS_PRINT32_CLASSNAME "Supports PRInt32"
// {ACF8DC4D-4A25-11d3-9890-006008962422}
#define NS_SUPPORTS_PRINT64_CID \
{ 0xacf8dc4d, 0x4a25, 0x11d3, \
{ 0x98, 0x90, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
#define NS_SUPPORTS_PRINT64_PROGID "component://netscape/supports-PRInt64"
#define NS_SUPPORTS_PRINT64_CLASSNAME "Supports PRInt64"
// {CBF86870-4AC0-11d3-BAEA-00805F8A5DD7}
#define NS_SUPPORTS_FLOAT_CID \
{ 0xcbf86870, 0x4ac0, 0x11d3, \
{ 0xba, 0xea, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
#define NS_SUPPORTS_FLOAT_PROGID "component://netscape/supports-float"
#define NS_SUPPORTS_FLOAT_CLASSNAME "Supports float"
// {CBF86871-4AC0-11d3-BAEA-00805F8A5DD7}
#define NS_SUPPORTS_DOUBLE_CID \
{ 0xcbf86871, 0x4ac0, 0x11d3, \
{ 0xba, 0xea, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
#define NS_SUPPORTS_DOUBLE_PROGID "component://netscape/supports-double"
#define NS_SUPPORTS_DOUBLE_CLASSNAME "Supports double"
// {AF10F3E0-568D-11d3-BAF8-00805F8A5DD7}
#define NS_SUPPORTS_VOID_CID \
{ 0xaf10f3e0, 0x568d, 0x11d3, \
{ 0xba, 0xf8, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
#define NS_SUPPORTS_VOID_PROGID "component://netscape/supports-void"
#define NS_SUPPORTS_VOID_CLASSNAME "Supports void"
%}

View File

@@ -1,57 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIUnicharBuffer_h___
#define nsIUnicharBuffer_h___
#include "nscore.h"
#include "nsISupports.h"
class nsIUnicharInputStream;
#define NS_IUNICHARBUFFER_IID \
{ 0x14cf6970, 0x93b5, 0x11d1, \
{0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81} }
/// Interface to a buffer that holds unicode characters
class nsIUnicharBuffer : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUNICHARBUFFER_IID);
NS_IMETHOD Init(PRUint32 aBufferSize) = 0;
NS_IMETHOD_(PRInt32) GetLength() const = 0;
NS_IMETHOD_(PRInt32) GetBufferSize() const = 0;
NS_IMETHOD_(PRUnichar*) GetBuffer() const = 0;
NS_IMETHOD_(PRBool) Grow(PRInt32 aNewSize) = 0;
NS_IMETHOD_(PRInt32) Fill(nsresult* aErrorCode, nsIUnicharInputStream* aStream,
PRInt32 aKeep) = 0;
};
/// Factory method for nsIUnicharBuffer.
extern NS_COM nsresult
NS_NewUnicharBuffer(nsIUnicharBuffer** aInstancePtrResult,
nsISupports* aOuter,
PRUint32 aBufferSize = 0);
#define NS_UNICHARBUFFER_CID \
{ /* c81fd8f0-0d6b-11d3-9331-00104ba0fd40 */ \
0xc81fd8f0, \
0x0d6b, \
0x11d3, \
{0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#endif /* nsIUnicharBuffer_h___ */

View File

@@ -1,340 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsInt64_h__
#define nsInt64_h__
#include "prlong.h"
#include "nscore.h"
/**
* This class encapsulates full 64-bit integer functionality and
* provides simple arithmetic and conversion operations.
*/
// If you ever decide that you need to add a non-inline method to this
// class, be sure to change the class declaration to "class NS_BASE
// nsInt64".
class nsInt64
{
private:
PRInt64 mValue;
public:
/**
* Construct a new 64-bit integer.
*/
nsInt64(void) : mValue(LL_ZERO) {
}
/**
* Construct a new 64-bit integer from a 32-bit signed integer
*/
nsInt64(const PRInt32 aInt32) {
LL_I2L(mValue, aInt32);
}
/**
* Construct a new 64-bit integer from a 32-bit unsigned integer
*/
nsInt64(const PRUint32 aUint32) {
LL_UI2L(mValue, aUint32);
}
/**
* Construct a new 64-bit integer from a floating point value.
*/
nsInt64(const PRFloat64 aFloat64) {
LL_D2L(mValue, aFloat64);
}
/**
* Construct a new 64-bit integer from a native 64-bit integer
*/
nsInt64(const PRInt64 aInt64) : mValue(aInt64) {
}
/**
* Construct a new 64-bit integer from another 64-bit integer
*/
nsInt64(const nsInt64& aObject) : mValue(aObject.mValue) {
}
// ~nsInt64(void) -- XXX destructor unnecessary
/**
* Assign a 64-bit integer to another 64-bit integer
*/
const nsInt64& operator =(const nsInt64& aObject) {
mValue = aObject.mValue;
return *this;
}
/**
* Convert a 64-bit integer to a signed 32-bit value
*/
operator PRInt32(void) const {
PRInt32 result;
LL_L2I(result, mValue);
return result;
}
/**
* Convert a 64-bit integer to an unsigned 32-bit value
*/
operator PRUint32(void) const {
PRUint32 result;
LL_L2UI(result, mValue);
return result;
}
/**
* Convert a 64-bit integer to a floating point value
*/
operator PRFloat64(void) const {
PRFloat64 result;
LL_L2D(result, mValue);
return result;
}
/**
* Convert a 64-bit integer to a native 64-bit integer.
*/
operator PRInt64(void) const {
return mValue;
}
/**
* Perform unary negation on a 64-bit integer.
*/
const nsInt64 operator -(void) {
nsInt64 result;
LL_NEG(result.mValue, mValue);
return result;
}
// Arithmetic operators
friend const nsInt64 operator +(const nsInt64& aObject1, const nsInt64& aObject2);
friend const nsInt64 operator -(const nsInt64& aObject1, const nsInt64& aObject2);
friend const nsInt64 operator *(const nsInt64& aObject1, const nsInt64& aObject2);
friend const nsInt64 operator /(const nsInt64& aObject1, const nsInt64& aObject2);
friend const nsInt64 operator %(const nsInt64& aObject1, const nsInt64& aObject2);
/**
* Increment a 64-bit integer by a 64-bit integer amount.
*/
nsInt64& operator +=(const nsInt64& aObject) {
LL_ADD(mValue, mValue, aObject.mValue);
return *this;
}
/**
* Decrement a 64-bit integer by a 64-bit integer amount.
*/
nsInt64& operator -=(const nsInt64& aObject) {
LL_SUB(mValue, mValue, aObject.mValue);
return *this;
}
/**
* Multiply a 64-bit integer by a 64-bit integer amount.
*/
nsInt64& operator *=(const nsInt64& aObject) {
LL_MUL(mValue, mValue, aObject.mValue);
return *this;
}
/**
* Divide a 64-bit integer by a 64-bit integer amount.
*/
nsInt64& operator /=(const nsInt64& aObject) {
LL_DIV(mValue, mValue, aObject.mValue);
return *this;
}
/**
* Compute the modulus of a 64-bit integer to a 64-bit value.
*/
nsInt64& operator %=(const nsInt64& aObject) {
LL_MOD(mValue, mValue, aObject.mValue);
return *this;
}
// Comparison operators
friend PRBool operator ==(const nsInt64& aObject1, const nsInt64& aObject2);
friend PRBool operator !=(const nsInt64& aObject1, const nsInt64& aObject2);
friend PRBool operator >(const nsInt64& aObject1, const nsInt64& aObject2);
friend PRBool operator >=(const nsInt64& aObject1, const nsInt64& aObject2);
friend PRBool operator <(const nsInt64& aObject1, const nsInt64& aObject2);
friend PRBool operator <=(const nsInt64& aObject1, const nsInt64& aObject2);
// Bitwise operators
friend const nsInt64 operator &(const nsInt64& aObject1, const nsInt64& aObject2);
friend const nsInt64 operator |(const nsInt64& aObject1, const nsInt64& aObject2);
friend const nsInt64 operator ^(const nsInt64& aObject1, const nsInt64& aObject2);
/**
* Compute the bitwise NOT of a 64-bit integer
*/
const nsInt64 operator ~(void) {
nsInt64 result;
LL_NOT(result.mValue, mValue);
return result;
}
/**
* Compute the bitwise AND with another 64-bit integer
*/
nsInt64& operator &=(const nsInt64& aObject) {
LL_AND(mValue, mValue, aObject.mValue);
return *this;
}
/**
* Compute the bitwise OR with another 64-bit integer
*/
nsInt64& operator |=(const nsInt64& aObject) {
LL_OR(mValue, mValue, aObject.mValue);
return *this;
}
/**
* Compute the bitwise XOR with another 64-bit integer
*/
nsInt64& operator ^=(const nsInt64& aObject) {
LL_XOR(mValue, mValue, aObject.mValue);
return *this;
}
};
/**
* Add two 64-bit integers.
*/
inline const nsInt64
operator +(const nsInt64& aObject1, const nsInt64& aObject2) {
return nsInt64(aObject1) += aObject2;
}
/**
* Subtract one 64-bit integer from another.
*/
inline const nsInt64
operator -(const nsInt64& aObject1, const nsInt64& aObject2) {
return nsInt64(aObject1) -= aObject2;
}
/**
* Multiply two 64-bit integers
*/
inline const nsInt64
operator *(const nsInt64& aObject1, const nsInt64& aObject2) {
return nsInt64(aObject1) *= aObject2;
}
/**
* Divide one 64-bit integer by another
*/
inline const nsInt64
operator /(const nsInt64& aObject1, const nsInt64& aObject2) {
return nsInt64(aObject1) /= aObject2;
}
/**
* Compute the modulus of two 64-bit integers
*/
inline const nsInt64
operator %(const nsInt64& aObject1, const nsInt64& aObject2) {
return nsInt64(aObject1) %= aObject2;
}
/**
* Determine if two 64-bit integers are equal
*/
inline PRBool
operator ==(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_EQ(aObject1.mValue, aObject2.mValue);
}
/**
* Determine if two 64-bit integers are not equal
*/
inline PRBool
operator !=(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_NE(aObject1.mValue, aObject2.mValue);
}
/**
* Determine if one 64-bit integer is strictly greater than another, using signed values
*/
inline PRBool
operator >(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_CMP(aObject1.mValue, >, aObject2.mValue);
}
/**
* Determine if one 64-bit integer is greater than or equal to another, using signed values
*/
inline PRBool
operator >=(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_CMP(aObject1.mValue, >=, aObject2.mValue);
}
/**
* Determine if one 64-bit integer is strictly less than another, using signed values
*/
inline PRBool
operator <(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_CMP(aObject1.mValue, <, aObject2.mValue);
}
/**
* Determine if one 64-bit integers is less than or equal to another, using signed values
*/
inline PRBool
operator <=(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_CMP(aObject1.mValue, <=, aObject2.mValue);
}
/**
* Perform a bitwise AND of two 64-bit integers
*/
inline const nsInt64
operator &(const nsInt64& aObject1, const nsInt64& aObject2) {
return nsInt64(aObject1) &= aObject2;
}
/**
* Perform a bitwise OR of two 64-bit integers
*/
inline const nsInt64
operator |(const nsInt64& aObject1, const nsInt64& aObject2) {
return nsInt64(aObject1) |= aObject2;
}
/**
* Perform a bitwise XOR of two 64-bit integers
*/
inline const nsInt64
operator ^(const nsInt64& aObject1, const nsInt64& aObject2) {
return nsInt64(aObject1) ^= aObject2;
}
#endif // nsInt64_h__

View File

@@ -1,92 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define NS_IMPL_IDS
#include "pratom.h"
#include "nsIFactory.h"
#include "nsIServiceManager.h"
#include "nsRepository.h"
#include "nsIObserver.h"
#include "nsObserver.h"
#include "nsString.h"
static NS_DEFINE_CID(kObserverCID, NS_OBSERVER_CID);
////////////////////////////////////////////////////////////////////////////////
// nsObserver Implementation
NS_IMPL_AGGREGATED(nsObserver)
NS_COM nsresult NS_NewObserver(nsIObserver** anObserver, nsISupports* outer)
{
return nsObserver::Create(outer, NS_GET_IID(nsIObserver), (void**)anObserver);
}
NS_METHOD
nsObserver::Create(nsISupports* outer, const nsIID& aIID, void* *anObserver)
{
NS_ENSURE_ARG_POINTER(anObserver);
NS_ENSURE_PROPER_AGGREGATION(outer, aIID);
nsObserver* it = new nsObserver(outer);
if (it == NULL)
return NS_ERROR_OUT_OF_MEMORY;
nsresult rv = it->AggregatedQueryInterface(aIID, anObserver);
if (NS_FAILED(rv)) {
delete it;
return rv;
}
return rv;
}
nsObserver::nsObserver(nsISupports* outer)
{
NS_INIT_AGGREGATED(outer);
}
nsObserver::~nsObserver(void)
{
}
NS_IMETHODIMP
nsObserver::AggregatedQueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_ENSURE_ARG_POINTER(aInstancePtr);
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID()))
*aInstancePtr = GetInner();
else if(aIID.Equals(nsIObserver::GetIID()))
*aInstancePtr = NS_STATIC_CAST(nsIObserver*, this);
else {
*aInstancePtr = nsnull;
return NS_NOINTERFACE;
}
NS_ADDREF((nsISupports*)*aInstancePtr);
return NS_OK;
}
NS_IMETHODIMP
nsObserver::Observe( nsISupports *, const PRUnichar *, const PRUnichar * ) {
nsresult rv = NS_OK;
return rv;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,50 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsObserver_h___
#define nsObserver_h___
#include "nsIObserver.h"
#include "nsAgg.h"
// {DB242E03-E4D9-11d2-9DDE-000064657374}
#define NS_OBSERVER_CID \
{ 0xdb242e03, 0xe4d9, 0x11d2, { 0x9d, 0xde, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
class nsObserver : public nsIObserver {
public:
NS_DEFINE_STATIC_CID_ACCESSOR( NS_OBSERVER_CID )
NS_DECL_NSIOBSERVER
nsObserver(nsISupports* outer);
virtual ~nsObserver(void);
static NS_METHOD
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
NS_DECL_AGGREGATED
private:
};
extern NS_COM nsresult NS_NewObserver(nsIObserver** anObserver, nsISupports* outer = NULL);
#endif /* nsObserver_h___ */

View File

@@ -1,133 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define NS_IMPL_IDS
#include "pratom.h"
#include "nsIObserverList.h"
#include "nsObserverList.h"
#include "nsString.h"
#include "nsAutoLock.h"
#define NS_AUTOLOCK(__monitor) nsAutoLock __lock(__monitor)
static NS_DEFINE_CID(kObserverListCID, NS_OBSERVERLIST_CID);
////////////////////////////////////////////////////////////////////////////////
// nsObserverList Implementation
NS_IMPL_ISUPPORTS1(nsObserverList, nsIObserverList)
NS_COM nsresult NS_NewObserverList(nsIObserverList** anObserverList)
{
if (anObserverList == NULL)
{
return NS_ERROR_NULL_POINTER;
}
nsObserverList* it = new nsObserverList();
if (it == 0) {
return NS_ERROR_OUT_OF_MEMORY;
}
return it->QueryInterface(NS_GET_IID(nsIObserverList), (void **) anObserverList);
}
nsObserverList::nsObserverList()
: mLock(nsnull),
mObserverList(NULL)
{
NS_INIT_REFCNT();
mLock = PR_NewLock();
}
nsObserverList::~nsObserverList(void)
{
PR_DestroyLock(mLock);
NS_IF_RELEASE(mObserverList);
}
nsresult nsObserverList::AddObserver(nsIObserver** anObserver)
{
nsresult rv;
PRBool inserted;
NS_AUTOLOCK(mLock);
if (anObserver == NULL)
{
return NS_ERROR_NULL_POINTER;
}
if(!mObserverList) {
rv = NS_NewISupportsArray(&mObserverList);
if (NS_FAILED(rv)) return rv;
}
if(*anObserver) {
inserted = mObserverList->AppendElement(*anObserver);
return inserted ? NS_OK : NS_ERROR_FAILURE;
}
return NS_ERROR_FAILURE;
}
nsresult nsObserverList::RemoveObserver(nsIObserver** anObserver)
{
PRBool removed;
NS_AUTOLOCK(mLock);
if (anObserver == NULL)
{
return NS_ERROR_NULL_POINTER;
}
if(!mObserverList) {
return NS_ERROR_FAILURE;
}
if(*anObserver) {
removed = mObserverList->RemoveElement(*anObserver);
return removed ? NS_OK : NS_ERROR_FAILURE;
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsObserverList::EnumerateObserverList(nsIEnumerator** anEnumerator)
{
NS_AUTOLOCK(mLock);
if (anEnumerator == NULL)
{
return NS_ERROR_NULL_POINTER;
}
if(!mObserverList) {
return NS_ERROR_FAILURE;
}
return mObserverList->Enumerate(anEnumerator);
}

View File

@@ -1,51 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsObserverList_h___
#define nsObserverList_h___
#include "nsIObserverList.h"
#include "nsIEnumerator.h"
#include "nsISupportsArray.h"
class nsObserverList : public nsIObserverList {
public:
NS_IMETHOD AddObserver(nsIObserver** anObserver);
NS_IMETHOD RemoveObserver(nsIObserver** anObserver);
NS_IMETHOD EnumerateObserverList(nsIEnumerator** anEnumerator);
nsObserverList();
virtual ~nsObserverList(void);
// This is ObserverList monitor object.
PRLock* mLock;
NS_DECL_ISUPPORTS
private:
nsISupportsArray *mObserverList;
};
#endif /* nsObserverList_h___ */

View File

@@ -1,249 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define NS_IMPL_IDS
#include "prlock.h"
#include "nsIFactory.h"
#include "nsIServiceManager.h"
#include "nsRepository.h"
#include "nsIObserverService.h"
#include "nsObserverService.h"
#include "nsIObserverList.h"
#include "nsObserverList.h"
#include "nsHashtable.h"
#include "nsString.h"
static NS_DEFINE_CID(kObserverServiceCID, NS_OBSERVERSERVICE_CID);
////////////////////////////////////////////////////////////////////////////////
static nsObserverService* gObserverService = nsnull; // The one-and-only ObserverService
////////////////////////////////////////////////////////////////////////////////
// nsObserverService Implementation
NS_IMPL_ISUPPORTS1(nsObserverService, nsIObserverService)
NS_COM nsresult NS_NewObserverService(nsIObserverService** anObserverService)
{
return nsObserverService::GetObserverService(anObserverService);
}
nsObserverService::nsObserverService()
: mObserverTopicTable(NULL)
{
NS_INIT_REFCNT();
mObserverTopicTable = nsnull;
}
nsObserverService::~nsObserverService(void)
{
if(mObserverTopicTable)
delete mObserverTopicTable;
gObserverService = nsnull;
}
NS_METHOD
nsObserverService::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr)
{
nsresult rv;
nsObserverService* os = new nsObserverService();
if (os == NULL)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(os);
rv = os->QueryInterface(aIID, aInstancePtr);
NS_RELEASE(os);
return rv;
}
nsresult nsObserverService::GetObserverService(nsIObserverService** anObserverService)
{
if (! gObserverService) {
nsObserverService* it = new nsObserverService();
if (! it)
return NS_ERROR_OUT_OF_MEMORY;
gObserverService = it;
}
NS_ADDREF(gObserverService);
*anObserverService = gObserverService;
return NS_OK;
}
static PRBool
ReleaseObserverList(nsHashKey *aKey, void *aData, void* closure)
{
nsIObserverList* observerList = NS_STATIC_CAST(nsIObserverList*, aData);
NS_RELEASE(observerList);
return PR_TRUE;
}
nsresult nsObserverService::GetObserverList(const nsString& aTopic, nsIObserverList** anObserverList)
{
if (anObserverList == NULL)
{
return NS_ERROR_NULL_POINTER;
}
if(mObserverTopicTable == NULL) {
mObserverTopicTable = new nsObjectHashtable(nsnull, nsnull, // should never be cloned
ReleaseObserverList, nsnull,
256, PR_TRUE);
if (mObserverTopicTable == NULL)
return NS_ERROR_OUT_OF_MEMORY;
}
nsStringKey key(aTopic);
nsIObserverList *topicObservers = nsnull;
if (mObserverTopicTable->Exists(&key)) {
topicObservers = (nsIObserverList *) mObserverTopicTable->Get(&key);
if (topicObservers != NULL) {
*anObserverList = topicObservers;
} else {
NS_NewObserverList(&topicObservers);
mObserverTopicTable->Put(&key, topicObservers);
}
} else {
NS_NewObserverList(&topicObservers);
*anObserverList = topicObservers;
mObserverTopicTable->Put(&key, topicObservers);
}
return NS_OK;
}
nsresult nsObserverService::AddObserver(nsIObserver* anObserver, const PRUnichar* aTopic)
{
nsIObserverList* anObserverList;
nsresult rv;
if (anObserver == NULL)
{
return NS_ERROR_NULL_POINTER;
}
if (aTopic == NULL)
{
return NS_ERROR_NULL_POINTER;
}
nsAutoString topic(aTopic);
rv = GetObserverList(topic, &anObserverList);
if (NS_FAILED(rv)) return rv;
if (anObserverList) {
return anObserverList->AddObserver(&anObserver);
}
return NS_ERROR_FAILURE;
}
nsresult nsObserverService::RemoveObserver(nsIObserver* anObserver, const PRUnichar* aTopic)
{
nsIObserverList* anObserverList;
nsresult rv;
if (anObserver == NULL)
{
return NS_ERROR_NULL_POINTER;
}
if (aTopic == NULL)
{
return NS_ERROR_NULL_POINTER;
}
nsAutoString topic(aTopic);
rv = GetObserverList(topic, &anObserverList);
if (NS_FAILED(rv)) return rv;
if (anObserverList) {
return anObserverList->RemoveObserver(&anObserver);
}
return NS_ERROR_FAILURE;
}
nsresult nsObserverService::EnumerateObserverList(const PRUnichar* aTopic, nsIEnumerator** anEnumerator)
{
nsIObserverList* anObserverList;
nsresult rv;
if (anEnumerator == NULL)
{
return NS_ERROR_NULL_POINTER;
}
if (aTopic == NULL)
{
return NS_ERROR_NULL_POINTER;
}
nsAutoString topic(aTopic);
rv = GetObserverList(topic, &anObserverList);
if (NS_FAILED(rv)) return rv;
if (anObserverList) {
return anObserverList->EnumerateObserverList(anEnumerator);
}
return NS_ERROR_FAILURE;
}
// Enumerate observers of aTopic and call Observe on each.
nsresult nsObserverService::Notify( nsISupports *aSubject,
const PRUnichar *aTopic,
const PRUnichar *someData ) {
nsresult rv = NS_OK;
nsIEnumerator *observers;
// Get observer list enumerator.
rv = this->EnumerateObserverList( aTopic, &observers );
if ( NS_SUCCEEDED( rv ) ) {
// Go to start of observer list.
rv = observers->First();
// Continue until error or end of list.
while ( observers->IsDone() != NS_OK && NS_SUCCEEDED(rv) ) {
// Get current item (observer).
nsISupports *base;
rv = observers->CurrentItem( &base );
if ( NS_SUCCEEDED( rv ) ) {
// Convert item to nsIObserver.
nsIObserver *observer;
rv = base->QueryInterface( nsIObserver::GetIID(), (void**)&observer );
if ( NS_SUCCEEDED( rv ) && observer ) {
// Tell the observer what's up.
observer->Observe( aSubject, aTopic, someData );
// Release the observer.
observer->Release();
}
}
// Go on to next observer in list.
rv = observers->Next();
}
// Release the observer list.
observers->Release();
rv = NS_OK;
}
return rv;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,56 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsObserverService_h___
#define nsObserverService_h___
#include "nsIObserverService.h"
#include "nsIObserverList.h"
class nsObjectHashtable;
class nsString;
// {D07F5195-E3D1-11d2-8ACD-00105A1B8860}
#define NS_OBSERVERSERVICE_CID \
{ 0xd07f5195, 0xe3d1, 0x11d2, { 0x8a, 0xcd, 0x0, 0x10, 0x5a, 0x1b, 0x88, 0x60 } }
class nsObserverService : public nsIObserverService {
public:
NS_DEFINE_STATIC_CID_ACCESSOR( NS_OBSERVERSERVICE_CID )
static nsresult GetObserverService(nsIObserverService** anObserverService);
NS_DECL_NSIOBSERVERSERVICE
nsObserverService();
virtual ~nsObserverService(void);
NS_DECL_ISUPPORTS
static NS_METHOD
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
private:
NS_IMETHOD GetObserverList(const nsString& aTopic, nsIObserverList** anObserverList);
nsObjectHashtable* mObserverTopicTable;
};
#endif /* nsObserverService_h___ */

View File

@@ -1,914 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsPageMgr.h"
#include "prmem.h"
#if defined(XP_PC)
#include <windows.h>
#elif defined(XP_MAC)
#include <stdlib.h>
#elif defined(XP_BEOS)
#include <fcntl.h>
#elif defined(XP_UNIX)
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <malloc.h>
#ifndef MAP_FAILED
#if defined (__STDC__) && __STDC__
#define MAP_FAILED ((void *) -1)
#else
#define MAP_FAILED ((char *) -1)
#endif
#endif
#if defined(VMS)
#if defined(DEBUG)
#include <stdio.h>
#endif
#include <starlet.h>
#include <ssdef.h>
#include <vadef.h>
#include <va_rangedef.h>
#endif
#endif
/******************************************************************************/
#define NS_PAGEMGR_CLUSTERDESC_CLUMPSIZE 16
void
nsPageMgr::DeleteFreeClusterDesc(nsClusterDesc *desc)
{
desc->mNext = mUnusedClusterDescs;
mUnusedClusterDescs = desc;
}
nsPageMgr::nsClusterDesc*
nsPageMgr::NewFreeClusterDesc(void)
{
nsClusterDesc *desc = mUnusedClusterDescs;
if (desc)
mUnusedClusterDescs = desc->mNext;
else {
/* Allocate a clump of cluster records at once, and link all except
the first onto the list of mUnusedClusterDescs */
desc = (nsClusterDesc*)PR_Malloc(NS_PAGEMGR_CLUSTERDESC_CLUMPSIZE * sizeof(nsClusterDesc));
if (desc) {
nsClusterDesc* desc2 = desc + (NS_PAGEMGR_CLUSTERDESC_CLUMPSIZE - 1);
while (desc2 != desc) {
DeleteFreeClusterDesc(desc2--);
}
}
}
return desc;
}
/* Search the mFreeClusters looking for the first cluster of consecutive free
pages that is at least size bytes long. If there is one, remove these pages
from the free page list and return their address; if not, return nil. */
nsPage*
nsPageMgr::AllocClusterFromFreeList(PRUword nPages)
{
nsClusterDesc **p = &mFreeClusters;
nsClusterDesc *desc;
while ((desc = *p) != NULL) {
if (desc->mPageCount >= nPages) {
nsPage* addr = desc->mAddr;
if (desc->mPageCount == nPages) {
*p = desc->mNext;
DeleteFreeClusterDesc(desc);
}
else {
desc->mAddr += nPages;
desc->mPageCount -= nPages;
}
return addr;
}
p = &desc->mNext;
}
return NULL;
}
/* Add the segment to the nsClusterDesc list, coalescing it with any
clusters already in the list when possible. */
void
nsPageMgr::AddClusterToFreeList(nsPage* addr, PRWord nPages)
{
nsClusterDesc **p = &mFreeClusters;
nsClusterDesc *desc;
nsClusterDesc *newDesc;
while ((desc = *p) != NULL) {
if (desc->mAddr + desc->mPageCount == addr) {
/* Coalesce with the previous cluster. */
nsClusterDesc *next = desc->mNext;
desc->mPageCount += nPages;
if (next && next->mAddr == addr + nPages) {
/* We can coalesce with both the previous and the next cluster. */
desc->mPageCount += next->mPageCount;
desc->mNext = next->mNext;
DeleteFreeClusterDesc(next);
}
return;
}
if (desc->mAddr == addr + nPages) {
/* Coalesce with the next cluster. */
desc->mAddr -= nPages;
desc->mPageCount += nPages;
return;
}
if (desc->mAddr > addr) {
PR_ASSERT(desc->mAddr > addr + nPages);
break;
}
PR_ASSERT(desc->mAddr + desc->mPageCount < addr);
p = &desc->mNext;
}
newDesc = NewFreeClusterDesc();
/* In the unlikely event that this malloc fails, we drop the free cluster
on the floor. The only consequence is that the memory mapping table
becomes slightly larger. */
if (newDesc) {
newDesc->mNext = desc;
newDesc->mAddr = addr;
newDesc->mPageCount = nPages;
*p = newDesc;
}
}
#ifdef NS_PAGEMGR_VERIFYCLUSTERS
#ifndef XP_PC
#define OutputDebugString(x) puts(x)
#endif
void
nsPageMgr::VerifyClusters(PRWord nPagesDelta)
{
static PRUword expectedPagesUsed = 0;
nsPageCount calculatedPagesUsed;
nsPage* lastDescEnd = 0;
nsClusterDesc* desc;
char str[256];
expectedPagesUsed += nPagesDelta;
calculatedPagesUsed = mBoundary - mMemoryBase;
sprintf(str, "[Clusters: %p", mMemoryBase);
OutputDebugString(str);
for (desc = mFreeClusters; desc; desc = desc->mNext) {
PR_ASSERT(desc->mAddr > lastDescEnd);
calculatedPagesUsed -= desc->mPageCount;
lastDescEnd = desc->mAddr + desc->mPageCount;
sprintf(str, "..%p, %p", desc->mAddr-1, desc->mAddr + desc->mPageCount);
OutputDebugString(str);
}
sprintf(str, "..%p]\n", mBoundary);
OutputDebugString(str);
PR_ASSERT(lastDescEnd < mBoundary);
PR_ASSERT(calculatedPagesUsed == expectedPagesUsed);
}
#endif /* NS_PAGEMGR_VERIFYCLUSTERS */
/*******************************************************************************
* Machine-dependent stuff
******************************************************************************/
#if defined(XP_PC)
#define GC_VMBASE 0x40000000 /* XXX move */
#define GC_VMLIMIT 0x0FFFFFFF
#elif defined(XP_MAC)
#define NS_PAGEMGR_MAC_SEGMENT_SIZE
#define NS_PAGEMGR_MAC_SEGMENT_COUNT
#endif
PRStatus
nsPageMgr::InitPages(nsPageCount minPages, nsPageCount maxPages)
{
#if defined(XP_PC)
nsPage* addr = NULL;
nsPageCount size = maxPages;
#ifdef NS_PAGEMGR_DEBUG
/* first try to place the heap at a well-known address for debugging */
addr = (nsPage*)VirtualAlloc((void*)GC_VMBASE, size << NS_PAGEMGR_PAGE_BITS,
MEM_RESERVE, PAGE_READWRITE);
#endif
while (addr == NULL) {
/* let the system place the heap */
addr = (nsPage*)VirtualAlloc(0, size << NS_PAGEMGR_PAGE_BITS,
MEM_RESERVE, PAGE_READWRITE);
if (addr == NULL) {
size--;
if (size < minPages) {
return PR_FAILURE;
}
}
}
PR_ASSERT(NS_PAGEMGR_IS_ALIGNED(addr, NS_PAGEMGR_PAGE_BITS));
mMemoryBase = addr;
mPageCount = size;
mBoundary = addr;
return PR_SUCCESS;
#elif defined(XP_MAC)
OSErr err;
void* seg;
void* segLimit;
Handle h;
PRUword segSize = (minPages + 1) * NS_PAGEMGR_PAGE_SIZE;
nsPage* firstPage;
nsPage* lastPage;
nsSegmentDesc* mSegTable;
int mSegTableCount, otherCount;
h = TempNewHandle(segSize, &err);
if (err || h == NULL) goto fail;
MoveHHi(h);
TempHLock(h, &err);
if (err) goto fail;
seg = *h;
segLimit = (void*)((char*)seg + segSize);
firstPage = NS_PAGEMGR_PAGE_ROUNDUP(seg);
lastPage = NS_PAGEMGR_PAGE_ROUNDDN(((char*)seg + segSize));
/* Put the segment table in the otherwise wasted space at one
end of the segment. We'll put it at which ever end is bigger. */
mSegTable = (nsSegmentDesc*)seg;
mSegTableCount = ((char*)firstPage - (char*)seg) / sizeof(nsSegmentDesc);
otherCount = ((char*)segLimit - (char*)lastPage) / sizeof(nsSegmentDesc);
if (otherCount > mSegTableCount) {
mSegTable = (nsSegmentDesc*)lastPage;
mSegTableCount = otherCount;
}
else if (mSegTableCount == 0) {
mSegTable = (nsSegmentDesc*)firstPage;
firstPage++;
mSegTableCount = NS_PAGEMGR_PAGE_SIZE / sizeof(nsSegmentDesc);
}
PR_ASSERT(mSegTableCount > 0);
mSegTable = mSegTable;
mSegTableCount = mSegTableCount;
mSegTable[0].mHandle = h;
mSegTable[0].mFirstPage = firstPage;
mSegTable[0].mLastPage = lastPage;
/* XXX hack for now -- just one segment */
mMemoryBase = firstPage;
mBoundary = firstPage;
mPageCount = lastPage - firstPage;
return PR_SUCCESS;
fail:
if (h) {
TempDisposeHandle(h, &err);
}
return PR_FAILURE;
#elif defined(XP_BEOS)
nsPage* addr = NULL;
nsPageCount size = maxPages;
#if (1L<<NS_PAGEMGR_PAGE_BITS) != B_PAGE_SIZE
#error can only work with 4096 byte pages
#endif
while(addr == NULL)
{
/* let the system place the heap */
if((mAid = create_area("MozillaHeap", (void **)&addr, B_ANY_ADDRESS,
size << NS_PAGEMGR_PAGE_BITS, B_NO_LOCK,
B_READ_AREA | B_WRITE_AREA)) < 0)
{
addr = NULL;
size--;
if (size < minPages) {
return PR_FAILURE;
}
}
}
PR_ASSERT(NS_PAGEMGR_IS_ALIGNED(addr, NS_PAGEMGR_PAGE_BITS));
mMemoryBase = addr;
mPageCount = size;
mBoundary = addr;
return PR_SUCCESS;
#elif defined(VMS)
nsPage* addr = NULL;
nsPageCount size = maxPages;
struct _va_range retadr, retadr2;
int status;
/*
** The default is 32767 pages. This is quite a lot (the pages are 4k).
** Let's at least make it configurable.
*/
char *tmp;
tmp = getenv("VMS_PAGE_MANAGER_SIZE");
if (tmp)
size=atoi(tmp);
#if defined(DEBUG)
printf("Requested page manager size is %d 4k pages\n",size);
#endif
/*
** $EXPREG will extend the virtual address region by the requested
** number of pages (or pagelets on Alpha). The process must have
** sufficient PGFLQUOTA for the operation, otherwise SS$_EXQUOTA will
** be returned. However, in the case of SS$_EXQUOTA, $EXPREG will have
** grown the region by the largest possible amount. In this case we will
** put back the maximum amount and repeat the $EXPREG requesting half of
** maximum (so as to leave some memory for others), just so long as its
** over our minimum threshold.
*/
status = sys$expreg(size << (NS_PAGEMGR_PAGE_BITS-VA$C_PAGELET_SHIFT_SIZE),
&retadr,0,0);
switch (status) {
case SS$_NORMAL:
break;
case SS$_EXQUOTA:
size = ( (int)retadr.va_range$ps_end_va -
(int)retadr.va_range$ps_start_va + 1
) >> NS_PAGEMGR_PAGE_BITS;
status=sys$deltva(&retadr,&retadr2,0);
size=size/2;
if (size < minPages) {
return PR_FAILURE;
}
status = sys$expreg(
size << (NS_PAGEMGR_PAGE_BITS-VA$C_PAGELET_SHIFT_SIZE),
&retadr,0,0);
if (status != SS$_NORMAL) {
status=sys$deltva(&retadr,&retadr2,0);
return PR_FAILURE;
}
size = ( (int)retadr.va_range$ps_end_va -
(int)retadr.va_range$ps_start_va + 1
) >> NS_PAGEMGR_PAGE_BITS;
break;
default:
return PR_FAILURE;
}
#if defined(DEBUG)
printf("Actual page manager size is %d 4k pages\n",size);
#endif
/* We got at least something */
addr = (nsPage *)retadr.va_range$ps_start_va;
PR_ASSERT(NS_PAGEMGR_IS_ALIGNED(addr, NS_PAGEMGR_PAGE_BITS));
mMemoryBase = addr;
mPageCount = size;
mBoundary = addr;
return PR_SUCCESS;
#else
nsPage* addr = NULL;
nsPageCount size = maxPages;
mZero_fd = 0;
#ifdef HAVE_DEV_ZERO
mZero_fd = open("/dev/zero", O_RDWR);
while (addr == NULL) {
/* let the system place the heap */
addr = (nsPage*)mmap(0, size << NS_PAGEMGR_PAGE_BITS,
PROT_READ | PROT_WRITE,
MAP_PRIVATE,
mZero_fd, 0);
if (addr == (nsPage*)MAP_FAILED) {
addr = NULL;
size--;
if (size < minPages) {
return PR_FAILURE;
}
}
}
#else
#ifdef HAVE_VALLOC
while (addr == NULL) {
addr = (nsPage*)valloc(size << NS_PAGEMGR_PAGE_BITS);
if (NULL == addr) {
size--;
if (size < minPages) {
return PR_FAILURE;
}
}
}
memset(addr, '\0', size << NS_PAGEMGR_PAGE_BITS);
#endif /* HAVE_VALLOC */
#endif /* HAVE_DEV_ZERO */
PR_ASSERT(NS_PAGEMGR_IS_ALIGNED(addr, NS_PAGEMGR_PAGE_BITS));
mMemoryBase = addr;
mPageCount = size;
mBoundary = addr;
return PR_SUCCESS;
#endif
}
void
nsPageMgr::FinalizePages()
{
#if defined(XP_PC)
BOOL ok;
ok = VirtualFree((void*)mMemoryBase, 0, MEM_RELEASE);
PR_ASSERT(ok);
mMemoryBase = NULL;
mPageCount = 0;
nsAutoMonitor::DestroyMonitor(mMonitor);
mMonitor = NULL;
#elif defined(XP_MAC)
OSErr err;
PRUword i;
for (i = 0; i < mSegTableCount; i++) {
if (mSegTable[i].mHandle) {
TempDisposeHandle(mSegTable[i].mHandle, &err);
PR_ASSERT(err == 0);
}
}
#elif defined(XP_BEOS)
delete_area(mAid);
#elif defined(VMS)
struct _va_range retadr, retadr2;
retadr.va_range$ps_start_va = mMemoryBase;
retadr.va_range$ps_end_va = mMemoryBase +
(mPageCount << NS_PAGEMGR_PAGE_BITS) - 1;
sys$deltva(&retadr,&retadr2,0);
#else
#ifdef HAVE_DEV_ZERO
munmap((caddr_t)mMemoryBase, mPageCount << NS_PAGEMGR_PAGE_BITS);
close(mZero_fd);
#else /* HAVE_DEV_ZERO */
#ifdef HAVE_VALLOC
free(mMemoryBase);
#endif /* HAVE_VALLOC */
#endif /* HAVE_DEV_ZERO */
#endif
}
/*******************************************************************************
* Page Manager
******************************************************************************/
nsPageMgr::nsPageMgr()
: mUnusedClusterDescs(nsnull),
mFreeClusters(nsnull),
mInUseClusters(nsnull),
mMonitor(nsnull),
mMemoryBase(nsnull),
mBoundary(nsnull),
#ifdef XP_PC
mLastPageFreed(nsnull),
mLastPageFreedSize(0),
mLastPageTemp(nsnull),
mLastPageTempSize(0),
#ifdef NS_PAGEMGR_DEBUG
mLastPageAllocTries(0),
mLastPageAllocHits(0),
mLastPageFreeTries(0),
mLastPageFreeHits(0),
#endif
#endif
#if defined(XP_MAC)
mSegMap(nsnull),
mSegTable(nsnull),
mSegTableCount(0),
#endif
#if defined(XP_BEOS)
mAid(B_ERROR),
#endif
mPageCount(0)
{
NS_INIT_REFCNT();
}
nsresult
nsPageMgr::Init(nsPageCount minPages, nsPageCount maxPages)
{
PRStatus status;
mMonitor = nsAutoMonitor::NewMonitor("PageMgr");
if (mMonitor == NULL)
return PR_FAILURE;
status = InitPages(minPages, maxPages);
if (status != PR_SUCCESS)
return status;
/* make sure these got set */
PR_ASSERT(mMemoryBase);
PR_ASSERT(mBoundary);
mFreeClusters = NULL;
mInUseClusters = NULL;
return status == PR_SUCCESS ? NS_OK : NS_ERROR_FAILURE;
}
nsPageMgr::~nsPageMgr()
{
#if defined(XP_PC) && defined(NS_PAGEMGR_DEBUG)
if (stderr) {
fprintf(stderr, "Page Manager Cache: alloc hits: %u/%u %u%%, free hits: %u/%u %u%%\n",
mLastPageAllocHits, mLastPageAllocTries,
(mLastPageAllocHits * 100 / mLastPageAllocTries),
mLastPageFreeHits, mLastPageFreeTries,
(mLastPageFreeHits * 100 / mLastPageFreeTries));
}
#endif
FinalizePages();
nsClusterDesc* chain = mUnusedClusterDescs;
while (chain) {
nsClusterDesc* desc = chain;
chain = chain->mNext;
PR_Free(desc);
}
}
NS_METHOD
nsPageMgr::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
nsPageMgr* pageMgr = new nsPageMgr();
if (pageMgr == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(pageMgr);
nsresult rv = pageMgr->Init();
if (NS_FAILED(rv)) {
NS_RELEASE(pageMgr);
return rv;
}
rv = pageMgr->QueryInterface(aIID, aResult);
NS_RELEASE(pageMgr);
return NS_OK;
}
NS_IMPL_ISUPPORTS2(nsPageMgr, nsIPageManager, nsIAllocator)
/******************************************************************************/
#ifdef XP_PC
#ifdef NS_PAGEMGR_PAGE_HYSTERESIS
#ifdef NS_PAGEMGR_DEBUG
void*
nsPageMgr::NS_PAGEMGR_COMMIT_CLUSTER(void* addr, PRUword size)
{
mLastPageAllocTries++;
if (mLastPageFreed == (void*)(addr) && mLastPageFreedSize == (size)) {
#ifdef NS_PAGEMGR_COMMIT_TRACE
char buf[64];
PR_snprintf(buf, sizeof(buf), "lalloc %p %u\n",
mLastPageFreed, mLastPageFreedSize);
OutputDebugString(buf);
#endif
DBG_MEMSET(mLastPageFreed, NS_PAGEMGR_PAGE_ALLOC_PATTERN, mLastPageFreedSize);
mLastPageTemp = mLastPageFreed;
mLastPageFreed = NULL;
mLastPageFreedSize = 0;
mLastPageAllocHits++;
return mLastPageTemp;
}
else {
/* If the cached pages intersect the current request, we lose.
Just free the cached request instead of trying to split it up. */
if (mLastPageFreed &&
nsOverlapping((char*)mLastPageFreed, ((char*)mLastPageFreed + mLastPageFreedSize),
(char*)(addr), ((char*)(addr) + (size)))
// ((char*)mLastPageFreed < ((char*)(addr) + (size))
// && ((char*)mLastPageFreed + mLastPageFreedSize) > (char*)(addr))
) {
#ifdef NS_PAGEMGR_COMMIT_TRACE
char buf[64];
PR_snprintf(buf, sizeof(buf), "valloc %p %u (vfree %p %u last=%u:%u req=%u:%u)\n",
addr, size,
mLastPageFreed, mLastPageFreedSize,
(char*)mLastPageFreed, ((char*)mLastPageFreed + mLastPageFreedSize),
(char*)(addr), ((char*)(addr) + (size)));
OutputDebugString(buf);
#endif
VirtualFree(mLastPageFreed, mLastPageFreedSize, MEM_DECOMMIT);
mLastPageFreed = NULL;
mLastPageFreedSize = 0;
mLastPageFreeHits--; /* lost after all */
}
else {
#ifdef NS_PAGEMGR_COMMIT_TRACE
char buf[64];
PR_snprintf(buf, sizeof(buf), "valloc %p %u (skipping %p %u)\n",
addr, size,
mLastPageFreed, mLastPageFreedSize);
OutputDebugString(buf);
#endif
}
return VirtualAlloc((void*)(addr), (size), MEM_COMMIT, PAGE_READWRITE);
}
}
int
nsPageMgr::NS_PAGEMGR_DECOMMIT_CLUSTER(void* addr, PRUword size)
{
mLastPageFreeTries++;
PR_ASSERT(mLastPageFreed != (void*)(addr));
if (mLastPageFreed) {
/* If we've already got a cached page, just keep it. Heuristically,
this tends to give us a higher hit rate because of the order in
which pages are decommitted. */
#ifdef NS_PAGEMGR_COMMIT_TRACE
char buf[64];
PR_snprintf(buf, sizeof(buf), "vfree %p %u (cached %p %u)\n",
addr, size, mLastPageFreed, mLastPageFreedSize);
OutputDebugString(buf);
#endif
return VirtualFree(addr, size, MEM_DECOMMIT);
}
mLastPageFreed = (void*)(addr);
mLastPageFreedSize = (size);
DBG_MEMSET(mLastPageFreed, NS_PAGEMGR_PAGE_FREE_PATTERN, mLastPageFreedSize);
#ifdef NS_PAGEMGR_COMMIT_TRACE
{
char buf[64];
PR_snprintf(buf, sizeof(buf), "lfree %p %u\n",
mLastPageFreed, mLastPageFreedSize);
OutputDebugString(buf);
}
#endif
mLastPageFreeHits++;
return 1;
}
#else /* !NS_PAGEMGR_DEBUG */
#define NS_PAGEMGR_COMMIT_CLUSTER(addr, size) \
(PR_ASSERT((void*)(addr) != NULL), \
((mLastPageFreed == (void*)(addr) && mLastPageFreedSize == (size)) \
? (DBG_MEMSET(mLastPageFreed, NS_PAGEMGR_PAGE_ALLOC_PATTERN, mLastPageFreedSize), \
mLastPageTemp = mLastPageFreed, \
mLastPageFreed = NULL, \
mLastPageFreedSize = 0, \
mLastPageTemp) \
: (((mLastPageFreed && \
((char*)mLastPageFreed < ((char*)(addr) + (size)) \
&& ((char*)mLastPageFreed + mLastPageFreedSize) > (char*)(addr))) \
? (VirtualFree(mLastPageFreed, mLastPageFreedSize, MEM_DECOMMIT), \
mLastPageFreed = NULL, \
mLastPageFreedSize = 0) \
: ((void)0)), \
VirtualAlloc((void*)(addr), (size), MEM_COMMIT, PAGE_READWRITE)))) \
#define NS_PAGEMGR_DECOMMIT_CLUSTER(addr, size) \
(PR_ASSERT(mLastPageFreed != (void*)(addr)), \
(mLastPageFreed \
? (VirtualFree(addr, size, MEM_DECOMMIT)) \
: (mLastPageFreed = (addr), \
mLastPageFreedSize = (size), \
DBG_MEMSET(mLastPageFreed, NS_PAGEMGR_PAGE_FREE_PATTERN, mLastPageFreedSize), \
1))) \
#endif /* !NS_PAGEMGR_DEBUG */
#else /* !NS_PAGEMGR_PAGE_HYSTERESIS */
#define NS_PAGEMGR_COMMIT_CLUSTER(addr, size) \
VirtualAlloc((void*)(addr), (size), MEM_COMMIT, PAGE_READWRITE)
#define NS_PAGEMGR_DECOMMIT_CLUSTER(addr, size) \
VirtualFree((void*)(addr), (size), MEM_DECOMMIT)
#endif /* !NS_PAGEMGR_PAGE_HYSTERESIS */
#else /* !XP_PC */
#define NS_PAGEMGR_COMMIT_CLUSTER(addr, size) (addr)
#define NS_PAGEMGR_DECOMMIT_CLUSTER(addr, size) 1
#endif /* !XP_PC */
nsPage*
nsPageMgr::NewCluster(nsPageCount nPages)
{
nsAutoMonitor mon(mMonitor);
nsPage* addr;
PR_ASSERT(nPages > 0);
addr = AllocClusterFromFreeList(nPages);
if (!addr && mBoundary + nPages <= mMemoryBase + mPageCount) {
addr = mBoundary;
mBoundary += nPages;
}
if (addr) {
/* Extend the mapping */
nsPage* vaddr;
PRUword size = nPages << NS_PAGEMGR_PAGE_BITS;
PR_ASSERT(NS_PAGEMGR_IS_ALIGNED(addr, NS_PAGEMGR_PAGE_BITS));
vaddr = (nsPage*)NS_PAGEMGR_COMMIT_CLUSTER((void*)addr, size);
#ifdef NS_PAGEMGR_VERIFYCLUSTERS
VerifyClusters(nPages);
#endif
if (addr) {
PR_ASSERT(vaddr == addr);
}
else {
DestroyCluster(addr, nPages);
}
DBG_MEMSET(addr, NS_PAGEMGR_PAGE_ALLOC_PATTERN, size);
}
return (nsPage*)addr;
}
void
nsPageMgr::DestroyCluster(nsPage* basePage, nsPageCount nPages)
{
nsAutoMonitor mon(mMonitor);
int freeResult;
PRUword size = nPages << NS_PAGEMGR_PAGE_BITS;
PR_ASSERT(nPages > 0);
PR_ASSERT(NS_PAGEMGR_IS_ALIGNED(basePage, NS_PAGEMGR_PAGE_BITS));
PR_ASSERT(mMemoryBase <= basePage);
PR_ASSERT(basePage + nPages <= mMemoryBase + mPageCount);
DBG_MEMSET(basePage, NS_PAGEMGR_PAGE_FREE_PATTERN, size);
freeResult = NS_PAGEMGR_DECOMMIT_CLUSTER((void*)basePage, size);
PR_ASSERT(freeResult);
if (basePage + nPages == mBoundary) {
nsClusterDesc **p;
nsClusterDesc *desc;
/* We deallocated the last set of clusters. Move the mBoundary lower. */
mBoundary = basePage;
/* The last free cluster might now be adjacent to the mBoundary; if so,
move the mBoundary before that cluster and delete that cluster
altogether. */
p = &mFreeClusters;
while ((desc = *p) != NULL) {
if (!desc->mNext && desc->mAddr + desc->mPageCount == mBoundary) {
*p = 0;
mBoundary = desc->mAddr;
DeleteFreeClusterDesc(desc);
}
else {
p = &desc->mNext;
}
}
}
else {
AddClusterToFreeList(basePage, nPages);
}
#ifdef NS_PAGEMGR_VERIFYCLUSTERS
VerifyClusters(-(PRWord)nPages);
#endif
}
////////////////////////////////////////////////////////////////////////////////
// nsIPageManager methods:
NS_IMETHODIMP
nsPageMgr::AllocPages(PRUint32 pageCount, void* *result)
{
nsPage* page = NewCluster(NS_STATIC_CAST(nsPageCount, pageCount));
if (page == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
*result = page;
return NS_OK;
}
NS_IMETHODIMP
nsPageMgr::DeallocPages(PRUint32 pageCount, void* pages)
{
DestroyCluster(NS_STATIC_CAST(nsPage*, pages),
NS_STATIC_CAST(nsPageCount, pageCount));
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIAllocator methods:
//
// Note: nsIAllocator needs to keep track of the size of the blocks it allocates
// whereas, nsIPageManager doesn't. That means that there's a little extra
// overhead for users of this interface. It also means that things allocated
// with the nsIPageManager interface can't be freed with the nsIAllocator
// interface and vice versa.
NS_IMETHODIMP_(void*)
nsPageMgr::Alloc(PRUint32 size)
{
nsAutoMonitor mon(mMonitor);
nsresult rv;
void* page = nsnull;
PRUint32 pageCount = NS_PAGEMGR_PAGE_COUNT(size);
rv = AllocPages(pageCount, &page);
if (NS_FAILED(rv))
return nsnull;
// Add this cluster to the mInUseClusters list:
nsClusterDesc* desc = NewFreeClusterDesc();
if (desc == nsnull) {
rv = DeallocPages(pageCount, page);
NS_ASSERTION(NS_SUCCEEDED(rv), "DeallocPages failed");
return nsnull;
}
desc->mAddr = (nsPage*)page;
desc->mPageCount = pageCount;
desc->mNext = mInUseClusters;
mInUseClusters = desc;
return page;
}
NS_IMETHODIMP_(void*)
nsPageMgr::Realloc(void* ptr, PRUint32 size)
{
// XXX This realloc implementation could be made smarter by trying to
// append to the current block, but I don't think we really care right now.
nsresult rv;
rv = Free(ptr);
if (NS_FAILED(rv)) return nsnull;
void* newPtr = Alloc(size);
return newPtr;
}
NS_IMETHODIMP
nsPageMgr::Free(void* ptr)
{
nsAutoMonitor mon(mMonitor);
PR_ASSERT(NS_PAGEMGR_IS_ALIGNED(ptr, NS_PAGEMGR_PAGE_BITS));
// Remove the cluster from the mInUseClusters list:
nsClusterDesc** list = &mInUseClusters;
nsClusterDesc* desc;
while ((desc = *list) != nsnull) {
if (desc->mAddr == ptr) {
// found -- unlink the desc and free it
*list = desc->mNext;
nsresult rv = DeallocPages(desc->mPageCount, ptr);
DeleteFreeClusterDesc(desc);
return rv;
}
list = &desc->mNext;
}
NS_ASSERTION(0, "memory not allocated with nsPageMgr::Alloc");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsPageMgr::HeapMinimize(void)
{
// can't compact this heap
return NS_ERROR_FAILURE;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,203 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsPageMgr_h__
#define nsPageMgr_h__
#include "nsIPageManager.h"
#include "nsIAllocator.h"
#include "nscore.h"
#include "nsAutoLock.h"
#include "prlog.h"
#ifdef XP_MAC
#include <Types.h>
#include <Memory.h>
#endif
#if defined(XP_BEOS)
#include <OS.h>
#endif
/*******************************************************************************
* Configuration/Debugging parameters:
******************************************************************************/
#ifdef NS_DEBUG
//#define NS_PAGEMGR_DEBUG
#endif
#define NS_PAGEMGR_PAGE_HYSTERESIS /* undef if you want to compare */
//#define NS_PAGEMGR_COMMIT_TRACE
#ifdef NS_PAGEMGR_DEBUG
#define NS_PAGEMGR_VERIFYCLUSTERS
#define NS_PAGEMGR_DBG_MEMSET
#endif
#define NS_PAGEMGR_MIN_PAGES 32 // XXX bogus -- this should be a runtime parameter
#define NS_PAGEMGR_MAX_PAGES 2560 // 10 meg XXX bogus -- this should be a runtime parameter
/******************************************************************************/
#ifdef NS_PAGEMGR_DBG_MEMSET
#include <string.h> /* for memset */
#include <stdio.h>
#define DBG_MEMSET(dest, pattern, size) memset(dest, pattern, size)
#define NS_PAGEMGR_PAGE_ALLOC_PATTERN 0xCB
#define NS_PAGEMGR_PAGE_FREE_PATTERN 0xCD
#else
#define DBG_MEMSET(dest, pattern, size) ((void)0)
#endif
#define NS_PAGEMGR_ALIGN(p, nBits) ((PRWord)(p) & ~((1 << nBits) - 1))
#define NS_PAGEMGR_IS_ALIGNED(p, nBits) ((PRWord)(p) == NS_PAGEMGR_ALIGN(p, nBits))
/*******************************************************************************
* Test for overlapping (one-dimensional) regions
******************************************************************************/
inline PRBool nsOverlapping(char* min1, char* max1, char* min2, char* max2)
{
PR_ASSERT(min1 < max1);
PR_ASSERT(min2 < max2);
return (min1 < max2 && max1 > min2);
}
/*******************************************************************************
* Types
******************************************************************************/
typedef PRUint8 nsPage[NS_PAGEMGR_PAGE_SIZE];
typedef PRUword nsPageCount; /* int big enough to count pages */
/*******************************************************************************
* Macros
******************************************************************************/
#define NS_PAGEMGR_PAGE_ROUNDDN(addr) ((nsPage*)NS_PAGEMGR_ALIGN((PRUword)(addr), NS_PAGEMGR_PAGE_BITS))
#define NS_PAGEMGR_PAGE_ROUNDUP(addr) NS_PAGEMGR_PAGE_ROUNDDN((PRUword)(addr) + NS_PAGEMGR_PAGE_SIZE)
/*******************************************************************************
* Page Manager
******************************************************************************/
class nsPageMgr : public nsIPageManager, public nsIAllocator {
public:
NS_DECL_ISUPPORTS
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
// nsIPageManager methods:
NS_IMETHOD AllocPages(PRUint32 pageCount, void* *result);
NS_IMETHOD DeallocPages(PRUint32 pageCount, void* pages);
// nsIAllocator methods:
NS_IMETHOD_(void*) Alloc(PRUint32 size);
NS_IMETHOD_(void*) Realloc(void* ptr, PRUint32 size);
NS_IMETHOD Free(void* ptr);
NS_IMETHOD HeapMinimize(void);
// nsPageMgr methods:
nsPageMgr();
virtual ~nsPageMgr();
nsresult Init(nsPageCount minPages = NS_PAGEMGR_MIN_PAGES,
nsPageCount maxPages = NS_PAGEMGR_MAX_PAGES);
struct nsClusterDesc {
nsClusterDesc* mNext; /* Link to next cluster of free pages */
nsPage* mAddr; /* First page in cluster of free pages */
nsPageCount mPageCount; /* Total size of cluster of free pages in bytes */
};
void DeleteFreeClusterDesc(nsClusterDesc *desc);
nsClusterDesc* NewFreeClusterDesc(void);
nsPage* AllocClusterFromFreeList(PRUword nPages);
void AddClusterToFreeList(nsPage* addr, PRWord nPages);
#ifdef NS_PAGEMGR_VERIFYCLUSTERS
void VerifyClusters(PRWord nPagesDelta);
#endif
#if defined(XP_PC) && defined(NS_PAGEMGR_DEBUG)
void* NS_PAGEMGR_COMMIT_CLUSTER(void* addr, PRUword size);
int NS_PAGEMGR_DECOMMIT_CLUSTER(void* addr, PRUword size);
#endif
// Managing Pages:
PRStatus InitPages(nsPageCount minPages, nsPageCount maxPages);
void FinalizePages();
nsPage* NewCluster(nsPageCount nPages);
void DestroyCluster(nsPage* basePage, nsPageCount nPages);
protected:
nsClusterDesc* mUnusedClusterDescs;
nsClusterDesc* mFreeClusters;
nsClusterDesc* mInUseClusters; // used by nsIAllocator methods
PRMonitor* mMonitor;
nsPage* mMemoryBase;
nsPage* mBoundary;
nsPageCount mPageCount;
#ifdef XP_PC
/* one-page hysteresis */
void* mLastPageFreed;
PRUword mLastPageFreedSize;
void* mLastPageTemp;
PRUword mLastPageTempSize;
# ifdef NS_PAGEMGR_DEBUG
PRUword mLastPageAllocTries;
PRUword mLastPageAllocHits;
PRUword mLastPageFreeTries;
PRUword mLastPageFreeHits;
# endif
#endif
#if defined(XP_MAC)
struct nsSegmentDesc {
Handle mHandle;
nsPage* mFirstPage;
nsPage* mLastPage;
};
PRUint8* mSegMap;
nsSegmentDesc* mSegTable;
PRWord mSegTableCount;
#endif
#if defined(XP_BEOS)
area_id mAid;
#endif
#if (! defined(VMS)) && (! defined(XP_BEOS)) && (! defined(XP_MAC)) && (! defined(XP_PC))
int mZero_fd;
#endif
};
/******************************************************************************/
#endif /* nsPageMgr_h__ */

View File

@@ -1,551 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#define NS_IMPL_IDS
#include "nsProperties.h"
#include <iostream.h>
////////////////////////////////////////////////////////////////////////////////
nsProperties::nsProperties(nsISupports* outer)
{
NS_INIT_AGGREGATED(outer);
}
NS_METHOD
nsProperties::Create(nsISupports *outer, REFNSIID aIID, void **aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_PROPER_AGGREGATION(outer, aIID);
nsProperties* props = new nsProperties(outer);
if (props == NULL)
return NS_ERROR_OUT_OF_MEMORY;
nsresult rv = props->AggregatedQueryInterface(aIID, aResult);
if (NS_FAILED(rv))
delete props;
return rv;
}
PRBool
nsProperties::ReleaseValues(nsHashKey* key, void* data, void* closure)
{
nsISupports* value = (nsISupports*)data;
NS_IF_RELEASE(value);
return PR_TRUE;
}
nsProperties::~nsProperties()
{
Enumerate(ReleaseValues);
}
NS_IMPL_AGGREGATED(nsProperties);
NS_METHOD
nsProperties::AggregatedQueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_ENSURE_ARG_POINTER(aInstancePtr);
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID()))
*aInstancePtr = GetInner();
else if (aIID.Equals(nsIProperties::GetIID()))
*aInstancePtr = NS_STATIC_CAST(nsIProperties*, this);
else {
*aInstancePtr = nsnull;
return NS_NOINTERFACE;
}
NS_ADDREF((nsISupports*)*aInstancePtr);
return NS_OK;
}
NS_IMETHODIMP
nsProperties::DefineProperty(const char* prop, nsISupports* initialValue)
{
nsStringKey key(prop);
if (Exists(&key))
return NS_ERROR_FAILURE;
nsISupports* prevValue = (nsISupports*)Put(&key, initialValue);
NS_ASSERTION(prevValue == NULL, "hashtable error");
NS_IF_ADDREF(initialValue);
return NS_OK;
}
NS_IMETHODIMP
nsProperties::UndefineProperty(const char* prop)
{
nsStringKey key(prop);
if (!Exists(&key))
return NS_ERROR_FAILURE;
nsISupports* prevValue = (nsISupports*)Remove(&key);
NS_IF_RELEASE(prevValue);
return NS_OK;
}
NS_IMETHODIMP
nsProperties::GetProperty(const char* prop, nsISupports* *result)
{
nsStringKey key(prop);
if (!Exists(&key))
return NS_ERROR_FAILURE;
nsISupports* value = (nsISupports*)Get(&key);
NS_IF_ADDREF(value);
*result = value;
return NS_OK;
}
NS_IMETHODIMP
nsProperties::SetProperty(const char* prop, nsISupports* value)
{
nsStringKey key(prop);
if (!Exists(&key))
return NS_ERROR_FAILURE;
nsISupports* prevValue = (nsISupports*)Put(&key, value);
NS_IF_RELEASE(prevValue);
NS_IF_ADDREF(value);
return NS_OK;
}
NS_IMETHODIMP
nsProperties::HasProperty(const char* prop, nsISupports* expectedValue)
{
nsISupports* value;
nsresult rv = GetProperty(prop, &value);
if (NS_FAILED(rv)) return NS_COMFALSE;
rv = (value == expectedValue) ? NS_OK : NS_COMFALSE;
NS_IF_RELEASE(value);
return rv;
}
////////////////////////////////////////////////////////////////////////////////
nsresult
NS_NewIProperties(nsIProperties* *result)
{
return nsProperties::Create(NULL, nsIProperties::GetIID(), (void**)result);
}
////////////////////////////////////////////////////////////////////////////////
// Persistent Properties (should go in a separate file)
////////////////////////////////////////////////////////////////////////////////
#include "nsID.h"
#include "nsCRT.h"
#include "nsIInputStream.h"
#include "nsIProperties.h"
#include "nsIUnicharInputStream.h"
#include "nsProperties.h"
#include "pratom.h"
static PLHashNumber
HashKey(const PRUnichar *aString)
{
return (PLHashNumber) nsCRT::HashValue(aString);
}
static PRIntn
CompareKeys(const PRUnichar *aStr1, const PRUnichar *aStr2)
{
return nsCRT::strcmp(aStr1, aStr2) == 0;
}
nsPersistentProperties::nsPersistentProperties()
{
NS_INIT_REFCNT();
mIn = nsnull;
mSubclass = NS_STATIC_CAST(nsIPersistentProperties*, this);
mTable = PL_NewHashTable(8, (PLHashFunction) HashKey,
(PLHashComparator) CompareKeys,
(PLHashComparator) nsnull, nsnull, nsnull);
}
PR_STATIC_CALLBACK(PRIntn)
FreeHashEntries(PLHashEntry* he, PRIntn i, void* arg)
{
nsCRT::free((PRUnichar*)he->key);
nsCRT::free((PRUnichar*)he->value);
return HT_ENUMERATE_REMOVE;
}
nsPersistentProperties::~nsPersistentProperties()
{
if (mTable) {
// Free the PRUnicode* pointers contained in the hash table entries
PL_HashTableEnumerateEntries(mTable, FreeHashEntries, 0);
PL_HashTableDestroy(mTable);
mTable = nsnull;
}
}
NS_METHOD
nsPersistentProperties::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
nsPersistentProperties* props = new nsPersistentProperties();
if (props == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(props);
nsresult rv = props->QueryInterface(aIID, aResult);
NS_RELEASE(props);
return rv;
}
NS_IMPL_ISUPPORTS2(nsPersistentProperties, nsIPersistentProperties, nsIProperties)
NS_IMETHODIMP
nsPersistentProperties::Load(nsIInputStream *aIn)
{
PRInt32 c;
nsresult ret;
nsAutoString uesc("x-u-escaped");
ret = NS_NewConverterStream(&mIn, nsnull, aIn, 0, &uesc);
if (ret != NS_OK) {
#ifdef NS_DEBUG
cout << "NS_NewConverterStream failed" << endl;
#endif
return NS_ERROR_FAILURE;
}
c = Read();
while (1) {
c = SkipWhiteSpace(c);
if (c < 0) {
break;
}
else if ((c == '#') || (c == '!')) {
c = SkipLine(c);
continue;
}
else {
nsAutoString key("");
while ((c >= 0) && (c != '=') && (c != ':')) {
key.Append((PRUnichar) c);
c = Read();
}
if (c < 0) {
break;
}
char *trimThese = " \t";
key.Trim(trimThese, PR_FALSE, PR_TRUE);
c = Read();
nsAutoString value("");
while ((c >= 0) && (c != '\r') && (c != '\n')) {
if (c == '\\') {
c = Read();
if ((c == '\r') || (c == '\n')) {
c = SkipWhiteSpace(c);
}
else {
value.Append('\\');
}
}
value.Append((PRUnichar) c);
c = Read();
}
value.Trim(trimThese, PR_TRUE, PR_TRUE);
nsAutoString oldValue("");
mSubclass->SetStringProperty(key, value, oldValue);
}
}
mIn->Close();
NS_RELEASE(mIn);
NS_ASSERTION(!mIn, "unexpected remaining reference");
return NS_OK;
}
NS_IMETHODIMP
nsPersistentProperties::SetStringProperty(const nsString& aKey, nsString& aNewValue,
nsString& aOldValue)
{
// XXX The ToNewCString() calls allocate memory using "new" so this code
// causes a memory leak...
#if 0
cout << "will add " << aKey.ToNewCString() << "=" << aNewValue.ToNewCString() << endl;
#endif
if (!mTable) {
return NS_ERROR_FAILURE;
}
const PRUnichar *key = aKey.GetUnicode(); // returns internal pointer (not a copy)
PRUint32 len;
PRUint32 hashValue = nsCRT::HashValue(key, &len);
PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key);
PLHashEntry *he = *hep;
if (he) {
// XXX should we copy the old value to aOldValue, and then remove it?
#ifdef NS_DEBUG
char buf[128];
aKey.ToCString(buf, sizeof(buf));
printf("warning: property %s already exists\n", buf);
#endif
return NS_OK;
}
PL_HashTableRawAdd(mTable, hep, hashValue, aKey.ToNewUnicode(),
aNewValue.ToNewUnicode());
return NS_OK;
}
NS_IMETHODIMP
nsPersistentProperties::Save(nsIOutputStream* aOut, const nsString& aHeader)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsPersistentProperties::Subclass(nsIPersistentProperties* aSubclass)
{
if (aSubclass) {
mSubclass = aSubclass;
}
return NS_OK;
}
NS_IMETHODIMP
nsPersistentProperties::GetStringProperty(const nsString& aKey, nsString& aValue)
{
if (!mTable)
return NS_ERROR_FAILURE;
const PRUnichar *key = aKey.GetUnicode();
if (!mTable) {
return NS_ERROR_FAILURE;
}
PRUint32 len;
PRUint32 hashValue = nsCRT::HashValue(key, &len);
PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key);
PLHashEntry *he = *hep;
if (he) {
aValue = (const PRUnichar*)he->value;
return NS_OK;
}
return NS_ERROR_FAILURE;
}
PR_STATIC_CALLBACK(PRIntn)
AddElemToArray(PLHashEntry* he, PRIntn i, void* arg)
{
nsISupportsArray *propArray = (nsISupportsArray *) arg;
nsString* keyStr = new nsString((PRUnichar*) he->key);
nsString* valueStr = new nsString((PRUnichar*) he->value);
nsPropertyElement *element = new nsPropertyElement();
if (!element)
return HT_ENUMERATE_STOP;
NS_ADDREF(element);
element->SetKey(keyStr);
element->SetValue(valueStr);
propArray->InsertElementAt(element, i);
return HT_ENUMERATE_NEXT;
}
NS_IMETHODIMP
nsPersistentProperties::EnumerateProperties(nsIBidirectionalEnumerator** aResult)
{
if (!mTable)
return NS_ERROR_FAILURE;
nsISupportsArray* propArray;
nsresult rv = NS_NewISupportsArray(&propArray);
if (rv != NS_OK)
return rv;
// Step through hash entries populating a transient array
PRIntn n = PL_HashTableEnumerateEntries(mTable, AddElemToArray, (void *)propArray);
if ( n < (PRIntn) mTable->nentries )
return NS_ERROR_OUT_OF_MEMORY;
// Convert array into enumerator
rv = NS_NewISupportsArrayEnumerator(propArray, aResult);
if (rv != NS_OK)
return rv;
return NS_OK;
}
PRInt32
nsPersistentProperties::Read()
{
PRUnichar c;
PRUint32 nRead;
nsresult ret;
ret = mIn->Read(&c, 0, 1, &nRead);
if (ret == NS_OK && nRead == 1) {
return c;
}
return -1;
}
#define IS_WHITE_SPACE(c) \
(((c) == ' ') || ((c) == '\t') || ((c) == '\r') || ((c) == '\n'))
PRInt32
nsPersistentProperties::SkipWhiteSpace(PRInt32 c)
{
while ((c >= 0) && IS_WHITE_SPACE(c)) {
c = Read();
}
return c;
}
PRInt32
nsPersistentProperties::SkipLine(PRInt32 c)
{
while ((c >= 0) && (c != '\r') && (c != '\n')) {
c = Read();
}
if (c == '\r') {
c = Read();
}
if (c == '\n') {
c = Read();
}
return c;
}
////////////////////////////////////////////////////////////////////////////////
NS_IMETHODIMP
nsPersistentProperties::DefineProperty(const char* prop, nsISupports* initialValue)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsPersistentProperties::UndefineProperty(const char* prop)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsPersistentProperties::GetProperty(const char* prop, nsISupports* *result)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsPersistentProperties::SetProperty(const char* prop, nsISupports* value)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsPersistentProperties::HasProperty(const char* prop, nsISupports* value)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
////////////////////////////////////////////////////////////////////////////////
// PropertyElement
////////////////////////////////////////////////////////////////////////////////
nsPropertyElement::nsPropertyElement()
{
NS_INIT_REFCNT();
mKey = nsnull;
mValue = nsnull;
}
nsPropertyElement::~nsPropertyElement()
{
if (mKey)
delete mKey;
if (mValue)
delete mValue;
}
NS_METHOD
nsPropertyElement::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
nsPropertyElement* propElem = new nsPropertyElement();
if (propElem == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(propElem);
nsresult rv = propElem->QueryInterface(aIID, aResult);
NS_RELEASE(propElem);
return rv;
}
NS_IMPL_ISUPPORTS1(nsPropertyElement, nsIPropertyElement)
NS_IMETHODIMP
nsPropertyElement::GetKey(nsString** aReturnKey)
{
if (aReturnKey)
{
*aReturnKey = mKey;
return NS_OK;
}
return NS_ERROR_INVALID_POINTER;
}
NS_IMETHODIMP
nsPropertyElement::GetValue(nsString** aReturnValue)
{
if (aReturnValue)
{
*aReturnValue = mValue;
return NS_OK;
}
return NS_ERROR_INVALID_POINTER;
}
NS_IMETHODIMP
nsPropertyElement::SetKey(nsString* aKey)
{
mKey = aKey;
return NS_OK;
}
NS_IMETHODIMP
nsPropertyElement::SetValue(nsString* aValue)
{
mValue = aValue;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,113 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsProperties_h___
#define nsProperties_h___
#include "nsIProperties.h"
#include "nsHashtable.h"
#include "nsAgg.h"
class nsIUnicharInputStream;
class nsProperties : public nsIProperties, public nsHashtable {
public:
NS_DECL_AGGREGATED
// nsIProperties methods:
NS_IMETHOD DefineProperty(const char* prop, nsISupports* initialValue);
NS_IMETHOD UndefineProperty(const char* prop);
NS_IMETHOD GetProperty(const char* prop, nsISupports* *result);
NS_IMETHOD SetProperty(const char* prop, nsISupports* value);
NS_IMETHOD HasProperty(const char* prop, nsISupports* value);
// nsProperties methods:
nsProperties(nsISupports* outer);
virtual ~nsProperties();
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
static PRBool ReleaseValues(nsHashKey* key, void* data, void* closure);
};
class nsPersistentProperties : public nsIPersistentProperties
{
public:
nsPersistentProperties();
virtual ~nsPersistentProperties();
NS_DECL_ISUPPORTS
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
// nsIProperties methods:
NS_IMETHOD DefineProperty(const char* prop, nsISupports* initialValue);
NS_IMETHOD UndefineProperty(const char* prop);
NS_IMETHOD GetProperty(const char* prop, nsISupports* *result);
NS_IMETHOD SetProperty(const char* prop, nsISupports* value);
NS_IMETHOD HasProperty(const char* prop, nsISupports* value);
// nsIPersistentProperties methods:
NS_IMETHOD Load(nsIInputStream* aIn);
NS_IMETHOD Save(nsIOutputStream* aOut, const nsString& aHeader);
NS_IMETHOD Subclass(nsIPersistentProperties* aSubclass);
NS_IMETHOD EnumerateProperties(nsIBidirectionalEnumerator* *aResult);
// XXX these 2 methods will be subsumed by the ones from
// nsIProperties once we figure this all out
NS_IMETHOD GetStringProperty(const nsString& aKey, nsString& aValue);
NS_IMETHOD SetStringProperty(const nsString& aKey, nsString& aNewValue,
nsString& aOldValue);
// nsPersistentProperties methods:
PRInt32 Read();
PRInt32 SkipLine(PRInt32 c);
PRInt32 SkipWhiteSpace(PRInt32 c);
nsIUnicharInputStream* mIn;
nsIPersistentProperties* mSubclass;
struct PLHashTable* mTable;
};
class nsPropertyElement : public nsIPropertyElement
{
public:
nsPropertyElement();
virtual ~nsPropertyElement();
NS_DECL_ISUPPORTS
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
// nsIPropertyElement methods:
NS_IMETHOD GetKey(nsString** aReturnKey);
NS_IMETHOD GetValue(nsString** aReturnValue);
NS_IMETHOD SetKey(nsString* aKey);
NS_IMETHOD SetValue(nsString* aValue);
protected:
nsString* mKey;
nsString* mValue;
};
#endif /* nsProperties_h___ */

View File

@@ -1,186 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* We need this because Solaris' version of qsort is broken and
* causes array bounds reads.
*/
#include <stdlib.h>
#include "prtypes.h"
#include "nsQuickSort.h"
NS_BEGIN_EXTERN_C
#if !defined(DEBUG) && (defined(__cplusplus) || defined(__gcc))
# ifndef INLINE
# define INLINE inline
# endif
#else
# define INLINE
#endif
typedef int cmp_t(const void *, const void *, void *);
static INLINE char *med3(char *, char *, char *, cmp_t *, void *);
static INLINE void swapfunc(char *, char *, int, int);
/*
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
*/
#define swapcode(TYPE, parmi, parmj, n) { \
long i = (n) / sizeof (TYPE); \
register TYPE *pi = (TYPE *) (parmi); \
register TYPE *pj = (TYPE *) (parmj); \
do { \
register TYPE t = *pi; \
*pi++ = *pj; \
*pj++ = t; \
} while (--i > 0); \
}
#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
static INLINE void
swapfunc(char *a, char *b, int n, int swaptype)
{
if(swaptype <= 1)
swapcode(long, a, b, n)
else
swapcode(char, a, b, n)
}
#define swap(a, b) \
if (swaptype == 0) { \
long t = *(long *)(a); \
*(long *)(a) = *(long *)(b); \
*(long *)(b) = t; \
} else \
swapfunc((char *)a, (char*)b, (int)es, swaptype)
#define vecswap(a, b, n) if ((n) > 0) swapfunc((char *)a, (char *)b, (int)n, swaptype)
static INLINE char *
med3(char *a, char *b, char *c, cmp_t* cmp, void *data)
{
return cmp(a, b, data) < 0 ?
(cmp(b, c, data) < 0 ? b : (cmp(a, c, data) < 0 ? c : a ))
:(cmp(b, c, data) > 0 ? b : (cmp(a, c, data) < 0 ? a : c ));
}
void NS_QuickSort (
void *a,
unsigned int n,
unsigned int es,
cmp_t *cmp,
void *data
)
{
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
int d, r, swaptype, swap_cnt;
loop: SWAPINIT(a, es);
swap_cnt = 0;
if (n < 7) {
for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
for (pl = pm; pl > (char *)a && cmp(pl - es, pl, data) > 0;
pl -= es)
swap(pl, pl - es);
return;
}
pm = (char *)a + (n / 2) * es;
if (n > 7) {
pl = (char *)a;
pn = (char *)a + (n - 1) * es;
if (n > 40) {
d = (n / 8) * es;
pl = med3(pl, pl + d, pl + 2 * d, cmp, data);
pm = med3(pm - d, pm, pm + d, cmp, data);
pn = med3(pn - 2 * d, pn - d, pn, cmp, data);
}
pm = med3(pl, pm, pn, cmp, data);
}
swap(a, pm);
pa = pb = (char *)a + es;
pc = pd = (char *)a + (n - 1) * es;
for (;;) {
while (pb <= pc && (r = cmp(pb, a, data)) <= 0) {
if (r == 0) {
swap_cnt = 1;
swap(pa, pb);
pa += es;
}
pb += es;
}
while (pb <= pc && (r = cmp(pc, a, data)) >= 0) {
if (r == 0) {
swap_cnt = 1;
swap(pc, pd);
pd -= es;
}
pc -= es;
}
if (pb > pc)
break;
swap(pb, pc);
swap_cnt = 1;
pb += es;
pc -= es;
}
if (swap_cnt == 0) { /* Switch to insertion sort */
for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
for (pl = pm; pl > (char *)a && cmp(pl - es, pl, data) > 0;
pl -= es)
swap(pl, pl - es);
return;
}
pn = (char *)a + n * es;
r = PR_MIN(pa - (char *)a, pb - pa);
vecswap(a, pb - r, r);
r = PR_MIN(pd - pc, (int)(pn - pd - es));
vecswap(pb, pn - r, r);
if ((r = pb - pa) > (int)es)
NS_QuickSort(a, r / es, es, cmp, data);
if ((r = pd - pc) > (int)es) {
/* Iterate rather than recurse to save stack space */
a = pn - r;
n = r / es;
goto loop;
}
/* NS_QuickSort(pn - r, r / es, es, cmp, data);*/
}
NS_END_EXTERN_C

View File

@@ -1,41 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* We need this because Solaris' version of qsort is broken and
* causes array bounds reads.
*/
#ifndef nsQuickSort_h___
#define nsQuickSort_h___
#include "nscore.h"
#include "prtypes.h"
/* Had to pull the following define out of xp_core.h
* to avoid including xp_core.h.
* That brought in too many header file dependencies.
*/
NS_BEGIN_EXTERN_C
PR_EXTERN(void) NS_QuickSort(void *, unsigned int, unsigned int,
int (*)(const void *, const void *, void *),
void *);
NS_END_EXTERN_C
#endif /* nsQuickSort_h___ */

View File

@@ -1,271 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISizeOfHandler.h"
#include "nsIAtom.h"
#include "plhash.h"
class nsSizeOfHandler : public nsISizeOfHandler {
public:
nsSizeOfHandler();
virtual ~nsSizeOfHandler();
// nsISupports
NS_DECL_ISUPPORTS
// nsISizeOfHandler
NS_IMETHOD Init();
NS_IMETHOD RecordObject(void* aObject, PRBool* aResult);
NS_IMETHOD AddSize(nsIAtom* aKey, PRUint32 aSize);
NS_IMETHOD Report(nsISizeofReportFunc aFunc, void* aArg);
NS_IMETHOD GetTotals(PRUint32* aCountResult, PRUint32* aTotalSizeResult);
protected:
PRUint32 mTotalSize;
PRUint32 mTotalCount;
PLHashTable* mSizeTable;
PLHashTable* mObjectTable;
static PRIntn RemoveObjectEntry(PLHashEntry* he, PRIntn i, void* arg);
static PRIntn RemoveSizeEntry(PLHashEntry* he, PRIntn i, void* arg);
static PRIntn ReportEntry(PLHashEntry* he, PRIntn i, void* arg);
};
class SizeOfDataStats {
public:
SizeOfDataStats(nsIAtom* aType, PRUint32 aSize);
~SizeOfDataStats();
void Update(PRUint32 aSize);
nsIAtom* mType; // type
PRUint32 mCount; // # of objects of this type
PRUint32 mTotalSize; // total size of all objects of this type
PRUint32 mMinSize; // smallest size for this type
PRUint32 mMaxSize; // largest size for this type
};
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(SizeOfDataStats);
SizeOfDataStats::SizeOfDataStats(nsIAtom* aType, PRUint32 aSize)
: mType(aType),
mCount(1),
mTotalSize(aSize),
mMinSize(aSize),
mMaxSize(aSize)
{
MOZ_COUNT_CTOR(SizeOfDataStats);
NS_IF_ADDREF(mType);
}
SizeOfDataStats::~SizeOfDataStats()
{
MOZ_COUNT_DTOR(SizeOfDataStats);
NS_IF_RELEASE(mType);
}
void
SizeOfDataStats::Update(PRUint32 aSize)
{
mCount++;
if (aSize < mMinSize) mMinSize = aSize;
if (aSize > mMaxSize) mMaxSize = aSize;
mTotalSize += aSize;
}
//----------------------------------------------------------------------
#define POINTER_HASH_KEY(_atom) ((PLHashNumber) _atom)
static PLHashNumber
PointerHashKey(nsIAtom* key)
{
return POINTER_HASH_KEY(key);
}
static PRIntn
PointerCompareKeys(void* key1, void* key2)
{
return key1 == key2;
}
nsSizeOfHandler::nsSizeOfHandler()
: mTotalSize(0),
mTotalCount(0)
{
NS_INIT_REFCNT();
mTotalSize = 0;
mSizeTable = PL_NewHashTable(32, (PLHashFunction) PointerHashKey,
(PLHashComparator) PointerCompareKeys,
(PLHashComparator) nsnull,
nsnull, nsnull);
mObjectTable = PL_NewHashTable(32, (PLHashFunction) PointerHashKey,
(PLHashComparator) PointerCompareKeys,
(PLHashComparator) nsnull,
nsnull, nsnull);
}
PRIntn
nsSizeOfHandler::RemoveObjectEntry(PLHashEntry* he, PRIntn i, void* arg)
{
// Remove and free this entry and continue enumerating
return HT_ENUMERATE_REMOVE | HT_ENUMERATE_NEXT;
}
PRIntn
nsSizeOfHandler::RemoveSizeEntry(PLHashEntry* he, PRIntn i, void* arg)
{
if (he->value) {
SizeOfDataStats* stats = (SizeOfDataStats*) he->value;
he->value = nsnull;
delete stats;
}
// Remove and free this entry and continue enumerating
return HT_ENUMERATE_REMOVE | HT_ENUMERATE_NEXT;
}
nsSizeOfHandler::~nsSizeOfHandler()
{
if (nsnull != mObjectTable) {
PL_HashTableEnumerateEntries(mObjectTable, RemoveObjectEntry, 0);
PL_HashTableDestroy(mObjectTable);
}
if (nsnull != mSizeTable) {
PL_HashTableEnumerateEntries(mSizeTable, RemoveSizeEntry, 0);
PL_HashTableDestroy(mSizeTable);
}
}
NS_IMPL_ISUPPORTS1(nsSizeOfHandler, nsISizeOfHandler)
NS_IMETHODIMP
nsSizeOfHandler::Init()
{
if (mObjectTable) {
PL_HashTableEnumerateEntries(mObjectTable, RemoveObjectEntry, 0);
}
if (mSizeTable) {
PL_HashTableEnumerateEntries(mSizeTable, RemoveSizeEntry, 0);
}
mTotalCount = 0;
mTotalSize = 0;
return NS_OK;
}
NS_IMETHODIMP
nsSizeOfHandler::RecordObject(void* aAddr, PRBool* aResult)
{
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
PRBool result = PR_TRUE;
if (mObjectTable && aAddr) {
PLHashNumber hashCode = POINTER_HASH_KEY(aAddr);
PLHashEntry** hep = PL_HashTableRawLookup(mObjectTable, hashCode, aAddr);
PLHashEntry* he = *hep;
if (!he) {
// We've never seen it before. Add it to the table
(void) PL_HashTableRawAdd(mObjectTable, hep, hashCode, aAddr, aAddr);
result = PR_FALSE;
}
}
*aResult = result;
return NS_OK;
}
NS_IMETHODIMP
nsSizeOfHandler::AddSize(nsIAtom* aType, PRUint32 aSize)
{
PLHashNumber hashCode = POINTER_HASH_KEY(aType);
PLHashEntry** hep = PL_HashTableRawLookup(mSizeTable, hashCode, aType);
PLHashEntry* he = *hep;
if (he) {
// Stats already exist
SizeOfDataStats* stats = (SizeOfDataStats*) he->value;
stats->Update(aSize);
}
else {
// Make new stats for the new frame type
SizeOfDataStats* newStats = new SizeOfDataStats(aType, aSize);
PL_HashTableRawAdd(mSizeTable, hep, hashCode, aType, newStats);
}
mTotalCount++;
mTotalSize += aSize;
return NS_OK;
}
struct ReportArgs {
nsISizeOfHandler* mHandler;
nsISizeofReportFunc mFunc;
void* mArg;
};
PRIntn
nsSizeOfHandler::ReportEntry(PLHashEntry* he, PRIntn i, void* arg)
{
ReportArgs* ra = (ReportArgs*) arg;
if (he && ra && ra->mFunc) {
SizeOfDataStats* stats = (SizeOfDataStats*) he->value;
if (stats) {
(*ra->mFunc)(ra->mHandler, stats->mType, stats->mCount,
stats->mTotalSize, stats->mMinSize, stats->mMaxSize,
ra->mArg);
}
}
return HT_ENUMERATE_NEXT;
}
NS_IMETHODIMP
nsSizeOfHandler::Report(nsISizeofReportFunc aFunc, void* aArg)
{
ReportArgs ra;
ra.mHandler = this;
ra.mFunc = aFunc;
ra.mArg = aArg;
PL_HashTableEnumerateEntries(mSizeTable, ReportEntry, (void*) &ra);
return NS_OK;
}
NS_IMETHODIMP
nsSizeOfHandler::GetTotals(PRUint32* aTotalCountResult,
PRUint32* aTotalSizeResult)
{
if (!aTotalCountResult || !aTotalSizeResult) {
return NS_ERROR_NULL_POINTER;
}
*aTotalCountResult = mTotalCount;
*aTotalSizeResult = mTotalSize;
return NS_OK;
}
NS_COM nsresult
NS_NewSizeOfHandler(nsISizeOfHandler** aInstancePtrResult)
{
if (!aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}
nsISizeOfHandler *it = new nsSizeOfHandler();
if (it == nsnull) {
return NS_ERROR_OUT_OF_MEMORY;
}
return it->QueryInterface(NS_GET_IID(nsISizeOfHandler), (void **) aInstancePtrResult);
}

View File

@@ -1,717 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/******************************************************************************************
MODULE NOTES:
This file contains the nsStr data structure.
This general purpose buffer management class is used as the basis for our strings.
It's benefits include:
1. An efficient set of library style functions for manipulating nsStrs
2. Support for 1 and 2 byte character strings (which can easily be increased to n)
3. Unicode awareness and interoperability.
*******************************************************************************************/
#include "nsStr.h"
#include "bufferRoutines.h"
#include "stdio.h" //only used for printf
#include "nsCRT.h"
#include "nsDeque.h"
//static const char* kCallFindChar = "For better performance, call FindChar() for targets whose length==1.";
//static const char* kCallRFindChar = "For better performance, call RFindChar() for targets whose length==1.";
static const PRUnichar gCommonEmptyBuffer[1] = {0};
/**
* This method initializes all the members of the nsStr structure
*
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Initialize(nsStr& aDest,eCharSize aCharSize) {
aDest.mStr=(char*)gCommonEmptyBuffer;
aDest.mLength=0;
aDest.mCapacity=0;
aDest.mCharSize=aCharSize;
aDest.mOwnsBuffer=0;
}
/**
* This method initializes all the members of the nsStr structure
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Initialize(nsStr& aDest,char* aCString,PRUint32 aCapacity,PRUint32 aLength,eCharSize aCharSize,PRBool aOwnsBuffer){
aDest.mStr=(aCString) ? aCString : (char*)gCommonEmptyBuffer;
aDest.mLength=aLength;
aDest.mCapacity=aCapacity;
aDest.mCharSize=aCharSize;
aDest.mOwnsBuffer=aOwnsBuffer;
}
/**
* This member destroys the memory buffer owned by an nsStr object (if it actually owns it)
* @update gess10/30/98
* @param
* @return
*/
void nsStr::Destroy(nsStr& aDest) {
if((aDest.mStr) && (aDest.mStr!=(char*)gCommonEmptyBuffer)) {
Free(aDest);
}
}
/**
* This method gets called when the internal buffer needs
* to grow to a given size. The original contents are not preserved.
* @update gess 3/30/98
* @param aNewLength -- new capacity of string in charSize units
* @return void
*/
PRBool nsStr::EnsureCapacity(nsStr& aString,PRUint32 aNewLength) {
PRBool result=PR_TRUE;
if(aNewLength>aString.mCapacity) {
result=Realloc(aString,aNewLength);
if(aString.mStr)
AddNullTerminator(aString);
}
return result;
}
/**
* This method gets called when the internal buffer needs
* to grow to a given size. The original contents ARE preserved.
* @update gess 3/30/98
* @param aNewLength -- new capacity of string in charSize units
* @return void
*/
PRBool nsStr::GrowCapacity(nsStr& aDest,PRUint32 aNewLength) {
PRBool result=PR_TRUE;
if(aNewLength>aDest.mCapacity) {
nsStr theTempStr;
nsStr::Initialize(theTempStr,aDest.mCharSize);
result=EnsureCapacity(theTempStr,aNewLength);
if(result) {
if(aDest.mLength) {
Append(theTempStr,aDest,0,aDest.mLength);
}
Free(aDest);
aDest.mStr = theTempStr.mStr;
theTempStr.mStr=0; //make sure to null this out so that you don't lose the buffer you just stole...
aDest.mLength=theTempStr.mLength;
aDest.mCapacity=theTempStr.mCapacity;
aDest.mOwnsBuffer=theTempStr.mOwnsBuffer;
}
}
return result;
}
/**
* Replaces the contents of aDest with aSource, up to aCount of chars.
* @update gess10/30/98
* @param aDest is the nsStr that gets changed.
* @param aSource is where chars are copied from
* @param aCount is the number of chars copied from aSource
*/
void nsStr::Assign(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount){
if(&aDest!=&aSource){
Truncate(aDest,0);
Append(aDest,aSource,anOffset,aCount);
}
}
/**
* This method appends the given nsStr to this one. Note that we have to
* pay attention to the underlying char-size of both structs.
* @update gess10/30/98
* @param aDest is the nsStr to be manipulated
* @param aSource is where char are copied from
* @aCount is the number of bytes to be copied
*/
void nsStr::Append(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount){
if(anOffset<aSource.mLength){
PRUint32 theRealLen=(aCount<0) ? aSource.mLength : MinInt(aCount,aSource.mLength);
PRUint32 theLength=(anOffset+theRealLen<aSource.mLength) ? theRealLen : (aSource.mLength-anOffset);
if(0<theLength){
PRBool isBigEnough=PR_TRUE;
if(aDest.mLength+theLength > aDest.mCapacity) {
isBigEnough=GrowCapacity(aDest,aDest.mLength+theLength);
}
if(isBigEnough) {
//now append new chars, starting at offset
(*gCopyChars[aSource.mCharSize][aDest.mCharSize])(aDest.mStr,aDest.mLength,aSource.mStr,anOffset,theLength);
aDest.mLength+=theLength;
AddNullTerminator(aDest);
}
}
}
}
/**
* This method inserts up to "aCount" chars from a source nsStr into a dest nsStr.
* @update gess10/30/98
* @param aDest is the nsStr that gets changed
* @param aDestOffset is where in aDest the insertion is to occur
* @param aSource is where chars are copied from
* @param aSrcOffset is where in aSource chars are copied from
* @param aCount is the number of chars from aSource to be inserted into aDest
*/
void nsStr::Insert( nsStr& aDest,PRUint32 aDestOffset,const nsStr& aSource,PRUint32 aSrcOffset,PRInt32 aCount){
//there are a few cases for insert:
// 1. You're inserting chars into an empty string (assign)
// 2. You're inserting onto the end of a string (append)
// 3. You're inserting onto the 1..n-1 pos of a string (the hard case).
if(0<aSource.mLength){
if(aDest.mLength){
if(aDestOffset<aDest.mLength){
PRInt32 theRealLen=(aCount<0) ? aSource.mLength : MinInt(aCount,aSource.mLength);
PRInt32 theLength=(aSrcOffset+theRealLen<aSource.mLength) ? theRealLen : (aSource.mLength-aSrcOffset);
if(aSrcOffset<aSource.mLength) {
//here's the only new case we have to handle.
//chars are really being inserted into our buffer...
if(aDest.mLength+theLength > aDest.mCapacity) {
nsStr theTempStr;
nsStr::Initialize(theTempStr,aDest.mCharSize);
PRBool isBigEnough=EnsureCapacity(theTempStr,aDest.mLength+theLength); //grow the temp buffer to the right size
if(isBigEnough) {
if(aDestOffset) {
Append(theTempStr,aDest,0,aDestOffset); //first copy leftmost data...
}
Append(theTempStr,aSource,0,aSource.mLength); //next copy inserted (new) data
PRUint32 theRemains=aDest.mLength-aDestOffset;
if(theRemains) {
Append(theTempStr,aDest,aDestOffset,theRemains); //next copy rightmost data
}
Free(aDest);
aDest.mStr = theTempStr.mStr;
theTempStr.mStr=0; //make sure to null this out so that you don't lose the buffer you just stole...
aDest.mCapacity=theTempStr.mCapacity;
aDest.mOwnsBuffer=theTempStr.mOwnsBuffer;
}
}
else {
//shift the chars right by theDelta...
(*gShiftChars[aDest.mCharSize][KSHIFTRIGHT])(aDest.mStr,aDest.mLength,aDestOffset,theLength);
//now insert new chars, starting at offset
(*gCopyChars[aSource.mCharSize][aDest.mCharSize])(aDest.mStr,aDestOffset,aSource.mStr,aSrcOffset,theLength);
}
//finally, make sure to update the string length...
aDest.mLength+=theLength;
AddNullTerminator(aDest);
}//if
//else nothing to do!
}
else Append(aDest,aSource,0,aCount);
}
else Append(aDest,aSource,0,aCount);
}
}
/**
* This method deletes up to aCount chars from aDest
* @update gess10/30/98
* @param aDest is the nsStr to be manipulated
* @param aDestOffset is where in aDest deletion is to occur
* @param aCount is the number of chars to be deleted in aDest
*/
void nsStr::Delete(nsStr& aDest,PRUint32 aDestOffset,PRUint32 aCount){
if(aDestOffset<aDest.mLength){
PRUint32 theDelta=aDest.mLength-aDestOffset;
PRUint32 theLength=(theDelta<aCount) ? theDelta : aCount;
if(aDestOffset+theLength<aDest.mLength) {
//if you're here, it means we're cutting chars out of the middle of the string...
//so shift the chars left by theLength...
(*gShiftChars[aDest.mCharSize][KSHIFTLEFT])(aDest.mStr,aDest.mLength,aDestOffset,theLength);
aDest.mLength-=theLength;
AddNullTerminator(aDest);
}
else Truncate(aDest,aDestOffset);
}//if
}
/**
* This method truncates the given nsStr at given offset
* @update gess10/30/98
* @param aDest is the nsStr to be truncated
* @param aDestOffset is where in aDest truncation is to occur
*/
void nsStr::Truncate(nsStr& aDest,PRUint32 aDestOffset){
if(aDestOffset<aDest.mLength){
aDest.mLength=aDestOffset;
AddNullTerminator(aDest);
}
}
/**
* This method forces the given string to upper or lowercase
* @update gess1/7/99
* @param aDest is the string you're going to change
* @param aToUpper: if TRUE, then we go uppercase, otherwise we go lowercase
* @return
*/
void nsStr::ChangeCase(nsStr& aDest,PRBool aToUpper) {
// somehow UnicharUtil return failed, fallback to the old ascii only code
gCaseConverters[aDest.mCharSize](aDest.mStr,aDest.mLength,aToUpper);
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::Trim(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing){
if((aDest.mLength>0) && aSet){
PRInt32 theIndex=-1;
PRInt32 theMax=aDest.mLength;
PRInt32 theSetLen=nsCRT::strlen(aSet);
if(aEliminateLeading) {
while(++theIndex<=theMax) {
PRUnichar theChar=GetCharAt(aDest,theIndex);
PRInt32 thePos=gFindChars[eOneByte](aSet,theSetLen,0,theChar,PR_FALSE);
if(kNotFound==thePos)
break;
}
if(0<theIndex) {
if(theIndex<theMax) {
Delete(aDest,0,theIndex);
}
else Truncate(aDest,0);
}
}
if(aEliminateTrailing) {
theIndex=aDest.mLength;
PRInt32 theNewLen=theIndex;
while(--theIndex>0) {
PRUnichar theChar=GetCharAt(aDest,theIndex); //read at end now...
PRInt32 thePos=gFindChars[eOneByte](aSet,theSetLen,0,theChar,PR_FALSE);
if(kNotFound<thePos)
theNewLen=theIndex;
else break;
}
if(theNewLen<theMax) {
Truncate(aDest,theNewLen);
}
}
}
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::CompressSet(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing){
Trim(aDest,aSet,aEliminateLeading,aEliminateTrailing);
PRUint32 aNewLen=gCompressChars[aDest.mCharSize](aDest.mStr,aDest.mLength,aSet);
aDest.mLength=aNewLen;
}
/**
*
* @update gess1/7/99
* @param
* @return
*/
void nsStr::StripChars(nsStr& aDest,const char* aSet){
if((0<aDest.mLength) && (aSet)) {
PRUint32 aNewLen=gStripChars[aDest.mCharSize](aDest.mStr,aDest.mLength,aSet);
aDest.mLength=aNewLen;
}
}
/**************************************************************
Searching methods...
**************************************************************/
/**
* This searches aDest for a given substring
*
* @update gess 3/25/98
* @param aDest string to search
* @param aTarget is the substring you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) {
// NS_PRECONDITION(aTarget.mLength!=1,kCallFindChar);
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRInt32 theMax=aDest.mLength-aTarget.mLength;
PRInt32 index=(0<=anOffset) ? anOffset : 0;
if((aDest.mLength>=aTarget.mLength) && (aTarget.mLength>0) && (index>=0)){
PRInt32 theTargetMax=aTarget.mLength;
while(index<=theMax) {
PRInt32 theSubIndex=-1;
PRBool matches=PR_TRUE;
while((++theSubIndex<theTargetMax) && (matches)){
PRUnichar theChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aDest,index+theSubIndex)) : GetCharAt(aDest,index+theSubIndex);
PRUnichar theTargetChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aTarget,theSubIndex)) : GetCharAt(aTarget,theSubIndex);
matches=PRBool(theChar==theTargetChar);
}
if(matches) {
result=index;
break;
}
index++;
} //while
}//if
}//if
return result;
}
/**
* This searches aDest for a given character
*
* @update gess 3/25/98
* @param aDest string to search
* @param char is the character you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset) {
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRUint32 index=(0<=anOffset) ? (PRUint32)anOffset : 0;
result=gFindChars[aDest.mCharSize](aDest.mStr,aDest.mLength,index,aChar,aIgnoreCase);
}
return result;
}
/**
* This searches aDest for a character found in aSet.
*
* @update gess 3/25/98
* @param aDest string to search
* @param aSet contains a list of chars to be searched for
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aSet.mLength!=1,kCallFindChar);
PRInt32 index=(0<=anOffset) ? anOffset-1 : -1;
PRInt32 thePos;
//Note that the search is inverted here. We're scanning aDest, one char at a time
//but doing the search against the given set. That's why we use 0 as the offset below.
if((0<aDest.mLength) && (0<aSet.mLength)){
while(++index<(PRInt32)aDest.mLength) {
PRUnichar theChar=GetCharAt(aDest,index);
thePos=gFindChars[aSet.mCharSize](aSet.mStr,aSet.mLength,0,theChar,aIgnoreCase);
if(kNotFound!=thePos)
return index;
} //while
}
return kNotFound;
}
/**************************************************************
Reverse Searching methods...
**************************************************************/
/**
* This searches aDest (in reverse) for a given substring
*
* @update gess 3/25/98
* @param aDest string to search
* @param aTarget is the substring you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search (counting from left)
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aTarget.mLength!=1,kCallRFindChar);
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRInt32 index=(0<=anOffset) ? anOffset : aDest.mLength-1;
if((aDest.mLength>=aTarget.mLength) && (aTarget.mLength>0) && (index>=0)){
nsStr theCopy;
nsStr::Initialize(theCopy,eOneByte);
nsStr::Assign(theCopy,aTarget,0,aTarget.mLength);
if(aIgnoreCase){
nsStr::ChangeCase(theCopy,PR_FALSE); //force to lowercase
}
PRInt32 theTargetMax=theCopy.mLength;
while(index>=0) {
PRInt32 theSubIndex=-1;
PRBool matches=PR_FALSE;
if(index+theCopy.mLength<=aDest.mLength) {
matches=PR_TRUE;
while((++theSubIndex<theTargetMax) && (matches)){
PRUnichar theDestChar=(aIgnoreCase) ? nsCRT::ToLower(GetCharAt(aDest,index+theSubIndex)) : GetCharAt(aDest,index+theSubIndex);
PRUnichar theTargetChar=GetCharAt(theCopy,theSubIndex);
matches=PRBool(theDestChar==theTargetChar);
} //while
} //if
if(matches) {
result=index;
break;
}
index--;
} //while
nsStr::Destroy(theCopy);
}//if
}//if
return result;
}
/**
* This searches aDest (in reverse) for a given character
*
* @update gess 3/25/98
* @param aDest string to search
* @param char is the character you're trying to find.
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset) {
PRInt32 result=kNotFound;
if((0<aDest.mLength) && (anOffset<(PRInt32)aDest.mLength)) {
PRUint32 index=(0<=anOffset) ? anOffset : aDest.mLength-1;
result=gRFindChars[aDest.mCharSize](aDest.mStr,aDest.mLength,index,aChar,aIgnoreCase);
}
return result;
}
/**
* This searches aDest (in reverese) for a character found in aSet.
*
* @update gess 3/25/98
* @param aDest string to search
* @param aSet contains a list of chars to be searched for
* @param aIgnorecase indicates case sensitivity of search
* @param anOffset tells us where to start the search
* @return index in aDest where member of aSet occurs, or -1 if not found
*/
PRInt32 nsStr::RFindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset) {
//NS_PRECONDITION(aSet.mLength!=1,kCallRFindChar);
PRInt32 index=(0<=anOffset) ? anOffset : aDest.mLength;
PRInt32 thePos;
//note that the search is inverted here. We're scanning aDest, one char at a time
//but doing the search against the given set. That's why we use 0 as the offset below.
if(0<aDest.mLength) {
while(--index>=0) {
PRUnichar theChar=GetCharAt(aDest,index);
thePos=gFindChars[aSet.mCharSize](aSet.mStr,aSet.mLength,0,theChar,aIgnoreCase);
if(kNotFound!=thePos)
return index;
} //while
}
return kNotFound;
}
/**
* Compare source and dest strings, up to an (optional max) number of chars
* @param aDest is the first str to compare
* @param aSource is the second str to compare
* @param aCount -- if (-1), then we use length of longer string; if (0<aCount) then it gives the max # of chars to compare
* @param aIgnorecase tells us whether to search with case sensitivity
* @return aDest<aSource=-1;aDest==aSource==0;aDest>aSource=1
*/
PRInt32 nsStr::Compare(const nsStr& aDest,const nsStr& aSource,PRInt32 aCount,PRBool aIgnoreCase) {
PRInt32 result=0;
if(aCount) {
PRInt32 minlen=(aSource.mLength<aDest.mLength) ? aSource.mLength : aDest.mLength;
if(0==minlen) {
if ((aDest.mLength == 0) && (aSource.mLength == 0))
return 0;
if (aDest.mLength == 0)
return -1;
return 1;
}
PRInt32 maxlen=(aSource.mLength<aDest.mLength) ? aDest.mLength : aSource.mLength;
aCount = (aCount<0) ? maxlen : MinInt(aCount,maxlen);
result=(*gCompare[aDest.mCharSize][aSource.mCharSize])(aDest.mStr,aSource.mStr,aCount,aIgnoreCase);
}
return result;
}
//----------------------------------------------------------------------------------------
PRBool nsStr::Alloc(nsStr& aDest,PRUint32 aCount) {
static int mAllocCount=0;
mAllocCount++;
//we're given the acount value in charunits; now scale up to next multiple.
PRUint32 theNewCapacity=kDefaultStringSize;
while(theNewCapacity<aCount){
theNewCapacity<<=1;
}
aDest.mCapacity=theNewCapacity++;
PRUint32 theSize=(theNewCapacity<<aDest.mCharSize);
aDest.mStr = (char*)nsAllocator::Alloc(theSize);
PRBool result=PR_FALSE;
if(aDest.mStr) {
aDest.mOwnsBuffer=1;
result=PR_TRUE;
}
return result;
}
PRBool nsStr::Free(nsStr& aDest){
if(aDest.mStr){
if(aDest.mOwnsBuffer){
nsAllocator::Free(aDest.mStr);
}
aDest.mStr=0;
aDest.mOwnsBuffer=0;
return PR_TRUE;
}
return PR_FALSE;
}
PRBool nsStr::Realloc(nsStr& aDest,PRUint32 aCount){
nsStr temp;
memcpy(&temp,&aDest,sizeof(aDest));
PRBool result=Alloc(temp,aCount);
if(result) {
Free(aDest);
aDest.mStr=temp.mStr;
aDest.mCapacity=temp.mCapacity;
aDest.mOwnsBuffer=temp.mOwnsBuffer;
}
return result;
}
//----------------------------------------------------------------------------------------
CBufDescriptor::CBufDescriptor(char* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=aString;
mCharSize=eOneByte;
mStackBased=aStackBased;
mIsConst=PR_FALSE;
mLength=mCapacity=0;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(const char* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eOneByte;
mStackBased=aStackBased;
mIsConst=PR_TRUE;
mLength=mCapacity=0;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eTwoByte;
mStackBased=aStackBased;
mLength=mCapacity=0;
mIsConst=PR_FALSE;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? nsCRT::strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
CBufDescriptor::CBufDescriptor(const PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength) {
mBuffer=(char*)aString;
mCharSize=eTwoByte;
mStackBased=aStackBased;
mLength=mCapacity=0;
mIsConst=PR_TRUE;
if(aString && aCapacity>1) {
mCapacity=aCapacity-1;
mLength=(-1==aLength) ? nsCRT::strlen(aString) : aLength;
if(mLength>PRInt32(mCapacity))
mLength=mCapacity;
}
}
//----------------------------------------------------------------------------------------

View File

@@ -1,450 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
1. There are two philosophies to building string classes:
A. Hide the underlying buffer & offer API's allow indirect iteration
B. Reveal underlying buffer, risk corruption, but gain performance
We chose the option B for performance reasons.
2 Our internal buffer always holds capacity+1 bytes.
The nsStr struct is a simple structure (no methods) that contains
the necessary info to be described as a string. This simple struct
is manipulated by the static methods provided in this class.
(Which effectively makes this a library that works on structs).
There are also object-based versions called nsString and nsAutoString
which use nsStr but makes it look at feel like an object.
***********************************************************************/
/***********************************************************************
ASSUMPTIONS:
1. nsStrings and nsAutoString are always null terminated.
2. If you try to set a null char (via SetChar()) a new length is set
3. nsCStrings can be upsampled into nsString without data loss
4. Char searching is faster than string searching. Use char interfaces
if your needs will allow it.
5. It's easy to use the stack for nsAutostring buffer storage (fast too!).
See the CBufDescriptor class in this file.
6. It's ONLY ok to provide non-null-terminated buffers to Append() and Insert()
provided you specify a 0<n value for the optional count argument.
7. Downsampling from nsString to nsCString is lossy -- avoid it if possible!
8. Calls to ToNewCString() and ToNewUnicode() should be matched with calls to Recycle().
***********************************************************************/
/**********************************************************************************
AND NOW FOR SOME GENERAL DOCUMENTATION ON STRING USAGE...
The fundamental datatype in the string library is nsStr. It's a structure that
provides the buffer storage and meta-info. It also provides a C-style library
of functions for direct manipulation (for those of you who prefer K&R to Bjarne).
Here's a diagram of the class hierarchy:
nsStr
|___nsString
| |
| ------nsAutoString
|
|___nsCString
|
------nsCAutoString
Why so many string classes? The 4 variants give you the control you need to
determine the best class for your purpose. There are 2 dimensions to this
flexibility: 1) stack vs. heap; and 2) 1-byte chars vs. 2-byte chars.
Note: While nsAutoString and nsCAutoString begin life using stack-based storage,
they may not stay that way. Like all nsString classes, autostrings will
automatically grow to contain the data you provide. When autostrings
grow beyond their intrinsic buffer, they switch to heap based allocations.
(We avoid alloca to avoid considerable platform difficulties; see the
GNU documentation for more details).
I should also briefly mention that all the string classes use a "memory agent"
object to perform memory operations. This class proxies the standard nsAllocator
for actual memory calls, but knows the structure of nsStr making heap operations
more localized.
CHOOSING A STRING CLASS:
In order to choose a string class for you purpose, use this handy table:
heap-based stack-based
-----------------------------------
ascii data | nsCString nsCAutoString |
|----------------------------------
unicode data | nsString nsAutoString |
-----------------------------------
Note: The i18n folks will stenuously object if we get too carried away with the
use of nsCString's that pass interface boundaries. Try to limit your
use of these to external interfaces that demand them, or for your own
private purposes in cases where they'll never be seen by humans.
PERFORMANCE CONSIDERATIONS:
Here are a few tricks to know in order to get better string performance:
1) Try to limit conversions between ascii and unicode; By sticking with nsString
wherever possible your code will be i18n-compliant.
2) Preallocating your string buffer cuts down trips to the allocator. So if you
have need for an arbitrarily large buffer, pre-size it like this:
{
nsString mBuffer;
mBuffer.SetCapacity(aReasonableSize);
}
3) Allocating nsAutoString or nsCAutoString on the heap is memory inefficient
(after all, the whole point is to avoid a heap allocation of the buffer).
4) Consider using an autoString to write into your arbitrarily-sized stack buffers, rather
than it's own buffers.
For example, let's say you're going to call printf() to emit pretty-printed debug output
of your object. You know from experience that the pretty-printed version of your object
exceeds the capacity of an autostring. Ignoring memory considerations, you could simply
use nsCString, appending the stringized version of each of your class's data members.
This will probably result in calls to the heap manager.
But there's a way to do this without necessarily having to call the heap manager.
All you do is declare a stack based buffer and instruct nsCString to use that instead
of it's own internal buffer by using the CBufDescriptor class:
{
char theBuffer[256];
CBufDescritor theBufDecriptor( theBuffer, PR_TRUE, sizeof(theBuffer), 0);
nsCAutoString s3( theBufDescriptor );
s3="HELLO, my name is inigo montoya, you killed my father, prepare to die!.";
}
The assignment statment to s3 will cause the given string to be written to your
stack-based buffer via the normal nsString/nsCString interfaces. Cool, huh?
Note however that just like any other nsStringXXX use, if you write more data
than will fit in the buffer, a visit to the heap manager will be in order.
**********************************************************************************/
#ifndef _nsStr
#define _nsStr
#include "nscore.h"
#include "nsIAllocator.h"
#include <string.h>
//----------------------------------------------------------------------------------------
enum eCharSize {eOneByte=0,eTwoByte=1};
#define kDefaultCharSize eTwoByte
#define kRadix10 (10)
#define kRadix16 (16)
#define kAutoDetect (100)
#define kRadixUnknown (kAutoDetect+1)
const PRInt32 kDefaultStringSize = 64;
const PRInt32 kNotFound = -1;
//----------------------------------------------------------------------------------------
class NS_COM CBufDescriptor {
public:
CBufDescriptor(char* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(const char* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(PRUnichar* aString, PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
CBufDescriptor(const PRUnichar* aString,PRBool aStackBased,PRUint32 aCapacity,PRInt32 aLength=-1);
char* mBuffer;
eCharSize mCharSize;
PRUint32 mCapacity;
PRInt32 mLength;
PRBool mStackBased;
PRBool mIsConst;
};
//----------------------------------------------------------------------------------------
struct NS_COM nsStr {
//----------------------------------------------------------------------------------------
nsStr() {
MOZ_COUNT_CTOR(nsStr);
}
~nsStr() {
MOZ_COUNT_DTOR(nsStr);
}
/**
* This method initializes an nsStr for use
*
* @update gess 01/04/99
* @param aString is the nsStr to be initialized
* @param aCharSize tells us the requested char size (1 or 2 bytes)
*/
static void Initialize(nsStr& aDest,eCharSize aCharSize);
/**
* This method initializes an nsStr for use
*
* @update gess 01/04/99
* @param aString is the nsStr to be initialized
* @param aCharSize tells us the requested char size (1 or 2 bytes)
*/
static void Initialize(nsStr& aDest,char* aCString,PRUint32 aCapacity,PRUint32 aLength,eCharSize aCharSize,PRBool aOwnsBuffer);
/**
* This method destroys the given nsStr, and *MAY*
* deallocate it's memory depending on the setting
* of the internal mOwnsBUffer flag.
*
* @update gess 01/04/99
* @param aString is the nsStr to be manipulated
* @param anAgent is the allocator to be used to the nsStr
*/
static void Destroy(nsStr& aDest);
/**
* These methods are where memory allocation/reallocation occur.
*
* @update gess 01/04/99
* @param aString is the nsStr to be manipulated
* @param anAgent is the allocator to be used on the nsStr
* @return
*/
static PRBool EnsureCapacity(nsStr& aString,PRUint32 aNewLength);
static PRBool GrowCapacity(nsStr& aString,PRUint32 aNewLength);
/**
* These methods are used to append content to the given nsStr
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aSource is the buffer to be copied from
* @param anOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to copy
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Append(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount);
/**
* These methods are used to assign contents of a source string to dest string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aSource is the buffer to be copied from
* @param anOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to copy
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Assign(nsStr& aDest,const nsStr& aSource,PRUint32 anOffset,PRInt32 aCount);
/**
* These methods are used to insert content from source string to the dest nsStr
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aDestOffset tells us where in dest to start insertion
* @param aSource is the buffer to be copied from
* @param aSrcOffset tells us where in source to start copying
* @param aCount tells us the (max) # of chars to insert
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Insert( nsStr& aDest,PRUint32 aDestOffset,const nsStr& aSource,PRUint32 aSrcOffset,PRInt32 aCount);
/**
* This method deletes chars from the given str.
* The given allocator may choose to resize the str as well.
*
* @update gess 01/04/99
* @param aDest is the nsStr to be deleted from
* @param aDestOffset tells us where in dest to start deleting
* @param aCount tells us the (max) # of chars to delete
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Delete(nsStr& aDest,PRUint32 aDestOffset,PRUint32 aCount);
/**
* This method is used to truncate the given string.
* The given allocator may choose to resize the str as well (but it's not likely).
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param aDestOffset tells us where in dest to start insertion
* @param aSource is the buffer to be copied from
* @param aSrcOffset tells us where in source to start copying
* @param anAgent is the allocator to be used for alloc/free operations
*/
static void Truncate(nsStr& aDest,PRUint32 aDestOffset);
/**
* This method is used to perform a case conversion on the given string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be case shifted
* @param toUpper tells us to go upper vs. lower
*/
static void ChangeCase(nsStr& aDest,PRBool aToUpper);
/**
* This method trims chars (given in aSet) from the edges of given buffer
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to remove from given buffer
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void Trim(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing);
/**
* This method compresses duplicate runs of a given char from the given buffer
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to compress from given buffer
* @param aChar is the replacement char
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void CompressSet(nsStr& aDest,const char* aSet,PRBool aEliminateLeading,PRBool aEliminateTrailing);
/**
* This method removes all occurances of chars in given set from aDest
*
* @update gess 01/04/99
* @param aDest is the buffer to be manipulated
* @param aSet tells us which chars to compress from given buffer
* @param aChar is the replacement char
* @param aEliminateLeading tells us whether to strip chars from the start of the buffer
* @param aEliminateTrailing tells us whether to strip chars from the start of the buffer
*/
static void StripChars(nsStr& aDest,const char* aSet);
/**
* This method compares the data bewteen two nsStr's
*
* @update gess 01/04/99
* @param aStr1 is the first buffer to be compared
* @param aStr2 is the 2nd buffer to be compared
* @param aCount is the number of chars to compare
* @param aIgnorecase tells us whether to use a case-sensitive comparison
* @return -1,0,1 depending on <,==,>
*/
static PRInt32 Compare(const nsStr& aDest,const nsStr& aSource,PRInt32 aCount,PRBool aIgnoreCase);
/**
* These methods scan the given string for 1 or more chars in a given direction
*
* @update gess 01/04/99
* @param aDest is the nsStr to be searched to
* @param aSource (or aChar) is the substr we're looking to find
* @param aIgnoreCase tells us whether to search in a case-sensitive manner
* @param anOffset tells us where in the dest string to start searching
* @return the index of the source (substr) in dest, or -1 (kNotFound) if not found.
*/
static PRInt32 FindSubstr(const nsStr& aDest,const nsStr& aSource, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 FindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindSubstr(const nsStr& aDest,const nsStr& aSource, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindChar(const nsStr& aDest,PRUnichar aChar, PRBool aIgnoreCase,PRInt32 anOffset);
static PRInt32 RFindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnoreCase,PRInt32 anOffset);
PRUint32 mLength;
PRUint32 mCapacity;
eCharSize mCharSize;
PRBool mOwnsBuffer;
union {
char* mStr;
PRUnichar* mUStr;
};
private:
static PRBool Alloc(nsStr& aString,PRUint32 aCount);
static PRBool Realloc(nsStr& aString,PRUint32 aCount);
static PRBool Free(nsStr& aString);
};
/**************************************************************
A couple of tiny helper methods used in the string classes.
**************************************************************/
inline PRInt32 MinInt(PRInt32 anInt1,PRInt32 anInt2){
return (anInt1<anInt2) ? anInt1 : anInt2;
}
inline PRInt32 MaxInt(PRInt32 anInt1,PRInt32 anInt2){
return (anInt1<anInt2) ? anInt2 : anInt1;
}
inline void AddNullTerminator(nsStr& aDest) {
if(eTwoByte==aDest.mCharSize)
aDest.mUStr[aDest.mLength]=0;
else aDest.mStr[aDest.mLength]=0;
}
/**
* Return the given buffer to the heap manager. Calls allocator::Free()
* @return string length
*/
inline void Recycle( char* aBuffer) { nsAllocator::Free(aBuffer); }
inline void Recycle( PRUnichar* aBuffer) { nsAllocator::Free(aBuffer); }
/**
* This method is used to access a given char in the given string
*
* @update gess 01/04/99
* @param aDest is the nsStr to be appended to
* @param anIndex tells us where in dest to get the char from
* @return the given char, or 0 if anIndex is out of range
*/
inline PRUnichar GetCharAt(const nsStr& aDest,PRUint32 anIndex){
if(anIndex<aDest.mLength) {
return (eTwoByte==aDest.mCharSize) ? aDest.mUStr[anIndex] : aDest.mStr[anIndex];
}//if
return 0;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,747 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
See nsStr.h for a more general description of string classes.
This version of the nsString class offers many improvements over the
original version:
1. Wide and narrow chars
2. Allocators
3. Much smarter autostrings
4. Subsumable strings
***********************************************************************/
#ifndef _nsCString_
#define _nsCString_
#include "nsString2.h"
#include "prtypes.h"
#include "nscore.h"
#include <stdio.h>
#include "nsStr.h"
#include "nsIAtom.h"
class NS_COM nsSubsumeCStr;
class NS_COM nsCString : public nsStr {
public:
/**
* Default constructor.
*/
nsCString();
/**
* This constructor accepts an isolatin string
* @param aCString is a ptr to a 1-byte cstr
*/
nsCString(const char* aCString,PRInt32 aLength=-1);
/**
* This constructor accepts a unichar string
* @param aCString is a ptr to a 2-byte cstr
*/
nsCString(const PRUnichar* aString,PRInt32 aLength=-1);
/**
* This is a copy constructor that accepts an nsStr
* @param reference to another nsCString
*/
nsCString(const nsStr&);
/**
* This is our copy constructor
* @param reference to another nsCString
*/
nsCString(const nsCString& aString);
/**
* This constructor takes a subsumestr
* @param reference to subsumestr
*/
nsCString(nsSubsumeCStr& aSubsumeStr);
/**
* Destructor
*
*/
virtual ~nsCString();
/**
* Retrieve the length of this string
* @return string length
*/
inline PRInt32 Length() const { return (PRInt32)mLength; }
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
/**
* Call this method if you want to force a different string capacity
* @update gess7/30/98
* @param aLength -- contains new length for mStr
* @return
*/
void SetLength(PRUint32 aLength) {
Truncate(aLength);
}
/**
* Sets the new length of the string.
* @param aLength is new string length.
* @return nada
*/
void SetCapacity(PRUint32 aLength);
/**
* This method truncates this string to given length.
*
* @param anIndex -- new length of string
* @return nada
*/
void Truncate(PRInt32 anIndex=0);
/**
* Determine whether or not the characters in this
* string are in sorted order.
*
* @return TRUE if ordered.
*/
PRBool IsOrdered(void) const;
/**
* Determine whether or not this string has a length of 0
*
* @return TRUE if empty.
*/
PRBool IsEmpty(void) const {
return PRBool(0==mLength);
}
/**********************************************************************
Accessor methods...
*********************************************************************/
/**
* Retrieve const ptr to internal buffer; DO NOT TRY TO FREE IT!
*/
const char* GetBuffer(void) const;
/**
* Get nth character.
*/
PRUnichar operator[](PRUint32 anIndex) const;
PRUnichar CharAt(PRUint32 anIndex) const;
PRUnichar First(void) const;
PRUnichar Last(void) const;
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
/**********************************************************************
String creation methods...
*********************************************************************/
/**
* Create a new string by appending given string to this
* @param aString -- 2nd string to be appended
* @return new string
*/
nsSubsumeCStr operator+(const nsCString& aString);
/**
* create a new string by adding this to the given char*.
* @param aCString is a ptr to cstring to be added to this
* @return newly created string
*/
nsSubsumeCStr operator+(const char* aCString);
/**
* create a new string by adding this to the given char.
* @param aChar is a char to be added to this
* @return newly created string
*/
nsSubsumeCStr operator+(PRUnichar aChar);
nsSubsumeCStr operator+(char aChar);
/**********************************************************************
Lexomorphic transforms...
*********************************************************************/
/**
* Converts chars in this to lowercase
* @update gess 7/27/98
*/
void ToLowerCase();
/**
* Converts chars in this to lowercase, and
* stores them in aOut
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToLowerCase(nsCString& aString) const;
/**
* Converts chars in this to uppercase
* @update gess 7/27/98
*/
void ToUpperCase();
/**
* Converts chars in this to lowercase, and
* stores them in a given output string
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToUpperCase(nsCString& aString) const;
/**
* This method is used to remove all occurances of the
* characters found in aSet from this string.
*
* @param aSet -- characters to be cut from this
* @return *this
*/
nsCString& StripChars(const char* aSet);
nsCString& StripChar(char aChar);
/**
* This method strips whitespace throughout the string
*
* @return this
*/
nsCString& StripWhitespace();
/**
* swaps occurence of 1 string for another
*
* @return this
*/
nsCString& ReplaceChar(PRUnichar aOldChar,PRUnichar aNewChar);
nsCString& ReplaceChar(const char* aSet,PRUnichar aNewChar);
PRInt32 CountChar(PRUnichar aChar);
/**
* This method trims characters found in aTrimSet from
* either end of the underlying string.
*
* @param aTrimSet -- contains chars to be trimmed from
* both ends
* @return this
*/
nsCString& Trim(const char* aSet,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsCString& CompressSet(const char* aSet, PRUnichar aChar,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsCString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**********************************************************************
string conversion methods...
*********************************************************************/
operator char*() {return mStr;}
operator const char*() const {return (const char*)mStr;}
/**
* This method constructs a new nsCString that is a clone
* of this string.
*
*/
nsCString* ToNewString() const;
/**
* Creates an ISOLatin1 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewCString() const;
/**
* Creates a unicode clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new unicode string
*/
PRUnichar* ToNewUnicode() const;
/**
* Copies data from internal buffer onto given char* buffer
* NOTE: This only copies as many chars as will fit in given buffer (clips)
* @param aBuf is the buffer where data is stored
* @param aBuflength is the max # of chars to move to buffer
* @return ptr to given buffer
*/
char* ToCString(char* aBuf,PRUint32 aBufLength,PRUint32 anOffset=0) const;
/**
* Perform string to float conversion.
* @param aErrorCode will contain error if one occurs
* @return float rep of string value
*/
float ToFloat(PRInt32* aErrorCode) const;
/**
* Try to derive the radix from the value contained in this string
* @return kRadix10, kRadix16 or kAutoDetect (meaning unknown)
*/
PRUint32 DetermineRadix(void);
/**
* Perform string to int conversion.
* @param aErrorCode will contain error if one occurs
* @return int rep of string value
*/
PRInt32 ToInteger(PRInt32* aErrorCode,PRUint32 aRadix=kRadix10) const;
/**********************************************************************
String manipulation methods...
*********************************************************************/
/**
* Functionally equivalent to assign or operator=
*
*/
nsCString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsCString& SetString(const nsStr& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
/**
* assign given string to this string
* @param aStr: buffer to be assigned to this
* @param alength is the length of the given str (or -1)
if you want me to determine its length
* @return this
*/
nsCString& Assign(const nsStr& aString,PRInt32 aCount=-1);
nsCString& Assign(const char* aString,PRInt32 aCount=-1);
nsCString& Assign(const PRUnichar* aString,PRInt32 aCount=-1);
nsCString& Assign(PRUnichar aChar);
nsCString& Assign(char aChar);
/**
* here come a bunch of assignment operators...
* @param aString: string to be added to this
* @return this
*/
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsCString& operator=(char aChar) {return Assign(aChar);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
nsCString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsCString& operator=(const nsSubsumeCStr& aSubsumeString); // AIX requires a const here
#else
nsCString& operator=(nsSubsumeCStr& aSubsumeString);
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsCString& operator+=(const nsCString& aString){return Append(aString,aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
nsCString& operator+=(PRUnichar aChar){return Append(aChar);}
nsCString& operator+=(char aChar){return Append(aChar);}
/*
* Appends n characters from given string to this,
* This version computes the length of your given string
*
* @param aString is the source to be appended to this
* @return number of chars copied
*/
nsCString& Append(const nsCString& aString) {return Append(aString,aString.mLength);}
/*
* Appends n characters from given string to this,
*
* @param aString is the source to be appended to this
* @param aCount -- number of chars to copy; -1 tells us to compute the strlen for you
* @return number of chars copied
*/
nsCString& Append(const nsCString& aString,PRInt32 aCount);
nsCString& Append(const nsStr& aString,PRInt32 aCount=-1);
nsCString& Append(const char* aString,PRInt32 aCount=-1);
nsCString& Append(PRUnichar aChar);
nsCString& Append(char aChar);
nsCString& Append(PRInt32 aInteger,PRInt32 aRadix=10); //radix=8,10 or 16
nsCString& Append(float aFloat);
/*
* Copies n characters from this string to given string,
* starting at the leftmost offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Left(nsCString& aCopy,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at the given offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @param anOffset -- position where copying begins
* @return number of chars copied
*/
PRUint32 Mid(nsCString& aCopy,PRUint32 anOffset,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at rightmost char.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Right(nsCString& aCopy,PRInt32 aCount) const;
/*
* This method inserts n chars from given string into this
* string at str[anOffset].
*
* @param aCopy -- String to be inserted into this
* @param anOffset -- insertion position within this str
* @param aCount -- number of chars to be copied from aCopy
* @return number of chars inserted into this.
*/
nsCString& Insert(const nsCString& aCopy,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a given string into this string at
* a specified offset.
*
* @param aString* to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsCString& Insert(const char* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a single char into this string at
* a specified offset.
*
* @param character to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsCString& Insert(PRUnichar aChar,PRUint32 anOffset);
nsCString& Insert(char aChar,PRUint32 anOffset);
/*
* This method is used to cut characters in this string
* starting at anOffset, continuing for aCount chars.
*
* @param anOffset -- start pos for cut operation
* @param aCount -- number of chars to be cut
* @return *this
*/
nsCString& Cut(PRUint32 anOffset,PRInt32 aCount);
/**********************************************************************
Searching methods...
*********************************************************************/
/**
* Search for given character within this string.
* This method does so by using a binary search,
* so your string HAD BETTER BE ORDERED!
*
* @param aChar is the unicode char to be found
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
*
* @param aString is substring to be sought in this
* @param aIgnoreCase selects case sensitivity
* @param anOffset tells us where in this strig to start searching
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 Find(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the first character
* found in the given charset
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 FindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**
* This methods scans the string backwards, looking for the given string
* @param aString is substring to be sought in this
* @param aIgnoreCase tells us whether or not to do caseless compare
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the last character
* found in the given string
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**********************************************************************
Comparison methods...
*********************************************************************/
/**
* Compares a given string type to this string.
* @update gess 7/27/98
* @param S is the string to be compared
* @param aIgnoreCase tells us how to treat case
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
virtual PRInt32 Compare(const nsStr &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
/**
* These methods compare a given string type to this one
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator==(const nsStr &aString) const;
PRBool operator==(const char* aString) const;
PRBool operator==(const PRUnichar* aString) const;
/**
* These methods perform a !compare of a given string type to this
* @param aString is the string to be compared to this
* @return TRUE
*/
PRBool operator!=(const nsStr &aString) const;
PRBool operator!=(const char* aString) const;
PRBool operator!=(const PRUnichar* aString) const;
/**
* These methods test if a given string is < than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<(const nsStr &aString) const;
PRBool operator<(const char* aString) const;
PRBool operator<(const PRUnichar* aString) const;
/**
* These methods test if a given string is > than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>(const nsStr &S) const;
PRBool operator>(const char* aString) const;
PRBool operator>(const PRUnichar* aString) const;
/**
* These methods test if a given string is <= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<=(const nsStr &S) const;
PRBool operator<=(const char* aString) const;
PRBool operator<=(const PRUnichar* aString) const;
/**
* These methods test if a given string is >= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>=(const nsStr &S) const;
PRBool operator>=(const char* aString) const;
PRBool operator>=(const PRUnichar* aString) const;
/**
* Compare this to given string; note that we compare full strings here.
* The optional length argument just lets us know how long the given string is.
* If you provide a length, it is compared to length of this string as an
* optimization.
*
* @param aString -- the string to compare to this
* @param aCount -- number of chars in given string you want to compare
* @return TRUE if equal
*/
PRBool Equals(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(const nsStr& aString) const;
PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(const PRUnichar* aString,PRInt32 aCount=-1) const;
static void Recycle(nsCString* aString);
static nsCString* CreateString(void);
};
extern NS_COM int fputs(const nsCString& aString, FILE* out);
//ostream& operator<<(ostream& aStream,const nsCString& aString);
//virtual void DebugDump(ostream& aStream) const;
/**************************************************************
Here comes the AutoString class which uses internal memory
(typically found on the stack) for its default buffer.
If the buffer needs to grow, it gets reallocated on the heap.
**************************************************************/
class NS_COM nsCAutoString : public nsCString {
public:
nsCAutoString();
nsCAutoString(const char* aString,PRInt32 aLength=-1);
nsCAutoString(const CBufDescriptor& aBuffer);
nsCAutoString(const PRUnichar* aString,PRInt32 aLength=-1);
nsCAutoString(const nsStr& aString);
nsCAutoString(const nsCAutoString& aString);
#ifdef AIX
nsCAutoString(const nsSubsumeCStr& aSubsumeStr); // AIX requires a const
#else
nsCAutoString(nsSubsumeCStr& aSubsumeStr);
#endif // AIX
nsCAutoString(PRUnichar aChar);
virtual ~nsCAutoString();
nsCAutoString& operator=(const nsCString& aString) {nsCString::Assign(aString); return *this;}
nsCAutoString& operator=(const char* aCString) {nsCString::Assign(aCString); return *this;}
nsCAutoString& operator=(PRUnichar aChar) {nsCString::Assign(aChar); return *this;}
nsCAutoString& operator=(char aChar) {nsCString::Assign(aChar); return *this;}
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
char mBuffer[kDefaultStringSize];
};
/***************************************************************
The subsumestr class is very unusual.
It differs from a normal string in that it doesn't use normal
copy semantics when another string is assign to this.
Instead, it "steals" the contents of the source string.
This is very handy for returning nsString classes as part of
an operator+(...) for example, in that it cuts down the number
of copy operations that must occur.
You should probably not use this class unless you really know
what you're doing.
***************************************************************/
class NS_COM nsSubsumeCStr : public nsCString {
public:
nsSubsumeCStr(nsStr& aString);
nsSubsumeCStr(PRUnichar* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
nsSubsumeCStr(char* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,840 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/***********************************************************************
MODULE NOTES:
See nsStr.h for a more general description of string classes.
This version of the nsString class offers many improvements over the
original version:
1. Wide and narrow chars
2. Allocators
3. Much smarter autostrings
4. Subsumable strings
***********************************************************************/
#ifndef _nsString_
#define _nsString_
#include "prtypes.h"
#include "nscore.h"
#include <stdio.h>
#include "nsString.h"
#include "nsIAtom.h"
#include "nsStr.h"
#include "nsCRT.h"
class nsISizeOfHandler;
#define nsString2 nsString
#define nsAutoString2 nsAutoString
class NS_COM nsSubsumeStr;
class NS_COM nsString : public nsStr {
public:
/**
* Default constructor.
*/
nsString();
/**
* This constructor accepts an isolatin string
* @param aCString is a ptr to a 1-byte cstr
*/
nsString(const char* aCString);
/**
* This constructor accepts a unichar string
* @param aCString is a ptr to a 2-byte cstr
*/
nsString(const PRUnichar* aString);
/**
* This is a copy constructor that accepts an nsStr
* @param reference to another nsString
*/
nsString(const nsStr&);
/**
* This is our copy constructor
* @param reference to another nsString
*/
nsString(const nsString& aString);
/**
* This constructor takes a subsumestr
* @param reference to subsumestr
*/
nsString(nsSubsumeStr& aSubsumeStr);
/**
* Destructor
*
*/
virtual ~nsString();
/**
* Retrieve the length of this string
* @return string length
*/
inline PRInt32 Length() const { return (PRInt32)mLength; }
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
/**
* Call this method if you want to force a different string length
* @update gess7/30/98
* @param aLength -- contains new length for mStr
* @return
*/
void SetLength(PRUint32 aLength) {
Truncate(aLength);
}
/**
* Sets the new length of the string.
* @param aLength is new string length.
* @return nada
*/
void SetCapacity(PRUint32 aLength);
/**
* This method truncates this string to given length.
*
* @param anIndex -- new length of string
* @return nada
*/
void Truncate(PRInt32 anIndex=0);
/**
* Determine whether or not the characters in this
* string are in sorted order.
*
* @return TRUE if ordered.
*/
PRBool IsOrdered(void) const;
/**
* Determine whether or not the characters in this
* string are in store as 1 or 2 byte (unicode) strings.
*
* @return TRUE if ordered.
*/
PRBool IsUnicode(void) const {
PRBool result=PRBool(mCharSize==eTwoByte);
return result;
}
/**
* Determine whether or not this string has a length of 0
*
* @return TRUE if empty.
*/
PRBool IsEmpty(void) const {
return PRBool(0==mLength);
}
/**********************************************************************
Getters/Setters...
*********************************************************************/
/**
* Retrieve const ptr to internal buffer; DO NOT TRY TO FREE IT!
*/
const char* GetBuffer(void) const;
const PRUnichar* GetUnicode(void) const;
/**
* Get nth character.
*/
PRUnichar operator[](PRUint32 anIndex) const;
PRUnichar CharAt(PRUint32 anIndex) const;
PRUnichar First(void) const;
PRUnichar Last(void) const;
/**
* Set nth character.
*/
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
/**********************************************************************
String concatenation methods...
*********************************************************************/
/**
* Create a new string by appending given string to this
* @param aString -- 2nd string to be appended
* @return new subsumable string
*/
nsSubsumeStr operator+(const nsStr& aString);
nsSubsumeStr operator+(const nsString& aString);
/**
* create a new string by adding this to the given cstring
* @param aCString is a ptr to cstring to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(const char* aCString);
/**
* create a new string by adding this to the given prunichar*.
* @param aString is a ptr to UC-string to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(const PRUnichar* aString);
/**
* create a new string by adding this to the given char.
* @param aChar is a char to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(char aChar);
/**
* create a new string by adding this to the given char.
* @param aChar is a unichar to be added to this
* @return newly created string
*/
nsSubsumeStr operator+(PRUnichar aChar);
/**********************************************************************
Lexomorphic transforms...
*********************************************************************/
/**
* Converts chars in this to lowercase
* @update gess 7/27/98
*/
void ToLowerCase();
/**
* Converts chars in this to lowercase, and
* stores them in aOut
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToLowerCase(nsString& aString) const;
/**
* Converts chars in this to uppercase
* @update gess 7/27/98
*/
void ToUpperCase();
/**
* Converts chars in this to lowercase, and
* stores them in a given output string
* @update gess 7/27/98
* @param aOut is a string to contain result
*/
void ToUpperCase(nsString& aString) const;
/**
* This method is used to remove all occurances of the
* characters found in aSet from this string.
*
* @param aSet -- characters to be cut from this
* @return *this
*/
nsString& StripChars(const char* aSet);
nsString& StripChar(char aChar);
/**
* This method strips whitespace throughout the string
*
* @return this
*/
nsString& StripWhitespace();
/**
* swaps occurence of 1 string for another
*
* @return this
*/
nsString& ReplaceChar(PRUnichar anOldChar,PRUnichar aNewChar);
nsString& ReplaceChar(const char* aSet,PRUnichar aNewChar);
PRInt32 CountChar(PRUnichar aChar);
/**
* This method trims characters found in aTrimSet from
* either end of the underlying string.
*
* @param aTrimSet -- contains chars to be trimmed from
* both ends
* @return this
*/
nsString& Trim(const char* aSet,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsString& CompressSet(const char* aSet, PRUnichar aChar,PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**
* This method strips whitespace from string.
* You can control whether whitespace is yanked from
* start and end of string as well.
*
* @param aEliminateLeading controls stripping of leading ws
* @param aEliminateTrailing controls stripping of trailing ws
* @return this
*/
nsString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminateTrailing=PR_TRUE);
/**********************************************************************
string conversion methods...
*********************************************************************/
/**
* This method constructs a new nsString is a clone of this string.
*
*/
nsString* ToNewString() const;
/**
* Creates an ISOLatin1 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewCString() const;
/**
* Creates an UTF8 clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new isolatin1 string
*/
char* ToNewUTF8String() const;
/**
* Creates a unicode clone of this string
* Note that calls to this method should be matched with calls to Recycle().
* @return ptr to new unicode string
*/
PRUnichar* ToNewUnicode() const;
/**
* Copies data from internal buffer onto given char* buffer
* NOTE: This only copies as many chars as will fit in given buffer (clips)
* @param aBuf is the buffer where data is stored
* @param aBuflength is the max # of chars to move to buffer
* @return ptr to given buffer
*/
char* ToCString(char* aBuf,PRUint32 aBufLength,PRUint32 anOffset=0) const;
/**
* Perform string to float conversion.
* @param aErrorCode will contain error if one occurs
* @return float rep of string value
*/
float ToFloat(PRInt32* aErrorCode) const;
/**
* Try to derive the radix from the value contained in this string
* @return kRadix10, kRadix16 or kAutoDetect (meaning unknown)
*/
PRUint32 DetermineRadix(void);
/**
* Perform string to int conversion.
* @param aErrorCode will contain error if one occurs
* @return int rep of string value
*/
PRInt32 ToInteger(PRInt32* aErrorCode,PRUint32 aRadix=kRadix10) const;
/**********************************************************************
String manipulation methods...
*********************************************************************/
/**
* Functionally equivalent to assign or operator=
*
*/
nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);}
/**
* assign given string to this string
* @param aStr: buffer to be assigned to this
* @param alength is the length of the given str (or -1)
if you want me to determine its length
* @return this
*/
nsString& Assign(const nsStr& aString,PRInt32 aCount=-1);
nsString& Assign(const char* aString,PRInt32 aCount=-1);
nsString& Assign(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Assign(char aChar);
nsString& Assign(PRUnichar aChar);
/**
* here come a bunch of assignment operators...
* @param aString: string to be added to this
* @return this
*/
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(char aChar) {return Assign(aChar);}
nsString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsString& operator=(const char* aCString) {return Assign(aCString);}
nsString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsString& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here
#else
nsString& operator=(nsSubsumeStr& aSubsumeString);
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsString& operator+=(const nsStr& aString){return Append(aString,aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,aString.mLength);}
nsString& operator+=(const char* aCString) {return Append(aCString);}
//nsString& operator+=(char aChar){return Append(aChar);}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
nsString& operator+=(PRUnichar aChar){return Append(aChar);}
/*
* Appends n characters from given string to this,
* This version computes the length of your given string
*
* @param aString is the source to be appended to this
* @return number of chars copied
*/
nsString& Append(const nsStr& aString) {return Append(aString,aString.mLength);}
nsString& Append(const nsString& aString) {return Append(aString,aString.mLength);}
/*
* Appends n characters from given string to this,
*
* @param aString is the source to be appended to this
* @param aCount -- number of chars to copy; -1 tells us to compute the strlen for you
* @return number of chars copied
*/
nsString& Append(const nsStr& aString,PRInt32 aCount);
nsString& Append(const nsString& aString,PRInt32 aCount);
nsString& Append(const char* aString,PRInt32 aCount=-1);
nsString& Append(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Append(char aChar);
nsString& Append(PRUnichar aChar);
nsString& Append(PRInt32 aInteger,PRInt32 aRadix=10); //radix=8,10 or 16
nsString& Append(float aFloat);
/*
* Copies n characters from this string to given string,
* starting at the leftmost offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Left(nsString& aCopy,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at the given offset.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @param anOffset -- position where copying begins
* @return number of chars copied
*/
PRUint32 Mid(nsString& aCopy,PRUint32 anOffset,PRInt32 aCount) const;
/*
* Copies n characters from this string to given string,
* starting at rightmost char.
*
*
* @param aCopy -- Receiving string
* @param aCount -- number of chars to copy
* @return number of chars copied
*/
PRUint32 Right(nsString& aCopy,PRInt32 aCount) const;
/*
* This method inserts n chars from given string into this
* string at str[anOffset].
*
* @param aCopy -- String to be inserted into this
* @param anOffset -- insertion position within this str
* @param aCount -- number of chars to be copied from aCopy
* @return number of chars inserted into this.
*/
nsString& Insert(const nsString& aCopy,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a given string into this string at
* a specified offset.
*
* @param aString* to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
nsString& Insert(const char* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
nsString& Insert(const PRUnichar* aChar,PRUint32 anOffset,PRInt32 aCount=-1);
/**
* Insert a single char into this string at
* a specified offset.
*
* @param character to be inserted into this string
* @param anOffset is insert pos in str
* @return the number of chars inserted into this string
*/
//nsString& Insert(char aChar,PRUint32 anOffset);
nsString& Insert(PRUnichar aChar,PRUint32 anOffset);
/*
* This method is used to cut characters in this string
* starting at anOffset, continuing for aCount chars.
*
* @param anOffset -- start pos for cut operation
* @param aCount -- number of chars to be cut
* @return *this
*/
nsString& Cut(PRUint32 anOffset,PRInt32 aCount);
/**********************************************************************
Searching methods...
*********************************************************************/
/**
* Search for given character within this string.
* This method does so by using a binary search,
* so your string HAD BETTER BE ORDERED!
*
* @param aChar is the unicode char to be found
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
*
* @param aString is substring to be sought in this
* @param aIgnoreCase selects case sensitivity
* @param anOffset tells us where in this strig to start searching
* @return offset in string, or -1 (kNotFound)
*/
PRInt32 Find(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
//PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const;
PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the first character
* found in the given charset
* @param aString contains set of chars to be found
* @param anOffset tells us where to start searching in this
* @return -1 if not found, else the offset in this
*/
PRInt32 FindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**
* This methods scans the string backwards, looking for the given string
* @param aString is substring to be sought in this
* @param aIgnoreCase tells us whether or not to do caseless compare
* @param anOffset tells us where in this strig to start searching (counting from left)
*/
PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* Search for given char within this string
*
* @param aString is substring to be sought in this
* @param anOffset tells us where in this strig to start searching (counting from left)
* @param aIgnoreCase selects case sensitivity
* @return find pos in string, or -1 (kNotFound)
*/
//PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const;
PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const;
/**
* This method searches this string for the last character
* found in the given string
* @param aString contains set of chars to be found
* @param anOffset tells us where in this strig to start searching (counting from left)
* @return -1 if not found, else the offset in this
*/
PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const PRUnichar* aString,PRInt32 anOffset=-1) const;
PRInt32 RFindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const;
/**********************************************************************
Comparison methods...
*********************************************************************/
/**
* Compares a given string type to this string.
* @update gess 7/27/98
* @param S is the string to be compared
* @param aIgnoreCase tells us how to treat case
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
virtual PRInt32 Compare(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const nsStr &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
virtual PRInt32 Compare(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
/**
* These methods compare a given string type to this one
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator==(const nsString &aString) const;
PRBool operator==(const nsStr &aString) const;
PRBool operator==(const char *aString) const;
PRBool operator==(const PRUnichar* aString) const;
/**
* These methods perform a !compare of a given string type to this
* @param aString is the string to be compared to this
* @return TRUE
*/
PRBool operator!=(const nsString &aString) const;
PRBool operator!=(const nsStr &aString) const;
PRBool operator!=(const char* aString) const;
PRBool operator!=(const PRUnichar* aString) const;
/**
* These methods test if a given string is < than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<(const nsString &aString) const;
PRBool operator<(const nsStr &aString) const;
PRBool operator<(const char* aString) const;
PRBool operator<(const PRUnichar* aString) const;
/**
* These methods test if a given string is > than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>(const nsString &aString) const;
PRBool operator>(const nsStr &S) const;
PRBool operator>(const char* aString) const;
PRBool operator>(const PRUnichar* aString) const;
/**
* These methods test if a given string is <= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator<=(const nsString &aString) const;
PRBool operator<=(const nsStr &S) const;
PRBool operator<=(const char* aString) const;
PRBool operator<=(const PRUnichar* aString) const;
/**
* These methods test if a given string is >= than this
* @param aString is the string to be compared to this
* @return TRUE or FALSE
*/
PRBool operator>=(const nsString &aString) const;
PRBool operator>=(const nsStr &S) const;
PRBool operator>=(const char* aString) const;
PRBool operator>=(const PRUnichar* aString) const;
/**
* Compare this to given string; note that we compare full strings here.
* The optional length argument just lets us know how long the given string is.
* If you provide a length, it is compared to length of this string as an
* optimization.
*
* @param aString -- the string to compare to this
* @param aCount -- number of chars to be compared.
* @return TRUE if equal
*/
PRBool Equals(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const;
PRBool Equals(const PRUnichar* s1, const PRUnichar* s2,PRBool aIgnoreCase=PR_FALSE) const;
PRBool EqualsIgnoreCase(const nsString& aString) const;
PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const;
PRBool EqualsIgnoreCase(/*FIX: const */nsIAtom *aAtom) const;
PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const;
/**
* Determine if given buffer is plain ascii
*
* @param aBuffer -- if null, then we test *this, otherwise we test given buffer
* @return TRUE if is all ascii chars or if strlen==0
*/
PRBool IsASCII(const PRUnichar* aBuffer=0);
/**
* Determine if given char is a valid space character
*
* @param aChar is character to be tested
* @return TRUE if is valid space char
*/
static PRBool IsSpace(PRUnichar ch);
/**
* Determine if given char in valid alpha range
*
* @param aChar is character to be tested
* @return TRUE if in alpha range
*/
static PRBool IsAlpha(PRUnichar ch);
/**
* Determine if given char is valid digit
*
* @param aChar is character to be tested
* @return TRUE if char is a valid digit
*/
static PRBool IsDigit(PRUnichar ch);
static void Recycle(nsString* aString);
static nsString* CreateString(void);
};
extern NS_COM int fputs(const nsString& aString, FILE* out);
//ostream& operator<<(ostream& aStream,const nsString& aString);
//virtual void DebugDump(ostream& aStream) const;
/**************************************************************
Here comes the AutoString class which uses internal memory
(typically found on the stack) for its default buffer.
If the buffer needs to grow, it gets reallocated on the heap.
**************************************************************/
class NS_COM nsAutoString : public nsString {
public:
nsAutoString();
nsAutoString(const char* aCString,PRInt32 aLength=-1);
nsAutoString(const PRUnichar* aString,PRInt32 aLength=-1);
nsAutoString(const CBufDescriptor& aBuffer);
nsAutoString(const nsStr& aString);
nsAutoString(const nsAutoString& aString);
#ifdef AIX
nsAutoString(const nsSubsumeStr& aSubsumeStr); // AIX requires a const
#else
nsAutoString(nsSubsumeStr& aSubsumeStr);
#endif // AIX
nsAutoString(PRUnichar aChar);
virtual ~nsAutoString();
nsAutoString& operator=(const nsStr& aString) {nsString::Assign(aString); return *this;}
nsAutoString& operator=(const nsAutoString& aString) {nsString::Assign(aString); return *this;}
nsAutoString& operator=(const char* aCString) {nsString::Assign(aCString); return *this;}
nsAutoString& operator=(char aChar) {nsString::Assign(aChar); return *this;}
nsAutoString& operator=(const PRUnichar* aBuffer) {nsString::Assign(aBuffer); return *this;}
nsAutoString& operator=(PRUnichar aChar) {nsString::Assign(aChar); return *this;}
/**
* Retrieve the size of this string
* @return string length
*/
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
char mBuffer[kDefaultStringSize<<eTwoByte];
};
/***************************************************************
The subsumestr class is very unusual.
It differs from a normal string in that it doesn't use normal
copy semantics when another string is assign to this.
Instead, it "steals" the contents of the source string.
This is very handy for returning nsString classes as part of
an operator+(...) for example, in that it cuts down the number
of copy operations that must occur.
You should probably not use this class unless you really know
what you're doing.
***************************************************************/
class NS_COM nsSubsumeStr : public nsString {
public:
nsSubsumeStr(nsStr& aString);
nsSubsumeStr(PRUnichar* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
nsSubsumeStr(char* aString,PRBool assumeOwnership,PRInt32 aLength=-1);
};
#endif

View File

@@ -1,551 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsStringTokenizer.h"
nsStringTokenizer::nsStringTokenizer(const char* aFieldSep,const char* aRecordSep) :
mDataStartDelimiter(""),
mDataEndDelimiter(""),
mSubstrStartDelimiter(""),
mSubstrEndDelimiter(""),
mFieldSeparator(aFieldSep),
mRecordSeparator(aRecordSep)
{
mBuffer=0;
mOffset=0;
mValidChars[0]=mValidChars[1]=mValidChars[2]=mValidChars[3]=0;
mInvalidChars[0]=mInvalidChars[1]=mInvalidChars[2]=mInvalidChars[3]=0;
mCharSpec=eGivenChars;
}
nsStringTokenizer::~nsStringTokenizer(){
}
/**
* This method can tell you whether a given char is in the valid set
* given by the user in the constructor
* @update gess7/10/99
*/
void nsStringTokenizer::SetBuffer(nsString& aBuffer) {
mBuffer=&aBuffer;
}
/**
* Call this to add a token specifier to this tokenizer.
* Ultimately -- this method will be callable any number of times
* so that you can have multiple token types.
*
* @update gess7/10/99
*/
void nsStringTokenizer::AddTokenSpec(const char* aTokenSpec) {
if(aTokenSpec) {
ExpandDataSpecifier(aTokenSpec);
}
}
/**
* This method can tell you whether a given char is in the valid set
* given by the user in the constructor
* @update gess7/10/99
*/
inline PRBool nsStringTokenizer::IsValidDataChar(PRUnichar aChar) {
PRBool result=PR_FALSE;
switch(mCharSpec) {
case eGivenChars:
{
PRInt32 theByteNum=aChar/32;
PRInt32 theBitNum=aChar-(theByteNum*32);
PRInt32 shift=(1<<theBitNum);
PRInt32 value=PRInt32(mValidChars[theByteNum]&shift);
result=PRBool(value>0);
}
break;
case eAllChars:
result=PR_TRUE;
break;
case eExceptChars:
break;
}
return result;
}
inline void SetChars(PRInt32 array[3],PRUnichar aStart,PRUnichar aStop){
PRInt32 theChar;
for(theChar=aStart;theChar<=aStop;theChar++){
PRInt32 theByteNum=theChar/32;
PRInt32 theBitNum=theChar-(theByteNum*32);
PRInt32 shift=(1<<theBitNum);
array[theByteNum]|=shift;
}
}
inline void ClearChars(PRInt32 array[3],PRUnichar aStart,PRUnichar aStop){
PRInt32 theChar;
for(theChar=aStart;theChar<=aStop;theChar++){
PRInt32 theByteNum=theChar/32;
PRInt32 theBitNum=theChar-(theByteNum*32);
PRInt32 shift=(1<<theBitNum);
array[theByteNum]&=(~shift);
}
}
/**
* This method constructs the legal charset and data delimiter pairs.
* Specifier rules are:
* abc -- allows a set of characters
* [a-z] -- allows all chars in given range
* [*-*] -- allows all characters
* ^abc -- disallows a set of characters
* [a^z] -- disallows all characters in given range
* [a*b] -- specifies a delimiter pair for the entire token
* [a+b] -- specifies a delimiter pair for substrings in the token
* @update gess7/10/99
*/
void nsStringTokenizer::ExpandDataSpecifier(const char* aDataSpec) {
if(aDataSpec) {
PRInt32 theIndex=-1;
char theChar=0;
while(theChar=aDataSpec[++theIndex]) {
switch(theChar) {
case '[':
switch(aDataSpec[theIndex+2]){
case '-':
{
char theStart=aDataSpec[theIndex+1];
char theEnd=aDataSpec[theIndex+3];
if(('*'==theStart) && (theStart==theEnd)) {
mCharSpec=eAllChars;
}
else {
SetChars(mValidChars,theStart,theEnd);
}
}
break;
case '^': //specify a range of invalid chars
{
char theStart=aDataSpec[theIndex+1];
char theEnd=aDataSpec[theIndex+3];
SetChars(mInvalidChars,theStart,theEnd);
}
break;
case '*': //this char signals a delimiter pair
mDataStartDelimiter+=aDataSpec[theIndex+1];
mDataEndDelimiter+=aDataSpec[theIndex+3];
break;
case '+': //this char signals a delimiter pair for substrings
mSubstrStartDelimiter+=aDataSpec[theIndex+1];
mSubstrEndDelimiter+=aDataSpec[theIndex+3];
break;
default:
break;
}
theIndex+=4;
break;
case '^'://they've given us a list (not a range) of invalid chars
{
while(theChar=aDataSpec[++theIndex]) {
if('['!=theChar) {
SetChars(mInvalidChars,theChar,theChar);
}
else {
--theIndex;
break;
}
}
}
break;
default:
SetChars(mValidChars,theChar,theChar);
break;
}//switch
}
}
/* DEBUG CODE TO SHOW STRING OF GIVEN CHARSET
CAutoString temp;
for(PRInt32 theChar=0;theChar<128;theChar++){
if(IsValidDataChar(theChar))
temp+=theChar;
}
PRInt32 x=10;
*/
}
nsStringTokenizer::eCharTypes nsStringTokenizer::DetermineCharType(PRUnichar ch) {
eCharTypes result=eUnknown;
if(mRecordSeparator[0]==ch)
result=eRecordSeparator;
else if(mFieldSeparator[0]==ch)
result=eFieldSeparator;
else if((mDataStartDelimiter[0]==ch) || (mDataEndDelimiter[0]==ch))
result=eDataDelimiter;
else if(IsValidDataChar(ch))
result=eDataChar;
return result;
}
/**
* Moves the input stream to the start of the file.
* @update gess7/25/98
* @return yes if all is well
*/
PRBool nsStringTokenizer::FirstRecord(void){
mOffset=0;
return PRBool(mBuffer!=0);
}
/**
* Seeks to next record
* @update gess7/25/98
* @return PR_TRUE if there IS a next record
*/
PRBool nsStringTokenizer::NextRecord(void){
PRBool result=PR_FALSE;
if(mBuffer) {
PRInt32 status=SkipOver(mRecordSeparator);
if(NS_OK==status) {
if(SkipToValidData()) {
if(NS_OK==status) {
result=HasNextToken();
}
}
else result=PR_FALSE;
}
}
return result;
}
/*
* LAST MODS: gess 12Aug94
* PARMS: «»
* RETURNS: YES if there is another field to be read.
* PURPOSE: Allows a client to ask the io system to test for
the presence of another field.
*/
PRBool nsStringTokenizer::HasNextToken(void){
PRBool result=PR_FALSE;
if(mBuffer){
while(More()) {
//Now go test to see if there is any other field data in this record.
//The appropriate algorithm here is to scan the file until you
//find one of following things occurs:
// 1. You find a field separator
// 2. You find a record separator
// 3. You hit the end of the file
// 4. You find a valid char.
PRUnichar theChar;
GetChar(theChar);
switch(DetermineCharType(theChar)){
case eUnknown: //ok to skip junk between delimiters...
if(-1<mSubstrStartDelimiter.Find(theChar)) {
break;
}
case eDataChar:
if(kSpace<theChar) {
UnGetChar(theChar);
return PR_TRUE;
}
break;
case eDataDelimiter:
UnGetChar(theChar);
return PR_TRUE;
case eFieldSeparator:
SkipOver(mFieldSeparator[0]);
return PR_TRUE;
case eRecordSeparator:
UnGetChar(theChar);
return PR_FALSE;
default:
return PR_FALSE;
}
}
}//if
return result;
}
/**
* LAST MODS: gess 4Jul94
* PARMS:
* RETURNS: error code; 0 means all is well.
* PURPOSE: Gets the next field of data from the stream.
* NOTES: This does not currently handle fields that have
field delimiters (ie quotes).
* WARNING: You should have called HasNextToken prior
to calling this method, so that you can
fail gracefully if you encounter the end
of your input stream (unexpectedly). If
this method hits EOF, it returns an error.
*/
PRInt32 nsStringTokenizer::GetNextToken(nsString& aToken){
PRInt32 result=0;
if(mBuffer && More()) {
PRUnichar theChar;
if(mDataStartDelimiter.Length()) {
result=GetChar(theChar); //skip delimiter...
if(mFieldSeparator[0]==theChar)
return result;
aToken+=theChar;
}
if(NS_OK==result) {
PRUnichar theTerm[]={mFieldSeparator[0],mRecordSeparator[0],0,0};
if(mDataEndDelimiter.Length()) {
theTerm[2]=mDataEndDelimiter[0];
}
nsAutoString terms(mRecordSeparator);
terms+=mFieldSeparator;
result=ReadUntil(aToken,terms,PRBool(0!=mDataEndDelimiter[0]));
if(NS_OK==result) {
PRInt32 status=SkipOver(mFieldSeparator[0]);
}
}
}
return result;
}
/*
* This method gets called when the system wants to jump over any garbage before that may be in a
* string. Typically, this happens before, inbetween and after valid data rows.
*
* LAST MODS: gess 11Aug94
* RETURNS: 0 if all is well; non-zero for error. If you hit EOF, return 0.
*/
PRBool nsStringTokenizer::SkipToValidData(void){
PRInt32 result=0;
PRUnichar ch;
if(mBuffer) {
while(More()) {
result=GetChar(ch);
switch(DetermineCharType(ch)){
case eDataChar:
if(!mDataStartDelimiter[0]) {
UnGetChar(ch);
return PR_TRUE;
}
break;
case eDataDelimiter:
if(ch==mDataStartDelimiter[0]) {
UnGetChar(ch);
return PR_TRUE;
}
break;
case eFieldSeparator:
case eRecordSeparator:
UnGetChar(ch);
return PR_TRUE;
default:
break;
} //switch
} //while
}//if
return PR_FALSE;
}
PRInt32 nsStringTokenizer::SkipOver(PRUnichar aSkipChar) {
PRUnichar theChar=0;
PRInt32 result=NS_OK;
if(mBuffer) {
while(NS_OK==result) {
result=GetChar(theChar);
if(NS_OK == result) {
if(theChar!=aSkipChar) {
UnGetChar(theChar);
break;
}
}
else break;
} //while
}//if
return result;
}
PRInt32 nsStringTokenizer::SkipOver(nsString& aString) {
PRUnichar theChar=0;
PRInt32 result=NS_OK;
if(mBuffer) {
while(NS_OK==result) {
result=GetChar(theChar);
if(NS_OK == result) {
PRInt32 index=aString.Find(theChar);
if(-1==index) {
UnGetChar(theChar);
break;
}
}
else break;
} //while
} //if
return result;
}
PRInt32 nsStringTokenizer::ReadUntil(nsString& aString,nsString& aTermSet,PRBool addTerminal){
PRInt32 result=NS_OK;
PRUnichar theChar=0;
PRBool theCharIsValid;
if(mBuffer) {
while(NS_OK == result) {
result=GetChar(theChar);
if(NS_OK==result) {
PRBool found=PR_FALSE;
PRInt32 index=aTermSet.Find(theChar);
if(kNotFound<index)
found=PR_TRUE;
if(found) {
if(addTerminal)
aString+=theChar;
else UnGetChar(theChar);
break;
}
else {
PRInt32 pos=mSubstrStartDelimiter.Find(theChar);
if(-1<pos) {
aString+=theChar;
result=ReadUntil(aString,mSubstrEndDelimiter[pos],PR_TRUE);
}
else if(theCharIsValid){
if(IsValidDataChar(theChar)){
aString+=theChar;
}
else theCharIsValid=PR_FALSE;
}
} //else
} //if
} //while
}//if
return result;
}
PRInt32 nsStringTokenizer::ReadUntil(nsString& aString,PRUnichar aTerminalChar,PRBool addTerminal){
PRInt32 result=NS_OK;
PRUnichar theChar=0;
if(mBuffer) {
while(NS_OK == result) {
result=GetChar(theChar);
if(NS_OK==result) {
if(theChar==aTerminalChar){
if(addTerminal)
aString+=theChar;
else UnGetChar(theChar);
break;
}
else aString+=theChar;
}//if
} //while
}//if
return result;
}
PRBool nsStringTokenizer::More(void){
PRBool result=PR_FALSE;
if(mBuffer) {
if(mOffset<mBuffer->Length())
result=PR_TRUE;
}
return result;
}
PRInt32 nsStringTokenizer::GetChar(PRUnichar& aChar){
PRInt32 result=kEOF;
if(mBuffer) {
if(mOffset<mBuffer->Length()) {
aChar=(*mBuffer)[mOffset++];
result=0;
}
}
return result;
}
void nsStringTokenizer::UnGetChar(PRUnichar aChar){
if(mOffset>0)
mOffset--;
}
/*
* Call this method if you want the tokenizer to iterate your string
* and automatically call you back with each token
*
* @parm aFunctor is the object you want me to notify
* @update gess 07/10/99
* RETURNS: 0 if all went well
*/
PRInt32 nsStringTokenizer::Iterate(nsString& aBuffer,ITokenizeFunctor& aFunctor) {
PRInt32 result=0;
PRInt32 theRecordNum=-1;
nsString* theOldBuffer=mBuffer;
mBuffer=&aBuffer;
FirstRecord();
while(HasNextToken()){
theRecordNum++;
PRInt32 theTokenNum=-1;
while(HasNextToken()){
theTokenNum++;
nsAutoString theString;
GetNextToken(theString);
aFunctor(theString,theRecordNum,theTokenNum);
}
NextRecord();
}
mBuffer=theOldBuffer;
return result;
}

View File

@@ -1,146 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/**
* MODULE NOTES:
* @update gess 4/1/98
*
* This class knows how to read delimited data from a string.
* Here are the 2 things you need to know to use this class effectively:
*
* ================================================
* How To Setup The Tokenizer
* ================================================
*
* The input charset can be either constrained or uncontrained. Constrained means
* that you've chosen to allow only certain chars into your tokens. Unconstrained
* means that any char (other than delimiters) are legal in your tokens.
* If you want unconstrained input, use [*-*] your dataspec. To contrain your token
* charset, you set ranges or single chars in the dataspec like this:
* "abc[0-9]" -- which allow numbers and the letters a,b,c
*
* Dataspecifier rules:
* abc -- allows a set of characters
* [a-z] -- allows all chars in given range
* [*-*] -- allows all characters
* ^abc -- disallows a set of characters //NOT_YET_IMPLEMENTED
* [a^z] -- disallows all characters in given range //NOT_YET_IMPLEMENTED
* [a*b] -- specifies a delimiter pair for the entire token
* [a+b] -- specifies a delimiter pair for substrings in the token
*
* One other note: there is an optional argument called allowQuoting, which tells
* the tokenizer whether to allow quoted strings within your fields. If you set this
* to TRUE, then we allow nested quoted strings, which themselves can contain any data.
* It's considered an error to set allowQuoting=TRUE and use a quote as a token or record delimiter.
*
* The other thing you need to set up for the tokenizer to work correctly are the delimiters.
* They seperate fields and records, and be different. You can also have more than one kind
* of delimiter for each. The distinguishment between tokens are records allows the caller
* to deal with multi-line text files (where \n is the record seperator). Again, you don't have
* to have a record seperator if it doesn't make sense in the context of your input dataset.
*
*
* ================================================
* How To Iterate Tokens
* ================================================
*
* There are 2 ways to iterate tokens, either manually or automatically.
* The manual method requires that you call a set of methods in the right order,
* but gives you slightly more control. Here's the calling pattern:
*
* {
* nsString theBuffer("xxxxxxx");
* nsStringTokenizer tok(...);
* tok.SetBuffer(theBuffer);
* tok.FirstRecord();
* while(tok.HasNextToken()){
* while(tok.HasNextToken()){
* nsAutoString theToken;
* tok.GetNextToken(theToken);
* //do something with your token here...
* } //while
* tok.NextRecord();
* } //while
* }
*
* The automatic method handles all the iteration for you. You provide a callback functor
* and you'll get called once for each token per record. To use that technique, you need
* to define an object that provides the ITokenizeFunctor interface (1 method). Then
* call the tokenizer method Iterate(...). Voila.
*
*/
#ifndef nsStringTokenizer_
#define nsStringTokenizer_
#include "nsString.h"
class ITokenizeFunctor {
public:
virtual operator ()(nsString& aToken,PRInt32 aRecordCount,PRInt32 aTokenCount)=0;
};
class nsStringTokenizer {
public:
nsStringTokenizer(const char* aFieldSep=",",const char* aRecordSep="\n");
~nsStringTokenizer();
//Call these methods if you want to iterate the tokens yourself
void SetBuffer(nsString& aBuffer);
void AddTokenSpec(const char* aTokenSpec="");
PRBool FirstRecord(void);
PRBool NextRecord(void);
PRBool HasNextToken(void);
PRInt32 GetNextToken(nsString& aToken);
//Call this one (exclusively) if you want to be called back iteratively
PRInt32 Iterate(nsString& aBuffer,ITokenizeFunctor& aFunctor);
protected:
enum eCharTypes {eUnknown,eDataChar,eFieldSeparator,eDataDelimiter,eRecordSeparator};
enum eCharSpec {eGivenChars,eAllChars,eExceptChars};
PRInt32 SkipOver(nsString& aSkipSet);
PRInt32 SkipOver(PRUnichar aSkipChar);
PRInt32 ReadUntil(nsString& aString,nsString& aTermSet,PRBool aState);
PRInt32 ReadUntil(nsString& aString,PRUnichar aChar,PRBool aState);
PRBool More(void);
PRInt32 GetChar(PRUnichar& aChar);
void UnGetChar(PRUnichar aChar);
PRBool SkipToValidData(void);
void ExpandDataSpecifier(const char* aDataSpec) ;
inline PRBool IsValidDataChar(PRUnichar aChar);
eCharTypes DetermineCharType(PRUnichar aChar);
PRInt32 mValidChars[4];
PRInt32 mInvalidChars[4];
nsString mDataStartDelimiter;
nsString mDataEndDelimiter;
nsString mSubstrStartDelimiter;
nsString mSubstrEndDelimiter;
nsString mFieldSeparator;
nsString mRecordSeparator;
PRInt32 mOffset;
eCharSpec mCharSpec;
nsString* mBuffer;
};
#endif

View File

@@ -1,388 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsSupportsArray.h"
#include "nsSupportsArrayEnumerator.h"
#include <string.h>
static const PRUint32 kGrowArrayBy = 8;
nsSupportsArray::nsSupportsArray()
{
NS_INIT_REFCNT();
mArray = &(mAutoArray[0]);
mArraySize = kAutoArraySize;
mCount = 0;
}
nsSupportsArray::~nsSupportsArray()
{
DeleteArray();
}
NS_METHOD
nsSupportsArray::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
nsSupportsArray *it = new nsSupportsArray();
if (it == NULL)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = it->QueryInterface(aIID, aResult);
NS_RELEASE(it);
return rv;
}
NS_IMPL_ISUPPORTS1(nsSupportsArray, nsISupportsArray)
void nsSupportsArray::DeleteArray(void)
{
Clear();
if (mArray != &(mAutoArray[0])) {
delete[] mArray;
mArray = &(mAutoArray[0]);
mArraySize = kAutoArraySize;
}
}
#if 0
NS_IMETHODIMP_(nsISupportsArray&)
nsISupportsArray::operator=(const nsISupportsArray& other)
{
NS_ASSERTION(0, "should be an abstract method");
return *this; // bogus
}
#endif
NS_IMETHODIMP_(nsISupportsArray&)
nsSupportsArray::operator=(nsISupportsArray const& aOther)
{
PRUint32 otherCount = 0;
nsresult rv = ((nsISupportsArray&)aOther).Count(&otherCount);
NS_ASSERTION(NS_SUCCEEDED(rv), "this method should return an error!");
if (NS_FAILED(rv)) return *this;
if (otherCount > mArraySize) {
DeleteArray();
mArraySize = otherCount;
mArray = new nsISupports*[mArraySize];
}
else {
Clear();
}
mCount = otherCount;
while (0 < otherCount--) {
mArray[otherCount] = ((nsISupportsArray&)aOther).ElementAt(otherCount);
}
return *this;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::Equals(const nsISupportsArray* aOther)
{
if (0 != aOther) {
const nsSupportsArray* other = (const nsSupportsArray*)aOther;
if (mCount == other->mCount) {
PRUint32 aIndex = mCount;
while (0 < aIndex--) {
if (mArray[aIndex] != other->mArray[aIndex]) {
return PR_FALSE;
}
}
return PR_TRUE;
}
}
return PR_FALSE;
}
NS_IMETHODIMP_(nsISupports*)
nsSupportsArray::ElementAt(PRUint32 aIndex)
{
if (aIndex < mCount) {
nsISupports* element = mArray[aIndex];
NS_ADDREF(element);
return element;
}
return 0;
}
NS_IMETHODIMP_(PRInt32)
nsSupportsArray::IndexOf(const nsISupports* aPossibleElement)
{
return IndexOfStartingAt(aPossibleElement, 0);
}
NS_IMETHODIMP_(PRInt32)
nsSupportsArray::IndexOfStartingAt(const nsISupports* aPossibleElement,
PRUint32 aStartIndex)
{
if (aStartIndex < mCount) {
const nsISupports** start = (const nsISupports**)mArray; // work around goofy compiler behavior
const nsISupports** ep = (start + aStartIndex);
const nsISupports** end = (start + mCount);
while (ep < end) {
if (aPossibleElement == *ep) {
return (ep - start);
}
ep++;
}
}
return -1;
}
NS_IMETHODIMP_(PRInt32)
nsSupportsArray::LastIndexOf(const nsISupports* aPossibleElement)
{
if (0 < mCount) {
const nsISupports** start = (const nsISupports**)mArray; // work around goofy compiler behavior
const nsISupports** ep = (start + mCount);
while (start <= --ep) {
if (aPossibleElement == *ep) {
return (ep - start);
}
}
}
return -1;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::InsertElementAt(nsISupports* aElement, PRUint32 aIndex)
{
if (!aElement) {
return PR_FALSE;
}
if (aIndex <= mCount) {
if (mArraySize < (mCount + 1)) { // need to grow the array
mArraySize += kGrowArrayBy;
nsISupports** oldArray = mArray;
mArray = new nsISupports*[mArraySize];
if (0 == mArray) { // ran out of memory
mArray = oldArray;
mArraySize -= kGrowArrayBy;
return PR_FALSE;
}
if (0 != oldArray) { // need to move old data
if (0 < aIndex) {
::memcpy(mArray, oldArray, aIndex * sizeof(nsISupports*));
}
PRUint32 slide = (mCount - aIndex);
if (0 < slide) {
::memcpy(mArray + aIndex + 1, oldArray + aIndex, slide * sizeof(nsISupports*));
}
if (oldArray != &(mAutoArray[0])) {
delete[] oldArray;
}
}
}
else {
PRUint32 slide = (mCount - aIndex);
if (0 < slide) {
::memmove(mArray + aIndex + 1, mArray + aIndex, slide * sizeof(nsISupports*));
}
}
mArray[aIndex] = aElement;
NS_ADDREF(aElement);
mCount++;
return PR_TRUE;
}
return PR_FALSE;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::ReplaceElementAt(nsISupports* aElement, PRUint32 aIndex)
{
if (aIndex < mCount) {
NS_ADDREF(aElement); // addref first in case it's the same object!
NS_RELEASE(mArray[aIndex]);
mArray[aIndex] = aElement;
return PR_TRUE;
}
return PR_FALSE;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::RemoveElementAt(PRUint32 aIndex)
{
if (aIndex < mCount) {
NS_RELEASE(mArray[aIndex]);
mCount--;
PRInt32 slide = (mCount - aIndex);
if (0 < slide) {
::memmove(mArray + aIndex, mArray + aIndex + 1,
slide * sizeof(nsISupports*));
}
return PR_TRUE;
}
return PR_FALSE;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::RemoveElement(const nsISupports* aElement, PRUint32 aStartIndex)
{
if (aStartIndex < mCount) {
nsISupports** ep = mArray;
nsISupports** end = ep + mCount;
while (ep < end) {
if (*ep == aElement) {
return RemoveElementAt(PRUint32(ep - mArray));
}
ep++;
}
}
return PR_FALSE;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::RemoveLastElement(const nsISupports* aElement)
{
if (0 < mCount) {
nsISupports** ep = (mArray + mCount);
while (mArray <= --ep) {
if (*ep == aElement) {
return RemoveElementAt(PRUint32(ep - mArray));
}
}
}
return PR_FALSE;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::AppendElements(nsISupportsArray* aElements)
{
nsSupportsArray* elements = (nsSupportsArray*)aElements;
if (elements && (0 < elements->mCount)) {
if (mArraySize < (mCount + elements->mCount)) { // need to grow the array
PRUint32 count = mCount + elements->mCount;
PRUint32 oldSize = mArraySize;
while (mArraySize < count) { // ick
mArraySize += kGrowArrayBy;
}
nsISupports** oldArray = mArray;
mArray = new nsISupports*[mArraySize];
if (0 == mArray) { // ran out of memory
mArray = oldArray;
mArraySize = oldSize;
return PR_FALSE;
}
if (0 != oldArray) { // need to move old data
if (0 < mCount) {
::memcpy(mArray, oldArray, mCount * sizeof(nsISupports*));
}
if (oldArray != &(mAutoArray[0])) {
delete[] oldArray;
}
}
}
PRUint32 aIndex = 0;
while (aIndex < elements->mCount) {
NS_ADDREF(elements->mArray[aIndex]);
mArray[mCount++] = elements->mArray[aIndex++];
}
return PR_TRUE;
}
return PR_FALSE;
}
NS_IMETHODIMP
nsSupportsArray::Clear(void)
{
if (0 < mCount) {
do {
--mCount;
NS_RELEASE(mArray[mCount]);
} while (0 != mCount);
}
return NS_OK;
}
NS_IMETHODIMP
nsSupportsArray::Compact(void)
{
if ((mArraySize != mCount) && (kAutoArraySize < mArraySize)) {
nsISupports** oldArray = mArray;
PRUint32 oldArraySize = mArraySize;
if (mCount <= kAutoArraySize) {
mArray = &(mAutoArray[0]);
mArraySize = kAutoArraySize;
}
else {
mArray = new nsISupports*[mCount];
mArraySize = mCount;
}
if (0 == mArray) {
mArray = oldArray;
mArraySize = oldArraySize;
return NS_OK;
}
::memcpy(mArray, oldArray, mCount * sizeof(nsISupports*));
delete[] oldArray;
}
return NS_OK;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::EnumerateForwards(nsISupportsArrayEnumFunc aFunc, void* aData)
{
PRInt32 aIndex = -1;
PRBool running = PR_TRUE;
while (running && (++aIndex < (PRInt32)mCount)) {
running = (*aFunc)(mArray[aIndex], aData);
}
return running;
}
NS_IMETHODIMP_(PRBool)
nsSupportsArray::EnumerateBackwards(nsISupportsArrayEnumFunc aFunc, void* aData)
{
PRUint32 aIndex = mCount;
PRBool running = PR_TRUE;
while (running && (0 < aIndex--)) {
running = (*aFunc)(mArray[aIndex], aData);
}
return running;
}
NS_IMETHODIMP
nsSupportsArray::Enumerate(nsIEnumerator* *result)
{
nsSupportsArrayEnumerator* e = new nsSupportsArrayEnumerator(this);
if (!e)
return NS_ERROR_OUT_OF_MEMORY;
*result = e;
NS_ADDREF(e);
return NS_OK;
}
NS_COM nsresult
NS_NewISupportsArray(nsISupportsArray** aInstancePtrResult)
{
nsresult rv;
rv = nsSupportsArray::Create(NULL, nsISupportsArray::GetIID(),
(void**)aInstancePtrResult);
return rv;
}

View File

@@ -1,131 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsSupportsArray_h__
#define nsSupportsArray_h__
#include "nsISupportsArray.h"
static const PRUint32 kAutoArraySize = 4;
class nsSupportsArray : public nsISupportsArray {
public:
nsSupportsArray(void);
virtual ~nsSupportsArray(void);
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
NS_DECL_ISUPPORTS
// nsICollection methods:
NS_IMETHOD Count(PRUint32 *result) { *result = mCount; return NS_OK; }
NS_IMETHOD GetElementAt(PRUint32 aIndex, nsISupports* *result) {
*result = ElementAt(aIndex);
return NS_OK;
}
NS_IMETHOD QueryElementAt(PRUint32 aIndex, const nsIID & aIID, void * *aResult) {
if (aIndex < mCount) {
nsISupports* element = mArray[aIndex];
if (nsnull != element)
return element->QueryInterface(aIID, aResult);
}
return NS_ERROR_FAILURE;
}
NS_IMETHOD SetElementAt(PRUint32 aIndex, nsISupports* value) {
PRBool ok = ReplaceElementAt(value, aIndex);
return ok ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHOD AppendElement(nsISupports *aElement) {
// XXX This incorrectly returns a PRBool instead of an nsresult.
return InsertElementAt(aElement, mCount);
}
NS_IMETHOD RemoveElement(nsISupports *aElement) {
// XXX This incorrectly returns a PRBool instead of an nsresult.
return RemoveElement(aElement, 0);
}
NS_IMETHOD Enumerate(nsIEnumerator* *result);
NS_IMETHOD Clear(void);
// nsISupportsArray methods:
NS_IMETHOD_(PRBool) Equals(const nsISupportsArray* aOther);
NS_IMETHOD_(nsISupports*) ElementAt(PRUint32 aIndex);
NS_IMETHOD_(PRInt32) IndexOf(const nsISupports* aPossibleElement);
NS_IMETHOD_(PRInt32) IndexOfStartingAt(const nsISupports* aPossibleElement,
PRUint32 aStartIndex = 0);
NS_IMETHOD_(PRInt32) LastIndexOf(const nsISupports* aPossibleElement);
NS_IMETHOD GetIndexOf(nsISupports *aPossibleElement, PRInt32 *_retval) {
*_retval = IndexOf(aPossibleElement);
return NS_OK;
}
NS_IMETHOD GetIndexOfStartingAt(nsISupports *aPossibleElement,
PRUint32 aStartIndex, PRInt32 *_retval) {
*_retval = IndexOfStartingAt(aPossibleElement, aStartIndex);
return NS_OK;
}
NS_IMETHOD GetLastIndexOf(nsISupports *aPossibleElement, PRInt32 *_retval) {
*_retval = LastIndexOf(aPossibleElement);
return NS_OK;
}
NS_IMETHOD_(PRBool) InsertElementAt(nsISupports* aElement, PRUint32 aIndex);
NS_IMETHOD_(PRBool) ReplaceElementAt(nsISupports* aElement, PRUint32 aIndex);
NS_IMETHOD_(PRBool) RemoveElementAt(PRUint32 aIndex);
NS_IMETHOD_(PRBool) RemoveElement(const nsISupports* aElement, PRUint32 aStartIndex = 0);
NS_IMETHOD_(PRBool) RemoveLastElement(const nsISupports* aElement);
NS_IMETHOD DeleteLastElement(nsISupports *aElement) {
return (RemoveLastElement(aElement) ? NS_OK : NS_ERROR_FAILURE);
}
NS_IMETHOD DeleteElementAt(PRUint32 aIndex) {
return (RemoveElementAt(aIndex) ? NS_OK : NS_ERROR_FAILURE);
}
NS_IMETHOD_(PRBool) AppendElements(nsISupportsArray* aElements);
NS_IMETHOD Compact(void);
NS_IMETHOD_(PRBool) EnumerateForwards(nsISupportsArrayEnumFunc aFunc, void* aData);
NS_IMETHOD_(PRBool) EnumerateBackwards(nsISupportsArrayEnumFunc aFunc, void* aData);
protected:
NS_IMETHOD_(nsISupportsArray&) operator=(const nsISupportsArray& aOther);
NS_IMETHOD_(PRBool) operator==(const nsISupportsArray& aOther) { return Equals(&aOther); }
NS_IMETHOD_(nsISupports*) operator[](PRUint32 aIndex) { return ElementAt(aIndex); }
void DeleteArray(void);
nsISupports** mArray;
PRUint32 mArraySize;
PRUint32 mCount;
nsISupports* mAutoArray[kAutoArraySize];
private:
// Copy constructors are not allowed
nsSupportsArray(const nsISupportsArray& other);
};
#endif // nsSupportsArray_h__

View File

@@ -1,130 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsSupportsArrayEnumerator.h"
#include "nsISupportsArray.h"
nsSupportsArrayEnumerator::nsSupportsArrayEnumerator(nsISupportsArray* array)
: mArray(array), mCursor(0)
{
NS_INIT_REFCNT();
NS_ASSERTION(array, "null array");
NS_ADDREF(mArray);
}
nsSupportsArrayEnumerator::~nsSupportsArrayEnumerator()
{
NS_RELEASE(mArray);
}
NS_IMPL_ISUPPORTS2(nsSupportsArrayEnumerator, nsIBidirectionalEnumerator, nsIEnumerator)
NS_IMETHODIMP
nsSupportsArrayEnumerator::First()
{
mCursor = 0;
PRUint32 cnt;
nsresult rv = mArray->Count(&cnt);
if (NS_FAILED(rv)) return rv;
PRInt32 end = (PRInt32)cnt;
if (mCursor < end)
return NS_OK;
else
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsSupportsArrayEnumerator::Next()
{
PRUint32 cnt;
nsresult rv = mArray->Count(&cnt);
if (NS_FAILED(rv)) return rv;
PRInt32 end = (PRInt32)cnt;
if (mCursor < end) // don't count upward forever
mCursor++;
if (mCursor < end)
return NS_OK;
else
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsSupportsArrayEnumerator::CurrentItem(nsISupports **aItem)
{
NS_ASSERTION(aItem, "null out parameter");
PRUint32 cnt;
nsresult rv = mArray->Count(&cnt);
if (NS_FAILED(rv)) return rv;
if (mCursor >= 0 && mCursor < (PRInt32)cnt) {
*aItem = mArray->ElementAt(mCursor);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsSupportsArrayEnumerator::IsDone()
{
PRUint32 cnt;
nsresult rv = mArray->Count(&cnt);
if (NS_FAILED(rv)) return rv;
return (mCursor >= 0 && mCursor < (PRInt32)cnt)
? NS_COMFALSE : NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
NS_IMETHODIMP
nsSupportsArrayEnumerator::Last()
{
PRUint32 cnt;
nsresult rv = mArray->Count(&cnt);
if (NS_FAILED(rv)) return rv;
mCursor = cnt - 1;
return NS_OK;
}
NS_IMETHODIMP
nsSupportsArrayEnumerator::Prev()
{
if (mCursor >= 0)
--mCursor;
if (mCursor >= 0)
return NS_OK;
else
return NS_ERROR_FAILURE;
}
////////////////////////////////////////////////////////////////////////////////
NS_COM nsresult
NS_NewISupportsArrayEnumerator(nsISupportsArray* array,
nsIBidirectionalEnumerator* *aInstancePtrResult)
{
if (aInstancePtrResult == 0)
return NS_ERROR_NULL_POINTER;
nsSupportsArrayEnumerator* e = new nsSupportsArrayEnumerator(array);
if (e == 0)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(e);
*aInstancePtrResult = e;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,46 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsSupportsArrayEnumerator_h___
#define nsSupportsArrayEnumerator_h___
#include "nsIEnumerator.h"
class nsISupportsArray;
class NS_COM nsSupportsArrayEnumerator : public nsIBidirectionalEnumerator {
public:
NS_DECL_ISUPPORTS
nsSupportsArrayEnumerator(nsISupportsArray* array);
virtual ~nsSupportsArrayEnumerator();
// nsIEnumerator methods:
NS_DECL_NSIENUMERATOR
// nsIBidirectionalEnumerator methods:
NS_DECL_NSIBIDIRECTIONALENUMERATOR
protected:
nsISupportsArray* mArray;
PRInt32 mCursor;
};
#endif // __nsSupportsArrayEnumerator_h

View File

@@ -1,809 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsSupportsPrimitives.h"
#include "nsCRT.h"
#include "nsIAllocator.h"
#include "prprf.h"
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsIDImpl, nsISupportsID)
nsSupportsIDImpl::nsSupportsIDImpl()
: mData(nsnull)
{
NS_INIT_ISUPPORTS();
}
nsSupportsIDImpl::~nsSupportsIDImpl()
{
if(mData)
nsAllocator::Free(mData);
}
NS_IMETHODIMP nsSupportsIDImpl::GetData(nsID **aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
if(mData)
{
*aData = (nsID*) nsAllocator::Clone(mData, sizeof(nsID));
return *aData ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
else
{
*aData = nsnull;
return NS_OK;
}
}
NS_IMETHODIMP nsSupportsIDImpl::SetData(const nsID *aData)
{
if(mData)
nsAllocator::Free(mData);
if(aData)
mData = (nsID*) nsAllocator::Clone(aData, sizeof(nsID));
else
mData = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsSupportsIDImpl::ToString(char **_retval)
{
char* result = nsnull;
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
if(mData)
{
char * str = mData->ToString();
if(str)
{
result = (char*) nsAllocator::Clone(str,
(nsCRT::strlen(str)+1)*sizeof(char));
delete [] str;
}
}
else
{
static const char nullStr[] = "null";
result = (char*) nsAllocator::Clone(nullStr, sizeof(nullStr));
}
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsStringImpl, nsISupportsString)
nsSupportsStringImpl::nsSupportsStringImpl()
: mData(nsnull)
{
NS_INIT_ISUPPORTS();
}
nsSupportsStringImpl::~nsSupportsStringImpl()
{
if(mData)
nsAllocator::Free(mData);
}
NS_IMETHODIMP nsSupportsStringImpl::GetData(char **aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
if(mData)
{
*aData = (char*) nsAllocator::Clone(mData,
(nsCRT::strlen(mData)+1)*sizeof(char));
return *aData ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
else
{
*aData = nsnull;
return NS_OK;
}
}
NS_IMETHODIMP nsSupportsStringImpl::SetData(const char *aData)
{
if(mData)
nsAllocator::Free(mData);
if(aData)
mData = (char*) nsAllocator::Clone(aData,
(nsCRT::strlen(aData)+1)*sizeof(char));
else
mData = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsSupportsStringImpl::ToString(char **_retval)
{
return GetData(_retval);
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsWStringImpl, nsISupportsWString)
nsSupportsWStringImpl::nsSupportsWStringImpl()
: mData(nsnull)
{
NS_INIT_ISUPPORTS();
}
nsSupportsWStringImpl::~nsSupportsWStringImpl()
{
if(mData)
nsAllocator::Free(mData);
}
NS_IMETHODIMP nsSupportsWStringImpl::GetData(PRUnichar **aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
if(mData)
{
*aData = (PRUnichar*) nsAllocator::Clone(mData,
(nsCRT::strlen(mData)+1)*sizeof(PRUnichar));
return *aData ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
else
{
*aData = nsnull;
return NS_OK;
}
}
NS_IMETHODIMP nsSupportsWStringImpl::SetData(const PRUnichar *aData)
{
if(mData)
nsAllocator::Free(mData);
if(aData)
mData = (PRUnichar*) nsAllocator::Clone(aData,
(nsCRT::strlen(aData)+1)*sizeof(PRUnichar));
else
mData = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsSupportsWStringImpl::ToString(PRUnichar **_retval)
{
return GetData(_retval);
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRBoolImpl, nsISupportsPRBool)
nsSupportsPRBoolImpl::nsSupportsPRBoolImpl()
: mData(PR_FALSE)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRBoolImpl::~nsSupportsPRBoolImpl() {}
NS_IMETHODIMP nsSupportsPRBoolImpl::GetData(PRBool *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRBoolImpl::SetData(PRBool aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRBoolImpl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
const char * str = mData ? "true" : "false";
char* result = (char*) nsAllocator::Clone(str,
(nsCRT::strlen(str)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRUint8Impl, nsISupportsPRUint8)
nsSupportsPRUint8Impl::nsSupportsPRUint8Impl()
: mData(0)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRUint8Impl::~nsSupportsPRUint8Impl() {}
NS_IMETHODIMP nsSupportsPRUint8Impl::GetData(PRUint8 *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRUint8Impl::SetData(PRUint8 aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRUint8Impl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 8;
char buf[size];
PR_snprintf(buf, size, "%u", (PRUint16) mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRUint16Impl, nsISupportsPRUint16)
nsSupportsPRUint16Impl::nsSupportsPRUint16Impl()
: mData(0)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRUint16Impl::~nsSupportsPRUint16Impl() {}
NS_IMETHODIMP nsSupportsPRUint16Impl::GetData(PRUint16 *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRUint16Impl::SetData(PRUint16 aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRUint16Impl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 8;
char buf[size];
PR_snprintf(buf, size, "%u", (int) mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRUint32Impl, nsISupportsPRUint32)
nsSupportsPRUint32Impl::nsSupportsPRUint32Impl()
: mData(0)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRUint32Impl::~nsSupportsPRUint32Impl() {}
NS_IMETHODIMP nsSupportsPRUint32Impl::GetData(PRUint32 *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRUint32Impl::SetData(PRUint32 aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRUint32Impl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 16;
char buf[size];
PR_snprintf(buf, size, "%lu", mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRUint64Impl, nsISupportsPRUint64)
nsSupportsPRUint64Impl::nsSupportsPRUint64Impl()
: mData(LL_ZERO)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRUint64Impl::~nsSupportsPRUint64Impl() {}
NS_IMETHODIMP nsSupportsPRUint64Impl::GetData(PRUint64 *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRUint64Impl::SetData(PRUint64 aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRUint64Impl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 32;
char buf[size];
PR_snprintf(buf, size, "%llu", mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRTimeImpl, nsISupportsPRTime)
nsSupportsPRTimeImpl::nsSupportsPRTimeImpl()
: mData(LL_ZERO)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRTimeImpl::~nsSupportsPRTimeImpl() {}
NS_IMETHODIMP nsSupportsPRTimeImpl::GetData(PRTime *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRTimeImpl::SetData(PRTime aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRTimeImpl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 32;
char buf[size];
PR_snprintf(buf, size, "%llu", mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsCharImpl, nsISupportsChar)
nsSupportsCharImpl::nsSupportsCharImpl()
: mData(0)
{
NS_INIT_ISUPPORTS();
}
nsSupportsCharImpl::~nsSupportsCharImpl() {}
NS_IMETHODIMP nsSupportsCharImpl::GetData(char *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsCharImpl::SetData(char aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsCharImpl::ToString(char **_retval)
{
char* result;
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
if(nsnull != (result = (char*) nsAllocator::Alloc(2*sizeof(char))))
{
result[0] = mData;
result[1] = '\0';
}
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRInt16Impl, nsISupportsPRInt16)
nsSupportsPRInt16Impl::nsSupportsPRInt16Impl()
: mData(0)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRInt16Impl::~nsSupportsPRInt16Impl() {}
NS_IMETHODIMP nsSupportsPRInt16Impl::GetData(PRInt16 *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRInt16Impl::SetData(PRInt16 aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRInt16Impl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 8;
char buf[size];
PR_snprintf(buf, size, "%d", mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRInt32Impl, nsISupportsPRInt32)
nsSupportsPRInt32Impl::nsSupportsPRInt32Impl()
: mData(0)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRInt32Impl::~nsSupportsPRInt32Impl() {}
NS_IMETHODIMP nsSupportsPRInt32Impl::GetData(PRInt32 *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRInt32Impl::SetData(PRInt32 aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRInt32Impl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 16;
char buf[size];
PR_snprintf(buf, size, "%ld", mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsPRInt64Impl, nsISupportsPRInt64)
nsSupportsPRInt64Impl::nsSupportsPRInt64Impl()
: mData(LL_ZERO)
{
NS_INIT_ISUPPORTS();
}
nsSupportsPRInt64Impl::~nsSupportsPRInt64Impl() {}
NS_IMETHODIMP nsSupportsPRInt64Impl::GetData(PRInt64 *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRInt64Impl::SetData(PRInt64 aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsPRInt64Impl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 32;
char buf[size];
PR_snprintf(buf, size, "%lld", mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsFloatImpl, nsISupportsFloat)
nsSupportsFloatImpl::nsSupportsFloatImpl()
: mData(float(0.0))
{
NS_INIT_ISUPPORTS();
}
nsSupportsFloatImpl::~nsSupportsFloatImpl() {}
NS_IMETHODIMP nsSupportsFloatImpl::GetData(float *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsFloatImpl::SetData(float aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsFloatImpl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 32;
char buf[size];
PR_snprintf(buf, size, "%f", (double) mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsDoubleImpl, nsISupportsDouble)
nsSupportsDoubleImpl::nsSupportsDoubleImpl()
: mData(double(0.0))
{
NS_INIT_ISUPPORTS();
}
nsSupportsDoubleImpl::~nsSupportsDoubleImpl() {}
NS_IMETHODIMP nsSupportsDoubleImpl::GetData(double *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsDoubleImpl::SetData(double aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsDoubleImpl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const int size = 32;
char buf[size];
PR_snprintf(buf, size, "%f", mData);
char* result = (char*) nsAllocator::Clone(buf,
(nsCRT::strlen(buf)+1)*sizeof(char));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/
NS_IMPL_ISUPPORTS1(nsSupportsVoidImpl, nsISupportsVoid)
nsSupportsVoidImpl::nsSupportsVoidImpl()
: mData(nsnull)
{
NS_INIT_ISUPPORTS();
}
nsSupportsVoidImpl::~nsSupportsVoidImpl() {}
NS_IMETHODIMP nsSupportsVoidImpl::GetData(const void * *aData)
{
if(!aData)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
*aData = mData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsVoidImpl::SetData(void * aData)
{
mData = aData;
return NS_OK;
}
NS_IMETHODIMP nsSupportsVoidImpl::ToString(char **_retval)
{
if(!_retval)
{
NS_ASSERTION(0,"Bad pointer");
return NS_ERROR_NULL_POINTER;
}
static const char str[] = "[raw data]";
char* result = (char*) nsAllocator::Clone(str, sizeof(str));
*_retval = result;
return result ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/***************************************************************************/

View File

@@ -1,264 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsSupportsPrimitives_h__
#define nsSupportsPrimitives_h__
#include "nsISupportsPrimitives.h"
class nsSupportsIDImpl : public nsISupportsID
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSID
nsSupportsIDImpl();
virtual ~nsSupportsIDImpl();
private:
nsID *mData;
};
/***************************************************************************/
class nsSupportsStringImpl : public nsISupportsString
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSSTRING
nsSupportsStringImpl();
virtual ~nsSupportsStringImpl();
private:
char *mData;
};
/***************************************************************************/
class nsSupportsWStringImpl : public nsISupportsWString
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSWSTRING
nsSupportsWStringImpl();
virtual ~nsSupportsWStringImpl();
private:
PRUnichar *mData;
};
/***************************************************************************/
class nsSupportsPRBoolImpl : public nsISupportsPRBool
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRBOOL
nsSupportsPRBoolImpl();
virtual ~nsSupportsPRBoolImpl();
private:
PRBool mData;
};
/***************************************************************************/
class nsSupportsPRUint8Impl : public nsISupportsPRUint8
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRUINT8
nsSupportsPRUint8Impl();
virtual ~nsSupportsPRUint8Impl();
private:
PRUint8 mData;
};
/***************************************************************************/
class nsSupportsPRUint16Impl : public nsISupportsPRUint16
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRUINT16
nsSupportsPRUint16Impl();
virtual ~nsSupportsPRUint16Impl();
private:
PRUint16 mData;
};
/***************************************************************************/
class nsSupportsPRUint32Impl : public nsISupportsPRUint32
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRUINT32
nsSupportsPRUint32Impl();
virtual ~nsSupportsPRUint32Impl();
private:
PRUint32 mData;
};
/***************************************************************************/
class nsSupportsPRUint64Impl : public nsISupportsPRUint64
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRUINT64
nsSupportsPRUint64Impl();
virtual ~nsSupportsPRUint64Impl();
private:
PRUint64 mData;
};
/***************************************************************************/
class nsSupportsPRTimeImpl : public nsISupportsPRTime
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRTIME
nsSupportsPRTimeImpl();
virtual ~nsSupportsPRTimeImpl();
private:
PRTime mData;
};
/***************************************************************************/
class nsSupportsCharImpl : public nsISupportsChar
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSCHAR
nsSupportsCharImpl();
virtual ~nsSupportsCharImpl();
private:
char mData;
};
/***************************************************************************/
class nsSupportsPRInt16Impl : public nsISupportsPRInt16
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRINT16
nsSupportsPRInt16Impl();
virtual ~nsSupportsPRInt16Impl();
private:
PRInt16 mData;
};
/***************************************************************************/
class nsSupportsPRInt32Impl : public nsISupportsPRInt32
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRINT32
nsSupportsPRInt32Impl();
virtual ~nsSupportsPRInt32Impl();
private:
PRInt32 mData;
};
/***************************************************************************/
class nsSupportsPRInt64Impl : public nsISupportsPRInt64
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRINT64
nsSupportsPRInt64Impl();
virtual ~nsSupportsPRInt64Impl();
private:
PRInt64 mData;
};
/***************************************************************************/
class nsSupportsFloatImpl : public nsISupportsFloat
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSFLOAT
nsSupportsFloatImpl();
virtual ~nsSupportsFloatImpl();
private:
float mData;
};
/***************************************************************************/
class nsSupportsDoubleImpl : public nsISupportsDouble
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSDOUBLE
nsSupportsDoubleImpl();
virtual ~nsSupportsDoubleImpl();
private:
double mData;
};
/***************************************************************************/
class nsSupportsVoidImpl : public nsISupportsVoid
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSVOID
nsSupportsVoidImpl();
virtual ~nsSupportsVoidImpl();
private:
void* mData;
};
/***************************************************************************/
#endif /* nsSupportsPrimitives_h__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,92 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsTextFormater_h___
#define nsTextFormater_h___
/*
** API for PR printf like routines. Supports the following formats
** %d - decimal
** %u - unsigned decimal
** %x - unsigned hex
** %X - unsigned uppercase hex
** %o - unsigned octal
** %hd, %hu, %hx, %hX, %ho - 16-bit versions of above
** %ld, %lu, %lx, %lX, %lo - 32-bit versions of above
** %lld, %llu, %llx, %llX, %llo - 64 bit versions of above
** %s - utf8 string
** %S - PRUnichar string
** %c - character
** %p - pointer (deals with machine dependent pointer size)
** %f - float
** %g - float
*/
#include "prtypes.h"
#include "prio.h"
#include <stdio.h>
#include <stdarg.h>
#include "nscore.h"
class NS_COM nsTextFormater {
public:
/*
** sprintf into a fixed size buffer. Guarantees that a NUL is at the end
** of the buffer. Returns the length of the written output, NOT including
** the NUL, or (PRUint32)-1 if an error occurs.
*/
static PRUint32 snprintf(PRUnichar *out, PRUint32 outlen, const PRUnichar *fmt, ...);
/*
** sprintf into a PR_MALLOC'd buffer. Return a pointer to the malloc'd
** buffer on success, NULL on failure. Call "smprintf_free" to release
** the memory returned.
*/
static PRUnichar* smprintf(const PRUnichar *fmt, ...);
/*
** Free the memory allocated, for the caller, by smprintf
*/
static void smprintf_free(PRUnichar *mem);
/*
** "append" sprintf into a PR_MALLOC'd buffer. "last" is the last value of
** the PR_MALLOC'd buffer. sprintf will append data to the end of last,
** growing it as necessary using realloc. If last is NULL, PR_sprintf_append
** will allocate the initial string. The return value is the new value of
** last for subsequent calls, or NULL if there is a malloc failure.
*/
static PRUnichar* sprintf_append(PRUnichar *last, const PRUnichar *fmt, ...);
/*
** va_list forms of the above.
*/
static PRUint32 vsnprintf(PRUnichar *out, PRUint32 outlen, const PRUnichar *fmt, va_list ap);
static PRUnichar* vsmprintf(const PRUnichar *fmt, va_list ap);
static PRUnichar* vsprintf_append(PRUnichar *last, const PRUnichar *fmt, va_list ap);
#ifdef DEBUG
static PRBool SelfTest();
#endif
};
#endif /* nsTextFormater_h___ */

View File

@@ -1,196 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsTime_h__
#define nsTime_h__
#include "prtime.h"
#include "nsInt64.h"
#include "nscore.h"
/**
* This class encapsulates full 64-bit time functionality and
* provides simple arithmetic and conversion operations.
*/
// If you ever decide that you need to add a non-inline method to this
// class, be sure to change the class declaration to "class NS_BASE
// nsTime".
class nsTime
{
private:
nsInt64 mValue;
public:
/**
* Construct the current time.
*/
nsTime(void) : mValue(PR_Now()) {
}
/**
* Construct the time from a string.
*/
nsTime(const char* dateStr, PRBool defaultToGMT) {
PRInt64 theTime;
PRStatus status = PR_ParseTimeString(dateStr, defaultToGMT, &theTime);
if (status == PR_SUCCESS)
mValue = theTime;
else
mValue = LL_ZERO;
}
/**
* Construct a time from a PRTime.
*/
nsTime(const PRTime aTime) : mValue(aTime) {
}
/**
* Construct a time from a 64-bit value.
*/
nsTime(const nsInt64& aTime) : mValue(aTime) {
}
/**
* Construct a time from another time.
*/
nsTime(const nsTime& aTime) : mValue(aTime.mValue) {
}
// ~nsTime(void) -- XXX destructor unnecessary
/**
* Assign one time to another.
*/
const nsTime& operator =(const nsTime& aTime) {
mValue = aTime.mValue;
return *this;
}
/**
* Convert a nsTime object to a PRTime
*/
operator PRTime(void) const {
return mValue;
}
/**
* Subtract a 64-bit interval from a time.
*/
nsTime& operator -=(const nsInt64& aInterval) {
mValue -= aInterval;
return *this;
}
/**
* Add a 64-bit interval to a time.
*/
nsTime& operator +=(const nsInt64& aInterval) {
mValue += aInterval;
return *this;
}
// Arithmetic operators
friend const nsTime operator +(const nsTime& aTime, const nsInt64& aInterval);
friend const nsTime operator -(const nsTime& aTime, const nsInt64& aInterval);
friend const nsInt64 operator -(const nsTime& aTime1, const nsTime& aTime2);
// Comparison operators
friend const PRBool operator ==(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator !=(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator <(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator <=(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator >(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator >=(const nsTime& aTime1, const nsTime& aTime2);
};
/**
* Binary addition to add a 64-bit interval to a time.
*/
inline const nsTime
operator +(const nsTime& aTime, const nsInt64& aInterval) {
return nsTime(aTime.mValue + aInterval);
}
/**
* Binary subtraction to subtract a 64-bit interval to a time.
*/
inline const nsTime
operator -(const nsTime& aTime, const nsInt64& aInterval) {
return nsTime(aTime.mValue - aInterval);
}
/**
* Binary subtraction to compute an interval from the difference of two times.
*/
inline const nsInt64
operator -(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue - aTime2.mValue;
}
/**
* Determine if two times are equal
*/
inline const PRBool
operator ==(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue == aTime2.mValue;
}
/**
* Determine if two times are different
*/
inline const PRBool
operator !=(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue != aTime2.mValue;
}
/**
* Determine if one time is strictly less than another
*/
inline const PRBool
operator <(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue < aTime2.mValue;
}
/**
* Determine if one time is less than or equal to another
*/
inline const PRBool
operator <=(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue <= aTime2.mValue;
}
/**
* Determine if one time is strictly greater than another
*/
inline const PRBool
operator >(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue > aTime2.mValue;
}
/**
* Determine if one time is greater than or equal to another
*/
inline const PRBool
operator >=(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue >= aTime2.mValue;
}
#endif // nsTime_h__

View File

@@ -1,157 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsUnicharBuffer.h"
#include "nsIUnicharInputStream.h"
#include "nsCRT.h"
#define MIN_BUFFER_SIZE 32
UnicharBufferImpl::UnicharBufferImpl()
: mBuffer(NULL), mSpace(0), mLength(0)
{
NS_INIT_REFCNT();
}
NS_METHOD
UnicharBufferImpl::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
UnicharBufferImpl* it = new UnicharBufferImpl();
if (it == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(it);
nsresult rv = it->QueryInterface(aIID, aResult);
NS_RELEASE(it);
return rv;
}
NS_IMETHODIMP
UnicharBufferImpl::Init(PRUint32 aBufferSize)
{
if (aBufferSize < MIN_BUFFER_SIZE) {
aBufferSize = MIN_BUFFER_SIZE;
}
mSpace = aBufferSize;
mLength = 0;
mBuffer = new PRUnichar[aBufferSize];
return mBuffer ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
NS_IMPL_ISUPPORTS1(UnicharBufferImpl, nsIUnicharBuffer)
UnicharBufferImpl::~UnicharBufferImpl()
{
if (nsnull != mBuffer) {
delete[] mBuffer;
mBuffer = nsnull;
}
mLength = 0;
}
NS_IMETHODIMP_(PRInt32)
UnicharBufferImpl::GetLength() const
{
return mLength;
}
NS_IMETHODIMP_(PRInt32)
UnicharBufferImpl::GetBufferSize() const
{
return mSpace;
}
NS_IMETHODIMP_(PRUnichar*)
UnicharBufferImpl::GetBuffer() const
{
return mBuffer;
}
NS_IMETHODIMP_(PRBool)
UnicharBufferImpl::Grow(PRInt32 aNewSize)
{
if (PRUint32(aNewSize) < MIN_BUFFER_SIZE) {
aNewSize = MIN_BUFFER_SIZE;
}
PRUnichar* newbuf = new PRUnichar[aNewSize];
if (nsnull != newbuf) {
if (0 != mLength) {
nsCRT::memcpy(newbuf, mBuffer, mLength * sizeof(PRUnichar));
}
delete[] mBuffer;
mBuffer = newbuf;
return PR_TRUE;
}
return PR_FALSE;
}
NS_IMETHODIMP_(PRInt32)
UnicharBufferImpl::Fill(nsresult* aErrorCode,
nsIUnicharInputStream* aStream,
PRInt32 aKeep)
{
NS_PRECONDITION(nsnull != aStream, "null stream");
NS_PRECONDITION(PRUint32(aKeep) < PRUint32(mLength), "illegal keep count");
if ((nsnull == aStream) || (PRUint32(aKeep) >= PRUint32(mLength))) {
// whoops
*aErrorCode = NS_BASE_STREAM_ILLEGAL_ARGS;
return -1;
}
if (0 != aKeep) {
// Slide over kept data
nsCRT::memmove(mBuffer, mBuffer + (mLength - aKeep),
aKeep * sizeof(PRUnichar));
}
// Read in some new data
mLength = aKeep;
PRInt32 amount = mSpace - aKeep;
PRUint32 nb;
NS_ASSERTION(aKeep >= 0, "unsigned madness");
NS_ASSERTION(amount >= 0, "unsigned madness");
*aErrorCode = aStream->Read(mBuffer, (PRUint32)aKeep, (PRUint32)amount, &nb);
if (NS_SUCCEEDED(*aErrorCode)) {
mLength += nb;
}
else
nb = 0;
return nb;
}
NS_COM nsresult
NS_NewUnicharBuffer(nsIUnicharBuffer** aInstancePtrResult,
nsISupports* aOuter,
PRUint32 aBufferSize)
{
nsresult rv;
nsIUnicharBuffer* buf;
rv = UnicharBufferImpl::Create(aOuter, nsIUnicharBuffer::GetIID(),
(void**)&buf);
if (NS_FAILED(rv)) return rv;
rv = buf->Init(aBufferSize);
if (NS_FAILED(rv)) {
NS_RELEASE(buf);
return rv;
}
*aInstancePtrResult = buf;
return rv;
}

View File

@@ -1,46 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsUnicharBuffer_h__
#define nsUnicharBuffer_h__
#include "nsIUnicharBuffer.h"
class UnicharBufferImpl : public nsIUnicharBuffer {
public:
UnicharBufferImpl();
virtual ~UnicharBufferImpl();
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
NS_DECL_ISUPPORTS
NS_IMETHOD Init(PRUint32 aBufferSize);
NS_IMETHOD_(PRInt32) GetLength() const;
NS_IMETHOD_(PRInt32) GetBufferSize() const;
NS_IMETHOD_(PRUnichar*) GetBuffer() const;
NS_IMETHOD_(PRBool) Grow(PRInt32 aNewSize);
NS_IMETHOD_(PRInt32) Fill(nsresult* aErrorCode, nsIUnicharInputStream* aStream,
PRInt32 aKeep);
PRUnichar* mBuffer;
PRUint32 mSpace;
PRUint32 mLength;
};
#endif // nsUnicharBuffer_h__

View File

@@ -1,182 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsUnitConversion_h__
#define nsUnitConversion_h__
#include "nscore.h"
#include <math.h>
/// handy constants
#define TWIPS_PER_POINT_INT 20
#define TWIPS_PER_POINT_FLOAT 20.0f
#define ROUND_EXCLUSIVE_CONST_FLOAT 0.4999999999999999f // XXX this should be derived from platform FLOAT_MIN
#define ROUND_CONST_FLOAT 0.5f
#define CEIL_CONST_FLOAT 0.9999999999999999f // XXX this should be derived from platform FLOAT_MIN
/*
* Coord Rounding Functions
*/
inline nscoord NSToCoordFloor(float aValue)
{
return ((0.0f <= aValue) ? nscoord(aValue) : nscoord(aValue - CEIL_CONST_FLOAT));
}
inline nscoord NSToCoordCeil(float aValue)
{
return ((0.0f <= aValue) ? nscoord(aValue + CEIL_CONST_FLOAT) : nscoord(aValue));
}
inline nscoord NSToCoordRound(float aValue)
{
return ((0.0f <= aValue) ? nscoord(aValue + ROUND_CONST_FLOAT) : nscoord(aValue - ROUND_CONST_FLOAT));
}
inline nscoord NSToCoordRoundExclusive(float aValue)
{
return ((0.0f <= aValue) ? nscoord(aValue + ROUND_EXCLUSIVE_CONST_FLOAT) :
nscoord(aValue - ROUND_EXCLUSIVE_CONST_FLOAT));
}
/*
* Int Rounding Functions
*/
inline PRInt32 NSToIntFloor(float aValue)
{
return ((0.0f <= aValue) ? PRInt32(aValue) : PRInt32(aValue - CEIL_CONST_FLOAT));
}
inline PRInt32 NSToIntCeil(float aValue)
{
return ((0.0f <= aValue) ? PRInt32(aValue + CEIL_CONST_FLOAT) : PRInt32(aValue));
}
inline PRInt32 NSToIntRound(float aValue)
{
return ((0.0f <= aValue) ? PRInt32(aValue + ROUND_CONST_FLOAT) : PRInt32(aValue - ROUND_CONST_FLOAT));
}
inline PRInt32 NSToIntRoundExclusive(float aValue)
{
return ((0.0f <= aValue) ? PRInt32(aValue + ROUND_EXCLUSIVE_CONST_FLOAT) :
PRInt32(aValue - ROUND_EXCLUSIVE_CONST_FLOAT));
}
/*
* Twips/Points conversions
*/
inline nscoord NSFloatPointsToTwips(float aPoints)
{
return NSToCoordRound(aPoints * TWIPS_PER_POINT_FLOAT);
}
inline nscoord NSIntPointsToTwips(PRInt32 aPoints)
{
return nscoord(aPoints * TWIPS_PER_POINT_INT);
}
inline PRInt32 NSTwipsToIntPoints(nscoord aTwips)
{
return NSToIntRound(aTwips / TWIPS_PER_POINT_FLOAT);
}
inline PRInt32 NSTwipsToFloorIntPoints(nscoord aTwips)
{
return NSToIntFloor(aTwips / TWIPS_PER_POINT_FLOAT);
}
inline PRInt32 NSTwipsToCeilIntPoints(nscoord aTwips)
{
return NSToIntCeil(aTwips / TWIPS_PER_POINT_FLOAT);
}
inline float NSTwipsToFloatPoints(nscoord aTwips)
{
return (float(aTwips) / TWIPS_PER_POINT_FLOAT);
}
/*
* Twips/Pixel conversions
*/
inline nscoord NSFloatPixelsToTwips(float aPixels, float aTwipsPerPixel)
{
return NSToCoordRound(aPixels * aTwipsPerPixel);
}
inline nscoord NSIntPixelsToTwips(PRInt32 aPixels, float aTwipsPerPixel)
{
return NSToCoordRound(float(aPixels) * aTwipsPerPixel);
}
inline float NSTwipsToFloatPixels(nscoord aTwips, float aPixelsPerTwip)
{
return (float(aTwips) * aPixelsPerTwip);
}
inline PRInt32 NSTwipsToIntPixels(nscoord aTwips, float aPixelsPerTwip)
{
return NSToIntRound(float(aTwips) * aPixelsPerTwip);
}
/*
* Twips/unit conversions
*/
inline nscoord NSUnitsToTwips(float aValue, float aPointsPerUnit)
{
return NSToCoordRound(aValue * aPointsPerUnit * TWIPS_PER_POINT_FLOAT);
}
inline float NSTwipsToUnits(nscoord aTwips, float aUnitsPerPoint)
{
return (aTwips * (aUnitsPerPoint / TWIPS_PER_POINT_FLOAT));
}
/// Unit conversion macros
//@{
#define NS_INCHES_TO_TWIPS(x) NSUnitsToTwips((x), 72.0f) // 72 points per inch
#define NS_FEET_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 12.0f)) // 12 inches per foot
#define NS_MILES_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 12.0f * 5280.0f)) // 5280 feet per mile
#define NS_MILLIMETERS_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 0.03937f))
#define NS_CENTIMETERS_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 0.3937f))
#define NS_METERS_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 39.37f))
#define NS_KILOMETERS_TO_TWIPS(x) NSUnitsToTwips((x), (72.0f * 39370.0f))
#define NS_PICAS_TO_TWIPS(x) NSUnitsToTwips((x), 12.0f) // 12 points per pica
#define NS_DIDOTS_TO_TWIPS(x) NSUnitsToTwips((x), (16.0f / 15.0f)) // 15 didots per 16 points
#define NS_CICEROS_TO_TWIPS(x) NSUnitsToTwips((x), (12.0f * (16.0f / 15.0f))) // 12 didots per cicero
#define NS_TWIPS_TO_INCHES(x) NSTwipsToUnits((x), 1.0f / 72.0f)
#define NS_TWIPS_TO_FEET(x) NSTwipsToUnits((x), 1.0f / (72.0f * 12.0f))
#define NS_TWIPS_TO_MILES(x) NSTwipsToUnits((x), 1.0f / (72.0f * 12.0f * 5280.0f))
#define NS_TWIPS_TO_MILLIMETERS(x) NSTwipsToUnits((x), 1.0f / (72.0f * 0.03937f))
#define NS_TWIPS_TO_CENTIMETERS(x) NSTwipsToUnits((x), 1.0f / (72.0f * 0.3937f))
#define NS_TWIPS_TO_METERS(x) NSTwipsToUnits((x), 1.0f / (72.0f * 39.37f))
#define NS_TWIPS_TO_KILOMETERS(x) NSTwipsToUnits((x), 1.0f / (72.0f * 39370.0f))
#define NS_TWIPS_TO_PICAS(x) NSTwipsToUnits((x), 1.0f / 12.0f)
#define NS_TWIPS_TO_DIDOTS(x) NSTwipsToUnits((x), 1.0f / (16.0f / 15.0f))
#define NS_TWIPS_TO_CICEROS(x) NSTwipsToUnits((x), 1.0f / (12.0f * (16.0f / 15.0f)))
//@}
#endif

View File

@@ -1,74 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsVector_h__
#define nsVector_h__
#include "plvector.h"
#include "nsCom.h"
class nsVector : public PLVector {
public:
// Construction
nsVector(PRUint32 initialSize = 0, PRInt32 initialGrowBy = 0) {
PL_VectorInitialize(this, initialSize, initialGrowBy);
}
~nsVector(void) { PL_VectorFinalize(this); }
// Attributes
PRUint32 GetSize(void) const { return PL_VectorGetSize(this); }
PRUint32 GetUpperBound(void) const { return GetSize() - 1; }
PRBool SetSize(PRUint32 nNewSize, PRInt32 nGrowBy = PL_VECTOR_GROW_DEFAULT) {
return PL_VectorSetSize(this, nNewSize, nGrowBy);
}
PRBool IsValidIndex(PRUint32 indx) { return PL_VectorIsValidIndex(this, indx); }
// Operations
// Clean up
void Compact(void) { PL_VectorCompact(this); }
void RemoveAll(void) { SetSize(0); }
void Copy(nsVector* src, PRUint32 len, PRUint32 dstPos = 0, PRUint32 srcPos = 0) {
PL_VectorCopy(this, dstPos, src, srcPos, len);
}
// Accessing elements
void* Get(PRUint32 indx) const { return PL_VectorGet(this, indx); }
void Set(PRUint32 indx, void* newElement) { PL_VectorSet(this, indx, newElement); }
void*& ElementAt(PRUint32 indx) { return *PL_VectorGetAddr(this, indx); }
// Potentially growing the array
PRInt32 Add(void* newElement) { return PL_VectorAdd(this, newElement); }
// overloaded operator helpers
void* operator[](PRUint32 indx) const { return Get(indx); }
void*& operator[](PRUint32 indx) { return ElementAt(indx); }
// Operations that move elements around
void Insert(PRUint32 indx, void* newElement, PRInt32 count = 1) {
PL_VectorInsert(this, indx, newElement, count);
}
void Remove(PRUint32 indx, PRInt32 count = 1) {
PL_VectorRemove(this, indx, count);
}
#ifdef DEBUG
void AssertValid(void) const { PL_VectorAssertValid((PLVector*)this); }
#endif
};
#endif

View File

@@ -1,416 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsVoidArray.h"
#include "nsCRT.h"
#include "nsISizeOfHandler.h"
#include "nsString.h"
static PRInt32 kGrowArrayBy = 8;
nsVoidArray::nsVoidArray()
{
mArray = nsnull;
mArraySize = 0;
mCount = 0;
}
nsVoidArray::nsVoidArray(PRInt32 aCount)
{
NS_PRECONDITION(aCount > 0, "bad count");
mCount = mArraySize = aCount;
mArray = new void*[mCount];
nsCRT::memset(mArray, 0, mCount * sizeof(void*));
}
nsVoidArray& nsVoidArray::operator=(const nsVoidArray& other)
{
if (nsnull != mArray) {
delete [] mArray;
}
PRInt32 otherCount = other.mCount;
mArraySize = otherCount;
mCount = otherCount;
if (otherCount != 0) {
mArray = new void*[otherCount];
nsCRT::memcpy(mArray, other.mArray, otherCount * sizeof(void*));
} else {
mArray = nsnull;
}
return *this;
}
nsVoidArray::~nsVoidArray()
{
if (nsnull != mArray) {
delete [] mArray;
}
}
void
nsVoidArray::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this) + sizeof(void*) * mArraySize;
}
}
void* nsVoidArray::ElementAt(PRInt32 aIndex) const
{
if (PRUint32(aIndex) >= PRUint32(mCount)) {
return nsnull;
}
return mArray[aIndex];
}
PRInt32 nsVoidArray::IndexOf(void* aPossibleElement) const
{
void** ap = mArray;
void** end = ap + mCount;
while (ap < end) {
if (*ap == aPossibleElement) {
return ap - mArray;
}
ap++;
}
return -1;
}
PRBool nsVoidArray::InsertElementAt(void* aElement, PRInt32 aIndex)
{
PRInt32 oldCount = mCount;
if (PRUint32(aIndex) > PRUint32(oldCount)) {
// An invalid index causes the insertion to fail
return PR_FALSE;
}
if (oldCount + 1 > mArraySize) {
// We have to grow the array
PRInt32 newCount = oldCount + kGrowArrayBy;
void** newArray = new void*[newCount];
if (mArray != nsnull && aIndex != 0)
nsCRT::memcpy(newArray, mArray, aIndex * sizeof(void*));
PRInt32 slide = oldCount - aIndex;
if (0 != slide) {
// Slide data over to make room for the insertion
nsCRT::memcpy(newArray + aIndex + 1, mArray + aIndex,
slide * sizeof(void*));
}
if (mArray != nsnull)
delete [] mArray;
mArray = newArray;
mArraySize = newCount;
} else {
// The array is already large enough
PRInt32 slide = oldCount - aIndex;
if (0 != slide) {
// Slide data over to make room for the insertion
nsCRT::memmove(mArray + aIndex + 1, mArray + aIndex,
slide * sizeof(void*));
}
}
mArray[aIndex] = aElement;
mCount++;
return PR_TRUE;
}
PRBool nsVoidArray::ReplaceElementAt(void* aElement, PRInt32 aIndex)
{
if (PRUint32(aIndex) >= PRUint32(mArraySize)) {
PRInt32 requestedCount = aIndex + 1;
PRInt32 growDelta = requestedCount - mCount;
PRInt32 newCount = mCount + (growDelta > kGrowArrayBy ? growDelta : kGrowArrayBy);
void** newArray = new void*[newCount];
nsCRT::memset(newArray, 0, newCount * sizeof(void*));
if (newArray==nsnull)
return PR_FALSE;
if (mArray != nsnull && aIndex != 0) {
nsCRT::memcpy(newArray, mArray, mCount * sizeof(void*));
if (mArray != nsnull)
delete [] mArray;
}
mArray = newArray;
mArraySize = newCount;
}
mArray[aIndex] = aElement;
if (aIndex >= mCount)
mCount = aIndex+1;
return PR_TRUE;
}
PRBool nsVoidArray::RemoveElementAt(PRInt32 aIndex)
{
PRInt32 oldCount = mCount;
if (PRUint32(aIndex) >= PRUint32(oldCount)) {
// An invalid index causes the replace to fail
return PR_FALSE;
}
// We don't need to move any elements if we're removing the
// last element in the array
if (aIndex < (oldCount - 1)) {
nsCRT::memmove(mArray + aIndex, mArray + aIndex + 1,
(oldCount - 1 - aIndex) * sizeof(void*));
}
mCount--;
return PR_TRUE;
}
PRBool nsVoidArray::RemoveElement(void* aElement)
{
void** ep = mArray;
void** end = ep + mCount;
while (ep < end) {
void* e = *ep++;
if (e == aElement) {
ep--;
return RemoveElementAt(PRInt32(ep - mArray));
}
}
return PR_FALSE;
}
void nsVoidArray::Clear()
{
mCount = 0;
}
void nsVoidArray::Compact()
{
PRInt32 count = mCount;
if (mArraySize != count) {
void** newArray = new void*[count];
if (nsnull != newArray) {
nsCRT::memcpy(newArray, mArray, count * sizeof(void*));
delete [] mArray;
mArray = newArray;
mArraySize = count;
}
}
}
PRBool nsVoidArray::EnumerateForwards(nsVoidArrayEnumFunc aFunc, void* aData)
{
PRInt32 index = -1;
PRBool running = PR_TRUE;
while (running && (++index < mCount)) {
running = (*aFunc)(mArray[index], aData);
}
return running;
}
PRBool nsVoidArray::EnumerateBackwards(nsVoidArrayEnumFunc aFunc, void* aData)
{
PRInt32 index = mCount;
PRBool running = PR_TRUE;
while (running && (0 <= --index)) {
running = (*aFunc)(mArray[index], aData);
}
return running;
}
//----------------------------------------------------------------
// nsStringArray
nsStringArray::nsStringArray(void)
: nsVoidArray()
{
}
nsStringArray::~nsStringArray(void)
{
Clear();
}
nsStringArray&
nsStringArray::operator=(const nsStringArray& other)
{
if (nsnull != mArray) {
delete mArray;
}
PRInt32 otherCount = other.mCount;
mArraySize = otherCount;
mCount = otherCount;
if (0 < otherCount) {
mArray = new void*[otherCount];
while (0 <= --otherCount) {
nsString* otherString = (nsString*)(other.mArray[otherCount]);
mArray[otherCount] = new nsString(*otherString);
}
} else {
mArray = nsnull;
}
return *this;
}
void
nsStringArray::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
PRUint32 sum = 0;
nsVoidArray::SizeOf(aHandler, &sum);
PRInt32 index = mCount;
while (0 <= --index) {
nsString* string = (nsString*)mArray[index];
PRUint32 size;
string->SizeOf(aHandler, &size);
sum += size;
}
}
void
nsStringArray::StringAt(PRInt32 aIndex, nsString& aString) const
{
nsString* string = (nsString*)nsVoidArray::ElementAt(aIndex);
if (nsnull != string) {
aString = *string;
}
else {
aString.Truncate();
}
}
nsString*
nsStringArray::StringAt(PRInt32 aIndex) const
{
return (nsString*)nsVoidArray::ElementAt(aIndex);
}
PRInt32
nsStringArray::IndexOf(const nsString& aPossibleString) const
{
void** ap = mArray;
void** end = ap + mCount;
while (ap < end) {
nsString* string = (nsString*)*ap;
if (string->Equals(aPossibleString)) {
return ap - mArray;
}
ap++;
}
return -1;
}
PRInt32
nsStringArray::IndexOfIgnoreCase(const nsString& aPossibleString) const
{
void** ap = mArray;
void** end = ap + mCount;
while (ap < end) {
nsString* string = (nsString*)*ap;
if (string->EqualsIgnoreCase(aPossibleString)) {
return ap - mArray;
}
ap++;
}
return -1;
}
PRBool
nsStringArray::InsertStringAt(const nsString& aString, PRInt32 aIndex)
{
nsString* string = new nsString(aString);
if (nsVoidArray::InsertElementAt(string, aIndex)) {
return PR_TRUE;
}
delete string;
return PR_FALSE;
}
PRBool
nsStringArray::ReplaceStringAt(const nsString& aString, PRInt32 aIndex)
{
nsString* string = (nsString*)nsVoidArray::ElementAt(aIndex);
if (nsnull != string) {
*string = aString;
return PR_TRUE;
}
return PR_FALSE;
}
PRBool
nsStringArray::RemoveString(const nsString& aString)
{
PRInt32 index = IndexOf(aString);
if (-1 < index) {
return RemoveStringAt(index);
}
return PR_FALSE;
}
PRBool
nsStringArray::RemoveStringIgnoreCase(const nsString& aString)
{
PRInt32 index = IndexOfIgnoreCase(aString);
if (-1 < index) {
return RemoveStringAt(index);
}
return PR_FALSE;
}
PRBool nsStringArray::RemoveStringAt(PRInt32 aIndex)
{
nsString* string = StringAt(aIndex);
if (nsnull != string) {
nsVoidArray::RemoveElementAt(aIndex);
delete string;
return PR_TRUE;
}
return PR_FALSE;
}
void
nsStringArray::Clear(void)
{
PRInt32 index = mCount;
while (0 <= --index) {
nsString* string = (nsString*)mArray[index];
delete string;
}
nsVoidArray::Clear();
}
PRBool
nsStringArray::EnumerateForwards(nsStringArrayEnumFunc aFunc, void* aData)
{
PRInt32 index = -1;
PRBool running = PR_TRUE;
while (running && (++index < mCount)) {
running = (*aFunc)(*((nsString*)mArray[index]), aData);
}
return running;
}
PRBool
nsStringArray::EnumerateBackwards(nsStringArrayEnumFunc aFunc, void* aData)
{
PRInt32 index = mCount;
PRBool running = PR_TRUE;
while (running && (0 <= --index)) {
running = (*aFunc)(*((nsString*)mArray[index]), aData);
}
return running;
}

View File

@@ -1,125 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsVoidArray_h___
#define nsVoidArray_h___
#include "nscore.h"
class nsISizeOfHandler;
// Enumerator callback function. Return PR_FALSE to stop
typedef PRBool (*nsVoidArrayEnumFunc)(void* aElement, void *aData);
/// A basic zero-based array of void*'s that manages its own memory
class NS_COM nsVoidArray {
public:
nsVoidArray();
nsVoidArray(PRInt32 aCount); // initial count of aCount elements set to nsnull
virtual ~nsVoidArray();
nsVoidArray& operator=(const nsVoidArray& other);
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
PRInt32 Count() const {
return mCount;
}
void* ElementAt(PRInt32 aIndex) const;
void* operator[](PRInt32 aIndex) const { return ElementAt(aIndex); }
PRInt32 IndexOf(void* aPossibleElement) const;
PRBool InsertElementAt(void* aElement, PRInt32 aIndex);
PRBool ReplaceElementAt(void* aElement, PRInt32 aIndex);
PRBool AppendElement(void* aElement) {
return InsertElementAt(aElement, mCount);
}
PRBool RemoveElement(void* aElement);
PRBool RemoveElementAt(PRInt32 aIndex);
void Clear();
void Compact();
PRBool EnumerateForwards(nsVoidArrayEnumFunc aFunc, void* aData);
PRBool EnumerateBackwards(nsVoidArrayEnumFunc aFunc, void* aData);
protected:
void** mArray;
PRInt32 mArraySize;
PRInt32 mCount;
private:
/// Copy constructors are not allowed
nsVoidArray(const nsVoidArray& other);
};
class nsString;
typedef PRBool (*nsStringArrayEnumFunc)(nsString& aElement, void *aData);
class NS_COM nsStringArray: protected nsVoidArray
{
public:
nsStringArray(void);
virtual ~nsStringArray(void);
nsStringArray& operator=(const nsStringArray& other);
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
PRInt32 Count(void) const {
return mCount;
}
void StringAt(PRInt32 aIndex, nsString& aString) const;
nsString* StringAt(PRInt32 aIndex) const;
nsString* operator[](PRInt32 aIndex) const { return StringAt(aIndex); }
PRInt32 IndexOf(const nsString& aPossibleString) const;
PRInt32 IndexOfIgnoreCase(const nsString& aPossibleString) const;
PRBool InsertStringAt(const nsString& aString, PRInt32 aIndex);
PRBool ReplaceStringAt(const nsString& aString, PRInt32 aIndex);
PRBool AppendString(const nsString& aString) {
return InsertStringAt(aString, mCount);
}
PRBool RemoveString(const nsString& aString);
PRBool RemoveStringIgnoreCase(const nsString& aString);
PRBool RemoveStringAt(PRInt32 aIndex);
void Clear(void);
void Compact(void) {
nsVoidArray::Compact();
}
PRBool EnumerateForwards(nsStringArrayEnumFunc aFunc, void* aData);
PRBool EnumerateBackwards(nsStringArrayEnumFunc aFunc, void* aData);
private:
/// Copy constructors are not allowed
nsStringArray(const nsStringArray& other);
};
#endif /* nsVoidArray_h___ */

View File

@@ -1,179 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsDebug.h"
#include "nsIAllocator.h"
#include "nsXPIDLString.h"
#include "plstr.h"
// If the allocator changes, fix it here.
#define XPIDL_STRING_ALLOC(__len) ((PRUnichar*) nsAllocator::Alloc((__len) * sizeof(PRUnichar)))
#define XPIDL_CSTRING_ALLOC(__len) ((char*) nsAllocator::Alloc((__len) * sizeof(char)))
#define XPIDL_FREE(__ptr) (nsAllocator::Free(__ptr))
////////////////////////////////////////////////////////////////////////
// nsXPIDLString
nsXPIDLString::nsXPIDLString()
: mBuf(0),
mBufOwner(PR_FALSE)
{
}
nsXPIDLString::~nsXPIDLString()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
}
nsXPIDLString::operator const PRUnichar*()
{
return mBuf;
}
PRUnichar*
nsXPIDLString::Copy(const PRUnichar* aString)
{
NS_ASSERTION(aString, "null ptr");
if (! aString)
return 0;
PRInt32 len = 0;
{
const PRUnichar* p = aString;
while (*p++)
len++;
}
PRUnichar* result = XPIDL_STRING_ALLOC(len + 1);
if (result) {
PRUnichar* q = result;
while (*aString) {
*q = *aString;
q++;
aString++;
}
*q = '\0';
}
return result;
}
PRUnichar**
nsXPIDLString::StartAssignmentByValue()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_TRUE;
return &mBuf;
}
const PRUnichar**
nsXPIDLString::StartAssignmentByReference()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_FALSE;
return (const PRUnichar**) &mBuf;
}
////////////////////////////////////////////////////////////////////////
// nsXPIDLCString
nsXPIDLCString::nsXPIDLCString()
: mBuf(0),
mBufOwner(PR_FALSE)
{
}
nsXPIDLCString::~nsXPIDLCString()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
}
nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString)
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = Copy(aCString);
mBufOwner = PR_TRUE;
return *this;
}
nsXPIDLCString::operator const char*()
{
return mBuf;
}
char*
nsXPIDLCString::Copy(const char* aCString)
{
NS_ASSERTION(aCString, "null ptr");
if (! aCString)
return 0;
PRInt32 len = PL_strlen(aCString);
char* result = XPIDL_CSTRING_ALLOC(len + 1);
if (result)
PL_strcpy(result, aCString);
return result;
}
char**
nsXPIDLCString::StartAssignmentByValue()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_TRUE;
return &mBuf;
}
const char**
nsXPIDLCString::StartAssignmentByReference()
{
if (mBufOwner && mBuf)
XPIDL_FREE(mBuf);
mBuf = 0;
mBufOwner = PR_FALSE;
return (const char**) &mBuf;
}

View File

@@ -1,302 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
A set of string wrapper classes that ease transition to use of XPIDL
interfaces. nsXPIDLString and nsXPIDLCString are to XPIDL `wstring'
and `string' out params as nsCOMPtr is to generic XPCOM interface
pointers. They help you deal with object ownership.
Consider the following interface:
interface nsIFoo {
attribute string Bar;
};
This will generate the following C++ header file:
class nsIFoo {
NS_IMETHOD SetBar(const PRUnichar* aValue);
NS_IMETHOD GetBar(PRUnichar* *aValue);
};
The GetBar() method will allocate a copy of the nsIFoo object's
"bar" attribute, and leave you to deal with freeing it:
nsIFoo* aFoo; // assume we get this somehow
PRUnichar* bar;
aFoo->GetFoo(&bar);
// Use bar here...
printf("bar is %s!\n", bar);
nsAllocator::Free(bar);
This makes your life harder, because you need to convolute your code
to ensure that you don't leak `bar'.
Enter nsXPIDLString, which manages the ownership of the allocated
string, and automatically destroys it when the nsXPIDLString goes
out of scope:
nsIFoo* aFoo;
nsXPIDLString bar;
aFoo->GetFoo( getter_Copies(bar) );
// Use bar here...
printf("bar is %s!\n", (const char*) bar);
// no need to remember to nsAllocator::Free().
Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it
painfully clear exactly what the code expects. You need to wrap an
nsXPIDLString object with either `getter_Copies()' or
`getter_Shares()' before passing it to a getter: these tell the
nsXPIDLString how ownership is being handled.
In the case of `getter_Copies()', the callee is allocating a copy
(which is usually the case). In the case of `getter_Shares()', the
callee is returning a const reference to `the real deal' (this can
be done using the [shared] attribute in XPIDL).
*/
#ifndef nsXPIDLString_h__
#define nsXPIDLString_h__
#include "nsCom.h"
#include "prtypes.h"
#ifndef __PRUNICHAR__
#define __PRUNICHAR__
typedef PRUint16 PRUnichar;
#endif /* __PRUNICHAR__ */
////////////////////////////////////////////////////////////////////////
// nsXPIDLString
//
// A wrapper for Unicode strings. With the |getter_Copies()| and
// |getter_Shares()| helper functions, this can be used instead of
// the "naked" |PRUnichar*| interface for |wstring| parameters in
// XPIDL interfaces.
//
class NS_COM nsXPIDLString {
private:
PRUnichar* mBuf;
PRBool mBufOwner;
PRUnichar** StartAssignmentByValue();
const PRUnichar** StartAssignmentByReference();
public:
/**
* Construct a new, uninitialized wrapper for a Unicode string.
*/
nsXPIDLString();
virtual ~nsXPIDLString();
/**
* Return a reference to the immutable Unicode string.
*/
operator const PRUnichar*();
/**
* Make a copy of the Unicode string. Use this function in the
* callee to ensure that the correct memory allocator is used.
*/
static PRUnichar* Copy(const PRUnichar* aString);
// A helper class for assignment-by-value. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterCopies {
private:
nsXPIDLString& mXPIDLString;
public:
GetterCopies(nsXPIDLString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator PRUnichar**() {
return mXPIDLString.StartAssignmentByValue();
}
friend GetterCopies getter_Copies(nsXPIDLString& aXPIDLString);
};
friend class GetterCopies;
// A helper class for assignment-by-reference. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterShares {
private:
nsXPIDLString& mXPIDLString;
public:
GetterShares(nsXPIDLString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator const PRUnichar**() {
return mXPIDLString.StartAssignmentByReference();
}
friend GetterShares getter_Shares(nsXPIDLString& aXPIDLString);
};
friend class GetterShares;
private:
// not to be implemented
nsXPIDLString(nsXPIDLString& /* aXPIDLString */) {}
nsXPIDLString& operator =(nsXPIDLString& /* aXPIDLString */) { return *this; }
};
/**
* Use this function to "wrap" the nsXPIDLString object that is to
* receive an |out| value.
*/
inline nsXPIDLString::GetterCopies
getter_Copies(nsXPIDLString& aXPIDLString)
{
return nsXPIDLString::GetterCopies(aXPIDLString);
}
/**
* Use this function to "wrap" the nsXPIDLString object that is to
* receive a |[shared] out| value.
*/
inline nsXPIDLString::GetterShares
getter_Shares(nsXPIDLString& aXPIDLString)
{
return nsXPIDLString::GetterShares(aXPIDLString);
}
////////////////////////////////////////////////////////////////////////
// nsXPIDLCString
//
// A wrapper for Unicode strings. With the |getter_Copies()| and
// |getter_Shares()| helper functions, this can be used instead of
// the "naked" |char*| interface for |string| parameters in XPIDL
// interfaces.
//
class NS_COM nsXPIDLCString {
private:
char* mBuf;
PRBool mBufOwner;
char** StartAssignmentByValue();
const char** StartAssignmentByReference();
public:
/**
* Construct a new, uninitialized wrapper for a single-byte string.
*/
nsXPIDLCString();
virtual ~nsXPIDLCString();
/**
* Assign a single-byte string to this wrapper. Copies and owns the result.
*/
nsXPIDLCString& operator =(const char* aString);
/**
* Return a reference to the immutable single-byte string.
*/
operator const char*();
/**
* Make a copy of the single-byte string. Use this function in the
* callee to ensure that the correct memory allocator is used.
*/
static char* Copy(const char* aString);
// A helper class for assignment-by-value. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterCopies {
private:
nsXPIDLCString& mXPIDLString;
public:
GetterCopies(nsXPIDLCString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator char**() {
return mXPIDLString.StartAssignmentByValue();
}
friend GetterCopies getter_Copies(nsXPIDLCString& aXPIDLString);
};
friend class GetterCopies;
// A helper class for assignment-by-reference. This class is an
// implementation detail and should not be considered part of the
// public interface.
class NS_COM GetterShares {
private:
nsXPIDLCString& mXPIDLString;
public:
GetterShares(nsXPIDLCString& aXPIDLString)
: mXPIDLString(aXPIDLString) {}
operator const char**() {
return mXPIDLString.StartAssignmentByReference();
}
friend GetterShares getter_Shares(nsXPIDLCString& aXPIDLString);
};
friend class GetterShares;
private:
// not to be implemented
nsXPIDLCString(nsXPIDLCString& /* aXPIDLString */) {}
nsXPIDLCString& operator =(nsXPIDLCString& /* aXPIDLCString */) { return *this; }
};
/**
* Use this function to "wrap" the nsXPIDLCString object that is to
* receive an |out| value.
*/
inline nsXPIDLCString::GetterCopies
getter_Copies(nsXPIDLCString& aXPIDLString)
{
return nsXPIDLCString::GetterCopies(aXPIDLString);
}
/**
* Use this function to "wrap" the nsXPIDLCString object that is to
* receive a |[shared] out| value.
*/
inline nsXPIDLCString::GetterShares
getter_Shares(nsXPIDLCString& aXPIDLString)
{
return nsXPIDLCString::GetterShares(aXPIDLString);
}
#endif // nsXPIDLString_h__

View File

@@ -1,318 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "plvector.h"
#include "prmem.h"
#include <string.h>
#ifdef XP_WIN16
#define SIZE_T_MAX 0xFF80 /* a little less than 64K, the max alloc size on win16. */
#define MAX_ARR_ELEMS SIZE_T_MAX/sizeof(void*)
#endif
PR_IMPLEMENT(PLVector*)
PL_NewVector(PRUint32 initialSize, PRInt32 initialGrowBy)
{
PLVector* v = (PLVector*)PR_Malloc(sizeof(PLVector*));
if (v == NULL)
return NULL;
PL_VectorInitialize(v, initialSize, initialGrowBy);
return v;
}
PR_IMPLEMENT(void)
PL_VectorDestroy(PLVector* v)
{
PL_VectorFinalize(v);
PR_Free(v);
}
/* Initializes an existing vector */
PR_IMPLEMENT(void)
PL_VectorInitialize(PLVector* v, PRUint32 initialSize, PRInt32 initialGrowBy)
{
v->data = NULL;
v->size = v->maxSize = v->growBy = 0;
if (initialSize > 0 || initialGrowBy > 0)
PL_VectorSetSize(v, initialSize, initialGrowBy);
}
/* Destroys the elements, but doesn't free the vector */
PR_IMPLEMENT(void)
PL_VectorFinalize(PLVector* v)
{
/* This implementation doesn't do anything to delete the elements
in the vector -- that's up to the caller. (Don't shoot me,
I just copied the code from libmsg.) */
PR_Free(v->data);
}
PR_IMPLEMENT(PRBool)
PL_VectorSetSize(PLVector* v, PRUint32 newSize, PRInt32 growBy)
{
if (growBy != -1)
v->growBy = growBy; /* set new size */
if (newSize == 0) {
/* shrink to nothing */
PR_Free(v->data);
v->data = NULL;
v->size = v->maxSize = 0;
}
else if (v->data == NULL) {
/* create one with exact size */
#ifdef SIZE_T_MAX
PR_ASSERT(newSize <= SIZE_T_MAX/sizeof(void*)); /* no overflow */
#endif
v->data = (void**)PR_Malloc(newSize * sizeof(void *));
if (v->data == NULL) {
v->size = 0;
return PR_FALSE;
}
memset(v->data, 0, newSize * sizeof(void *)); /* zero fill */
v->size = v->maxSize = newSize;
}
else if (newSize <= v->maxSize) {
/* it fits */
if (newSize > v->size) {
/* initialize the new elements */
memset(&v->data[v->size], 0, (newSize-v->size) * sizeof(void *));
}
v->size = newSize;
}
else {
/* otherwise, grow array */
PRUint32 newMax;
void** newData;
PRInt32 ngrowBy = v->growBy;
if (ngrowBy == 0) {
/* heuristically determine growth when ngrowBy == 0
(this avoids heap fragmentation in many situations) */
ngrowBy = PR_MIN(1024, PR_MAX(4, v->size / 8));
}
#ifdef MAX_ARR_ELEMS
if (v->size + ngrowBy > MAX_ARR_ELEMS)
ngrowBy = MAX_ARR_ELEMS - v->size;
#endif
if (newSize < v->maxSize + ngrowBy)
newMax = v->maxSize + ngrowBy; /* granularity */
else
newMax = newSize; /* no slush */
#ifdef SIZE_T_MAX
if (newMax >= SIZE_T_MAX/sizeof(void*))
return PR_FALSE;
PR_ASSERT(newMax <= SIZE_T_MAX/sizeof(void*)); /* no overflow */
#endif
PR_ASSERT(newMax >= v->maxSize); /* no wrap around */
newData = (void**)PR_Malloc(newMax * sizeof(void*));
if (newData != NULL) {
/* copy new data from old */
memcpy(newData, v->data, v->size * sizeof(void*));
/* construct remaining elements */
PR_ASSERT(newSize > v->size);
memset(&newData[v->size], 0, (newSize-v->size) * sizeof(void*));
/* get rid of old stuff (note: no destructors called) */
PR_Free(v->data);
v->data = newData;
v->size = newSize;
v->maxSize = newMax;
}
else {
return PR_FALSE;
}
}
return PR_TRUE;
}
PR_IMPLEMENT(PRBool)
PL_VectorIsValidIndex(PLVector* v, PRUint32 index)
{
return (index < v->size) ? PR_TRUE : PR_FALSE;
}
PR_IMPLEMENT(void)
PL_VectorCompact(PLVector* v)
{
if (v->size != v->maxSize) {
/* shrink to desired size */
#ifdef SIZE_T_MAX
PR_ASSERT(v->size <= SIZE_T_MAX/sizeof(void *)); /* no overflow */
#endif
void ** newData = NULL;
if (v->size != 0) {
newData = (void **)PR_Malloc(v->size * sizeof(void *));
/* copy new data from old */
memcpy(newData, v->data, v->size * sizeof(void *));
}
/* get rid of old stuff (note: no destructors called) */
PR_Free(v->data);
v->data = newData;
v->maxSize = v->size;
}
}
#if 0 /* becomes Copy */
PR_IMPLEMENT(void)
PL_VectorSplice(PLVector* v, PRUint32 startIndex, PLVector* newVector)
{
PRUint32 i;
PR_ASSERT(newVector != NULL);
if (PL_VectorGetSize(newVector) > 0) {
PL_VectorInsert(v, startIndex, PL_VectorGet(newVector, 0),
PL_VectorGetSize(newVector));
for (i = 0; i < PL_VectorGetSize(newVector); i++)
PL_VectorSet(v, startIndex + i, PL_VectorGet(newVector, i));
}
}
#endif
PR_IMPLEMENT(void)
PL_VectorCopy(PLVector* dstVector, PRUint32 dstPosition,
PLVector* srcVector, PRUint32 srcPosition, PRUint32 length)
{
PR_ASSERT(0); /* XXX not implemented yet */
#if 0
PL_VectorSetSize(dstVector, PR_MAX(PL_VectorGetSize(dstVector),
PL_VectorGetSize(srcVector)),
PL_VECTOR_GROW_DEFAULT);
if (v->data)
PR_Free(v->data);
v->size = oldA->v->size;
v->maxSize = oldA->v->maxSize;
v->growBy = oldA->v->growBy;
v->data = (void**)PR_Malloc(v->size * sizeof(void *));
if (v->data == NULL) {
v->size = 0;
}
else {
memcpy(v->data, oldA->v->data, v->size * sizeof(void *));
}
#endif
}
PR_IMPLEMENT(PLVector*)
PL_VectorClone(PLVector* v)
{
PLVector* newVec = PL_NewVector(v->size, v->growBy);
PL_VectorCopy(newVec, 0, v, 0, v->size);
return newVec;
}
/* Accessing elements */
PR_IMPLEMENT(void)
PL_VectorSet(PLVector* v, PRUint32 index, void* newElement)
{
if (index >= v->size) {
if (!PL_VectorSetSize(v, index+1, PL_VECTOR_GROW_DEFAULT))
return;
}
v->data[index] = newElement;
}
/* Adds at the end */
PR_IMPLEMENT(PRUint32)
PL_VectorAdd(PLVector* v, void* newElement)
{
PRUint32 index = v->size;
#ifdef XP_WIN16
if (index >= SIZE_T_MAX / 4L) {
return -1;
}
#endif
PL_VectorSet(v, index, newElement);
return index;
}
/* Inserts new element count times at index */
PR_IMPLEMENT(void)
PL_VectorInsert(PLVector* v, PRUint32 index, void* newElement, PRUint32 count)
{
PR_ASSERT(count > 0); /* zero or negative size not allowed */
if (index >= v->size) {
/* adding after the end of the array */
if (!PL_VectorSetSize(v, index + count, PL_VECTOR_GROW_DEFAULT))
return; /* grow so index is valid */
}
else {
/* inserting in the middle of the array */
PRUint32 nOldSize = v->size;
if (!PL_VectorSetSize(v, v->size + count, PL_VECTOR_GROW_DEFAULT))
return; /* grow it to new size */
/* shift old data up to fill gap */
memmove(&v->data[index+count], &v->data[index],
(nOldSize-index) * sizeof(void *));
/* re-init slots we copied from */
memset(&v->data[index], 0, count * sizeof(void *));
}
/* insert new value in the gap */
PR_ASSERT(index + count <= v->size);
while (count--)
v->data[index++] = newElement;
}
/* Removes count elements at index */
PR_IMPLEMENT(void)
PL_VectorRemove(PLVector* v, PRUint32 index, PRUint32 count)
{
PRUint32 moveCount;
/* PR_ASSERT(count >= 0); */
PR_ASSERT(index + count <= v->size);
/* just remove a range */
moveCount = v->size - (index + count);
if (moveCount)
memmove(&v->data[index], &v->data[index + count],
moveCount * sizeof(void *));
v->size -= count;
}
#ifdef DEBUG
PR_IMPLEMENT(void)
PL_VectorAssertValid(PLVector* v)
{
if (v->data == NULL) {
PR_ASSERT(v->size == 0);
PR_ASSERT(v->maxSize == 0);
}
else {
/* PR_ASSERT(v->size >= 0); */
/* PR_ASSERT(v->maxSize >= 0); */
PR_ASSERT(v->size <= v->maxSize);
}
}
#endif

View File

@@ -1,100 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef plvector_h__
#define plvector_h__
#include "prtypes.h"
#include "prlog.h"
PR_BEGIN_EXTERN_C
/* Vectors are extensible arrays */
typedef struct PLVector {
void** data; /* the actual array of data */
PRUint32 size; /* # of elements (upperBound - 1) */
PRUint32 maxSize; /* max allocated */
PRInt32 growBy; /* grow amount */
} PLVector;
PR_EXTERN(PLVector*)
PL_NewVector(PRUint32 initialSize, PRInt32 initialGrowBy);
PR_EXTERN(void)
PL_VectorDestroy(PLVector* v);
/* Initializes an existing vector */
PR_EXTERN(void)
PL_VectorInitialize(PLVector* v, PRUint32 initialSize, PRInt32 initialGrowBy);
/* Destroys the elements, but doesn't free the vector */
PR_EXTERN(void)
PL_VectorFinalize(PLVector* v);
#define PL_VectorGetSize(v) ((v)->size)
#define PL_VECTOR_GROW_DEFAULT (-1)
PR_EXTERN(PRBool)
PL_VectorSetSize(PLVector* v, PRUint32 newSize, PRInt32 growBy);
PR_EXTERN(PRBool)
PL_VectorIsValidIndex(PLVector* v, PRUint32 index);
PR_EXTERN(void)
PL_VectorCompact(PLVector* v);
PR_EXTERN(void)
PL_VectorCopy(PLVector* dstVector, PRUint32 dstPosition,
PLVector* srcVector, PRUint32 srcPosition, PRUint32 length);
PR_EXTERN(PLVector*)
PL_VectorClone(PLVector* v);
/* Accessing elements */
#define PL_VectorGetAddr(v, index) (PR_ASSERT((index) < (v)->size), &(v)->data[index])
#define PL_VectorGet(v, index) (*PL_VectorGetAddr(v, index))
PR_EXTERN(void)
PL_VectorSet(PLVector* v, PRUint32 index, void* newElement);
/* Adds at the end */
PR_EXTERN(PRUint32)
PL_VectorAdd(PLVector* v, void* newElement);
/* Inserts new element count times at index */
PR_EXTERN(void)
PL_VectorInsert(PLVector* v, PRUint32 index, void* newElement, PRUint32 count);
/* Removes count elements at index */
PR_EXTERN(void)
PL_VectorRemove(PLVector* v, PRUint32 index, PRUint32 count);
#ifdef DEBUG
PR_EXTERN(void)
PL_VectorAssertValid(PLVector* v);
#endif
PR_END_EXTERN_C
#endif /* plvector_h__ */

View File

@@ -1,10 +0,0 @@
nsEscape.h
nsFileSpec.h
nsFileSpecStreaming.h
nsFileStream.h
nsIByteBufferInputStream.h
nsIFileStream.h
nsIStringStream.h
nsIUnicharInputStream.h
nsSpecialSystemDirectory.h
nsPipe2.h

View File

@@ -1,6 +0,0 @@
nsIFileSpec.idl
nsIBufferInputStream.idl
nsIInputStream.idl
nsIBaseStream.idl
nsIOutputStream.idl
nsIPipe.idl

View File

@@ -1,79 +0,0 @@
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = xpcom
XPIDL_MODULE = xpcom_io
LIBRARY_NAME = xpcomio_s
REQUIRES = xpcom uconv unicharutil
CPPSRCS = \
nsEscape.cpp \
nsFileSpec.cpp \
nsFileSpecStreaming.cpp \
nsFileStream.cpp \
nsFileSpecImpl.cpp \
nsIFileStream.cpp \
nsIStringStream.cpp \
nsSegmentedBuffer.cpp \
nsPipe2.cpp \
nsSpecialSystemDirectory.cpp \
nsUnicharInputStream.cpp \
$(NULL)
EXPORTS = \
nsEscape.h \
nsFileSpec.h \
nsFileSpecStreaming.h \
nsFileStream.h \
nsIFileStream.h \
nsIStringStream.h \
nsIUnicharInputStream.h \
nsSpecialSystemDirectory.h \
$(NULL)
XPIDLSRCS = \
nsIPipe.idl \
nsIFileSpec.idl \
nsIBaseStream.idl \
nsIInputStream.idl \
nsIOutputStream.idl \
nsIBufferInputStream.idl \
nsIBufferOutputStream.idl \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
# we don't want the shared lib, but we want to force the creation of a static lib.
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
include $(topsrcdir)/config/rules.mk
DEFINES += -D_IMPL_NS_COM -D_IMPL_NS_BASE
ifeq ($(OS_ARCH), Linux)
DEFINES += -D_BSD_SOURCE
endif

View File

@@ -1,386 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsByteBufferInputStream.h"
#include "prcmon.h"
NS_IMETHODIMP
nsDummyBufferStream::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
NS_NOTREACHED("nsDummyBufferStream::QueryInterface");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP_(nsrefcnt)
nsDummyBufferStream::AddRef(void)
{
NS_NOTREACHED("nsDummyBufferStream::AddRef");
return 1;
}
NS_IMETHODIMP_(nsrefcnt)
nsDummyBufferStream::Release(void)
{
NS_NOTREACHED("nsDummyBufferStream::Release");
return 1;
}
////////////////////////////////////////////////////////////////////////////////
// nsByteBufferInputStream methods:
////////////////////////////////////////////////////////////////////////////////
nsByteBufferInputStream::nsByteBufferInputStream(PRBool blocking, PRUint32 size)
: mBuffer(nsnull), mLength(size), mReadCursor(0), mWriteCursor(0),
mFull(PR_FALSE), mClosed(PR_FALSE), mEOF(PR_FALSE), mBlocking(blocking)
{
NS_INIT_REFCNT();
}
nsresult
nsByteBufferInputStream::Init(void)
{
mBuffer = new char[mLength];
if (mBuffer == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}
nsByteBufferInputStream::~nsByteBufferInputStream()
{
(void)Close();
if (mBuffer) delete mBuffer;
}
NS_IMPL_ISUPPORTS3(nsByteBufferInputStream, nsIByteBufferInputStream, nsIInputStream, nsIBaseStream)
NS_IMETHODIMP
nsByteBufferInputStream::Close(void)
{
nsresult rv = NS_OK;
if (mBlocking)
PR_CEnterMonitor(this);
mClosed = PR_TRUE;
if (mBlocking) {
PRStatus status = PR_CNotify(this); // wake up the writer
if (status != PR_SUCCESS)
rv = NS_ERROR_FAILURE;
PR_CExitMonitor(this);
}
return rv;
}
NS_IMETHODIMP
nsByteBufferInputStream::GetLength(PRUint32 *aLength)
{
if (mClosed)
return NS_BASE_STREAM_CLOSED;
if (mBlocking)
PR_CEnterMonitor(this);
*aLength = ReadableAmount();
if (mBlocking)
PR_CExitMonitor(this);
return NS_OK;
}
NS_IMETHODIMP
nsByteBufferInputStream::Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount)
{
nsresult rv = NS_OK;
if (mClosed)
return NS_BASE_STREAM_CLOSED;
if (AtEOF())
return NS_BASE_STREAM_EOF;
if (mBlocking)
PR_CEnterMonitor(this);
*aReadCount = 0;
/*while (aCount > 0)*/ {
if (ReadableAmount() == 0) {
if (mBlocking) {
PRStatus status = PR_CWait(this, PR_INTERVAL_NO_TIMEOUT);
if (status != PR_SUCCESS) {
rv = NS_ERROR_FAILURE;
goto done;
}
}
if (mEOF) {
rv = NS_BASE_STREAM_EOF;
goto done;
}
else if (!mBlocking) {
rv = NS_BASE_STREAM_WOULD_BLOCK;
goto done;
}
}
// wrap-around buffer:
PRUint32 amt = 0;
if (mReadCursor >= mWriteCursor || mFull) {
ReadChunk(aBuf, aCount, mLength, &amt);
*aReadCount += amt;
aBuf += amt;
aCount -= amt;
if (mReadCursor == mLength) {
mReadCursor = 0;
amt = 0;
ReadChunk(aBuf, aCount, mWriteCursor, &amt);
*aReadCount += amt;
aBuf += amt;
aCount -= amt;
}
}
else {
ReadChunk(aBuf, aCount, mWriteCursor, &amt);
*aReadCount += amt;
aBuf += amt;
aCount -= amt;
}
if (*aReadCount)
mFull = PR_FALSE;
if (mBlocking) {
PRStatus status = PR_CNotify(this); // tell the writer there's space
if (status != PR_SUCCESS)
rv = NS_ERROR_FAILURE;
}
}
done:
if (mBlocking)
PR_CExitMonitor(this);
return rv;
}
NS_IMETHODIMP
nsByteBufferInputStream::Fill(const char* aBuf, PRUint32 aCount, PRUint32 *aWriteCount)
{
nsDummyBufferStream in(aBuf, aCount);
return Fill(&in, aCount, aWriteCount);
}
NS_IMETHODIMP
nsByteBufferInputStream::Fill(nsIInputStream* stream, PRUint32 aCount, PRUint32 *aWriteCount)
{
nsresult rv = NS_OK;
if (mClosed || mEOF)
return NS_BASE_STREAM_CLOSED;
*aWriteCount = 0;
if (mBlocking)
PR_CEnterMonitor(this);
while (aCount > 0) {
if (WritableAmount() == 0) {
if (mBlocking) {
PRStatus status = PR_CWait(this, PR_INTERVAL_NO_TIMEOUT);
if (status != PR_SUCCESS) {
rv = NS_ERROR_FAILURE;
goto done;
}
}
if (mClosed) {
rv = NS_BASE_STREAM_CLOSED;
goto done;
}
else if (!mBlocking) {
rv = NS_BASE_STREAM_WOULD_BLOCK;
goto done;
}
}
// wrap-around buffer:
PRUint32 amt = 0;
if (mReadCursor <= mWriteCursor && !mFull) {
rv = WriteChunk(stream, mLength, &amt);
if (NS_FAILED(rv)) goto done;
*aWriteCount += amt;
aCount -= amt;
if (mWriteCursor == mLength) {
mWriteCursor = 0;
amt = 0;
rv = WriteChunk(stream, mReadCursor, &amt);
if (NS_FAILED(rv)) goto done;
*aWriteCount += amt;
aCount -= amt;
}
}
else {
rv = WriteChunk(stream, mReadCursor, &amt);
if (NS_FAILED(rv)) goto done;
*aWriteCount += amt;
aCount -= amt;
}
if (mWriteCursor == mReadCursor)
mFull = PR_TRUE;
if (mBlocking) {
PRStatus status = PR_CNotify(this); // tell the reader there's more
if (status != PR_SUCCESS)
rv = NS_ERROR_FAILURE;
}
}
done:
if (mBlocking)
PR_CExitMonitor(this);
return rv;
}
nsresult
nsByteBufferInputStream::SetEOF()
{
nsresult rv = NS_OK;
if (mBlocking)
PR_CEnterMonitor(this);
mEOF = PR_TRUE;
if (mBlocking) {
PRStatus status = PR_CNotify(this); // wake up the reader
if (status != PR_SUCCESS)
rv = NS_ERROR_FAILURE;
PR_CExitMonitor(this);
}
return rv;
}
nsresult
nsByteBufferInputStream::Drain()
{
nsresult rv = NS_OK;
if (mBlocking) {
PR_CEnterMonitor(this);
while (ReadableAmount() != 0) {
PRStatus status = PR_CNotify(this); // wake up the reader
if (status != PR_SUCCESS) {
rv = NS_ERROR_FAILURE;
break;
}
else {
// wait for the reader to take all the data
status = PR_CWait(this, PR_INTERVAL_NO_TIMEOUT);
if (status != PR_SUCCESS) {
rv = NS_ERROR_FAILURE;
break;
}
}
}
PR_CExitMonitor(this);
}
return rv;
}
////////////////////////////////////////////////////////////////////////////////
// nsByteBufferOutputStream methods:
////////////////////////////////////////////////////////////////////////////////
nsByteBufferOutputStream::nsByteBufferOutputStream(nsByteBufferInputStream* in)
: mInputStream(in)
{
NS_INIT_REFCNT();
NS_ADDREF(mInputStream);
}
nsByteBufferOutputStream::~nsByteBufferOutputStream()
{
(void)Close();
NS_IF_RELEASE(mInputStream);
}
NS_IMPL_ISUPPORTS2(nsByteBufferOutputStream, nsIOutputStream, nsIBaseStream)
NS_IMETHODIMP
nsByteBufferOutputStream::Close(void)
{
mInputStream->SetEOF();
return NS_OK;
}
NS_IMETHODIMP
nsByteBufferOutputStream::Write(const char* aBuf, PRUint32 aCount,
PRUint32 *aWriteCount)
{
return mInputStream->Fill(aBuf, aCount, aWriteCount);
}
NS_IMETHODIMP
nsByteBufferOutputStream::WriteFrom(nsIInputStream* fromStream, PRUint32 aCount,
PRUint32 *aWriteCount)
{
return mInputStream->Fill(fromStream, aCount, aWriteCount);
}
NS_IMETHODIMP
nsByteBufferOutputStream::Flush(void)
{
return mInputStream->Drain();
}
////////////////////////////////////////////////////////////////////////////////
NS_COM nsresult
NS_NewByteBufferInputStream(nsIByteBufferInputStream* *result,
PRBool blocking, PRUint32 size)
{
nsresult rv;
nsByteBufferInputStream* inStr = nsnull;
inStr = new nsByteBufferInputStream(blocking, size);
if (inStr == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
rv = inStr->Init();
if (NS_FAILED(rv)) {
delete inStr;
return rv;
}
NS_ADDREF(inStr);
*result = inStr;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
NS_COM nsresult
NS_NewPipe(nsIInputStream* *inStrResult,
nsIOutputStream* *outStrResult,
PRBool blocking, PRUint32 size)
{
nsresult rv;
nsIByteBufferInputStream* in;
nsByteBufferInputStream* inStr;
nsByteBufferOutputStream* outStr;
rv = NS_NewByteBufferInputStream(&in, blocking, size);
if (NS_FAILED(rv)) return rv;
// this cast is safe, because we know how NS_NewByteBufferInputStream works:
inStr = NS_STATIC_CAST(nsByteBufferInputStream*, in);
outStr = new nsByteBufferOutputStream(inStr);
if (outStr == nsnull) {
NS_RELEASE(inStr);
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(outStr);
*inStrResult = inStr;
*outStrResult = outStr;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,180 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsByteBufferInputStream_h__
#define nsByteBufferInputStream_h__
#include "nsIByteBufferInputStream.h"
#include "nsCRT.h"
class nsByteBufferInputStream;
////////////////////////////////////////////////////////////////////////////////
class nsByteBufferOutputStream : public nsIOutputStream
{
public:
NS_DECL_ISUPPORTS
// nsIBaseStream methods:
NS_DECL_NSIBASESTREAM
// nsIOutputStream methods:
NS_DECL_NSIOUTPUTSTREAM
// This method isn't in nsIOutputStream...
NS_IMETHOD WriteFrom(nsIInputStream* fromStream, PRUint32 aCount,
PRUint32 *aWriteCount);
// nsByteBufferOutputStream methods:
nsByteBufferOutputStream(nsByteBufferInputStream* in);
virtual ~nsByteBufferOutputStream();
protected:
nsByteBufferInputStream* mInputStream;
};
////////////////////////////////////////////////////////////////////////////////
class nsByteBufferInputStream : public nsIByteBufferInputStream
{
public:
NS_DECL_ISUPPORTS
// nsIBaseStream methods:
NS_DECL_NSIBASESTREAM
// nsIInputStream methods:
NS_DECL_NSIINPUTSTREAM
// nsIByteBufferInputStream methods:
NS_IMETHOD Fill(nsIInputStream* stream, PRUint32 aCount, PRUint32 *aWriteCount);
NS_IMETHOD Fill(const char* aBuf, PRUint32 aCount, PRUint32 *aWriteCount);
// nsByteBufferInputStream methods:
nsByteBufferInputStream(PRBool blocking, PRUint32 size);
virtual ~nsByteBufferInputStream();
friend class nsByteBufferOutputStream;
nsresult Init(void);
nsresult SetEOF(void);
nsresult Drain(void);
PRBool AtEOF() { return mEOF && (mReadCursor == mWriteCursor) && !mFull; }
PRUint32 ReadableAmount() {
if (mReadCursor < mWriteCursor)
return mWriteCursor - mReadCursor;
else if (mReadCursor == mWriteCursor && !mFull)
return 0;
else
return (mLength - mReadCursor) + mWriteCursor;
}
PRUint32 WritableAmount() {
if (mWriteCursor < mReadCursor)
return mWriteCursor - mReadCursor;
else if (mReadCursor == mWriteCursor && mFull)
return 0;
else
return (mLength - mWriteCursor) + mReadCursor;
}
void ReadChunk(char* toBuf, PRUint32 max,
PRUint32 end, PRUint32 *totalRef)
{
NS_ASSERTION(mReadCursor <= end, "bad range");
PRUint32 diff = end - mReadCursor;
PRInt32 amt = PR_MIN(max, diff);
if (amt > 0) {
nsCRT::memcpy(toBuf, &mBuffer[mReadCursor], amt);
#ifdef DEBUG_warren
// nsCRT::memset(&mBuffer[mReadCursor], 0xDD, amt);
#endif
mReadCursor += amt;
*totalRef += amt;
}
}
nsresult WriteChunk(nsIInputStream* in,
PRUint32 end, PRUint32 *totalRef)
{
NS_ASSERTION(mWriteCursor <= end, "bad range");
PRUint32 amt = end - mWriteCursor;
if (amt > 0) {
PRUint32 readAmt;
nsresult rv = in->Read(&mBuffer[mWriteCursor], amt, &readAmt);
if (NS_FAILED(rv) || readAmt == 0) return rv;
mWriteCursor += readAmt;
*totalRef += readAmt;
}
return NS_OK;
}
protected:
char* mBuffer;
PRUint32 mLength;
PRUint32 mReadCursor;
PRUint32 mWriteCursor;
PRBool mFull;
PRBool mClosed;
PRBool mEOF;
PRBool mBlocking;
};
////////////////////////////////////////////////////////////////////////////////
class nsDummyBufferStream : public nsIInputStream
{
public:
NS_DECL_ISUPPORTS
// nsIBaseStream methods:
NS_IMETHOD Close(void) {
NS_NOTREACHED("nsDummyBufferStream::Close");
return NS_ERROR_FAILURE;
}
// nsIInputStream methods:
NS_IMETHOD GetLength(PRUint32 *aLength) {
*aLength = mLength;
return NS_OK;
}
NS_IMETHOD Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount) {
PRUint32 amt = PR_MIN(aCount, mLength);
if (amt > 0) {
nsCRT::memcpy(aBuf, mBuffer, amt);
mBuffer += amt;
mLength -= amt;
}
*aReadCount = amt;
return NS_OK;
}
// nsDummyBufferStream methods:
nsDummyBufferStream(const char* buffer, PRUint32 length)
: mBuffer(buffer), mLength(length) {}
virtual ~nsDummyBufferStream() {}
protected:
const char* mBuffer;
PRUint32 mLength;
};
#endif // nsByteBufferInputStream_h__

Some files were not shown because too many files have changed in this diff Show More