Compare commits

..

1764 Commits

Author SHA1 Message Date
warren%netscape.com
bd0616d861 Changes for removing nsIRDFResource and nsIRDFNode in favor of nsISupports.
git-svn-id: svn://10.0.0.236/branches/NoRDFResources2_BRANCH@24442 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 11:43:13 +00:00
warren%netscape.com
65efc2a867 Linked with xpcom32.dll because of non-inlined nsCStringKey methods (because of -pedantic on linux).
git-svn-id: svn://10.0.0.236/branches/NoRDFResources2_BRANCH@24441 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 11:38:19 +00:00
warren%netscape.com
0f42597e40 Moving stuff from base/src because linux egcs -pedantic doesn't like it.
git-svn-id: svn://10.0.0.236/branches/NoRDFResources2_BRANCH@24440 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 10:31:03 +00:00
warren%netscape.com
4b45375ab4 Moved NoRDFResources_BRANCH forward.
git-svn-id: svn://10.0.0.236/branches/NoRDFResources2_BRANCH@24436 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 09:31:52 +00:00
(no author)
fe44c577bf This commit was manufactured by cvs2svn to create branch
'NoRDFResources2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NoRDFResources2_BRANCH@24421 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 06:08:31 +00:00
jefft%netscape.com
27308a8c83 added some thread stuff
git-svn-id: svn://10.0.0.236/trunk@24419 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 06:08:29 +00:00
jefft%netscape.com
f2eaef5222 added GetThreadEventQueue() method
git-svn-id: svn://10.0.0.236/trunk@24418 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 06:07:31 +00:00
rpotts%netscape.com
f991b0aae1 fix for crash in bug #2991... We still need to figure out why the EventQueue is not being returned properly on the Mac.
git-svn-id: svn://10.0.0.236/trunk@24417 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 05:54:17 +00:00
warren%netscape.com
be9f0afe1a Added nsHashtable::Exists. Renamed nsProgIDKey to nsCStringKey (what it is).
git-svn-id: svn://10.0.0.236/trunk@24416 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 05:51:49 +00:00
warren%netscape.com
0adad0956a Added NS_WITH_SERVICE1 macro.
git-svn-id: svn://10.0.0.236/trunk@24415 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 05:48:49 +00:00
warren%netscape.com
23227822ab Added missing flush.
git-svn-id: svn://10.0.0.236/trunk@24414 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 05:42:20 +00:00
jband%netscape.com
55e7b193c6 update TODO list, fixed finalization to wrapper release mapping for wrapped native
git-svn-id: svn://10.0.0.236/trunk@24413 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 04:57:09 +00:00
jband%netscape.com
eee31f5abc fail gracefully on badly formed uuid
git-svn-id: svn://10.0.0.236/trunk@24412 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 04:54:47 +00:00
rjc%netscape.com
9861dabea1 Remember cast of void ** on QueryInterface!
git-svn-id: svn://10.0.0.236/trunk@24411 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 04:19:55 +00:00
rjc%netscape.com
24670425e0 Added a comment about nsString.Find() which is currently only case-significant. We really want to have a case-insignificant Find().
git-svn-id: svn://10.0.0.236/trunk@24410 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 04:17:17 +00:00
rjc%netscape.com
08cba24f65 Finish implementing match criterion.
git-svn-id: svn://10.0.0.236/trunk@24409 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 04:14:20 +00:00
rjc%netscape.com
811dce0032 Add some more sample Find queries and some Mac bookmarks.
git-svn-id: svn://10.0.0.236/trunk@24408 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 04:14:01 +00:00
mscott%netscape.com
e9a5f53984 Helping with smoketest. When we are done running a mailbox url, write the phrase Mailbox Done followed by a line return to a text file. QA will build an automated smoketest which will look for this phrase in that particular file. I've also wrapped the change in a ENABLE_SMOKETEST ifdef....
git-svn-id: svn://10.0.0.236/trunk@24407 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 04:09:33 +00:00
rhp%netscape.com
45fde4db60 No need to build this test anymore.
git-svn-id: svn://10.0.0.236/trunk@24406 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 03:58:08 +00:00
morse%netscape.com
a5112b76e0 workaround for bug 3585
git-svn-id: svn://10.0.0.236/trunk@24405 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 03:42:54 +00:00
putterman%netscape.com
75488e2db2 Added some of the special folder icons.
git-svn-id: svn://10.0.0.236/trunk@24404 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 02:29:49 +00:00
putterman%netscape.com
f01846a383 Added Special Folder attribute
git-svn-id: svn://10.0.0.236/trunk@24403 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 02:28:41 +00:00
pierre%netscape.com
6d5fbbc51a #3821 "Enter Key should be mapped to Return"
git-svn-id: svn://10.0.0.236/trunk@24402 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 02:23:51 +00:00
rjc%netscape.com
897bbefdb0 Remove const.
git-svn-id: svn://10.0.0.236/trunk@24401 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:56:21 +00:00
slamm%netscape.com
8f8d0710a9 Last changes were not working as well as I would have liked. Reverting to 1.1
git-svn-id: svn://10.0.0.236/trunk@24400 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:52:36 +00:00
rjc%netscape.com
9c9a163de9 When sorting (not natural order), first ask for a slightly modified target value. This allows a datasource to detect when a value is being asked for sorting purposes and can be smart... for example, a mail datasource could strip off the "Re:" on mail messages.
git-svn-id: svn://10.0.0.236/trunk@24399 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:52:18 +00:00
rjc%netscape.com
932a5d0716 AppCores is no longer in the "Components" directory as it no longer auto-registers, so modify Setup_Registry() to register RDF AppCore at startup.
git-svn-id: svn://10.0.0.236/trunk@24398 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:45:03 +00:00
nisheeth%netscape.com
b18288c5e8 Fix for bug 3584.
Change coded by vidur.  Reviewed by me.  Document.written documents now get
a default "about:blank" url assigned to them.  This fixes crash bugs associated
with other code assuming that all documents have non-null urls.

Approved by chofmann.


git-svn-id: svn://10.0.0.236/trunk@24397 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:41:09 +00:00
mscott%netscape.com
3643ece092 Remove a debug printf which displayed each line of the message to the terminal when displaying messages to the window.
git-svn-id: svn://10.0.0.236/trunk@24395 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:36:07 +00:00
cata%netscape.com
ef25a6922f UTF8 name fixed.
git-svn-id: svn://10.0.0.236/trunk@24394 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:33:47 +00:00
rhp%netscape.com
d8b375c905 Fix to not output HTML into an image stream
git-svn-id: svn://10.0.0.236/trunk@24393 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:29:51 +00:00
cata%netscape.com
2855549c08 UTF8 decoder added.
git-svn-id: svn://10.0.0.236/trunk@24392 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:20:55 +00:00
radha%netscape.com
da6bf59c4c Remove a bunch of compiler warnings in linux
git-svn-id: svn://10.0.0.236/trunk@24390 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:16:40 +00:00
radha%netscape.com
e738766b6f Remove unwanted printfs
git-svn-id: svn://10.0.0.236/trunk@24389 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:16:04 +00:00
radha%netscape.com
1acd176e0b Implement 2 interfaces to return handle to argc and argv.
Conform to code style standards


git-svn-id: svn://10.0.0.236/trunk@24388 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:15:39 +00:00
cata%netscape.com
197ba000d3 UTF8 decoder added.
git-svn-id: svn://10.0.0.236/trunk@24387 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:15:04 +00:00
cata%netscape.com
9747add336 added files: mozilla/intl/uconv/ucvlatin/nsUTF8ToUnicode.cpp
git-svn-id: svn://10.0.0.236/trunk@24386 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:14:40 +00:00
radha%netscape.com
e2164b3a5a Add 2 interfaces to Get a handle to argc & argv
git-svn-id: svn://10.0.0.236/trunk@24385 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:14:29 +00:00
rjc%netscape.com
c352803b36 Be sure to NS_INIT_REFCNT() for InMemoryResourceCursor() creation.
git-svn-id: svn://10.0.0.236/trunk@24384 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:09:48 +00:00
cata%netscape.com
761bd22e70 Created.
git-svn-id: svn://10.0.0.236/trunk@24383 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 01:08:01 +00:00
putterman%netscape.com
6015ef11cc Make folder tree take up the entire pane.
git-svn-id: svn://10.0.0.236/trunk@24380 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:52:38 +00:00
rjc%netscape.com
6a2fa958ca Only answer questions with positive assertions.
git-svn-id: svn://10.0.0.236/trunk@24377 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:44:04 +00:00
dougt%netscape.com
6318f7f44d Added queue to hold pending downloads
Further object wacking


git-svn-id: svn://10.0.0.236/trunk@24375 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:32:05 +00:00
mcafee%netscape.com
0641420d4d Adding default cases to switch statements.
git-svn-id: svn://10.0.0.236/trunk@24373 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:25:40 +00:00
putterman%netscape.com
1d91b0a3ab Added some icons to folder and thread panes
git-svn-id: svn://10.0.0.236/trunk@24372 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:24:30 +00:00
mcafee%netscape.com
3a1ed69e24 Uninitialized variable.
git-svn-id: svn://10.0.0.236/trunk@24371 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:20:02 +00:00
mcafee%netscape.com
55780280ad Adding default path for case statement.
git-svn-id: svn://10.0.0.236/trunk@24370 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:18:01 +00:00
rhp%netscape.com
86ba9c355f Adding the Mime Emitter to CVS - Note: this is not part of the build
process until the 3/19/99 checkin.


git-svn-id: svn://10.0.0.236/trunk@24369 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:17:39 +00:00
pierre%netscape.com
0495949bcb Fix for #3899. Bumped the stack size to 128K from 64K. r: beard. a:chofmann.
git-svn-id: svn://10.0.0.236/trunk@24368 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:02:52 +00:00
rjc%netscape.com
8c8c80a991 Add RDF find datasource into build system.
git-svn-id: svn://10.0.0.236/trunk@24367 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:01:49 +00:00
rjc%netscape.com
e76723a678 No longer checking if a file URL is a directory and, if so, appending a slash. nsFileSpec et.al. should be doing that now.
git-svn-id: svn://10.0.0.236/trunk@24366 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-19 00:00:52 +00:00
slamm%netscape.com
01dd2340ab -mQuiet the cvs checkout with -q. It will still print what is updated. It just won't print the name of every directory it recurses through. Cleared with cyeh.
git-svn-id: svn://10.0.0.236/trunk@24365 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 23:50:10 +00:00
ramiro%netscape.com
aa125ee2a3 Wrapped in PR_BEGIN_EXTERN_C and PR_END_EXTERN_C to fix c++/c linkage problem.
git-svn-id: svn://10.0.0.236/trunk@24364 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 23:29:50 +00:00
waterson%netscape.com
b90124e8b8 Bug 3978. Removed warning: it was silly. This happens all the time for HTML content in a XUL document.
git-svn-id: svn://10.0.0.236/trunk@24361 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 23:04:58 +00:00
mcafee%netscape.com
d2cba4a33a Solaris needs prototype for PR_GetEnv().
git-svn-id: svn://10.0.0.236/trunk@24360 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:41:24 +00:00
terry%netscape.com
7546019541 Was not correctly checking BUGSYSTEMEXPR (because the config file
hadn't been read in).


git-svn-id: svn://10.0.0.236/trunk@24359 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:41:07 +00:00
larryh%netscape.com
6a18742292 OS2 changes
git-svn-id: svn://10.0.0.236/trunk@24358 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:39:53 +00:00
rjc%netscape.com
bff5b3f3b5 Add Find datasource CID.
git-svn-id: svn://10.0.0.236/trunk@24357 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:38:30 +00:00
mcafee%netscape.com
8b40395ae3 Switch to PR_GetEnv(), warn once if MOZILLA_FIVE_HOME is not set.
git-svn-id: svn://10.0.0.236/trunk@24356 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:38:25 +00:00
rjc%netscape.com
795c83a346 Add a sample "Find Queries" bookmark folder for testing.
git-svn-id: svn://10.0.0.236/trunk@24355 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:36:13 +00:00
rjc%netscape.com
21eed2a9d9 Export nsIRDFFind.h
git-svn-id: svn://10.0.0.236/trunk@24354 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:35:12 +00:00
rjc%netscape.com
95da1fcacb First Checked In.
git-svn-id: svn://10.0.0.236/trunk@24353 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:34:22 +00:00
mcafee%netscape.com
f288fcb962 Added prototype for UnixPrDialog(). r=syd@netscape.com
git-svn-id: svn://10.0.0.236/trunk@24352 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:33:04 +00:00
neeti%netscape.com
f678a0a658 First version
git-svn-id: svn://10.0.0.236/trunk@24351 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:32:56 +00:00
cata%netscape.com
393b785270 Added new return codes.
git-svn-id: svn://10.0.0.236/trunk@24350 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:27:11 +00:00
nhotta%netscape.com
b2c17b9084 Initialize ref. count in the constructor.
git-svn-id: svn://10.0.0.236/trunk@24348 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:08:05 +00:00
mcafee%netscape.com
b4b83e68dc Ignore generated files.
git-svn-id: svn://10.0.0.236/trunk@24347 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:01:51 +00:00
mcafee%netscape.com
53b9ecd299 Unitialized variable.
git-svn-id: svn://10.0.0.236/trunk@24346 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 22:00:24 +00:00
buster%netscape.com
6e1117a873 small change to match change in semantics in nsIDOMRange::GetCommonParent
git-svn-id: svn://10.0.0.236/trunk@24345 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:55:23 +00:00
slamm%netscape.com
7d1f24e330 Make room for more tinderbox columns by truncating the email address. To get the full email address, you have to click on the name.
git-svn-id: svn://10.0.0.236/trunk@24344 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:54:28 +00:00
putterman%netscape.com
3d0939f7db Increase the length the url can be before the document file name is prepended to it.
git-svn-id: svn://10.0.0.236/trunk@24343 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:43:00 +00:00
putterman%netscape.com
6e75a0bbb7 Add status column. Bold messages with new.
git-svn-id: svn://10.0.0.236/trunk@24342 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:41:51 +00:00
putterman%netscape.com
c2ef0832ac Add status column and Re: to messages.
git-svn-id: svn://10.0.0.236/trunk@24341 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:41:07 +00:00
putterman%netscape.com
a33e66155d Add .sbd when building up subfolders.
git-svn-id: svn://10.0.0.236/trunk@24339 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:40:41 +00:00
putterman%netscape.com
687cb8f5e7 Changes made to avoid nsMsgHdr duplication. Add back releases so memory
management works correctly.


git-svn-id: svn://10.0.0.236/trunk@24338 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:40:12 +00:00
putterman%netscape.com
61a8f0d1cc Changes made to avoid nsMsgHdr duplication. Now can get a message resource from
the factory.


git-svn-id: svn://10.0.0.236/trunk@24337 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:39:42 +00:00
putterman%netscape.com
27c01a87dc Changes made to avoid nsMsgHdr duplication
git-svn-id: svn://10.0.0.236/trunk@24336 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:39:04 +00:00
putterman%netscape.com
7651ef6f17 Use .sbd not .sbd/
git-svn-id: svn://10.0.0.236/trunk@24335 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:37:48 +00:00
putterman%netscape.com
69d5107409 Changes made to avoid nsMsgHdr duplication.
git-svn-id: svn://10.0.0.236/trunk@24334 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:37:21 +00:00
jefft%netscape.com
ea267cd528 move SetWindow(), SetEditor() to the outer scode in case we find an instance of ComposeAppCore
git-svn-id: svn://10.0.0.236/trunk@24333 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:34:39 +00:00
pinkerton%netscape.com
b959e16afe removed nsInlineReflow.cpp for kipp
git-svn-id: svn://10.0.0.236/trunk@24332 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:32:16 +00:00
jefft%netscape.com
99d34a3b2d clean up, added composeAppCore, msgAppCore global variables; added FindMsgAppCore() & FindComposeAppCore() function
git-svn-id: svn://10.0.0.236/trunk@24331 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:31:29 +00:00
jefft%netscape.com
1fdd3a13be consolidate NewMessage, ReplyMessage, ForwardMessage into one single method - NewMessage
git-svn-id: svn://10.0.0.236/trunk@24330 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:28:47 +00:00
av%netscape.com
2460c7215e M3 -- Fix for bug #1157
git-svn-id: svn://10.0.0.236/trunk@24329 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:26:15 +00:00
kipp%netscape.com
79d5d1f948 Make sure we update the update-area when doing synchronous updates or full widget updates
git-svn-id: svn://10.0.0.236/trunk@24328 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:19:59 +00:00
kipp%netscape.com
dd99c16187 Eliminate some GDK warning messages by only freeing valid pixmaps
git-svn-id: svn://10.0.0.236/trunk@24327 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:19:30 +00:00
kipp%netscape.com
3592c099da Revised the font matching algorithm to work somewhat better; allow for font-scaling in debug builds with an environment variable
git-svn-id: svn://10.0.0.236/trunk@24326 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:19:10 +00:00
kipp%netscape.com
f34b27ae16 Fudge the dpi into something that makes for more rational scaling to twips
git-svn-id: svn://10.0.0.236/trunk@24325 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:18:40 +00:00
hyatt%netscape.com
4ecf27a1dd Fixes for the mouseover toolbar button problem. Approved by Chris.
git-svn-id: svn://10.0.0.236/trunk@24324 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:18:00 +00:00
michaelp%netscape.com
53ce63ea80 fixed bug where out of order computation of child view positions and scroll
offsets in layout, widgets could be in different places than their views.
made nsView::List() print out all units in app units.


git-svn-id: svn://10.0.0.236/trunk@24322 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:04:00 +00:00
kipp%netscape.com
83f5d0de70 Spanked to collapse inline-reflow with line-layout into line-layout; fixed bugs #1278, #1990, #3527, #1670, etc.
git-svn-id: svn://10.0.0.236/trunk@24321 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:03:25 +00:00
waterson%netscape.com
f26bf52c02 Fixed nsCOMPtr bustage. Friggin' windows compiler.
git-svn-id: svn://10.0.0.236/trunk@24320 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:03:01 +00:00
kipp%netscape.com
7e25f9704c Fixed bug #3918 with measuring small-caps text; ported to use new line-layout API's
git-svn-id: svn://10.0.0.236/trunk@24319 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:02:40 +00:00
kipp%netscape.com
0f0692af69 Fixed bug #3597 - lower case alpha/roman bullets
git-svn-id: svn://10.0.0.236/trunk@24318 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:01:52 +00:00
michaelp%netscape.com
cd30c3c493 changed for new ComputeScrollOffsets() method.
git-svn-id: svn://10.0.0.236/trunk@24317 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:01:46 +00:00
kipp%netscape.com
66e83399ef Removed unused header file include
git-svn-id: svn://10.0.0.236/trunk@24316 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 21:01:24 +00:00
waterson%netscape.com
e463250fc8 Added dom-test-1.
git-svn-id: svn://10.0.0.236/trunk@24315 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 20:55:53 +00:00
waterson%netscape.com
c02bb4a5a3 Test files for DOM manipulators.
git-svn-id: svn://10.0.0.236/trunk@24314 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 20:54:14 +00:00
waterson%netscape.com
5cafbf3104 Fixed unwanted NS_RELEASE() in RegisterResource().
git-svn-id: svn://10.0.0.236/trunk@24313 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 20:47:27 +00:00
waterson%netscape.com
4189371260 Changed to use operator new[] instead of PL_strdup(). (Thanks, Brad!)
git-svn-id: svn://10.0.0.236/trunk@24312 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 20:47:03 +00:00
waterson%netscape.com
9086a4c777 Cleaned up code that mutates an element's ID, modulo bug 3971.
git-svn-id: svn://10.0.0.236/trunk@24311 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 20:46:02 +00:00
peterl%netscape.com
6c7eb08c7e real fix for pulling nspr from the tip
git-svn-id: svn://10.0.0.236/trunk@24310 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 20:43:14 +00:00
sar%netscape.com
dc98b38e5f correcting the pulling of NSPR
git-svn-id: svn://10.0.0.236/trunk@24307 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 19:50:26 +00:00
danm%netscape.com
34e100c7e3 D'OH! another tweak to bugs 3676/3900. a:chofmann,cyeh. r:rpotts
git-svn-id: svn://10.0.0.236/trunk@24306 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 19:19:52 +00:00
danm%netscape.com
61eba8993a Added and used Close() method to nsWebShellWindow. Part of fix for bug 3676 (again) and 3900. Wants to be part of M3 build. r:sdagley,pierre. a:chofmann,cyeh.
git-svn-id: svn://10.0.0.236/trunk@24305 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 19:08:36 +00:00
danm%netscape.com
6c0a68e81f Removed Release of mTopLevelWidget in the handling of the "inGoAway" event. Fixes bug 3900; part of fix for bug 3676. Wants to be part of M3 build. r:pierre,sdagley. a:chofmann,cyeh.
git-svn-id: svn://10.0.0.236/trunk@24304 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 19:05:32 +00:00
jefft%netscape.com
445e3e0706 fixed bug 3833 - Apprunner -mail needs the correct url; hard coded url string now set to resource:/res/samples/mailshell.xul; this is intended for M3; approved by choffmann
git-svn-id: svn://10.0.0.236/trunk@24298 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 17:32:57 +00:00
kipp%netscape.com
9be9680a28 Teach the widget how to manage an update rect so that we avoid gratuitous full window paints
git-svn-id: svn://10.0.0.236/trunk@24297 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 16:35:16 +00:00
briano%netscape.com
3567f3969c Added --help. Just because...
git-svn-id: svn://10.0.0.236/trunk@24296 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 09:30:57 +00:00
briano%netscape.com
86f8862cf8 Now the version number is determined using the RCS Revision keyword mechanism.
git-svn-id: svn://10.0.0.236/trunk@24295 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 09:19:22 +00:00
briano%netscape.com
f49b58a4bb Support for Linux/sparc and QNX, and a few additional minor tweaks.
git-svn-id: svn://10.0.0.236/trunk@24294 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 08:47:10 +00:00
leaf%mozilla.org
a94d7b2ad4 backing out change that clearly has destabilized the tree.
git-svn-id: svn://10.0.0.236/trunk@24293 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 04:43:38 +00:00
pavlov%pavlov.net
fe7d95bc7a fix for hpux and aix build bustage. approved by leaf.
git-svn-id: svn://10.0.0.236/trunk@24292 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 03:16:44 +00:00
briano%netscape.com
a33e298172 Automated update
git-svn-id: svn://10.0.0.236/trunk@24291 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 03:15:39 +00:00
briano%netscape.com
49bea3a684 Fixed the typo in the check for C++ unused methods, and hard-coded ac_ext=C
for the C++ checks (needed to make Watcom's QNX compiler notice that it's
dealing with C++ not C <sigh...>).


git-svn-id: svn://10.0.0.236/trunk@24290 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 03:11:15 +00:00
slamm%netscape.com
6bae52d41b Older version of perl cannot have foreach loop on same line as print.
git-svn-id: svn://10.0.0.236/trunk@24289 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 02:53:54 +00:00
pavlov%pavlov.net
f05bd48ddd fix bug #3617 (approved by cyeh)
git-svn-id: svn://10.0.0.236/trunk@24288 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 02:47:48 +00:00
slamm%netscape.com
fef09d9798 Shave off a third of the time to process the log, by parsing in a single pass.
git-svn-id: svn://10.0.0.236/trunk@24287 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 02:16:57 +00:00
mscott%netscape.com
559dc890e5 Not part of the build yet! (a=chofmann) Part of the imap framework check in.
Implementations of imap url and imap protocol instance.


git-svn-id: svn://10.0.0.236/trunk@24286 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 01:13:37 +00:00
mscott%netscape.com
0723e3d278 Not part of the build yet! (a=chofmann). Part of the initial Imap framework.
Add imap url and protocol interfaces.


git-svn-id: svn://10.0.0.236/trunk@24285 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 01:12:06 +00:00
mscott%netscape.com
7a73ece2ce Not part of the build yet. a=chofmann. Initial check in of imap framework.
Imap factory is used to build the imap dll component.


git-svn-id: svn://10.0.0.236/trunk@24284 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 01:09:50 +00:00
nisheeth%netscape.com
a19d7b898a Fix bug 3413. Approved by chofmann. Reviewed by rpotts. We check nsIURL's
address in nsWebshell::OnStartBinding() and if a trailing slash has been
added to it, we replace the topmost history entry with the new address.


git-svn-id: svn://10.0.0.236/trunk@24283 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 01:07:22 +00:00
harishd%netscape.com
e0d752d5af Added code to avoid head tag getting closed
on encountering newlines and whitespaces.  This would
prevent script tag, inside head, from opening body tag - made
up body tag.


git-svn-id: svn://10.0.0.236/trunk@24282 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-18 00:22:10 +00:00
briano%netscape.com
a61139e347 Automated update
git-svn-id: svn://10.0.0.236/trunk@24281 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 23:45:42 +00:00
donm%netscape.com
a54118f374 script oopsy. fixed now.
git-svn-id: svn://10.0.0.236/trunk@24280 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 23:38:44 +00:00
sar%netscape.com
38d0369202 only watch SeaMonkey tree, Mozilla-External is old news
git-svn-id: svn://10.0.0.236/trunk@24278 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 21:56:50 +00:00
briano%netscape.com
2c87e9db78 Automated update
git-svn-id: svn://10.0.0.236/trunk@24277 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 21:32:40 +00:00
leaf%mozilla.org
8fadf11677 Landing nspr library name change, and plevent function call change.
git-svn-id: svn://10.0.0.236/trunk@24276 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 21:32:03 +00:00
wtc%netscape.com
cdec214c4c NSPR library name change (libnspr21 ==> libnspr3) and
plevent.c.


git-svn-id: svn://10.0.0.236/trunk@24273 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 21:25:08 +00:00
buster%netscape.com
3ee55b4626 split and join now properly remember which content gets deleted, and which content remains in the tree
split and join now properly set selection to the remaining node, at the proper offset.
fixes bugs 3910 3881, with approval from chofmann


git-svn-id: svn://10.0.0.236/trunk@24272 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 20:56:10 +00:00
hshaw%netscape.com
9748f5857f Backout M3 Bug #1542 changes (to go on branch) mkgeturl.h mkgeturl.c nsNetService.cpp
git-svn-id: svn://10.0.0.236/trunk@24269 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 20:21:31 +00:00
terry%netscape.com
23d378e5e4 NSCP is no more.
Horrible hack to have it look at Grendel tinderbox if the bot's name
contains "grend".


git-svn-id: svn://10.0.0.236/trunk@24268 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 19:36:11 +00:00
hshaw%netscape.com
e0b10672b7 Timebomb workaround for static initialization of netlib, M3 Bug #1542
git-svn-id: svn://10.0.0.236/trunk@24267 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 19:25:22 +00:00
kipp%netscape.com
f81ad77137 Fixed bug #3905 - frame construction code wasn't dealing with tables properly when they were floated; reviewed by vidur for M3 checkin
git-svn-id: svn://10.0.0.236/trunk@24263 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 18:17:24 +00:00
pinkerton%netscape.com
7bc3b61b2a Fix bug #3792 by checking for null parent (for rods).
git-svn-id: svn://10.0.0.236/trunk@24262 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 17:46:14 +00:00
pierre%netscape.com
f622d92db0 Fixed a crash on "File | Print Setup" (or any other dialog without specific menubar) #3769. Approved: chofmann.
git-svn-id: svn://10.0.0.236/trunk@24260 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 07:17:19 +00:00
morse%netscape.com
23de1187d2 added work-around for a blocking wallet bug
git-svn-id: svn://10.0.0.236/trunk@24258 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 06:27:54 +00:00
morse%netscape.com
fdcafd63cf add prefs for wallet
git-svn-id: svn://10.0.0.236/trunk@24257 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 06:24:58 +00:00
morse%netscape.com
31a0360290 obscure saved data, skip doing prompts by default
git-svn-id: svn://10.0.0.236/trunk@24256 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 06:23:16 +00:00
morse%netscape.com
cdff63a1d7 fix crash, obscure saved data, skip doing prompts by default
git-svn-id: svn://10.0.0.236/trunk@24255 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 06:22:18 +00:00
buster%netscape.com
041f73c845 I fixed the content twiddling part of bug 3778. Mike has a fix for the display part of it in his tree, but determined the risk didn't
justify the benefit.  This is partly true because he and I would have had to integrate tonight before checking in, which we thought
presented some additional risk.  In any event, this bug is fixed for all cases except when the user hits enter at the end of the
document.  That is the only case in text editing when the selection will not render correctly.

Some related problems got fixed as a side benefit of my code changes.  I filed bug 3896.


git-svn-id: svn://10.0.0.236/trunk@24254 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 06:13:46 +00:00
evaughan%netscape.com
33068a82b2 Checkin is for bug #3853
Approved by don, hyatt


git-svn-id: svn://10.0.0.236/trunk@24253 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 06:07:07 +00:00
law%netscape.com
c10d5ccabc (partial) fix for bug #3853; reviewed by hyatt; approved by don/sar;
git-svn-id: svn://10.0.0.236/trunk@24252 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 05:57:10 +00:00
davidm%netscape.com
c53b7fb0fc Wll eventually provide support for NetLib dialogs. Currently is not being built on any platforms but Don wants me to check in tonight.
git-svn-id: svn://10.0.0.236/trunk@24250 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 03:25:53 +00:00
davidm%netscape.com
09d9b03dd2 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@24249 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 03:24:35 +00:00
sfraser%netscape.com
4f17752b01 Turn on traceback tables in the optimized build, so that MacsBug logs from dogfood are useful. Bug 3888, approved chofmann.
git-svn-id: svn://10.0.0.236/trunk@24248 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 03:18:24 +00:00
saari%netscape.com
47f05203de Fixing Bug #3808 - Bookmark menu doesn't work on MacOS
git-svn-id: svn://10.0.0.236/trunk@24247 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 03:03:58 +00:00
akkana%netscape.com
69ccd59466 3855: Back out hyatt's change of the toolbar width -- it made the stop button wrap to the next line on linux. Approved by chofmann
git-svn-id: svn://10.0.0.236/trunk@24246 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 01:57:33 +00:00
cata%netscape.com
9b7cdbfe7d Fix bug 3862. Reviewed by ftang. Fallback character bellow 0x20.
git-svn-id: svn://10.0.0.236/trunk@24245 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 01:47:39 +00:00
pollmann%netscape.com
ef622fe89e Opps, typo - bug #3619 A: chofmann R: harishd
git-svn-id: svn://10.0.0.236/trunk@24244 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 01:41:52 +00:00
gagan%netscape.com
3593ed3580 Calling parse on SetSpec to correctly reflect the changes. Partial fix for #3413.
git-svn-id: svn://10.0.0.236/trunk@24243 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 01:39:20 +00:00
ftang%netscape.com
416657c6bd move the ucvja2 into componment directory so autoreg will work. we should move other intl dll there after dogfood. reviwed by dp. fix bug 3866
git-svn-id: svn://10.0.0.236/trunk@24240 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 01:22:06 +00:00
kmcclusk%netscape.com
92e6b22228 Approved by Chris Hofmann.
Patch for #bug #2226. This patch modifies the nsBrowserWindow to call SetDisplayDirectory
to set the default directory when using the viewer's file open dialog.


git-svn-id: svn://10.0.0.236/trunk@24239 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 00:45:33 +00:00
kmcclusk%netscape.com
6d6336fbd0 Approved by Chris Hofmann.
Patch for M3 bug #2226. [PATCH] File->Open dialog does not 'remember' browsing directory.
The patch fixes WIN32. It also defines member variables and functions for Mac and Unix to keep tinderbox building.
Mac and Unix need implementations which honor the SetDisplayDirectory method so that the browsing directory is actually set.


git-svn-id: svn://10.0.0.236/trunk@24238 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 00:35:37 +00:00
law%netscape.com
947ef0572f Fix for M3 bug #3803; approved by chofmann/don
git-svn-id: svn://10.0.0.236/trunk@24237 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 00:33:25 +00:00
pnunn%netscape.com
df399ccfeb Fix for bugz#3858. View-images were decoding twice. M3, pnunn@netscape.com
Reviewed by kipp@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@24236 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-17 00:13:31 +00:00
karnaze%netscape.com
03d63f15c6 bug 1725
git-svn-id: svn://10.0.0.236/trunk@24235 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 23:42:38 +00:00
mscott%netscape.com
252952f232 Temporary work around for Bug #3790. Layout is having trouble with scrolling when the iframe has a height expressed in terms of a percent. So we are going to hard code the height of the message pane. This allows folks to scroll through their messages instead of seeing only the first few lines. I just tweaked the xul file to replace the 100% height with a fixed value.
a=chofmann


git-svn-id: svn://10.0.0.236/trunk@24234 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 23:30:57 +00:00
slamm%netscape.com
23baadeb99 Fix for http://bugzilla.mozilla.org/show_bug.cgi?id=3699. Renamed tree array to trees. Added 'var' for local variables.
git-svn-id: svn://10.0.0.236/trunk@24233 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 23:30:16 +00:00
kin%netscape.com
f156b21405 Fix for bug #3758: Drag selecting entire content, then deleting, causes crash.
Added check for mContentLength <= 0 to TextFrame::GetPointFromOffset().
Reviewed by jfrancis@netscape.com and sfraser@netscape.com.
Approved by chofmann@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@24232 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 22:55:49 +00:00
peterl%netscape.com
05c92ee1ad Fixed table background inheritance, bug #1355
Checkin approved by chofmann


git-svn-id: svn://10.0.0.236/trunk@24231 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 22:33:29 +00:00
hshaw%netscape.com
80ecb45eff Let libpref decide which file to load by default, M3 bug #2343 #3598
git-svn-id: svn://10.0.0.236/trunk@24230 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 22:07:50 +00:00
hshaw%netscape.com
4c5667fdce Changes to call Startup() from main() so we don't have thread problems in javascript
git-svn-id: svn://10.0.0.236/trunk@24228 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 22:03:03 +00:00
matt%netscape.com
e1b46e5eb8 disabling the print button in the menu bar
git-svn-id: svn://10.0.0.236/trunk@24227 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 21:40:10 +00:00
matt%netscape.com
489dbd7ad7 changing www.bugsplat.org to bugsplat.mozilla.org in the toolbar
git-svn-id: svn://10.0.0.236/trunk@24226 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 21:39:06 +00:00
akkana%netscape.com
3dc262cd31 Bug 3829: don't generate key events for modifier keys. Fix courtesy of Pavlov, Approved chofmann and kostello
git-svn-id: svn://10.0.0.236/trunk@24225 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 20:45:17 +00:00
chuckb%netscape.com
6507681cbc Fix for http://bugzilla.mozilla.org/show_bug.cgi?id=3231 Thanks to lentz@process.com
git-svn-id: svn://10.0.0.236/trunk@24221 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 20:14:19 +00:00
chuckb%netscape.com
eba3cc88f9 Merge from NSCP repository (prior to rsync)
git-svn-id: svn://10.0.0.236/trunk@24219 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 19:57:34 +00:00
kipp%netscape.com
035bc47fe1 Don't dereference a null pointer when print previewing
git-svn-id: svn://10.0.0.236/trunk@24218 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 19:37:12 +00:00
kipp%netscape.com
b3b4b4cbe6 Only set ends-in-newline flag for pre text (bug #3262)
git-svn-id: svn://10.0.0.236/trunk@24217 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 19:36:49 +00:00
kipp%netscape.com
15f605def7 Handle removable of continued frames better (not 100% done) (bug #3262)
git-svn-id: svn://10.0.0.236/trunk@24216 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 19:36:24 +00:00
kipp%netscape.com
99c54cef53 Fixed numerous frame removed bugs (bug #3262)
git-svn-id: svn://10.0.0.236/trunk@24215 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 19:36:00 +00:00
mcmullen%netscape.com
0e8563520b Fixes for bugs #3779,#2784. Member initialization of nsFileURL for windows compiler, escaping of url when made from path or spec, add file:// on macintosh when making a url from a spec. [bugs introduced when, for dp, I changed nsFilePath not to escape]. a=chofmann.
git-svn-id: svn://10.0.0.236/trunk@24214 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 19:12:51 +00:00
hshaw%netscape.com
7236a2582a To reduce confusion, read 'Netscape Preferences' for Mac, M3 bug #2343, approved dp
git-svn-id: svn://10.0.0.236/trunk@24213 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 18:31:40 +00:00
terry%netscape.com
afbf0febc8 Fixed typo in comment.
git-svn-id: svn://10.0.0.236/trunk@24212 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 18:29:45 +00:00
kin%netscape.com
e10b10c490 Fix for bug #3786: Undo/Redo icons broken in Editor test bed. Approved by chofmann.
git-svn-id: svn://10.0.0.236/trunk@24211 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 18:24:37 +00:00
hshaw%netscape.com
c6b6bb0e47 To reduce confusion, read preferences.js for UNIX, prefs.js for Win/Mac, M3 bug #2343, approved dp
git-svn-id: svn://10.0.0.236/trunk@24210 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 17:59:11 +00:00
buster%netscape.com
8851e742d6 fixed join.
made a special case for typing with BR as the selection (as after an InsertBreak.)
made DEL and BACKSPACE at the beginning and end of a text node
fixes bugs 3742 and 3756 (with permission from choff and gkostello)


git-svn-id: svn://10.0.0.236/trunk@24209 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 16:38:09 +00:00
gagan%netscape.com
540707af8e Fix for 3776.
git-svn-id: svn://10.0.0.236/trunk@24208 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 07:46:57 +00:00
gagan%netscape.com
a7bed3561d Fix for 1742. There is a bigger bug hiding behind this one... its about file:// urls. It needs to be revisited later.
git-svn-id: svn://10.0.0.236/trunk@24207 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 07:45:16 +00:00
rpotts%netscape.com
7bbc87b3d0 fix for bug #2343 - Preferences are not initialized in the apprunner...
git-svn-id: svn://10.0.0.236/trunk@24206 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 07:25:43 +00:00
rpotts%netscape.com
5dcafd7b80 fix for bug #2343 - Preferences are not initialized in the apprunner...
git-svn-id: svn://10.0.0.236/trunk@24205 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 07:15:37 +00:00
rickg%netscape.com
6aa4a20063 removed warnings and partially fixed M3
git-svn-id: svn://10.0.0.236/trunk@24204 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 07:06:48 +00:00
rpotts%netscape.com
36e5062afc Fixed build bustage... nsIWalletService.h was not being found because dist\public\walletlib was missing from the LINCS...
git-svn-id: svn://10.0.0.236/trunk@24202 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 06:08:18 +00:00
bienvenu%netscape.com
63ee355daa fix 3765 r=mscott,scottip a=chofmann problem updating thread pane after get new mail
git-svn-id: svn://10.0.0.236/trunk@24201 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 03:16:31 +00:00
despotdaemon%netscape.com
e0fe0f92a2 Pseudo-automatic update of changes made by dmose@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@24200 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 02:55:44 +00:00
pavlov%pavlov.net
38641f5c48 fix for #2513. r=mcafee@netscape.com, a=don@netscape.com
git-svn-id: svn://10.0.0.236/trunk@24199 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 02:19:52 +00:00
dp%netscape.com
71be445c74 Moving appcores.dll from bin/components/ to bin/ since mailnews links with it
git-svn-id: svn://10.0.0.236/trunk@24197 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 01:41:33 +00:00
dp%netscape.com
b57de82436 Moving appcores.dll from bin/components/ to bin/ since mailnews links with it
git-svn-id: svn://10.0.0.236/trunk@24196 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 01:34:22 +00:00
dp%netscape.com
33606ad65b Forcing xpcom registry recreation after moving appcores.dll from bin/components to bin/ since mailnew links with it
git-svn-id: svn://10.0.0.236/trunk@24195 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 01:33:46 +00:00
hyatt%netscape.com
6dda978028 As per German's request, moving the Wallet menu underneath the
Edit menu.


git-svn-id: svn://10.0.0.236/trunk@24194 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 01:17:30 +00:00
nhotta%netscape.com
2f28121e41 Change to generate a meta-tag for i18n mail testing, for the dogfood only (and windows only), reviwed by rhp, approved by chofmann.
git-svn-id: svn://10.0.0.236/trunk@24193 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 00:52:37 +00:00
hyatt%netscape.com
84a6776999 Changing some errors in the XUL file and moving the URL bar to be vertically
centered.

Also making a change requested by German... moving the new task bar underneath
the status area.


git-svn-id: svn://10.0.0.236/trunk@24192 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 00:40:49 +00:00
mjudge%netscape.com
598cd8d192 I am "unfixing" something. This was something I introduced to prevent an M3 bug with a hack, it is not necessary anymore. reviewd by sfrasier. several people have verified this.
git-svn-id: svn://10.0.0.236/trunk@24191 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 00:08:38 +00:00
saari%netscape.com
d329e297fb Fixing bug #3743 - Hierarchical menus display wrong info on MacOS
git-svn-id: svn://10.0.0.236/trunk@24188 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-16 00:00:39 +00:00
joki%netscape.com
4aff2a13e3 Fix for bug 3553, links on Linux
git-svn-id: svn://10.0.0.236/trunk@24187 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 23:44:15 +00:00
danm%netscape.com
780878cdde Moving release of nsWindow object up from its Destroy method to its caller, nsMacEventHandler. This is a better remainder of a fix for bug 3676. r:saari a:chofmann.
git-svn-id: svn://10.0.0.236/trunk@24186 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 23:40:42 +00:00
alecf%netscape.com
e580b04cc9 fix for #3755 - bring up messenger from Tools->Messenger by opening a new
window with the messenger XUL file.


git-svn-id: svn://10.0.0.236/trunk@24185 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 23:31:09 +00:00
mjudge%netscape.com
d86bbf4046 M3 bug reviewed by joe francis. simply adding 0 initiializers to variables
git-svn-id: svn://10.0.0.236/trunk@24184 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 23:08:27 +00:00
jfrancis%netscape.com
da1fc8ea13 fixed 3632 - selection turds after delete.
fixed 3751 - resizing page with selected image crashes.

reviewed mjudge and kin.  checkin approval chofmann.


git-svn-id: svn://10.0.0.236/trunk@24183 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 22:52:06 +00:00
cyeh%netscape.com
a303b2a42b added loop command line option to control the number of times it cycles
on a url.txt file. default is 100 times.


git-svn-id: svn://10.0.0.236/trunk@24182 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 22:46:46 +00:00
putterman%netscape.com
b61167ad7b can now change folder root. Reviewed by waterson and approved by chofmann
git-svn-id: svn://10.0.0.236/trunk@24181 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 22:33:09 +00:00
bienvenu%netscape.com
70142237f5 fix 3754 assert deleting a mail message r=davidmc, a=chofmann
git-svn-id: svn://10.0.0.236/trunk@24180 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 21:46:11 +00:00
hshaw%netscape.com
6c9b13a66e use default prefs.js if someone cause PREF_ API before initializing it
git-svn-id: svn://10.0.0.236/trunk@24179 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 21:38:06 +00:00
ramiro%netscape.com
f4cf6c562b Fix bugs 3653, 3652 and 3566. Leaking timers.
Thanks to Tomi Leppikangas <Tomi.Leppikangas@oulu.fi> for providing the
fix and Bruce Mitchener <bruce@cybersight.com> for purifying it.


git-svn-id: svn://10.0.0.236/trunk@24178 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 21:23:49 +00:00
evaughan%netscape.com
c332730afc Fixed align bug.
git-svn-id: svn://10.0.0.236/trunk@24177 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 21:22:49 +00:00
hyatt%netscape.com
814f8171fa Fixing the personal toolbar. Someone had a duplicate ID in there.
git-svn-id: svn://10.0.0.236/trunk@24176 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 21:06:24 +00:00
law%netscape.com
5908a31379 Corrected 'typo' in text for Home button; approved by chofmann/don
git-svn-id: svn://10.0.0.236/trunk@24175 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 20:53:24 +00:00
cyeh%netscape.com
9bf229dc0d fix -f command line option so that it actually works.
git-svn-id: svn://10.0.0.236/trunk@24174 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 19:33:13 +00:00
kostello%netscape.com
e0259c902d Fix build bustage. Move entity code to nsHTMLContentSinkStream until
this can be correctly addressed.


git-svn-id: svn://10.0.0.236/trunk@24173 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 19:19:01 +00:00
hyatt%netscape.com
0fc62f3ccf Removing the "About" menu and placing the link to Release Notes under
the "Help" menu instead.  Approved by chofmann.


git-svn-id: svn://10.0.0.236/trunk@24171 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 19:01:22 +00:00
slamm%netscape.com
313e26b262 Use one name for .mozconfig
git-svn-id: svn://10.0.0.236/trunk@24170 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 17:49:25 +00:00
rickg%netscape.com
a78f2703db two tiny fixes that have been sitting around awhile
git-svn-id: svn://10.0.0.236/trunk@24169 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 08:38:41 +00:00
bienvenu%netscape.com
de8a697e56 fix problem in reply all
git-svn-id: svn://10.0.0.236/trunk@24168 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 07:43:14 +00:00
hshaw%netscape.com
a8d2897d6f load up default pref file, more detailed version requires mac project file changes
git-svn-id: svn://10.0.0.236/trunk@24167 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 06:12:17 +00:00
mccabe%netscape.com
9062024e28 Another reworking of the loader -
- added a forward declaration of nsIInterfaceInfoManager to xptinfo.h

- reworked and cleaned up most aspects of the loader; typelib files now get associated typelib records, which have arrays of pointers to shared interface records; no hashtable lookup is necessary to resolve index pointers from params, etc to nsInterfaceInfo objects.

- moved to two hashtables in nsInterfaceInfoManager, mapping from name->interface record and iid->interface record.  Still unclear if I handle the different-iid, same-name case correctly.


git-svn-id: svn://10.0.0.236/trunk@24166 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:50:11 +00:00
hyatt%netscape.com
f41ac2bd41 Changes to fix the bookmarks menu crashing problem.
git-svn-id: svn://10.0.0.236/trunk@24165 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:39:04 +00:00
hyatt%netscape.com
e9895b0fef Changes to fix the Bookmarks menu crashing problem.
git-svn-id: svn://10.0.0.236/trunk@24164 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:36:13 +00:00
kostello%netscape.com
a1d937336a Added implementation for nsIHTMLContentSink::DoFragment()
git-svn-id: svn://10.0.0.236/trunk@24163 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:11:43 +00:00
kostello%netscape.com
b795dfd74a Add support to encode selection informaton
git-svn-id: svn://10.0.0.236/trunk@24162 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:10:03 +00:00
kostello%netscape.com
212c5568d0 Added nsIHTMLContentSink::DoFragment() method.
Added support for conversion of HTML entities in output


git-svn-id: svn://10.0.0.236/trunk@24161 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:08:36 +00:00
buster%netscape.com
506d9a9565 added WillUndo, DidUndo, WillRedo, DidRedo and some supporting code so
the text edit rule object can maintain it's own state more efficiently and correctly.


git-svn-id: svn://10.0.0.236/trunk@24160 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:08:30 +00:00
kostello%netscape.com
8ed917b8c2 Add support to get a SelectiomManager if non exists.
Waiting for Repository work


git-svn-id: svn://10.0.0.236/trunk@24159 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:06:52 +00:00
buster%netscape.com
099c42d8d3 small bug fix in Collapse. If the range array has 0 children, the selection should be considered collapsed.
git-svn-id: svn://10.0.0.236/trunk@24158 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 05:04:34 +00:00
sdagley%netscape.com
b25a5bd57a Had to temporarily back out danm's Release() hack from v1.95 as it causes a crash trying to load a new URL. While the hack did fix the problem with not being able to close the bookmark window my feeling is the crash is the less desirable behavior.
git-svn-id: svn://10.0.0.236/trunk@24157 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 03:18:05 +00:00
pavlov%pavlov.net
ca80f65092 fix another memory leak.
git-svn-id: svn://10.0.0.236/trunk@24156 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 03:03:49 +00:00
edwin%woudt.nl
1e9c573bb0 More addressbook patches from Mauro Botelho.
1. Now we are saving new entries to a file named aBook.nab
2. Sort ascending and descending are working now.


git-svn-id: svn://10.0.0.236/trunk@24155 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 01:59:26 +00:00
bienvenu%netscape.com
0d98b2a9fd latest mork drop, fix commit code
git-svn-id: svn://10.0.0.236/trunk@24154 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 01:32:31 +00:00
briano%netscape.com
5090bfc5fc Automated update
git-svn-id: svn://10.0.0.236/trunk@24153 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 01:00:41 +00:00
buster%netscape.com
518e2bdc59 added files: mozilla/editor/base/PlaceholderTxn.cpp
git-svn-id: svn://10.0.0.236/trunk@24152 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 00:58:15 +00:00
buster%netscape.com
ef5f3265cc added PlaceholderTxn. This is an aggregate transaction that sits on the undo stack
and merges in subsequent transactions indiscriminately until it's told to stop.
It also gives the last transaction in its child list a chance to merge the
next transaction.
All this is in support of complex transactions that result in text insertion
being able to collapse into a single undoable event.
Also improved tracking of bogus content node used when document is empty.


git-svn-id: svn://10.0.0.236/trunk@24151 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 00:57:32 +00:00
pavlov%pavlov.net
a5b07e4bf2 attempt to see what tinderbox machines don't have gtk 1.2 on them... will
revert this in a minute.


git-svn-id: svn://10.0.0.236/trunk@24150 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 00:47:55 +00:00
morse%netscape.com
12c434488f add wallet samples
git-svn-id: svn://10.0.0.236/trunk@24149 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 00:46:22 +00:00
morse%netscape.com
29a296322d get tables from server
git-svn-id: svn://10.0.0.236/trunk@24148 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-15 00:42:33 +00:00
pavlov%pavlov.net
ee9477a22a fix another mem leak.
git-svn-id: svn://10.0.0.236/trunk@24147 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 23:57:26 +00:00
pavlov%pavlov.net
5bad3fe9c7 fix mem leak for real this time.
git-svn-id: svn://10.0.0.236/trunk@24146 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 23:15:35 +00:00
pavlov%pavlov.net
78bde97ca5 fix mem leaks.
git-svn-id: svn://10.0.0.236/trunk@24145 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 23:14:35 +00:00
pavlov%pavlov.net
093fc1914e minor cleanups.
git-svn-id: svn://10.0.0.236/trunk@24144 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 23:03:34 +00:00
bienvenu%netscape.com
403c89404d add comma separator between addresses, remove null byte in msg hdr yarn
git-svn-id: svn://10.0.0.236/trunk@24143 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 23:00:31 +00:00
beard%netscape.com
72b38afe7f added extensions
git-svn-id: svn://10.0.0.236/trunk@24142 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 22:52:39 +00:00
beard%netscape.com
4da1e46179 always create console in a new window
git-svn-id: svn://10.0.0.236/trunk@24141 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 22:52:18 +00:00
beard%netscape.com
d4708408bc fixed crashing bug when frames are destroyed
git-svn-id: svn://10.0.0.236/trunk@24140 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 22:51:41 +00:00
jefft%netscape.com
8be650186c more reply/forward message support
git-svn-id: svn://10.0.0.236/trunk@24139 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 21:01:36 +00:00
jefft%netscape.com
4a7fcc684f more reply/forward message implementation
git-svn-id: svn://10.0.0.236/trunk@24138 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 21:00:30 +00:00
saari%netscape.com
08874e6586 Fixing bug #3674 and #3679
git-svn-id: svn://10.0.0.236/trunk@24137 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:59:10 +00:00
jefft%netscape.com
f00cddec76 rename GetMessageHeader to GetRDFResourceForMessage
git-svn-id: svn://10.0.0.236/trunk@24136 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:58:58 +00:00
beard%netscape.com
f3f0f9e4c5 added CreatePluginInstance.
git-svn-id: svn://10.0.0.236/trunk@24135 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:26:29 +00:00
beard%netscape.com
f2113a9ff2 calling CreatePluginInstance instead of CreateInstance, so MIME type is available early.
git-svn-id: svn://10.0.0.236/trunk@24134 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:09:57 +00:00
beard%netscape.com
ec20be3608 added CreatePluginInstance, to create a plugin instance with a specified MIME type.
git-svn-id: svn://10.0.0.236/trunk@24133 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:09:12 +00:00
beard%netscape.com
bacd108673 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@24132 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:07:46 +00:00
beard%netscape.com
0421e358e6 EmbeddedFrame
git-svn-id: svn://10.0.0.236/trunk@24131 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:06:59 +00:00
beard%netscape.com
b795a5140e added CreatePluginInstance
git-svn-id: svn://10.0.0.236/trunk@24130 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:06:41 +00:00
beard%netscape.com
0c9fa70221 Added CreatePluginInstance method.
git-svn-id: svn://10.0.0.236/trunk@24129 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:06:22 +00:00
beard%netscape.com
fdb6b83f16 added additional MIME type, "application/x-java-frame"
git-svn-id: svn://10.0.0.236/trunk@24128 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:05:51 +00:00
beard%netscape.com
151dfaca36 private SupportsMixin
git-svn-id: svn://10.0.0.236/trunk@24127 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:05:14 +00:00
beard%netscape.com
5c47386cb3 Added JSEvaluator.cpp, EmbeddedFrame.cpp, EmbeddedFramePluginInstance.cpp.
git-svn-id: svn://10.0.0.236/trunk@24126 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 20:04:48 +00:00
morse%netscape.com
9b065263e5 make wallet editor accessible outside of firewall
git-svn-id: svn://10.0.0.236/trunk@24125 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 19:50:49 +00:00
morse%netscape.com
55720e3d53 cleanup use of url-specific field-to-schema mapping
git-svn-id: svn://10.0.0.236/trunk@24124 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 19:02:38 +00:00
pavlov%pavlov.net
3b8b73438e fix bug #3721
git-svn-id: svn://10.0.0.236/trunk@24123 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 18:50:04 +00:00
locka%iol.ie
56919abb99 Made changes for IE DOM support
git-svn-id: svn://10.0.0.236/trunk@24122 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 18:29:21 +00:00
locka%iol.ie
f8a294feaf Added basic IE element implementations
git-svn-id: svn://10.0.0.236/trunk@24121 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 18:26:58 +00:00
pavlov%pavlov.net
1b8af08f0f fix another memory leak.
git-svn-id: svn://10.0.0.236/trunk@24120 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 18:12:23 +00:00
pavlov%pavlov.net
1d5e39fcc9 fix bug #3564
git-svn-id: svn://10.0.0.236/trunk@24119 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 18:06:18 +00:00
bienvenu%netscape.com
4f9d8961d4 add accessors for recipients and cc list
git-svn-id: svn://10.0.0.236/trunk@24118 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 17:46:14 +00:00
locka%iol.ie
6d98f4b590 New icons
git-svn-id: svn://10.0.0.236/trunk@24117 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 17:44:40 +00:00
locka%iol.ie
e65e3b7805 Updated CBrowse into a mini-test app
git-svn-id: svn://10.0.0.236/trunk@24116 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 17:44:01 +00:00
karnaze%netscape.com
fe3b92e60b removed code to set margins on radio buttons and checkboxes. It is now done using attribute selectors in ua.css.
git-svn-id: svn://10.0.0.236/trunk@24115 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 17:39:58 +00:00
karnaze%netscape.com
0a1d6741dd table cell uses its own border (instead of table's) when sizing its area frame
git-svn-id: svn://10.0.0.236/trunk@24114 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 17:36:10 +00:00
ramiro%netscape.com
5cbb09f9bf Fix typo.
git-svn-id: svn://10.0.0.236/trunk@24113 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 17:33:43 +00:00
edwin%woudt.nl
d614531026 Changed the smtphost preference to be identity based instead of global.
git-svn-id: svn://10.0.0.236/trunk@24112 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 13:30:45 +00:00
edwin%woudt.nl
cabbfb0c46 Default identities can be set now in the preferences file for each store.
git-svn-id: svn://10.0.0.236/trunk@24111 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 11:16:50 +00:00
mcafee%netscape.com
688621eb3f getenv() needs a prototype for Solaris.
git-svn-id: svn://10.0.0.236/trunk@24110 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 09:00:38 +00:00
danm%netscape.com
aecf46f198 disabling ability to specify a parent for a top-level window (until all platforms agree on what this means). fix refcount when registering windows with the window list.
git-svn-id: svn://10.0.0.236/trunk@24109 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 08:24:21 +00:00
danm%netscape.com
2366297b1b adjusting refcount for menubars and deletion. deletion adjustment is a HACK for the impending milestone.
git-svn-id: svn://10.0.0.236/trunk@24108 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 08:22:43 +00:00
danm%netscape.com
4293674b32 fixing goofy reversal of normal window and dialog window creation
git-svn-id: svn://10.0.0.236/trunk@24107 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 08:21:09 +00:00
danm%netscape.com
9b22c9c322 Added SetParent method
git-svn-id: svn://10.0.0.236/trunk@24106 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 08:19:34 +00:00
jband%netscape.com
859b96d66e use of typelibs via xptinfo working with test program on win32. Untested on Linux. typelib generation not yet integrated into the make system
git-svn-id: svn://10.0.0.236/trunk@24105 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 06:07:21 +00:00
beard%netscape.com
406c19300d Added NPL
git-svn-id: svn://10.0.0.236/trunk@24104 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 05:22:50 +00:00
pavlov%pavlov.net
872dc8de37 removed some unused code
git-svn-id: svn://10.0.0.236/trunk@24103 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 05:01:55 +00:00
rods%netscape.com
59be444747 Added DragListener for Drag & Drop (it's not turned on)
git-svn-id: svn://10.0.0.236/trunk@24102 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 04:45:00 +00:00
beard%netscape.com
6c2fa78c9d added nsILiveconnect service.
git-svn-id: svn://10.0.0.236/trunk@24101 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 04:41:51 +00:00
beard%netscape.com
4ee6f2956f added IID accessors
git-svn-id: svn://10.0.0.236/trunk@24100 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 04:40:54 +00:00
beard%netscape.com
98648c5313 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@24099 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 04:39:04 +00:00
buster%netscape.com
7cc6cda1c5 added checks for DOM Key event returning 0x0 key code. If we get 0, we bail.
git-svn-id: svn://10.0.0.236/trunk@24098 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 04:12:21 +00:00
buster%netscape.com
6119addb3c added a debug-only printf warning if the char code returned is 0
git-svn-id: svn://10.0.0.236/trunk@24097 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 04:10:55 +00:00
beard%netscape.com
23f8cca44d First Checked In.
git-svn-id: svn://10.0.0.236/trunk@24096 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 03:06:42 +00:00
beard%netscape.com
d86a17c17e JSObject tests.
git-svn-id: svn://10.0.0.236/trunk@24095 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 03:06:08 +00:00
beard%netscape.com
47e7c1394c Added nsLiveconnect to backward adapter target.
git-svn-id: svn://10.0.0.236/trunk@24094 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 03:05:18 +00:00
beard%netscape.com
0884e8f2d7 MRJPLUGIN_4X support.
git-svn-id: svn://10.0.0.236/trunk@24093 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 03:04:44 +00:00
jband%netscape.com
a01f741d90 added octet for unsigned 8bit, made float and double work, added a Win32 batfile to build against the right MS runtime dll, added hacked temporary support for nsID expresed as nsIIDRef, added GOTO support for iid_is being native rather than an interface type; i.e. for QueryInterface style sig where a void* is used as the out type
git-svn-id: svn://10.0.0.236/trunk@24092 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 02:59:43 +00:00
mjudge%netscape.com
0615e6fe73 fix hack for getting selection to "Really" update the frame
git-svn-id: svn://10.0.0.236/trunk@24091 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 01:18:47 +00:00
kostello%netscape.com
7ba2fb1536 Added HACKForceRedraw() when deleting a range or inserting text
git-svn-id: svn://10.0.0.236/trunk@24090 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 01:02:53 +00:00
sfraser%netscape.com
0ed96a5600 Remove an extra ", and remove the align tag on the throbber, because it
currently shows up as a label. sdagley helped.


git-svn-id: svn://10.0.0.236/trunk@24089 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 00:46:02 +00:00
kostello%netscape.com
200ff1e40c Add HACKForceRedraw() to force a redraw until the drawing
problems are solved in Gecko


git-svn-id: svn://10.0.0.236/trunk@24088 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 00:31:35 +00:00
pavlov%pavlov.net
d44739f283 make the Enumerator destructor virtual to remove build warning.
git-svn-id: svn://10.0.0.236/trunk@24087 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 00:21:56 +00:00
gordon%netscape.com
36fad31c19 Fix for Mac OT bugs #2133, #2405, #2451, #2623, #3580 among others. Steve Dagley served as buddy for my changes. This is basically the first half of the redesign for Mac NSPR Sockets. Blocking mode or Server sockets remain to be implemented.
git-svn-id: svn://10.0.0.236/trunk@24086 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 00:15:39 +00:00
mcmullen%netscape.com
f636dbb228 Added nsFileLocations.cpp/.h to the build.
git-svn-id: svn://10.0.0.236/trunk@24085 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 00:03:21 +00:00
mcmullen%netscape.com
ce1795ba6d First Checked In.
git-svn-id: svn://10.0.0.236/trunk@24084 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-14 00:02:40 +00:00
mcmullen%netscape.com
8a41bf3664 Added "About" menu with release notes item (bug #3648).
git-svn-id: svn://10.0.0.236/trunk@24083 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 23:27:45 +00:00
mcmullen%netscape.com
70f0026961 Adjusted the use of nsFileSpec in GetVolumeList(), thereby avoiding a crash.
git-svn-id: svn://10.0.0.236/trunk@24082 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 22:52:24 +00:00
edwin%woudt.nl
d328bbec32 Implemented signature replacement code. When changing identities now, the sig will change. Also the sig will be automatically added when composing a message.
git-svn-id: svn://10.0.0.236/trunk@24081 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 22:31:58 +00:00
mjudge%netscape.com
2ebf5f3b4b needed to get caret to draw at end of line and on an empty text element
git-svn-id: svn://10.0.0.236/trunk@24080 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 21:33:34 +00:00
mjudge%netscape.com
e60f9b40c5 hack to get caret to draw on empty line.
git-svn-id: svn://10.0.0.236/trunk@24079 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 21:33:01 +00:00
morse%netscape.com
2e91a789f7 added wallet
git-svn-id: svn://10.0.0.236/trunk@24078 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 21:29:49 +00:00
morse%netscape.com
5619966aab fix for bug 2414 -- cookie file not being created
git-svn-id: svn://10.0.0.236/trunk@24077 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 21:26:35 +00:00
jefft%netscape.com
e544c62a1f call nsJSUtils::nsConvertObjectToJSVal to convert returning object into jsval
git-svn-id: svn://10.0.0.236/trunk@24076 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 20:15:08 +00:00
jefft%netscape.com
a5ccc1fc81 partially enable reply and forward message
git-svn-id: svn://10.0.0.236/trunk@24075 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 20:10:10 +00:00
ducarroz%netscape.com
ef85a14469 Remove default text, now the default body is blank
git-svn-id: svn://10.0.0.236/trunk@24074 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 18:02:33 +00:00
morse%netscape.com
03293e7efc removed some dead code
git-svn-id: svn://10.0.0.236/trunk@24073 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 16:00:40 +00:00
morse%netscape.com
164b45f147 fix bugzilla bug 909
git-svn-id: svn://10.0.0.236/trunk@24072 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 15:59:05 +00:00
karnaze%netscape.com
3828070fad set max element size for hidden element
git-svn-id: svn://10.0.0.236/trunk@24071 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 12:50:43 +00:00
karnaze%netscape.com
320437ece4 bug 2220; changed wording of some warnings.
git-svn-id: svn://10.0.0.236/trunk@24070 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 12:49:37 +00:00
karnaze%netscape.com
fe22718487 removed some table frame construction warnings.
git-svn-id: svn://10.0.0.236/trunk@24069 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 12:47:56 +00:00
rjc%netscape.com
4285a9887c Reduce amount of string allocation, and delete []basename when done with it.
git-svn-id: svn://10.0.0.236/trunk@24068 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 09:32:13 +00:00
rjc%netscape.com
75a939310a Use nsFileURL instead of nsFilePath to get file URL.
git-svn-id: svn://10.0.0.236/trunk@24067 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 09:25:46 +00:00
rjc%netscape.com
d5a22ad969 Add column sorting support to bookmarks.xul
git-svn-id: svn://10.0.0.236/trunk@24066 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 09:10:40 +00:00
jband%netscape.com
5eaf37bbb1 more to fix assumption that interfaces don't have the pointer bit set
git-svn-id: svn://10.0.0.236/trunk@24065 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 09:09:26 +00:00
dp%netscape.com
6ddfe4b9de Removing unix hack of translation ./libabc.so to libabc.so to prevent multiple loads. This wont be required as we load all dlls absolutely
git-svn-id: svn://10.0.0.236/trunk@24064 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 08:09:54 +00:00
ducarroz%netscape.com
6417ada219 Part of implementation of Reply and Forward
git-svn-id: svn://10.0.0.236/trunk@24063 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 07:51:54 +00:00
ducarroz%netscape.com
972c7474f5 Part of implementation of Reply and Forward. Use new SendMessage command
git-svn-id: svn://10.0.0.236/trunk@24062 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 07:51:15 +00:00
ducarroz%netscape.com
29fb5a6f25 add pref for reply_to
git-svn-id: svn://10.0.0.236/trunk@24061 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 07:49:23 +00:00
mcmullen%netscape.com
3b2fd6b905 Fix a parameter type.
git-svn-id: svn://10.0.0.236/trunk@24060 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 07:07:33 +00:00
mcmullen%netscape.com
56cf21a8da Adapt to an API change.
git-svn-id: svn://10.0.0.236/trunk@24059 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 06:39:17 +00:00
mcmullen%netscape.com
de8fc99c4f Upgrades, bugfixes (including nsFilePath no longer hex escaped). Features (including DiskSpaceAvailable)
git-svn-id: svn://10.0.0.236/trunk@24058 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 06:38:57 +00:00
buster%netscape.com
c40ea0b1ef InsertBreak now works at the beginning of a line. Plus a trivial bug fix.
git-svn-id: svn://10.0.0.236/trunk@24057 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 05:31:22 +00:00
syd%netscape.com
e2edc000af gtk_toggle_button_get_active() is an API newer than Gtk+ 1.1.13. Replaced it
with legacy code that just looks at active field of widget directly (I could
use the GtkObject interfaces, but those are kludgy and the reason that the
newer API was introduced). Eventually (hopefully soon) we'll migrate to Gtk+
1.2 (which will fix some rendering bugs as well...)


git-svn-id: svn://10.0.0.236/trunk@24056 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 05:25:31 +00:00
buster%netscape.com
3900dace67 added delegate code for InsertText (WillInsertText, DidInsertText)
which calls generic WillInsert, DidInsert to test for magic bogus
content and does the right thing.
You now can't delete magic content with user gestures, and when you
insert anything the magic kludgy &nbsp; is deleted first.


git-svn-id: svn://10.0.0.236/trunk@24055 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 04:53:21 +00:00
buster%netscape.com
1adc16e177 Table cells need to call DidSetStyleContext whenever their style changes, or
whenever the table's style changes.
This is a partial fix for bug 3513


git-svn-id: svn://10.0.0.236/trunk@24054 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 04:38:02 +00:00
buster%netscape.com
fdd92cdedf added some debugging code. uncomment the #define DELETE_SELECTION
to see some output about what node is selected.


git-svn-id: svn://10.0.0.236/trunk@24053 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 04:36:03 +00:00
law%netscape.com
6aee465560 Throbberized
git-svn-id: svn://10.0.0.236/trunk@24052 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 04:24:13 +00:00
law%netscape.com
e898ea3970 Throb, baby, throb
git-svn-id: svn://10.0.0.236/trunk@24051 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:51:22 +00:00
law%netscape.com
6f483dbf4e Added throbbingN.gif and fixed clobber dirs
git-svn-id: svn://10.0.0.236/trunk@24050 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:40:27 +00:00
syd%netscape.com
2e269a53c6 Declare mPrData
git-svn-id: svn://10.0.0.236/trunk@24049 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:39:38 +00:00
law%netscape.com
a8a4d3d226 Adding url listener support
git-svn-id: svn://10.0.0.236/trunk@24048 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:31:55 +00:00
slamm%netscape.com
8988adee79 Disable PrintPreview 'cause it's crashing.
git-svn-id: svn://10.0.0.236/trunk@24047 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:26:54 +00:00
syd%netscape.com
3a9c39025c Call GTK print dialog. Currently, Init routine returns FAILURE, effectively
stubbing out this functionality. Done Cone will turn it on at a later time.

Gtk+ print menu crashes will temporarily disappear because of this change.


git-svn-id: svn://10.0.0.236/trunk@24046 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:21:16 +00:00
syd%netscape.com
c86a5bb085 Add nsPrintdGTK.c to build.
git-svn-id: svn://10.0.0.236/trunk@24045 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:19:58 +00:00
syd%netscape.com
57ff622ee2 Print dialog for Gtk. Needs to be wired by Done Cone, currently stubbed out
in caller.


git-svn-id: svn://10.0.0.236/trunk@24044 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:19:28 +00:00
slamm%netscape.com
d2355bf850 Add click handler for personal toolbar.
git-svn-id: svn://10.0.0.236/trunk@24043 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:15:39 +00:00
beard%netscape.com
284c311805 added IID_ACCESSOR
git-svn-id: svn://10.0.0.236/trunk@24042 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:12:16 +00:00
beard%netscape.com
8230ab5364 fixed IID accessor
git-svn-id: svn://10.0.0.236/trunk@24041 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:11:05 +00:00
beard%netscape.com
82d7689071 Added some println's to test console.
git-svn-id: svn://10.0.0.236/trunk@24040 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:08:02 +00:00
law%netscape.com
ed145eabba Export nsIURLListener.h
git-svn-id: svn://10.0.0.236/trunk@24039 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 03:01:15 +00:00
slamm%netscape.com
cda10a48e6 -mAdd FAQ link.
git-svn-id: svn://10.0.0.236/trunk@24038 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 02:59:30 +00:00
sdagley%netscape.com
ff49c74457 Make an alias of mozilla:xpfe:AppCores:xul:resources:throbbingN.gif in the throbber res directory so that law's upcoming toolbar xul change can find it.
git-svn-id: svn://10.0.0.236/trunk@24037 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 02:51:00 +00:00
law%netscape.com
da9fcb2b49 New URL listener interface to get throbber working
git-svn-id: svn://10.0.0.236/trunk@24036 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 02:28:31 +00:00
law%netscape.com
7d73848f1b New styles for throbber
git-svn-id: svn://10.0.0.236/trunk@24035 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 02:21:51 +00:00
beard%netscape.com
ab9d076b20 reverted back to kISupportsIID. It seems not all compilers can handle ::nsISupports::GetIID() from inside an XPCOM interface. Yech.
git-svn-id: svn://10.0.0.236/trunk@24034 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 02:20:57 +00:00
slamm%netscape.com
a0d92131e4 Add throbbingN.gif.
git-svn-id: svn://10.0.0.236/trunk@24033 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 02:15:34 +00:00
evaughan%netscape.com
5caad912d3 Fixed Titled button bugs.
git-svn-id: svn://10.0.0.236/trunk@24032 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:51:49 +00:00
slamm%netscape.com
b06c9cece3 Update script name
git-svn-id: svn://10.0.0.236/trunk@24031 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:43:25 +00:00
jband%netscape.com
8bb15255e9 support float and double in headers and typelibs
git-svn-id: svn://10.0.0.236/trunk@24030 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:43:19 +00:00
jband%netscape.com
9ed30011df made in params const, added some comments
git-svn-id: svn://10.0.0.236/trunk@24029 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:34:37 +00:00
jband%netscape.com
d96fb8c360 fix assumption that interfaces don't have the poointer bit set
git-svn-id: svn://10.0.0.236/trunk@24028 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:31:48 +00:00
hyatt%netscape.com
950c46393d Bookmarks menu coming online.
git-svn-id: svn://10.0.0.236/trunk@24027 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:12:53 +00:00
alecf%netscape.com
0be2671888 #if 0 out calls to functions we haven't defined yet.
git-svn-id: svn://10.0.0.236/trunk@24026 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:07:11 +00:00
alecf%netscape.com
2e006cf6f7 remove more undefined symbols by linking against more libraries
git-svn-id: svn://10.0.0.236/trunk@24025 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:06:27 +00:00
chuang%netscape.com
68726183a2 Change 3 pane layout using frame instead of iframe
git-svn-id: svn://10.0.0.236/trunk@24022 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:03:50 +00:00
hyatt%netscape.com
c888f11e4f Menus now handle click events properly (by sending them into the DOM).
git-svn-id: svn://10.0.0.236/trunk@24021 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:03:33 +00:00
law%netscape.com
96232ea83d Animated gif for apprunner throbber
git-svn-id: svn://10.0.0.236/trunk@24020 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 01:02:28 +00:00
mccabe%netscape.com
b8deb21290 Fixed a place where I was missing an NS_RELEASE, thanks jband.
git-svn-id: svn://10.0.0.236/trunk@24019 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:56:47 +00:00
slamm%netscape.com
2df99b84b6 Trim NSPR options down to two. Add mozilla banner.
git-svn-id: svn://10.0.0.236/trunk@24018 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:51:40 +00:00
alecf%netscape.com
28d6dad50c putterman's patches to re-root thread pane
git-svn-id: svn://10.0.0.236/trunk@24017 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:50:51 +00:00
morse%netscape.com
8aade4c7bb fix potential build bustage
git-svn-id: svn://10.0.0.236/trunk@24016 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:44:13 +00:00
hyatt%netscape.com
79251a162a Menus are much closer now.
git-svn-id: svn://10.0.0.236/trunk@24015 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:31:05 +00:00
nhotta%netscape.com
390059663f Added a MIME decoder interface which takes arguments in nsString.
git-svn-id: svn://10.0.0.236/trunk@24014 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:28:18 +00:00
beard%netscape.com
03cc80e739 forcing nsISupports to global scope to resovle ambiguity (VC is very weak)
git-svn-id: svn://10.0.0.236/trunk@24013 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:12:13 +00:00
hyatt%netscape.com
9d57739e0b On the road to making the bookmarks menu work properly.
git-svn-id: svn://10.0.0.236/trunk@24012 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:08:25 +00:00
rjc%netscape.com
2262fccde4 Autoregistration now works on all platforms, and RDF self-registers, so removing code that statically registers RDF here.
git-svn-id: svn://10.0.0.236/trunk@24011 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-13 00:06:29 +00:00
pinkerton%netscape.com
fa2dd9188c onClick -> onclick conversion.
git-svn-id: svn://10.0.0.236/trunk@24010 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:56:13 +00:00
evaughan%netscape.com
28720251d6 Fixed disabled bug on buttons.
git-svn-id: svn://10.0.0.236/trunk@24009 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:47:52 +00:00
rjc%netscape.com
6e88ce0a1b Export nsComponentManager::AutoRegister
git-svn-id: svn://10.0.0.236/trunk@24008 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:47:17 +00:00
pierre%netscape.com
7c6c8ca488 fixed uninitialized variable in XULContentSinkImpl::Init()
git-svn-id: svn://10.0.0.236/trunk@24007 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:36:33 +00:00
morse%netscape.com
c708eb1603 move wallet editor to a server
git-svn-id: svn://10.0.0.236/trunk@24006 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:32:11 +00:00
morse%netscape.com
be75a1a597 fix for wallet
git-svn-id: svn://10.0.0.236/trunk@24005 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:30:48 +00:00
morse%netscape.com
f0e79dc53c turn on client wallet for win32
git-svn-id: svn://10.0.0.236/trunk@24004 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:29:12 +00:00
rhp%netscape.com
9080b52939 Changes for content type handler plugins on unix
git-svn-id: svn://10.0.0.236/trunk@24003 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:28:39 +00:00
pierre%netscape.com
b73810df3b fixed uninitialized variable in ProxyEvent::Fire()
git-svn-id: svn://10.0.0.236/trunk@24002 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:27:46 +00:00
cyeh%netscape.com
50f0663eee use plain text for the automated report, and don't uuencode
git-svn-id: svn://10.0.0.236/trunk@24001 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:24:53 +00:00
pierre%netscape.com
d84171a598 fixed uninitialized variable in map_java_object_to_js_object_impl()
git-svn-id: svn://10.0.0.236/trunk@24000 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:18:13 +00:00
rhp%netscape.com
2afbdebea2 Change for different names on non PC platforms
git-svn-id: svn://10.0.0.236/trunk@23999 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:17:59 +00:00
rhp%netscape.com
4f3fc78aaa Change for temporary stat() call.
git-svn-id: svn://10.0.0.236/trunk@23998 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:16:52 +00:00
pinkerton%netscape.com
62c22bea64 fix for the mac part of bug #3675. We were dispatching all menu events twice.
git-svn-id: svn://10.0.0.236/trunk@23997 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 23:02:33 +00:00
pinkerton%netscape.com
9191075bb8 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23996 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:57:55 +00:00
beard%netscape.com
f070c0d794 now passing events to plugins, generating idle events with an nsITimer, all XP_MAC changes for the most part.
git-svn-id: svn://10.0.0.236/trunk@23994 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:46:14 +00:00
beard%netscape.com
b4dc5c36ea Added NS_NATIVE_PLUGIN_PORT selector to GetNativeData.
git-svn-id: svn://10.0.0.236/trunk@23993 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:45:02 +00:00
michaelp%netscape.com
dcfeafc885 added memory cleanup tripwire.
git-svn-id: svn://10.0.0.236/trunk@23992 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:24:30 +00:00
hyatt%netscape.com
108afeab5c Checking in German's new UI!
git-svn-id: svn://10.0.0.236/trunk@23991 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:21:58 +00:00
waterson%netscape.com
fbdbf7403d Bug 3529: re-rooting the tree. Added code in the generic content builder that notices changes to the 'id=' attribute and reconstructs the tree from a new resource when the object's identity is changed. Also, renamed the nsRDFGenericBuilder::IsWidgetElement() to IsFolderOrItem(), because that's what it's doing.
git-svn-id: svn://10.0.0.236/trunk@23990 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:20:34 +00:00
hyatt%netscape.com
e6b40dddbb Checking in German's new UI.
git-svn-id: svn://10.0.0.236/trunk@23989 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:16:05 +00:00
mcmullen%netscape.com
1acae3d8a9 Fixed crashing bug on solaris. Added support for mac documents directory.
git-svn-id: svn://10.0.0.236/trunk@23988 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:15:02 +00:00
mcmullen%netscape.com
0f5a09ef47 Added mac documents directory.
git-svn-id: svn://10.0.0.236/trunk@23987 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:14:08 +00:00
mscott%netscape.com
a03a0d6ba4 Add line return after "Mailbox Done" to make it easier for QA to smoketest this string.
git-svn-id: svn://10.0.0.236/trunk@23986 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:05:32 +00:00
beard%netscape.com
606af1d257 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23985 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 22:04:13 +00:00
ftang%netscape.com
63130c7028 change the macroman converter to a better shape.... reviewed by pierre
git-svn-id: svn://10.0.0.236/trunk@23984 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:58:28 +00:00
beard%netscape.com
e749a03cef Took out <SCRIPT> tag, <APPLET> tag. Only used with <EMBED> tag.
git-svn-id: svn://10.0.0.236/trunk@23983 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:51:56 +00:00
beard%netscape.com
b4d0db73a0 Added clear button, moved buttons into a panel.
git-svn-id: svn://10.0.0.236/trunk@23982 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:51:05 +00:00
slamm%netscape.com
bccc688d11 Add animated gif, anim.gif.
git-svn-id: svn://10.0.0.236/trunk@23981 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:40:39 +00:00
warren%netscape.com
fa9ffdfa65 Fixed comment.
git-svn-id: svn://10.0.0.236/trunk@23980 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:39:25 +00:00
mjudge%netscape.com
c77899adc4 fixed GetWidth to "do the right thing" and take smallcaps and spaced words/chars into account.
git-svn-id: svn://10.0.0.236/trunk@23979 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:38:16 +00:00
matt%netscape.com
5b84a7c059 Adding refresh function to refresh urlbar
for bug3548


git-svn-id: svn://10.0.0.236/trunk@23978 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:37:08 +00:00
beard%netscape.com
3d7d70e2c1 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23977 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:35:17 +00:00
warren%netscape.com
5da91ed33c Changed background colors to be standard messenger.
git-svn-id: svn://10.0.0.236/trunk@23976 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:29:44 +00:00
warren%netscape.com
cc89d8e394 Changed GetEnabledCommands to GetAllCommands/IsCommandEnabled.
git-svn-id: svn://10.0.0.236/trunk@23975 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:28:34 +00:00
endico%mozilla.org
e88bd6b01c Removing the mailnews tree. The mail code is in seamonkey already so the tree is redundant.
git-svn-id: svn://10.0.0.236/trunk@23974 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:10:39 +00:00
slamm%netscape.com
22b62bde01 Add animated gif version of throbber.
git-svn-id: svn://10.0.0.236/trunk@23973 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 21:03:26 +00:00
morse%netscape.com
77bd512e6f fix bug 1729
git-svn-id: svn://10.0.0.236/trunk@23972 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:53:01 +00:00
ducarroz%netscape.com
b0facc5ae6 Add GetMessageHeader Interface (written by jefft)
git-svn-id: svn://10.0.0.236/trunk@23971 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:41:43 +00:00
ducarroz%netscape.com
008becef89 Add ReplyMessage, ForwardMessage and SendMessage2 interface
git-svn-id: svn://10.0.0.236/trunk@23970 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:39:16 +00:00
ducarroz%netscape.com
3901089d0a implement Message Forward and Reply
git-svn-id: svn://10.0.0.236/trunk@23969 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:36:53 +00:00
bienvenu%netscape.com
310430bb3c add mork to makefiles
git-svn-id: svn://10.0.0.236/trunk@23968 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:31:57 +00:00
bienvenu%netscape.com
3f91b7a6cb turn on file stuff for Unix
git-svn-id: svn://10.0.0.236/trunk@23967 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:20:54 +00:00
bienvenu%netscape.com
26d5ef10a8 mork landing
git-svn-id: svn://10.0.0.236/trunk@23966 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:16:40 +00:00
bienvenu%netscape.com
781f4a7ec1 add error check that we can actually get the hdr from the db
git-svn-id: svn://10.0.0.236/trunk@23965 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:16:23 +00:00
bienvenu%netscape.com
b3213aed32 mork landing, fix delete of local mail messages
git-svn-id: svn://10.0.0.236/trunk@23964 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:12:41 +00:00
alecf%netscape.com
92b909c348 now link libnntp directly into base, so we can do dogfood
git-svn-id: svn://10.0.0.236/trunk@23963 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 20:05:16 +00:00
bienvenu%netscape.com
17e06b0b25 initialize offset before asking for it
git-svn-id: svn://10.0.0.236/trunk@23962 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:57:56 +00:00
bienvenu%netscape.com
d5a9fd297a fix buffer size overstatement, add assertions for various failures
git-svn-id: svn://10.0.0.236/trunk@23961 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:54:26 +00:00
dp%netscape.com
963e08ef2a Descriptor Leak fixed. Thanks to bruce@cybersight.com
git-svn-id: svn://10.0.0.236/trunk@23960 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:49:31 +00:00
briano%netscape.com
1062c18c50 Automated update
git-svn-id: svn://10.0.0.236/trunk@23959 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:45:45 +00:00
ebina%netscape.com
653d886923 Fix bug #773
Apply patch to not infinite loop if Chunking in STRIP_CRLF
state, and no LF is provided.


git-svn-id: svn://10.0.0.236/trunk@23958 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:45:24 +00:00
alecf%netscape.com
79baed5053 only use these rules if the libIDL is available (and thus XPIDL is available)
git-svn-id: svn://10.0.0.236/trunk@23957 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:35:40 +00:00
alecf%netscape.com
0081c7c702 ignore generated files
git-svn-id: svn://10.0.0.236/trunk@23956 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:34:47 +00:00
alecf%netscape.com
4978342613 use BUILD_IDLC to refer to the DOM idl compiler
git-svn-id: svn://10.0.0.236/trunk@23955 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:34:25 +00:00
alecf%netscape.com
e139fc1c63 start using BUILD_XPIDL to build XPIDL
git-svn-id: svn://10.0.0.236/trunk@23954 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:28:09 +00:00
ebina%netscape.com
121de6f1db Fix bug #2808
Add explicit text/html and text/xml to the accepts header.  Move PNG
to the from of the list of accepted image formats.


git-svn-id: svn://10.0.0.236/trunk@23953 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:16:01 +00:00
bienvenu%netscape.com
7f77b5715c fix character after line continuation character problem
git-svn-id: svn://10.0.0.236/trunk@23952 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 19:12:37 +00:00
alecf%netscape.com
1089cc78f7 uppercase filename for Unix
git-svn-id: svn://10.0.0.236/trunk@23951 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 18:50:31 +00:00
bienvenu%netscape.com
554ebeecf3 start adding mork to linux build
git-svn-id: svn://10.0.0.236/trunk@23950 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 18:16:34 +00:00
ducarroz%netscape.com
5493a75b12 change root path preference name
git-svn-id: svn://10.0.0.236/trunk@23948 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 17:17:10 +00:00
ducarroz%netscape.com
c48085c109 change prefs properties name to be compatible with Nova's prefs as much as possible. Add pref for reply to.
git-svn-id: svn://10.0.0.236/trunk@23947 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 17:16:06 +00:00
kostello%netscape.com
5d9eb5bd73 Force Redraw on Enter: this is a workaround for bug#3356 & bug#3639
git-svn-id: svn://10.0.0.236/trunk@23946 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 15:40:29 +00:00
ftang%netscape.com
a7e0437a49 add meta tag reload hack. reviewed by rickg
git-svn-id: svn://10.0.0.236/trunk@23945 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 14:31:20 +00:00
edwin%woudt.nl
bd55b34cd0 Patches from Mauro Botelho
git-svn-id: svn://10.0.0.236/trunk@23944 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 14:22:59 +00:00
putterman%netscape.com
f7a08a5c4b Load Message
git-svn-id: svn://10.0.0.236/trunk@23943 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 13:18:14 +00:00
putterman%netscape.com
f08fa8d0a9 removed release of nsmsghdr until we decouple from rdf.
git-svn-id: svn://10.0.0.236/trunk@23942 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 13:17:45 +00:00
putterman%netscape.com
de4b563b52 Moved parse url utility
git-svn-id: svn://10.0.0.236/trunk@23941 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 13:17:21 +00:00
putterman%netscape.com
3a9a14da2b Can either load a demo message or a real message.
git-svn-id: svn://10.0.0.236/trunk@23940 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 13:16:51 +00:00
putterman%netscape.com
62f84045eb link with msgdb and rdfutil.
git-svn-id: svn://10.0.0.236/trunk@23939 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 13:14:57 +00:00
putterman%netscape.com
1be401d4ec Date displays correctly.
git-svn-id: svn://10.0.0.236/trunk@23938 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 13:14:33 +00:00
putterman%netscape.com
04c9f37ca6 comment out NS_ERROR in remove
git-svn-id: svn://10.0.0.236/trunk@23937 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 13:13:58 +00:00
ramiro%netscape.com
db0ca36e35 Make it possible to prefix mozilla dlls that conflict with system dlls.
git-svn-id: svn://10.0.0.236/trunk@23935 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 12:43:04 +00:00
briano%netscape.com
402809f631 Automated update
git-svn-id: svn://10.0.0.236/trunk@23934 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 11:45:42 +00:00
ramiro%netscape.com
6814bf46c6 Take out exception tests, it breaks --enable-tests.
git-svn-id: svn://10.0.0.236/trunk@23933 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 11:42:10 +00:00
ramiro%netscape.com
e5da645884 unbreak it on linux.
git-svn-id: svn://10.0.0.236/trunk@23932 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 11:29:43 +00:00
ramiro%netscape.com
d51ceea808 Dont build broken rdfsink tests, breaks --enable-tests.
git-svn-id: svn://10.0.0.236/trunk@23931 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 11:27:57 +00:00
dp%netscape.com
9356d42ebe Using nsHashtable and nsProgIDKey for dll hashing
git-svn-id: svn://10.0.0.236/trunk@23930 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 11:25:17 +00:00
dp%netscape.com
2d294e429d using nsHashtable for dllStore.
git-svn-id: svn://10.0.0.236/trunk@23929 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 11:23:49 +00:00
waterson%netscape.com
1947b09302 More nsCOMPtr bustage. !@$!%!@ Mac.
git-svn-id: svn://10.0.0.236/trunk@23928 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 10:29:11 +00:00
waterson%netscape.com
f59164d74d Fixed nsCOMPtr bustage on Mac.
git-svn-id: svn://10.0.0.236/trunk@23927 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 10:24:42 +00:00
waterson%netscape.com
0481c9b28f Added note on making fns virtual.
git-svn-id: svn://10.0.0.236/trunk@23926 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 10:09:51 +00:00
waterson%netscape.com
e98eb1a012 Added precondition checks to DOM observer APIs.
git-svn-id: svn://10.0.0.236/trunk@23925 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 10:09:26 +00:00
waterson%netscape.com
e2f8b6b96e Fixed bug with ambiguity that may occur in calls to RDFTreeBuilderImpl::RemoveWidgetItem(); implemented OnRemoveChild() DOM observer.
git-svn-id: svn://10.0.0.236/trunk@23924 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 10:09:07 +00:00
rjc%netscape.com
bf2745b51c Damn tabs/spaces.
git-svn-id: svn://10.0.0.236/trunk@23923 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 09:21:04 +00:00
mcafee%netscape.com
72ea9e5ee5 Removing a printf()
git-svn-id: svn://10.0.0.236/trunk@23922 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 09:19:28 +00:00
rjc%netscape.com
9f76dfecf8 Move folder-open.gif and folder-closed.gif into dist area.
git-svn-id: svn://10.0.0.236/trunk@23921 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 09:00:58 +00:00
dp%netscape.com
943c88fd8d Forcing XPCOM registry recreation
git-svn-id: svn://10.0.0.236/trunk@23920 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:53:45 +00:00
dp%netscape.com
189340f83f PC: Disabling autoregistration at initialization. It will be done by the app.
git-svn-id: svn://10.0.0.236/trunk@23919 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:52:56 +00:00
dp%netscape.com
a926c59c99 PC: Enabling autoregistration from the app
git-svn-id: svn://10.0.0.236/trunk@23918 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:51:37 +00:00
rjc%netscape.com
d57c9702e3 The file system datasource now sets a type='FileSystemObject' attribute on file system nodes.
git-svn-id: svn://10.0.0.236/trunk@23917 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:50:36 +00:00
rjc%netscape.com
981dc68d02 Only set container='true' when something is really a container.
git-svn-id: svn://10.0.0.236/trunk@23916 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:49:26 +00:00
rjc%netscape.com
d6d3579139 Add icons for type=FileSystemObject
git-svn-id: svn://10.0.0.236/trunk@23915 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:48:21 +00:00
rjc%netscape.com
839c3ab6f5 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23914 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:38:21 +00:00
waterson%netscape.com
e1aa99a9a8 Renamed IsWidgetProperty() to IsContainmentProperty(), added RemoveWidgetItem() call and hooked it up in the generic builder.
git-svn-id: svn://10.0.0.236/trunk@23913 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:13:14 +00:00
waterson%netscape.com
5728cb2dcf Fixed bug where button created without 'src=' would crash when 'src=' was set.
git-svn-id: svn://10.0.0.236/trunk@23912 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:11:54 +00:00
rpotts%netscape.com
80e70e30ec Removed the Change Icons menu item... Removed the call to BrowserPrintPreview() from the Print Preview menu item. Currently, the BrowserPrintPreview() function does not do what you expect - it tries to change the toolbar icons and crashes
git-svn-id: svn://10.0.0.236/trunk@23911 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:03:02 +00:00
putterman%netscape.com
45203890af Fix some idl changes.
git-svn-id: svn://10.0.0.236/trunk@23910 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 08:02:35 +00:00
putterman%netscape.com
af42b15942 Specify folder with two '/'.
git-svn-id: svn://10.0.0.236/trunk@23909 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 07:59:03 +00:00
putterman%netscape.com
1d8fc9a6e8 Remove another release because of RDF nsMsgHdr problems. Will fix after we
decouple nsMsghdr and nsIMessage.


git-svn-id: svn://10.0.0.236/trunk@23908 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 07:58:20 +00:00
putterman%netscape.com
25069479e9 Add and Remove folderListeners, and hook up DeleteMessage between datasource
and database.


git-svn-id: svn://10.0.0.236/trunk@23907 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 07:57:26 +00:00
putterman%netscape.com
1a7ee5eddc Added a parameter to CreateMsgHdr to determine if we use GetMessageKey while
creating URI.


git-svn-id: svn://10.0.0.236/trunk@23906 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 07:56:24 +00:00
putterman%netscape.com
f76992bc38 Add and Remove FolderListeners.
git-svn-id: svn://10.0.0.236/trunk@23905 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 07:55:26 +00:00
putterman%netscape.com
ce0a8ed2f8 Add and Remove Folder Listeners.
git-svn-id: svn://10.0.0.236/trunk@23904 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 07:54:48 +00:00
waterson%netscape.com
0d344fe048 Ripped out the 'toy' parser and installed an updated version of the parser from 4.5.
git-svn-id: svn://10.0.0.236/trunk@23903 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 07:46:42 +00:00
bienvenu%netscape.com
aba5cf4b18 initial mork landing - not part of build yet
git-svn-id: svn://10.0.0.236/trunk@23902 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 07:39:27 +00:00
kostello%netscape.com
b53c0edb3c Fixed bug 3651: for OutputText, we were not outputting
linebreaks whenever we encounter <BR> in the content
model.


git-svn-id: svn://10.0.0.236/trunk@23901 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 06:51:34 +00:00
kostello%netscape.com
32ae1e3029 Fixed bug 3664: not checking for null condition
git-svn-id: svn://10.0.0.236/trunk@23900 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 06:50:41 +00:00
mccabe%netscape.com
d7ffc955ca Not part of seamonkey.
Removed awkward nsXPTParamInfo::GetInterface and friend, and als removed supporting nsXPTParamInfo.cpp file.  Replace by nsIInterfaceInfo::GetInfoForParam and friend.

Made the constructor for nsInterfaceInfo private, with nsInterfaceInfoManager as a friend class.


git-svn-id: svn://10.0.0.236/trunk@23899 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 06:49:01 +00:00
mcafee%netscape.com
50d6478a9c Solaris needs prototypes for PR_Free, PR_smprintf.
git-svn-id: svn://10.0.0.236/trunk@23898 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 06:42:37 +00:00
mscott%netscape.com
c550297965 add printf statement for "Mailbox Done" to allow QA to script a smoketest for the mail client.
git-svn-id: svn://10.0.0.236/trunk@23897 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 06:24:34 +00:00
karnaze%netscape.com
df217ace86 hopefully a fix for the mac build
git-svn-id: svn://10.0.0.236/trunk@23896 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 06:12:03 +00:00
karnaze%netscape.com
1a9cdab67c bug 3628, scrolling=yes on <frame>, <iframe>
git-svn-id: svn://10.0.0.236/trunk@23895 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:36:35 +00:00
mscott%netscape.com
b6eb6d4598 Add a return value at the end of GetSmtpName to fix build breakage on windows. I don't know why VC6.0 let it go....
git-svn-id: svn://10.0.0.236/trunk@23894 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:33:00 +00:00
sfraser%netscape.com
1c80fd42e0 Throw the switch so we now pay attention to the charCode in the key event.
git-svn-id: svn://10.0.0.236/trunk@23893 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:28:22 +00:00
hyatt%netscape.com
a8ddba3660 Changing the name of the include tag.
git-svn-id: svn://10.0.0.236/trunk@23892 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:22:19 +00:00
hyatt%netscape.com
c62b139bf2 XUL fragments live!
git-svn-id: svn://10.0.0.236/trunk@23891 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:21:25 +00:00
hyatt%netscape.com
d132d95a8f Tweaked the content sink to remove an unused argument from the Init method.
git-svn-id: svn://10.0.0.236/trunk@23890 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:21:01 +00:00
hyatt%netscape.com
2e291cefc4 Enhanced the document loader to handle subdocuments.
git-svn-id: svn://10.0.0.236/trunk@23889 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:20:29 +00:00
hyatt%netscape.com
2a48f5090b Enhanced the document loader so that it can now handle subdocuments, thus
enabling it to load multiple documents at once and to support the integration
of a subdocument into the parent document.


git-svn-id: svn://10.0.0.236/trunk@23888 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:20:14 +00:00
rjc%netscape.com
226685e45f Use appropriate icon for actual bookmark URLs.
git-svn-id: svn://10.0.0.236/trunk@23887 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:01:41 +00:00
waterson%netscape.com
a1e15dd39c Fix more tab-spaces makefile bustage.
git-svn-id: svn://10.0.0.236/trunk@23886 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 05:00:13 +00:00
beard%netscape.com
dd2226b969 using nsITimer::GetIID() instead of kITimerIID
git-svn-id: svn://10.0.0.236/trunk@23885 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:48:48 +00:00
beard%netscape.com
598d135826 took out initialization check in InitLiveConnectClasses
git-svn-id: svn://10.0.0.236/trunk@23884 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:48:28 +00:00
beard%netscape.com
e4c35278ba massive overhaul for new stream APIs.
git-svn-id: svn://10.0.0.236/trunk@23883 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:48:04 +00:00
beard%netscape.com
04acba3cf8 added NS_DEFINE_STATIC_IID_ACCESSOR.
git-svn-id: svn://10.0.0.236/trunk@23882 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:46:43 +00:00
waterson%netscape.com
c0fd696b5d Added an #ifdef XP_UNIX implementation of _strrev() to fix the
build. No clue if it works.


git-svn-id: svn://10.0.0.236/trunk@23881 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:41:50 +00:00
beard%netscape.com
5176ae5079 NS_NATIVE_PLUGIN_PORT
git-svn-id: svn://10.0.0.236/trunk@23880 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:33:29 +00:00
pinkerton%netscape.com
63b1cd1062 Fixes bug #3532 where incremental reflow was not being correctly handled. Also no longer re-resolves the style context at each reflow, but only once on inital reflow.
git-svn-id: svn://10.0.0.236/trunk@23879 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:33:24 +00:00
rjc%netscape.com
105565a73e Removing old personal toolbar folder icons which are too long (>31 characters) due to Mac. They've been replaced by icon files with shorter names.
git-svn-id: svn://10.0.0.236/trunk@23878 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:31:21 +00:00
beard%netscape.com
c77610eb5c Fixed some unitialized variables
git-svn-id: svn://10.0.0.236/trunk@23877 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:31:13 +00:00
beard%netscape.com
d170b2f876 added AddEventListener
git-svn-id: svn://10.0.0.236/trunk@23876 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:30:30 +00:00
beard%netscape.com
5c6e5f4422 now reference counts all listeners
git-svn-id: svn://10.0.0.236/trunk@23875 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:29:48 +00:00
rjc%netscape.com
d1979f0a6c Reducing length of personal toolbar folder icons to be no more than 31 characters as its a Mac limit.
git-svn-id: svn://10.0.0.236/trunk@23874 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:29:41 +00:00
beard%netscape.com
50a74966ea now subclasses nsISupports
git-svn-id: svn://10.0.0.236/trunk@23873 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:29:19 +00:00
rjc%netscape.com
881f75b58e Icon filenames can't be longer than 31 characters (its a Mac limit) so shortening references to the personal toolbar folder icons. Also, adding in icon references to sidebar.xul
git-svn-id: svn://10.0.0.236/trunk@23872 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:19:43 +00:00
mscott%netscape.com
663e68d936 Build nsPop3Service.cpp
git-svn-id: svn://10.0.0.236/trunk@23871 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:19:12 +00:00
mscott%netscape.com
ea98214b55 Export nsIPop3Service.h
git-svn-id: svn://10.0.0.236/trunk@23870 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:18:34 +00:00
mscott%netscape.com
50aa8f26b5 Implement get new mail.
git-svn-id: svn://10.0.0.236/trunk@23869 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:15:13 +00:00
mscott%netscape.com
78e9bb7fab MsgGetNewMsg should call the get new mail function.
git-svn-id: svn://10.0.0.236/trunk@23868 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:14:28 +00:00
mscott%netscape.com
0c84ca104b Changes for naoki to implement set character set function.
git-svn-id: svn://10.0.0.236/trunk@23867 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:13:53 +00:00
mscott%netscape.com
36488fe0ba Changes for naoki to fill in the character set encoding menu.
git-svn-id: svn://10.0.0.236/trunk@23866 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:13:11 +00:00
mscott%netscape.com
197aa0528d Changes for Naoki to implement set character set menu stuff.
Implement GetNewMsgs function which runs a get new mail url through the pop3 service.


git-svn-id: svn://10.0.0.236/trunk@23865 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:12:36 +00:00
mscott%netscape.com
e2f3bd930e oops don't build pop3test until I'm ready for it to work again...
git-svn-id: svn://10.0.0.236/trunk@23864 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:10:59 +00:00
mscott%netscape.com
3c4779614a pop3 test no longer needs to create a transport. Go through the pop3 service for running a get new mail url....
git-svn-id: svn://10.0.0.236/trunk@23863 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:09:39 +00:00
mscott%netscape.com
9bdec6edc6 factory can now create a pop3 service...
git-svn-id: svn://10.0.0.236/trunk@23862 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:07:52 +00:00
mscott%netscape.com
7d5546829d Build nsPop3Service.
git-svn-id: svn://10.0.0.236/trunk@23861 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:06:09 +00:00
mscott%netscape.com
af6a3f985d Creating a pop3 protocol should not require a transport. We should do it ourselves. LoadUrL should take a consumer.
git-svn-id: svn://10.0.0.236/trunk@23860 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:05:40 +00:00
rjc%netscape.com
e8b44fc4ee Need to shorten image filenames to 31 or less characters. Its a Mac file limit.
git-svn-id: svn://10.0.0.236/trunk@23859 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:05:23 +00:00
mscott%netscape.com
79b39b0714 updates to use nsIMsgMailNewsUrl to pick up url listener stuff. define a default Pop3 port...
git-svn-id: svn://10.0.0.236/trunk@23858 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:04:40 +00:00
mscott%netscape.com
5f517473b7 Update the interface so it supports the nsIMsgMailNews interface...
git-svn-id: svn://10.0.0.236/trunk@23857 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 04:02:53 +00:00
mscott%netscape.com
4565c68f77 We no longer need to create the transport for the smtp protocol. Use smtpName as sender's name.
git-svn-id: svn://10.0.0.236/trunk@23856 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:57:59 +00:00
waterson%netscape.com
28605e89fb Fix Unix build bustage.
git-svn-id: svn://10.0.0.236/trunk@23855 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:57:16 +00:00
mscott%netscape.com
6f42922563 Updates to smtp protocol. We should not require the caller to create the transport at construction time. the protocol should do this itself.
git-svn-id: svn://10.0.0.236/trunk@23854 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:57:13 +00:00
beard%netscape.com
7eba319f1f commented out NEW_PLUGIN_STREAM_API
git-svn-id: svn://10.0.0.236/trunk@23853 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:56:02 +00:00
mscott%netscape.com
41b91ea697 use default smtp port to initialize m_port.
git-svn-id: svn://10.0.0.236/trunk@23852 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:55:46 +00:00
beard%netscape.com
ed188a97ca removed NEW_PLUGIN_STREAM_API #ifdefs, conformed to latest nsIPluginStreamListener interface.
git-svn-id: svn://10.0.0.236/trunk@23851 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:55:42 +00:00
beard%netscape.com
4e4dbfcd3c Added a 4.x target.
git-svn-id: svn://10.0.0.236/trunk@23850 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:55:26 +00:00
mscott%netscape.com
bc3a57ba68 define default SMTP port...
git-svn-id: svn://10.0.0.236/trunk@23849 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:54:59 +00:00
beard%netscape.com
9912c80b57 changed how visibility is computed with nsPluginPort.
git-svn-id: svn://10.0.0.236/trunk@23848 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:54:23 +00:00
mscott%netscape.com
47b36d89c8 Distinguish between pop and smtp user name. Remove old user_name field which has these new, more specific fields instead.
git-svn-id: svn://10.0.0.236/trunk@23847 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:54:13 +00:00
mscott%netscape.com
8ea5ffa415 a service to make running pop3 urls easier for the mail client.
git-svn-id: svn://10.0.0.236/trunk@23846 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:51:35 +00:00
mscott%netscape.com
a43c810e98 Export nsIPop3Service.h
git-svn-id: svn://10.0.0.236/trunk@23845 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:50:48 +00:00
mscott%netscape.com
bb94c546c7 Pop3 service for dealing with pop3 urls...
git-svn-id: svn://10.0.0.236/trunk@23844 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:50:20 +00:00
rjc%netscape.com
8713a65eb3 Make history datasource work on Mac and Unix, not just Windows. Now using nsFileSpec and removed all Std C FILE code in favor of streams.
git-svn-id: svn://10.0.0.236/trunk@23843 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:42:43 +00:00
rhp%netscape.com
5160205498 Finding content type handler plugins on UNIX
git-svn-id: svn://10.0.0.236/trunk@23842 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:40:28 +00:00
rhp%netscape.com
4d25652ec3 More makefile changes for components
git-svn-id: svn://10.0.0.236/trunk@23841 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:35:09 +00:00
rhp%netscape.com
dd67e1fe64 Change to make it a component
git-svn-id: svn://10.0.0.236/trunk@23840 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:24:00 +00:00
rhp%netscape.com
c6bc7aa463 Added the installation of CSS and JS files.
git-svn-id: svn://10.0.0.236/trunk@23839 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:17:45 +00:00
ducarroz%netscape.com
414f9038e7 export composeBody.html
git-svn-id: svn://10.0.0.236/trunk@23838 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 03:03:23 +00:00
briano%netscape.com
c12e8e5eb1 Made it acceptable to QNX's shell.
git-svn-id: svn://10.0.0.236/trunk@23837 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 02:55:24 +00:00
buster%netscape.com
b6be8ea31d deleting the last editable object in a document now causes a bogus placeholder <P>&nbsp;</P> to be added to the document. This node has the
attribute MOZ_EDITOR_BOGUS_NODE set to TRUE.  this solves the problem of when you do a SelectAll then a DEL, you don't have a cursor
or any way to set selection in the document. You do still have the problem that the nbsp is pretty narrow and the frame containing it is hard to hit
with the mouse.  We really need the "set selection to frame nearest the mouse down point" operation.

the intent is for all inserts to look for this node, and if found delete it before the insert.  likewise, all deletes will be no-ops if this node is found.


git-svn-id: svn://10.0.0.236/trunk@23836 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 02:28:24 +00:00
buster%netscape.com
3475d199f3 fixed a small bug. mRefNode may be nsnull.
git-svn-id: svn://10.0.0.236/trunk@23835 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 02:27:48 +00:00
sar%netscape.com
7b417ab826 make it possible to turn mailnews off by setting DISABLE_MAILNEWS
git-svn-id: svn://10.0.0.236/trunk@23834 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 02:27:29 +00:00
mcafee%netscape.com
eefc28a949 Removing printf
git-svn-id: svn://10.0.0.236/trunk@23833 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 02:25:00 +00:00
mcafee%netscape.com
18e50b9e0b Adding triple-click support; map double-click events to NS_MOUSE_LEFT_DOUBLECLICK, etc. (3595)
git-svn-id: svn://10.0.0.236/trunk@23832 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 02:23:44 +00:00
warren%netscape.com
5bbb6913cd Put back in call to NS_NewUnionEnumerator -- resolved link problem.
git-svn-id: svn://10.0.0.236/trunk@23831 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 02:10:03 +00:00
mjudge%netscape.com
e4c09191d6 reverting fix :(
git-svn-id: svn://10.0.0.236/trunk@23830 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:49:12 +00:00
alecf%netscape.com
2e1d72fa5a nsNetFile wasn't building on unix...
git-svn-id: svn://10.0.0.236/trunk@23829 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:44:02 +00:00
alecf%netscape.com
df9d34d3cd don't build old-sk00l mail/news protocols
git-svn-id: svn://10.0.0.236/trunk@23828 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:42:52 +00:00
mjudge%netscape.com
f49ed08720 backing out fix
git-svn-id: svn://10.0.0.236/trunk@23827 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:35:13 +00:00
mjudge%netscape.com
c9c3a38a91 backing out fix. i hate this
git-svn-id: svn://10.0.0.236/trunk@23826 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:34:44 +00:00
mjudge%netscape.com
56ac18a720 fixing libs phase to make the windows lib to be used by \widget
git-svn-id: svn://10.0.0.236/trunk@23825 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:29:31 +00:00
mjudge%netscape.com
f73de66a02 changing the build system to export the "lib" on the libs phase not wait for install
git-svn-id: svn://10.0.0.236/trunk@23824 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:28:52 +00:00
ducarroz%netscape.com
1f8a8ccb14 Fix transparency color problem
git-svn-id: svn://10.0.0.236/trunk@23823 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:27:54 +00:00
waterson%netscape.com
b2a49aab76 s/rdfb/rdf
git-svn-id: svn://10.0.0.236/trunk@23822 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:25:30 +00:00
waterson%netscape.com
6c48f04c6d Added rules for personal toolbar GIFs.
git-svn-id: svn://10.0.0.236/trunk@23821 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:23:00 +00:00
rhp%netscape.com
07fa937efc Changes for linux build.
git-svn-id: svn://10.0.0.236/trunk@23820 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:22:30 +00:00
waterson%netscape.com
a7fe911af7 Added rules for personal toolbar folder GIFs.
git-svn-id: svn://10.0.0.236/trunk@23819 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:21:40 +00:00
waterson%netscape.com
7017b2656c Added icons and style rules for the personal toolbar folder.
git-svn-id: svn://10.0.0.236/trunk@23818 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:21:20 +00:00
sdagley%netscape.com
f1888f3f4e Fixing the Mac build bustage by calling the get() accessor for comparison
git-svn-id: svn://10.0.0.236/trunk@23817 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:16:08 +00:00
ftang%netscape.com
8a18f3ae43 Add atsui work for non ASCII text. Reviewed and approved by pierre. Need more work to convert more text into MacRoman.
git-svn-id: svn://10.0.0.236/trunk@23816 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:15:52 +00:00
ducarroz%netscape.com
56b6d9487a Part of integration of preference into compose
git-svn-id: svn://10.0.0.236/trunk@23815 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:10:43 +00:00
ducarroz%netscape.com
8a51948c91 Add pref for user real name, organization and user email address
git-svn-id: svn://10.0.0.236/trunk@23814 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:09:48 +00:00
warren%netscape.com
c557e9d038 Added menu item to bring up messenger.
git-svn-id: svn://10.0.0.236/trunk@23813 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:08:17 +00:00
ducarroz%netscape.com
af0e1f977b Part of the intregration of preferences into compose
git-svn-id: svn://10.0.0.236/trunk@23812 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:07:30 +00:00
despotdaemon%netscape.com
64a0e1d8a7 Pseudo-automatic update of changes made by brendan@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@23811 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:04:08 +00:00
mjudge%netscape.com
2531ba7a64 need to swap positions for mac. need to put COMPtr on right side of ==
git-svn-id: svn://10.0.0.236/trunk@23810 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 01:02:34 +00:00
despotdaemon%netscape.com
7dc69c50e5 Pseudo-automatic update of changes made by brendan@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@23809 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:49:00 +00:00
ducarroz%netscape.com
c4c91237ac Initial checkin, part of integration of preference into compose
git-svn-id: svn://10.0.0.236/trunk@23808 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:47:09 +00:00
waterson%netscape.com
0881f4d92b Fixed spaces in Makefile.in.
git-svn-id: svn://10.0.0.236/trunk@23807 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:31:40 +00:00
briano%netscape.com
a8c4a6f357 Now static builds can find the static libraries they need.
git-svn-id: svn://10.0.0.236/trunk@23806 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:30:52 +00:00
rods%netscape.com
17a3db4b61 removed D&D define
git-svn-id: svn://10.0.0.236/trunk@23805 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:24:36 +00:00
akkana%netscape.com
5fccac2f05 nsConvertKey should only set the key code to zero if the key is one
of the special keys.
Also, handle_key_press/release_event shouldn't pass events for shift,
control, and alt keys -- other platforms don't treat those as key events,
so the XP code isn't prepared to handle them.
This fixes typing of punctuation marks in the editor.


git-svn-id: svn://10.0.0.236/trunk@23804 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:23:11 +00:00
rods%netscape.com
28fc42d142 Fixed up some of the drag & drop codce
Added the filling in of the charCode  field in nsKeyEvent


git-svn-id: svn://10.0.0.236/trunk@23803 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:21:11 +00:00
mjudge%netscape.com
5876940d2e fixed memory leaks in nsRangelist.cpp. uninitialized memory in nsTextframe, simplified APIs in nsIFrame and the underlying implementations. see layout.checkins
git-svn-id: svn://10.0.0.236/trunk@23802 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:17:14 +00:00
dp%netscape.com
5915fbf7df Unix: Autoregistration disabled at initialization. This should be done by app.
git-svn-id: svn://10.0.0.236/trunk@23801 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:05:54 +00:00
dp%netscape.com
dd245a35ba Autoregistration at startup on unix from the app
git-svn-id: svn://10.0.0.236/trunk@23800 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:04:39 +00:00
cyeh%netscape.com
5f2bfbd29b re-enabling this directory. if the tree breaks again, i'll yank it again, but i have built and clobber_alled and i still can't reproduce the problem.
git-svn-id: svn://10.0.0.236/trunk@23799 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:04:23 +00:00
bienvenu%netscape.com
e8b07e2650 fix off by 1 error in buffer growing code
git-svn-id: svn://10.0.0.236/trunk@23798 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:01:37 +00:00
mjudge%netscape.com
a1cd7388b4 fixed copy paste issue on windows, linking wrong.lib file
git-svn-id: svn://10.0.0.236/trunk@23797 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:01:24 +00:00
waterson%netscape.com
3bf2c5323c Added rules to export bookmark images.
git-svn-id: svn://10.0.0.236/trunk@23796 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-12 00:01:22 +00:00
waterson%netscape.com
25b9b109d0 Use xul:titledbutton instead of xul:treeicon for now.
git-svn-id: svn://10.0.0.236/trunk@23795 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:59:26 +00:00
waterson%netscape.com
6b3c9f5d2c Added bookmark images and style rules to apply them.
git-svn-id: svn://10.0.0.236/trunk@23794 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:58:51 +00:00
sfraser%netscape.com
98f3ad251b Added EditorInitPagePlain.html, for plain text testing.
Changed editor XUL file to load this.


git-svn-id: svn://10.0.0.236/trunk@23793 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:31:58 +00:00
morse%netscape.com
706d1518bf added include for wallet
git-svn-id: svn://10.0.0.236/trunk@23792 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:30:49 +00:00
sfraser%netscape.com
095d0e1915 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23791 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:30:44 +00:00
briano%netscape.com
c6519177cb Automated update
git-svn-id: svn://10.0.0.236/trunk@23790 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:30:41 +00:00
michaelp%netscape.com
0264b208cc added Sample 13
git-svn-id: svn://10.0.0.236/trunk@23789 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:22:46 +00:00
sfraser%netscape.com
5eece8ae5d Fix a crash if a xul file specifies a non-existent start page (NS_ADDREF changed to NS_IF_ADDREF).
git-svn-id: svn://10.0.0.236/trunk@23788 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:17:29 +00:00
briano%netscape.com
bc9f831df4 Fix for the NetBSD build breakage (hopefully).
git-svn-id: svn://10.0.0.236/trunk@23787 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 23:16:49 +00:00
alecf%netscape.com
d5ce998bd6 purify fixes from bruce@cybersight.com
git-svn-id: svn://10.0.0.236/trunk@23786 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:58:25 +00:00
cyeh%netscape.com
0aa49cad32 i have no idea why clobber_all isn't working in this directory. instead
of letting the tree burn forever, i am removing from mainline build until
i can reproduce this problem on my machine


git-svn-id: svn://10.0.0.236/trunk@23785 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:55:08 +00:00
alecf%netscape.com
9207ac4292 purify fix from bruce@cybersight.com
git-svn-id: svn://10.0.0.236/trunk@23784 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:53:02 +00:00
amusil%netscape.com
d2ecbb2bef Minor API change. Added support for tags that don't specify SRC or DATA params.
git-svn-id: svn://10.0.0.236/trunk@23783 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:50:58 +00:00
amusil%netscape.com
f6cd375f7c Added some mimetypes. Fixed bugs.
git-svn-id: svn://10.0.0.236/trunk@23782 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:49:51 +00:00
amusil%netscape.com
417ae85db0 Redesigned plugin cache code for StreamAsFile operations. Removed NEW_PLUGIN_STREAM_API ifdefs.
git-svn-id: svn://10.0.0.236/trunk@23781 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:48:58 +00:00
terry%netscape.com
afe8ed25d5 Added new pages to edit existing components.
git-svn-id: svn://10.0.0.236/trunk@23780 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:48:42 +00:00
alecf%netscape.com
fce2803e63 update this interface, rename CreateAndInit->CreateAndInitialize
git-svn-id: svn://10.0.0.236/trunk@23779 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:46:56 +00:00
hyatt%netscape.com
918a6347c9 Adding GetIID methods to the content viewer and document loader.
git-svn-id: svn://10.0.0.236/trunk@23778 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:38:38 +00:00
cata%netscape.com
cae09c94bf EUCJP encoder test
git-svn-id: svn://10.0.0.236/trunk@23777 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:37:53 +00:00
cata%netscape.com
f48fb5e6f6 EUCJP encoder
git-svn-id: svn://10.0.0.236/trunk@23776 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:37:27 +00:00
cata%netscape.com
75944f01ac Multi table support added.
git-svn-id: svn://10.0.0.236/trunk@23775 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:36:40 +00:00
hyatt%netscape.com
22d212af2a Adding the GetIID methods to webshell.
git-svn-id: svn://10.0.0.236/trunk@23774 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:34:13 +00:00
waterson%netscape.com
3558cb747a Fixed build: capitalization error.
git-svn-id: svn://10.0.0.236/trunk@23773 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:32:44 +00:00
michaelp%netscape.com
637d37eb64 fixes for demo #13.
git-svn-id: svn://10.0.0.236/trunk@23772 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:27:00 +00:00
waterson%netscape.com
0159a35dfc Bug 3213. Removed obsolete files to keep the tree clean.
git-svn-id: svn://10.0.0.236/trunk@23771 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:26:08 +00:00
alecf%netscape.com
0908df47c4 remove bogus call for now
git-svn-id: svn://10.0.0.236/trunk@23770 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:23:43 +00:00
sfraser%netscape.com
d02e8ad864 Ignore the offset parameter returned from GetScrap.
git-svn-id: svn://10.0.0.236/trunk@23769 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:14:25 +00:00
sfraser%netscape.com
5d32eefd0f Fix the Paste code in various ways.
git-svn-id: svn://10.0.0.236/trunk@23768 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 22:03:22 +00:00
dp%netscape.com
6a616ea35a Unix: Adding MOZILLA_FIVE_HOME
git-svn-id: svn://10.0.0.236/trunk@23767 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:31:16 +00:00
sfraser%netscape.com
6a3d01cd40 Fix for 3630 -- terminate text and HTML strings returned from the editor.
git-svn-id: svn://10.0.0.236/trunk@23766 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:31:03 +00:00
michaelp%netscape.com
92d0f77a8c made compositor state an enum and macro to trace state transitions
for easier debugging. made offscreen to onscreen blit restricted to the
damage rect. added temporary hack so that new compositor works on linux.


git-svn-id: svn://10.0.0.236/trunk@23765 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:25:25 +00:00
michaelp%netscape.com
83c8853043 added sample #13: dhtml and compositor.
git-svn-id: svn://10.0.0.236/trunk@23764 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:23:28 +00:00
ducarroz%netscape.com
8d008d263b Remove all the delete this that was generating a crash when the send failed for any reason
git-svn-id: svn://10.0.0.236/trunk@23763 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:22:25 +00:00
ducarroz%netscape.com
18f45eb469 Use ender instance of an input field for the body of the message
git-svn-id: svn://10.0.0.236/trunk@23762 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:16:08 +00:00
ducarroz%netscape.com
5bcb1e7229 Initial check in, ender integration
git-svn-id: svn://10.0.0.236/trunk@23761 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:15:23 +00:00
cyeh%netscape.com
e604db3381 bizarre. i don't know how an empty makefile.win got checked into the tree.
git-svn-id: svn://10.0.0.236/trunk@23760 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:13:22 +00:00
alecf%netscape.com
08514ac409 rev this interface - remove unnecessary functions
git-svn-id: svn://10.0.0.236/trunk@23759 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:06:31 +00:00
cata%netscape.com
9adc779545 Fix for GetMaxLength()
git-svn-id: svn://10.0.0.236/trunk@23758 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:05:31 +00:00
alecf%netscape.com
f199bf9a87 rev this interface
git-svn-id: svn://10.0.0.236/trunk@23757 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:05:26 +00:00
alecf%netscape.com
a076346f86 rev this interface: char* -> const char*
git-svn-id: svn://10.0.0.236/trunk@23756 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:04:57 +00:00
cata%netscape.com
7ccb120a1d SJIS encoder added.
git-svn-id: svn://10.0.0.236/trunk@23755 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:04:54 +00:00
cata%netscape.com
3de23b0fb3 SJIS encoder test added.
git-svn-id: svn://10.0.0.236/trunk@23754 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:04:30 +00:00
alecf%netscape.com
b94994dc5d rev this interface - char*->const char*
git-svn-id: svn://10.0.0.236/trunk@23753 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:02:50 +00:00
sar%netscape.com
2336908bf5 add mozilla/extensions to SeaMonkeyBrowser
git-svn-id: svn://10.0.0.236/trunk@23752 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:02:04 +00:00
alecf%netscape.com
1aad69b823 fix up libraries a bit more
git-svn-id: svn://10.0.0.236/trunk@23751 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 21:01:39 +00:00
alecf%netscape.com
1b37c66667 remove unnecessary libraries
git-svn-id: svn://10.0.0.236/trunk@23750 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:56:17 +00:00
cata%netscape.com
f05d1b51f9 Test EUCJP encoder added.
git-svn-id: svn://10.0.0.236/trunk@23749 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:39:50 +00:00
ebina%netscape.com
2ddc35bca2 Bruce Mitchener's memory leak fixes.
git-svn-id: svn://10.0.0.236/trunk@23748 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:39:39 +00:00
cata%netscape.com
5d993fef81 Fix for correct converting.
git-svn-id: svn://10.0.0.236/trunk@23747 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:39:19 +00:00
alecf%netscape.com
5781f583a8 constructors not public confuses unix
git-svn-id: svn://10.0.0.236/trunk@23746 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:38:47 +00:00
cata%netscape.com
e20331ac02 Decoder helper param fixed.
git-svn-id: svn://10.0.0.236/trunk@23745 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:38:39 +00:00
troy%netscape.com
7a6ab354fa Fixed a few places where memory allocated using ToNewCString() was free'd using
PR_Free() instead of delete[]


git-svn-id: svn://10.0.0.236/trunk@23744 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:38:28 +00:00
alecf%netscape.com
a55bfa8f8c use MIN not min - unix doesn't have min()
git-svn-id: svn://10.0.0.236/trunk@23743 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:38:19 +00:00
cata%netscape.com
46a552681d Method param fixed.
git-svn-id: svn://10.0.0.236/trunk@23742 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:37:57 +00:00
alecf%netscape.com
a066758d59 install of these files doesn't quite work yet
git-svn-id: svn://10.0.0.236/trunk@23741 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:36:47 +00:00
alecf%netscape.com
fb4d800a68 remove files that don't exist anymore (though this directory isn't even entered any more)
git-svn-id: svn://10.0.0.236/trunk@23740 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:36:18 +00:00
alecf%netscape.com
010d146d47 ignore generated files
git-svn-id: svn://10.0.0.236/trunk@23739 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:35:29 +00:00
troy%netscape.com
710622602d Patch from Bruce Mitchener that fixes incorrect use of delete
operator


git-svn-id: svn://10.0.0.236/trunk@23738 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:32:59 +00:00
alecf%netscape.com
5641548120 this is a component now
git-svn-id: svn://10.0.0.236/trunk@23737 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:29:18 +00:00
troy%netscape.com
efa6744bfd Fixed MapDeclarationInto() so it correctly handles 'min-width', 'max-width',
'min-height', and 'max-height'


git-svn-id: svn://10.0.0.236/trunk@23736 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:29:02 +00:00
troy%netscape.com
25220f507f Patch from Bruce Mitchener that fixes an incorrect use of delete
git-svn-id: svn://10.0.0.236/trunk@23735 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:27:54 +00:00
alecf%netscape.com
b9b10f3081 add libraries to link this library against
git-svn-id: svn://10.0.0.236/trunk@23734 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:27:14 +00:00
ducarroz%netscape.com
1c1027b70f Extend messenger patch to composer
git-svn-id: svn://10.0.0.236/trunk@23733 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:27:13 +00:00
alecf%netscape.com
710ff324a6 update unix makefile list for mailnews - add new mime stuff, remove old compose makefiles
git-svn-id: svn://10.0.0.236/trunk@23732 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:25:58 +00:00
mscott%netscape.com
28f45695ea Change m0id_scope to m_0id_id in order to fix the problem where the list of msg headers was always empty...
git-svn-id: svn://10.0.0.236/trunk@23731 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:22:41 +00:00
putterman%netscape.com
6b09cec24d removed call to release
git-svn-id: svn://10.0.0.236/trunk@23730 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:19:53 +00:00
hyatt%netscape.com
33cc556694 Added nsXULDocumentInfo.cpp
git-svn-id: svn://10.0.0.236/trunk@23729 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:10:31 +00:00
ramiro%netscape.com
9407081b70 Change MOZILLA_HOME to MOZILLA_FIVE_HOME so that we dont fight Communicator
4.x installations.


git-svn-id: svn://10.0.0.236/trunk@23728 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:00:57 +00:00
briano%netscape.com
a25b2f9d53 Automated update
git-svn-id: svn://10.0.0.236/trunk@23727 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 20:00:43 +00:00
jfrancis%netscape.com
aa9e3374d2 implemented paste
git-svn-id: svn://10.0.0.236/trunk@23726 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:56:12 +00:00
danm%netscape.com
7e985dfa2f fix large leak loading XUL page. bug 3561 reported by bruce@cybersight.com. r:hyatt.
git-svn-id: svn://10.0.0.236/trunk@23725 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:54:17 +00:00
putterman%netscape.com
ca9ee9973a Added delete button code
git-svn-id: svn://10.0.0.236/trunk@23724 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:52:02 +00:00
putterman%netscape.com
8df736e3ad Add delete message
git-svn-id: svn://10.0.0.236/trunk@23723 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:50:54 +00:00
putterman%netscape.com
28d9c7407d Add delete button
git-svn-id: svn://10.0.0.236/trunk@23722 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:50:27 +00:00
putterman%netscape.com
539b85f7b4 Gets dependencies correct
git-svn-id: svn://10.0.0.236/trunk@23721 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:50:01 +00:00
cyeh%netscape.com
b88162a61f *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@23720 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:49:40 +00:00
hyatt%netscape.com
1b0823980c Adding in the new document info class and tweaking the builder so that
it knows how to use it.


git-svn-id: svn://10.0.0.236/trunk@23719 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:49:32 +00:00
hyatt%netscape.com
1a5441a132 Code to enable instantiation of the new document info class.
git-svn-id: svn://10.0.0.236/trunk@23718 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:49:05 +00:00
cyeh%netscape.com
fbfda029ed moving code from mozilla/wallet to mozilla/extensions/wallet per brendan/shaver.
code owner is morse@netscape.com.

modified source and makefiles to be connected to toplevel build and fix optimized
builds. mozilla/wallet is obsolete.


git-svn-id: svn://10.0.0.236/trunk@23717 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:48:51 +00:00
hyatt%netscape.com
793f50ca3c Helper class for handling of XUL fragments.
git-svn-id: svn://10.0.0.236/trunk@23716 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:48:43 +00:00
slamm%netscape.com
d2df84f62d Fix for -MD flags. Filter-out the rule if the rule if it is bogus. A better way around the problem would be to take CFLAGS off the link line, but I am not sure if we can do this.
git-svn-id: svn://10.0.0.236/trunk@23715 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:46:00 +00:00
sfraser%netscape.com
36dae6fed3 Add SelectAll() to the EditorAppCore
git-svn-id: svn://10.0.0.236/trunk@23713 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:35:26 +00:00
sfraser%netscape.com
ab21987cd6 Fix the key handling, and fix my macro for the charCode stuff
git-svn-id: svn://10.0.0.236/trunk@23712 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:34:28 +00:00
sfraser%netscape.com
2af73d37f9 Add SelectAll()
git-svn-id: svn://10.0.0.236/trunk@23711 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 19:33:37 +00:00
cyeh%netscape.com
b404d5302c make clobber_all remove the dist so we can catch depedency problems. if you don't
blow away the dist, you can hide module dependencies and build order that need
to be correct in makefile.win DIRS


git-svn-id: svn://10.0.0.236/trunk@23710 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 18:14:57 +00:00
kostello%netscape.com
be6a84bd6d Fix build bustage: editor is near the end of the make order AND
gfx comes before widget


git-svn-id: svn://10.0.0.236/trunk@23709 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 18:12:12 +00:00
terry%netscape.com
6bb632aa4f Allow importing of groupset.
git-svn-id: svn://10.0.0.236/trunk@23708 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 16:54:12 +00:00
terry%netscape.com
ca10a7208c Added 'groups' stuff, where we have different group bits that we can
put on a person or on a bug.  Some of the group bits control access to bugzilla
features.  And a person can't access a bug unless he has every group bit set
that is also set on the bug.


git-svn-id: svn://10.0.0.236/trunk@23707 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 16:30:54 +00:00
troy%netscape.com
4dc985bb1a Patch from Bruce Mitchener (bruce@sybersight.com) that fixes incorrect
use of delete operator


git-svn-id: svn://10.0.0.236/trunk@23706 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 15:21:46 +00:00
troy%netscape.com
bc0d788a43 Work-in-progress for min/max properties
git-svn-id: svn://10.0.0.236/trunk@23705 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 15:13:17 +00:00
dcone%netscape.com
808ec32e38 added the nsdrawingsurfacemac to project
git-svn-id: svn://10.0.0.236/trunk@23704 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 15:02:42 +00:00
dcone%netscape.com
1e8690a6ef update to use the nsDrawingSurfaceMac object for its onscreen on offscreen drawing.
git-svn-id: svn://10.0.0.236/trunk@23703 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 14:42:11 +00:00
rjc%netscape.com
30a3d46852 Comment out NS_PRECONDITION on mDocument.
git-svn-id: svn://10.0.0.236/trunk@23702 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 12:07:49 +00:00
rjc%netscape.com
b62f8f98d6 Better, smarter sorting implementation.
git-svn-id: svn://10.0.0.236/trunk@23701 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 12:01:47 +00:00
rjc%netscape.com
d1d11b6ca0 Only answer GetTarget() queries if its a file URL (ignore file root node)
git-svn-id: svn://10.0.0.236/trunk@23700 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 12:00:57 +00:00
rpotts%netscape.com
ec0377d74b in the process of adding support for a protocol helper component which is responsible for dealing with modal requests from the network protocol handlers (which may be on different threads...)
git-svn-id: svn://10.0.0.236/trunk@23699 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 11:39:34 +00:00
rpotts%netscape.com
1cbd1aad68 Temporarily added a CID for the default protocol helper component...
git-svn-id: svn://10.0.0.236/trunk@23698 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 11:35:23 +00:00
warren%netscape.com
fe85bdf68a Commented out line causing link error on mac (fix later).
git-svn-id: svn://10.0.0.236/trunk@23697 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 11:03:43 +00:00
warren%netscape.com
c0d9f68452 tweak
git-svn-id: svn://10.0.0.236/trunk@23696 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 11:01:16 +00:00
warren%netscape.com
e82363f5b8 Exporting symbols for the mac.
git-svn-id: svn://10.0.0.236/trunk@23695 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 10:47:54 +00:00
rpotts%netscape.com
c53692a87b added an #ifdef USE_NGPREF around the definition of the nsIPref interface and ClassID... This should fix the build bustage...
git-svn-id: svn://10.0.0.236/trunk@23694 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 10:23:37 +00:00
warren%netscape.com
6a01692cd7 attempt to fix mac build
git-svn-id: svn://10.0.0.236/trunk@23693 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 10:18:46 +00:00
warren%netscape.com
bdd2b4c0ad First cut at new command architecture.
git-svn-id: svn://10.0.0.236/trunk@23692 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 10:14:35 +00:00
warren%netscape.com
720e68dd8f First cut at new command architecture.
git-svn-id: svn://10.0.0.236/trunk@23691 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 10:01:25 +00:00
warren%netscape.com
14b5004bf2 Added union and intersection enumerators.
git-svn-id: svn://10.0.0.236/trunk@23690 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 09:56:59 +00:00
briano%netscape.com
d34fbbe08a Automated update
git-svn-id: svn://10.0.0.236/trunk@23689 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 09:30:43 +00:00
mcafee%netscape.com
ca9a6edb76 Adding -xildoff linker flag to Solaris/CC build; removing -z defaultextract MKSHLIB_UNFORCE_ALL option, this works with ld but not CC. CC just picks the last -z option and uses that for the whole line, ld behaves as advertized in the ld man page.
git-svn-id: svn://10.0.0.236/trunk@23688 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 09:16:56 +00:00
vidur%netscape.com
52fcbb54d3 Put back in changes blown away by evaughn
git-svn-id: svn://10.0.0.236/trunk@23687 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 08:59:37 +00:00
rpotts%netscape.com
34a70160b5 Added an mRequestingThread member to nsConnectionInfo... This is a PRThread pointer to the thread which made the network request (ie. the UI thread, etc)... This information is necessary when marshelling information back to the requesting thread...
git-svn-id: svn://10.0.0.236/trunk@23686 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 08:19:54 +00:00
jband%netscape.com
bd370dabc0 strings are TD_PSTRING | XPT_TDP_POINTER
git-svn-id: svn://10.0.0.236/trunk@23685 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 08:01:02 +00:00
dp%netscape.com
0f3e789976 Changing default registry name:
Unix: ~/.mozilla/registry
Win: <winnt dir>\mozregistry.dat

BTW, mac is already MozRegistry


git-svn-id: svn://10.0.0.236/trunk@23684 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 07:56:03 +00:00
vidur%netscape.com
38fd4465f1 Added parsererror and sourcetext to element table
git-svn-id: svn://10.0.0.236/trunk@23683 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 07:52:24 +00:00
dp%netscape.com
50fc6ba44a creating ~/.mozilla under unix if not already there.
git-svn-id: svn://10.0.0.236/trunk@23682 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 07:44:23 +00:00
sfraser%netscape.com
00dff352b1 Added Cut, Copy and Paste, and did general cleanup
git-svn-id: svn://10.0.0.236/trunk@23681 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 07:40:55 +00:00
jband%netscape.com
498733635b interfaces are pointers and getters return retvals
git-svn-id: svn://10.0.0.236/trunk@23680 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 07:12:18 +00:00
kostello%netscape.com
846e8c7d06 Changed To using Ender: approved by legal
git-svn-id: svn://10.0.0.236/trunk@23679 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 06:48:30 +00:00
bienvenu%netscape.com
c26b882d4b add morkWriter and morkCell, morkRowCellCursor.cpp
git-svn-id: svn://10.0.0.236/trunk@23678 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 06:42:59 +00:00
bienvenu%netscape.com
2662ed7e15 use Close instead of Release
git-svn-id: svn://10.0.0.236/trunk@23677 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 06:42:18 +00:00
sfraser%netscape.com
3e711b3574 Adapted key listener to get char code directly from event, rather than trying to do a key code conversion (#ifdeffed out until char code is there on all platforms).
git-svn-id: svn://10.0.0.236/trunk@23676 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 06:42:09 +00:00
bienvenu%netscape.com
aa91144cd8 patches not to use persistent databases
git-svn-id: svn://10.0.0.236/trunk@23675 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 06:41:29 +00:00
bienvenu%netscape.com
ae80565560 fix bogus cast to nsMsgHdr
git-svn-id: svn://10.0.0.236/trunk@23674 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 06:40:22 +00:00
bienvenu%netscape.com
a3b794e060 add explicit include of nsCOMPtr.h
git-svn-id: svn://10.0.0.236/trunk@23673 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 06:39:35 +00:00
bienvenu%netscape.com
349b24308b check for missing db when deciding to reparse
git-svn-id: svn://10.0.0.236/trunk@23672 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 06:38:56 +00:00
ftang%netscape.com
ad19d90ea2 add shift_jis to the list. Solve PRBool problem on mac
git-svn-id: svn://10.0.0.236/trunk@23671 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:56:29 +00:00
troy%netscape.com
dac998d679 Patch from Bruce Mitchener (bruce@cybersight.com) that fixes unitialized
memort error


git-svn-id: svn://10.0.0.236/trunk@23670 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:56:11 +00:00
michaelp%netscape.com
52cba6f996 fixed memory leak.
git-svn-id: svn://10.0.0.236/trunk@23669 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:45:52 +00:00
nisheeth%netscape.com
6d7dd79951 - Send out the source line where the error occurred from inside PushXMLErrorToken().
- Add the 'parsererror' and 'sourcetext' tags to the HTML tag enum.


git-svn-id: svn://10.0.0.236/trunk@23668 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:36:50 +00:00
bienvenu%netscape.com
462294a411 fix syntax error in widgetglue js
git-svn-id: svn://10.0.0.236/trunk@23667 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:32:51 +00:00
nisheeth%netscape.com
d6582f1383 Added two new HTML tags used internally for error reporting of expat errors: "parsererror" and "sourcetext".
git-svn-id: svn://10.0.0.236/trunk@23666 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:30:28 +00:00
nisheeth%netscape.com
1f80f4903a - Beautified error reporting of expat errors. We now don't just dump the error text out as nodes. We create the parsererror and sourcetext HTML nodes that can be styled via ua.css.
git-svn-id: svn://10.0.0.236/trunk@23665 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:29:36 +00:00
nisheeth%netscape.com
840ff7b218 - changing ua.css to add style rules for the 'parsererror' and 'sourcetext' elements.
- added eHTMLTag_parsererror, eHTMLTag_sourcetext to the set of HTML tags.
- These tags are used within XML documents to show errors from expat.


git-svn-id: svn://10.0.0.236/trunk@23664 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:26:53 +00:00
kostello%netscape.com
34b6d10e6e Changed comment on -editor and -mail command line code
git-svn-id: svn://10.0.0.236/trunk@23663 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:25:57 +00:00
kostello%netscape.com
18a85b2199 Added -editor and -mail as command line extensions. When
passed into apprunner they load the corresponding editor and
mail url


git-svn-id: svn://10.0.0.236/trunk@23662 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:24:29 +00:00
bienvenu%netscape.com
4cdd706865 add GetAuthor and GetSubject intefraces
git-svn-id: svn://10.0.0.236/trunk@23661 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 05:15:33 +00:00
kostello%netscape.com
ca7237d1a1 Cleaned up PasteTextBlocking to return better
error information if NO TEXT data exists
on the clipboard


git-svn-id: svn://10.0.0.236/trunk@23660 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 04:41:43 +00:00
kostello%netscape.com
0c821c1e9b Added windows specific paste code
git-svn-id: svn://10.0.0.236/trunk@23659 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 04:27:39 +00:00
mscott%netscape.com
3aa074e975 somehow the pointer passed into getting the netlib queue service got changed...change it back....
git-svn-id: svn://10.0.0.236/trunk@23658 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 03:34:27 +00:00
ftang%netscape.com
dbe9e3f74a fix mHasMultibyte hint problem when the first character of the *word* is not ASCII
git-svn-id: svn://10.0.0.236/trunk@23657 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 03:00:33 +00:00
alecf%netscape.com
b55da7fc0d more linux fixes - link against the right libraries, include xp_time.c, etc.
git-svn-id: svn://10.0.0.236/trunk@23656 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 02:50:08 +00:00
briano%netscape.com
a07f46d649 Automated update
git-svn-id: svn://10.0.0.236/trunk@23655 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 02:45:41 +00:00
sdagley%netscape.com
e4e0984d7d Fill in the keyEvent.charCode field so that we can figure out what character code corresponds to the key pressed.
git-svn-id: svn://10.0.0.236/trunk@23654 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 02:37:24 +00:00
briano%netscape.com
96a96a8041 Cleaned up some of the platform-specific ifdef's. Using HAVE_INT16_T, HAVE_INT32_T, and HAVE_UINT16_T now.
git-svn-id: svn://10.0.0.236/trunk@23653 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 02:37:23 +00:00
briano%netscape.com
7d557e36ad Added tests for int16_t, int32_t, and uint16_t for AIX and BSDI.
git-svn-id: svn://10.0.0.236/trunk@23652 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 02:32:53 +00:00
jband%netscape.com
2e6dec8b20 get xptinfo building on Win32 again
git-svn-id: svn://10.0.0.236/trunk@23651 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 02:21:23 +00:00
coop%netscape.com
989ad5fb47 NOT YET PART OF SEAMONKEY:
* added improved error message for IID collision.


git-svn-id: svn://10.0.0.236/trunk@23650 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 02:15:53 +00:00
alecf%netscape.com
e0e0f4428e fix constness casting problem
git-svn-id: svn://10.0.0.236/trunk@23649 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 02:08:41 +00:00
ducarroz%netscape.com
9a882563b4 add new entries
git-svn-id: svn://10.0.0.236/trunk@23647 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:44:44 +00:00
ducarroz%netscape.com
0443449c45 did some cleanup
git-svn-id: svn://10.0.0.236/trunk@23646 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:43:19 +00:00
ducarroz%netscape.com
5f3dc5c96f The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working.
git-svn-id: svn://10.0.0.236/trunk@23645 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:41:25 +00:00
ducarroz%netscape.com
0f2fac7795 The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working.
Initial check in


git-svn-id: svn://10.0.0.236/trunk@23644 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:38:11 +00:00
mjudge%netscape.com
b06caff664 fix win32 breakage by changing build order of widget and editor
git-svn-id: svn://10.0.0.236/trunk@23643 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:37:45 +00:00
ducarroz%netscape.com
095251d5fd The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working.
this file was originally located into mailnews/ui/compose/src


git-svn-id: svn://10.0.0.236/trunk@23642 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:36:37 +00:00
slamm%netscape.com
4b0a86f81a Only use mddepend.pl when PERL is set.
git-svn-id: svn://10.0.0.236/trunk@23641 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:35:33 +00:00
ducarroz%netscape.com
38429fdb48 Add new interface to nsMsgCompose, cleanup the code
git-svn-id: svn://10.0.0.236/trunk@23640 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:34:59 +00:00
alecf%netscape.com
945b46a56f rev these interfaces
git-svn-id: svn://10.0.0.236/trunk@23639 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:33:33 +00:00
jj%netscape.com
a608360198 changed $CLOBBER_LIBS from 0 to 1 [existing libs must be deleted before new one gets built]
git-svn-id: svn://10.0.0.236/trunk@23638 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:33:18 +00:00
ducarroz%netscape.com
a36ca94f86 The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working.
git-svn-id: svn://10.0.0.236/trunk@23637 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:32:48 +00:00
alecf%netscape.com
63c65a3694 eliminate duplicate IID
git-svn-id: svn://10.0.0.236/trunk@23636 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:32:08 +00:00
ducarroz%netscape.com
d4e5b0aa05 add new interface to nsIMsgCompose
git-svn-id: svn://10.0.0.236/trunk@23635 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:30:18 +00:00
slamm%netscape.com
17e4604888 Change name of save script
git-svn-id: svn://10.0.0.236/trunk@23634 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:30:16 +00:00
alecf%netscape.com
1e814f213b we don't need to link against these libraries any more on unix
git-svn-id: svn://10.0.0.236/trunk@23633 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:30:07 +00:00
alecf%netscape.com
47f482ea66 link against our libraries to resolve as many differences as possible
git-svn-id: svn://10.0.0.236/trunk@23632 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:28:48 +00:00
ducarroz%netscape.com
66c622b188 The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working.
this file was originally located into mailnews/ui/compose/public


git-svn-id: svn://10.0.0.236/trunk@23631 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:28:46 +00:00
sfraser%netscape.com
a95ee16903 Add widget.shlb to fix link bustage
git-svn-id: svn://10.0.0.236/trunk@23630 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:26:19 +00:00
troy%netscape.com
6866976cb9 Work-in-progress for 'min' and 'max' properties
git-svn-id: svn://10.0.0.236/trunk@23629 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:23:10 +00:00
slamm%netscape.com
43ac5089cb Summarize checkout conflicts before dying.
git-svn-id: svn://10.0.0.236/trunk@23628 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:21:25 +00:00
alecf%netscape.com
b0914f756b rev nsINNTPHost and nsINewsgroupList interfaces
git-svn-id: svn://10.0.0.236/trunk@23627 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:18:04 +00:00
ducarroz%netscape.com
b6fdfe569c add new icons to the build process
git-svn-id: svn://10.0.0.236/trunk@23626 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:17:36 +00:00
ducarroz%netscape.com
f69e944958 initial check in, Icons used by mail composer
git-svn-id: svn://10.0.0.236/trunk@23625 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:15:40 +00:00
kostello%netscape.com
8214fef4e5 Move editor to build last because of the dependency on widget
git-svn-id: svn://10.0.0.236/trunk@23624 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:13:48 +00:00
ducarroz%netscape.com
e4f75dce4b don't need anymore this file, use xul file instance
git-svn-id: svn://10.0.0.236/trunk@23623 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:12:06 +00:00
ducarroz%netscape.com
adc62ac4a1 did a lot of cleanup, now compatible with new compose appcore
git-svn-id: svn://10.0.0.236/trunk@23622 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:11:04 +00:00
ducarroz%netscape.com
ff7e7e5958 The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working.
This file isn't needed anymore


git-svn-id: svn://10.0.0.236/trunk@23621 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:07:23 +00:00
ducarroz%netscape.com
9f358744b8 The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working
this file has been moved to mailnews/compose/src


git-svn-id: svn://10.0.0.236/trunk@23620 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:06:09 +00:00
ducarroz%netscape.com
0366fa8b46 The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working
don't need anymore this file


git-svn-id: svn://10.0.0.236/trunk@23619 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:04:24 +00:00
ducarroz%netscape.com
9e31970053 The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working
don't need anymore those files


git-svn-id: svn://10.0.0.236/trunk@23618 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 01:03:12 +00:00
ducarroz%netscape.com
514844786a folder ui/compose/public removed
git-svn-id: svn://10.0.0.236/trunk@23617 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:56:54 +00:00
ducarroz%netscape.com
8f056dc1ab as compose.dll has been merged with msgcompose.dll, those files has been moved to mailnewscompose/public
git-svn-id: svn://10.0.0.236/trunk@23616 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:55:06 +00:00
ducarroz%netscape.com
349b1a82a5 As compose.dll has been merged into msgcompose.dll, we don't need those makefile anymore
git-svn-id: svn://10.0.0.236/trunk@23615 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:52:31 +00:00
ducarroz%netscape.com
42a18f68c1 The compose.dll has been merged into msgcompose.dll in order to have the auto appcore registration working
git-svn-id: svn://10.0.0.236/trunk@23614 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:48:35 +00:00
mjudge%netscape.com
85664fd476 fixing windows build bustage by temporarily loading the raptorwidget_s.dll when ender.dll is loaded. temporary until repository code working
git-svn-id: svn://10.0.0.236/trunk@23613 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:20:27 +00:00
slamm%netscape.com
0832fa39cd Take out NSPR rpm option. let the user type it in.
git-svn-id: svn://10.0.0.236/trunk@23612 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:18:57 +00:00
av%netscape.com
d645e88da3 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@23611 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:17:38 +00:00
cmanske%netscape.com
8c0b6cc73e Removed unnecessary factory interface registration
git-svn-id: svn://10.0.0.236/trunk@23610 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:16:19 +00:00
slamm%netscape.com
fda4e234b3 Combine NSPR and pthreads options. Update overall look.
git-svn-id: svn://10.0.0.236/trunk@23609 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:10:46 +00:00
akkana%netscape.com
5aedc09286 Change the reference to the global selection mgr to fix windows build
git-svn-id: svn://10.0.0.236/trunk@23608 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:08:10 +00:00
joki%netscape.com
d710a79e1d Adding DOM access to new character information
git-svn-id: svn://10.0.0.236/trunk@23607 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:07:59 +00:00
joki%netscape.com
19bae035e4 Adding new charCode variable to nsGUIEvent
git-svn-id: svn://10.0.0.236/trunk@23606 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-11 00:01:50 +00:00
coop%netscape.com
80dfa8d3e2 NOT YET PART OF SEAMONKEY:
* one character fix (D'oh!) to make InterfaceTypeDescriptor indices update properly.


git-svn-id: svn://10.0.0.236/trunk@23605 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 23:41:04 +00:00
hyatt%netscape.com
742df4c179 Tweaks related to XUL fragments.
git-svn-id: svn://10.0.0.236/trunk@23604 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 23:31:26 +00:00
dp%netscape.com
7898673a73 Removing unused variable.
git-svn-id: svn://10.0.0.236/trunk@23603 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 23:30:25 +00:00
tague%netscape.com
6ad4a14379 Checked in patch from bruce@cybersight.com. Fixed purify memory error.
git-svn-id: svn://10.0.0.236/trunk@23602 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 23:19:44 +00:00
endico%mozilla.org
7b0ee15a8e Add support for indexing multiple trees from the same lxr directory.
git-svn-id: svn://10.0.0.236/trunk@23600 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:58:57 +00:00
nhotta%netscape.com
81a05263f7 Added Support class and encoders
git-svn-id: svn://10.0.0.236/trunk@23599 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:57:54 +00:00
rjc%netscape.com
1bf77ce0f4 const this, baby!
git-svn-id: svn://10.0.0.236/trunk@23598 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:54:49 +00:00
warren%netscape.com
e5d24a2696 Added progID version of GetService. Fixed up nsService to not be a template.
git-svn-id: svn://10.0.0.236/trunk@23597 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:53:17 +00:00
pollmann%netscape.com
c060190502 Checking in GetSelectedItem, GetSelectedIndices, and SetSelectedIndices methods. This enables submission of a listbox's value for Linux. (wahoo!)
git-svn-id: svn://10.0.0.236/trunk@23596 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:52:55 +00:00
akkana%netscape.com
f28253683c Comment out debug prints
git-svn-id: svn://10.0.0.236/trunk@23595 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:50:51 +00:00
cata%netscape.com
58053aee71 Support class, EUCJP and ISO2022JP encoders added.
git-svn-id: svn://10.0.0.236/trunk@23594 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:46:38 +00:00
akkana%netscape.com
a6feb40744 Implement editor cut/copy/paste
git-svn-id: svn://10.0.0.236/trunk@23593 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:46:15 +00:00
rpotts%netscape.com
ad4a570981 New interface to allow protocol handlers to request and process modal dialogs...
git-svn-id: svn://10.0.0.236/trunk@23592 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:43:23 +00:00
akkana%netscape.com
109aad3dea Fix Solaris build problems -- thanks to braddr & bruce @ puremagic.com
git-svn-id: svn://10.0.0.236/trunk@23591 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:41:18 +00:00
alecf%netscape.com
59c04072de rev the interface, update char* to const char*
git-svn-id: svn://10.0.0.236/trunk@23590 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:32:46 +00:00
akkana%netscape.com
f198ef7ae3 Fix purify UMR error -- thanks to braddr & bruce @ puremagic.com
git-svn-id: svn://10.0.0.236/trunk@23589 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:30:23 +00:00
slamm%netscape.com
2589f5be88 Added Javascript to change focus and radio selection for radio/text groups. Simplified the instructions.
git-svn-id: svn://10.0.0.236/trunk@23588 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:20:55 +00:00
alecf%netscape.com
b5aabe5013 rev this interface and remove NS_DOM binding from IDL
git-svn-id: svn://10.0.0.236/trunk@23587 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:19:54 +00:00
cata%netscape.com
edc8cfeb62 added files: mozilla/intl/uconv/ucvja/nsUCvJaSupport.cpp, mozilla/intl/uconv/ucvja/nsUnicodeToSJIS.cpp
git-svn-id: svn://10.0.0.236/trunk@23586 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:09:06 +00:00
alecf%netscape.com
fbc0ce4691 comment out these two functions, they are already defined on Unix
git-svn-id: svn://10.0.0.236/trunk@23585 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:08:07 +00:00
cata%netscape.com
c4558e181f SJIS encoder, Support class added.
git-svn-id: svn://10.0.0.236/trunk@23584 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:08:00 +00:00
alecf%netscape.com
80ac2d23f4 revert to old types for now to match definition in include/
git-svn-id: svn://10.0.0.236/trunk@23583 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:07:45 +00:00
dp%netscape.com
c81e64e889 Adding error messages when loading fails.
git-svn-id: svn://10.0.0.236/trunk@23582 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:07:34 +00:00
alecf%netscape.com
6121b82e15 various tweaks to make this build on Linux
git-svn-id: svn://10.0.0.236/trunk@23581 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:06:52 +00:00
alecf%netscape.com
598584c05b gotta export all these header files so that we can see them from other mime directories
git-svn-id: svn://10.0.0.236/trunk@23580 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:06:15 +00:00
rjc%netscape.com
fda66fcfc1 Small sort fix.
git-svn-id: svn://10.0.0.236/trunk@23579 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 22:02:25 +00:00
rjc%netscape.com
d90524979e When asking for a bookmark's URL via GetTarget(), synthesize it.
git-svn-id: svn://10.0.0.236/trunk@23578 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:58:40 +00:00
morse%netscape.com
926dd7bbd4 changes for wallet
git-svn-id: svn://10.0.0.236/trunk@23577 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:42:45 +00:00
mcmullen%netscape.com
6a5c89fa74 Fixed bustage with typo.
git-svn-id: svn://10.0.0.236/trunk@23576 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:41:43 +00:00
morse%netscape.com
e74e92add5 bug fix for single signon
git-svn-id: svn://10.0.0.236/trunk@23575 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:38:34 +00:00
morse%netscape.com
85bb026c3f New files for wallet
git-svn-id: svn://10.0.0.236/trunk@23574 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:35:41 +00:00
slamm%netscape.com
50ff7e73b4 Use an even simpler name, mozconfig (no .sh).
git-svn-id: svn://10.0.0.236/trunk@23573 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:34:17 +00:00
sfraser%netscape.com
fffcc0cbc4 Add Cut, Copy and Paste to editor interfaces and classes, with a stub implemenatioon in nsEditor. Changed .idl file and regenerated nsIDOMEditorAppCore and nsJSEditorAPpCore.
git-svn-id: svn://10.0.0.236/trunk@23572 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:31:50 +00:00
sfraser%netscape.com
0a1636794b Add Cut, Copy and Paste to editor interfaces and classes, with a stub implemenatioon in nsEditor.
git-svn-id: svn://10.0.0.236/trunk@23571 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:29:41 +00:00
kin%netscape.com
dd9bfaeb94 Changed all occurences of NS_TRANSACTION_MANAGER_FACTORY_CID
and kCTransactionManagerFactoryCID to NS_TRANSACTIONMANAGER_CID
and kCTransactionManagerCID.


git-svn-id: svn://10.0.0.236/trunk@23570 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:27:02 +00:00
sfraser%netscape.com
bbdc2c5a6b Add static to remove warning
git-svn-id: svn://10.0.0.236/trunk@23569 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:26:33 +00:00
kin%netscape.com
8b4d03a7fb Modified the clobber target so that it removes the dll from the bin/components directory.
git-svn-id: svn://10.0.0.236/trunk@23568 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:25:03 +00:00
shaver%netscape.com
378256875c generate meaningful annotation
git-svn-id: svn://10.0.0.236/trunk@23567 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:09:01 +00:00
mcmullen%netscape.com
681a46c1c0 Added tests for size and mod date.
git-svn-id: svn://10.0.0.236/trunk@23566 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:03:53 +00:00
slamm%netscape.com
8bc62cedd3 Make sure .mozconfig.mk can be read. Even for first checkout. Pre-fill web configurator with existing options.
git-svn-id: svn://10.0.0.236/trunk@23565 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:03:33 +00:00
mcmullen%netscape.com
bdbf667fac Added GetModDate and GetFileSize. Fixed a crash with a strcmp of null.
git-svn-id: svn://10.0.0.236/trunk@23564 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 21:02:58 +00:00
mcmullen%netscape.com
19c53c8fda Added output streamers for int and unsigned int.
git-svn-id: svn://10.0.0.236/trunk@23563 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:56:38 +00:00
av%netscape.com
d91791f1ef Rendering alt context in object tag
git-svn-id: svn://10.0.0.236/trunk@23562 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:43:07 +00:00
coop%netscape.com
4e2ef3ec92 NOT YET PART OF SEAMONKEY:
* first annotation indicates that resulting typelib was created by the linker.
* annotations from files being linked in are now preserved.


git-svn-id: svn://10.0.0.236/trunk@23561 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:40:17 +00:00
hshaw%netscape.com
7791b67a3a Replace NS_DECLARE_CID with NS_DEFINE_IID for kIPrefIID and KPrefCID
git-svn-id: svn://10.0.0.236/trunk@23560 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:33:18 +00:00
hshaw%netscape.com
d1254ab87c Replace NS_DECLARE_CID with NS_DEFINE_IID for KPrefCID
git-svn-id: svn://10.0.0.236/trunk@23559 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:33:14 +00:00
waterson%netscape.com
e64fdedc82 Added GetResource() to XULElement.
git-svn-id: svn://10.0.0.236/trunk@23558 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:20:52 +00:00
slamm%netscape.com
aabcc7fbbf sar want more 'checkins since' links. Don't refresh pagepage if it isn't the most recent time.
git-svn-id: svn://10.0.0.236/trunk@23557 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:18:49 +00:00
waterson%netscape.com
997a39d173 Remove invalid reference to nsIRDFContent.h
git-svn-id: svn://10.0.0.236/trunk@23556 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:18:21 +00:00
dougt%netscape.com
fdb6e0f2a5 Unix makefiles. Gotta love xpcode!
git-svn-id: svn://10.0.0.236/trunk@23555 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:17:14 +00:00
waterson%netscape.com
a0c57020f4 Must've missed this file in my merge: support for xpidl keyword.
git-svn-id: svn://10.0.0.236/trunk@23554 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:15:23 +00:00
putterman%netscape.com
e3eb9dceb3 Initialize mPath to "" instead of nsnull.
git-svn-id: svn://10.0.0.236/trunk@23553 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:07:44 +00:00
dougt%netscape.com
d643c0b6d4 No longer shifting windows nsFileSpec's mPath to uppercase.
Now comparing without regard to case instead on windows.
Windows nsSpecialSystemDirectory will have all uppercase mPaths.


git-svn-id: svn://10.0.0.236/trunk@23552 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:07:10 +00:00
hyatt%netscape.com
f7eb900fae Working on XUL fragments.
git-svn-id: svn://10.0.0.236/trunk@23551 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:05:12 +00:00
hshaw%netscape.com
3a95a0679c Fix for bug #3130 , thanks mcafee
git-svn-id: svn://10.0.0.236/trunk@23550 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 20:02:22 +00:00
waterson%netscape.com
d3d993d327 Support for xpidl keyword.
git-svn-id: svn://10.0.0.236/trunk@23549 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:55:00 +00:00
waterson%netscape.com
bd625fd0d0 Added SetDataBase() implementation that'll set the database on the DOMXULNode.
git-svn-id: svn://10.0.0.236/trunk@23548 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:54:36 +00:00
buster%netscape.com
9bcc7a19c2 first cut at rules delegate for text editor, will change drastically in the next week or two
git-svn-id: svn://10.0.0.236/trunk@23547 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:53:26 +00:00
buster%netscape.com
f076cbe10e creation of text nodes now supported
git-svn-id: svn://10.0.0.236/trunk@23546 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:51:55 +00:00
buster%netscape.com
4ddf2b48c1 mNewNode is a DOM Node, not a DOM Element
git-svn-id: svn://10.0.0.236/trunk@23545 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:51:07 +00:00
buster%netscape.com
cc359d1068 small fix of an off-by-one error in an assertion
git-svn-id: svn://10.0.0.236/trunk@23544 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:50:17 +00:00
buster%netscape.com
9dd1f7d958 SelectAll wired to Ctrl-A.
git-svn-id: svn://10.0.0.236/trunk@23543 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:49:43 +00:00
buster%netscape.com
4a106cee02 small interface change to InsertBreak
git-svn-id: svn://10.0.0.236/trunk@23542 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:49:18 +00:00
buster%netscape.com
0b0989c61c improvements to InsertBreak, and first crack at adding support for rules delegate
git-svn-id: svn://10.0.0.236/trunk@23541 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:48:46 +00:00
buster%netscape.com
d859f3e58c Implemented SelectAll.
Added nsEditor::DoInitialInsert() for doing first insert into an empty document.  Try typing into <html><body></body></html>
Added some smarts to DeleteSelectionAndCreateNode() so it only splits the selected node when appropriate (when the selection is not at offset 0 or max)

CreateElementTxn now creates text nodes as well as DOM elements


git-svn-id: svn://10.0.0.236/trunk@23540 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:48:13 +00:00
buster%netscape.com
0e7f65788f added nsTextEditRules
git-svn-id: svn://10.0.0.236/trunk@23539 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:47:34 +00:00
despotdaemon%netscape.com
9871322f1a Pseudo-automatic update of changes made by bruce@cybersight.com.
git-svn-id: svn://10.0.0.236/trunk@23538 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:46:32 +00:00
buster%netscape.com
9bf72e290c added nsIEditRules.h. Experimental, don't count on this.
git-svn-id: svn://10.0.0.236/trunk@23537 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:46:24 +00:00
jfrancis%netscape.com
bf6551cfed adding nsTextEditRules.cpp
git-svn-id: svn://10.0.0.236/trunk@23536 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:45:23 +00:00
coop%netscape.com
6db7aab3c3 NOT YET PART OF SEAMONKEY:
* xpt_dump now checks num_methods and num_constants before trying to walk the arrays.
* xpt_link now actually links. It even updates interfaces indices. Tested using all the idl files in mozilla/xpcom/idl.


git-svn-id: svn://10.0.0.236/trunk@23535 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:44:36 +00:00
pinkerton%netscape.com
1f508b19fb correct my pitiful spelling of bonsai.
git-svn-id: svn://10.0.0.236/trunk@23534 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:39:04 +00:00
terry%netscape.com
afebdc6fff Redistributed some QA folks.
git-svn-id: svn://10.0.0.236/trunk@23533 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 19:23:46 +00:00
dougt%netscape.com
bffbf478f9 Fixing casting problem on windows
NOT PART OF TINDERBOX


git-svn-id: svn://10.0.0.236/trunk@23532 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 18:51:15 +00:00
dougt%netscape.com
4b6e1122ce Make it work on the mac.
Passing unix paths to ZIP routines.  

THIS IS NOT PART OF THE BUILD SYSTEM YET


git-svn-id: svn://10.0.0.236/trunk@23530 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 18:39:01 +00:00
dougt%netscape.com
4d7174a311 Removing extra ; to get rid of warning.
THIS IS NOT PART OF TREE IS NOT PART OF THE BUILD SYSTEM YET


git-svn-id: svn://10.0.0.236/trunk@23529 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 18:36:40 +00:00
pinkerton%netscape.com
e9af4fe3ff fix 95/98 bustage
git-svn-id: svn://10.0.0.236/trunk@23528 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 18:11:35 +00:00
mcafee%netscape.com
c89a455a05 Solaris needs newline at EOF.
git-svn-id: svn://10.0.0.236/trunk@23527 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 10:57:05 +00:00
mcafee%netscape.com
39c88a0585 Solaris doesn't like the dangling semi-colon after NS_DECL_ISUPPORTS_INHERITED macro.
git-svn-id: svn://10.0.0.236/trunk@23526 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 10:52:50 +00:00
mccabe%netscape.com
ea7137976d Added tests of getting info assoc'd with params to TestInterfaceInfo.cpp, which uncovered an off-by-one problem due to magic typelib offsets for nsXPTParamInfo. Which makes me wonder if we shouldn't have just said #define XPT_INDEX_NO_PARENT 0xFFFF.
git-svn-id: svn://10.0.0.236/trunk@23525 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 10:36:13 +00:00
mcafee%netscape.com
6c5b72830c newline at end of file for Solaris, whitespace.
git-svn-id: svn://10.0.0.236/trunk@23524 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 09:56:25 +00:00
dp%netscape.com
4bcb926c07 changing to correct indent style and tabs. Beautify...
git-svn-id: svn://10.0.0.236/trunk@23523 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 09:53:25 +00:00
rjc%netscape.com
aa7eab3051 Cast away! and changed a few .Equals() to now be .EqualsIgnoreCase()
git-svn-id: svn://10.0.0.236/trunk@23522 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 09:41:07 +00:00
mccabe%netscape.com
1c4dd83cdc Not yet part of the Monkey.
- Added magic comments to make the LXR browsing experience more pleasant.

- introduced the nsInterfaceRecord class (formerly less formally interface_record).

- changed the XPTInterfaceDirectoryEntry pointer in InterfaceInfoes into nsInterfaceRecord pointers, removing the need for a hash just to go from entries to records to support nsXPTParamInfo::GetInterface.

- made the destructor for InterfaceInfo objects remove null the pointer in the corresponding reference.


git-svn-id: svn://10.0.0.236/trunk@23521 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 09:30:48 +00:00
dp%netscape.com
0f679ff5e4 Recheckin because of loss during ComponentManager Merge
- Using Reg*Raw() interface to support component urls storage in registry.
 - Implemented recursive version of DeleteKey() so that Reg*Raw() interface could be used

 - Fixing memory corruption; access of deleted dll object


git-svn-id: svn://10.0.0.236/trunk@23520 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 09:16:28 +00:00
waterson%netscape.com
4a8136b8ec Aggregate nsIDOMXULTreeElement interface onto nsRDFElement. Scriptability #ifdef-ed out.
git-svn-id: svn://10.0.0.236/trunk@23519 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 08:50:27 +00:00
waterson%netscape.com
ca6e4614ef Added nsXULTreeBuilder to build.
git-svn-id: svn://10.0.0.236/trunk@23518 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 08:49:35 +00:00
waterson%netscape.com
bb4ae3367f Added nsXULTreeElement to build.
git-svn-id: svn://10.0.0.236/trunk@23517 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 08:49:12 +00:00
braddr%puremagic.com
948141df40 Add new target for quantify
git-svn-id: svn://10.0.0.236/trunk@23516 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 08:32:42 +00:00
mccabe%netscape.com
9e433b6fbe Not part of seamonkey.
Added a comment saying preconditions the tests actually needs to
succeed.  (also simplified these some.)


git-svn-id: svn://10.0.0.236/trunk@23515 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 08:22:17 +00:00
waterson%netscape.com
67073aee6a Bug 3510. Fixed to use nsFileSpec, so now bookmarks should load on Mac (even through an alias).
git-svn-id: svn://10.0.0.236/trunk@23514 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 08:15:17 +00:00
waterson%netscape.com
997e72149b Fix build bustage, not really sure what this is supposed to be doing.
git-svn-id: svn://10.0.0.236/trunk@23513 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 08:11:28 +00:00
jband%netscape.com
9eb814c93e was using the same iid for 2 interfaces - synced nsIShutdownListener iid with the iid from the .h file
git-svn-id: svn://10.0.0.236/trunk@23512 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 08:02:23 +00:00
waterson%netscape.com
f933a42a97 Change PATH_MAX to MAXPATHLEN to compile on Solaris.
git-svn-id: svn://10.0.0.236/trunk@23511 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 07:21:09 +00:00
waterson%netscape.com
22026e5bb5 Fixed header files to work outside the XPIDL world for now.
git-svn-id: svn://10.0.0.236/trunk@23510 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 07:12:42 +00:00
rjc%netscape.com
cf3d2ba32b Small changes to sorting code to prepare for sorting on id attribute.
git-svn-id: svn://10.0.0.236/trunk@23509 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 07:07:10 +00:00
mccabe%netscape.com
c4fef7da6b Not part of seamonkey.
Fixed bustage due to improper use of DEBUG_somehacker.


git-svn-id: svn://10.0.0.236/trunk@23508 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:59:53 +00:00
rjc%netscape.com
df76041bf6 Quick&dirty fix for natural position attribute hack.
git-svn-id: svn://10.0.0.236/trunk@23507 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:37:04 +00:00
jband%netscape.com
c118498478 making it compile on Win32
git-svn-id: svn://10.0.0.236/trunk@23506 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:36:03 +00:00
mscott%netscape.com
238e5948be Add code to allow user's to display mailbox messages from the first 4 messages in their inbox....
also add code to retrieve the current user's root mail folder path...


git-svn-id: svn://10.0.0.236/trunk@23505 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:35:48 +00:00
waterson%netscape.com
46d6048104 Fixed my bad back-out.
git-svn-id: svn://10.0.0.236/trunk@23504 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:17:29 +00:00
karnaze%netscape.com
67d36f76f2 bug 3407
git-svn-id: svn://10.0.0.236/trunk@23503 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:13:35 +00:00
waterson%netscape.com
195f0c9dd4 Added OS_CurrentProcessDirectory test.
git-svn-id: svn://10.0.0.236/trunk@23502 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:08:06 +00:00
waterson%netscape.com
0f472a8518 Added OS_CurrentProcessDirectory implementation. Thanks to RJC for Mac. Unix is still bogus: uses getcwd().
git-svn-id: svn://10.0.0.236/trunk@23501 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:07:21 +00:00
alecf%netscape.com
5e01ee7094 fix nsFileSpec casting
git-svn-id: svn://10.0.0.236/trunk@23500 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:06:40 +00:00
mccabe%netscape.com
0b0b45888d Not part of seamonkey.
API change - changed nsXPTParamInfo from taking an InterfaceDirectoryEntry* (which really isn't part of the API I want to expose) to taking an nsIInterfaceInfo*, which is.


git-svn-id: svn://10.0.0.236/trunk@23499 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:06:19 +00:00
ducarroz%netscape.com
3aec1baafe don't crash anymore when the pane is null
git-svn-id: svn://10.0.0.236/trunk@23498 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:05:49 +00:00
alecf%netscape.com
a8ff15bf7a don't build tests by default
git-svn-id: svn://10.0.0.236/trunk@23497 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:01:40 +00:00
alecf%netscape.com
0380d26a03 don't link against base libmailnews
git-svn-id: svn://10.0.0.236/trunk@23496 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:00:59 +00:00
alecf%netscape.com
9262c5bd62 remove old call to NS_NewRFC822Parser
git-svn-id: svn://10.0.0.236/trunk@23495 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 06:00:11 +00:00
waterson%netscape.com
57265d0550 Landed on tip.
git-svn-id: svn://10.0.0.236/trunk@23494 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 05:37:31 +00:00
michaelp%netscape.com
0dfa53b698 fixed bug in underflow of state push count in new compositor.
git-svn-id: svn://10.0.0.236/trunk@23493 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 05:31:27 +00:00
briano%netscape.com
2069289d3b Automated update
git-svn-id: svn://10.0.0.236/trunk@23492 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 05:15:41 +00:00
waterson%netscape.com
93038788a2 Backed out addition of nsIDOMXULTreeElement: repository is horked.
git-svn-id: svn://10.0.0.236/trunk@23491 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 05:11:54 +00:00
ramiro%netscape.com
7933edd03e Reverted donm's solaris linker flag changes. You need to detect that gcc
is built to use the gnu linker.  You cant assume that here.


git-svn-id: svn://10.0.0.236/trunk@23490 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 05:09:54 +00:00
waterson%netscape.com
4f8cf8634e Added nsIDOMXULTreeElement.g to exports. This is currently generated by a very special version of idlc.
git-svn-id: svn://10.0.0.236/trunk@23489 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 05:08:26 +00:00
waterson%netscape.com
d745eb82a4 Added XULTreeElement to makefile, under !if.
git-svn-id: svn://10.0.0.236/trunk@23488 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 05:06:52 +00:00
waterson%netscape.com
0d826a1c01 Added nsIStreamListener to #includes to try to fix gcc 2.7 bustage.
git-svn-id: svn://10.0.0.236/trunk@23487 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 05:05:27 +00:00
waterson%netscape.com
0f8f4468a3 Initial revision.
git-svn-id: svn://10.0.0.236/trunk@23486 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 04:49:54 +00:00
mccabe%netscape.com
2c5a38de3e Not yet part of Seamonkey.
Progress on the nsInterfaceInfoManager typelib loader for xpconnect.
Now has complete (I think) functionality, though the implementation is
still probably rusty.

I punted on defining a directory for .xpt files at this point; the
implementation looks at the value of the XPTDIR environment variable
for this value.

Note that the nsXPTParaminfo interface (public/xpt_cpp) has changed
(possibly temporarily) to take an 'entry' parameter.


git-svn-id: svn://10.0.0.236/trunk@23485 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 04:26:15 +00:00
alecf%netscape.com
6879c5461b use CreateInstance to create a parser rather than linking directly with libmailnews.so
git-svn-id: svn://10.0.0.236/trunk@23484 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 04:22:52 +00:00
bienvenu%netscape.com
584b25602a fix nsFileSpec bustage
git-svn-id: svn://10.0.0.236/trunk@23482 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:55:10 +00:00
alecf%netscape.com
49cb5dada8 oops, don't build nsIMessenger.cpp twice
git-svn-id: svn://10.0.0.236/trunk@23481 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:53:48 +00:00
alecf%netscape.com
2cd4454623 export new files from ui directory
git-svn-id: svn://10.0.0.236/trunk@23480 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:52:29 +00:00
mscott%netscape.com
4e72d42e2a Warren's changes broke component creation for nsIMsgMailSession and nsIUrlListenerManager. Restore these so our code runs correctly.
git-svn-id: svn://10.0.0.236/trunk@23479 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:49:39 +00:00
mscott%netscape.com
c68803898a restore code from the breakage that occurred last night by fixing up nsFileSpec/nsFilePath problems. use CLOSE on the db because it isn't an interface yet so we should not be calling release.
git-svn-id: svn://10.0.0.236/trunk@23478 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:48:32 +00:00
mscott%netscape.com
9f173d6446 creating a url listener manager should go through the componenet manager and not the service manager.
git-svn-id: svn://10.0.0.236/trunk@23477 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:47:14 +00:00
briano%netscape.com
f80ea81018 Lame tweak in order to do a test build on non-glibc Linux systems.
git-svn-id: svn://10.0.0.236/trunk@23476 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:30:42 +00:00
mscott%netscape.com
5450b79a19 More Linux makefile changes for libmime
git-svn-id: svn://10.0.0.236/trunk@23475 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:27:12 +00:00
despotdaemon%netscape.com
fc53bb7f38 Pseudo-automatic update of changes made by pschwan@cmu.edu.
git-svn-id: svn://10.0.0.236/trunk@23474 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:26:04 +00:00
mscott%netscape.com
b0b1083af2 Adding files for linux build
git-svn-id: svn://10.0.0.236/trunk@23473 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:25:33 +00:00
mscott%netscape.com
7e66b91f85 Adding for Linux build.
git-svn-id: svn://10.0.0.236/trunk@23472 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:23:18 +00:00
mscott%netscape.com
1a5cd582ca Further changes for linux makefile
git-svn-id: svn://10.0.0.236/trunk@23471 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:21:02 +00:00
mscott%netscape.com
ab0c00e783 New files for Linux build
git-svn-id: svn://10.0.0.236/trunk@23470 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:20:16 +00:00
despotdaemon%netscape.com
92192bacf8 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@23469 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:15:31 +00:00
terry%netscape.com
e4f999a632 Only show checkboxes for trees that have had activity in the last two days.
git-svn-id: svn://10.0.0.236/trunk@23468 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 03:03:27 +00:00
law%netscape.com
03e8d64f2a New and improved status bar
git-svn-id: svn://10.0.0.236/trunk@23467 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 02:52:02 +00:00
mcmullen%netscape.com
5d582ac9c0 Change assignment operator not to create dirs.
git-svn-id: svn://10.0.0.236/trunk@23466 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 02:50:16 +00:00
terry%netscape.com
47ecdbd80b Cope if no mindate/maxdate is provided.
git-svn-id: svn://10.0.0.236/trunk@23465 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 02:48:31 +00:00
law%netscape.com
870160dbf4 Adding support for various statusbar broadcasters
git-svn-id: svn://10.0.0.236/trunk@23464 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 02:42:29 +00:00
cmanske%netscape.com
9832b2e459 removed files: mozilla/xpfe/AppCores/src/nsEditorMode.cpp
git-svn-id: svn://10.0.0.236/trunk@23463 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 02:41:02 +00:00
cmanske%netscape.com
22f502cd7f Cleaned up editor inialization in EditoAppCore
git-svn-id: svn://10.0.0.236/trunk@23462 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 02:35:58 +00:00
mscott%netscape.com
21415a3793 make the folder pane black =)....
git-svn-id: svn://10.0.0.236/trunk@23461 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 02:17:16 +00:00
hyatt%netscape.com
2db15f8900 Oops. Fixing build bustage.
git-svn-id: svn://10.0.0.236/trunk@23460 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 02:10:44 +00:00
despotdaemon%netscape.com
491fdefc01 Pseudo-automatic update of changes made by endico@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@23459 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:57:58 +00:00
terry%netscape.com
ef17928062 Was displaying junk for the branch name if a checkin wasn't allowed.
git-svn-id: svn://10.0.0.236/trunk@23458 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:52:32 +00:00
hyatt%netscape.com
9a6837ddd1 Fixing a bug.
git-svn-id: svn://10.0.0.236/trunk@23457 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:47:35 +00:00
hyatt%netscape.com
3762b96095 Adding support for XUL fragments to the content sink. (Work in
progress)


git-svn-id: svn://10.0.0.236/trunk@23456 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:45:53 +00:00
briano%netscape.com
ca209af80c Automated update
git-svn-id: svn://10.0.0.236/trunk@23455 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:45:41 +00:00
mscott%netscape.com
7fcb7c9321 Add more tests to the demo menu to allow folks to display messages from their Inbox.
git-svn-id: svn://10.0.0.236/trunk@23454 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:42:54 +00:00
alecf%netscape.com
c84fa01c70 don't #define MOZ_MAIL_NEWS, only set it in the make system
git-svn-id: svn://10.0.0.236/trunk@23453 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:41:09 +00:00
hyatt%netscape.com
4dd006de26 Landing the initial changes to support XUL fragments.
git-svn-id: svn://10.0.0.236/trunk@23452 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:37:31 +00:00
alecf%netscape.com
dff5073858 remove old cruft from ui (most moved into base)
git-svn-id: svn://10.0.0.236/trunk@23451 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:32:29 +00:00
alecf%netscape.com
9d23fe000f stop exporting stuff in this directory
git-svn-id: svn://10.0.0.236/trunk@23450 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:31:00 +00:00
jband%netscape.com
a825f73d7d adding Components object. Got rid of jsapi based nsID object and replaced it with reflected xpcom objects for IID and CID. adapted to xpt_struct changes. added allocator static helpers to the module. starting to use nsIComponentManager. fixed scriptable stuff. and on and on
git-svn-id: svn://10.0.0.236/trunk@23449 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:28:49 +00:00
alecf%netscape.com
2338455673 rev XPIDL-generated header files - now native #include's are no longer re-included!
git-svn-id: svn://10.0.0.236/trunk@23448 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:25:34 +00:00
rhp%netscape.com
1d1948a4e0 This change is needed to register libmime with netlib for parsing RFC822 messages.
git-svn-id: svn://10.0.0.236/trunk@23447 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:24:07 +00:00
alecf%netscape.com
7ed8242d7d add new source files that weren't being build on linux
git-svn-id: svn://10.0.0.236/trunk@23446 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:22:53 +00:00
alecf%netscape.com
51f3d54af3 #include the right file
git-svn-id: svn://10.0.0.236/trunk@23445 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:22:19 +00:00
alecf%netscape.com
39aed77c25 end in newline
git-svn-id: svn://10.0.0.236/trunk@23444 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:21:52 +00:00
vidur%netscape.com
7944b75ced Removed bogus addition of text for newlines
git-svn-id: svn://10.0.0.236/trunk@23443 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:19:35 +00:00
mscott%netscape.com
d77f43ff5b Changes for Linux builds.
git-svn-id: svn://10.0.0.236/trunk@23442 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:18:57 +00:00
vidur%netscape.com
2cf6b40bda Added CreateElementWithNameSpace to proprietary document interface. Fixed GetTagName for HTML to uppercase tag names. Hooked up style rule addition and deletion to reconstruct frames. Fixed DOM generation problem
git-svn-id: svn://10.0.0.236/trunk@23441 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:17:49 +00:00
mscott%netscape.com
089050a64d Fixes for makefiles on Linux
git-svn-id: svn://10.0.0.236/trunk@23440 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:17:48 +00:00
alecf%netscape.com
2cf4c284bc fix casting problems
git-svn-id: svn://10.0.0.236/trunk@23439 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:17:47 +00:00
alecf%netscape.com
cc1b5f77d9 uint -> PRUint32
git-svn-id: svn://10.0.0.236/trunk@23438 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:13:52 +00:00
alecf%netscape.com
2c0e5ce8fc export nsID.idl to get native types
git-svn-id: svn://10.0.0.236/trunk@23437 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:13:27 +00:00
michaelp%netscape.com
a699b49e4b factored code.
git-svn-id: svn://10.0.0.236/trunk@23435 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 01:03:03 +00:00
mscott%netscape.com
738e0cf71c Getting new mime change to run on Linux
git-svn-id: svn://10.0.0.236/trunk@23434 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:57:50 +00:00
sfraser%netscape.com
f867547c36 Put editor shared libs in the Components folder, and call the folder "Components", not "components".
git-svn-id: svn://10.0.0.236/trunk@23433 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:55:34 +00:00
mcafee%netscape.com
7ac72a2140 PRBool means use PR_FALSE/PR_TRUE. This breaks Solaris.
git-svn-id: svn://10.0.0.236/trunk@23432 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:53:29 +00:00
mscott%netscape.com
d58b486813 Updates to fix breakage caused by the big check in last night. In particular, update to use nsFilespec instead of nsFilePath. Use correct variable name for requesting the netlib queue service...
git-svn-id: svn://10.0.0.236/trunk@23431 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:43:58 +00:00
rhp%netscape.com
b3645fb2c7 Reworked an issue with includes to prevent compile problems with C & C++ code.
git-svn-id: svn://10.0.0.236/trunk@23430 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:36:39 +00:00
alecf%netscape.com
8021fac986 purify fix from bruce@cybersight.com - use delete[] rather than delete
git-svn-id: svn://10.0.0.236/trunk@23429 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:36:18 +00:00
alecf%netscape.com
9bb701d390 purify fixes from bruce@cybersight.com - use delete[] rather than delete
git-svn-id: svn://10.0.0.236/trunk@23428 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:35:16 +00:00
alecf%netscape.com
1bab895f15 purify fixes from bruce@cybersight.com - free memory the right way
git-svn-id: svn://10.0.0.236/trunk@23427 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:32:44 +00:00
alecf%netscape.com
c7c621d431 purify fixes from bruce@cybersight.com
use delete[] rather than delete


git-svn-id: svn://10.0.0.236/trunk@23426 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:31:59 +00:00
briano%netscape.com
15591a6649 Automated update
git-svn-id: svn://10.0.0.236/trunk@23425 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:30:41 +00:00
mcafee%netscape.com
63d1ddca8c Fixing Solaris/CC bustage.
git-svn-id: svn://10.0.0.236/trunk@23424 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:29:34 +00:00
akkana%netscape.com
c6464d3004 Fix UMR, caught with purify by bruce@portland.puremagic.com
git-svn-id: svn://10.0.0.236/trunk@23423 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:28:47 +00:00
donm%netscape.com
758efdc59e solaris gcc needs different command line options to link a
set of static libs into a shared lib.


git-svn-id: svn://10.0.0.236/trunk@23422 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:27:20 +00:00
waterson%netscape.com
89b60f7c29 Change class to clazz to get to compile in C++.
git-svn-id: svn://10.0.0.236/trunk@23421 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:22:22 +00:00
nhotta%netscape.com
56b9bce46c Added charset menu items in view menu.
git-svn-id: svn://10.0.0.236/trunk@23420 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:21:26 +00:00
slamm%netscape.com
11f1f88355 Give warning for 'make depend' with --enable-md.
git-svn-id: svn://10.0.0.236/trunk@23419 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:03:12 +00:00
pinkerton%netscape.com
7d7d82c1c1 new styles for expanding and collapsing folders
git-svn-id: svn://10.0.0.236/trunk@23418 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:01:55 +00:00
sfraser%netscape.com
b82cb437b9 onConstruction -> onload
git-svn-id: svn://10.0.0.236/trunk@23417 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-10 00:00:06 +00:00
dougt%netscape.com
39d464c13c First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23416 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:59:16 +00:00
slamm%netscape.com
b9cb51bca5 Change 'name' array to 'build'. Looks like name is reserved or something.
git-svn-id: svn://10.0.0.236/trunk@23415 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:59:15 +00:00
mscott%netscape.com
6afb85812c Build nsMsgIdentity and nsMsgMailSession.
git-svn-id: svn://10.0.0.236/trunk@23414 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:52:24 +00:00
mscott%netscape.com
85638846b7 Export nsIMsgIdentity.h and nsIMsgMailSession.h.
git-svn-id: svn://10.0.0.236/trunk@23413 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:51:40 +00:00
waterson%netscape.com
c758ab8571 Made sure to initialize rv to NS_OK.
git-svn-id: svn://10.0.0.236/trunk@23412 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:51:34 +00:00
rods%netscape.com
81e01450a9 Added the handling for nsDragDropEvents for files
git-svn-id: svn://10.0.0.236/trunk@23411 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:51:29 +00:00
rods%netscape.com
22f6a4adb0 Added EnableDileDrop method
git-svn-id: svn://10.0.0.236/trunk@23410 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:50:40 +00:00
rods%netscape.com
0d03271f02 Added nsDragDropEvent
git-svn-id: svn://10.0.0.236/trunk@23409 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:50:18 +00:00
rods%netscape.com
bf53653ab4 Added File Drop
Now handling the WM_DROPFILE event


git-svn-id: svn://10.0.0.236/trunk@23408 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:48:58 +00:00
cata%netscape.com
9d06235a51 "extern" declaration for global vars fixed.
git-svn-id: svn://10.0.0.236/trunk@23407 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:48:10 +00:00
rods%netscape.com
d6db2acd54 Added method EnableFileDrop (temporary for D&D work)
git-svn-id: svn://10.0.0.236/trunk@23406 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:47:47 +00:00
rods%netscape.com
26dce0d4a2 Added Uuid.lib and OLE32.lib for drag & drop
git-svn-id: svn://10.0.0.236/trunk@23405 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:46:24 +00:00
rods%netscape.com
f7a274adef Added shell32.lib
git-svn-id: svn://10.0.0.236/trunk@23404 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:44:21 +00:00
rods%netscape.com
3f32fab8a0 Added nsDropTarget
git-svn-id: svn://10.0.0.236/trunk@23403 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:39:15 +00:00
rods%netscape.com
2d3986d90c initial checkin
git-svn-id: svn://10.0.0.236/trunk@23402 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:38:37 +00:00
mscott%netscape.com
adb3cd8520 Fix runtime breakage caused by changing nsFilePath to nsFileSpec.
git-svn-id: svn://10.0.0.236/trunk@23401 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:17:44 +00:00
cmanske%netscape.com
fc43b4f0d4 2nd try to get it right in get editor factory method
git-svn-id: svn://10.0.0.236/trunk@23400 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:06:16 +00:00
dougt%netscape.com
209f30f426 ack.
git-svn-id: svn://10.0.0.236/trunk@23399 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 23:06:11 +00:00
cmanske%netscape.com
70947d83ca Fixed editor registration and startup problems
git-svn-id: svn://10.0.0.236/trunk@23398 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:52:24 +00:00
cata%netscape.com
05e4d00784 Docs added.
git-svn-id: svn://10.0.0.236/trunk@23397 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:41:09 +00:00
dougt%netscape.com
eb1175b875 Added VR_ calls to the export list.
git-svn-id: svn://10.0.0.236/trunk@23396 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:39:09 +00:00
pinkerton%netscape.com
be80881964 fix minor goof in xptoolkit sample menu
git-svn-id: svn://10.0.0.236/trunk@23395 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:39:02 +00:00
putterman%netscape.com
7be07c5b29 use correct mailbox path.
git-svn-id: svn://10.0.0.236/trunk@23394 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:38:40 +00:00
putterman%netscape.com
921e359dbe use nsCRT string functions.
git-svn-id: svn://10.0.0.236/trunk@23393 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:38:22 +00:00
putterman%netscape.com
a8beb67c48 Added folder listener so we can run the mailbox parsing url.
git-svn-id: svn://10.0.0.236/trunk@23392 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:37:55 +00:00
putterman%netscape.com
623a8f0bf2 Added xplib.lib and added folderListener
git-svn-id: svn://10.0.0.236/trunk@23391 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:37:06 +00:00
rhp%netscape.com
d2857b91de Changes for autoregistration as well as the new stream converter
interface.


git-svn-id: svn://10.0.0.236/trunk@23390 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:37:03 +00:00
putterman%netscape.com
5c24751987 implement SetMessageKey
git-svn-id: svn://10.0.0.236/trunk@23389 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:36:24 +00:00
putterman%netscape.com
abae3a3095 OnAnnouncerGoingAway is abstract.
git-svn-id: svn://10.0.0.236/trunk@23388 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:35:57 +00:00
troy%netscape.com
aa06c3716c Some more table pagination improvements
git-svn-id: svn://10.0.0.236/trunk@23387 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:34:51 +00:00
putterman%netscape.com
2a470cbde5 Added folder listener.
git-svn-id: svn://10.0.0.236/trunk@23386 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:34:29 +00:00
mcmullen%netscape.com
2b21b06cb7 Turning on dougt's special system directory stuff, and adding it to the Macintosh build. Fixed spurious leading slash on getting leaf name (win and unix). Adding dougt's equality test operator, too. Adding dougt's test code for all the above.
git-svn-id: svn://10.0.0.236/trunk@23385 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:33:36 +00:00
akkana%netscape.com
d966254b07 fixing merge problem of windows not looking for components in components directory - dp & akkana
git-svn-id: svn://10.0.0.236/trunk@23384 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:18:32 +00:00
pinkerton%netscape.com
c4117f80e5 make the personal toolbar buttons more mozilla centric, even if everything else is blatant NSCP drug money.
git-svn-id: svn://10.0.0.236/trunk@23383 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:13:36 +00:00
michaelp%netscape.com
9a8800e96b added background image.
made one table relatively positioned.
added opacity to transparent scrolled table.


git-svn-id: svn://10.0.0.236/trunk@23382 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:12:20 +00:00
michaelp%netscape.com
81f9258975 added nsIClipView.h
added support for getting/setting scroll properties in scrollable view so
that the app can control whether scrolling should be accomplished via
blitting or painting.
more work in progress for the new compositor.


git-svn-id: svn://10.0.0.236/trunk@23381 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:10:31 +00:00
michaelp%netscape.com
cd37a865bf added blender method that takes rendering contexts.
added LockDrawingSurface() and UnlockDrawingSurface() to rendering
context.
fixed state maintenance errors in rendering context win.
added IsReleaseDCDestructive() to drawingsurfacewin.


git-svn-id: svn://10.0.0.236/trunk@23380 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:07:06 +00:00
pinkerton%netscape.com
66fec9010c added xptoolkit tree test 1 to menus
git-svn-id: svn://10.0.0.236/trunk@23379 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:06:38 +00:00
rjc%netscape.com
35eea039ba Comment out PR_ASSERT() due to assert/unassert now actually being called.
git-svn-id: svn://10.0.0.236/trunk@23378 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:06:29 +00:00
pinkerton%netscape.com
cd2e93001b add spiffy header
git-svn-id: svn://10.0.0.236/trunk@23377 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:03:38 +00:00
pinkerton%netscape.com
fbb00b246c Add case for xptoolkit tree demo and fix missing break statement at end of toolbar demo case that would always cause JS window to appear. doh!
git-svn-id: svn://10.0.0.236/trunk@23376 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:03:18 +00:00
pinkerton%netscape.com
67297e8d73 add define for xptoolkit tree demo
git-svn-id: svn://10.0.0.236/trunk@23375 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:02:25 +00:00
pinkerton%netscape.com
d475b76dfa add new tree sample
git-svn-id: svn://10.0.0.236/trunk@23374 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 22:01:28 +00:00
hyatt%netscape.com
47a81994c3 Fixing a bug with selection in the tree view.
git-svn-id: svn://10.0.0.236/trunk@23373 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:58:06 +00:00
slamm%netscape.com
e6258c5d6d -MD depend: Putting objects on PHONY target didn't work. Use 'FORCE' dependency instead.
git-svn-id: svn://10.0.0.236/trunk@23372 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:56:44 +00:00
pinkerton%netscape.com
7dcd005c44 export the first tree test xul/css files
git-svn-id: svn://10.0.0.236/trunk@23371 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:55:22 +00:00
pinkerton%netscape.com
54b3b30385 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23370 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:53:01 +00:00
shaver%netscape.com
79e4108e56 #include "nsID.idl" to get the nsID/nsIID/nsCID defines in other IDL, not just C++
git-svn-id: svn://10.0.0.236/trunk@23369 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:50:55 +00:00
putterman%netscape.com
e6ceda4543 Added selection color. Removed Local Mail from thread pane.
git-svn-id: svn://10.0.0.236/trunk@23368 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:49:35 +00:00
dp%netscape.com
4cfc093823 registry version to 0.40 for component manager change
git-svn-id: svn://10.0.0.236/trunk@23366 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:31:33 +00:00
slamm%netscape.com
419c65d22c Clean-up some output. Add link for 'Show next X hours' instead of 'Show more checkin history'. Skip dates that are in the future.
git-svn-id: svn://10.0.0.236/trunk@23365 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:30:02 +00:00
mscott%netscape.com
4024e89953 Fix crash when displaying thread pane. This fix is really scottip's.
git-svn-id: svn://10.0.0.236/trunk@23364 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:28:48 +00:00
ramiro%netscape.com
2c2e1e8b02 Fix windows bustage. Why doesnt this file build on other platforms ?
git-svn-id: svn://10.0.0.236/trunk@23363 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:22:03 +00:00
dougt%netscape.com
d22687b856 Stripping additional access paths.
git-svn-id: svn://10.0.0.236/trunk@23362 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 21:03:39 +00:00
despotdaemon%netscape.com
4d5cb73c21 Pseudo-automatic update of changes made by dmose@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@23361 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 20:59:53 +00:00
dougt%netscape.com
da242762c8 remove libutil references.
git-svn-id: svn://10.0.0.236/trunk@23360 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 20:58:29 +00:00
terry%netscape.com
4796c85fe7 Use new lxr links.
git-svn-id: svn://10.0.0.236/trunk@23359 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 20:57:24 +00:00
dougt%netscape.com
06cbe39c3f First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23358 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 20:57:17 +00:00
jfrancis%netscape.com
8e01fb29f9 catching up with nsComponentManager and getting rid of cout usage
git-svn-id: svn://10.0.0.236/trunk@23357 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 20:11:27 +00:00
slamm%netscape.com
0cf3821a9e Fix typo. s/AC_DEFINES/ACDEFINES/
git-svn-id: svn://10.0.0.236/trunk@23356 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 20:11:05 +00:00
dougt%netscape.com
3d7a22afdc Fixes compare from int to ptr. ANSI C++ does not like that.
git-svn-id: svn://10.0.0.236/trunk@23355 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 20:10:20 +00:00
jfrancis%netscape.com
fc33b92b99 including header
git-svn-id: svn://10.0.0.236/trunk@23354 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 20:04:59 +00:00
shaver%netscape.com
5ea64cbf54 Handle nsID, nsIID and nsCID via a custom string-compare hack. (Ugly, but we
need 0.6.3 for a better fix, and this'll do for now.)
When sorting IDEs, sort entries with identical IIDs by namespace::name.


git-svn-id: svn://10.0.0.236/trunk@23353 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:59:42 +00:00
alecf%netscape.com
f9e44dfc1b - move messenger appcore into the base mailnews directory
- do appcore initialization during Initialize() in messenger bootstrap


git-svn-id: svn://10.0.0.236/trunk@23352 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:58:17 +00:00
slamm%netscape.com
80490954a5 I broke it. ...again. back out, back out.
git-svn-id: svn://10.0.0.236/trunk@23351 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:57:13 +00:00
alecf%netscape.com
a41ca7385c stop building the seperate messenger appcore
git-svn-id: svn://10.0.0.236/trunk@23350 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:56:53 +00:00
slamm%netscape.com
864abe3c76 Shorten the output a bit more.
git-svn-id: svn://10.0.0.236/trunk@23349 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:53:31 +00:00
alecf%netscape.com
3243351c34 export NS_InitBaseAppCoreClass so that appcores outside this DLL can initialize themselves
(Yes, I know this is a generated file, but this is how it needs to work right now, otherwise
appcores can't live outside appcores.dll)


git-svn-id: svn://10.0.0.236/trunk@23348 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:53:19 +00:00
terry%netscape.com
ce3b1dddbf Patch by Ry4an Brase <ry4an@ry4an.org> -- fix typo.
git-svn-id: svn://10.0.0.236/trunk@23347 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:52:18 +00:00
dougt%netscape.com
b22394cd3e First checkin of unix makefile.
git-svn-id: svn://10.0.0.236/trunk@23346 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:31:55 +00:00
hyatt%netscape.com
8588377965 Fixes to the broadcasters and observers. I made HTML elements work with
observes nodes, and I changed some SetAttribute calls to use the DOM
instead of the nsIContent APIs.


git-svn-id: svn://10.0.0.236/trunk@23345 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:30:41 +00:00
nhotta%netscape.com
db418a9816 Implementation of SetDocumentCharset.
git-svn-id: svn://10.0.0.236/trunk@23344 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:24:28 +00:00
jfrancis%netscape.com
772f3287c8 integrated with content iterator
git-svn-id: svn://10.0.0.236/trunk@23343 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:22:48 +00:00
jfrancis%netscape.com
fb0583ffb5 reordered link order so that cout would work
git-svn-id: svn://10.0.0.236/trunk@23342 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:22:00 +00:00
jfrancis%netscape.com
a3a451200f fixed refcounting bugs
git-svn-id: svn://10.0.0.236/trunk@23341 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:21:30 +00:00
jfrancis%netscape.com
928892f905 fixed refcounting bugs plus a little cleanup
git-svn-id: svn://10.0.0.236/trunk@23340 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:21:04 +00:00
ramiro%netscape.com
f05974cb48 Use the macro on all platforms. Thanks to pierre for helping me make sure
it doesnt break the mac.  I verified that it works on unix and windows.


git-svn-id: svn://10.0.0.236/trunk@23339 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 19:19:02 +00:00
troy%netscape.com
c954953e18 Better handles the case where the first row is complete when splitting
the row group


git-svn-id: svn://10.0.0.236/trunk@23338 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 15:35:43 +00:00
troy%netscape.com
5f577fe103 Changed it so we get the computed width from the first-in-flow
git-svn-id: svn://10.0.0.236/trunk@23337 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 15:35:08 +00:00
terry%netscape.com
3bb49a53cf Added a disgusting hack to deal with the fact that we can occasionally get builds with wildly wrong times.
git-svn-id: svn://10.0.0.236/trunk@23336 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 15:22:09 +00:00
warren%netscape.com
2d6102e5e6 Fixed prefs code.
git-svn-id: svn://10.0.0.236/trunk@23335 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 15:06:52 +00:00
warren%netscape.com
5d0cd73d0a Include problem.
git-svn-id: svn://10.0.0.236/trunk@23334 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 14:44:24 +00:00
warren%netscape.com
68843d63a2 Re-enabled the prefs.js stuff.
git-svn-id: svn://10.0.0.236/trunk@23333 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 14:20:30 +00:00
warren%netscape.com
6769b3f0ef Implemented virtuals in cpp file to try to avoid linux pedantic error.
git-svn-id: svn://10.0.0.236/trunk@23332 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 14:09:11 +00:00
warren%netscape.com
5e1f310167 PR_ASSERT wasn't defined for the mac.
git-svn-id: svn://10.0.0.236/trunk@23331 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 14:03:56 +00:00
warren%netscape.com
015051d6b3 Fixed registration methods.
git-svn-id: svn://10.0.0.236/trunk@23330 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 13:23:36 +00:00
warren%netscape.com
8519161b55 fixed include problem
git-svn-id: svn://10.0.0.236/trunk@23329 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 13:07:15 +00:00
warren%netscape.com
b40f054bad Fixed include
git-svn-id: svn://10.0.0.236/trunk@23328 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 12:53:21 +00:00
warren%netscape.com
0f71af4fee Fixed nsService problems.
git-svn-id: svn://10.0.0.236/trunk@23327 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 12:49:38 +00:00
warren%netscape.com
6d47974e30 Fixed nsRepository -> nsComponentManager
git-svn-id: svn://10.0.0.236/trunk@23326 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 12:43:27 +00:00
warren%netscape.com
72d0dbfbc8 Fixed return.
git-svn-id: svn://10.0.0.236/trunk@23325 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 12:36:13 +00:00
warren%netscape.com
9309a7b8fb Fixed include problem.
git-svn-id: svn://10.0.0.236/trunk@23324 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 12:34:01 +00:00
warren%netscape.com
d62d4a9f0b Removed nsService stuff.
git-svn-id: svn://10.0.0.236/trunk@23323 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 12:29:08 +00:00
warren%netscape.com
0a5af143e2 Fixed include problem.
git-svn-id: svn://10.0.0.236/trunk@23322 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 12:16:34 +00:00
warren%netscape.com
b36740faf3 Backed out nsService changes.
git-svn-id: svn://10.0.0.236/trunk@23321 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 11:53:02 +00:00
warren%netscape.com
e082c74dc0 Backed out the nsService template stuff.
git-svn-id: svn://10.0.0.236/trunk@23320 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 11:49:41 +00:00
warren%netscape.com
345056e941 Fixed variable name problem.
git-svn-id: svn://10.0.0.236/trunk@23319 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 11:42:48 +00:00
warren%netscape.com
f8ef3e9349 Removed nsService template.
git-svn-id: svn://10.0.0.236/trunk@23318 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 11:12:52 +00:00
warren%netscape.com
3a95261810 Commented out template because linux isn't happy with it.
git-svn-id: svn://10.0.0.236/trunk@23317 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 11:12:23 +00:00
warren%netscape.com
7392983e7b Fixed exports for nsRepository -> nsComponentManager
git-svn-id: svn://10.0.0.236/trunk@23316 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 10:51:12 +00:00
warren%netscape.com
c6559126d6 Fixed path separator.
git-svn-id: svn://10.0.0.236/trunk@23315 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 10:20:01 +00:00
warren%netscape.com
47efd8d451 Trying a hack to see if I can make linux happy.
git-svn-id: svn://10.0.0.236/trunk@23314 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 10:15:54 +00:00
warren%netscape.com
291c802a13 Workaround for sun386i breakage.
git-svn-id: svn://10.0.0.236/trunk@23313 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 10:07:02 +00:00
warren%netscape.com
de7b75d07f nsRepository -> nsIComponentManager changes. nsIMsgDatabase interface. Message enumerators. Misc.
git-svn-id: svn://10.0.0.236/trunk@23303 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 09:52:30 +00:00
mcafee%netscape.com
529189e540 Protect against a copy of zero characters (zero-length buffer)
git-svn-id: svn://10.0.0.236/trunk@23302 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 09:49:32 +00:00
warren%netscape.com
055216c4b1 Added nsComponentManager.cpp
git-svn-id: svn://10.0.0.236/trunk@23301 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 09:47:12 +00:00
warren%netscape.com
0b33372d99 nsRepository -> nsIComponentManager changes.
git-svn-id: svn://10.0.0.236/trunk@23300 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 09:44:27 +00:00
shaver%netscape.com
e294264814 turn off more debugging noise and prepare for 0.6.2's forward handling
git-svn-id: svn://10.0.0.236/trunk@23298 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 08:23:00 +00:00
waterson%netscape.com
95a9f4d99f Fixed GetElementsByAttribute(): use the DOM APIs to be consistent with namespaces.
git-svn-id: svn://10.0.0.236/trunk@23297 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 08:10:50 +00:00
waterson%netscape.com
52da7b7d32 Made widget observer observe the composite data source.
git-svn-id: svn://10.0.0.236/trunk@23296 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 08:05:26 +00:00
nisheeth%netscape.com
a9b7621b74 - Quoted all attributes.
- Fixed casing on the end BookSet tag.  (The expat parser enforces case-sensitivity in XML)


git-svn-id: svn://10.0.0.236/trunk@23295 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 07:44:47 +00:00
nisheeth%netscape.com
bbb4dffad0 - We weren't adding the tag text to the token created for the end tag. Fixed.
- Tokens for CDATA sections were not being created.  Fixed.
- The length of the parse buffer is passed into ParseXMLBuffer() because it is available from the scanner.  We were doing a strlen() to determine the length which was inefficient.


git-svn-id: svn://10.0.0.236/trunk@23294 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 07:39:04 +00:00
pierre%netscape.com
1c05e162b4 added menu command VIEWER_PRINT_SETUP
git-svn-id: svn://10.0.0.236/trunk@23293 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 06:39:50 +00:00
mcafee%netscape.com
ebf32a0f5d Adding Edit|{Cut,Copy,Paste} to menubar.
git-svn-id: svn://10.0.0.236/trunk@23292 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 06:04:38 +00:00
pierre%netscape.com
7be0666585 don't dispatch mouseMoved events when Raptor is in the background
git-svn-id: svn://10.0.0.236/trunk@23291 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:46:01 +00:00
pierre%netscape.com
dd5b567297 dispatch suspend/resume events to Raptor
git-svn-id: svn://10.0.0.236/trunk@23290 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:44:47 +00:00
troy%netscape.com
39e58ce72d Overflow code and pushing code now take header/footer frames into
account


git-svn-id: svn://10.0.0.236/trunk@23289 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:29:37 +00:00
troy%netscape.com
d3a15268a2 Better handling of NS_FRAME_NOT_COMPLETE for incremental reflow
git-svn-id: svn://10.0.0.236/trunk@23288 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:28:44 +00:00
wtc%netscape.com
35f5c7deeb Another update from the internal CVS repository /m/src.
git-svn-id: svn://10.0.0.236/trunk@23284 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:12:06 +00:00
troy%netscape.com
144854728c Made sure NS_FRAME_COMPLETE is always returned. This fixes an incremental
reflow problem


git-svn-id: svn://10.0.0.236/trunk@23283 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:11:14 +00:00
terry%netscape.com
3367b1fec2 Added a disgusting hack to deal with the fact that we can occasionally get builds with wildly wrong times.
git-svn-id: svn://10.0.0.236/trunk@23282 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:07:50 +00:00
troy%netscape.com
d6693ebf08 Fixed it so that for incremental reflow commands the correct value is
passed for the available height


git-svn-id: svn://10.0.0.236/trunk@23281 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:01:59 +00:00
pierre%netscape.com
ea645514fc fixed crash on delete (the OS deleted the menu a second time)
git-svn-id: svn://10.0.0.236/trunk@23280 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 05:01:45 +00:00
despotdaemon%netscape.com
2ca1ed560a Pseudo-automatic update of changes made by nisheeth@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@23279 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 04:47:32 +00:00
pierre%netscape.com
c8d2b0a41d added menu commands VIEWER_GFX_WIDGET_MODE and VIEWER_NATIVE_WIDGET_MODE
git-svn-id: svn://10.0.0.236/trunk@23278 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 04:39:50 +00:00
mcafee%netscape.com
afe16f3c08 Adding install target for purify binaries
git-svn-id: svn://10.0.0.236/trunk@23277 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 04:21:51 +00:00
pierre%netscape.com
1fde015542 fixed display in SetSelectedIndices()
git-svn-id: svn://10.0.0.236/trunk@23276 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 04:11:25 +00:00
pierre%netscape.com
92ee6edde8 fixed index off by 1 in GetSelectedIndex()
git-svn-id: svn://10.0.0.236/trunk@23275 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 04:10:33 +00:00
mccabe%netscape.com
783ac85782 Chop xptinfo from the list of sub-Makes built by libxpt during coding
thrash.


git-svn-id: svn://10.0.0.236/trunk@23274 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 04:10:30 +00:00
waterson%netscape.com
f856b93c1d Land Guha's history stuff, including some fixes for references in the file system data source, and modifications for literals: there's now nsIntLiteral and nsDateLiteral.
git-svn-id: svn://10.0.0.236/trunk@23273 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 04:01:56 +00:00
mscott%netscape.com
cfbb447bcb Sending a message no longer requires a host and from field because we can now extract that information from the current identity.
git-svn-id: svn://10.0.0.236/trunk@23269 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 03:06:59 +00:00
pierre%netscape.com
f2f9218b22 Fixed #2253 "Copy and Paste in text widget"
Fixed double-click


git-svn-id: svn://10.0.0.236/trunk@23268 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 02:58:14 +00:00
alecf%netscape.com
49198778c3 use Messenger's CID rather than ProgID because I can't seem to create objects
by ProgID (looks like ProgID->CID mapping is broken)


git-svn-id: svn://10.0.0.236/trunk@23267 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 02:51:25 +00:00
coop%netscape.com
093d2cdff1 NOT YET PART OF SEAMONKEY:
* initial pass at handling the update of interface indices.


git-svn-id: svn://10.0.0.236/trunk@23266 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 02:51:22 +00:00
brendan%netscape.com
c3911df063 Must use defined XP_UNIX, not XP_UNIX, as #elif condition.
git-svn-id: svn://10.0.0.236/trunk@23265 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 02:46:23 +00:00
terry%netscape.com
a5535f79dd Added params to control how priorities are set in a new bug. You can
now choose whether to let submitters of new bugs choose a priority, or whether
they should just accept the default priority (which is now no longer hardcoded
to "P2", but is instead a param.)  The default value of the params will cause
the same behavior as before.


git-svn-id: svn://10.0.0.236/trunk@23264 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 02:33:58 +00:00
dveditz%netscape.com
7680dbd368 initial libjar files, NOT PART OF BUILD
git-svn-id: svn://10.0.0.236/trunk@23259 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 02:13:56 +00:00
ducarroz%netscape.com
280626b090 make the file conform to the new norm
git-svn-id: svn://10.0.0.236/trunk@23258 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 02:05:29 +00:00
ducarroz%netscape.com
a756229510 add definition for MSG_CommandType
git-svn-id: svn://10.0.0.236/trunk@23257 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 02:01:16 +00:00
ftang%netscape.com
0fed7fd34e add katakana, hiragana, katakana-iroha, hiragana-iroha, lower-greek
git-svn-id: svn://10.0.0.236/trunk@23256 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:56:02 +00:00
rjc%netscape.com
bf378b4e8e Add selection and column sortActive/sortDirection observation support. (Thanks, David!)
git-svn-id: svn://10.0.0.236/trunk@23255 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:54:46 +00:00
pierre%netscape.com
60b773385b Register CharsetAlias. Fixed by ftang on my machine.
git-svn-id: svn://10.0.0.236/trunk@23254 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:50:03 +00:00
briano%netscape.com
8bb9a84b60 Automated update
git-svn-id: svn://10.0.0.236/trunk@23253 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:45:41 +00:00
mscott%netscape.com
c57452593c Add ability to generate a mail session to this factory.
git-svn-id: svn://10.0.0.236/trunk@23252 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:39:05 +00:00
mscott%netscape.com
3a4bc49ec9 Build nsMsgMailSession and nsMsgIdentity.
git-svn-id: svn://10.0.0.236/trunk@23251 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:37:41 +00:00
mscott%netscape.com
2221feaddb Shell for a msg mail session. Folks will add to this as they need to.
git-svn-id: svn://10.0.0.236/trunk@23250 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:36:17 +00:00
pinkerton%netscape.com
f5f59adcee Add debug code to point out a bug #3505 with display:none and frames. Fix bug #3451 with grippies not working when toolbars not at top of window. Not creating atoms every time we expand/collapse toolbars.
git-svn-id: svn://10.0.0.236/trunk@23249 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:36:11 +00:00
mscott%netscape.com
e4bfe1fdb5 First pass implementation of a mail identity. Right now we just read out these values from prefs.js in the current working directory. This is a dogfood implementation and will change drastically when we really do implement multiple identities.
git-svn-id: svn://10.0.0.236/trunk@23248 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:35:44 +00:00
mscott%netscape.com
73a0e8c5f4 Export nsIMsgIdentity.h and nsIMsgMailSession.h
git-svn-id: svn://10.0.0.236/trunk@23247 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:33:36 +00:00
mscott%netscape.com
9ebeb941ee A mail session interface. Right now it is empty except for the current identity. As people need to add thinks to the mail session, I expect this to grow. Oh it is a singleton object and you should go through the service manager to obtain it.
git-svn-id: svn://10.0.0.236/trunk@23246 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:33:08 +00:00
mscott%netscape.com
ca27daab72 A first pass at a generic mail identity interface. Right now, I'm using this to organize a lot of mail server & password preferences for dogfood.
git-svn-id: svn://10.0.0.236/trunk@23245 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:32:16 +00:00
slamm%netscape.com
6c6f03f34b Have -MD dependencies cope will missing headerfiles.
git-svn-id: svn://10.0.0.236/trunk@23244 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:31:26 +00:00
slamm%netscape.com
cf94a899f1 Give error if building in objdir and have previously built in srcdir. Move '-Wall' and '-include' to GNU-only section (silly to test for GNU-only features). Change '-MMD' to '-MD' to include standard headers. Clean '-O' from CFLAGS/CXXFLAGS if MOZ_DEBUG is set.
git-svn-id: svn://10.0.0.236/trunk@23243 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:30:26 +00:00
slamm%netscape.com
fe1818cd07 Move AC_INCLUDE_OR_DEFINES into OS_CFLAGS/OS_CXXFLAGS.
git-svn-id: svn://10.0.0.236/trunk@23242 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:30:00 +00:00
slamm%netscape.com
f9468ca12f Move '-O' stripping into configure. Move compile-line defines into configure.
git-svn-id: svn://10.0.0.236/trunk@23241 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:29:57 +00:00
slamm%netscape.com
6012bdaf3a Script converts .mozconfig.sh into a url to prefill configurator web form. Will be used by client.mk
git-svn-id: svn://10.0.0.236/trunk@23240 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:29:53 +00:00
slamm%netscape.com
824d688eb0 Script to clean out all 'configure' generated files.
git-svn-id: svn://10.0.0.236/trunk@23239 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:29:50 +00:00
briano%netscape.com
c8edb6c46b Fixed the permission problem with nsinstall'd binary files, and added rules to make
sure shared libraries also get copied into $(DIST)/lib (where they're *supposed* to go).


git-svn-id: svn://10.0.0.236/trunk@23238 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:20:03 +00:00
cmanske%netscape.com
27e7a5fcf3 Added registration of editor factory classes to NS_SetupRegistry
git-svn-id: svn://10.0.0.236/trunk@23237 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:17:21 +00:00
chuang%netscape.com
a912bbcc6a Move throbber to the right, add MsgHome() function.
git-svn-id: svn://10.0.0.236/trunk@23236 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:15:00 +00:00
slamm%netscape.com
839d83ac54 Quiet mac warnings.
git-svn-id: svn://10.0.0.236/trunk@23235 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:10:59 +00:00
slamm%netscape.com
d3ff196119 Add source tree navigation tool.
git-svn-id: svn://10.0.0.236/trunk@23234 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:07:00 +00:00
despotdaemon%netscape.com
03cb24e8aa Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@23233 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 01:06:41 +00:00
rpotts%netscape.com
7936c5d6dc fix for bug #3507. Also replaced raw comparse of nsresult == NS_OK with NS_FAILED(...) or NS_SUCCEEDED(...) macros...
git-svn-id: svn://10.0.0.236/trunk@23232 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:54:07 +00:00
dougt%netscape.com
2eb050c4c0 Removed InstallFolder Object - just using nsStrings now.
Now creating tempfiles for ZIP calls
hooked up to nsSpecialSystemDirectory
cleaned up Install() api


git-svn-id: svn://10.0.0.236/trunk@23231 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:50:23 +00:00
briano%netscape.com
aa7c81207d Fixed my stupid mistake (theoretically) and increased the test timeout to 45 seconds.
git-svn-id: svn://10.0.0.236/trunk@23230 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:44:04 +00:00
vidur%netscape.com
feb7c9a586 Table of contents example
git-svn-id: svn://10.0.0.236/trunk@23229 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:36:54 +00:00
briano%netscape.com
35cdf04fde Automated update
git-svn-id: svn://10.0.0.236/trunk@23228 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:30:47 +00:00
akkana%netscape.com
905d55aca8 Changes to fix the Irix N32/egcs build; thanks to Jason Heirtzler <jasonh@cthulhu.engr.sgi.com>
git-svn-id: svn://10.0.0.236/trunk@23227 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:24:17 +00:00
briano%netscape.com
9f121d0ce7 More fixes, and I added a silly hack to show what compiler is being used.
git-svn-id: svn://10.0.0.236/trunk@23226 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:15:46 +00:00
cmanske%netscape.com
e5c4ce24e9 Removed unused code in editor appcore and cleaned up factory registration
git-svn-id: svn://10.0.0.236/trunk@23225 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:05:27 +00:00
ebina%netscape.com
4ee08fa4f8 Changes to make the Mac not complain so much.
git-svn-id: svn://10.0.0.236/trunk@23224 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-09 00:04:34 +00:00
mscott%netscape.com
3087e391db Fix build breakage caused by ebina when he changed nsINetPluginInstance. Looks like nsINetPluginInstance::Initialize() now takes two arguments.
git-svn-id: svn://10.0.0.236/trunk@23221 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 23:44:22 +00:00
cmanske%netscape.com
a5258195f0 Removed registration code now done by NSRegisterSelf for editor classes
git-svn-id: svn://10.0.0.236/trunk@23218 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:52:03 +00:00
cmanske%netscape.com
c89001dcbb Removed registration code no done by NSRegisterSelf for editor classes
git-svn-id: svn://10.0.0.236/trunk@23217 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:51:58 +00:00
cmanske%netscape.com
dea2088bcb Fixed editor classes to do autoregistration correctly and moved target directory to bin/components
git-svn-id: svn://10.0.0.236/trunk@23216 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:46:33 +00:00
akkana%netscape.com
1bc5a98e62 Hook up a debug implementation of paste
git-svn-id: svn://10.0.0.236/trunk@23215 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:45:56 +00:00
pinkerton%netscape.com
ff75f4321a adding debug printf to see when toolbar frames are being deleted. I don't think they are when display is set to none.
git-svn-id: svn://10.0.0.236/trunk@23214 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:44:44 +00:00
pinkerton%netscape.com
5941299154 fix attribute selector for grippies to actually trigger when grippies clicked on.
git-svn-id: svn://10.0.0.236/trunk@23213 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:44:06 +00:00
pinkerton%netscape.com
c543412c2d fix bug where if I didn't check if the first child frame was null during reflow.
git-svn-id: svn://10.0.0.236/trunk@23212 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:43:48 +00:00
val4%cornell.edu
65f58bdd75 Some changes here and there. Added noted about PerlConnect.pm. Added update history.
git-svn-id: svn://10.0.0.236/trunk@23211 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:43:17 +00:00
cyeh%netscape.com
c746e96df5 pdbfiles have a ".pdb" at the end.
git-svn-id: svn://10.0.0.236/trunk@23210 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:40:17 +00:00
cyeh%netscape.com
5907555ee7 change MOZ_DEBUGOPT config to not generate PDB files.
git-svn-id: svn://10.0.0.236/trunk@23209 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:38:33 +00:00
dp%netscape.com
722542857b adding new exported NR_*Raw() symbols
git-svn-id: svn://10.0.0.236/trunk@23208 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:10:18 +00:00
hyatt%netscape.com
909350643f Putting the extra items into the bookmarks menu.
git-svn-id: svn://10.0.0.236/trunk@23207 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 22:09:34 +00:00
ebina%netscape.com
40e1602a4b Add the stream name (URL string) to the nsINetPluginInstance
interface in the Initialize method.


git-svn-id: svn://10.0.0.236/trunk@23206 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 21:57:35 +00:00
alecf%netscape.com
abafe271de patches from cmanske@netscape.com - use NS_IMETHODIMP* macros instead of declaring nsrefcnt/etc directly
git-svn-id: svn://10.0.0.236/trunk@23205 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 21:34:16 +00:00
shaver%netscape.com
4881717cd5 ignore generated files
git-svn-id: svn://10.0.0.236/trunk@23204 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 21:27:03 +00:00
shaver%netscape.com
30f497ae66 Turn off debugging noise for myself.
Parse IIDs, and handle the unspecified case (= 0).
Sort IDE block like a good boy (all hail qsort).
Follow typedefs to make the right thing happen.
Hide [notxpcom] methods, and don't munge their signatures with _retval, etc.


git-svn-id: svn://10.0.0.236/trunk@23203 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 21:22:29 +00:00
coop%netscape.com
3371ff5105 NOT YET PART OF SEAMONKEY:
* linker now sorts based on IIDs
* xpt_dump no longer complains about md->result if it is of the correct retval type


git-svn-id: svn://10.0.0.236/trunk@23202 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 21:13:58 +00:00
shaver%netscape.com
26b1439250 display method flags, handle bogus indices
git-svn-id: svn://10.0.0.236/trunk@23201 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 21:11:08 +00:00
tague%netscape.com
b53730d1aa Fixed build bustage (lost const)
git-svn-id: svn://10.0.0.236/trunk@23198 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 21:02:35 +00:00
terry%netscape.com
6d26142980 Changed some QA contacts.
git-svn-id: svn://10.0.0.236/trunk@23197 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 20:47:51 +00:00
dp%netscape.com
b73886f588 Using Raw registry interface so that component urls and filename can be stored without transformation of / and =
git-svn-id: svn://10.0.0.236/trunk@23196 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 20:40:32 +00:00
dp%netscape.com
52090316db Adding Raw interface that wont interpret / in keynames. Plus removed = being a invalid char for keys.
git-svn-id: svn://10.0.0.236/trunk@23195 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 20:35:54 +00:00
shaver%netscape.com
b03b382f3e Make params include the name of the interface referenced.
git-svn-id: svn://10.0.0.236/trunk@23194 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 20:33:35 +00:00
alecf%netscape.com
6083b1d43d fix g++ -pedantic bustage
git-svn-id: svn://10.0.0.236/trunk@23193 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 20:18:53 +00:00
mscott%netscape.com
18ee545010 Call close on the mail database instead of release.
git-svn-id: svn://10.0.0.236/trunk@23192 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 20:10:14 +00:00
mscott%netscape.com
d3b260a630 Call close on the mail database instead of release....
git-svn-id: svn://10.0.0.236/trunk@23191 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 20:09:42 +00:00
ftang%netscape.com
768862e631 reviewed by rickg. Pick up meta tag and change converter
git-svn-id: svn://10.0.0.236/trunk@23190 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 20:00:23 +00:00
mscott%netscape.com
566f776df0 When setting the byte range based on the message size subtract one byte (this gives it the proper byte range in the file...).
git-svn-id: svn://10.0.0.236/trunk@23189 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:53:10 +00:00
bienvenu%netscape.com
7172f6d57d fix db cache lookup bug
git-svn-id: svn://10.0.0.236/trunk@23188 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:50:24 +00:00
coop%netscape.com
60b95e8294 NOT YET PART OF SEAMONKEY:
* changing references to interfaces (within structs) to be indices rather than pointers
* updated xpt_dump and xpt_link code to reflect above change


git-svn-id: svn://10.0.0.236/trunk@23187 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:47:09 +00:00
kipp%netscape.com
641a7a7202 Implement GetFrameName
git-svn-id: svn://10.0.0.236/trunk@23186 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:26:45 +00:00
kipp%netscape.com
0750860714 setup more skid marks (disabled)
git-svn-id: svn://10.0.0.236/trunk@23185 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:26:30 +00:00
kipp%netscape.com
b37f5e28cc Added a skid mark (disabled)
git-svn-id: svn://10.0.0.236/trunk@23184 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:26:09 +00:00
kipp%netscape.com
00cb1a62f1 added some nasty logging messages for frames that don't set max-element-size; added more vertical alignment noise
git-svn-id: svn://10.0.0.236/trunk@23183 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:25:55 +00:00
kipp%netscape.com
0ed15663ec added some nasty logging messages for frames that don't set max-element-size
git-svn-id: svn://10.0.0.236/trunk@23182 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:25:18 +00:00
kipp%netscape.com
f8ee65e4d3 Copy out computed combined area even when dealing with an zero height block; added some nasty logging messages for frames that don't set max-element-size
git-svn-id: svn://10.0.0.236/trunk@23181 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:25:03 +00:00
kipp%netscape.com
566d18356c Compute combined-area more sanely; handle another nasty top margin bug (1910)
git-svn-id: svn://10.0.0.236/trunk@23180 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:24:07 +00:00
kipp%netscape.com
c60c176227 Removed a duplicated method; moved by debug asserts into a central spot
git-svn-id: svn://10.0.0.236/trunk@23179 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:22:55 +00:00
kipp%netscape.com
0547776b90 Fixed bug #2052 - don't adjust the height when its computed
git-svn-id: svn://10.0.0.236/trunk@23178 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:22:16 +00:00
kipp%netscape.com
3aaf74d39a Fixed a build issue
git-svn-id: svn://10.0.0.236/trunk@23177 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 19:21:44 +00:00
ramiro%netscape.com
ea36063fa0 Cannot forward declare a class used with an nsCOMPtr.
see: http://www.mozilla.org/projects/xpcom/nsCOMPtr.html


git-svn-id: svn://10.0.0.236/trunk@23176 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 18:57:21 +00:00
nisheeth%netscape.com
a81177003d Checking in the first stab at error propagation from the expat parser to the content sink. The flow of control is as follows. The tokenizer creates an error token (CErrorToken) when an error occurs in expat and pushes it onto the token dequeue. The DTD forwards the contents of the token to the content sink, which creates content objects to show the error.
git-svn-id: svn://10.0.0.236/trunk@23175 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 17:42:54 +00:00
briano%netscape.com
4b4a663c7f Automated update
git-svn-id: svn://10.0.0.236/trunk@23174 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 16:00:39 +00:00
ramiro%netscape.com
71f4219ea9 Fix unix builds.
git-svn-id: svn://10.0.0.236/trunk@23173 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 15:50:50 +00:00
briano%netscape.com
397f7f3521 Automated update
git-svn-id: svn://10.0.0.236/trunk@23172 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 15:15:41 +00:00
ramiro%netscape.com
2dd0c5cdf9 Latest AIX fixes. (waqar@netscape.com).
When doing the multiple inheritance thing, explicitly give the publicness
for each superclass.


git-svn-id: svn://10.0.0.236/trunk@23171 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 15:13:54 +00:00
ramiro%netscape.com
970dc7c4fc Allow for lock_SunOS.s to build properly. Fix the build system to
properly set all the ac magic needed to properly asm files.
Currently this is only an issue on Solaris, when building with the native
sun compiler.


git-svn-id: svn://10.0.0.236/trunk@23170 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 15:01:13 +00:00
edwin%woudt.nl
bc8fd40d25 A new throbber
git-svn-id: svn://10.0.0.236/trunk@23169 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 14:45:52 +00:00
ramiro%netscape.com
01f08478fc Add Templates.DB dir to GARBAGE so that the output of the Solaris CC template
code generator can be clobber.  Otherwise, dependancies and clobbering dont
work.


git-svn-id: svn://10.0.0.236/trunk@23168 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 11:44:25 +00:00
ramiro%netscape.com
bdfb92b7b9 Memory leak.
delete[] memory returned by nsString::ToNewCString.


git-svn-id: svn://10.0.0.236/trunk@23167 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 11:38:59 +00:00
ramiro%netscape.com
e1c07957a0 Fix win32, mac breakage.
git-svn-id: svn://10.0.0.236/trunk@23166 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 11:04:49 +00:00
ramiro%netscape.com
240e66fab6 Templates in nsXPComFactory exorcism. Part I.
Replaced the template code with a NS_DEF_FACTORY.
This is temporary.  As soon as I can verify this works on windows and
mac, ill remove the old code.


git-svn-id: svn://10.0.0.236/trunk@23165 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 09:44:16 +00:00
waterson%netscape.com
c276775547 Bug #3465. Atomize literals as well as resources.
git-svn-id: svn://10.0.0.236/trunk@23164 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 08:28:46 +00:00
waterson%netscape.com
324b35b91b Added some debugging code while tracking down bug #3465.
git-svn-id: svn://10.0.0.236/trunk@23163 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 08:27:53 +00:00
pierre%netscape.com
24f2df4eea implemented nsListbox
git-svn-id: svn://10.0.0.236/trunk@23158 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 04:50:20 +00:00
pierre%netscape.com
0118215e13 Fixed several things. The popup now actually displays and works.
git-svn-id: svn://10.0.0.236/trunk@23157 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 04:48:55 +00:00
pierre%netscape.com
089d8feb9e small change to make Move and Resize more efficient
git-svn-id: svn://10.0.0.236/trunk@23156 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 04:47:17 +00:00
pierre%netscape.com
ef19f8a40b small change to make it behave like nsCheckboxControlFrame when the WidgetRenderingMode is not initialized.
git-svn-id: svn://10.0.0.236/trunk@23155 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 04:46:12 +00:00
shaver%netscape.com
8fe29cabbc fix remnant of 32-bit interface references
git-svn-id: svn://10.0.0.236/trunk@23154 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 03:56:14 +00:00
danm%netscape.com
739872bb0b adding ShowDialog()
git-svn-id: svn://10.0.0.236/trunk@23153 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 03:01:17 +00:00
mscott%netscape.com
b7422fa464 Add ability to display a message given just a message number. We take this number (which is not a key or ID) and get the array of message keys from the db. We then extract the key corresponding to the number passed in. This interface function is used primarily to make debuggin easier where we don't have a message key or message ID lying around...
git-svn-id: svn://10.0.0.236/trunk@23152 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 02:12:50 +00:00
bienvenu%netscape.com
dc5a62dacf make sure db name is strdupped before caching
git-svn-id: svn://10.0.0.236/trunk@23151 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 02:11:39 +00:00
jfrancis%netscape.com
ec84311a00 adding mAnchorFrame to the ClearFrameRefs call
git-svn-id: svn://10.0.0.236/trunk@23150 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 01:22:37 +00:00
jfrancis%netscape.com
87c745f970 bug fixes + changing broken "dont_QueryInterface" additions to "do_QueryInterface"
git-svn-id: svn://10.0.0.236/trunk@23149 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 01:20:02 +00:00
mscott%netscape.com
2e5cace5e3 requires js for the prefs stuff. Link with rdf_utils.lib instead of rdf.lib.
git-svn-id: svn://10.0.0.236/trunk@23148 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 01:05:21 +00:00
mscott%netscape.com
0fb9344d6c Many many changes. (1) get rid of hard coded mailbox folder paths and rely on the the mail root folder preference being set. (2) when displaying a message, open the db, extract the array of msgKeys and ask the user which message they want to display. This number is based on the number of items in the msgKey array. Then use the user provided number as an offset into the msg key array to extract the correct message key to use. This provides us with a lot more testing flexibility instead of forcing the test to know the message key of each message he/she wanted to display. (3) remove call to NS_NewMsgParser and go through the repository instead....
git-svn-id: svn://10.0.0.236/trunk@23147 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 01:04:53 +00:00
mscott%netscape.com
e78bb00181 Remove NS_NewMsgParser. You should be going through the repository to create an instance of mailbox parser. I've already updated the nsLocalMsgFactory to be able to create instances of this object.
git-svn-id: svn://10.0.0.236/trunk@23146 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 01:00:52 +00:00
beard%netscape.com
ff96b264a9 fixed call to nsIInputStream::Read(), no longer passing 0 offset.
git-svn-id: svn://10.0.0.236/trunk@23145 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:15:40 +00:00
beard%netscape.com
0f0c2a1c13 Added InitializeLiveConnectClasses() method.
git-svn-id: svn://10.0.0.236/trunk@23144 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:14:40 +00:00
beard%netscape.com
93ebb9e8aa Added InitializeLiveConnectClasses() method. This makes the standard java packages visible to a given JSContext. Guarding against multiple initialization otherwise LiveConnect gives a warning.
git-svn-id: svn://10.0.0.236/trunk@23143 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:14:38 +00:00
beard%netscape.com
8334bbbe58 Added accessor for NS_JVMMANAGER_CID.
git-svn-id: svn://10.0.0.236/trunk@23142 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:12:00 +00:00
beard%netscape.com
83fc142853 Added InitLiveConnectClasses for DOM's use.
git-svn-id: svn://10.0.0.236/trunk@23141 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:09:05 +00:00
beard%netscape.com
9e471da20d Fixed Read/Write methods to conform to latest nsIInputStream and nsIOutputStream interfaces.
git-svn-id: svn://10.0.0.236/trunk@23140 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:07:24 +00:00
mscott%netscape.com
e743625bfb include xplib.h....
git-svn-id: svn://10.0.0.236/trunk@23139 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:01:04 +00:00
beard%netscape.com
7be9526f8f Using the service manager to access the plugin manager, because it needs to be a singleton.
git-svn-id: svn://10.0.0.236/trunk@23138 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:01:02 +00:00
mscott%netscape.com
02c61ddd40 Add mailbox parser to list of components the local msg factory can create.
git-svn-id: svn://10.0.0.236/trunk@23137 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-08 00:00:44 +00:00
beard%netscape.com
5ceecb3479 Added NS_DEFINE_STATIC_CID_ACCESSOR.
git-svn-id: svn://10.0.0.236/trunk@23136 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:56:59 +00:00
beard%netscape.com
97403304e5 fixed a crash caused by unitialized variable focusedWidget.
git-svn-id: svn://10.0.0.236/trunk@23135 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:56:22 +00:00
mscott%netscape.com
875780bfa0 Assign a CID to the mailbox parser so we can create it through the local msg factory...
git-svn-id: svn://10.0.0.236/trunk@23134 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:53:14 +00:00
beard%netscape.com
5d42f82ea4 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23133 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:32:35 +00:00
hyatt%netscape.com
1113d37be5 added files: mozilla/rdf/content/src/nsRDFToolbarBuilder.cpp
git-svn-id: svn://10.0.0.236/trunk@23132 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:24:51 +00:00
hyatt%netscape.com
40ff968768 Added the NS_NewRDFToolbarBuilder call to the header.
git-svn-id: svn://10.0.0.236/trunk@23131 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:21:18 +00:00
hyatt%netscape.com
8accebad8a Changes to enable the instantiation of a toolbar builder.
git-svn-id: svn://10.0.0.236/trunk@23130 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:18:58 +00:00
hyatt%netscape.com
0f937ddd5b Changes to the builder APIs to distinguish folder items from leaf
items (although we're not quite there yet).


git-svn-id: svn://10.0.0.236/trunk@23129 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:18:26 +00:00
hyatt%netscape.com
963375d55e Adding the toolbar builder to Windows and Linux makefiles.
git-svn-id: svn://10.0.0.236/trunk@23128 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:17:01 +00:00
hyatt%netscape.com
4d29994251 The RDF toolbar builder (for constructing RDF toolbars like the Personal Toolbar).
git-svn-id: svn://10.0.0.236/trunk@23127 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:16:37 +00:00
hyatt%netscape.com
5de09bf263 Added the Personal Toolbar to the XUL file.
git-svn-id: svn://10.0.0.236/trunk@23126 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 23:14:41 +00:00
mscott%netscape.com
4936ba4a0d Change onClick to onclick to enable menu item commands.
git-svn-id: svn://10.0.0.236/trunk@23125 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 21:58:36 +00:00
mscott%netscape.com
9b0caae748 Change rdf:id to id. (Although the thread pane doesn't seem to be working for me as of sunday's current tip....)
git-svn-id: svn://10.0.0.236/trunk@23124 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 21:58:15 +00:00
mscott%netscape.com
c0b892b4fa Install DLL in components directory as part of dp's changes...
git-svn-id: svn://10.0.0.236/trunk@23123 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 21:54:46 +00:00
pavlov%pavlov.net
2c561f6d59 fix bug 3079
git-svn-id: svn://10.0.0.236/trunk@23122 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 21:22:53 +00:00
mscott%netscape.com
9d4ea29f98 Move read/write file io stream changes....Read and write no longer take offsets...
git-svn-id: svn://10.0.0.236/trunk@23121 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 21:21:25 +00:00
jband%netscape.com
073ee50abb fix fopen mode for binary files - I'm starting to think that shaver, coop, and mccabe are doing this to me on purpose :)
git-svn-id: svn://10.0.0.236/trunk@23120 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 20:48:37 +00:00
edwin%woudt.nl
262e661621 Oh boy, I broke this with my license compliance checkin :-(
git-svn-id: svn://10.0.0.236/trunk@23119 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 20:04:41 +00:00
edwin%woudt.nl
e80d95f4b2 Fixing to comply with MPL requirements: every contributor should be mentioned!
git-svn-id: svn://10.0.0.236/trunk@23118 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 19:58:40 +00:00
rickg%netscape.com
0608af3478 fixed recently introduced i18n bugs
git-svn-id: svn://10.0.0.236/trunk@23117 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 19:23:28 +00:00
hyatt%netscape.com
a76538f256 Changing the natural order pos name to match the function conventions.
git-svn-id: svn://10.0.0.236/trunk@23116 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:52:42 +00:00
hyatt%netscape.com
e097700974 Again.
git-svn-id: svn://10.0.0.236/trunk@23115 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:49:26 +00:00
hyatt%netscape.com
a8ab7e3102 Fixing build bustage.
git-svn-id: svn://10.0.0.236/trunk@23114 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:48:58 +00:00
hyatt%netscape.com
973b2a044e Declaring some classes so that the compilers are happy again.
git-svn-id: svn://10.0.0.236/trunk@23113 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:41:00 +00:00
hyatt%netscape.com
8d0b3864cd added files: mozilla/rdf/content/src/nsRDFGenericBuilder.cpp, mozilla/rdf/content/src/nsRDFMenuBuilder.cpp
git-svn-id: svn://10.0.0.236/trunk@23112 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:35:17 +00:00
hyatt%netscape.com
57020bc795 Changing the display type of menubars, menus, and menuitems to be "none" so that
frames don't get built for them.  Added a bookmarks menu that uses real
RDF data.  (WOO HOO!)


git-svn-id: svn://10.0.0.236/trunk@23111 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:33:21 +00:00
hyatt%netscape.com
0a8f08e165 The modified tree builder.
git-svn-id: svn://10.0.0.236/trunk@23110 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:30:42 +00:00
hyatt%netscape.com
59dd328258 Landing the menu builder for real. The bookmarks menu lives (well, sort of).
git-svn-id: svn://10.0.0.236/trunk@23109 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:28:42 +00:00
hyatt%netscape.com
7c89bc9b07 First stab at the menu builder. It doesn't know how to build popup menus
yet. We'll need to work on that one.


git-svn-id: svn://10.0.0.236/trunk@23108 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 10:00:13 +00:00
hyatt%netscape.com
ae118c5d22 Checking in a patch for a XUL bug in ContentInserted (inside an #ifdef INCLUDE_XUL).
git-svn-id: svn://10.0.0.236/trunk@23107 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 09:55:39 +00:00
rjc%netscape.com
7c9fffcbb0 More support for column sorting.
git-svn-id: svn://10.0.0.236/trunk@23106 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 09:44:38 +00:00
hyatt%netscape.com
ba91bb4cbf A base class for factoring out the common functionality that exists
among builders.  (To be used by the tree, toolbar, and menu builders
at the very least.)


git-svn-id: svn://10.0.0.236/trunk@23105 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 08:12:48 +00:00
bienvenu%netscape.com
fa3a9d1061 hook up a little more to mdb, add some error checking
git-svn-id: svn://10.0.0.236/trunk@23104 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 05:39:35 +00:00
bienvenu%netscape.com
bff63bf92f add ClearErrors stub
git-svn-id: svn://10.0.0.236/trunk@23103 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 05:38:54 +00:00
bienvenu%netscape.com
4db58490e6 check for error creating msghdr in test prepulate method
git-svn-id: svn://10.0.0.236/trunk@23102 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 05:34:01 +00:00
briano%netscape.com
f4b02ce313 Automated update
git-svn-id: svn://10.0.0.236/trunk@23101 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 05:30:39 +00:00
cls%seawood.org
528012e0b5 Introduced separate CXXFLAGS for use with C++ code in the same style as the existing CFLAGS. Prepended _ to some configure.in private variables.
git-svn-id: svn://10.0.0.236/trunk@23100 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 05:18:45 +00:00
cls%seawood.org
38280e9eac Build db subdir before build so that libmailnewsmsgdb is available for libmailnews' final link.
git-svn-id: svn://10.0.0.236/trunk@23099 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 04:36:09 +00:00
edwin%woudt.nl
dbc0ed9954 Fixing to comply with MPL requirements: every contributor should be mentioned!
git-svn-id: svn://10.0.0.236/trunk@23098 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 02:46:50 +00:00
edwin%woudt.nl
c2f903d8c0 Fixing to comply with MPL requirements: every contributor should be mentioned!
git-svn-id: svn://10.0.0.236/trunk@23097 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 02:39:04 +00:00
shaver%netscape.com
44e5f9594a we do windows, but still wait on Mac
git-svn-id: svn://10.0.0.236/trunk@23096 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 02:37:17 +00:00
edwin%woudt.nl
ad689b27b1 Fixing to comply with MPL requirements: every contributor should be mentioned!
git-svn-id: svn://10.0.0.236/trunk@23095 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 02:30:35 +00:00
edwin%woudt.nl
ebf38833f6 Fixing to comply with MPL requirements: every contributor should be mentioned!
git-svn-id: svn://10.0.0.236/trunk@23094 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 02:19:44 +00:00
edwin%woudt.nl
e7a7211830 Fixing to comply with MPL requirements: every contributor should be mentioned!
git-svn-id: svn://10.0.0.236/trunk@23093 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 01:40:44 +00:00
edwin%woudt.nl
ec35849638 Fixing to comply with MPL requirements: every contributor should be mentioned!
git-svn-id: svn://10.0.0.236/trunk@23092 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 01:30:52 +00:00
pavlov%pavlov.net
d154e0982b more work
git-svn-id: svn://10.0.0.236/trunk@23091 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 00:58:11 +00:00
pavlov%pavlov.net
066e49e7e7 add a few comments in here on how a few things should be done.
git-svn-id: svn://10.0.0.236/trunk@23090 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-07 00:40:08 +00:00
beard%netscape.com
c3ed0d6f79 passing service manager, using NS_CALLBACK macro.
git-svn-id: svn://10.0.0.236/trunk@23089 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 22:32:49 +00:00
beard%netscape.com
68267d0bfb passing service manager, using nsIAllocator instead of nsIMalloc for memory allocation.
git-svn-id: svn://10.0.0.236/trunk@23088 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 22:32:47 +00:00
beard%netscape.com
54ea4168ab passing service manager instead of plugin host.
git-svn-id: svn://10.0.0.236/trunk@23087 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 22:31:28 +00:00
beard%netscape.com
423d0533ef took out singleton management, and registering with the repository. That's what the service manager/component manager is for.
git-svn-id: svn://10.0.0.236/trunk@23086 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 22:25:55 +00:00
beard%netscape.com
216bfff8b9 File Removed.
git-svn-id: svn://10.0.0.236/trunk@23085 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 22:23:41 +00:00
beard%netscape.com
1cc31e4675 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@23084 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 22:23:26 +00:00
jband%netscape.com
d2e367d9f5 getting shaver's changes compiling on Win32 - (and linking - dependency on nspr was added)
git-svn-id: svn://10.0.0.236/trunk@23083 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 21:39:45 +00:00
jband%netscape.com
d64ba60bfa getting shaver's changes compiling on Win32
git-svn-id: svn://10.0.0.236/trunk@23082 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 21:35:01 +00:00
shaver%netscape.com
809bab74f6 updated README and fixed 3484 (make in strings const)
git-svn-id: svn://10.0.0.236/trunk@23081 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:59:41 +00:00
sfraser%netscape.com
ea69d4597d Added debug output text and HTML menu items
git-svn-id: svn://10.0.0.236/trunk@23080 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:54:03 +00:00
sfraser%netscape.com
d268bb036d Fix the text & HTML output routines
git-svn-id: svn://10.0.0.236/trunk@23079 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:49:34 +00:00
briano%netscape.com
0adeb6c4f1 Automated update
git-svn-id: svn://10.0.0.236/trunk@23078 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:45:39 +00:00
cls%seawood.org
58aea2a7f4 Modified allmakefiles.sh setup to use autoconf's default $srcdir. Also fixes mailnews not building in separate obj tree.
git-svn-id: svn://10.0.0.236/trunk@23077 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:38:24 +00:00
sfraser%netscape.com
3b08f1c684 Changed file grouping.
git-svn-id: svn://10.0.0.236/trunk@23076 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:33:07 +00:00
sfraser%netscape.com
c5cf61dbdb Modified OutputText and OutputHTML methods to pass out nsStrings instead of nsIOutputStreams. Also fixed return values, and commented out line termination conversion in Mac outoutput.
git-svn-id: svn://10.0.0.236/trunk@23075 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:32:48 +00:00
cls%seawood.org
c181a3c141 Add $(topsrcdir)/network/protocol/imap4 to LOCAL_INCLUDES.
git-svn-id: svn://10.0.0.236/trunk@23074 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:29:01 +00:00
sfraser%netscape.com
52af2d264e Add support for getting text or HTML through a readonly properly on the EditorAppCore. Added attributes to .idl file, regenerated .h and .cpp with idlc. Simplified toolbar in the .xul file.
git-svn-id: svn://10.0.0.236/trunk@23073 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:28:47 +00:00
sfraser%netscape.com
163c837469 Arrange the various AppCores into groups
git-svn-id: svn://10.0.0.236/trunk@23072 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:27:33 +00:00
sfraser%netscape.com
740e25376c Fix warning reported by warren (bracket was in wrong place).
git-svn-id: svn://10.0.0.236/trunk@23071 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 20:19:52 +00:00
evaughan%netscape.com
0615e95ff7 1) Implemented regular button and html4 button with a button renderer.
2) Fixed ProgressMeter to update correctly when attributes change
3) Fixed sample8.html so that it does not over ride the borders of the HTML4 button this
   messed up the active, hover, and disabled states.


git-svn-id: svn://10.0.0.236/trunk@23070 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 19:43:13 +00:00
shaver%netscape.com
d67b62db13 Add XPT_InterfaceDescriptorAddConsts to API.
git-svn-id: svn://10.0.0.236/trunk@23069 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 19:40:34 +00:00
shaver%netscape.com
ade285390e Compatibility with libIDL 0.6.x. (now required -- 0.5.x won't work any more)
Open absolutely-named files without include-path checking.
Always report errors (duh).
typelib generation: [iid_is()], consts, parse [uuid()], string type change
(will someone please explain our string types to me?), add float support,
handle [retval], IDL return as trailing argument (duh), attributes generate
accessor entries.
Use IDL_tree_error instead of burping at stderr.


git-svn-id: svn://10.0.0.236/trunk@23068 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 19:26:40 +00:00
troy%netscape.com
279360546a In RulesMatching(), changed NS_RELEASE to NS_IF_RELEASE for the link handler.
This fixes a crash when doing a print preview


git-svn-id: svn://10.0.0.236/trunk@23067 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 17:20:27 +00:00
troy%netscape.com
8c2eb5770c Changed ComputeDesiredWidth() to get the table layout strategy from the
first-in-flow. This fixes a crash in paginated mode


git-svn-id: svn://10.0.0.236/trunk@23066 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 17:01:15 +00:00
briano%netscape.com
6842a254dd Automated update
git-svn-id: svn://10.0.0.236/trunk@23065 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 15:16:10 +00:00
ramiro%netscape.com
16659349cb Latest AIX fixes from waqar@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@23064 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 15:09:48 +00:00
ramiro%netscape.com
0602774650 Fix printf format. Thanks to (waqar@netscape.com).
git-svn-id: svn://10.0.0.236/trunk@23063 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 15:07:44 +00:00
ramiro%netscape.com
393e76453d Latest AIX fixes from waqar@netscape.com.
I added this define before and its not needed now, thanks to the c++ feature
detection magic in configure.in.


git-svn-id: svn://10.0.0.236/trunk@23062 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 15:07:01 +00:00
briano%netscape.com
7666411623 Automated update
git-svn-id: svn://10.0.0.236/trunk@23061 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 12:15:43 +00:00
ramiro%netscape.com
91077bb45b Fix the exceptions flag test.
git-svn-id: svn://10.0.0.236/trunk@23060 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 12:03:42 +00:00
dp%netscape.com
69df3f9c47 Bumping nsRepository version string to force registry to be cleaned
git-svn-id: svn://10.0.0.236/trunk@23059 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 09:11:05 +00:00
dp%netscape.com
a6d34909ca dist/bin/components is where all loadable components will be installed.
git-svn-id: svn://10.0.0.236/trunk@23058 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 09:04:53 +00:00
grail%cafebabe.org
df6e2353c4 Fixed bad type cast.
git-svn-id: svn://10.0.0.236/trunk@23057 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 07:25:10 +00:00
grail%cafebabe.org
115126053e Re-organized for more flexible handling of widget creation.
git-svn-id: svn://10.0.0.236/trunk@23056 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 07:08:01 +00:00
grail%cafebabe.org
76937a8d5e Added documentation.
git-svn-id: svn://10.0.0.236/trunk@23055 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 07:07:34 +00:00
grail%cafebabe.org
20c454d5fb Added MPL license to SearchDirectory, Added it to makefile. Removed
references to AWT as much as possible. I need to enhance pagebuilder to
do other layouts other than GridBagLayout.


git-svn-id: svn://10.0.0.236/trunk@23054 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 07:06:31 +00:00
grail%cafebabe.org
a9752fa00b Fixed DOS end-of-lines from the files.
git-svn-id: svn://10.0.0.236/trunk@23053 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 06:55:26 +00:00
briano%netscape.com
7cf95055d1 Automated update
git-svn-id: svn://10.0.0.236/trunk@23050 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 05:15:39 +00:00
mcafee%netscape.com
26e6bc85e2 Removing -xar from MKSHLIB, this was incorrectly generating .a libs, thanks to Tim McNerney <mumbly@netcom.com> for this fix.
git-svn-id: svn://10.0.0.236/trunk@23049 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 05:08:12 +00:00
troy%netscape.com
cac3fb5b73 Added some XXX comments
git-svn-id: svn://10.0.0.236/trunk@23048 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 05:03:09 +00:00
rjc%netscape.com
a4b87102ee Add RDF to list of include directories on Windows.
git-svn-id: svn://10.0.0.236/trunk@23047 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 04:57:20 +00:00
mcafee%netscape.com
cdc5264bdb Directly calling const char* const() operator to avoid ambiguity on Solaris. r=mcmullen@netscape.com
git-svn-id: svn://10.0.0.236/trunk@23046 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 04:42:08 +00:00
warren%netscape.com
c65396ffe0 Fixing someone's RDF breakage.
git-svn-id: svn://10.0.0.236/trunk@23045 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 04:12:56 +00:00
rjc%netscape.com
898583b974 Its a good thing to compile nsXULSortService.cpp, isn't it? (cyeh is making the same change to Makefile.win after verifying the fix.)
git-svn-id: svn://10.0.0.236/trunk@23044 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 04:05:38 +00:00
warren%netscape.com
140018846d Fixed multiple mRefCnt problem.
git-svn-id: svn://10.0.0.236/trunk@23043 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 03:56:24 +00:00
warren%netscape.com
9eaa6a745d Fixed uninitialized variable problem.
git-svn-id: svn://10.0.0.236/trunk@23042 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 03:54:19 +00:00
troy%netscape.com
6002e5995c Used style data pointer in HTML reflow state and eliminated some calls to
GetStyleData()


git-svn-id: svn://10.0.0.236/trunk@23041 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 03:37:44 +00:00
troy%netscape.com
009e3818fb Changed Reflow() to use style info from the HTML reflow state
git-svn-id: svn://10.0.0.236/trunk@23040 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 03:30:25 +00:00
talisman%anamorphic.com
8b0e4bddd5 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@23039 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 02:49:47 +00:00
talisman%anamorphic.com
2910c0269d Added per Mauro Botelho.
git-svn-id: svn://10.0.0.236/trunk@23038 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 02:49:24 +00:00
mcmullen%netscape.com
f74a94e9ff More bustage (more calls to Read() with old parameters).
git-svn-id: svn://10.0.0.236/trunk@23037 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 02:42:44 +00:00
mcmullen%netscape.com
f54f7a537e More lurking calls to Read() with the old API.
git-svn-id: svn://10.0.0.236/trunk@23036 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 02:38:27 +00:00
mcmullen%netscape.com
f6c1353346 Adapt to new stream interfaces some more.
git-svn-id: svn://10.0.0.236/trunk@23033 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 02:12:52 +00:00
nisheeth%netscape.com
b0dfaee405 Changed nsIContentSink->NotifyError() to accept an nsParserError argument. This change is needed for propagating errors from the new expat parser.
git-svn-id: svn://10.0.0.236/trunk@23032 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 02:09:46 +00:00
nisheeth%netscape.com
0127c619d0 Changed nsIContentSink->NotifyError() to accept an nsParserError argument. This change is needed for propagating errors from the new expat parser.
git-svn-id: svn://10.0.0.236/trunk@23031 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 02:01:11 +00:00
troy%netscape.com
21a6536307 Removed some code that is no longer needed
git-svn-id: svn://10.0.0.236/trunk@23030 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:58:33 +00:00
troy%netscape.com
5bd0174c47 Eliminated some code that's no longer needed now that the info is in the
HTML reflow state


git-svn-id: svn://10.0.0.236/trunk@23029 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:48:28 +00:00
nisheeth%netscape.com
5016ed7684 Changed nsIContentSink->NotifyError() to accept an nsParserError argument.
This change is needed for propagating errors from the new
expat parser.


git-svn-id: svn://10.0.0.236/trunk@23028 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:48:11 +00:00
hyatt%netscape.com
304b78af18 Changing the name of a function. It was hiding another function in a base class.
git-svn-id: svn://10.0.0.236/trunk@23027 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:43:33 +00:00
troy%netscape.com
cd506df1a1 Eliminated some code that's no longer needed now that the info is in the
HTML reflow state


git-svn-id: svn://10.0.0.236/trunk@23026 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:40:29 +00:00
mscott%netscape.com
da3ad2f309 fix build breakage when the base file i/o stream changed.
git-svn-id: svn://10.0.0.236/trunk@23025 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:37:00 +00:00
nisheeth%netscape.com
ec2572e0af Exporting nsParserError.h...
git-svn-id: svn://10.0.0.236/trunk@23024 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:32:00 +00:00
alecf%netscape.com
5f05c90ce0 fix up autoregistration messenger bootstrap code
git-svn-id: svn://10.0.0.236/trunk@23023 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:29:31 +00:00
nisheeth%netscape.com
72db16df3a Exported nsParserError.h.
git-svn-id: svn://10.0.0.236/trunk@23022 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:29:11 +00:00
alecf%netscape.com
888ba4dea8 fix newline at end of file problem
git-svn-id: svn://10.0.0.236/trunk@23021 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:24:36 +00:00
alecf%netscape.com
3c77f2e6a3 rev the idl-generated headers
git-svn-id: svn://10.0.0.236/trunk@23020 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:24:00 +00:00
alecf%netscape.com
d7ba80c1da update interface to prepare to move nsMsgGroupRecord to be behind an interface
git-svn-id: svn://10.0.0.236/trunk@23019 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:23:07 +00:00
mscott%netscape.com
3f035f4167 Fix build breakage for mcmullen using the file stream changes.
git-svn-id: svn://10.0.0.236/trunk@23018 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:21:41 +00:00
nisheeth%netscape.com
8425c6c0d5 Adding nsParserError.h for export.
git-svn-id: svn://10.0.0.236/trunk@23017 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:20:18 +00:00
hyatt%netscape.com
04bdd7657a onchange handler implemented for observes nodes.
git-svn-id: svn://10.0.0.236/trunk@23016 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:19:13 +00:00
mscott%netscape.com
faafbf7f8d fix build breakage. file stream updates for mcmullen.
git-svn-id: svn://10.0.0.236/trunk@23015 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:17:55 +00:00
mcmullen%netscape.com
86f1a505d9 Adapt to the removed offset parameter in streams.
git-svn-id: svn://10.0.0.236/trunk@23014 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 01:03:12 +00:00
tague%netscape.com
00fb8568a5 Fixed tree bustage
git-svn-id: svn://10.0.0.236/trunk@23013 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:58:50 +00:00
mscott%netscape.com
9d3ed613ec Don't link with rdf_utils. That is already linked into msglocal.lib.
git-svn-id: svn://10.0.0.236/trunk@23012 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:53:32 +00:00
mscott%netscape.com
6babebf41f Remove extraneous functions....update to use ::RegisterComponent.
git-svn-id: svn://10.0.0.236/trunk@23011 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:53:11 +00:00
troy%netscape.com
b81fd87c6f Removed some static functions that are no longer needed
git-svn-id: svn://10.0.0.236/trunk@23010 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:48:45 +00:00
mcmullen%netscape.com
470d81fb75 Trying to fix the use of streams (the offset parameter has gone).
git-svn-id: svn://10.0.0.236/trunk@23009 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:44:40 +00:00
law%netscape.com
53806f3573 Updating test case
git-svn-id: svn://10.0.0.236/trunk@23008 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:44:32 +00:00
chuang%netscape.com
759293bc9a Java script functions for shared command between mail and browser, like Communicator and Help menu
git-svn-id: svn://10.0.0.236/trunk@23007 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:43:10 +00:00
chuang%netscape.com
d6d84cff70 Java script functions for mailnews commands
git-svn-id: svn://10.0.0.236/trunk@23006 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:41:56 +00:00
chuang%netscape.com
1157593c07 Java script functions for UI widgets
git-svn-id: svn://10.0.0.236/trunk@23005 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:41:21 +00:00
mscott%netscape.com
40a3deefd3 woops....fix typo....
git-svn-id: svn://10.0.0.236/trunk@23004 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:39:46 +00:00
troy%netscape.com
a468a48e17 Added ComputePadding() member function
git-svn-id: svn://10.0.0.236/trunk@23003 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:36:59 +00:00
sfraser%netscape.com
7e33e3843a Changes to get DOM IDL compiler to build on Mac.
git-svn-id: svn://10.0.0.236/trunk@23002 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:33:35 +00:00
mscott%netscape.com
d5832e6c07 Add test code for displaying a mailbox message from a berkley mail folder.
git-svn-id: svn://10.0.0.236/trunk@23001 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:31:59 +00:00
mscott%netscape.com
c2555fd151 LoadUrl now takes a display consumer. Add functionality for reading & displaying a mailbox message.
Right now we write the message to a temp file and then run a file url on the temp file to display the message.
So mkfile handles the rfc-822 to html conversion for us...


git-svn-id: svn://10.0.0.236/trunk@23000 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:31:06 +00:00
mscott%netscape.com
2fe594628c interface change, display message now takes a message id and a message key.
git-svn-id: svn://10.0.0.236/trunk@22999 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:30:10 +00:00
mcmullen%netscape.com
0f802d5ed2 Adapt to new stream interfaces
git-svn-id: svn://10.0.0.236/trunk@22998 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:29:58 +00:00
mscott%netscape.com
db151a164a Implemented a DisplayMessage service which takes a msg id, msg key a display consumer and possibly a url listener. It builds a mailbox url and runs it. Also, nsMailboxProtocol::LoadUrl now takes the consumer as an argument..
git-svn-id: svn://10.0.0.236/trunk@22997 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:29:50 +00:00
mscott%netscape.com
61558e8f53 many changes to how we parse a url. Added ability to extract message ID and message key from the search part.
When generating the url_struct for netlib, if we are a display mailbox url, then set the byte range based on message key and message size.


git-svn-id: svn://10.0.0.236/trunk@22996 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:29:10 +00:00
sfraser%netscape.com
846a9b8069 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@22995 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:28:40 +00:00
mscott%netscape.com
539e846fce accessors for fetching a message key for the current url and a setter for setting the message size.
git-svn-id: svn://10.0.0.236/trunk@22994 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:28:23 +00:00
mscott%netscape.com
c877cb06b8 display message takes a message key and a messageID.
git-svn-id: svn://10.0.0.236/trunk@22993 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:27:58 +00:00
mcmullen%netscape.com
f90ec6e3ba Adapt to new Write()
git-svn-id: svn://10.0.0.236/trunk@22992 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:27:37 +00:00
slamm%netscape.com
ed35e74c15 Put test bookmarks at top.
git-svn-id: svn://10.0.0.236/trunk@22991 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:11:55 +00:00
rjc%netscape.com
19f8c00e28 Small cleanup to nsXULSortService.
git-svn-id: svn://10.0.0.236/trunk@22990 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:11:14 +00:00
mscott%netscape.com
2504363772 Leverage name spaces and remove rdf:id leaving just 'id'. This was causing the folder pane to come up blank....
git-svn-id: svn://10.0.0.236/trunk@22989 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:07:27 +00:00
slamm%netscape.com
1fed87b221 Simple bookmarks that launch.
git-svn-id: svn://10.0.0.236/trunk@22988 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:07:23 +00:00
mcmullen%netscape.com
adc585142d Fixing nsCOMPtr usage for unix.
git-svn-id: svn://10.0.0.236/trunk@22987 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:07:06 +00:00
slamm%netscape.com
8e97b9e85f Add some bookmarks without redirection. delete ^M's
git-svn-id: svn://10.0.0.236/trunk@22986 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:05:52 +00:00
alecf%netscape.com
7d408cc5c0 rev IDL-generated headers, won't bust on nsIID this time.
git-svn-id: svn://10.0.0.236/trunk@22985 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:05:51 +00:00
alecf%netscape.com
158065dfd1 add mozilla/compose/build/Makefile
git-svn-id: svn://10.0.0.236/trunk@22984 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:04:33 +00:00
troy%netscape.com
b2ed84683d Removed some code that's no longer needed, because mComputedPadding is now
part of the HTML reflow state


git-svn-id: svn://10.0.0.236/trunk@22983 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-06 00:04:24 +00:00
hyatt%netscape.com
f13c2c1cce More tweaks to broadcasters.
git-svn-id: svn://10.0.0.236/trunk@22982 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:53:01 +00:00
pavlov%pavlov.net
bb3f6aa1df proper fix
git-svn-id: svn://10.0.0.236/trunk@22981 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:52:34 +00:00
rjc%netscape.com
13142f4a98 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@22980 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:51:41 +00:00
rjc%netscape.com
cd01332f38 nsXULSortService implementation: XUL sort functionality.
git-svn-id: svn://10.0.0.236/trunk@22979 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:51:13 +00:00
despotdaemon%netscape.com
ec7933732a Pseudo-automatic update of changes made by gbeasley@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@22978 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:48:18 +00:00
mcmullen%netscape.com
a801f8e296 Adding stringstreams
git-svn-id: svn://10.0.0.236/trunk@22977 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:44:22 +00:00
mcmullen%netscape.com
bda242b372 Have the right fix now, so backing out the hack.
git-svn-id: svn://10.0.0.236/trunk@22976 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:43:37 +00:00
mcmullen%netscape.com
58c3fd7fc2 Need the exports, so checking in the makefiles.
git-svn-id: svn://10.0.0.236/trunk@22975 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:41:46 +00:00
pavlov%pavlov.net
0c52e9f756 hacky fix to fix build. someone please do this correctly.
git-svn-id: svn://10.0.0.236/trunk@22974 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:41:40 +00:00
mscott%netscape.com
61ff77fdea Definition for LINEBREAK moved up into msgCore.h
git-svn-id: svn://10.0.0.236/trunk@22973 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:41:27 +00:00
mscott%netscape.com
beec466d17 Add platform specific defintions for LINEBREAK (these came from nsMsgLineBuffer)
git-svn-id: svn://10.0.0.236/trunk@22972 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:40:53 +00:00
cyeh%netscape.com
538e46343a fix pdb file generation so that the go into $(OBJDIR) and also
have more useful names other than "none.pdb". some cleanup remains.


git-svn-id: svn://10.0.0.236/trunk@22971 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:24:48 +00:00
nisheeth%netscape.com
ec4eb761d4 First commit for nsParserError struct.
git-svn-id: svn://10.0.0.236/trunk@22970 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:24:32 +00:00
syd%netscape.com
8bf9391538 Fix for 2503.
Communicate GTK_DELETE event so that higher levels can deal with the window
closure.


git-svn-id: svn://10.0.0.236/trunk@22969 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:21:51 +00:00
mcmullen%netscape.com
b9816559be Reversing the previous change. This was checked in in error.
git-svn-id: svn://10.0.0.236/trunk@22968 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:08:56 +00:00
hyatt%netscape.com
456017166d Fixed a memory leak in the broadcasters.
git-svn-id: svn://10.0.0.236/trunk@22967 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:08:34 +00:00
terry%netscape.com
0da1ca453e Check qa_contact IDs.
git-svn-id: svn://10.0.0.236/trunk@22966 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:08:23 +00:00
mcmullen%netscape.com
848546e2e8 Fix a unix warning
git-svn-id: svn://10.0.0.236/trunk@22965 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 23:00:57 +00:00
mcmullen%netscape.com
5b8c2045d8 Removed the offset parameter from the base stream interfaces. Implemented string streams.
git-svn-id: svn://10.0.0.236/trunk@22964 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:53:56 +00:00
hyatt%netscape.com
278305681e Changes to broadcasters.
git-svn-id: svn://10.0.0.236/trunk@22963 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:43:02 +00:00
alecf%netscape.com
49bedf1ec8 split up nsISupports macros into seperate files
git-svn-id: svn://10.0.0.236/trunk@22962 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:39:03 +00:00
alecf%netscape.com
932e5a5e58 oops, don't include nsID.idl, it's not being exported right now
git-svn-id: svn://10.0.0.236/trunk@22961 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:37:35 +00:00
hyatt%netscape.com
f1b078cf1c Changing the broadcaster methods to take DOM elements instead of DOM
nodes.


git-svn-id: svn://10.0.0.236/trunk@22960 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:37:24 +00:00
hyatt%netscape.com
3c2abba5dd Cleaning up some code.
git-svn-id: svn://10.0.0.236/trunk@22959 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:33:27 +00:00
wtc%netscape.com
aee1618592 Another update from the internal CVS repository /m/src.
git-svn-id: svn://10.0.0.236/trunk@22958 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:32:56 +00:00
alecf%netscape.com
0201c25604 removed lower-case version
git-svn-id: svn://10.0.0.236/trunk@22957 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:24:49 +00:00
troy%netscape.com
6bf1e58e48 Added ComputeMargin() member function that takes the containing block width
as an argument. This is necessary for absolutely positioned elements which use
the padding edge and not the content edge for the containing block


git-svn-id: svn://10.0.0.236/trunk@22956 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:24:27 +00:00
rhp%netscape.com
596b678a4c New files for XP-COM stream converter interface
git-svn-id: svn://10.0.0.236/trunk@22955 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:18:42 +00:00
slamm%netscape.com
5b89d0fbca Via irc vote, turn on 'checkins since' links even for nocrap.
git-svn-id: svn://10.0.0.236/trunk@22954 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 22:10:04 +00:00
alecf%netscape.com
2893cb0c07 fix linux -pedantic casting problems
git-svn-id: svn://10.0.0.236/trunk@22953 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:39:55 +00:00
mcmullen%netscape.com
72a74134c2 Made a function static to remove a warning.
git-svn-id: svn://10.0.0.236/trunk@22952 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:35:23 +00:00
alecf%netscape.com
f79fad04dc eliminate netlib dependancy by removing call to FE_Alert
git-svn-id: svn://10.0.0.236/trunk@22951 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:33:02 +00:00
alecf%netscape.com
adb9ab93da add OLD_MAIL_NEWS macros to eliminate libpref dependancy from libxp
git-svn-id: svn://10.0.0.236/trunk@22950 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:31:00 +00:00
ramiro%netscape.com
7ee4fc82c7 Filename was misspelled. Broke unix. Blessed by cyeh.
git-svn-id: svn://10.0.0.236/trunk@22949 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:29:26 +00:00
troy%netscape.com
cab2885013 Fixed containing block calculation for absolutely positioned elements. Now
uses padding edge and not the content edge


git-svn-id: svn://10.0.0.236/trunk@22948 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:26:49 +00:00
slamm%netscape.com
4d872e3116 Fix type and add m4 to path.
git-svn-id: svn://10.0.0.236/trunk@22947 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:26:04 +00:00
bienvenu%netscape.com
c2dcf1f296 load mail root path from prefs.js
git-svn-id: svn://10.0.0.236/trunk@22946 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:17:59 +00:00
rods%netscape.com
653fd3b694 Made sure nsIRadioGroup has been removed
git-svn-id: svn://10.0.0.236/trunk@22945 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:06:09 +00:00
cmanske%netscape.com
6987407539 Changed editor classes to inherited model. Fixed lots of destructor warnings.
git-svn-id: svn://10.0.0.236/trunk@22944 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:05:35 +00:00
cmanske%netscape.com
f6ff40c486 Change InitHTMLEditor to Init and removed EnableUndo, which is done in Init
git-svn-id: svn://10.0.0.236/trunk@22943 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:05:31 +00:00
cmanske%netscape.com
f6d9c2d5f8 Changed InitHTMLEditor to Init and removed EnableUndo, which is done in the Init
git-svn-id: svn://10.0.0.236/trunk@22942 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:05:26 +00:00
rods%netscape.com
bc22754c21 cleaned up some comment and debugging
git-svn-id: svn://10.0.0.236/trunk@22941 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:04:57 +00:00
alecf%netscape.com
d4d4126684 make clobber remove .deps directory too
git-svn-id: svn://10.0.0.236/trunk@22940 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:03:54 +00:00
mcmullen%netscape.com
859bdf20d9 Added nsIStringStream.h
git-svn-id: svn://10.0.0.236/trunk@22939 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:01:38 +00:00
mcmullen%netscape.com
1e5ac4f1d3 Make the FilesTest project build again.
git-svn-id: svn://10.0.0.236/trunk@22938 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 21:01:11 +00:00
beard%netscape.com
b0ca311028 Removed nsIRadioGroup.h (evidently obsolete?)
git-svn-id: svn://10.0.0.236/trunk@22937 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:59:34 +00:00
mcmullen%netscape.com
239f08d915 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@22936 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:55:10 +00:00
slamm%netscape.com
ca8f6c08f7 Have script write out its own .cvspass. Use '.mozconfig.sh' symbolic link for Save As
git-svn-id: svn://10.0.0.236/trunk@22935 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:53:22 +00:00
slamm%netscape.com
50b1b3d4b2 Script writes its own .cvspass now
git-svn-id: svn://10.0.0.236/trunk@22934 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:51:12 +00:00
rods%netscape.com
379cc1597f Fixed crash bug on releaseing null pointer
git-svn-id: svn://10.0.0.236/trunk@22933 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:41:37 +00:00
sdagley%netscape.com
275c0f7692 Re-checking in pinkerton's fix as the project seemed to have cached something and kept putting nsGlobalVariables.cpp back into Rescued Items every time it was opened.
git-svn-id: svn://10.0.0.236/trunk@22932 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:31:19 +00:00
hyatt%netscape.com
6068e57e94 Fixes to enable getElementById to work with HTML elements.
git-svn-id: svn://10.0.0.236/trunk@22931 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:30:13 +00:00
sar%netscape.com
cf2eed582c adding mailnews to the SeaMonkeyAll module
git-svn-id: svn://10.0.0.236/trunk@22930 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:30:02 +00:00
sar%netscape.com
4078c85c95 enabling mailnews by default
git-svn-id: svn://10.0.0.236/trunk@22929 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:29:36 +00:00
rods%netscape.com
6ffeafda85 I have removed nsRadioGroup and nsIRadioGroup and all references to it.
git-svn-id: svn://10.0.0.236/trunk@22928 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:28:16 +00:00
danm%netscape.com
cc44e7799b adding convenience makefile (not part of the normal build)
git-svn-id: svn://10.0.0.236/trunk@22927 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:25:48 +00:00
dougt%netscape.com
547cad0b24 added nsSpecialSystemDirectory to build.
git-svn-id: svn://10.0.0.236/trunk@22926 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:25:05 +00:00
danm%netscape.com
5a423eb9bb changed name of onConstruction event to onload
git-svn-id: svn://10.0.0.236/trunk@22925 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:23:19 +00:00
dougt%netscape.com
1cbb8d488d Added testcases for nsSpecialSystemDirectory. These cases are
currently turned off until mcmullen takes a look at them on the mac.


git-svn-id: svn://10.0.0.236/trunk@22924 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:21:33 +00:00
pinkerton%netscape.com
1517688bd7 handle toolbar demo sample menu command.
git-svn-id: svn://10.0.0.236/trunk@22923 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:21:25 +00:00
pinkerton%netscape.com
fcd702d820 Remove toolbar/tree demo code (which was commented out).
git-svn-id: svn://10.0.0.236/trunk@22922 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:21:14 +00:00
dougt%netscape.com
96bdde7c31 adding nsSpecialSystemDirectory.cpp to windows makefile.
Fixed MakeAllDirectory bug in nsFileSpec.cpp


git-svn-id: svn://10.0.0.236/trunk@22921 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:20:22 +00:00
pinkerton%netscape.com
460615666c export toolbar samples and css file.
git-svn-id: svn://10.0.0.236/trunk@22920 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:20:18 +00:00
pinkerton%netscape.com
edce09c3ab table for main toolbar, removing html namespace stuff, onClick->onclick
git-svn-id: svn://10.0.0.236/trunk@22919 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:19:46 +00:00
pinkerton%netscape.com
020161f824 add new toolbar sample, remove old widget samples.
git-svn-id: svn://10.0.0.236/trunk@22918 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:19:13 +00:00
pinkerton%netscape.com
b76c4a887f fix for bug #3449 (onClick should be onclick).
git-svn-id: svn://10.0.0.236/trunk@22917 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:18:59 +00:00
dougt%netscape.com
59a658730f Updating makefiles so that nsSpecialSystemDirectory.h gets exported.
git-svn-id: svn://10.0.0.236/trunk@22916 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:18:33 +00:00
pinkerton%netscape.com
7fcd6c2b23 New menus for xul tests
git-svn-id: svn://10.0.0.236/trunk@22915 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:18:25 +00:00
pinkerton%netscape.com
467f6cdca7 remove toolbar/tree stuff, add xul tests.
git-svn-id: svn://10.0.0.236/trunk@22914 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:18:05 +00:00
dougt%netscape.com
9e5d173364 Initial Checkin
git-svn-id: svn://10.0.0.236/trunk@22913 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:17:47 +00:00
pinkerton%netscape.com
6a9df86f26 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@22912 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:17:45 +00:00
dougt%netscape.com
b170bd79a4 Initial Checkin.
git-svn-id: svn://10.0.0.236/trunk@22911 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:16:47 +00:00
slamm%netscape.com
92478835cc Use symbolic link instead of rewrite rule.
git-svn-id: svn://10.0.0.236/trunk@22910 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:15:57 +00:00
rods%netscape.com
e0396140b8 Aded check for null parent to fix printing
git-svn-id: svn://10.0.0.236/trunk@22909 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:14:05 +00:00
terry%netscape.com
36da73bc23 Fixed bug 3365 -- was generating wrong statistics if there were no NEW
or no ASSIGNED bugs.


git-svn-id: svn://10.0.0.236/trunk@22908 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 20:05:53 +00:00
terry%netscape.com
0029bda371 Reformated all the code to match the rest of Bugzilla.
git-svn-id: svn://10.0.0.236/trunk@22907 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 19:48:26 +00:00
pinkerton%netscape.com
451990367b removed nsGlobalVariables.cpp for kipp. permission to checkin to a closed tree given to kipp by cyeh.
git-svn-id: svn://10.0.0.236/trunk@22906 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 19:35:01 +00:00
kipp%netscape.com
7d9aebda71 Cleanup state recomputation; fix bug # 3453 crasher; debug out some max-element-size issues
git-svn-id: svn://10.0.0.236/trunk@22905 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 19:25:44 +00:00
kipp%netscape.com
4717ed3aa4 nuked global variables
git-svn-id: svn://10.0.0.236/trunk@22904 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 19:24:45 +00:00
kipp%netscape.com
2521770fa4 Disable trim code for now; disable horizontal alignment during pass1 table reflow
git-svn-id: svn://10.0.0.236/trunk@22903 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 19:24:15 +00:00
kipp%netscape.com
1bd6230ab0 Remove dead global-variable nonsense
git-svn-id: svn://10.0.0.236/trunk@22902 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 19:23:52 +00:00
kipp%netscape.com
9d77708387 Partial fix to bug #3094
git-svn-id: svn://10.0.0.236/trunk@22901 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 19:23:24 +00:00
kipp%netscape.com
e24dd0c2bf Removed dead include
git-svn-id: svn://10.0.0.236/trunk@22900 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 19:23:09 +00:00
slamm%netscape.com
2ce22c6452 Avoid copying the list pointers
git-svn-id: svn://10.0.0.236/trunk@22899 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 18:08:24 +00:00
terry%netscape.com
984cd512c6 Add check to make sure versions table is OK.
git-svn-id: svn://10.0.0.236/trunk@22898 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 17:55:45 +00:00
slamm%netscape.com
6be2f1a5ba Don't use unshift because it is slow. Use push/reverse combo instead.
git-svn-id: svn://10.0.0.236/trunk@22897 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 17:14:03 +00:00
rods%netscape.com
8edb5cad46 Added ref counting to vertical scrollbar
git-svn-id: svn://10.0.0.236/trunk@22896 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:50:04 +00:00
briano%netscape.com
3d3781560b Automated update
git-svn-id: svn://10.0.0.236/trunk@22895 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:45:38 +00:00
rods%netscape.com
704f4fa587 Added where a scrolled view sets the widget for the vertical scrollbar
into the window so the window can send the vertical scrollbar the appropriate
message.


git-svn-id: svn://10.0.0.236/trunk@22894 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:41:50 +00:00
ramiro%netscape.com
019d74afca Add --enable-cpp-rtti , --enable-cpp-exceptions flags.
RTTI and exceptions are off by default on Linux.


git-svn-id: svn://10.0.0.236/trunk@22893 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:36:20 +00:00
rods%netscape.com
90e6c696a7 Major update for tracking the popping up and dropping down of menus.
Added Mouse Wheel tracking


git-svn-id: svn://10.0.0.236/trunk@22892 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:34:53 +00:00
rods%netscape.com
0bde4cee94 Fixed voidarray problem and a few other minor things
git-svn-id: svn://10.0.0.236/trunk@22891 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:33:40 +00:00
rods%netscape.com
bd3a759b8d Fixed up ref counting issues
git-svn-id: svn://10.0.0.236/trunk@22890 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:32:54 +00:00
rods%netscape.com
c713510396 Changed VoidArray to nsISupportsArray
git-svn-id: svn://10.0.0.236/trunk@22889 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:30:11 +00:00
rods%netscape.com
1a87528672 Added impl of SetVerticalScrollbar
git-svn-id: svn://10.0.0.236/trunk@22888 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:25:24 +00:00
rods%netscape.com
1af1e7d436 Added new method "SetVerticalScrollbar"
git-svn-id: svn://10.0.0.236/trunk@22887 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:25:21 +00:00
kipp%netscape.com
3f13e4f864 nuked
git-svn-id: svn://10.0.0.236/trunk@22886 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:23:46 +00:00
kipp%netscape.com
2095143fa1 Removed ref to dead nsFrameReflowState
git-svn-id: svn://10.0.0.236/trunk@22885 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:22:03 +00:00
edwin%woudt.nl
43b7410fae I'm backing out the changes to use the provider registry for now, because of problems. We should investigate this!
git-svn-id: svn://10.0.0.236/trunk@22884 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 15:16:09 +00:00
dcone%netscape.com
41675a0381 Update the surfaces to include graphics state
git-svn-id: svn://10.0.0.236/trunk@22883 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 14:48:44 +00:00
rpotts%netscape.com
169729d0bb changed all references to getElementByID(...) into getElementById(...). This fixed the URL typein bar...
git-svn-id: svn://10.0.0.236/trunk@22882 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 11:38:40 +00:00
waterson%netscape.com
af04e281fe Added nsRDFInterfaces.h to EXPORTS.
git-svn-id: svn://10.0.0.236/trunk@22881 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 11:12:58 +00:00
waterson%netscape.com
6a06193da5 Added C++-specific #include of nscore.h to make sure that PRUnichar gets included.
git-svn-id: svn://10.0.0.236/trunk@22880 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 11:12:24 +00:00
waterson%netscape.com
700e04eda4 Initial revision. Generated from nsRDFInterfaces.idl.
git-svn-id: svn://10.0.0.236/trunk@22879 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 10:55:04 +00:00
waterson%netscape.com
a68b77b40b Initial revision. Generated from nsRDFInterfaces.idl.
git-svn-id: svn://10.0.0.236/trunk@22878 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 10:49:13 +00:00
waterson%netscape.com
9492eb4357 Removed individual interface files for now, and plugged everything into nsRDFInterfaces.idl.
git-svn-id: svn://10.0.0.236/trunk@22877 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 10:48:07 +00:00
pierre%netscape.com
02557cd6d4 Fix #3408 "When mousedown, mousemoves should all go to same widget"
git-svn-id: svn://10.0.0.236/trunk@22876 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 10:04:07 +00:00
pierre%netscape.com
d711f26063 Improved SetCursor() to use the Appearance Mgr
git-svn-id: svn://10.0.0.236/trunk@22875 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 10:02:16 +00:00
pierre%netscape.com
a9a81bed98 Added nsToolkit::HasAppearanceManager()
git-svn-id: svn://10.0.0.236/trunk@22874 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 10:01:07 +00:00
mcafee%netscape.com
aee2bf8765 Fixing enums for the Solaris 5.0 compiler, thanks to Tim McNerney <mumbly@netcom.com> for this change.
git-svn-id: svn://10.0.0.236/trunk@22873 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 09:29:52 +00:00
grail%cafebabe.org
2cb1be4194 Signature storage into prefs.
git-svn-id: svn://10.0.0.236/trunk@22872 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 09:06:36 +00:00
grail%cafebabe.org
bb0a72c8b7 Removed old references to AWT file chooser. We're never going back there.
git-svn-id: svn://10.0.0.236/trunk@22871 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 09:06:16 +00:00
saari%netscape.com
8979faf55a Fixing menus on Win32
git-svn-id: svn://10.0.0.236/trunk@22870 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 07:31:54 +00:00
bienvenu%netscape.com
761756c428 fix folder info uint32 handling
git-svn-id: svn://10.0.0.236/trunk@22869 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 07:23:24 +00:00
saari%netscape.com
71cb6461a1 Fixing IID() to GetIID() to fix warren's bustage
git-svn-id: svn://10.0.0.236/trunk@22868 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 07:02:27 +00:00
leaf%mozilla.org
f88b33e5c1 ok, this time for sure, fixing mozbot.
git-svn-id: svn://10.0.0.236/trunk@22867 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 06:28:58 +00:00
leaf%mozilla.org
4e45aa3274 making the bot's given nick (an argument) global, because i'm evil.
git-svn-id: svn://10.0.0.236/trunk@22866 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 06:19:28 +00:00
warren%netscape.com
2395acaf74 Fixed up Advance methods.
git-svn-id: svn://10.0.0.236/trunk@22865 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 06:12:47 +00:00
warren%netscape.com
dde7c45373 Removed obsolete mail folder installation.
git-svn-id: svn://10.0.0.236/trunk@22864 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 06:09:43 +00:00
warren%netscape.com
fca11f6c47 Removed obsolete mail folder installation.
git-svn-id: svn://10.0.0.236/trunk@22863 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 06:03:36 +00:00
rjc%netscape.com
84f2cdbbb7 Only have one arc (a child) going out, otherwise duplicates! Also commented out NS_INIT_REFCNT() due to weirdness.
git-svn-id: svn://10.0.0.236/trunk@22862 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 06:03:03 +00:00
troy%netscape.com
ab4b858697 Fixed HTML to be correct: CAPTION must be at start of table, and TFOOT must be
before any body section row groups


git-svn-id: svn://10.0.0.236/trunk@22861 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 06:02:11 +00:00
troy%netscape.com
a759e230cf Table header/footer are repeated when splitting tables
git-svn-id: svn://10.0.0.236/trunk@22860 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 06:00:40 +00:00
warren%netscape.com
7e12e54f21 Added prlog tracing code. Fixed some error codes. Fixed DBArcsInOutCursor::Advance to check for failure on GetValue.
git-svn-id: svn://10.0.0.236/trunk@22859 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 05:59:02 +00:00
warren%netscape.com
4fee15d393 Fixed First method to return error.
git-svn-id: svn://10.0.0.236/trunk@22858 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 05:48:21 +00:00
sdagley%netscape.com
41a3b015d5 Fix bug #3405. Thanks to sfraser's research we discovered that there was a nasty problem caused by mactime.c including xp_mcom.h (added by brade on 3/3) causing ctime to be redefined as macctime. This is bad since macctime calls ctime (can you say recursion, recusrion, recusrsion...). Fix was to add an #undef for ctime after including xp_mcom.h and sacrificing a purple dinosaur.
git-svn-id: svn://10.0.0.236/trunk@22857 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 05:39:20 +00:00
rjc%netscape.com
ab4a1fe960 Fix bug 3401: aliases to shared libraries which auto-register need to be placed inside of a "components" directory (which itself needs to exist in the same directory as apprunner/viewer). Review/approval: sdagley
git-svn-id: svn://10.0.0.236/trunk@22856 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 05:09:04 +00:00
mcafee%netscape.com
ee18b1bc83 Uninitialized variables
git-svn-id: svn://10.0.0.236/trunk@22855 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:40:14 +00:00
kipp%netscape.com
00c7d42996 Use proper new/delete operators
git-svn-id: svn://10.0.0.236/trunk@22854 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:36:00 +00:00
kipp%netscape.com
54765b7652 Stop linking with other libraries to avoid finding symbols with dlsym that we don't want to find
git-svn-id: svn://10.0.0.236/trunk@22853 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:35:49 +00:00
kipp%netscape.com
fb97ac8491 Clean up query-interface; attempt to work around bug (failed; left some commentary in to help the netlib crew)
git-svn-id: svn://10.0.0.236/trunk@22852 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:35:37 +00:00
kipp%netscape.com
b76038d16c Use proper new operator
git-svn-id: svn://10.0.0.236/trunk@22851 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:33:57 +00:00
kipp%netscape.com
f73b4b8971 use new nsHTMLReflowState ctors
git-svn-id: svn://10.0.0.236/trunk@22850 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:29:11 +00:00
kipp%netscape.com
001a19082a Eliminate some compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22849 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:28:54 +00:00
kipp%netscape.com
c9fd8c7538 Output rects in twips; eliminated some typo bugs with selection directions
git-svn-id: svn://10.0.0.236/trunk@22848 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:28:40 +00:00
kipp%netscape.com
399ce5dd64 use new nsHTMLReflowState ctors; made pages support IsPercentageBase
git-svn-id: svn://10.0.0.236/trunk@22847 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:28:07 +00:00
kipp%netscape.com
3a72fd18c3 Output rects in twips
git-svn-id: svn://10.0.0.236/trunk@22846 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:26:40 +00:00
kipp%netscape.com
65edef0640 Refactored code to make effecient use of computed state in nsHTMLReflowState
git-svn-id: svn://10.0.0.236/trunk@22845 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:26:21 +00:00
kipp%netscape.com
15c4920b73 use computed values from reflow state; made inline-reflow-state no longer isa html-reflow-state
git-svn-id: svn://10.0.0.236/trunk@22844 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:25:57 +00:00
kipp%netscape.com
f90b774ae9 Store more computed state; reformulated the constructors for nsHTMLReflowState
git-svn-id: svn://10.0.0.236/trunk@22843 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:25:25 +00:00
kipp%netscape.com
3bdcb1e967 Revised computations for blocks; store more computed values
git-svn-id: svn://10.0.0.236/trunk@22842 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:24:20 +00:00
kipp%netscape.com
44c66a325c Spanked almost away
git-svn-id: svn://10.0.0.236/trunk@22841 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:23:41 +00:00
kipp%netscape.com
bad84e485e Removed dead code; output rects naturally
git-svn-id: svn://10.0.0.236/trunk@22840 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:22:54 +00:00
kipp%netscape.com
e8c1baf1a5 Removed List method
git-svn-id: svn://10.0.0.236/trunk@22839 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:22:29 +00:00
kipp%netscape.com
4dfe8022be Minor tweaks to work better with computed values in html reflow state
git-svn-id: svn://10.0.0.236/trunk@22838 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:22:11 +00:00
kipp%netscape.com
bcf95a83f5 nsBlockReflowState no longer is-a nsHTMLReflowState; fixes to numerous bugs; reworked to use computed values from reflow-state
git-svn-id: svn://10.0.0.236/trunk@22837 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:21:32 +00:00
mcafee%netscape.com
2a7cf46dd3 Uninitialized variables
git-svn-id: svn://10.0.0.236/trunk@22836 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:20:54 +00:00
kipp%netscape.com
9c5a7c3cee Some asserts for me
git-svn-id: svn://10.0.0.236/trunk@22835 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:20:31 +00:00
kipp%netscape.com
e72cc15886 Support more css style for hr's; map align to auto margins
git-svn-id: svn://10.0.0.236/trunk@22834 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:20:07 +00:00
kipp%netscape.com
b4d19704fd use new nsHTMLReflowState ctors
git-svn-id: svn://10.0.0.236/trunk@22833 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:19:09 +00:00
kipp%netscape.com
6ef266bc6c Cleaned up margins hackery and made things use css instead of evil code in the block layout code
git-svn-id: svn://10.0.0.236/trunk@22832 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:18:58 +00:00
kipp%netscape.com
0b37e12e30 Removed constructors for nsReflowState
git-svn-id: svn://10.0.0.236/trunk@22831 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:17:00 +00:00
ftang%netscape.com
eb77f0eb37 add iso-8859-7 and windows-1253
git-svn-id: svn://10.0.0.236/trunk@22830 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 04:11:25 +00:00
bienvenu%netscape.com
a488d0f3fc add factory method, remove oid parameter to match real mdb
git-svn-id: svn://10.0.0.236/trunk@22829 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 03:29:41 +00:00
bienvenu%netscape.com
65d1575b3b try to fix time stamp and stat routines so we can re-open existing db's
git-svn-id: svn://10.0.0.236/trunk@22828 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 03:28:34 +00:00
bienvenu%netscape.com
ee28f1915e add rdf to the stupid mailbox parsing test app
git-svn-id: svn://10.0.0.236/trunk@22827 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 03:25:51 +00:00
rjc%netscape.com
108021ada8 Changes to autoregister the file system datasource (broken due to Warren's earlier changes.)
git-svn-id: svn://10.0.0.236/trunk@22826 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 03:22:51 +00:00
bienvenu%netscape.com
fe85c4dab4 add morkConfig to makefile
git-svn-id: svn://10.0.0.236/trunk@22825 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 02:49:36 +00:00
pavlov%pavlov.net
229469c47e start fixing file selector, fix menus under apprunner, fix font setting for
widgets.


git-svn-id: svn://10.0.0.236/trunk@22824 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 02:48:43 +00:00
slamm%netscape.com
4b94d0dfe4 Speed it up right.
git-svn-id: svn://10.0.0.236/trunk@22823 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:57:13 +00:00
cmanske%netscape.com
1d5ae5c42a This fixes build bustage if you are using nglayout.mak (editor must be built after htmlparser)
git-svn-id: svn://10.0.0.236/trunk@22822 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:54:22 +00:00
edwin%woudt.nl
97812d1705 The last step in updating the docs.
git-svn-id: svn://10.0.0.236/trunk@22821 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:48:15 +00:00
michaelp%netscape.com
3b152094ca added return code check WRT off screen surface allocation.
part of mac fixes.


git-svn-id: svn://10.0.0.236/trunk@22820 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:43:06 +00:00
slamm%netscape.com
6c1bce143c Uhoh, change wasn't ready for prime-time. backout.
git-svn-id: svn://10.0.0.236/trunk@22819 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:33:38 +00:00
edwin%woudt.nl
ee4e4ad487 Updated build docs
git-svn-id: svn://10.0.0.236/trunk@22818 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:26:30 +00:00
slamm%netscape.com
e702ebfd8d Speed up data reading. Read it backwards and only as much as needed.
git-svn-id: svn://10.0.0.236/trunk@22817 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:25:23 +00:00
edwin%woudt.nl
ba1c568fb4 Updated lib dependencies
git-svn-id: svn://10.0.0.236/trunk@22816 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:18:23 +00:00
slamm%netscape.com
44504c8755 Stick /opt/cvs-tools/bin on the path for cvs on cvs-mirror.
git-svn-id: svn://10.0.0.236/trunk@22815 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 01:03:33 +00:00
slamm%netscape.com
f53189a4ae add a comment
git-svn-id: svn://10.0.0.236/trunk@22814 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:48:35 +00:00
slamm%netscape.com
b36d37e499 Try to create a subdir.
git-svn-id: svn://10.0.0.236/trunk@22813 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:44:17 +00:00
despotdaemon%netscape.com
6d014280f1 Pseudo-automatic update of changes made by sgehani@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@22812 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:33:08 +00:00
hyatt%netscape.com
b528dce697 Adding XUL attributes to the project.
git-svn-id: svn://10.0.0.236/trunk@22811 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:32:18 +00:00
slamm%netscape.com
27a6125dd9 Need a cvs login for checking out configure.in
git-svn-id: svn://10.0.0.236/trunk@22810 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:23:57 +00:00
hyatt%netscape.com
15eb16c4b7 Fix for the Mac crash.
git-svn-id: svn://10.0.0.236/trunk@22809 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:20:10 +00:00
hyatt%netscape.com
79d6609992 Fixes to layout to allow nsHTMLCSSStyleSheet to be instantiable from outside
the layout DLL.


git-svn-id: svn://10.0.0.236/trunk@22808 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:06:31 +00:00
edwin%woudt.nl
8708ff3f6a Backed out mauros changes until they get fixed.
git-svn-id: svn://10.0.0.236/trunk@22807 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:04:48 +00:00
hyatt%netscape.com
68339f3d58 Fix to allow nsHTMLCSSStyleSheet to be instantiable.
git-svn-id: svn://10.0.0.236/trunk@22806 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:04:04 +00:00
hyatt%netscape.com
c5fb807561 Fix to the RFind method of nsString.
git-svn-id: svn://10.0.0.236/trunk@22805 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:03:46 +00:00
hyatt%netscape.com
b67c7ebb6b Fixing the split of the attribute name (into a URI and an ID).
git-svn-id: svn://10.0.0.236/trunk@22804 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:03:30 +00:00
hyatt%netscape.com
571769ba85 Changes to the content sink to make sure attributes are not converted to lower case
and to make sure attributes are put into the correct namespace.


git-svn-id: svn://10.0.0.236/trunk@22803 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:02:33 +00:00
hyatt%netscape.com
1db9fb2927 Regenerated the IDL for the XUlDocument. Changed getElementById to return
an element (and to have a lowercase d) for consistency with the HTML document
method of the same name.


git-svn-id: svn://10.0.0.236/trunk@22802 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:02:00 +00:00
hyatt%netscape.com
29dfb19d4e Many bug fixes to the RDF content model including namespace changes and
style support.


git-svn-id: svn://10.0.0.236/trunk@22801 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:01:26 +00:00
hyatt%netscape.com
d37bec4951 Modified the makefiles to handle the new XUL attribute class.
git-svn-id: svn://10.0.0.236/trunk@22800 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:00:56 +00:00
hyatt%netscape.com
a8fd6e7560 Committing the new attribute class for the handling of XUL attributes.
git-svn-id: svn://10.0.0.236/trunk@22799 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-05 00:00:40 +00:00
hyatt%netscape.com
37b30b463e generic attribute is going away in favor of a XUL-specific attribute class.
git-svn-id: svn://10.0.0.236/trunk@22798 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 23:59:57 +00:00
slamm%netscape.com
f54f68aef9 Pull configure.in in subdir, configure-mirror.
git-svn-id: svn://10.0.0.236/trunk@22797 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 23:53:38 +00:00
despotdaemon%netscape.com
7dbb8763e1 Pseudo-automatic update of changes made by terry@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@22796 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 23:49:05 +00:00
kin%netscape.com
1caf25fce0 Fix win32 build bustage. The editor directory is now built after the htmlparser directory.
git-svn-id: svn://10.0.0.236/trunk@22795 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 23:43:23 +00:00
slamm%netscape.com
4aed7b0f83 Retire the old 'express' code. Also reduce the default hours from 36 down to 12.
git-svn-id: svn://10.0.0.236/trunk@22794 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 23:41:02 +00:00
evaughan%netscape.com
45aec1474e Fixed a bug that caused TitledButtons and ProgressMeters to be skews when made inline.
git-svn-id: svn://10.0.0.236/trunk@22793 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 23:39:06 +00:00
evaughan%netscape.com
86a935fe8b Fixed buttons in apprunner so there borders appear when moved over.
git-svn-id: svn://10.0.0.236/trunk@22792 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 23:36:12 +00:00
edwin%woudt.nl
60335641a1 A few weeks earlier I fixed a bug that the whole class was synchronized. I just removed it. A few methods however should have been synchronized instead. I've done that now.
git-svn-id: svn://10.0.0.236/trunk@22791 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 22:31:34 +00:00
briano%netscape.com
b391febd29 Automated update
git-svn-id: svn://10.0.0.236/trunk@22790 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 22:30:40 +00:00
scc%netscape.com
2f7394142e make HAVE_CPP_NEW_CASTS stronger for bug in Solaris/CC
git-svn-id: svn://10.0.0.236/trunk@22789 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 22:22:14 +00:00
akkana%netscape.com
a535f86c0d Add displaytext/displayhtml to gtk menu. This is part of kostello's change, approved by sar
git-svn-id: svn://10.0.0.236/trunk@22788 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:59:13 +00:00
sfraser%netscape.com
da5c3ac0d9 Project change for kostello, approved sar. New link dependency on htmlParser.shlb
git-svn-id: svn://10.0.0.236/trunk@22787 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:57:59 +00:00
sfraser%netscape.com
40ba827e51 Project checkin for kostello, approved sar. Added nsHTMLToTXTSinkStream.cpp.
git-svn-id: svn://10.0.0.236/trunk@22786 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:55:26 +00:00
kostello%netscape.com
575a96dca1 Added Implementations for OutputHTML and OutputTXT
git-svn-id: svn://10.0.0.236/trunk@22785 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:53:42 +00:00
kostello%netscape.com
1d257371a8 Added new sink that outputs a Text stream instead of
an HTML stream.


git-svn-id: svn://10.0.0.236/trunk@22784 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:52:57 +00:00
despotdaemon%netscape.com
825e4caa13 Pseudo-automatic update of changes made by sgehani@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@22783 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:52:21 +00:00
despotdaemon%netscape.com
570e36e2b8 Pseudo-automatic update of changes made by terry@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@22782 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:50:49 +00:00
kostello%netscape.com
a484974367 Added Debug Output HTML and Debug Output Text
Note: these only work in editor mode.


git-svn-id: svn://10.0.0.236/trunk@22781 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:50:44 +00:00
slamm%netscape.com
820d265112 Add 'express_fast' which is a much faster than 'express'. Uses Backwards.pm. This will probably replace 'express'.
git-svn-id: svn://10.0.0.236/trunk@22780 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:46:07 +00:00
despotdaemon%netscape.com
b13907ba45 Pseudo-automatic update of changes made by sgehani@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@22779 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 21:27:13 +00:00
terry%netscape.com
de0928b4a1 Added "Grendel".
git-svn-id: svn://10.0.0.236/trunk@22778 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 20:37:25 +00:00
mscott%netscape.com
45559f72cb Don't add a null urllistener...
git-svn-id: svn://10.0.0.236/trunk@22777 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 20:10:20 +00:00
despotdaemon%netscape.com
35a6891c11 Pseudo-automatic update of changes made by terry@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@22776 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 20:07:22 +00:00
ducarroz%netscape.com
e389dcf261 no comment
git-svn-id: svn://10.0.0.236/trunk@22775 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 19:43:28 +00:00
ducarroz%netscape.com
4b14c18672 Add the function NewMessage to popup the compose window.
git-svn-id: svn://10.0.0.236/trunk@22774 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 19:33:55 +00:00
gordon%netscape.com
56df6d033f Bug fix for #3410 & #3403 by Simon Fraser, reviewed by Gordon Sheridan. Stop leaking UPPs everytime we do a file read.
git-svn-id: svn://10.0.0.236/trunk@22773 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 19:27:19 +00:00
fur%netscape.com
48762f0205 Add Object.registerNatives() dummy stub.
git-svn-id: svn://10.0.0.236/trunk@22772 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 19:17:24 +00:00
fur%netscape.com
15fdcab054 Artur Biasiaodowski's patch so that instruction immediates print out correctly.
git-svn-id: svn://10.0.0.236/trunk@22771 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 19:06:31 +00:00
bienvenu%netscape.com
aed8a4d01f add a couple cursors
git-svn-id: svn://10.0.0.236/trunk@22770 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 15:58:52 +00:00
putterman%netscape.com
396c97c1be Need to register the datasource.
git-svn-id: svn://10.0.0.236/trunk@22769 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 05:24:12 +00:00
briano%netscape.com
ea7eb46d00 Patched for QNX by Jerry.Kirk@Nexwarecorp.com.
git-svn-id: svn://10.0.0.236/trunk@22768 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 05:10:45 +00:00
putterman%netscape.com
606cc3c5ed changed id to rdf:id
git-svn-id: svn://10.0.0.236/trunk@22767 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 05:03:32 +00:00
briano%netscape.com
68f6e9c649 Minor change to make it acceptable to QNX.
git-svn-id: svn://10.0.0.236/trunk@22766 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 05:02:09 +00:00
talisman%anamorphic.com
07d8ae14ef Added by Mauro Botelho - we are now building addressbook gui from xml.
git-svn-id: svn://10.0.0.236/trunk@22765 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 04:14:09 +00:00
talisman%anamorphic.com
336e3f2ec9 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@22764 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 04:13:07 +00:00
alecf%netscape.com
c4f27f980d remove FE_Alert to remove dependancy on netlib
git-svn-id: svn://10.0.0.236/trunk@22763 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 03:11:59 +00:00
slamm%netscape.com
1f2bcbebf5 Add ability to reread options. Still need to modify a few of them (nspr, with pthreads, debug, checkout options) before anyone uses this feature.
git-svn-id: svn://10.0.0.236/trunk@22762 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 03:07:50 +00:00
rjc%netscape.com
b668b7ec9b Now store pathnames as strings which prevents nr_MacAliasFromPath() from ever being called (it was being passed a Unix path when it really wanted a Mac path anyway). Also, autoregistration now looks inside the "components" directory (which is in the same folder as the program.) Also, bumped up registry version # due to change. Also, at startup, when building up list of arguments, check argv[0] against NULL as it might be (on the Mac).
git-svn-id: svn://10.0.0.236/trunk@22761 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 03:01:33 +00:00
mscott%netscape.com
3b3c01c8bc Changes for naoki to implement SetDocumentCharset.
git-svn-id: svn://10.0.0.236/trunk@22760 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 02:02:12 +00:00
briano%netscape.com
cf07d498ba Now it'll be able to capture all of CVS's output instead of just stdout.
git-svn-id: svn://10.0.0.236/trunk@22759 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 01:53:23 +00:00
alecf%netscape.com
eaf4267034 make this test compile on unix
git-svn-id: svn://10.0.0.236/trunk@22758 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 01:40:40 +00:00
alecf%netscape.com
cb9b4dedc6 forgot to include nsUInt32Array.cpp in this library!
git-svn-id: svn://10.0.0.236/trunk@22757 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 01:40:03 +00:00
alecf%netscape.com
ada6d5ba21 fully resolve all symbols and make the base mailnews library a component
git-svn-id: svn://10.0.0.236/trunk@22756 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 01:39:36 +00:00
alecf%netscape.com
2fb77ae582 only build tests when ENABLE_TESTS (i.e. --enable-tests) is turned on
git-svn-id: svn://10.0.0.236/trunk@22755 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 01:36:25 +00:00
terry%netscape.com
530633b1ad "regenerate" was busted.
git-svn-id: svn://10.0.0.236/trunk@22754 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 01:22:27 +00:00
terry%netscape.com
348f970a15 Do the grand component/product renaming.
git-svn-id: svn://10.0.0.236/trunk@22753 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 01:12:31 +00:00
mscott%netscape.com
cb4aefdcb9 part of scc's merge: change interface calls to IID() to GetIID().
git-svn-id: svn://10.0.0.236/trunk@22752 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 00:57:51 +00:00
mscott%netscape.com
4376db8133 part of scc's merge: change IID() calls to GetIID().
git-svn-id: svn://10.0.0.236/trunk@22751 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-04 00:44:05 +00:00
scc%netscape.com
033c58f132 rename |IID()| --> |GetIID()|
git-svn-id: svn://10.0.0.236/trunk@22750 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 23:03:34 +00:00
terry%netscape.com
04e2508b2a Added a "component/product" sanity check.
git-svn-id: svn://10.0.0.236/trunk@22749 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 22:55:36 +00:00
mscott%netscape.com
37569d2d56 attribute name space changes.
git-svn-id: svn://10.0.0.236/trunk@22748 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 21:59:04 +00:00
mscott%netscape.com
0d254799fe attribute name space changes. Spell start up correctly.
git-svn-id: svn://10.0.0.236/trunk@22747 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 21:56:48 +00:00
terry%netscape.com
4240a2d4ca Oops; forgot description for "Apprunner".
git-svn-id: svn://10.0.0.236/trunk@22746 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 21:21:31 +00:00
terry%netscape.com
51e61e5d03 Added "Apprunner".
git-svn-id: svn://10.0.0.236/trunk@22745 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 21:19:33 +00:00
scc%netscape.com
817f56596f rename |IID()| --> |GetIID()|
git-svn-id: svn://10.0.0.236/trunk@22744 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 19:48:57 +00:00
mscott%netscape.com
c09668ebed Fix build breakage by defining SetDocumentCharSet which was added to nsIDOMAppCore.
git-svn-id: svn://10.0.0.236/trunk@22743 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 18:47:16 +00:00
mscott%netscape.com
64dd7f377a Fix build breakage by adding SetDocumentCharset function which was added to nIDOMMsgAppCore.
git-svn-id: svn://10.0.0.236/trunk@22742 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 18:44:12 +00:00
buster%netscape.com
8ee6a7d6a6 added editor module (#define NS_ERROR_MODULE_EDITOR )
git-svn-id: svn://10.0.0.236/trunk@22741 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 18:30:09 +00:00
terry%netscape.com
d5426845f8 Added a "disallownew" field to the products table. If non-zero, then
don't let people file new bugs against this product.  (This is for when a
product is retired, but you want to keep the bug reports around for posterity.)


git-svn-id: svn://10.0.0.236/trunk@22740 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 18:16:24 +00:00
mscott%netscape.com
5bd6463a64 Updates to restore commands by changing Onclick to onclick. Also fixed the syntax error in the openURL call that was preventing the LoadMsg button from working.
git-svn-id: svn://10.0.0.236/trunk@22739 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 18:11:53 +00:00
alecf%netscape.com
4efe12e3f7 onClick -> onclick
git-svn-id: svn://10.0.0.236/trunk@22738 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 17:48:34 +00:00
pinkerton%netscape.com
a60bed6b62 don't look in xul namespace for "src" attribute. Images show up again. permission to checkin to closed tree by sar.
git-svn-id: svn://10.0.0.236/trunk@22737 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 17:28:27 +00:00
val4%cornell.edu
b9e50b7bfe Suport module for jsperl.c. It's not intended for use from Perl.
git-svn-id: svn://10.0.0.236/trunk@22736 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 16:42:57 +00:00
troy%netscape.com
2c9f8c326c Work-in-progress for table pagination
git-svn-id: svn://10.0.0.236/trunk@22735 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 16:33:57 +00:00
dcone%netscape.com
583e3dd616 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@22734 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 15:46:43 +00:00
brade%netscape.com
9a1dd1f7df add static to ConsumeConditional to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22733 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 15:37:27 +00:00
brade%netscape.com
65a77a958a add static to two functions and a compare to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22732 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 15:36:42 +00:00
brade%netscape.com
3df52d033c reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22731 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 15:35:49 +00:00
brade%netscape.com
5ac6f5b4a8 remove unused local variable in #ifdef XP_MAC section
git-svn-id: svn://10.0.0.236/trunk@22730 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 15:29:56 +00:00
brade%netscape.com
8cab29de0c add static to 2 functions to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22729 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 15:28:43 +00:00
rods%netscape.com
8ab43c6e54 Added static IID() method
git-svn-id: svn://10.0.0.236/trunk@22728 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 15:17:33 +00:00
brade%netscape.com
f51a003d2b add static to 2 functions to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22727 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:54:48 +00:00
brade%netscape.com
501edd5e13 add static to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22726 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:54:20 +00:00
brade%netscape.com
b48a462046 add "static" to HandleRobotEvent and HandleSiteEvent to reduce compiler warnings on Macintosh
git-svn-id: svn://10.0.0.236/trunk@22725 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:53:39 +00:00
brade%netscape.com
115b5fd0fb reduce compiler warnings on Macintosh by adding comparison in loop (around assignments)
git-svn-id: svn://10.0.0.236/trunk@22724 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:50:41 +00:00
brade%netscape.com
4aa447a575 add static to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22723 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:47:48 +00:00
brade%netscape.com
a97cdf9aba add curly braces to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22722 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:47:18 +00:00
brade%netscape.com
3eb66d6cd6 add static to 4 functions to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22721 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:44:02 +00:00
brade%netscape.com
95d563e707 add static to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22720 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:37:04 +00:00
brade%netscape.com
129375e2ec *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@22719 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:35:06 +00:00
brade%netscape.com
bf6e876ffb reduce compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22718 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 14:31:00 +00:00
ramiro%netscape.com
bd55e1a422 Unhardcode nspr libs.
git-svn-id: svn://10.0.0.236/trunk@22717 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 13:35:52 +00:00
edwin%woudt.nl
b8371710b9 Patch from Morgan Schweers <morgan@vixen.com> to directly edit the From: header in the composition window. We need to add an advanced configuration option to turn this on, because otherwise not-so-clueful users might make mistakes. It'll stay here for now
git-svn-id: svn://10.0.0.236/trunk@22716 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 11:18:50 +00:00
edwin%woudt.nl
64e95c338b We don't want to send the whole path, just the filename.
git-svn-id: svn://10.0.0.236/trunk@22715 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 11:01:22 +00:00
edwin%woudt.nl
6ee1a4f682 For adding attachments a swing JFileChooser is now displayed instead of the AWT FileDialog
git-svn-id: svn://10.0.0.236/trunk@22714 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 10:47:40 +00:00
edwin%woudt.nl
33ab54f1dc Patches from Thomas Down <thomas.down@tri.ox.ac.uk> for better attachment sending handling.
git-svn-id: svn://10.0.0.236/trunk@22713 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 10:46:57 +00:00
edwin%woudt.nl
fe009e1c51 Moving Constants from grendel.storage to grendel.util. Also a little bit of cleaning up on this subject.
git-svn-id: svn://10.0.0.236/trunk@22712 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 10:10:23 +00:00
edwin%woudt.nl
fcf0c79e84 Message deletion works
git-svn-id: svn://10.0.0.236/trunk@22711 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 10:03:06 +00:00
mcafee%netscape.com
df71a67b17 Removing tests that link with components, we need to dlopen() these libraries and not link with them.
git-svn-id: svn://10.0.0.236/trunk@22710 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 09:17:32 +00:00
pierre%netscape.com
37d4d179e6 fix last part of #2336 "Miscellaneous cosmetic problems with scrollbars"
git-svn-id: svn://10.0.0.236/trunk@22709 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 09:05:50 +00:00
pierre%netscape.com
95a3f47239 fix funny button hilites that happened when moving quickly the mouse after doing a dragWindow
git-svn-id: svn://10.0.0.236/trunk@22708 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 09:04:42 +00:00
pierre%netscape.com
72f155cfdc fix #3358 "Missed mouse up events cause chaos"
fix double-clicks in buttons


git-svn-id: svn://10.0.0.236/trunk@22707 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 09:02:54 +00:00
pierre%netscape.com
70413d9059 fix #3358 "Missed mouse up events cause chaos"
git-svn-id: svn://10.0.0.236/trunk@22706 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 09:01:58 +00:00
pierre%netscape.com
c5ce5f5263 updated some comments about nsIWindow
git-svn-id: svn://10.0.0.236/trunk@22705 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 09:00:44 +00:00
rickg%netscape.com
6bea38145b ifdef expat until more testing can be done
git-svn-id: svn://10.0.0.236/trunk@22704 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 08:55:23 +00:00
rickg%netscape.com
26bb7f0161 enabled expat in parsing engine
git-svn-id: svn://10.0.0.236/trunk@22703 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 08:34:23 +00:00
waterson%netscape.com
d97c4079fb Cleaned up OnSetAttribute() and OnRemoveAttribute() to only listen on elements in the tree. Special-cased the 'open' attribute on a xul:treeitem to construct and destroy treechildren as its value is set and unset.
git-svn-id: svn://10.0.0.236/trunk@22702 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 08:10:20 +00:00
waterson%netscape.com
88fe4eb36c Cleaned up OnSetAttribute() and OnRemoveAttribute() to only listen on elements in the XUL document. Renamed the 'contentsgenerated' attribute to 'xulcontentsgenerated' to differentiate from the tree builder's stuff. Made this actually work.
git-svn-id: svn://10.0.0.236/trunk@22701 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 08:09:21 +00:00
waterson%netscape.com
0de97e73ef Removed tree-specific open and close code. This is now in the nsRDFTreeBuilder, where it belongs.
git-svn-id: svn://10.0.0.236/trunk@22700 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 08:07:10 +00:00
waterson%netscape.com
e26551151b Modified tree double-click handler to use DOM APIs instead of nsIContent.
git-svn-id: svn://10.0.0.236/trunk@22699 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 08:05:32 +00:00
beard%netscape.com
9947d53238 struct -> class
git-svn-id: svn://10.0.0.236/trunk@22698 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 06:10:58 +00:00
rhp%netscape.com
5043661316 More cleanup for stream conveter interface.
git-svn-id: svn://10.0.0.236/trunk@22697 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 05:58:00 +00:00
rhp%netscape.com
f4a97dd7af Changes for new XP-COM interface for stream converters.
git-svn-id: svn://10.0.0.236/trunk@22696 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 05:45:55 +00:00
rhp%netscape.com
62ba78eb1d New files for XP-COM stream converter interface.
git-svn-id: svn://10.0.0.236/trunk@22695 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 05:36:20 +00:00
bienvenu%netscape.com
c41d98b442 fix build bustage courtesy of the nsCOMPtr team
git-svn-id: svn://10.0.0.236/trunk@22694 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 05:13:21 +00:00
beard%netscape.com
a1c27dc778 resolving aliases.
git-svn-id: svn://10.0.0.236/trunk@22693 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 04:11:15 +00:00
beard%netscape.com
6ef5b7280e rewrote SetUpPluginInstance to use GetPluginFactory.
git-svn-id: svn://10.0.0.236/trunk@22692 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 04:10:54 +00:00
beard%netscape.com
320d4de322 moved NS_CALLBACK to nsCom.h.
git-svn-id: svn://10.0.0.236/trunk@22691 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 04:09:33 +00:00
beard%netscape.com
7b32613a59 Added NS_CALLBACK macro for standard callback APIs
git-svn-id: svn://10.0.0.236/trunk@22690 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 04:09:11 +00:00
evaughan%netscape.com
c0c44744db Fixed mac event bug.
Fixed alignment bug.


git-svn-id: svn://10.0.0.236/trunk@22689 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 04:04:48 +00:00
waterson%netscape.com
dd3eeaa644 Added mozilla/rdf/base/idl so Makefile is generated. This is not otherwise in the build.
git-svn-id: svn://10.0.0.236/trunk@22688 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 03:30:17 +00:00
waterson%netscape.com
73584bff5f Initial revision: all of the IDL files globbed together.
git-svn-id: svn://10.0.0.236/trunk@22687 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 03:29:37 +00:00
waterson%netscape.com
82e63ea07a Fixed use of Object, which is apparently a keyword.
git-svn-id: svn://10.0.0.236/trunk@22686 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 03:29:13 +00:00
mscott%netscape.com
40e81c3ce8 Remove nsIsmgSend->Test() call.
git-svn-id: svn://10.0.0.236/trunk@22685 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 03:27:31 +00:00
bienvenu%netscape.com
c6bf3f0b96 latest drop of mork files
git-svn-id: svn://10.0.0.236/trunk@22684 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 03:15:45 +00:00
hyatt%netscape.com
c3752a8df8 Fix to the ContentInserted function (ifdef XUL only) for treechildren.
git-svn-id: svn://10.0.0.236/trunk@22683 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 03:11:55 +00:00
pollmann%netscape.com
6385ee828c Handle readonly changes for TextAreas as well as Text Inputs.
git-svn-id: svn://10.0.0.236/trunk@22682 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 03:06:36 +00:00
pollmann%netscape.com
4642b85847 Give nsTextControlFrame a notification when readonly on a TextArea is changed.
git-svn-id: svn://10.0.0.236/trunk@22681 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 03:05:31 +00:00
pollmann%netscape.com
7692e0c4c1 Fix bug #3375 and #3368: Allow hidden inputs and password inputs to store values.
git-svn-id: svn://10.0.0.236/trunk@22680 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 02:54:25 +00:00
nisheeth%netscape.com
8ce7dc3e65 We've decided to do away with the notion of an nsExpatDTD. The expat tokenizer which encapsulates the expat parser will be driven by nsWellFormedDTD. So, nsExpatTokenizer has changed accordingly. nsWellFormedDTD() creates an nsExpatTokenizer if EXPAT is #define'd; otherwise it creates the old nsXMLTokenizer. nsParser no longer registers and createsthe nsExpatDTD.
git-svn-id: svn://10.0.0.236/trunk@22679 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 02:34:18 +00:00
dp%netscape.com
787945c1bd Forcing registry upgrade to alpha0.30 due to autoreg beginning at ./components instead of ./
git-svn-id: svn://10.0.0.236/trunk@22678 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 02:17:57 +00:00
mscott%netscape.com
92d7fc1050 Fix build breakage. Seems like none of these interfaces implement a Test() method...
git-svn-id: svn://10.0.0.236/trunk@22677 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 02:03:48 +00:00
joki%netscape.com
c41dbba1c6 Fix for frames not resizing.
git-svn-id: svn://10.0.0.236/trunk@22676 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:59:50 +00:00
nisheeth%netscape.com
614b3fd83c We've decided to do away with the notion of an nsExpatDTD. The expat tokenizer which encapsulates the expat parser will be driven by nsWellFormedDTD. So, I'm removing the code that constructed an expat DTD for controlling the parsing of an XML document.
git-svn-id: svn://10.0.0.236/trunk@22675 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:57:03 +00:00
mjudge%netscape.com
86f2920385 fixes for selection code, batching at correct point
git-svn-id: svn://10.0.0.236/trunk@22674 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:51:59 +00:00
mjudge%netscape.com
4bb2e93aeb updates and fixes for CTRL left arrow and right arrow. also fixes for releasing the presshell correctly. the selection code was leaking it. updates for PREV and NEXT in nsFrameTraversal
git-svn-id: svn://10.0.0.236/trunk@22673 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:51:21 +00:00
hyatt%netscape.com
35f4281b4d More fixes to make sure the right attribute namespace is being used.
git-svn-id: svn://10.0.0.236/trunk@22672 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:38:32 +00:00
mscott%netscape.com
71ce6f1280 url listener update.
git-svn-id: svn://10.0.0.236/trunk@22671 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:32:10 +00:00
mscott%netscape.com
bdd7ff4c36 Remove RegisterFactory call for an rfc822 parser. this is done during the self register phase of the msgcore dll.
git-svn-id: svn://10.0.0.236/trunk@22670 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:31:28 +00:00
mscott%netscape.com
254261aa33 Update smtp test to register itself as a url listener on the current smtp url being run.
git-svn-id: svn://10.0.0.236/trunk@22669 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:27:11 +00:00
hyatt%netscape.com
90b4ba1563 Fixes so that attributes are set correctly.
git-svn-id: svn://10.0.0.236/trunk@22668 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:26:33 +00:00
mscott%netscape.com
5d70853340 Don't rely on msgcore.lib, use the dll instead....
git-svn-id: svn://10.0.0.236/trunk@22667 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:25:49 +00:00
dp%netscape.com
2cce57d913 Installing loadable components in components/ directory
git-svn-id: svn://10.0.0.236/trunk@22666 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:25:21 +00:00
mscott%netscape.com
9fb4f82661 asking the smtp service to send a message requires you to pass in a url listener (which can be nsnull if you don't care).
git-svn-id: svn://10.0.0.236/trunk@22665 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:24:56 +00:00
bienvenu%netscape.com
231ebbbf1a make sure message key gets set correctly
git-svn-id: svn://10.0.0.236/trunk@22664 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:22:49 +00:00
mscott%netscape.com
e7b00ca17e Pass in a url listener to send message.
git-svn-id: svn://10.0.0.236/trunk@22663 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:22:20 +00:00
briano%netscape.com
46acc683f2 Major housecleaning, and a hack to allow me to build on Solaris using Workshop.
git-svn-id: svn://10.0.0.236/trunk@22662 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:21:42 +00:00
mscott%netscape.com
1042739ca9 Update to latest version of nsIMsgMailNewsUrl which includes url listener registration and notification stuff.
git-svn-id: svn://10.0.0.236/trunk@22661 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:21:38 +00:00
nhotta%netscape.com
9d42323693 Reformat code for MIME encoder, otherwise unreadable.
git-svn-id: svn://10.0.0.236/trunk@22660 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:20:22 +00:00
mscott%netscape.com
32e276e2af Update to take a url listener when sending a message.
git-svn-id: svn://10.0.0.236/trunk@22659 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:19:50 +00:00
waterson%netscape.com
73e6f37199 Initial revision. They don't work.
git-svn-id: svn://10.0.0.236/trunk@22658 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:19:11 +00:00
mscott%netscape.com
83539652d8 Changes to make the mailbox test driver a url listener on the currently loaded url. This allowed me to use the test driver for mailbox urls as a test for url listeners...
git-svn-id: svn://10.0.0.236/trunk@22657 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:18:18 +00:00
waterson%netscape.com
a1cd895bd4 Added ProgIDToCLSID cache.
git-svn-id: svn://10.0.0.236/trunk@22656 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:18:15 +00:00
hyatt%netscape.com
49fc7c85a3 Fixes to attributes so that they are properly added in with a namespace of
NONE.


git-svn-id: svn://10.0.0.236/trunk@22655 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:17:29 +00:00
mscott%netscape.com
cf21ad834f Update urlListener stuff.
git-svn-id: svn://10.0.0.236/trunk@22654 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:16:42 +00:00
mscott%netscape.com
e3367656c2 pass in urlListener as argument to parsing a mailbox.
git-svn-id: svn://10.0.0.236/trunk@22653 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:15:40 +00:00
mscott%netscape.com
8a0fa9b3cf Add url listener manager support to mailbox urls.
git-svn-id: svn://10.0.0.236/trunk@22652 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:14:45 +00:00
mscott%netscape.com
133e65fe26 When parsing a mailbox, allow the caller to pass in a url listener on the action....
git-svn-id: svn://10.0.0.236/trunk@22651 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:13:34 +00:00
mscott%netscape.com
4135eec9c9 Requires netlib.
git-svn-id: svn://10.0.0.236/trunk@22650 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:12:20 +00:00
mscott%netscape.com
0230d7ef17 Add code to register a url listener manager.
git-svn-id: svn://10.0.0.236/trunk@22649 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:11:53 +00:00
akkana%netscape.com
ad596eb161 Turn on blinking caret
git-svn-id: svn://10.0.0.236/trunk@22648 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:11:50 +00:00
akkana%netscape.com
08d2fe9b17 Fix Unix crash: comment out an assert
git-svn-id: svn://10.0.0.236/trunk@22647 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:11:28 +00:00
mscott%netscape.com
dafcb92bca Build nsUrlListenerManager.
git-svn-id: svn://10.0.0.236/trunk@22646 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:10:42 +00:00
mscott%netscape.com
695610eea1 Build the url listener manager.
git-svn-id: svn://10.0.0.236/trunk@22645 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:08:29 +00:00
mscott%netscape.com
0a1d781831 A generic url listener manager...
git-svn-id: svn://10.0.0.236/trunk@22644 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:07:55 +00:00
mscott%netscape.com
73b36312cb MailNews Urls now support url listeners. Add these new methods to the base url interface class.
git-svn-id: svn://10.0.0.236/trunk@22643 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:06:52 +00:00
mscott%netscape.com
fb502c1c77 Remove from directory...
git-svn-id: svn://10.0.0.236/trunk@22642 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:05:37 +00:00
mscott%netscape.com
f9aca39111 Export nsIUrlListener.h and nsIUrlListenerManager.h
git-svn-id: svn://10.0.0.236/trunk@22641 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:05:04 +00:00
mscott%netscape.com
216e25711a Export nsIListenerUrl.h and nsIUrlListenerManager.h
git-svn-id: svn://10.0.0.236/trunk@22640 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:03:27 +00:00
mscott%netscape.com
35b5fa40ce UrlListener interface and the interface for a generic url listener manager. Each of our url classes will have a url listener manager to handle the book keeping related to url listeners.
git-svn-id: svn://10.0.0.236/trunk@22639 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 01:02:53 +00:00
briano%netscape.com
6976369168 Automated update
git-svn-id: svn://10.0.0.236/trunk@22638 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 00:45:39 +00:00
karnaze%netscape.com
a726826198 improved <iframe> sizing to consider left, right, etc borders
git-svn-id: svn://10.0.0.236/trunk@22637 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 00:37:55 +00:00
alecf%netscape.com
b18062f12e start splitting nsISupports.h into multiple header files (blank right now until we get them into the Mac build)
git-svn-id: svn://10.0.0.236/trunk@22636 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 00:31:50 +00:00
briano%netscape.com
1d4497a497 Fix the SunOS4 shared lib linking problem. Probably ought to be done more elegantly, though....
git-svn-id: svn://10.0.0.236/trunk@22635 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 00:31:42 +00:00
slamm%netscape.com
7e51be6e16 still not working
git-svn-id: svn://10.0.0.236/trunk@22634 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-03 00:01:03 +00:00
mscott%netscape.com
ec6ceee69a Build mailbox test.
git-svn-id: svn://10.0.0.236/trunk@22633 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:56:27 +00:00
slamm%netscape.com
2a20d151e1 a little more
git-svn-id: svn://10.0.0.236/trunk@22632 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:56:12 +00:00
scc%netscape.com
e70b8e958a backed out depency on nscore.h
git-svn-id: svn://10.0.0.236/trunk@22631 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:52:38 +00:00
slamm%netscape.com
5f08e71779 try again
git-svn-id: svn://10.0.0.236/trunk@22630 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:47:31 +00:00
briano%netscape.com
09a337ad35 Automated update
git-svn-id: svn://10.0.0.236/trunk@22628 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:31:36 +00:00
brade%netscape.com
dc58e7d168 add static to GetTagName to reduce Macintosh compiler warnings
git-svn-id: svn://10.0.0.236/trunk@22626 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:28:04 +00:00
slamm%netscape.com
07f28f211e Change the order of --disable-build-xpfe and --disable-build-nspr
git-svn-id: svn://10.0.0.236/trunk@22625 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:25:29 +00:00
vidur%netscape.com
2041f859c6 Fixes to get CDATASections working again. Also changes to fix XML links.
git-svn-id: svn://10.0.0.236/trunk@22623 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:22:05 +00:00
vidur%netscape.com
e7ba5a8b0b Fix to get old XML parser to see CDATASections again
git-svn-id: svn://10.0.0.236/trunk@22622 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:20:45 +00:00
wtc%netscape.com
01ee68305f Undo the temporary "depend: clean" hack.
git-svn-id: svn://10.0.0.236/trunk@22621 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:19:01 +00:00
scc%netscape.com
ce584e3c02 now rely on "nscore.h" for NS_REINTERPRET_CAST instead of defining my own. now relying on autoconf system for all unixes. Some tests may need to be fixed.
git-svn-id: svn://10.0.0.236/trunk@22620 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:08:54 +00:00
val4%cornell.edu
90515a0a91 Fix a prolem with prev. check-in
git-svn-id: svn://10.0.0.236/trunk@22619 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:08:06 +00:00
scc%netscape.com
533c3d1f11 fix for nsCOMPtr: no direct construction/assignment from raw COM interface pointers
git-svn-id: svn://10.0.0.236/trunk@22618 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 23:00:09 +00:00
val4%cornell.edu
9684e39320 Divided JS.pm into two modules to break dependencies between jsperl.c support functions
and functions exporsed from Perl. test.pl fails one of the tests -- need to look at that.
Worspace  build settings also changed.


git-svn-id: svn://10.0.0.236/trunk@22617 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:53:16 +00:00
jband%netscape.com
8fda3403f8 nsID JSObject can now do mapping to and from interface names using nsIInterfaceInfoManager. Fixed a bug in getting name. Added nsID tests
git-svn-id: svn://10.0.0.236/trunk@22616 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:51:11 +00:00
scc%netscape.com
a6ad86bdb2 fix for nsCOMPtr: no construction/assignment from raw COM interface pointers
git-svn-id: svn://10.0.0.236/trunk@22615 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:44:55 +00:00
kmcclusk%netscape.com
4bd141876c gfx vs native widget rendering can now be specified in the viewer at run-time.
Added methods to GetWidgetRenderingMode and SetWidgetRenderingMode in nsPresContext
Removed NS_GFX_RENDER_FORM_ELEMENTS define, now it uses the GetWidgetRenderingMode
method on the rendering context.
Resurrected Rod's listbox frame-based widget code.
Added -moz-option-selected pseudo attribute to control the appearance of selected items for the listbox frame-based widget.
Added a style rule with attribute selector for -moz-option-selected to the ua.css style sheet.
Modifed nsView::SetVFlags to do a bitwise or instead of bitwise and to set flags.
Modified nsView::HandleEvent to compare mVFlags with NS_VIEW_FLAG_DONT_CHECK_CHILDREN


git-svn-id: svn://10.0.0.236/trunk@22614 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:43:26 +00:00
scc%netscape.com
8525928774 fixed for nsCOMPtr: no constructions assignments from raw COM interface pointers
git-svn-id: svn://10.0.0.236/trunk@22613 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:38:42 +00:00
beard%netscape.com
d264efb592 removed all vestiges of nsIMalloc.
git-svn-id: svn://10.0.0.236/trunk@22612 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:33:32 +00:00
beard%netscape.com
a9d898c78c made inheritance public.
git-svn-id: svn://10.0.0.236/trunk@22611 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:31:54 +00:00
beard%netscape.com
e53b867cea fix menu double dispatching
git-svn-id: svn://10.0.0.236/trunk@22610 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:30:02 +00:00
scc%netscape.com
84d4e393bc fixed for nsCOMPtr: no construction or assignment from raw COM interface pointers
git-svn-id: svn://10.0.0.236/trunk@22609 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:27:46 +00:00
wtc%netscape.com
cda9f78e88 Another update of the latest stuff from the internal CVS repository /m/src.
git-svn-id: svn://10.0.0.236/trunk@22608 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:23:14 +00:00
kmcclusk%netscape.com
f5e311af18 Added debug/style/widget render mode to the viewer menu in GTK. This allows
the viewer to set whether native or gfx-rendered widgets should be used.


git-svn-id: svn://10.0.0.236/trunk@22607 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 22:15:35 +00:00
despotdaemon%netscape.com
5816235d2a Pseudo-automatic update of changes made by val4@cornell.edu.
git-svn-id: svn://10.0.0.236/trunk@22606 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 21:32:53 +00:00
dougt%netscape.com
ca9ff84fe2 Added Unix makefiles (that really do not do anything)
Added Arguments and Jarfile variables to the Install object which
are now being reflected into js.
Fixed how ExtractJarFile in Install was working
Hooked up to libjar.

** These changes are not part of the Tinderbox builds **


git-svn-id: svn://10.0.0.236/trunk@22605 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 20:25:42 +00:00
mcafee%netscape.com
ccb66a01d5 mcom_db.h, cdefs.h also had copies over in mozilla/dbm/include, this was causing much confusion as you can imagine. I've merged changes over to the dbm versions and am retiring these files. r=pinkerton@netscape.com,leaf@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@22604 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:41:25 +00:00
despotdaemon%netscape.com
55d295b1ef Pseudo-automatic update of changes made by syd@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@22603 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:40:53 +00:00
leaf%mozilla.org
9f0b197029 Helping mcafee change the default location of cdefs.h and mcom_db.h
git-svn-id: svn://10.0.0.236/trunk@22602 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:37:15 +00:00
despotdaemon%netscape.com
1874aee396 Pseudo-automatic update of changes made by leaf@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@22601 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:27:01 +00:00
alecf%netscape.com
42f969b1e0 fix HPUX bustage - confused by too many similar constructors
git-svn-id: svn://10.0.0.236/trunk@22600 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:23:06 +00:00
joki%netscape.com
e62bbe65fe Adding new tab handling and focus support.
git-svn-id: svn://10.0.0.236/trunk@22599 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:19:24 +00:00
akkana%netscape.com
59406ac999 nsWindow.cpp didn't like the fcn name SelectionClear
git-svn-id: svn://10.0.0.236/trunk@22598 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:06:28 +00:00
joki%netscape.com
6e83286f60 Adding new interface for focusable content
git-svn-id: svn://10.0.0.236/trunk@22597 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:05:54 +00:00
pinkerton%netscape.com
62116e0985 add manifest for dbm/include
git-svn-id: svn://10.0.0.236/trunk@22596 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:02:28 +00:00
pinkerton%netscape.com
88055a803c remove duplicated files already in dbm
git-svn-id: svn://10.0.0.236/trunk@22595 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 19:01:56 +00:00
slamm%netscape.com
267f358295 Style changes.
git-svn-id: svn://10.0.0.236/trunk@22594 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:41:21 +00:00
ducarroz%netscape.com
78124a6bda clean up: change PR_MALLOC for PR_Malloc
git-svn-id: svn://10.0.0.236/trunk@22593 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:36:58 +00:00
ducarroz%netscape.com
2ab9da25ac sources clean up
git-svn-id: svn://10.0.0.236/trunk@22592 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:35:42 +00:00
putterman%netscape.com
dc666000f4 Add ".msf" to the list of files types we should ignore when building folders.
git-svn-id: svn://10.0.0.236/trunk@22591 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:32:39 +00:00
jband%netscape.com
6c33d541a1 fix misguided use of ebx in tests too
git-svn-id: svn://10.0.0.236/trunk@22590 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:31:25 +00:00
ftang%netscape.com
88f3ce7132 fix SmallCap to make it work for the whole range of unicode
git-svn-id: svn://10.0.0.236/trunk@22589 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:25:22 +00:00
ftang%netscape.com
48f5a3a3d8 add IsUpper and IsLower which work for all Unicode, reviewed and approved by kipp
git-svn-id: svn://10.0.0.236/trunk@22588 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:24:42 +00:00
jband%netscape.com
b59c75350a fixes to make it work in release builds: some #ifdef DEBUGs, don't munge ebx register on win32!, stray star, friendlier result if linux code included in non-Linux build
git-svn-id: svn://10.0.0.236/trunk@22587 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:24:17 +00:00
akkana%netscape.com
40a8bc718d Improvements in handling of the X selection, and some explanatory comments
git-svn-id: svn://10.0.0.236/trunk@22586 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 18:08:49 +00:00
nhotta%netscape.com
e99241e1d8 Added SetDocumentCharset.
git-svn-id: svn://10.0.0.236/trunk@22585 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:53:52 +00:00
nhotta%netscape.com
4e4a33af41 Added SetDocumentCharset.
git-svn-id: svn://10.0.0.236/trunk@22584 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:48:05 +00:00
rhp%netscape.com
3e62888ba3 Changes for new header conversion interfaces
git-svn-id: svn://10.0.0.236/trunk@22583 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:47:31 +00:00
terry%netscape.com
1c7a9c70cb Oops! Mispelled "petersen".
git-svn-id: svn://10.0.0.236/trunk@22582 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:45:23 +00:00
rhp%netscape.com
ca91c60636 Update for header defines
git-svn-id: svn://10.0.0.236/trunk@22581 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:43:02 +00:00
putterman%netscape.com
8640a14ce1 update to use RDF:containment tag. ThreadPane now loads from RDF.
Removed xul: from threadPane.


git-svn-id: svn://10.0.0.236/trunk@22580 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:21:11 +00:00
putterman%netscape.com
52e99acea6 Added ability to GetMessages from prepopulated database.
git-svn-id: svn://10.0.0.236/trunk@22579 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:17:53 +00:00
putterman%netscape.com
32d57dc133 Added temporary code for creating a URI and adding it to nsMsgHdr.
git-svn-id: svn://10.0.0.236/trunk@22578 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:17:00 +00:00
harishd%netscape.com
6b0ff9e89c We don't create a content node for <NOEMBED> tags.
Therefore, added kDiscardTag to noembed special properties bit.


git-svn-id: svn://10.0.0.236/trunk@22577 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:13:55 +00:00
harishd%netscape.com
33d3b8cb7f Included flag kLegalOpen which will be used later
in handling <BODY>, <SCRIPT>, and <TITLE> tags.


git-svn-id: svn://10.0.0.236/trunk@22576 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:13:18 +00:00
rhp%netscape.com
0bbbe6bed9 Changes for new XP-COM interface.
git-svn-id: svn://10.0.0.236/trunk@22575 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 17:06:48 +00:00
rhp%netscape.com
7aa66bf8b7 Change for interface
git-svn-id: svn://10.0.0.236/trunk@22574 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 16:57:16 +00:00
dcone%netscape.com
9d7acd41c1 Update some functions, and formating
git-svn-id: svn://10.0.0.236/trunk@22573 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 16:47:16 +00:00
rhp%netscape.com
d752c91db0 New interfaces to be exported.
git-svn-id: svn://10.0.0.236/trunk@22572 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 16:46:02 +00:00
rhp%netscape.com
f7c8fc398a Adding new header converter interface.
git-svn-id: svn://10.0.0.236/trunk@22570 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 16:10:28 +00:00
fur%netscape.com
98dc06cfc5 Eliminating New* files, which are old snapshots of other files
git-svn-id: svn://10.0.0.236/trunk@22569 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 16:07:50 +00:00
rhp%netscape.com
a6aaae7794 New header conversion interface
git-svn-id: svn://10.0.0.236/trunk@22568 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 15:58:15 +00:00
958 changed files with 242182 additions and 5136 deletions

View File

@@ -0,0 +1,305 @@
/* -*- 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 "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.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
/*
Helper class to implement the nsIDOMNodeList interface.
XXX It's probably wrong in some sense, as it uses the "naked"
content interface to look for kids. (I assume in general this is
bad because there may be pseudo-elements created for presentation
that aren't visible to the DOM.)
*/
#include "nsDOMCID.h"
#include "nsIDOMNode.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMScriptObjectFactory.h"
#include "nsIScriptGlobalObject.h"
#include "nsIServiceManager.h"
#include "nsISupportsArray.h"
#include "nsRDFDOMNodeList.h"
////////////////////////////////////////////////////////////////////////
// GUID definitions
static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID);
static NS_DEFINE_IID(kIDOMNodeListIID, NS_IDOMNODELIST_IID);
static NS_DEFINE_IID(kIDOMScriptObjectFactoryIID, NS_IDOM_SCRIPT_OBJECT_FACTORY_IID);
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
////////////////////////////////////////////////////////////////////////
//
class RDFHTMLCollectionImpl : public nsIDOMHTMLCollection
{
private:
nsRDFDOMNodeList* mOuter;
public:
RDFHTMLCollectionImpl(nsRDFDOMNodeList* aOuter);
virtual ~RDFHTMLCollectionImpl();
// nsISupports interface
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aResult);
// nsIDOMHTMLCollection interface
NS_DECL_IDOMHTMLCOLLECTION
};
RDFHTMLCollectionImpl::RDFHTMLCollectionImpl(nsRDFDOMNodeList* aOuter)
: mOuter(aOuter)
{
}
RDFHTMLCollectionImpl::~RDFHTMLCollectionImpl(void)
{
}
NS_IMETHODIMP_(nsrefcnt)
RDFHTMLCollectionImpl::AddRef(void)
{
return mOuter->AddRef();
}
NS_IMETHODIMP_(nsrefcnt)
RDFHTMLCollectionImpl::Release(void)
{
return mOuter->Release();
}
NS_IMETHODIMP
RDFHTMLCollectionImpl::QueryInterface(REFNSIID aIID, void** aResult)
{
NS_PRECONDITION(aResult != nsnull, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsIDOMHTMLCollection::GetIID())) {
*aResult = NS_STATIC_CAST(nsIDOMHTMLCollection*, this);
NS_ADDREF(this);
return NS_OK;
}
else {
return mOuter->QueryInterface(aIID, aResult);
}
}
NS_IMETHODIMP
RDFHTMLCollectionImpl::GetLength(PRUint32* aLength)
{
return mOuter->GetLength(aLength);
}
NS_IMETHODIMP
RDFHTMLCollectionImpl::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
{
return mOuter->Item(aIndex, aReturn);
}
NS_IMETHODIMP
RDFHTMLCollectionImpl::NamedItem(const nsString& aName, nsIDOMNode** aReturn)
{
NS_NOTYETIMPLEMENTED("write me!");
return NS_ERROR_NOT_IMPLEMENTED;
}
////////////////////////////////////////////////////////////////////////
// ctors & dtors
nsRDFDOMNodeList::nsRDFDOMNodeList(void)
: mInner(nsnull),
mElements(nsnull),
mScriptObject(nsnull)
{
NS_INIT_REFCNT();
}
nsRDFDOMNodeList::~nsRDFDOMNodeList(void)
{
NS_IF_RELEASE(mElements);
delete mInner;
}
nsresult
nsRDFDOMNodeList::Create(nsRDFDOMNodeList** aResult)
{
NS_PRECONDITION(aResult != nsnull, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
nsRDFDOMNodeList* list = new nsRDFDOMNodeList();
if (! list)
return NS_ERROR_OUT_OF_MEMORY;
nsresult rv;
if (NS_FAILED(rv = list->Init())) {
delete list;
return rv;
}
NS_ADDREF(list);
*aResult = list;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
// nsISupports interface
NS_IMPL_ADDREF(nsRDFDOMNodeList);
NS_IMPL_RELEASE(nsRDFDOMNodeList);
nsresult
nsRDFDOMNodeList::QueryInterface(REFNSIID aIID, void** aResult)
{
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
NS_PRECONDITION(aResult != nsnull, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(nsIDOMNodeList::GetIID()) ||
aIID.Equals(kISupportsIID)) {
*aResult = NS_STATIC_CAST(nsIDOMNodeList*, this);
NS_ADDREF(this);
return NS_OK;
}
else if (aIID.Equals(kIScriptObjectOwnerIID)) {
*aResult = NS_STATIC_CAST(nsIScriptObjectOwner*, this);
NS_ADDREF(this);
return NS_OK;
}
else if (aIID.Equals(nsIDOMHTMLCollection::GetIID())) {
// Aggregate this interface
if (! mInner) {
if (! (mInner = new RDFHTMLCollectionImpl(this)))
return NS_ERROR_OUT_OF_MEMORY;
}
return mInner->QueryInterface(aIID, aResult);
}
return NS_NOINTERFACE;
}
////////////////////////////////////////////////////////////////////////
// nsIDOMNodeList interface
NS_IMETHODIMP
nsRDFDOMNodeList::GetLength(PRUint32* aLength)
{
NS_ASSERTION(aLength != nsnull, "null ptr");
if (! aLength)
return NS_ERROR_NULL_POINTER;
*aLength = mElements->Count();
return NS_OK;
}
NS_IMETHODIMP
nsRDFDOMNodeList::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
{
NS_PRECONDITION(aReturn != nsnull, "null ptr");
if (! aReturn)
return NS_ERROR_NULL_POINTER;
NS_PRECONDITION(aIndex < (PRUint32) mElements->Count(), "invalid arg");
if (aIndex >= (PRUint32) mElements->Count())
return NS_ERROR_INVALID_ARG;
// Cast is okay because we're in a closed system.
*aReturn = (nsIDOMNode*) mElements->ElementAt(aIndex);
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
// nsIScriptObjectOwner interface
NS_IMETHODIMP
nsRDFDOMNodeList::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject)
{
nsresult rv = NS_OK;
nsIScriptGlobalObject* global = aContext->GetGlobalObject();
if (nsnull == mScriptObject) {
nsIDOMScriptObjectFactory *factory;
if (NS_SUCCEEDED(rv = nsServiceManager::GetService(kDOMScriptObjectFactoryCID,
kIDOMScriptObjectFactoryIID,
(nsISupports **)&factory))) {
rv = factory->NewScriptHTMLCollection(aContext,
(nsISupports*)(nsIDOMNodeList*)this,
global,
(void**)&mScriptObject);
nsServiceManager::ReleaseService(kDOMScriptObjectFactoryCID, factory);
}
}
*aScriptObject = mScriptObject;
NS_RELEASE(global);
return rv;
}
NS_IMETHODIMP
nsRDFDOMNodeList::SetScriptObject(void* aScriptObject)
{
mScriptObject = aScriptObject;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
// Implementation methods
nsresult
nsRDFDOMNodeList::Init(void)
{
nsresult rv;
if (NS_FAILED(rv = NS_NewISupportsArray(&mElements))) {
NS_ERROR("unable to create elements array");
return rv;
}
return NS_OK;
}
nsresult
nsRDFDOMNodeList::AppendNode(nsIDOMNode* aNode)
{
NS_PRECONDITION(aNode != nsnull, "null ptr");
if (! aNode)
return NS_ERROR_NULL_POINTER;
return mElements->AppendElement(aNode);
}

View File

@@ -0,0 +1,58 @@
/* -*- 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 "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.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsRDFDOMNodeList_h__
#define nsRDFDOMNodeList_h__
#include "nsIDOMNodeList.h"
#include "nsIScriptObjectOwner.h"
class nsIDOMNode;
class nsISupportsArray;
class nsRDFDOMNodeList : public nsIDOMNodeList,
public nsIScriptObjectOwner
{
private:
nsISupports* mInner;
nsISupportsArray* mElements;
void* mScriptObject;
nsRDFDOMNodeList(void);
nsresult Init(void);
public:
static nsresult Create(nsRDFDOMNodeList** aResult);
virtual ~nsRDFDOMNodeList(void);
// nsISupports interface
NS_DECL_ISUPPORTS
// nsIDOMNodeList interface
NS_DECL_IDOMNODELIST
// nsIScriptObjectOwner interface
NS_IMETHOD GetScriptObject(nsIScriptContext *aContext, void** aScriptObject);
NS_IMETHOD SetScriptObject(void* aScriptObject);
// Implementation methods
nsresult AppendNode(nsIDOMNode* aNode);
};
#endif // nsRDFDOMNodeList_h__

View File

@@ -0,0 +1,144 @@
/* -*- 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 "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.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
/*
A helper class used to implement attributes.
*/
#include "nsXULAttributes.h"
#include "nsICSSParser.h"
#include "nsIURL.h"
const PRUnichar kNullCh = PRUnichar('\0');
static void ParseClasses(const nsString& aClassString, nsClassList** aClassList)
{
NS_ASSERTION(nsnull == *aClassList, "non null start list");
nsAutoString classStr(aClassString); // copy to work buffer
classStr.Append(kNullCh); // put an extra null at the end
PRUnichar* start = (PRUnichar*)(const PRUnichar*)classStr;
PRUnichar* end = start;
while (kNullCh != *start) {
while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
start++;
}
end = start;
while ((kNullCh != *end) && (PR_FALSE == nsString::IsSpace(*end))) { // look for space or end
end++;
}
*end = kNullCh; // end string here
if (start < end) {
*aClassList = new nsClassList(NS_NewAtom(start));
aClassList = &((*aClassList)->mNext);
}
start = ++end;
}
}
nsresult
nsXULAttributes::GetClasses(nsVoidArray& aArray) const
{
aArray.Clear();
const nsClassList* classList = mClassList;
while (nsnull != classList) {
aArray.AppendElement(classList->mAtom); // NOTE atom is not addrefed
classList = classList->mNext;
}
return NS_OK;
}
nsresult
nsXULAttributes::HasClass(nsIAtom* aClass) const
{
const nsClassList* classList = mClassList;
while (nsnull != classList) {
if (classList->mAtom == aClass) {
return NS_OK;
}
classList = classList->mNext;
}
return NS_COMFALSE;
}
nsresult nsXULAttributes::UpdateClassList(const nsString& aValue)
{
if (mClassList != nsnull)
{
delete mClassList;
mClassList = nsnull;
}
if (aValue != "")
ParseClasses(aValue, &mClassList);
return NS_OK;
}
nsresult nsXULAttributes::UpdateStyleRule(nsIURL* aDocURL, const nsString& aValue)
{
if (aValue == "")
{
// XXX: Removing the rule. Is this sufficient?
NS_IF_RELEASE(mStyleRule);
mStyleRule = nsnull;
return NS_OK;
}
nsICSSParser* css;
nsresult result = NS_NewCSSParser(&css);
if (NS_OK != result) {
return result;
}
nsIStyleRule* rule;
result = css->ParseDeclarations(aValue, aDocURL, rule);
//NS_IF_RELEASE(docURL);
if ((NS_OK == result) && (nsnull != rule)) {
mStyleRule = rule; //Addrefed already during parse, so don't need to addref again.
//result = SetHTMLAttribute(aAttribute, nsHTMLValue(rule), aNotify);
}
//else {
// result = SetHTMLAttribute(aAttribute, nsHTMLValue(aValue), aNotify);
//}
NS_RELEASE(css);
return NS_OK;
}
nsresult nsXULAttributes::GetInlineStyleRule(nsIStyleRule*& aRule)
{
nsresult result = NS_ERROR_NULL_POINTER;
if (mStyleRule != nsnull)
{
aRule = mStyleRule;
NS_ADDREF(aRule);
result = NS_OK;
}
return result;
}

View File

@@ -0,0 +1,128 @@
/* -*- 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 "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.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
/*
A helper class used to implement attributes.
*/
#ifndef nsXULAttributes_h__
#define nsXULAttributes_h__
#include "nsIStyleRule.h"
#include "nsString.h"
#include "nsIAtom.h"
#include "nsVoidArray.h"
class nsIURL;
struct nsClassList {
nsClassList(nsIAtom* aAtom)
: mAtom(aAtom),
mNext(nsnull)
{
}
nsClassList(const nsClassList& aCopy)
: mAtom(aCopy.mAtom),
mNext(nsnull)
{
NS_ADDREF(mAtom);
if (nsnull != aCopy.mNext) {
mNext = new nsClassList(*(aCopy.mNext));
}
}
~nsClassList(void)
{
NS_RELEASE(mAtom);
if (nsnull != mNext) {
delete mNext;
}
}
nsIAtom* mAtom;
nsClassList* mNext;
};
struct nsXULAttribute
{
nsXULAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, const nsString& aValue)
{
mNameSpaceID = aNameSpaceID;
NS_IF_ADDREF(aName);
mName = aName;
mValue = aValue;
}
~nsXULAttribute()
{
NS_IF_RELEASE(mName);
}
PRInt32 mNameSpaceID;
nsIAtom* mName;
nsString mValue;
};
class nsXULAttributes
{
public:
nsXULAttributes()
: mClassList(nsnull), mStyleRule(nsnull)
{
mAttributes = new nsVoidArray();
}
~nsXULAttributes(void)
{
if (nsnull != mAttributes) {
PRInt32 count = mAttributes->Count();
PRInt32 index;
for (index = 0; index < count; index++) {
nsXULAttribute* attr = (nsXULAttribute*)mAttributes->ElementAt(index);
delete attr;
}
}
delete mAttributes;
}
// VoidArray Helpers
PRInt32 Count() { return mAttributes->Count(); };
nsXULAttribute* ElementAt(PRInt32 i) { return (nsXULAttribute*)mAttributes->ElementAt(i); };
void AppendElement(nsXULAttribute* aElement) { mAttributes->AppendElement((void*)aElement); };
void RemoveElementAt(PRInt32 index) { mAttributes->RemoveElementAt(index); };
// Style Helpers
nsresult GetClasses(nsVoidArray& aArray) const;
nsresult HasClass(nsIAtom* aClass) const;
nsresult UpdateClassList(const nsString& aValue);
nsresult UpdateStyleRule(nsIURL* aDocURL, const nsString& aValue);
nsresult GetInlineStyleRule(nsIStyleRule*& aRule);
public:
nsClassList* mClassList;
nsIStyleRule* mStyleRule;
nsVoidArray* mAttributes;
};
#endif // nsXULAttributes_h__

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
/* -*- 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 "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.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsXULElement_h__
#define nsXULElement_h__
#include "nsIDOMXULElement.h"
class nsXULElement : public nsISupports
{
protected:
nsIDOMXULElement* mOuter;
nsXULElement(nsIDOMXULElement* aOuter) : mOuter(aOuter) {}
public:
virtual ~nsXULElement() {};
// nsISupports interface. Subclasses should use the
// NS_DECL/IMPL_ISUPPORTS_INHERITED macros to implement the
// nsISupports interface.
NS_IMETHOD_(nsrefcnt) AddRef() {
return mOuter->AddRef();
}
NS_IMETHOD_(nsrefcnt) Release() {
return mOuter->Release();
}
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aResult) {
return mOuter->QueryInterface(aIID, aResult);
}
};
#define NS_IMPL_XULELEMENT_ISUPPORTS \
NS_IMETHOD_(nsrefcnt) AddRef() { \
return mOuter->AddRef(); \
} \
\
NS_IMETHOD_(nsrefcnt) Release() { \
return mOuter->Release(); \
} \
\
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aResult) { \
if (aIID.Equals(GetDOMIID())) { \
*aResult = this; \
NS_ADDREF(this); \
return NS_OK; \
} \
else { \
return mOuter->QueryInterface(aIID, aResult); \
} \
}
#endif // nsXULElement_h__

View File

@@ -0,0 +1,55 @@
/* -*- 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 "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.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#include "nsCOMPtr.h"
#include "nsIRDFCompositeDataSource.h"
#include "nsIServiceManager.h"
#include "nsRDFCID.h"
#include "nsXULTreeElement.h"
NS_IMPL_ISUPPORTS_INHERITED(nsXULTreeElement, nsXULElement, nsIDOMXULTreeElement);
NS_IMETHODIMP
nsXULTreeElement::GetDatabase(nsIRDFCompositeDataSource** aDatabase)
{
NS_PRECONDITION(aDatabase != nsnull, "null ptr");
if (! aDatabase)
return NS_ERROR_NULL_POINTER;
NS_IF_ADDREF(mDatabase);
*aDatabase = mDatabase;
return NS_OK;
}
NS_IMETHODIMP
nsXULTreeElement::SetDatabase(nsIRDFCompositeDataSource* aDatabase)
{
// XXX maybe someday you'll be allowed to change it.
NS_PRECONDITION(mDatabase == nsnull, "already initialized");
if (mDatabase)
return NS_ERROR_ALREADY_INITIALIZED;
mDatabase = aDatabase;
NS_IF_ADDREF(aDatabase);
// XXX reconstruct the entire tree now!
return NS_OK;
}

View File

@@ -0,0 +1,60 @@
/* -*- 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 "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.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsXULTreeElement_h__
#define nsXULTreeElement_h__
#include "nsXULElement.h"
#include "nsIDOMXULTreeElement.h"
#include "nsIRDFCompositeDataSource.h"
class nsXULTreeElement : public nsXULElement,
public nsIDOMXULTreeElement
{
private:
nsIRDFCompositeDataSource* mDatabase;
public:
nsXULTreeElement(nsIDOMXULElement* aOuter)
: nsXULElement(aOuter),
mDatabase(nsnull)
{
}
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode interface
NS_FORWARD_IDOMNODE(mOuter->);
// nsIDOMElement interface
NS_FORWARD_IDOMELEMENT(mOuter->);
// nsIDOMXULElement interface
NS_FORWARD_IDOMXULELEMENT(mOuter->);
// nsIDOMXULTreeElement interface
NS_DECL_IDOMXULTREEELEMENT
virtual const nsIID& GetDOMIID() {
return nsIDOMXULTreeElement::GetIID();
}
};
#endif // nsXULTreeElement_h__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
#!gmake
#
# 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@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
# no src yet, or tests or build
DIRS = public
ifdef ENABLE_TESTS
# DIRS += tests
endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,24 @@
#!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=..\..\..
#tests src no tests or src yet
DIRS=public
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,32 @@
#!gmake
#
# 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.
DEPTH = ../../../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXPORTS= \
mdb.h \
$(NULL)
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,32 @@
#!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=..\..\..\..
IGNORE_MANIFEST=1
IDLSRCS = \
$(NULL)
EXPORTS = \
mdb.h \
$(NULL)
MODULE=mailnews
include <$(DEPTH)\config\rules.mak>

1910
mozilla/db/mdb/public/mdb.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
#!gmake
#
# 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@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = src # tests public
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,24 @@
#!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=..\..\..
#tests no tests yet or public yet
DIRS=src
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,86 @@
#!gmake
#
# 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@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = mailnews
LIBRARY_NAME=mork
EXPORTS = \
$(NULL)
CPPSRCS = \
orkinCell.cpp\
orkinEnv.cpp\
orkinFactory.cpp\
orkinHeap.cpp\
orkinPortTableCursor.cpp\
orkinRow.cpp\
orkinRowCellCursor.cpp\
orkinStore.cpp\
orkinTable.cpp\
orkinTableRowCursor.cpp\
orkinThumb.cpp\
morkArray.cpp\
morkAtom.cpp\
morkAtomMap.cpp\
morkAtomSpace.cpp\
morkBlob.cpp\
morkBuilder.cpp\
morkCell.cpp\
morkCellObject.cpp\
morkConfig.cpp\
morkCursor.cpp \
morkDeque.cpp\
morkEnv.cpp\
morkFactory.cpp\
morkFile.cpp\
morkHandle.cpp\
morkIntMap.cpp\
morkMap.cpp\
morkNode.cpp\
morkNodeMap.cpp\
morkObject.cpp\
morkParser.cpp\
morkPool.cpp\
morkRow.cpp\
morkRowCellCursor.cpp\
morkRowMap.cpp\
morkRowObject.cpp\
morkRowSpace.cpp\
morkSink.cpp\
morkSpace.cpp\
morkStore.cpp\
morkStream.cpp\
morkTable.cpp\
morkPortTableCursor.cpp\
morkTableRowCursor.cpp\
morkThumb.cpp\
morkWriter.cpp\
morkYarn.cpp\
$(NULL)
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,148 @@
#!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=..\..\..\..
IGNORE_MANIFEST=1
LINCS= -I$(PUBLIC)\xpcom -I$(PUBLIC)\mailnews
include <$(DEPTH)\config\config.mak>
LIBRARY_NAME=mork
MODULE= mailnews
REQUIRES=rdf
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
CPPSRCS= orkinCell.cpp\
orkinEnv.cpp\
orkinFactory.cpp\
orkinHeap.cpp\
orkinPortTableCursor.cpp\
orkinRow.cpp\
orkinRowCellCursor.cpp\
orkinStore.cpp\
orkinTable.cpp\
orkinTableRowCursor.cpp\
orkinThumb.cpp\
morkArray.cpp\
morkAtom.cpp\
morkAtomMap.cpp\
morkAtomSpace.cpp\
morkBlob.cpp\
morkBuilder.cpp\
morkCell.cpp\
morkCellObject.cpp\
morkConfig.cpp\
morkCursor.cpp \
morkDeque.cpp\
morkEnv.cpp\
morkFactory.cpp\
morkFile.cpp\
morkHandle.cpp\
morkIntMap.cpp\
morkMap.cpp\
morkNode.cpp\
morkNodeMap.cpp\
morkObject.cpp\
morkParser.cpp\
morkPool.cpp\
morkRow.cpp\
morkRowCellCursor.cpp\
morkRowMap.cpp\
morkRowObject.cpp\
morkRowSpace.cpp\
morkSink.cpp\
morkSpace.cpp\
morkStore.cpp\
morkStream.cpp\
morkTable.cpp\
morkPortTableCursor.cpp\
morkTableRowCursor.cpp\
morkThumb.cpp\
morkWriter.cpp\
morkYarn.cpp\
$(NULL)
CPP_OBJS= .\$(OBJDIR)\orkinCell.obj\
.\$(OBJDIR)\orkinEnv.obj\
.\$(OBJDIR)\orkinFactory.obj\
.\$(OBJDIR)\orkinHeap.obj\
.\$(OBJDIR)\orkinPortTableCursor.obj\
.\$(OBJDIR)\orkinRow.obj\
.\$(OBJDIR)\orkinRowCellCursor.obj\
.\$(OBJDIR)\orkinStore.obj\
.\$(OBJDIR)\orkinTable.obj\
.\$(OBJDIR)\orkinTableRowCursor.obj\
.\$(OBJDIR)\orkinThumb.obj\
.\$(OBJDIR)\morkArray.obj \
.\$(OBJDIR)\morkAtom.obj \
.\$(OBJDIR)\morkAtomMap.obj \
.\$(OBJDIR)\morkAtomSpace.obj \
.\$(OBJDIR)\morkBlob.obj\
.\$(OBJDIR)\morkBuilder.obj\
.\$(OBJDIR)\morkCell.obj\
.\$(OBJDIR)\morkCellObject.obj\
.\$(OBJDIR)\morkConfig.obj\
.\$(OBJDIR)\morkCursor.obj\
.\$(OBJDIR)\morkDeque.obj\
.\$(OBJDIR)\morkEnv.obj\
.\$(OBJDIR)\morkFactory.obj\
.\$(OBJDIR)\morkFile.obj\
.\$(OBJDIR)\morkHandle.obj\
.\$(OBJDIR)\morkIntMap.obj\
.\$(OBJDIR)\morkMap.obj\
.\$(OBJDIR)\morkNode.obj\
.\$(OBJDIR)\morkNodeMap.obj\
.\$(OBJDIR)\morkObject.obj\
.\$(OBJDIR)\morkParser.obj\
.\$(OBJDIR)\morkPool.obj\
.\$(OBJDIR)\morkPortTableCursor.obj\
.\$(OBJDIR)\morkRow.obj\
.\$(OBJDIR)\morkRowCellCursor.obj\
.\$(OBJDIR)\morkRowMap.obj\
.\$(OBJDIR)\morkRowObject.obj\
.\$(OBJDIR)\morkRowSpace.obj\
.\$(OBJDIR)\morkSink.obj\
.\$(OBJDIR)\morkSpace.obj\
.\$(OBJDIR)\morkStore.obj\
.\$(OBJDIR)\morkStream.obj\
.\$(OBJDIR)\morkTable.obj\
.\$(OBJDIR)\morkTableRowCursor.obj\
.\$(OBJDIR)\morkThumb.obj\
.\$(OBJDIR)\morkWriter.obj\
.\$(OBJDIR)\morkYarn.obj\
$(NULL)
EXPORTS= \
$(NULL)
LCFLAGS = \
$(LCFLAGS) \
$(DEFINES) \
$(NULL)
include <$(DEPTH)\config\rules.mak>
libs:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

193
mozilla/db/mork/src/mork.h Normal file
View File

@@ -0,0 +1,193 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORK_
#define _MORK_ 1
#ifndef _MDB_
#include "mdb.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// { %%%%% begin disable unused param warnings %%%%%
#define MORK_USED_1(x) (void)(&x)
#define MORK_USED_2(x,y) (void)(&x,&y)
#define MORK_USED_3(x,y,z) (void)(&x,&y,&z)
#define MORK_USED_4(w,x,y,z) (void)(&w,&x,&y,&z)
// } %%%%% end disable unused param warnings %%%%%
// { %%%%% begin macro for finding class member offset %%%%%
/*| OffsetOf: the unsigned integer offset of a class or struct
**| field from the beginning of that class or struct. This is
**| the same as the similarly named public domain IronDoc macro,
**| and is also the same as another macro appearing in stdlib.h.
**| We want these offsets so we can correctly convert pointers
**| to member slots back into pointers to enclosing objects, and
**| have this exactly match what the compiler thinks is true.
**|
**|| Bascially we are asking the compiler to determine the offset at
**| compile time, and we use the definition of address artithmetic
**| to do this. By casting integer zero to a pointer of type obj*,
**| we can reference the address of a slot in such an object that
**| is hypothetically physically placed at address zero, but without
**| actually dereferencing a memory location. The absolute address
**| of slot is the same as offset of that slot, when the object is
**| placed at address zero.
|*/
#define mork_OffsetOf(obj,slot) ((unsigned int)&((obj*) 0)->slot)
// } %%%%% end macro for finding class member offset %%%%%
// { %%%%% begin specific-size integer scalar typedefs %%%%%
typedef unsigned char mork_u1; // make sure this is one byte
typedef unsigned short mork_u2; // make sure this is two bytes
typedef short mork_i2; // make sure this is two bytes
typedef unsigned long mork_u4; // make sure this is four bytes
typedef long mork_i4; // make sure this is four bytes
typedef long mork_ip; // make sure sizeof(mork_ip) == sizeof(void*)
typedef mork_u2 mork_base; // 2-byte magic class signature slot in object
typedef mork_u2 mork_derived; // 2-byte magic class signature slot in object
typedef mork_u2 mork_uses; // 2-byte strong uses count
typedef mork_u2 mork_refs; // 2-byte actual reference count
typedef mork_u4 mork_token; // unsigned token for atomized string
typedef mork_token mork_scope; // token used to id scope for rows
typedef mork_token mork_kind; // token used to id kind for tables
typedef mork_token mork_cscode; // token used to id charset names
typedef mork_token mork_aid; // token used to id atomize cell values
typedef mork_token mork_column; // token used to id columns for rows
typedef mork_column mork_delta; // mork_column plus mork_change
typedef mork_u4 mork_magic; // unsigned magic signature
typedef mork_u4 mork_seed; // unsigned collection change counter
typedef mork_u4 mork_count; // unsigned collection member count
typedef mork_count mork_num; // synonym for count
typedef mork_u4 mork_size; // unsigned physical media size
typedef mork_u4 mork_fill; // unsigned logical content size
typedef mork_u4 mork_more; // more available bytes for larger buffer
typedef mork_i4 mork_pos; // negative means "before first" (at zero pos)
typedef mork_i4 mork_line; // negative means "before first line in file"
typedef mork_u1 mork_usage; // 1-byte magic usage signature slot in object
typedef mork_u1 mork_access; // 1-byte magic access signature slot in object
typedef mork_u1 mork_change; // add, cut, put, set, nil
typedef mork_u1 mork_able; // on, off, asleep (clone IronDoc's fe_able)
typedef mork_u1 mork_load; // dirty or clean (clone IronDoc's fe_load)
// } %%%%% end specific-size integer scalar typedefs %%%%%
// { %%%%% begin constants for Mork scalar types %%%%%
#define morkAble_kEnabled ((mork_able) 0x55) /* same as IronDoc constant */
#define morkAble_kDisabled ((mork_able) 0xAA) /* same as IronDoc constant */
#define morkAble_kAsleep ((mork_able) 0x5A) /* same as IronDoc constant */
#define morkChange_kAdd 'a' /* add member */
#define morkChange_kCut 'c' /* cut member */
#define morkChange_kPut 'p' /* put member */
#define morkChange_kSet 's' /* set all members */
#define morkChange_kNil 0 /* no change in this member */
#define morkLoad_kDirty ((mork_load) 0xDD) /* same as IronDoc constant */
#define morkLoad_kClean ((mork_load) 0x22) /* same as IronDoc constant */
#define morkAccess_kOpen 'o'
#define morkAccess_kClosing 'c'
#define morkAccess_kShut 's'
#define morkAccess_kDead 'd'
// } %%%%% end constants for Mork scalar types %%%%%
// { %%%%% begin non-specific-size integer scalar typedefs %%%%%
typedef int mork_char; // nominal type for ints used to hold input byte
#define morkChar_IsWhite(c) \
((c) == 0xA || (c) == 0x9 || (c) == 0xD || (c) == ' ')
// } %%%%% end non-specific-size integer scalar typedefs %%%%%
// { %%%%% begin mdb-driven scalar typedefs %%%%%
// easier to define bool exactly the same as mdb:
typedef mdb_bool mork_bool; // unsigned byte with zero=false, nonzero=true
/* canonical boolean constants provided only for code clarity: */
#define morkBool_kTrue ((mork_bool) 1) /* actually any nonzero means true */
#define morkBool_kFalse ((mork_bool) 0) /* only zero means false */
// mdb clients can assign these, so we cannot pick maximum size:
typedef mdb_id mork_id; // unsigned object identity in a scope
typedef mork_id mork_rid; // unsigned row identity inside scope
typedef mork_id mork_tid; // unsigned table identity inside scope
typedef mork_id mork_gid; // unsigned group identity without any scope
// we only care about neg, zero, pos -- so we don't care about size:
typedef mdb_order mork_order; // neg:lessthan, zero:equalto, pos:greaterthan
// } %%%%% end mdb-driven scalar typedefs %%%%%
#define morkId_kMinusOne ((mdb_id) -1)
// { %%%%% begin class forward defines %%%%%
// try to put these in alphabetical order for easier examination:
class morkAtom;
class morkAtomSpace;
class morkBookAtom;
class morkBuf;
class morkBuilder;
class morkCell;
class morkCellObject;
class morkCursor;
class morkEnv;
class morkFactory;
class morkFile;
class morkHandle;
class morkHandleFace; // just an opaque cookie type
class morkHandleFrame;
class morkHashArrays;
class morkMap;
class morkNode;
class morkObject;
class morkOidAtom;
class morkParser;
class morkPool;
class morkPort;
class morkPortTableCursor;
class morkRow;
class morkRowCellCursor;
class morkRowObject;
class morkRowSpace;
class morkSpace;
class morkStore;
class morkStream;
class morkTable;
class morkTableRowCursor;
class morkThumb;
class morkWriter;
// } %%%%% end class forward defines %%%%%
// include this config file last for platform & environment specific stuff:
#ifndef _MORKCONFIG_
#include "morkConfig.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORK_ */

View File

@@ -0,0 +1,310 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKARRAY_
#include "morkArray.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkArray::CloseMorkNode(morkEnv* ev) // CloseTable() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseArray(ev);
this->MarkShut();
}
}
/*public virtual*/
morkArray::~morkArray() // assert CloseTable() executed earlier
{
MORK_ASSERT(this->IsShutNode());
MORK_ASSERT(mArray_Slots==0);
}
/*public non-poly*/
morkArray::morkArray(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, mork_size inSize, nsIMdbHeap* ioSlotHeap)
: morkNode(ev, inUsage, ioHeap)
, mArray_Slots( 0 )
, mArray_Heap( 0 )
, mArray_Fill( 0 )
, mArray_Size( 0 )
, mArray_Seed( (mork_u4) this ) // "random" integer assignment
{
if ( ev->Good() )
{
if ( ioSlotHeap )
{
nsIMdbHeap_SlotStrongHeap(ioSlotHeap, ev, &mArray_Heap);
if ( ev->Good() )
{
if ( inSize < 3 )
inSize = 3;
mdb_size byteSize = inSize * sizeof(void*);
void** block = 0;
ioSlotHeap->Alloc(ev->AsMdbEnv(), byteSize, (void**) &block);
if ( block && ev->Good() )
{
mArray_Slots = block;
mArray_Size = inSize;
MORK_MEMSET(mArray_Slots, 0, byteSize);
if ( ev->Good() )
mNode_Derived = morkDerived_kArray;
}
}
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkArray::CloseArray(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
if ( mArray_Heap && mArray_Slots )
mArray_Heap->Free(ev->AsMdbEnv(), mArray_Slots);
mArray_Slots = 0;
mArray_Size = 0;
mArray_Fill = 0;
++mArray_Seed;
nsIMdbHeap_SlotStrongHeap((nsIMdbHeap*) 0, ev, &mArray_Heap);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkArray::NonArrayTypeError(morkEnv* ev)
{
ev->NewError("non morkArray");
}
/*static*/ void
morkArray::IndexBeyondEndError(morkEnv* ev)
{
ev->NewError("array index beyond end");
}
/*static*/ void
morkArray::NilSlotsAddressError(morkEnv* ev)
{
ev->NewError("nil mArray_Slots");
}
/*static*/ void
morkArray::FillBeyondSizeError(morkEnv* ev)
{
ev->NewError("mArray_Fill > mArray_Size");
}
mork_bool
morkArray::Grow(morkEnv* ev, mork_size inNewSize)
// Grow() returns true if capacity becomes >= inNewSize and ev->Good()
{
if ( ev->Good() && inNewSize > mArray_Size ) // make array larger?
{
if ( mArray_Fill <= mArray_Size ) // fill and size fit the invariant?
{
if ( inNewSize - mArray_Size < 3 ) // actually want a few more slots?
inNewSize = mArray_Size + 3;
mdb_size newByteSize = inNewSize * sizeof(void*);
void** newBlock = 0;
mArray_Heap->Alloc(ev->AsMdbEnv(), newByteSize, (void**) &newBlock);
if ( newBlock && ev->Good() ) // okay new block?
{
void** oldSlots = mArray_Slots;
void** oldEnd = oldSlots + mArray_Fill;
void** newSlots = newBlock;
void** newEnd = newBlock + inNewSize;
while ( oldSlots < oldEnd )
*newSlots++ = *oldSlots++;
while ( newSlots < newEnd )
*newSlots++ = (void*) 0;
oldSlots = mArray_Slots;
mArray_Size = inNewSize;
mArray_Slots = newBlock;
mArray_Heap->Free(ev->AsMdbEnv(), oldSlots);
}
}
else
this->FillBeyondSizeError(ev);
}
++mArray_Seed; // always modify seed, since caller intends to add slots
return ( ev->Good() && mArray_Size >= inNewSize );
}
void*
morkArray::SafeAt(morkEnv* ev, mork_pos inPos)
{
if ( mArray_Slots )
{
if ( inPos < mArray_Fill )
return mArray_Slots[ inPos ];
else
this->IndexBeyondEndError(ev);
}
else
this->NilSlotsAddressError(ev);
return (void*) 0;
}
void
morkArray::SafeAtPut(morkEnv* ev, mork_pos inPos, void* ioSlot)
{
if ( mArray_Slots )
{
if ( inPos < mArray_Fill )
{
mArray_Slots[ inPos ] = ioSlot;
++mArray_Seed;
}
else
this->IndexBeyondEndError(ev);
}
else
this->NilSlotsAddressError(ev);
}
mork_pos
morkArray::AppendSlot(morkEnv* ev, void* ioSlot)
{
mork_pos outPos = -1;
if ( mArray_Slots )
{
mork_fill fill = mArray_Fill;
if ( this->Grow(ev, fill+1) )
{
outPos = fill;
mArray_Slots[ fill ] = ioSlot;
mArray_Fill = fill + 1;
// note Grow() increments mArray_Seed
}
}
else
this->NilSlotsAddressError(ev);
return outPos;
}
void
morkArray::AddSlot(morkEnv* ev, mork_pos inPos, void* ioSlot)
{
if ( mArray_Slots )
{
mork_fill fill = mArray_Fill;
if ( this->Grow(ev, fill+1) )
{
void** slot = mArray_Slots; // the slot vector
void** end = slot + fill; // one past the last used array slot
slot += inPos; // the slot to be added
while ( --end >= slot ) // another slot to move upward?
end[ 1 ] = *end;
*slot = ioSlot;
mArray_Fill = fill + 1;
// note Grow() increments mArray_Seed
}
}
else
this->NilSlotsAddressError(ev);
}
void
morkArray::CutSlot(morkEnv* ev, mork_pos inPos)
{
mork_fill fill = mArray_Fill;
if ( inPos < fill ) // cutting a slot in the used array portion?
{
void** slot = mArray_Slots; // the slot vector
void** end = slot + fill; // one past the last used array slot
slot += inPos; // the slot to be cut
while ( ++slot < end ) // another slot to move downward?
slot[ -1 ] = *slot;
slot[ -1 ] = 0; // clear the last used slot which is now unused
// note inPos<fill implies fill>0, so fill-1 must be nonnegative:
mArray_Fill = fill - 1;
++mArray_Seed;
}
}
void
morkArray::CutAllSlots(morkEnv* ev)
{
if ( mArray_Slots )
{
if ( mArray_Fill <= mArray_Size )
{
mdb_size oldByteSize = mArray_Fill * sizeof(void*);
MORK_MEMSET(mArray_Slots, 0, oldByteSize);
}
else
this->FillBeyondSizeError(ev);
}
else
this->NilSlotsAddressError(ev);
++mArray_Seed;
mArray_Fill = 0;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,111 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKARRAY_
#define _MORKARRAY_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kArray /*i*/ 0x4179 /* ascii 'Ay' */
class morkArray : public morkNode { // row iterator
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
public: // state is public because the entire Mork system is private
void** mArray_Slots; // array of pointers
nsIMdbHeap* mArray_Heap; // required heap for allocating mArray_Slots
mork_fill mArray_Fill; // logical count of used slots in mArray_Slots
mork_size mArray_Size; // physical count of mArray_Slots ( >= Fill)
mork_seed mArray_Seed; // change counter for syncing with iterators
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseArray()
virtual ~morkArray(); // assert that close executed earlier
public: // morkArray construction & destruction
morkArray(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, mork_size inSize, nsIMdbHeap* ioSlotHeap);
void CloseArray(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkArray(const morkArray& other);
morkArray& operator=(const morkArray& other);
public: // dynamic type identification
mork_bool IsArray() const
{ return IsNode() && mNode_Derived == morkDerived_kArray; }
// } ===== end morkNode methods =====
public: // typing & errors
static void NonArrayTypeError(morkEnv* ev);
static void IndexBeyondEndError(morkEnv* ev);
static void NilSlotsAddressError(morkEnv* ev);
static void FillBeyondSizeError(morkEnv* ev);
public: // other table row cursor methods
mork_fill Length() const { return mArray_Fill; }
mork_size Capacity() const { return mArray_Size; }
mork_bool Grow(morkEnv* ev, mork_size inNewSize);
// Grow() returns true if capacity becomes >= inNewSize and ev->Good()
void* At(mork_pos inPos) const { return mArray_Slots[ inPos ]; }
void AtPut(mork_pos inPos, void* ioSlot)
{ mArray_Slots[ inPos ] = ioSlot; }
void* SafeAt(morkEnv* ev, mork_pos inPos);
void SafeAtPut(morkEnv* ev, mork_pos inPos, void* ioSlot);
mork_pos AppendSlot(morkEnv* ev, void* ioSlot);
void AddSlot(morkEnv* ev, mork_pos inPos, void* ioSlot);
void CutSlot(morkEnv* ev, mork_pos inPos);
void CutAllSlots(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakArray(morkArray* me,
morkEnv* ev, morkArray** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongArray(morkArray* me,
morkEnv* ev, morkArray** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKTABLEROWCURSOR_ */

View File

@@ -0,0 +1,504 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKBLOB_
#include "morkBlob.h"
#endif
#ifndef _MORKATOM_
#include "morkAtom.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKATOMSPACE_
#include "morkAtomSpace.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
mork_bool
morkAtom::GetYarn(mdbYarn* outYarn) const
{
const void* source = 0;
mdb_fill fill = 0;
mdb_cscode form = 0;
outYarn->mYarn_More = 0;
if ( this )
{
if ( this->IsWeeBook() )
{
morkWeeBookAtom* weeBook = (morkWeeBookAtom*) this;
source = weeBook->mWeeBookAtom_Body;
fill = weeBook->mAtom_Size;
}
else if ( this->IsBigBook() )
{
morkBigBookAtom* bigBook = (morkBigBookAtom*) this;
source = bigBook->mBigBookAtom_Body;
fill = bigBook->mBigBookAtom_Size;
form = bigBook->mBigBookAtom_Form;
}
else if ( this->IsWeeAnon() )
{
morkWeeAnonAtom* weeAnon = (morkWeeAnonAtom*) this;
source = weeAnon->mWeeAnonAtom_Body;
fill = weeAnon->mAtom_Size;
}
else if ( this->IsBigAnon() )
{
morkBigAnonAtom* bigAnon = (morkBigAnonAtom*) this;
source = bigAnon->mBigAnonAtom_Body;
fill = bigAnon->mBigAnonAtom_Size;
form = bigAnon->mBigAnonAtom_Form;
}
}
if ( source && fill ) // have an atom with nonempty content?
{
// if we have too many bytes, and yarn seems growable:
if ( fill > outYarn->mYarn_Size && outYarn->mYarn_Grow ) // try grow?
(*outYarn->mYarn_Grow)(outYarn, (mdb_size) fill); // request bigger
mdb_size size = outYarn->mYarn_Size; // max dest size
if ( fill > size ) // too much atom content?
{
outYarn->mYarn_More = size - fill; // extra atom bytes omitted
fill = size; // copy no more bytes than size of yarn buffer
}
void* dest = outYarn->mYarn_Buf; // where bytes are going
if ( !dest ) // nil destination address buffer?
fill = 0; // we can't write any content at all
if ( fill ) // anything to copy?
MORK_MEMCPY(dest, source, fill); // copy fill bytes to yarn
outYarn->mYarn_Fill = fill; // tell yarn size of copied content
}
else // no content to put into the yarn
{
outYarn->mYarn_Fill = 0; // tell yarn that atom has no bytes
}
outYarn->mYarn_Form = form; // always update the form slot
return ( source != 0 );
}
mork_bool
morkAtom::AsBuf(morkBuf& outBuf) const
{
const morkAtom* atom = this;
if ( atom )
{
if ( atom->IsWeeBook() )
{
morkWeeBookAtom* weeBook = (morkWeeBookAtom*) atom;
outBuf.mBuf_Body = weeBook->mWeeBookAtom_Body;
outBuf.mBuf_Fill = weeBook->mAtom_Size;
}
else if ( atom->IsBigBook() )
{
morkBigBookAtom* bigBook = (morkBigBookAtom*) atom;
outBuf.mBuf_Body = bigBook->mBigBookAtom_Body;
outBuf.mBuf_Fill = bigBook->mBigBookAtom_Size;
}
else if ( atom->IsWeeAnon() )
{
morkWeeAnonAtom* weeAnon = (morkWeeAnonAtom*) atom;
outBuf.mBuf_Body = weeAnon->mWeeAnonAtom_Body;
outBuf.mBuf_Fill = weeAnon->mAtom_Size;
}
else if ( atom->IsBigAnon() )
{
morkBigAnonAtom* bigAnon = (morkBigAnonAtom*) atom;
outBuf.mBuf_Body = bigAnon->mBigAnonAtom_Body;
outBuf.mBuf_Fill = bigAnon->mBigAnonAtom_Size;
}
else
atom = 0; // show desire to put empty content in yarn
}
if ( !atom ) // empty content for yarn?
{
outBuf.mBuf_Body = 0;
outBuf.mBuf_Fill = 0;
}
return ( atom != 0 );
}
mork_bool
morkAtom::AliasYarn(mdbYarn* outYarn) const
{
outYarn->mYarn_More = 0;
outYarn->mYarn_Form = 0;
const morkAtom* atom = this;
if ( atom )
{
if ( atom->IsWeeBook() )
{
morkWeeBookAtom* weeBook = (morkWeeBookAtom*) atom;
outYarn->mYarn_Buf = weeBook->mWeeBookAtom_Body;
outYarn->mYarn_Fill = weeBook->mAtom_Size;
outYarn->mYarn_Size = weeBook->mAtom_Size;
}
else if ( atom->IsBigBook() )
{
morkBigBookAtom* bigBook = (morkBigBookAtom*) atom;
outYarn->mYarn_Buf = bigBook->mBigBookAtom_Body;
outYarn->mYarn_Fill = bigBook->mBigBookAtom_Size;
outYarn->mYarn_Size = bigBook->mBigBookAtom_Size;
outYarn->mYarn_Form = bigBook->mBigBookAtom_Form;
}
else if ( atom->IsWeeAnon() )
{
morkWeeAnonAtom* weeAnon = (morkWeeAnonAtom*) atom;
outYarn->mYarn_Buf = weeAnon->mWeeAnonAtom_Body;
outYarn->mYarn_Fill = weeAnon->mAtom_Size;
outYarn->mYarn_Size = weeAnon->mAtom_Size;
}
else if ( atom->IsBigAnon() )
{
morkBigAnonAtom* bigAnon = (morkBigAnonAtom*) atom;
outYarn->mYarn_Buf = bigAnon->mBigAnonAtom_Body;
outYarn->mYarn_Fill = bigAnon->mBigAnonAtom_Size;
outYarn->mYarn_Size = bigAnon->mBigAnonAtom_Size;
outYarn->mYarn_Form = bigAnon->mBigAnonAtom_Form;
}
else
atom = 0; // show desire to put empty content in yarn
}
if ( !atom ) // empty content for yarn?
{
outYarn->mYarn_Buf = 0;
outYarn->mYarn_Fill = 0;
outYarn->mYarn_Size = 0;
// outYarn->mYarn_Grow = 0; // please don't modify the Grow slot
}
return ( atom != 0 );
}
void
morkAtom::MakeCellUseForever(morkEnv* ev)
{
mAtom_CellUses = morkAtom_kForeverCellUses;
}
mork_u1
morkAtom::AddCellUse(morkEnv* ev)
{
if ( mAtom_CellUses < morkAtom_kMaxCellUses ) // not already maxed out?
++mAtom_CellUses;
return mAtom_CellUses;
}
mork_u1
morkAtom::CutCellUse(morkEnv* ev)
{
if ( mAtom_CellUses ) // any outstanding uses to cut?
{
if ( mAtom_CellUses < morkAtom_kMaxCellUses ) // not frozen at max?
--mAtom_CellUses;
}
else
this->CellUsesUnderflowWarning(ev);
return mAtom_CellUses;
}
/*static*/ void
morkAtom::CellUsesUnderflowWarning(morkEnv* ev)
{
ev->NewWarning("mAtom_CellUses underflow");
}
/*static*/ void
morkAtom::BadAtomKindError(morkEnv* ev)
{
ev->NewError("bad mAtom_Kind");
}
/*static*/ void
morkAtom::ZeroAidError(morkEnv* ev)
{
ev->NewError("zero atom ID");
}
/*static*/ void
morkAtom::AtomSizeOverflowError(morkEnv* ev)
{
ev->NewError("atom mAtom_Size overflow");
}
void
morkOidAtom::InitRowOidAtom(morkEnv* ev, const mdbOid& inOid)
{
mAtom_CellUses = 0;
mAtom_Kind = morkAtom_kKindRowOid;
mAtom_Change = morkChange_kNil;
mAtom_Size = 0;
mOidAtom_Oid = inOid; // bitwise copy
}
void
morkOidAtom::InitTableOidAtom(morkEnv* ev, const mdbOid& inOid)
{
mAtom_CellUses = 0;
mAtom_Kind = morkAtom_kKindTableOid;
mAtom_Change = morkChange_kNil;
mAtom_Size = 0;
mOidAtom_Oid = inOid; // bitwise copy
}
void
morkWeeAnonAtom::InitWeeAnonAtom(morkEnv* ev, const morkBuf& inBuf)
{
mAtom_Kind = 0;
mAtom_Change = morkChange_kNil;
if ( inBuf.mBuf_Fill <= morkAtom_kMaxByteSize )
{
mAtom_CellUses = 0;
mAtom_Kind = morkAtom_kKindWeeAnon;
mork_size size = inBuf.mBuf_Fill;
mAtom_Size = (mork_u1) size;
if ( size && inBuf.mBuf_Body )
MORK_MEMCPY(mWeeAnonAtom_Body, inBuf.mBuf_Body, size);
mWeeAnonAtom_Body[ size ] = 0;
}
else
this->AtomSizeOverflowError(ev);
}
void
morkBigAnonAtom::InitBigAnonAtom(morkEnv* ev, const morkBuf& inBuf,
mork_cscode inForm)
{
mAtom_CellUses = 0;
mAtom_Kind = morkAtom_kKindBigAnon;
mAtom_Change = morkChange_kNil;
mAtom_Size = 0;
mBigAnonAtom_Form = inForm;
mork_size size = inBuf.mBuf_Fill;
mBigAnonAtom_Size = size;
if ( size && inBuf.mBuf_Body )
MORK_MEMCPY(mBigAnonAtom_Body, inBuf.mBuf_Body, size);
mBigAnonAtom_Body[ size ] = 0;
}
/*static*/ void
morkBookAtom::NonBookAtomTypeError(morkEnv* ev)
{
ev->NewError("non morkBookAtom");
}
mork_u4
morkBookAtom::HashFormAndBody(morkEnv* ev) const
{
// This hash is obviously a variation of the dragon book string hash.
// (I won't bother to explain or rationalize this usage for you.)
register mork_u4 outHash = 0; // hash value returned
register unsigned char c; // next character
register const mork_u1* body; // body of bytes to hash
mork_size size = 0; // the number of bytes to hash
if ( this->IsWeeBook() )
{
size = mAtom_Size;
body = ((const morkWeeBookAtom*) this)->mWeeBookAtom_Body;
}
else if ( this->IsBigBook() )
{
size = ((const morkBigBookAtom*) this)->mBigBookAtom_Size;
body = ((const morkBigBookAtom*) this)->mBigBookAtom_Body;
}
else
this->NonBookAtomTypeError(ev);
const mork_u1* end = body + size;
while ( body < end )
{
c = *body++;
outHash <<= 4;
outHash += c;
mork_u4 top = outHash & 0xF0000000L; // top four bits
if ( top ) // any of high four bits equal to one?
{
outHash ^= (top >> 24); // fold down high bits
outHash ^= top; // zero top four bits
}
}
return outHash;
}
mork_bool
morkBookAtom::EqualFormAndBody(morkEnv* ev, const morkBookAtom* inAtom) const
{
mork_bool outEqual = morkBool_kFalse;
const mork_u1* body = 0; // body of inAtom bytes to compare
mork_size size; // the number of inAtom bytes to compare
mork_cscode form; // nominal charset for ioAtom
if ( inAtom->IsWeeBook() )
{
size = inAtom->mAtom_Size;
body = ((const morkWeeBookAtom*) inAtom)->mWeeBookAtom_Body;
form = 0;
}
else if ( inAtom->IsBigBook() )
{
size = ((const morkBigBookAtom*) inAtom)->mBigBookAtom_Size;
body = ((const morkBigBookAtom*) inAtom)->mBigBookAtom_Body;
form = ((const morkBigBookAtom*) inAtom)->mBigBookAtom_Form;
}
else
inAtom->NonBookAtomTypeError(ev);
const mork_u1* thisBody = 0; // body of bytes in this to compare
mork_size thisSize; // the number of bytes in this to compare
mork_cscode thisForm; // nominal charset for this atom
if ( this->IsWeeBook() )
{
thisSize = mAtom_Size;
thisBody = ((const morkWeeBookAtom*) this)->mWeeBookAtom_Body;
thisForm = 0;
}
else if ( this->IsBigBook() )
{
thisSize = ((const morkBigBookAtom*) this)->mBigBookAtom_Size;
thisBody = ((const morkBigBookAtom*) this)->mBigBookAtom_Body;
thisForm = ((const morkBigBookAtom*) this)->mBigBookAtom_Form;
}
else
this->NonBookAtomTypeError(ev);
if ( body && thisBody && size == thisSize && form == thisForm )
outEqual = (MORK_MEMCMP(body, thisBody, size) == 0);
return outEqual;
}
void
morkBookAtom::CutBookAtomFromSpace(morkEnv* ev)
{
morkAtomSpace* space = mBookAtom_Space;
if ( space )
{
mBookAtom_Space = 0;
space->mAtomSpace_AtomBodies.CutAtom(ev, this);
space->mAtomSpace_AtomAids.CutAtom(ev, this);
}
else
ev->NilPointerError();
}
morkWeeBookAtom::morkWeeBookAtom(mork_aid inAid)
{
mAtom_Kind = morkAtom_kKindWeeBook;
mAtom_CellUses = 0;
mAtom_Change = morkChange_kNil;
mAtom_Size = 0;
mBookAtom_Space = 0;
mBookAtom_Id = inAid;
mWeeBookAtom_Body[ 0 ] = 0;
}
void
morkWeeBookAtom::InitWeeBookAtom(morkEnv* ev, const morkBuf& inBuf,
morkAtomSpace* ioSpace, mork_aid inAid)
{
mAtom_Kind = 0;
mAtom_Change = morkChange_kNil;
if ( ioSpace )
{
if ( inAid )
{
if ( inBuf.mBuf_Fill <= morkAtom_kMaxByteSize )
{
mAtom_CellUses = 0;
mAtom_Kind = morkAtom_kKindWeeBook;
mBookAtom_Space = ioSpace;
mBookAtom_Id = inAid;
mork_size size = inBuf.mBuf_Fill;
mAtom_Size = (mork_u1) size;
if ( size && inBuf.mBuf_Body )
MORK_MEMCPY(mWeeBookAtom_Body, inBuf.mBuf_Body, size);
mWeeBookAtom_Body[ size ] = 0;
}
else
this->AtomSizeOverflowError(ev);
}
else
this->ZeroAidError(ev);
}
else
ev->NilPointerError();
}
void
morkBigBookAtom::InitBigBookAtom(morkEnv* ev, const morkBuf& inBuf,
mork_cscode inForm, morkAtomSpace* ioSpace, mork_aid inAid)
{
mAtom_Kind = 0;
mAtom_Change = morkChange_kNil;
if ( ioSpace )
{
if ( inAid )
{
mAtom_CellUses = 0;
mAtom_Kind = morkAtom_kKindBigBook;
mAtom_Size = 0;
mBookAtom_Space = ioSpace;
mBookAtom_Id = inAid;
mBigBookAtom_Form = inForm;
mork_size size = inBuf.mBuf_Fill;
mBigBookAtom_Size = size;
if ( size && inBuf.mBuf_Body )
MORK_MEMCPY(mBigBookAtom_Body, inBuf.mBuf_Body, size);
mBigBookAtom_Body[ size ] = 0;
}
else
this->ZeroAidError(ev);
}
else
ev->NilPointerError();
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,323 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKATOM_
#define _MORKATOM_ 1
#ifndef _MORK_
#include "mork.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkAtom_kMaxByteSize 255 /* max for 8-bit integer */
#define morkAtom_kForeverCellUses 0x0FF /* max for 8-bit integer */
#define morkAtom_kMaxCellUses 0x07F /* max for 7-bit integer */
#define morkAtom_kKindWeeAnon 'a' /* means morkWeeAnonAtom subclass */
#define morkAtom_kKindBigAnon 'A' /* means morkBigAnonAtom subclass */
#define morkAtom_kKindWeeBook 'b' /* means morkWeeBookAtom subclass */
#define morkAtom_kKindBigBook 'B' /* means morkBigBookAtom subclass */
#define morkAtom_kKindRowOid 'r' /* means morkOidAtom subclass */
#define morkAtom_kKindTableOid 't' /* means morkOidAtom subclass */
/*| Atom: .
|*/
class morkAtom { //
public:
mork_u1 mAtom_Kind; // identifies a specific atom subclass
mork_u1 mAtom_CellUses; // number of persistent uses in a cell
mork_change mAtom_Change; // how has this atom been changed?
mork_u1 mAtom_Size; // only for atoms smaller than 256 bytes
public:
morkAtom(mork_aid inAid, mork_u1 inKind);
mork_bool IsWeeAnon() const { return mAtom_Kind == morkAtom_kKindWeeAnon; }
mork_bool IsBigAnon() const { return mAtom_Kind == morkAtom_kKindBigAnon; }
mork_bool IsWeeBook() const { return mAtom_Kind == morkAtom_kKindWeeBook; }
mork_bool IsBigBook() const { return mAtom_Kind == morkAtom_kKindBigBook; }
mork_bool IsRowOid() const { return mAtom_Kind == morkAtom_kKindRowOid; }
mork_bool IsTableOid() const { return mAtom_Kind == morkAtom_kKindTableOid; }
mork_bool IsBook() const { return this->IsWeeBook() || this->IsBigBook(); }
public: // empty construction does nothing
morkAtom() { }
public: // one-byte refcounting, freezing at maximum
void MakeCellUseForever(morkEnv* ev);
mork_u1 AddCellUse(morkEnv* ev);
mork_u1 CutCellUse(morkEnv* ev);
mork_bool IsCellUseForever() const
{ return mAtom_CellUses == morkAtom_kForeverCellUses; }
void SetAtomDirty() { mAtom_Change = morkChange_kAdd; }
private: // warnings
static void CellUsesUnderflowWarning(morkEnv* ev);
public: // errors
static void BadAtomKindError(morkEnv* ev);
static void ZeroAidError(morkEnv* ev);
static void AtomSizeOverflowError(morkEnv* ev);
public: // yarns
mork_bool AsBuf(morkBuf& outBuf) const;
mork_bool AliasYarn(mdbYarn* outYarn) const;
mork_bool GetYarn(mdbYarn* outYarn) const;
private: // copying is not allowed
morkAtom(const morkAtom& other);
morkAtom& operator=(const morkAtom& other);
};
/*| OidAtom: an atom that references a row or table by identity.
|*/
class morkOidAtom : public morkAtom { //
// mork_u1 mAtom_Kind; // identifies a specific atom subclass
// mork_u1 mAtom_CellUses; // number of persistent uses in a cell
// mork_change mAtom_Change; // how has this atom been changed?
// mork_u1 mAtom_Size; // NOT USED IN "BIG" format atoms
public:
mdbOid mOidAtom_Oid; // identity of referenced object
public: // empty construction does nothing
morkOidAtom() { }
void InitRowOidAtom(morkEnv* ev, const mdbOid& inOid);
void InitTableOidAtom(morkEnv* ev, const mdbOid& inOid);
private: // copying is not allowed
morkOidAtom(const morkOidAtom& other);
morkOidAtom& operator=(const morkOidAtom& other);
};
/*| WeeAnonAtom: an atom whose content immediately follows morkAtom slots
**| in an inline fashion, so that morkWeeAnonAtom contains both leading
**| atom slots and then the content bytes without further overhead. Note
**| that charset encoding is not indicated, so zero is implied for Latin1.
**| (Non-Latin1 content must be stored in a morkBigAnonAtom with a charset.)
**|
**|| An anon (anonymous) atom has no identity, with no associated bookkeeping
**| for lookup needed for sharing like a book atom.
**|
**|| A wee anon atom is immediate but not shared with any other users of this
**| atom, so no bookkeeping for sharing is needed. This means the atom has
**| no ID, because the atom has no identity other than this immediate content,
**| and no hash table is needed to look up this particular atom. This also
**| applies to the larger format morkBigAnonAtom, which has more slots.
|*/
class morkWeeAnonAtom : public morkAtom { //
// mork_u1 mAtom_Kind; // identifies a specific atom subclass
// mork_u1 mAtom_CellUses; // number of persistent uses in a cell
// mork_change mAtom_Change; // how has this atom been changed?
// mork_u1 mAtom_Size; // only for atoms smaller than 256 bytes
public:
mork_u1 mWeeAnonAtom_Body[ 1 ]; // 1st byte of immediate content vector
public: // empty construction does nothing
morkWeeAnonAtom() { }
void InitWeeAnonAtom(morkEnv* ev, const morkBuf& inBuf);
// allow extra trailing byte for a null byte:
static mork_size SizeForFill(mork_fill inFill)
{ return sizeof(morkWeeAnonAtom) + inFill; }
private: // copying is not allowed
morkWeeAnonAtom(const morkWeeAnonAtom& other);
morkWeeAnonAtom& operator=(const morkWeeAnonAtom& other);
};
/*| BigAnonAtom: another immediate atom that cannot be encoded as the smaller
**| morkWeeAnonAtom format because either the size is too great, and/or the
**| charset is not the default zero for Latin1 and must be explicitly noted.
**|
**|| An anon (anonymous) atom has no identity, with no associated bookkeeping
**| for lookup needed for sharing like a book atom.
|*/
class morkBigAnonAtom : public morkAtom { //
// mork_u1 mAtom_Kind; // identifies a specific atom subclass
// mork_u1 mAtom_CellUses; // number of persistent uses in a cell
// mork_change mAtom_Change; // how has this atom been changed?
// mork_u1 mAtom_Size; // NOT USED IN "BIG" format atoms
public:
mork_cscode mBigAnonAtom_Form; // charset format encoding
mork_size mBigAnonAtom_Size; // size of content vector
mork_u1 mBigAnonAtom_Body[ 1 ]; // 1st byte of immed content vector
public: // empty construction does nothing
morkBigAnonAtom() { }
void InitBigAnonAtom(morkEnv* ev, const morkBuf& inBuf, mork_cscode inForm);
// allow extra trailing byte for a null byte:
static mork_size SizeForFill(mork_fill inFill)
{ return sizeof(morkBigAnonAtom) + inFill; }
private: // copying is not allowed
morkBigAnonAtom(const morkBigAnonAtom& other);
morkBigAnonAtom& operator=(const morkBigAnonAtom& other);
};
#define morkBookAtom_kMaxBodySize 1024 /* if larger, cannot be shared */
/*| BookAtom: the common subportion of wee book atoms and big book atoms that
**| includes the atom ID and the pointer to the space referencing this atom
**| through a hash table.
|*/
class morkBookAtom : public morkAtom { //
// mork_u1 mAtom_Kind; // identifies a specific atom subclass
// mork_u1 mAtom_CellUses; // number of persistent uses in a cell
// mork_change mAtom_Change; // how has this atom been changed?
// mork_u1 mAtom_Size; // only for atoms smaller than 256 bytes
public:
morkAtomSpace* mBookAtom_Space; // mBookAtom_Space->mSpace_Scope is atom scope
mork_aid mBookAtom_Id; // identity token for this shared atom
public: // empty construction does nothing
morkBookAtom() { }
static void NonBookAtomTypeError(morkEnv* ev);
public: // Hash() and Equal() for atom ID maps are same for all subclasses:
mork_u4 HashAid() const { return mBookAtom_Id; }
mork_bool EqualAid(const morkBookAtom* inAtom) const
{ return ( mBookAtom_Id == inAtom->mBookAtom_Id); }
public: // Hash() and Equal() for atom body maps know about subclasses:
mork_u4 HashFormAndBody(morkEnv* ev) const;
mork_bool EqualFormAndBody(morkEnv* ev, const morkBookAtom* inAtom) const;
public: // separation from containing space
void CutBookAtomFromSpace(morkEnv* ev);
private: // copying is not allowed
morkBookAtom(const morkBookAtom& other);
morkBookAtom& operator=(const morkBookAtom& other);
};
/*| WeeBookAtom: .
|*/
class morkWeeBookAtom : public morkBookAtom { //
// mork_u1 mAtom_Kind; // identifies a specific atom subclass
// mork_u1 mAtom_CellUses; // number of persistent uses in a cell
// mork_change mAtom_Change; // how has this atom been changed?
// mork_u1 mAtom_Size; // only for atoms smaller than 256 bytes
// morkAtomSpace* mBookAtom_Space; // mBookAtom_Space->mSpace_Scope is scope
// mork_aid mBookAtom_Id; // identity token for this shared atom
public:
mork_u1 mWeeBookAtom_Body[ 1 ]; // 1st byte of immed content vector
public: // empty construction does nothing
morkWeeBookAtom() { }
morkWeeBookAtom(mork_aid inAid);
void InitWeeBookAtom(morkEnv* ev, const morkBuf& inBuf,
morkAtomSpace* ioSpace, mork_aid inAid);
// allow extra trailing byte for a null byte:
static mork_size SizeForFill(mork_fill inFill)
{ return sizeof(morkWeeBookAtom) + inFill; }
private: // copying is not allowed
morkWeeBookAtom(const morkWeeBookAtom& other);
morkWeeBookAtom& operator=(const morkWeeBookAtom& other);
};
/*| BigBookAtom: .
|*/
class morkBigBookAtom : public morkBookAtom { //
// mork_u1 mAtom_Kind; // identifies a specific atom subclass
// mork_u1 mAtom_CellUses; // number of persistent uses in a cell
// mork_change mAtom_Change; // how has this atom been changed?
// mork_u1 mAtom_Size; // NOT USED IN "BIG" format atoms
// morkAtomSpace* mBookAtom_Space; // mBookAtom_Space->mSpace_Scope is scope
// mork_aid mBookAtom_Id; // identity token for this shared atom
public:
mork_cscode mBigBookAtom_Form; // charset format encoding
mork_size mBigBookAtom_Size; // size of content vector
mork_u1 mBigBookAtom_Body[ 1 ]; // 1st byte of immed content vector
public: // empty construction does nothing
morkBigBookAtom() { }
void InitBigBookAtom(morkEnv* ev, const morkBuf& inBuf,
mork_cscode inForm, morkAtomSpace* ioSpace, mork_aid inAid);
// allow extra trailing byte for a null byte:
static mork_size SizeForFill(mork_fill inFill)
{ return sizeof(morkBigBookAtom) + inFill; }
private: // copying is not allowed
morkBigBookAtom(const morkBigBookAtom& other);
morkBigBookAtom& operator=(const morkBigBookAtom& other);
};
/*| MaxBookAtom: .
|*/
class morkMaxBookAtom : public morkBigBookAtom { //
// mork_u1 mAtom_Kind; // identifies a specific atom subclass
// mork_u1 mAtom_CellUses; // number of persistent uses in a cell
// mork_change mAtom_Change; // how has this atom been changed?
// mork_u1 mAtom_Size; // NOT USED IN "BIG" format atoms
// morkAtomSpace* mBookAtom_Space; // mBookAtom_Space->mSpace_Scope is scope
// mork_aid mBookAtom_Id; // identity token for this shared atom
// mork_cscode mBigBookAtom_Form; // charset format encoding
// mork_size mBigBookAtom_Size; // size of content vector
// mork_u1 mBigBookAtom_Body[ 1 ]; // 1st byte of immed content vector
public:
mork_u1 mBigBookAtom_Body[ morkBookAtom_kMaxBodySize + 3 ]; // max bytes
public: // empty construction does nothing
morkMaxBookAtom() { }
void InitMaxBookAtom(morkEnv* ev, const morkBuf& inBuf,
mork_cscode inForm, morkAtomSpace* ioSpace, mork_aid inAid)
{ this->InitBigBookAtom(ev, inBuf, inForm, ioSpace, inAid); }
private: // copying is not allowed
morkMaxBookAtom(const morkMaxBookAtom& other);
morkMaxBookAtom& operator=(const morkMaxBookAtom& other);
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKATOM_ */

View File

@@ -0,0 +1,263 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKATOMMAP_
#include "morkAtomMap.h"
#endif
#ifndef _MORKATOM_
#include "morkAtom.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkAtomAidMap::CloseMorkNode(morkEnv* ev) // CloseAtomAidMap() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseAtomAidMap(ev);
this->MarkShut();
}
}
/*public virtual*/
morkAtomAidMap::~morkAtomAidMap() // assert CloseAtomAidMap() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkAtomAidMap::morkAtomAidMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkMap(ev, inUsage, ioHeap,
/*inKeySize*/ sizeof(morkBookAtom*), /*inValSize*/ 0,
morkAtomAidMap_kStartSlotCount, ioSlotHeap,
/*inHoldChanges*/ morkBool_kFalse)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kAtomAidMap;
}
/*public non-poly*/ void
morkAtomAidMap::CloseAtomAidMap(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
this->CloseMap(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
// { ===== begin morkMap poly interface =====
/*virtual*/ mork_bool //
morkAtomAidMap::Equal(morkEnv* ev, const void* inKeyA,
const void* inKeyB) const
{
return (*(const morkBookAtom**) inKeyA)->EqualAid(
*(const morkBookAtom**) inKeyB);
}
/*virtual*/ mork_u4 //
morkAtomAidMap::Hash(morkEnv* ev, const void* inKey) const
{
return (*(const morkBookAtom**) inKey)->HashAid();
}
// } ===== end morkMap poly interface =====
mork_bool
morkAtomAidMap::AddAtom(morkEnv* ev, morkBookAtom* ioAtom)
{
if ( ev->Good() )
{
this->Put(ev, &ioAtom, /*val*/ (void*) 0,
/*key*/ (void*) 0, /*val*/ (void*) 0, (mork_change**) 0);
}
return ev->Good();
}
morkBookAtom*
morkAtomAidMap::CutAtom(morkEnv* ev, const morkBookAtom* inAtom)
{
morkBookAtom* oldKey = 0;
this->Cut(ev, &inAtom, &oldKey, /*val*/ (void*) 0,
(mork_change**) 0);
return oldKey;
}
morkBookAtom*
morkAtomAidMap::GetAtom(morkEnv* ev, const morkBookAtom* inAtom)
{
morkBookAtom* key = 0; // old val in the map
this->Get(ev, &inAtom, &key, /*val*/ (void*) 0, (mork_change**) 0);
return key;
}
morkBookAtom*
morkAtomAidMap::GetAid(morkEnv* ev, mork_aid inAid)
{
morkWeeBookAtom weeAtom(inAid);
morkBookAtom* key = &weeAtom; // we need a pointer
morkBookAtom* oldKey = 0; // old key in the map
this->Get(ev, &key, &oldKey, /*val*/ (void*) 0, (mork_change**) 0);
return oldKey;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkAtomBodyMap::CloseMorkNode(morkEnv* ev) // CloseAtomBodyMap() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseAtomBodyMap(ev);
this->MarkShut();
}
}
/*public virtual*/
morkAtomBodyMap::~morkAtomBodyMap() // assert CloseAtomBodyMap() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkAtomBodyMap::morkAtomBodyMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkMap(ev, inUsage, ioHeap,
/*inKeySize*/ sizeof(morkBookAtom*), /*inValSize*/ 0,
morkAtomBodyMap_kStartSlotCount, ioSlotHeap,
/*inHoldChanges*/ morkBool_kFalse)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kAtomBodyMap;
}
/*public non-poly*/ void
morkAtomBodyMap::CloseAtomBodyMap(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
this->CloseMap(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
// { ===== begin morkMap poly interface =====
/*virtual*/ mork_bool //
morkAtomBodyMap::Equal(morkEnv* ev, const void* inKeyA,
const void* inKeyB) const
{
return (*(const morkBookAtom**) inKeyA)->EqualFormAndBody(ev,
*(const morkBookAtom**) inKeyB);
}
/*virtual*/ mork_u4 //
morkAtomBodyMap::Hash(morkEnv* ev, const void* inKey) const
{
return (*(const morkBookAtom**) inKey)->HashFormAndBody(ev);
}
// } ===== end morkMap poly interface =====
mork_bool
morkAtomBodyMap::AddAtom(morkEnv* ev, morkBookAtom* ioAtom)
{
if ( ev->Good() )
{
this->Put(ev, &ioAtom, /*val*/ (void*) 0,
/*key*/ (void*) 0, /*val*/ (void*) 0, (mork_change**) 0);
}
return ev->Good();
}
morkBookAtom*
morkAtomBodyMap::CutAtom(morkEnv* ev, const morkBookAtom* inAtom)
{
morkBookAtom* oldKey = 0;
this->Cut(ev, &inAtom, &oldKey, /*val*/ (void*) 0,
(mork_change**) 0);
return oldKey;
}
morkBookAtom*
morkAtomBodyMap::GetAtom(morkEnv* ev, const morkBookAtom* inAtom)
{
morkBookAtom* key = 0; // old val in the map
this->Get(ev, &inAtom, &key, /*val*/ (void*) 0, (mork_change**) 0);
return key;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,187 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKATOMMAP_
#define _MORKATOMMAP_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kAtomAidMap /*i*/ 0x6141 /* ascii 'aA' */
#define morkAtomAidMap_kStartSlotCount 512
/*| morkAtomAidMap: keys of morkBookAtom organized by atom ID
|*/
class morkAtomAidMap : public morkMap { // for mapping tokens to maps
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseAtomAidMap() only if open
virtual ~morkAtomAidMap(); // assert that CloseAtomAidMap() executed earlier
public: // morkMap construction & destruction
morkAtomAidMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap);
void CloseAtomAidMap(morkEnv* ev); // called by CloseMorkNode();
public: // dynamic type identification
mork_bool IsAtomAidMap() const
{ return IsNode() && mNode_Derived == morkDerived_kAtomAidMap; }
// } ===== end morkNode methods =====
// { ===== begin morkMap poly interface =====
virtual mork_bool // note: equal(a,b) implies hash(a) == hash(b)
Equal(morkEnv* ev, const void* inKeyA, const void* inKeyB) const;
// implemented using morkBookAtom::HashAid()
virtual mork_u4 // note: equal(a,b) implies hash(a) == hash(b)
Hash(morkEnv* ev, const void* inKey) const;
// implemented using morkBookAtom::EqualAid()
// } ===== end morkMap poly interface =====
public: // other map methods
mork_bool AddAtom(morkEnv* ev, morkBookAtom* ioAtom);
// AddAtom() returns ev->Good()
morkBookAtom* CutAtom(morkEnv* ev, const morkBookAtom* inAtom);
// CutAtom() returns the atom removed equal to inAtom, if there was one
morkBookAtom* GetAtom(morkEnv* ev, const morkBookAtom* inAtom);
// GetAtom() returns the atom equal to inAtom, or else nil
morkBookAtom* GetAid(morkEnv* ev, mork_aid inAid);
// GetAid() returns the atom equal to inAid, or else nil
// note the atoms are owned elsewhere, usuall by morkAtomSpace
};
class morkAtomAidMapIter: public morkMapIter{ // typesafe wrapper class
public:
morkAtomAidMapIter(morkEnv* ev, morkAtomAidMap* ioMap)
: morkMapIter(ev, ioMap) { }
morkAtomAidMapIter( ) : morkMapIter() { }
void InitAtomAidMapIter(morkEnv* ev, morkAtomAidMap* ioMap)
{ this->InitMapIter(ev, ioMap); }
mork_change* FirstAtom(morkEnv* ev, morkBookAtom** outAtomPtr)
{ return this->First(ev, outAtomPtr, /*val*/ (void*) 0); }
mork_change* NextAtom(morkEnv* ev, morkBookAtom** outAtomPtr)
{ return this->Next(ev, outAtomPtr, /*val*/ (void*) 0); }
mork_change* HereAtom(morkEnv* ev, morkBookAtom** outAtomPtr)
{ return this->Here(ev, outAtomPtr, /*val*/ (void*) 0); }
mork_change* CutHereAtom(morkEnv* ev, morkBookAtom** outAtomPtr)
{ return this->CutHere(ev, outAtomPtr, /*val*/ (void*) 0); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kAtomBodyMap /*i*/ 0x6142 /* ascii 'aB' */
#define morkAtomBodyMap_kStartSlotCount 512
/*| morkAtomBodyMap: keys of morkBookAtom organized by body bytes
|*/
class morkAtomBodyMap : public morkMap { // for mapping tokens to maps
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseAtomBodyMap() only if open
virtual ~morkAtomBodyMap(); // assert CloseAtomBodyMap() executed earlier
public: // morkMap construction & destruction
morkAtomBodyMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap);
void CloseAtomBodyMap(morkEnv* ev); // called by CloseMorkNode();
public: // dynamic type identification
mork_bool IsAtomBodyMap() const
{ return IsNode() && mNode_Derived == morkDerived_kAtomBodyMap; }
// } ===== end morkNode methods =====
// { ===== begin morkMap poly interface =====
virtual mork_bool // note: equal(a,b) implies hash(a) == hash(b)
Equal(morkEnv* ev, const void* inKeyA, const void* inKeyB) const;
// implemented using morkBookAtom::HashFormAndBody()
virtual mork_u4 // note: equal(a,b) implies hash(a) == hash(b)
Hash(morkEnv* ev, const void* inKey) const;
// implemented using morkBookAtom::EqualFormAndBody()
// } ===== end morkMap poly interface =====
public: // other map methods
mork_bool AddAtom(morkEnv* ev, morkBookAtom* ioAtom);
// AddAtom() returns ev->Good()
morkBookAtom* CutAtom(morkEnv* ev, const morkBookAtom* inAtom);
// CutAtom() returns the atom removed equal to inAtom, if there was one
morkBookAtom* GetAtom(morkEnv* ev, const morkBookAtom* inAtom);
// GetAtom() returns the atom equal to inAtom, or else nil
// note the atoms are owned elsewhere, usuall by morkAtomSpace
};
class morkAtomBodyMapIter: public morkMapIter{ // typesafe wrapper class
public:
morkAtomBodyMapIter(morkEnv* ev, morkAtomBodyMap* ioMap)
: morkMapIter(ev, ioMap) { }
morkAtomBodyMapIter( ) : morkMapIter() { }
void InitAtomBodyMapIter(morkEnv* ev, morkAtomBodyMap* ioMap)
{ this->InitMapIter(ev, ioMap); }
mork_change* FirstAtom(morkEnv* ev, morkBookAtom** outAtomPtr)
{ return this->First(ev, outAtomPtr, /*val*/ (void*) 0); }
mork_change* NextAtom(morkEnv* ev, morkBookAtom** outAtomPtr)
{ return this->Next(ev, outAtomPtr, /*val*/ (void*) 0); }
mork_change* HereAtom(morkEnv* ev, morkBookAtom** outAtomPtr)
{ return this->Here(ev, outAtomPtr, /*val*/ (void*) 0); }
mork_change* CutHereAtom(morkEnv* ev, morkBookAtom** outAtomPtr)
{ return this->CutHere(ev, outAtomPtr, /*val*/ (void*) 0); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKATOMMAP_ */

View File

@@ -0,0 +1,220 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKSPACE_
#include "morkSpace.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKSPACE_
#include "morkSpace.h"
#endif
#ifndef _MORKATOMSPACE_
#include "morkAtomSpace.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _MORKATOM_
#include "morkAtom.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkAtomSpace::CloseMorkNode(morkEnv* ev) // CloseAtomSpace() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseAtomSpace(ev);
this->MarkShut();
}
}
/*public virtual*/
morkAtomSpace::~morkAtomSpace() // assert CloseAtomSpace() executed earlier
{
MORK_ASSERT(mAtomSpace_HighUnderId==0);
MORK_ASSERT(mAtomSpace_HighOverId==0);
MORK_ASSERT(this->IsShutNode());
MORK_ASSERT(mAtomSpace_AtomAids.IsShutNode());
MORK_ASSERT(mAtomSpace_AtomBodies.IsShutNode());
}
/*public non-poly*/
morkAtomSpace::morkAtomSpace(morkEnv* ev, const morkUsage& inUsage,
mork_scope inScope, morkStore* ioStore,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkSpace(ev, inUsage, inScope, ioStore, ioHeap, ioSlotHeap)
, mAtomSpace_HighUnderId( morkAtomSpace_kMinUnderId )
, mAtomSpace_HighOverId( morkAtomSpace_kMinOverId )
, mAtomSpace_AtomAids(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioSlotHeap)
, mAtomSpace_AtomBodies(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioSlotHeap)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kAtomSpace;
}
/*public non-poly*/ void
morkAtomSpace::CloseAtomSpace(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
mAtomSpace_AtomBodies.CloseMorkNode(ev);
morkStore* store = mSpace_Store;
if ( store )
this->CutAllAtoms(ev, &store->mStore_Pool);
mAtomSpace_AtomAids.CloseMorkNode(ev);
this->CloseSpace(ev);
mAtomSpace_HighUnderId = 0;
mAtomSpace_HighOverId = 0;
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkAtomSpace::NonAtomSpaceTypeError(morkEnv* ev)
{
ev->NewError("non morkAtomSpace");
}
mork_num
morkAtomSpace::CutAllAtoms(morkEnv* ev, morkPool* ioPool)
{
mork_num outSlots = mAtomSpace_AtomAids.mMap_Fill;
morkBookAtom* a = 0; // old key atom in the map
mork_change* c = 0;
morkAtomAidMapIter i(ev, &mAtomSpace_AtomAids);
for ( c = i.FirstAtom(ev, &a); c ; c = i.NextAtom(ev, &a) )
{
if ( a )
ioPool->ZapAtom(ev, a);
i.CutHereAtom(ev, /*key*/ (morkBookAtom**) 0);
}
return outSlots;
}
morkBookAtom*
morkAtomSpace::MakeBookAtomCopy(morkEnv* ev, const morkBigBookAtom& inAtom)
// make copy of inAtom and put it in both maps, using a new ID as needed.
{
morkBookAtom* outAtom = 0;
if ( ev->Good() )
{
morkPool* pool = this->GetSpaceStorePool();
morkBookAtom* atom = pool->NewBookAtomCopy(ev, inAtom);
if ( atom )
{
mork_aid id = this->MakeNewAtomId(ev, atom);
if ( id )
{
outAtom = atom;
mAtomSpace_AtomAids.AddAtom(ev, atom);
mAtomSpace_AtomBodies.AddAtom(ev, atom);
}
}
}
return outAtom;
}
mork_aid
morkAtomSpace::MakeNewAtomId(morkEnv* ev, morkBookAtom* ioAtom)
{
mork_aid outAid = 0;
mork_tid id = mAtomSpace_HighUnderId;
mork_num count = 8; // try up to eight times
while ( !outAid && count ) // still trying to find an unused table ID?
{
--count;
ioAtom->mBookAtom_Id = id;
if ( !mAtomSpace_AtomAids.GetAtom(ev, ioAtom) )
outAid = id;
else
{
MORK_ASSERT(morkBool_kFalse); // alert developer about ID problems
++id;
}
}
mAtomSpace_HighUnderId = id + 1;
return outAid;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
morkAtomSpaceMap::~morkAtomSpaceMap()
{
}
morkAtomSpaceMap::morkAtomSpaceMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkNodeMap(ev, inUsage, ioHeap, ioSlotHeap)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kAtomSpaceMap;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,213 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKATOMSPACE_
#define _MORKATOMSPACE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKSPACE_
#include "morkSpace.h"
#endif
#ifndef _MORKATOMMAP_
#include "morkAtomMap.h"
#endif
#ifndef _MORKNODEMAP_
#include "morkNodeMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*| kMinUnderId: the smallest ID we auto-assign to the 'under' namespace
**| reserved for tokens expected to occur very frequently, such as the names
**| of columns. We reserve single byte ids in the ASCII range to correspond
**| one-to-one to those tokens consisting single ASCII characters (so that
**| this assignment is always known and constant). So we start at 0x80, and
**| then reserve the upper half of two hex digit ids and all the three hex
**| digit IDs for the 'under' namespace for common tokens.
|*/
#define morkAtomSpace_kMinUnderId 0x80 /* low 7 bits mean byte tokens */
#define morkAtomSpace_kMaxSevenBitAid 0x7F /* low seven bit integer ID */
/*| kMinOverId: the smallest ID we auto-assign to the 'over' namespace that
**| might include very large numbers of tokens that are used infrequently,
**| so that we care less whether the shortest hex representation is used.
**| So we start all IDs for 'over' category tokens at a value range that
**| needs at least four hex digits, so we can reserve three hex digits and
**| shorter for more commonly occuring tokens in the 'under' category.
|*/
#define morkAtomSpace_kMinOverId 0x1000 /* using at least four hex bytes */
#define morkDerived_kAtomSpace /*i*/ 0x6153 /* ascii 'aS' */
/*| morkAtomSpace:
|*/
class morkAtomSpace : public morkSpace { //
// public: // slots inherited from morkSpace (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkStore* mSpace_Store; // weak ref to containing store
// mork_scope mSpace_Scope; // the scope for this space
// mork_bool mSpace_DoAutoIDs; // whether db should assign member IDs
// mork_bool mSpace_HaveDoneAutoIDs; // whether actually auto assigned IDs
// mork_u1 mSpace_Pad[ 2 ]; // pad to u4 alignment
public: // state is public because the entire Mork system is private
mork_aid mAtomSpace_HighUnderId; // high ID in 'under' range
mork_aid mAtomSpace_HighOverId; // high ID in 'over' range
morkAtomAidMap mAtomSpace_AtomAids; // all atoms in space by ID
morkAtomBodyMap mAtomSpace_AtomBodies; // all atoms in space by body
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseAtomSpace() only if open
virtual ~morkAtomSpace(); // assert that CloseAtomSpace() executed earlier
public: // morkMap construction & destruction
morkAtomSpace(morkEnv* ev, const morkUsage& inUsage, mork_scope inScope,
morkStore* ioStore, nsIMdbHeap* ioNodeHeap, nsIMdbHeap* ioSlotHeap);
void CloseAtomSpace(morkEnv* ev); // called by CloseMorkNode();
public: // dynamic type identification
mork_bool IsAtomSpace() const
{ return IsNode() && mNode_Derived == morkDerived_kAtomSpace; }
// } ===== end morkNode methods =====
public: // typing
void NonAtomSpaceTypeError(morkEnv* ev);
public: // setup
mork_bool MarkAllAtomSpaceContentDirty(morkEnv* ev);
// MarkAllAtomSpaceContentDirty() visits every space object and marks
// them dirty, including every table, row, cell, and atom. The return
// equals ev->Good(), to show whether any error happened. This method is
// intended for use in the beginning of a "compress commit" which writes
// all store content, whether dirty or not. We dirty everything first so
// that later iterations over content can mark things clean as they are
// written, and organize the process of serialization so that objects are
// written only at need (because of being dirty).
public: // other space methods
mork_num CutAllAtoms(morkEnv* ev, morkPool* ioPool);
// CutAllAtoms() puts all the atoms back in the pool.
morkBookAtom* MakeBookAtomCopy(morkEnv* ev, const morkBigBookAtom& inAtom);
// Make copy of inAtom and put it in both maps, using a new ID as needed.
mork_aid MakeNewAtomId(morkEnv* ev, morkBookAtom* ioAtom);
// generate an unused atom id.
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakAtomSpace(morkAtomSpace* me,
morkEnv* ev, morkAtomSpace** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongAtomSpace(morkAtomSpace* me,
morkEnv* ev, morkAtomSpace** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kAtomSpaceMap /*i*/ 0x615A /* ascii 'aZ' */
/*| morkAtomSpaceMap: maps mork_scope -> morkAtomSpace
|*/
class morkAtomSpaceMap : public morkNodeMap { // for mapping tokens to tables
public:
virtual ~morkAtomSpaceMap();
morkAtomSpaceMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap);
public: // other map methods
mork_bool AddAtomSpace(morkEnv* ev, morkAtomSpace* ioAtomSpace)
{ return this->AddNode(ev, ioAtomSpace->mSpace_Scope, ioAtomSpace); }
// the AddAtomSpace() boolean return equals ev->Good().
mork_bool CutAtomSpace(morkEnv* ev, mork_scope inScope)
{ return this->CutNode(ev, inScope); }
// The CutAtomSpace() boolean return indicates whether removal happened.
morkAtomSpace* GetAtomSpace(morkEnv* ev, mork_scope inScope)
{ return (morkAtomSpace*) this->GetNode(ev, inScope); }
// Note the returned space does NOT have an increase in refcount for this.
mork_num CutAllAtomSpaces(morkEnv* ev)
{ return this->CutAllNodes(ev); }
// CutAllAtomSpaces() releases all the referenced table values.
};
class morkAtomSpaceMapIter: public morkMapIter{ // typesafe wrapper class
public:
morkAtomSpaceMapIter(morkEnv* ev, morkAtomSpaceMap* ioMap)
: morkMapIter(ev, ioMap) { }
morkAtomSpaceMapIter( ) : morkMapIter() { }
void InitAtomSpaceMapIter(morkEnv* ev, morkAtomSpaceMap* ioMap)
{ this->InitMapIter(ev, ioMap); }
mork_change*
FirstAtomSpace(morkEnv* ev, mork_scope* outScope, morkAtomSpace** outAtomSpace)
{ return this->First(ev, outScope, outAtomSpace); }
mork_change*
NextAtomSpace(morkEnv* ev, mork_scope* outScope, morkAtomSpace** outAtomSpace)
{ return this->Next(ev, outScope, outAtomSpace); }
mork_change*
HereAtomSpace(morkEnv* ev, mork_scope* outScope, morkAtomSpace** outAtomSpace)
{ return this->Here(ev, outScope, outAtomSpace); }
mork_change*
CutHereAtomSpace(morkEnv* ev, mork_scope* outScope, morkAtomSpace** outAtomSpace)
{ return this->CutHere(ev, outScope, outAtomSpace); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKATOMSPACE_ */

View File

@@ -0,0 +1,62 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKBLOB_
#include "morkBlob.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
morkSpool::morkSpool(morkEnv* ev, nsIMdbHeap* ioHeap)
{
mBuf_Body = 0;
mBuf_Fill = 0;
mBlob_Size = 0;
mText_Form = 0;
mSpool_Heap = ioHeap;
if ( !ioHeap )
ev->NilPointerError();
}
void
morkSpool::CloseSpool(morkEnv* ev)
{
void* body = mBuf_Body;
nsIMdbHeap* heap = mSpool_Heap;
if ( body && heap )
{
heap->Free(ev->AsMdbEnv(), body);
}
mBuf_Body = 0;
mSpool_Heap = 0;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,144 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKBLOB_
#define _MORKBLOB_ 1
#ifndef _MORK_
#include "mork.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*| Buf: the minimum needed to describe location and content length.
**| This is typically only enough to read from this buffer, since
**| one cannot write effectively without knowing the size of a buf.
|*/
class morkBuf { // subset of nsIMdbYarn slots
public:
void* mBuf_Body; // space for holding any binary content
mork_fill mBuf_Fill; // logical content in Buf in bytes
public:
morkBuf() { }
morkBuf(const void* ioBuf, mork_fill inFill)
: mBuf_Body((void*) ioBuf), mBuf_Fill(inFill) { }
private: // copying is not allowed
morkBuf(const morkBuf& other);
morkBuf& operator=(const morkBuf& other);
};
/*| Blob: a buffer with an associated size, to increase known buf info
**| to include max capacity in addition to buf location and content.
**| This form factor allows us to allocate a vector of such blobs,
**| which can share the same managing heap stored elsewhere, and that
**| is why we don't include a pointer to a heap in this blob class.
|*/
class morkBlob : public morkBuf { // greater subset of nsIMdbYarn slots
// void* mBuf_Body; // space for holding any binary content
// mdb_fill mBuf_Fill; // logical content in Buf in bytes
public:
mork_size mBlob_Size; // physical size of Buf in bytes
public:
morkBlob() { }
morkBlob(const void* ioBuf, mork_fill inFill, mork_size inSize)
: morkBuf(ioBuf, inFill), mBlob_Size(inSize) { }
public:
mork_bool Grow(morkEnv* ev, nsIMdbHeap* ioHeap, mork_size inNewSize);
private: // copying is not allowed
morkBlob(const morkBlob& other);
morkBlob& operator=(const morkBlob& other);
};
/*| Text: a blob with an associated charset annotation, where the
**| charset actually includes the general notion of typing, and not
**| just a specification of character set alone; we want to permit
**| arbitrary charset annotations for ad hoc binary types as well.
**| (We avoid including a nsIMdbHeap pointer in morkText for the same
**| reason morkBlob does: we want minimal size vectors of morkText.)
|*/
class morkText : public morkBlob { // greater subset of nsIMdbYarn slots
// void* mBuf_Body; // space for holding any binary content
// mdb_fill mBuf_Fill; // logical content in Buf in bytes
// mdb_size mBlob_Size; // physical size of Buf in bytes
public:
mork_cscode mText_Form; // charset format encoding
morkText() { }
private: // copying is not allowed
morkText(const morkText& other);
morkText& operator=(const morkText& other);
};
/*| Spool: a text with an associated nsIMdbHeap instance that provides
**| all memory management for the space pointed to by mBuf_Body. (This
**| was the hardest type to give a name in this small class hierarchy,
**| because it's hard to characterize self-management of one's space.)
**| A spool is a self-contained blob that knows how to grow itself as
**| necessary to hold more content when necessary. Spool descends from
**| morkText to include the mText_Form slot, even though this won't be
**| needed always, because we are not as concerned about the overall
**| size of this particular Spool object (if we were concerned about
**| the size of an array of Spool instances, we would not bother with
**| a separate heap pointer for each of them).
**|
**|| A spool makes a good medium in which to stream content as a sink,
**| so we will have a subclass of morkSink called morkSpoolSink that
**| will stream bytes into this self-contained spool object. The name
**| of this morkSpool class derives more from this intended usage than
**| from anything else. The Mork code to parse db content will use
**| spools with associated sinks to accumulate parsed strings.
**|
**|| Heap: this is the heap used for memory allocation. This instance
**| is NOT refcounted, since this spool always assumes the heap is held
**| through a reference elsewhere (for example, through the same object
**| that contains or holds the spool itself. This lack of refcounting
**| is consistent with the fact that morkSpool itself is not refcounted,
**| and is not intended for use as a standalone object.
|*/
class morkSpool : public morkText { // self-managing text blob object
// void* mBuf_Body; // space for holding any binary content
// mdb_fill mBuf_Fill; // logical content in Buf in bytes
// mdb_size mBlob_Size; // physical size of Buf in bytes
// mdb_cscode mText_Form; // charset format encoding
public:
nsIMdbHeap* mSpool_Heap; // storage manager for mBuf_Body pointer
public:
morkSpool(morkEnv* ev, nsIMdbHeap* ioHeap);
void CloseSpool(morkEnv* ev);
private: // copying is not allowed
morkSpool(const morkSpool& other);
morkSpool& operator=(const morkSpool& other);
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKBLOB_ */

View File

@@ -0,0 +1,325 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKPARSER_
#include "morkParser.h"
#endif
#ifndef _MORKBUILDER_
#include "morkBuilder.h"
#endif
#ifndef _MORKCELL_
#include "morkCell.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkBuilder::CloseMorkNode(morkEnv* ev) // CloseBuilder() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseBuilder(ev);
this->MarkShut();
}
}
/*public virtual*/
morkBuilder::~morkBuilder() // assert CloseBuilder() executed earlier
{
MORK_ASSERT(mBuilder_Table==0);
}
/*public non-poly*/
morkBuilder::morkBuilder(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkStream* ioStream, mdb_count inBytesPerParseSegment,
nsIMdbHeap* ioSlotHeap, morkStore* ioStore)
: morkParser(ev, inUsage, ioHeap, ioStream,
inBytesPerParseSegment, ioSlotHeap)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kBuilder;
}
/*public non-poly*/ void
morkBuilder::CloseBuilder(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
this->CloseParser(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkBuilder::NonBuilderTypeError(morkEnv* ev)
{
ev->NewError("non morkBuilder");
}
/*virtual*/ void
morkBuilder::AliasToYarn(morkEnv* ev,
const morkAlias& inAlias, // typically an alias to concat with strings
mdbYarn* outYarn)
// The parser might ask that some aliases be turned into yarns, so they
// can be concatenated into longer blobs under some circumstances. This
// is an alternative to using a long and complex callback for many parts
// for a single cell value.
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnNewPort(morkEnv* ev, const morkPlace& inPlace)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnPortGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnPortEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnNewGroup(morkEnv* ev, const morkPlace& inPlace, mork_gid inGid)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnGroupGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnGroupCommitEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnGroupAbortEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnNewPortRow(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnPortRowGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnPortRowEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnNewTable(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnTableGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnTableEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnNewMeta(morkEnv* ev, const morkPlace& inPlace)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnMetaGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnMetaEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnNewRow(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnRowGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnRowEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnNewDict(morkEnv* ev, const morkPlace& inPlace)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnDictGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnDictEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnAliasGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnNewCell(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnCellGlitch(morkEnv* ev, const morkGlitch& inGlitch)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnCellForm(morkEnv* ev, mork_cscode inCharsetFormat)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnCellEnd(morkEnv* ev, const morkSpan& inSpan)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnValue(morkEnv* ev, const morkSpan& inSpan,
const morkBuf& inBuf)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnValueAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnRowAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias)
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkBuilder::OnTableAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias)
{
ev->StubMethodOnlyError();
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,290 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKBUILDER_
#define _MORKBUILDER_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKPARSER_
#include "morkParser.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*| kCellsVecSize: length of cell vector buffer inside morkBuilder
|*/
#define morkBuilder_kCellsVecSize 64
#define morkBuilder_kDefaultBytesPerParseSegment 512 /* plausible to big */
#define morkDerived_kBuilder /*i*/ 0x4275 /* ascii 'Bu' */
class morkBuilder /*d*/ : public morkParser {
// public: // slots inherited from morkParser (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// nsIMdbHeap* mParser_Heap; // refcounted heap used for allocation
// morkStream* mParser_Stream; // refcounted input stream
// mork_u4 mParser_Tag; // must equal morkParser_kTag
// mork_count mParser_MoreGranularity; // constructor inBytesPerParseSegment
// mork_u4 mParser_State; // state where parser should resume
// after finding ends of group transactions, we can re-seek the start:
// mork_pos mParser_GroupContentStartPos; // start of this group
// mork_gid mParser_GroupId; // group ID if inside a group
// mork_tid mParser_TableId; // table ID if inside a table
// mork_rid mParser_RowId; // row ID if inside a row
// mork_bool mParser_InPort; // called OnNewPort but not OnPortEnd?
// mork_bool mParser_InDict; // called OnNewDict but not OnDictEnd?
// mork_bool mParser_InCell; // called OnNewCell but not OnCellEnd?
// mork_bool mParser_InMeta; // called OnNewMeta but not OnMetaEnd?
// morkAlias mParser_Alias; // current alias being parsed
// note that mParser_Alias.mAlias_Buf points at mParser_ScopeSpool below:
// blob spools allocated in mParser_Heap
// morkSpool mParser_ScopeSpool; // place to accumulate ID scope blobs
// morkSpool mParser_ValueSpool; // place to accumulate value blobs
// morkSpool mParser_ColumnSpool; // place to accumulate column blobs
// morkSpool mParser_StringSpool; // place to accumulate string blobs
// morkSpoolSink mParser_ScopeSink; // writes to mParser_ScopeSpool
// morkSpoolSink mParser_ValueSink; // writes to mParser_ValueSpool
// morkSpoolSink mParser_ColumnSink; // writes to mParser_ColumnSpool
// morkSpoolSink mParser_StringSink; // writes to mParser_StringSpool
// yarns allocated in mParser_Heap
// morkYarn mParser_AliasYarn; // place to receive from AliasToYarn()
// span showing current ongoing file position status:
// morkSpan mParser_PortSpan; // span of current db port file
// various spans denoting nested subspaces inside the file's port span:
// morkSpan mParser_GroupSpan; // span of current transaction group
// morkSpan mParser_DictSpan;
// morkSpan mParser_AliasSpan;
// morkSpan mParser_MetaDictSpan;
// morkSpan mParser_TableSpan;
// morkSpan mParser_MetaTableSpan;
// morkSpan mParser_RowSpan;
// morkSpan mParser_MetaRowSpan;
// morkSpan mParser_CellSpan;
// morkSpan mParser_ColumnSpan;
// morkSpan mParser_SlotSpan;
// ````` ````` ````` ````` ````` ````` ````` `````
protected: // protected morkBuilder members
// weak refs that do not prevent closure of referenced nodes:
morkStore* mBuilder_Store; // weak ref to builder's store
// strong refs that do indeed prevent closure of referenced nodes:
morkTable* mBuilder_Table; // current table being built (or nil)
morkRow* mBuilder_Row; // current row being built (or nil)
morkCell* mBuilder_Cell; // current cell within CellsVec (or nil)
morkRowSpace* mBuilder_RowSpace; // space for mBuilder_CurrentRowScope
morkAtomSpace* mBuilder_AtomSpace; // space for mBuilder_CurrentAtomScope
morkAtomSpace* mBuilder_OidAtomSpace; // ground atom space for oids
morkAtomSpace* mBuilder_ScopeAtomSpace; // ground atom space for scopes
// scoped object ids for current objects under construction:
mdbOid mBuilder_TableOid; // full oid for current table
mdbOid mBuilder_RowOid; // full oid for current row
// standard tokens that we want to know about for this port:
mork_cscode mBuilder_iso_8859_1; // token for "iso-8859-1"
mork_cscode mBuilder_r; // token for "r"
mork_cscode mBuilder_a; // token for "a"
mork_cscode mBuilder_t; // token for "t"
// tokens that become set as the result of meta cells in port rows:
mork_cscode mBuilder_PortForm; // default port charset format
mork_scope mBuilder_PortRowScope; // port row scope
mork_scope mBuilder_PortAtomScope; // port atom scope
// tokens that become set as the result of meta cells in meta tables:
mork_cscode mBuilder_TableForm; // default table charset format
mork_scope mBuilder_TableRowScope; // table row scope
mork_scope mBuilder_TableAtomScope; // table atom scope
mork_kind mBuilder_TableKind; // table kind
// tokens that become set as the result of meta cells in meta rows:
mork_cscode mBuilder_RowForm; // default row charset format
mork_scope mBuilder_RowRowScope; // row scope per row metainfo
mork_scope mBuilder_RowAtomScope; // row atom scope
// meta tokens currently in force, driven by meta info slots above:
mork_cscode mBuilder_CurrentForm; // current charset format
mork_scope mBuilder_CurrentRowScope; // current row scope
mork_scope mBuilder_CurrentAtomScope; // current atom scope
// If any of these 'cut' bools are true, it means a minus was seen in the
// Mork source text to indicate removal of content from some container.
// (Note there is no corresponding 'add' bool, since add is the default.)
// CutRow implies the current row should be cut from the table.
// CutCell implies the current column should be cut from the row.
mork_bool mBuilder_CutRow; // row with kCut change
mork_bool mBuilder_CutCell; // cell with kCut change
mork_u1 mBuilder_Pad1; // pad to u4 alignment
mork_u1 mBuilder_Pad2; // pad to u4 alignment
morkCell mBuilder_CellsVec[ morkBuilder_kCellsVecSize ];
mork_fill mBuilder_CellsVecFill; // count used in CellsVec
// Note when mBuilder_CellsVecFill equals morkBuilder_kCellsVecSize, and
// another cell is added, this means all the cells in the vector above
// must be flushed to the current row being built to create more room.
protected: // protected inlines
mork_bool CellVectorIsFull() const
{ return ( mBuilder_CellsVecFill == morkBuilder_kCellsVecSize ); };
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseBuilder() only if open
virtual ~morkBuilder(); // assert that CloseBuilder() executed earlier
public: // morkYarn construction & destruction
morkBuilder(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkStream* ioStream, // the readonly stream for input bytes
mdb_count inBytesPerParseSegment, // target for ParseMore()
nsIMdbHeap* ioSlotHeap, morkStore* ioStore
);
void CloseBuilder(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkBuilder(const morkBuilder& other);
morkBuilder& operator=(const morkBuilder& other);
public: // dynamic type identification
mork_bool IsBuilder() const
{ return IsNode() && mNode_Derived == morkDerived_kBuilder; }
// } ===== end morkNode methods =====
public: // typing
static void NonBuilderTypeError(morkEnv* ev);
// ````` ````` ````` ````` ````` ````` ````` `````
public: // in virtual morkParser methods, data flow subclass to parser
virtual void AliasToYarn(morkEnv* ev,
const morkAlias& inAlias, // typically an alias to concat with strings
mdbYarn* outYarn);
// The parser might ask that some aliases be turned into yarns, so they
// can be concatenated into longer blobs under some circumstances. This
// is an alternative to using a long and complex callback for many parts
// for a single cell value.
// ````` ````` ````` ````` ````` ````` ````` `````
public: // out virtual morkParser methods, data flow parser to subclass
virtual void OnNewPort(morkEnv* ev, const morkPlace& inPlace);
virtual void OnPortGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnPortEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnNewGroup(morkEnv* ev, const morkPlace& inPlace, mork_gid inGid);
virtual void OnGroupGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnGroupCommitEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnGroupAbortEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnNewPortRow(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange);
virtual void OnPortRowGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnPortRowEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnNewTable(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange);
virtual void OnTableGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnTableEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnNewMeta(morkEnv* ev, const morkPlace& inPlace);
virtual void OnMetaGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnMetaEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnNewRow(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange);
virtual void OnRowGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnRowEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnNewDict(morkEnv* ev, const morkPlace& inPlace);
virtual void OnDictGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnDictEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias);
virtual void OnAliasGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnNewCell(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange);
virtual void OnCellGlitch(morkEnv* ev, const morkGlitch& inGlitch);
virtual void OnCellForm(morkEnv* ev, mork_cscode inCharsetFormat);
virtual void OnCellEnd(morkEnv* ev, const morkSpan& inSpan);
virtual void OnValue(morkEnv* ev, const morkSpan& inSpan,
const morkBuf& inBuf);
virtual void OnValueAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias);
virtual void OnRowAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias);
virtual void OnTableAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias);
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public non-poly morkBuilder methods
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakBuilder(morkBuilder* me,
morkEnv* ev, morkBuilder** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongBuilder(morkBuilder* me,
morkEnv* ev, morkBuilder** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKBUILDER_ */

View File

@@ -0,0 +1,120 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKCELL_
#include "morkCell.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
void
morkCell::SetYarn(morkEnv* ev, const mdbYarn* inYarn, morkStore* ioStore)
{
morkAtom* atom = ioStore->YarnToAtom(ev, inYarn);
if ( atom )
this->SetAtom(ev, atom, ioStore->StorePool()); // refcounts atom
}
void
morkCell::GetYarn(morkEnv* ev, mdbYarn* outYarn) const
{
mCell_Atom->GetYarn(outYarn);
}
void
morkCell::AliasYarn(morkEnv* ev, mdbYarn* outYarn) const
{
mCell_Atom->AliasYarn(outYarn);
}
void
morkCell::SetCellDirty()
{
mork_column col = this->GetColumn();
this->SetColumnAndChange(col, morkChange_kAdd);
}
void
morkCell::SetAtom(morkEnv* ev, morkAtom* ioAtom, morkPool* ioPool)
// SetAtom() "acquires" the new ioAtom if non-nil, by calling AddCellUse()
// to increase the refcount, and puts ioAtom into mCell_Atom. If the old
// atom in mCell_Atom is non-nil, then it is "released" first by a call to
// CutCellUse(), and if the use count then becomes zero, then the old atom
// is deallocated by returning it to the pool ioPool. (And this is
// why ioPool is a parameter to this method.) Note that ioAtom can be nil
// to cause the cell to refer to nothing, and the old atom in mCell_Atom
// can also be nil, and all the atom refcounting is handled correctly.
//
// Note that if ioAtom was just created, it typically has a zero use count
// before calling SetAtom(). But use count is one higher after SetAtom().
{
morkAtom* oldAtom = mCell_Atom;
if ( oldAtom != ioAtom ) // ioAtom is not already installed in this cell?
{
if ( oldAtom )
{
mCell_Atom = 0;
if ( oldAtom->CutCellUse(ev) == 0 )
{
if ( ioPool )
{
if ( oldAtom->IsBook() )
((morkBookAtom*) oldAtom)->CutBookAtomFromSpace(ev);
ioPool->ZapAtom(ev, oldAtom);
}
else
ev->NilPointerError();
}
}
if ( ioAtom )
ioAtom->AddCellUse(ev);
mCell_Atom = ioAtom;
}
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,89 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKCELL_
#define _MORKCELL_ 1
#ifndef _MORK_
#include "mork.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDelta_kShift 8 /* 8 bit shift */
#define morkDelta_kChangeMask 0x0FF /* low 8 bit mask */
#define morkDelta_kColumnMask (~ (mork_column) morkDelta_kChangeMask)
#define morkDelta_Init(self,cl,ch) ((self) = ((cl)<<morkDelta_kShift) | (ch))
#define morkDelta_Change(self) ((self) & morkDelta_kChangeMask)
#define morkDelta_Column(self) ((self) >> morkDelta_kShift)
class morkCell { // minimal cell format
public:
mork_delta mCell_Delta; // encoding of both column and change
morkAtom* mCell_Atom; // content in this cell
public:
morkCell() : mCell_Atom( 0 ), mCell_Delta( 0 ) { }
// note if ioAtom is non-nil, caller needs to call ioAtom->AddCellUse():
morkCell(mork_column inCol, mork_change inChange, morkAtom* ioAtom)
{
morkDelta_Init(mCell_Delta, inCol,inChange);
mCell_Atom = ioAtom;
}
// note if ioAtom is non-nil, caller needs to call ioAtom->AddCellUse():
void Init(mork_column inCol, mork_change inChange, morkAtom* ioAtom)
{
morkDelta_Init(mCell_Delta,inCol,inChange);
mCell_Atom = ioAtom;
}
mork_column GetColumn() const { return morkDelta_Column(mCell_Delta); }
mork_change GetChange() const { return morkDelta_Change(mCell_Delta); }
void SetCellDirty();
void SetColumnAndChange(mork_column inCol, mork_change inChange)
{ morkDelta_Init(mCell_Delta, inCol, inChange); }
morkAtom* GetAtom() { return mCell_Atom; }
void SetAtom(morkEnv* ev, morkAtom* ioAtom, morkPool* ioPool);
// SetAtom() "acquires" the new ioAtom if non-nil, by calling AddCellUse()
// to increase the refcount, and puts ioAtom into mCell_Atom. If the old
// atom in mCell_Atom is non-nil, then it is "released" first by a call to
// CutCellUse(), and if the use count then becomes zero, then the old atom
// is deallocated by returning it to the pool ioPool. (And this is
// why ioPool is a parameter to this method.) Note that ioAtom can be nil
// to cause the cell to refer to nothing, and the old atom in mCell_Atom
// can also be nil, and all the atom refcounting is handled correctly.
//
// Note that if ioAtom was just created, it typically has a zero use count
// before calling SetAtom(). But use count is one higher after SetAtom().
void SetYarn(morkEnv* ev, const mdbYarn* inYarn, morkStore* ioStore);
void AliasYarn(morkEnv* ev, mdbYarn* outYarn) const;
void GetYarn(morkEnv* ev, mdbYarn* outYarn) const;
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKCELL_ */

View File

@@ -0,0 +1,233 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKCELLOBJECT_
#include "morkCellObject.h"
#endif
#ifndef _MORKROWOBJECT_
#include "morkRowObject.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
#ifndef _MORKCELL_
#include "morkCell.h"
#endif
#ifndef _ORKINCELL_
#include "orkinCell.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkCellObject::CloseMorkNode(morkEnv* ev) // CloseCellObject() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseCellObject(ev);
this->MarkShut();
}
}
/*public virtual*/
morkCellObject::~morkCellObject() // assert CloseCellObject() executed earlier
{
MORK_ASSERT(mCellObject_Row==0);
}
/*public non-poly*/
morkCellObject::morkCellObject(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkRow* ioRow, morkCell* ioCell,
mork_column inCol, mork_pos inPos)
: morkObject(ev, inUsage, ioHeap, (morkHandle*) 0)
, mCellObject_RowObject( 0 )
, mCellObject_Row( 0 )
, mCellObject_Cell( 0 )
, mCellObject_Col( inCol )
, mCellObject_RowSeed( 0 )
, mCellObject_Pos( (mork_u2) inPos )
{
if ( ev->Good() )
{
if ( ioRow && ioCell )
{
if ( ioRow->IsRow() )
{
morkStore* store = ioRow->GetRowSpaceStore(ev);
if ( store )
{
morkRowObject* rowObj = ioRow->GetRowObject(ev, store);
if ( rowObj )
{
mCellObject_Row = ioRow;
mCellObject_Cell = ioCell;
mCellObject_RowSeed = ioRow->mRow_Seed;
morkRowObject::SlotStrongRowObject(rowObj, ev,
&mCellObject_RowObject);
}
if ( ev->Good() )
mNode_Derived = morkDerived_kCellObject;
}
}
else
ioRow->NonRowTypeError(ev);
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkCellObject::CloseCellObject(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
morkRowObject::SlotStrongRowObject((morkRowObject*) 0, ev,
&mCellObject_RowObject);
mCellObject_Row = 0;
mCellObject_Cell = 0;
mCellObject_RowSeed = 0;
this->CloseObject(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
mork_bool
morkCellObject::ResyncWithRow(morkEnv* ev)
{
morkRow* row = mCellObject_Row;
mork_pos pos = 0;
morkCell* cell = row->GetCell(ev, mCellObject_Col, &pos);
if ( cell )
{
mCellObject_Pos = pos;
mCellObject_Cell = cell;
mCellObject_RowSeed = row->mRow_Seed;
}
else
{
mCellObject_Cell = 0;
this->MissingRowColumnError(ev);
}
return ev->Good();
}
morkAtom*
morkCellObject::GetCellAtom(morkEnv* ev) const
{
morkCell* cell = mCellObject_Cell;
if ( cell )
return cell->GetAtom();
else
this->NilCellError(ev);
return (morkAtom*) 0;
}
/*static*/ void
morkCellObject::WrongRowObjectRowError(morkEnv* ev)
{
ev->NewError("mCellObject_Row != mCellObject_RowObject->mRowObject_Row");
}
/*static*/ void
morkCellObject::NilRowError(morkEnv* ev)
{
ev->NewError("nil mCellObject_Row");
}
/*static*/ void
morkCellObject::NilRowObjectError(morkEnv* ev)
{
ev->NewError("nil mCellObject_RowObject");
}
/*static*/ void
morkCellObject::NilCellError(morkEnv* ev)
{
ev->NewError("nil mCellObject_Cell");
}
/*static*/ void
morkCellObject::NonCellObjectTypeError(morkEnv* ev)
{
ev->NewError("non morkCellObject");
}
/*static*/ void
morkCellObject::MissingRowColumnError(morkEnv* ev)
{
ev->NewError("mCellObject_Col not in mCellObject_Row");
}
nsIMdbCell*
morkCellObject::AcquireCellHandle(morkEnv* ev)
{
nsIMdbCell* outCell = 0;
orkinCell* c = (orkinCell*) mObject_Handle;
if ( c ) // have an old handle?
c->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
c = orkinCell::MakeCell(ev, this);
mObject_Handle = c;
}
if ( c )
outCell = c;
return outCell;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,107 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKCELLOBJECT_
#define _MORKCELLOBJECT_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kCellObject /*i*/ 0x634F /* ascii 'cO' */
class morkCellObject : public morkObject { // blob attribute in column scope
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkFactory* mObject_Factory; // weak ref to suite factory
public: // state is public because the entire Mork system is private
morkRowObject* mCellObject_RowObject; // strong ref to row's object
morkRow* mCellObject_Row; // cell's row if still in row object
morkCell* mCellObject_Cell; // cell in row if rowseed matches
mork_column mCellObject_Col; // col of cell last living in pos
mork_u2 mCellObject_RowSeed; // copy of row's seed
mork_u2 mCellObject_Pos; // position of cell in row
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseCellObject() only if open
virtual ~morkCellObject(); // assert that CloseCellObject() executed earlier
public: // morkCellObject construction & destruction
morkCellObject(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkRow* ioRow, morkCell* ioCell,
mork_column inCol, mork_pos inPos);
void CloseCellObject(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkCellObject(const morkCellObject& other);
morkCellObject& operator=(const morkCellObject& other);
public: // dynamic type identification
mork_bool IsCellObject() const
{ return IsNode() && mNode_Derived == morkDerived_kCellObject; }
// } ===== end morkNode methods =====
public: // other cell node methods
mork_bool ResyncWithRow(morkEnv* ev); // return ev->Good()
morkAtom* GetCellAtom(morkEnv* ev) const;
static void MissingRowColumnError(morkEnv* ev);
static void NilRowError(morkEnv* ev);
static void NilCellError(morkEnv* ev);
static void NilRowObjectError(morkEnv* ev);
static void WrongRowObjectRowError(morkEnv* ev);
static void NonCellObjectTypeError(morkEnv* ev);
nsIMdbCell* AcquireCellHandle(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakCellObject(morkCellObject* me,
morkEnv* ev, morkCellObject** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongCellObject(morkCellObject* me,
morkEnv* ev, morkCellObject** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKCELLOBJECT_ */

View File

@@ -0,0 +1,249 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKCONFIG_
#include "morkConfig.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/* ----- ----- ----- ----- MORK_MAC ----- ----- ----- ----- */
#ifdef MORK_MAC
#include <Types.h>
static void // copied almost verbatim from the IronDoc debugger sources:
mork_mac_break_string(register const char* inMessage) /*i*/
{
Str255 pascalStr; // to hold Pascal string version of inMessage
mork_u4 length = XP_STRLEN(inMessage);
// if longer than maximum 255 bytes, just copy 255 bytes worth
pascalStr[ 0 ] = (length > 255)? 255 : length;
if ( length ) // anything to copy? */
{
register mork_u1* p = ((mork_u1*) &pascalStr) + 1; // after length byte
register mork_u1* end = p + length; // one past last byte to copy
while ( p < end ) // more bytes to copy?
{
register int c = (mork_u1) *inMessage++;
if ( c == ';' ) // c is the MacsBug ';' metacharacter?
c = ':'; // change to ':', rendering harmless in a MacsBug context
*p++ = (mork_u1) c;
}
}
DebugStr(pascalStr); /* call Mac debugger entry point */
}
#endif /*MORK_MAC*/
/* ----- ----- ----- ----- MORK_MAC ----- ----- ----- ----- */
void mork_assertion_signal(const char* inMessage)
{
#ifdef XP_MAC
mork_mac_break_string(inMessage);
#endif /*XP_MAC*/
#ifdef MORK_WIN
// asm { int 3 }
NS_ASSERTION(0, inMessage);
#endif /*MORK_WIN*/
}
#ifdef MORK_PROVIDE_STDLIB
MORK_LIB_IMPL(mork_i4)
mork_memcmp(const void* inOne, const void* inTwo, mork_size inSize)
{
register const mork_u1* t = (const mork_u1*) inTwo;
register const mork_u1* s = (const mork_u1*) inOne;
const mork_u1* end = s + inSize;
register mork_i4 delta;
while ( s < end )
{
delta = ((mork_i4) *s) - ((mork_i4) *t);
if ( delta )
return delta;
else
{
++t;
++s;
}
}
return 0;
}
MORK_LIB_IMPL(void)
mork_memcpy(void* outDst, const void* inSrc, mork_size inSize)
{
register mork_u1* d = (mork_u1*) outDst;
mork_u1* end = d + inSize;
register const mork_u1* s = ((const mork_u1*) inSrc);
while ( inSize >= 8 )
{
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
inSize -= 8;
}
while ( d < end )
*d++ = *s++;
}
MORK_LIB_IMPL(void)
mork_memmove(void* outDst, const void* inSrc, mork_size inSize)
{
register mork_u1* d = (mork_u1*) outDst;
register const mork_u1* s = (const mork_u1*) inSrc;
if ( d != s && inSize ) // copy is necessary?
{
const mork_u1* srcEnd = s + inSize; // one past last source byte
if ( d > s && d < srcEnd ) // overlap? need to copy backwards?
{
s = srcEnd; // start one past last source byte
d += inSize; // start one past last dest byte
mork_u1* dstBegin = d; // last byte to write is first in dest range
while ( d - dstBegin >= 8 )
{
*--d = *--s;
*--d = *--s;
*--d = *--s;
*--d = *--s;
*--d = *--s;
*--d = *--s;
*--d = *--s;
*--d = *--s;
}
while ( d > dstBegin )
*--d = *--s;
}
else // can copy forwards without any overlap
{
mork_u1* dstEnd = d + inSize;
while ( dstEnd - d >= 8 )
{
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
*d++ = *s++;
}
while ( d < dstEnd )
*d++ = *s++;
}
}
}
MORK_LIB_IMPL(void)
mork_memset(void* outDst, int inByte, mork_size inSize)
{
register mork_u1* d = (mork_u1*) outDst;
mork_u1* end = d + inSize;
while ( d < end )
*d++ = (mork_u1) inByte;
}
MORK_LIB_IMPL(void)
mork_strcpy(void* outDst, const void* inSrc)
{
// back up one first to support preincrement
register mork_u1* d = ((mork_u1*) outDst) - 1;
register const mork_u1* s = ((const mork_u1*) inSrc) - 1;
while ( ( *++d = *++s ) != 0 )
/* empty */;
}
MORK_LIB_IMPL(mork_i4)
mork_strcmp(const void* inOne, const void* inTwo)
{
register const mork_u1* t = (const mork_u1*) inTwo;
register const mork_u1* s = ((const mork_u1*) inOne);
register mork_i4 a;
register mork_i4 b;
register mork_i4 delta;
do
{
a = (mork_i4) *s++;
b = (mork_i4) *t++;
delta = a - b;
}
while ( !delta && a && b );
return delta;
}
MORK_LIB_IMPL(mork_i4)
mork_strncmp(const void* inOne, const void* inTwo, mork_size inSize)
{
register const mork_u1* t = (const mork_u1*) inTwo;
register const mork_u1* s = (const mork_u1*) inOne;
const mork_u1* end = s + inSize;
register mork_i4 delta;
register mork_i4 a;
register mork_i4 b;
while ( s < end )
{
a = (mork_i4) *s++;
b = (mork_i4) *t++;
delta = a - b;
if ( delta || !a || !b )
return delta;
}
return 0;
}
MORK_LIB_IMPL(mork_size)
mork_strlen(const void* inString)
{
// back up one first to support preincrement
register const mork_u1* s = ((const mork_u1*) inString) - 1;
while ( *++s ) // preincrement is cheapest
/* empty */;
return s - ((const mork_u1*) inString); // distance from original address
}
#endif /*MORK_PROVIDE_STDLIB*/
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,171 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKCONFIG_
#define _MORKCONFIG_ 1
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// { %%%%% begin debug mode options in Mork %%%%%
#define MORK_DEBUG 1
// } %%%%% end debug mode options in Mork %%%%%
#ifdef MORK_DEBUG
#define MORK_MAX_CODE_COMPILE 1
#endif
// { %%%%% begin platform defs peculiar to Mork %%%%%
#ifdef XP_MAC
#define MORK_MAC 1
#endif
#ifdef XP_OS2
#define MORK_OS2 1
#endif
#ifdef XP_PC
#define MORK_WIN 1
#define XP_WIN 1
#endif
#ifdef XP_UNIX
#define MORK_UNIX 1
#endif
// } %%%%% end platform defs peculiar to Mork %%%%%
#if defined (MORK_WIN) || defined(MORK_UNIX)
#include "stdio.h"
#include "ctype.h"
#include "errno.h"
#include "string.h"
#include "memory.h"
#include "nsDebug.h"
#define MORK_ISPRINT(c) isprint(c)
#define MORK_FILETELL(file) ftell(file)
#define MORK_FILESEEK(file, where, how) fseek(file, where, how)
#define MORK_FILEREAD(outbuf, insize, file) fread(outbuf, insize, 1, file)
#define MORK_FILEFLUSH(file) fflush(file)
#define MORK_FILECLOSE(file) fclose(file)
#endif /*MORK_WIN*/
#ifdef MORK_MAC
#include "xp_file.h"
#include "ctype.h"
#define MORK_ISPRINT(c) isprint(c)
#define MORK_FILETELL(file) XP_FileTell(file)
#define MORK_FILESEEK(file, where, how) XP_FileSeek(file, where, how)
#define MORK_FILEREAD(outbuf, insize, file) XP_FileRead(outbuf, insize, file)
#define MORK_FILEFLUSH(file) XP_FileFlush(file)
#define MORK_FILECLOSE(file) XP_FileClose(file)
#endif /*MORK_MAC*/
/* ===== ===== ===== ===== line characters ===== ===== ===== ===== */
#define mork_kCR '\015'
#define mork_kLF '\012'
#define mork_kVTAB '\013'
#define mork_kFF '\014'
#define mork_kTAB '\011'
#define mork_kCRLF "\015\012" /* A CR LF equivalent string */
#ifdef MORK_MAC
# define mork_kNewline "\015"
# define mork_kNewlineSize 1
#else
# if defined(MORK_WIN) || defined(MORK_OS2)
# define mork_kNewline "\015\012"
# define mork_kNewlineSize 2
# else
# ifdef MORK_UNIX
# define mork_kNewline "\012"
# define mork_kNewlineSize 1
# endif /* MORK_UNIX */
# endif /* MORK_WIN */
#endif /* MORK_MAC */
// { %%%%% begin assertion macro %%%%%
extern void mork_assertion_signal(const char* inMessage);
#define MORK_ASSERTION_SIGNAL(Y) mork_assertion_signal(Y)
#define MORK_ASSERT(X) if (!(X)) MORK_ASSERTION_SIGNAL(#X)
// } %%%%% end assertion macro %%%%%
#define MORK_LIB(return) return /*API return declaration*/
#define MORK_LIB_IMPL(return) return /*implementation return declaration*/
// { %%%%% begin standard c utility methods %%%%%
/*define MORK_USE_XP_STDLIB 1*/
#ifdef MORK_MAC
#define MORK_PROVIDE_STDLIB 1
#endif /*MORK_MAC*/
#ifdef MORK_WIN
#define MORK_USE_C_STDLIB 1
#endif /*MORK_WIN*/
#ifdef MORK_USE_C_STDLIB
#define MORK_MEMCMP(src1,src2,size) memcmp(src1,src2,size)
#define MORK_MEMCPY(dest,src,size) memcpy(dest,src,size)
#define MORK_MEMMOVE(dest,src,size) memmove(dest,src,size)
#define MORK_MEMSET(dest,byte,size) memset(dest,byte,size)
#define MORK_STRCPY(dest,src) strcpy(dest,src)
#define MORK_STRCMP(one,two) strcmp(one,two)
#define MORK_STRNCMP(one,two,length) strncmp(one,two,length)
#define MORK_STRLEN(string) strlen(string)
#endif /*MORK_USE_C_STDLIB*/
#ifdef MORK_PROVIDE_STDLIB
MORK_LIB(mork_i4) mork_memcmp(const void* a, const void* b, mork_size inSize);
MORK_LIB(void) mork_memcpy(void* dst, const void* src, mork_size inSize);
MORK_LIB(void) mork_memmove(void* dst, const void* src, mork_size inSize);
MORK_LIB(void) mork_memset(void* dst, int inByte, mork_size inSize);
MORK_LIB(void) mork_strcpy(void* dst, const void* src);
MORK_LIB(mork_i4) mork_strcmp(const void* a, const void* b);
MORK_LIB(mork_i4) mork_strncmp(const void* a, const void* b, mork_size inSize);
MORK_LIB(mork_size) mork_strlen(const void* inString);
#define MORK_MEMCMP(src1,src2,size) mork_memcmp(src1,src2,size)
#define MORK_MEMCPY(dest,src,size) mork_memcpy(dest,src,size)
#define MORK_MEMMOVE(dest,src,size) mork_memmove(dest,src,size)
#define MORK_MEMSET(dest,byte,size) mork_memset(dest,byte,size)
#define MORK_STRCPY(dest,src) mork_strcpy(dest,src)
#define MORK_STRCMP(one,two) mork_strcmp(one,two)
#define MORK_STRNCMP(one,two,length) mork_strncmp(one,two,length)
#define MORK_STRLEN(string) mork_strlen(string)
#endif /*MORK_PROVIDE_STDLIB*/
#ifdef MORK_USE_XP_STDLIB
#define MORK_MEMCMP(src1,src2,size) XP_MEMCMP(src1,src2,size)
#define MORK_MEMCPY(dest,src,size) XP_MEMCPY(dest,src,size)
#define MORK_MEMMOVE(dest,src,size) XP_MEMMOVE(dest,src,size)
#define MORK_MEMSET(dest,byte,size) XP_MEMSET(dest,byte,size)
#define MORK_STRCPY(dest,src) XP_STRCPY(dest,src)
#define MORK_STRCMP(one,two) XP_STRCMP(one,two)
#define MORK_STRNCMP(one,two,length) XP_STRNCMP(one,two,length)
#define MORK_STRLEN(string) XP_STRLEN(string)
#endif /*MORK_USE_XP_STDLIB*/
// } %%%%% end standard c utility methods %%%%%
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKCONFIG_ */

View File

@@ -0,0 +1,98 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKCURSOR_
#include "morkCursor.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkCursor::CloseMorkNode(morkEnv* ev) // CloseCursor() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseCursor(ev);
this->MarkShut();
}
}
/*public virtual*/
morkCursor::~morkCursor() // assert CloseCursor() executed earlier
{
}
/*public non-poly*/
morkCursor::morkCursor(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap)
: morkObject(ev, inUsage, ioHeap, (morkHandle*) 0)
, mCursor_Seed( 0 )
, mCursor_Pos( -1 )
, mCursor_DoFailOnSeedOutOfSync( morkBool_kFalse )
{
if ( ev->Good() )
mNode_Derived = morkDerived_kCursor;
}
/*public non-poly*/ void
morkCursor::CloseCursor(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
mCursor_Seed = 0;
mCursor_Pos = -1;
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,88 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKCURSOR_
#define _MORKCURSOR_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kCursor /*i*/ 0x4375 /* ascii 'Cu' */
class morkCursor : public morkObject { // collection iterator
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkFactory* mObject_Factory; // weak ref to suite factory
public: // state is public because the entire Mork system is private
mork_seed mCursor_Seed;
mork_pos mCursor_Pos;
mork_bool mCursor_DoFailOnSeedOutOfSync;
mork_u1 mCursor_Pad[ 3 ]; // explicitly pad to u4 alignment
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseCursor() only if open
virtual ~morkCursor(); // assert that CloseCursor() executed earlier
public: // morkCursor construction & destruction
morkCursor(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap);
void CloseCursor(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkCursor(const morkCursor& other);
morkCursor& operator=(const morkCursor& other);
public: // dynamic type identification
mork_bool IsCursor() const
{ return IsNode() && mNode_Derived == morkDerived_kCursor; }
// } ===== end morkNode methods =====
public: // other cursor methods
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakCursor(morkCursor* me,
morkEnv* ev, morkCursor** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongCursor(morkCursor* me,
morkEnv* ev, morkCursor** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKCURSOR_ */

View File

@@ -0,0 +1,125 @@
/*************************************************************************
This software is part of a public domain IronDoc source code distribution,
and is provided on an "AS IS" basis, with all risks borne by the consumers
or users of the IronDoc software. There are no warranties, guarantees, or
promises about quality of any kind; and no remedies for failure exist.
Permission is hereby granted to use this IronDoc software for any purpose
at all, without need for written agreements, without royalty or license
fees, and without fees or obligations of any other kind. Anyone can use,
copy, change and distribute this software for any purpose, and nothing is
required, implicitly or otherwise, in exchange for this usage.
You cannot apply your own copyright to this software, but otherwise you
are encouraged to enjoy the use of this software in any way you see fit.
However, it would be rude to remove names of developers from the code.
(IronDoc is also known by the short name "Fe" and a longer name "Ferrum",
which are used interchangeably with the name IronDoc in the sources.)
*************************************************************************/
/*
* File: morkDeque.cpp
* Contains: Ferrum deque (double ended queue (linked list))
*
* Copied directly from public domain IronDoc, with minor naming tweaks:
* Designed and written by David McCusker, but all this code is public domain.
* There are no warranties, no guarantees, no promises, and no remedies.
*/
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKDEQUE_
#include "morkDeque.h"
#endif
/*| RemoveFirst:
|*/
morkLink*
morkDeque::RemoveFirst() /*i*/
{
morkLink* link = mDeque_Head.mLink_Next;
if ( link != &mDeque_Head )
{
(mDeque_Head.mLink_Next = link->mLink_Next)->mLink_Prev =
&mDeque_Head;
return link;
}
return (morkLink*) 0;
}
/*| RemoveLast:
|*/
morkLink*
morkDeque::RemoveLast() /*i*/
{
morkLink* link = mDeque_Head.mLink_Prev;
if ( link != &mDeque_Head )
{
(mDeque_Head.mLink_Prev = link->mLink_Prev)->mLink_Next =
&mDeque_Head;
return link;
}
return (morkLink*) 0;
}
/*| At:
|*/
morkLink*
morkDeque::At(mork_pos index) const /*i*/
/* indexes are one based (and not zero based) */
{
register mork_num count = 0;
register morkLink* link;
for ( link = this->First(); link; link = this->After(link) )
{
if ( ++count == index )
break;
}
return link;
}
/*| IndexOf:
|*/
mork_pos
morkDeque::IndexOf(const morkLink* member) const /*i*/
/* indexes are one based (and not zero based) */
/* zero means member is not in deque */
{
register mork_num count = 0;
register const morkLink* link;
for ( link = this->First(); link; link = this->After(link) )
{
++count;
if ( member == link )
return count;
}
return 0;
}
/*| Length:
|*/
mork_num
morkDeque::Length() const /*i*/
{
register mork_num count = 0;
register morkLink* link;
for ( link = this->First(); link; link = this->After(link) )
++count;
return count;
}
/*| LengthCompare:
|*/
int
morkDeque::LengthCompare(mork_num c) const /*i*/
{
register mork_num count = 0;
register const morkLink* link;
for ( link = this->First(); link; link = this->After(link) )
{
if ( ++count > c )
return 1;
}
return ( count == c )? 0 : -1;
}

View File

@@ -0,0 +1,149 @@
/*************************************************************************
This software is part of a public domain IronDoc source code distribution,
and is provided on an "AS IS" basis, with all risks borne by the consumers
or users of the IronDoc software. There are no warranties, guarantees, or
promises about quality of any kind; and no remedies for failure exist.
Permission is hereby granted to use this IronDoc software for any purpose
at all, without need for written agreements, without royalty or license
fees, and without fees or obligations of any other kind. Anyone can use,
copy, change and distribute this software for any purpose, and nothing is
required, implicitly or otherwise, in exchange for this usage.
You cannot apply your own copyright to this software, but otherwise you
are encouraged to enjoy the use of this software in any way you see fit.
However, it would be rude to remove names of developers from the code.
(IronDoc is also known by the short name "Fe" and a longer name "Ferrum",
which are used interchangeably with the name IronDoc in the sources.)
*************************************************************************/
/*
* File: morkDeque.h
* Contains: Ferrum deque (double ended queue (linked list))
*
* Copied directly from public domain IronDoc, with minor naming tweaks:
* Designed and written by David McCusker, but all this code is public domain.
* There are no warranties, no guarantees, no promises, and no remedies.
*/
#ifndef _MORKDEQUE_
#define _MORKDEQUE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
/*=============================================================================
* morkLink: linked list node embedded in objs to allow insertion in morkDeques
*/
class morkLink /*d*/ {
public:
morkLink* mLink_Next;
morkLink* mLink_Prev;
public:
morkLink* Next() const { return mLink_Next; }
morkLink* Prev() const { return mLink_Prev; }
void SelfRefer() { mLink_Next = mLink_Prev = this; }
void Clear() { mLink_Next = mLink_Prev = 0; }
void AddBefore(morkLink* old)
{
((old)->mLink_Prev->mLink_Next = (this))->mLink_Prev = (old)->mLink_Prev;
((this)->mLink_Next = (old))->mLink_Prev = this;
}
void AddAfter(morkLink* old)
{
((old)->mLink_Next->mLink_Prev = (this))->mLink_Next = (old)->mLink_Next;
((this)->mLink_Prev = (old))->mLink_Next = this;
}
void Remove()
{
(mLink_Prev->mLink_Next = mLink_Next)->mLink_Prev = mLink_Prev;
}
};
/*=============================================================================
* morkDeque: doubly linked list modeled after VAX queue instructions
*/
class morkDeque /*d*/ {
public:
morkLink mDeque_Head;
public: // construction
morkDeque() { mDeque_Head.SelfRefer(); }
public:// methods
morkLink* RemoveFirst();
morkLink* RemoveLast();
morkLink* At(mork_pos index) const ; /* one-based, not zero-based */
mork_pos IndexOf(const morkLink* inMember) const;
/* one-based index ; zero means member is not in deque */
mork_num Length() const;
/* the following method is more efficient for long lists: */
int LengthCompare(mork_num inCount) const;
/* -1: length < count, 0: length == count, 1: length > count */
public: // inlines
mork_bool IsEmpty()const
{ return (mDeque_Head.mLink_Next == (morkLink*) &mDeque_Head); }
morkLink* After(const morkLink* old) const
{ return (((old)->mLink_Next != &mDeque_Head)?
(old)->mLink_Next : (morkLink*) 0); }
morkLink* Before(const morkLink* old) const
{ return (((old)->mLink_Prev != &mDeque_Head)?
(old)->mLink_Prev : (morkLink*) 0); }
morkLink* First() const
{ return ((mDeque_Head.mLink_Next != &mDeque_Head)?
mDeque_Head.mLink_Next : (morkLink*) 0); }
morkLink* Last() const
{ return ((mDeque_Head.mLink_Prev != &mDeque_Head)?
mDeque_Head.mLink_Prev : (morkLink*) 0); }
/*
From IronDoc documentation for AddFirst:
+--------+ +--------+ +--------+ +--------+ +--------+
| h.next |-->| b.next | | h.next |-->| a.next |-->| b.next |
+--------+ +--------+ ==> +--------+ +--------+ +--------+
| h.prev |<--| b.prev | | h.prev |<--| a.prev |<--| b.prev |
+--------+ +--------+ +--------+ +--------+ +--------+
*/
void AddFirst(morkLink* in) /*i*/
{
( (mDeque_Head.mLink_Next->mLink_Prev =
(in))->mLink_Next = mDeque_Head.mLink_Next,
((in)->mLink_Prev = &mDeque_Head)->mLink_Next = (in) );
}
/*
From IronDoc documentation for AddLast:
+--------+ +--------+ +--------+ +--------+ +--------+
| y.next |-->| h.next | | y.next |-->| z.next |-->| h.next |
+--------+ +--------+ ==> +--------+ +--------+ +--------+
| y.prev |<--| h.prev | | y.prev |<--| z.prev |<--| h.prev |
+--------+ +--------+ +--------+ +--------+ +--------+
*/
void AddLast(morkLink* in)
{
( (mDeque_Head.mLink_Prev->mLink_Next =
(in))->mLink_Prev = mDeque_Head.mLink_Prev,
((in)->mLink_Next = &mDeque_Head)->mLink_Prev = (in) );
}
};
#endif /* _MORKDEQUE_ */

View File

@@ -0,0 +1,406 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _ORKINENV_
#include "orkinEnv.h"
#endif
#ifndef _MORKFACTORY_
#include "morkFactory.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkEnv::CloseMorkNode(morkEnv* ev) /*i*/ // CloseEnv() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseEnv(ev);
this->MarkShut();
}
}
/*public virtual*/
morkEnv::~morkEnv() /*i*/ // assert CloseEnv() executed earlier
{
MORK_ASSERT(mEnv_SelfAsMdbEnv==0);
MORK_ASSERT(mEnv_ErrorHook==0);
}
/*public non-poly*/
morkEnv::morkEnv(const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkFactory* ioFactory, nsIMdbHeap* ioSlotHeap)
: morkObject(inUsage, ioHeap)
, mEnv_Factory( ioFactory )
, mEnv_Heap( ioSlotHeap )
, mEnv_SelfAsMdbEnv( 0 )
, mEnv_ErrorHook( 0 )
, mEnv_HandlePool( 0 )
, mEnv_ErrorCount( 0 )
, mEnv_WarningCount( 0 )
, mEnv_ErrorCode( 0 )
, mEnv_DoTrace( morkBool_kFalse )
, mEnv_AutoClear( morkAble_kDisabled )
, mEnv_ShouldAbort( morkBool_kFalse )
{
MORK_ASSERT(ioSlotHeap && ioFactory );
if ( ioSlotHeap )
{
// mEnv_Heap is NOT refcounted:
// nsIMdbHeap_SlotStrongHeap(ioSlotHeap, this, &mEnv_Heap);
mEnv_HandlePool = new morkPool(morkUsage::kGlobal,
(nsIMdbHeap*) 0, ioSlotHeap);
MORK_ASSERT(mEnv_HandlePool);
if ( mEnv_HandlePool && this->Good() )
{
mNode_Derived = morkDerived_kEnv;
mNode_Refs += morkEnv_kWeakRefCountEnvBonus;
}
}
}
/*public non-poly*/
morkEnv::morkEnv(morkEnv* ev, /*i*/
const morkUsage& inUsage, nsIMdbHeap* ioHeap, nsIMdbEnv* inSelfAsMdbEnv,
morkFactory* ioFactory, nsIMdbHeap* ioSlotHeap)
: morkObject(ev, inUsage, ioHeap, (morkHandle*) 0)
, mEnv_Factory( ioFactory )
, mEnv_Heap( ioSlotHeap )
, mEnv_SelfAsMdbEnv( inSelfAsMdbEnv )
, mEnv_ErrorHook( 0 )
, mEnv_HandlePool( 0 )
, mEnv_ErrorCount( 0 )
, mEnv_WarningCount( 0 )
, mEnv_ErrorCode( 0 )
, mEnv_DoTrace( morkBool_kFalse )
, mEnv_AutoClear( morkAble_kDisabled )
{
// $$$ do we need to refcount the inSelfAsMdbEnv nsIMdbEnv??
if ( ioFactory && inSelfAsMdbEnv && ioSlotHeap)
{
// mEnv_Heap is NOT refcounted:
// nsIMdbHeap_SlotStrongHeap(ioSlotHeap, ev, &mEnv_Heap);
mEnv_HandlePool = new(*ioSlotHeap, ev) morkPool(ev,
morkUsage::kHeap, ioSlotHeap, ioSlotHeap);
MORK_ASSERT(mEnv_HandlePool);
if ( mEnv_HandlePool && ev->Good() )
{
mNode_Derived = morkDerived_kEnv;
mNode_Refs += morkEnv_kWeakRefCountEnvBonus;
}
}
else
ev->NilPointerError();
}
/*public non-poly*/ void
morkEnv::CloseEnv(morkEnv* ev) /*i*/ // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
// $$$ release mEnv_SelfAsMdbEnv??
// $$$ release mEnv_ErrorHook??
mEnv_SelfAsMdbEnv = 0;
mEnv_ErrorHook = 0;
// mEnv_Factory is NOT refcounted
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
mork_size
morkEnv::OidAsHex(void* outBuf, const mdbOid& inOid)
// sprintf(buf, "%lX:^%lX", (long) inOid.mOid_Id, (long) inOid.mOid_Scope);
{
mork_u1* p = (mork_u1*) outBuf;
mork_size idSize = this->TokenAsHex(p, inOid.mOid_Id);
p += idSize;
*p++ = ':';
*p++ = '^';
mork_size scopeSize = this->TokenAsHex(p, inOid.mOid_Scope);
return idSize + scopeSize + 2;
}
mork_size
morkEnv::TokenAsHex(void* outBuf, mork_token inToken)
// TokenAsHex() is the same as sprintf(outBuf, "%lX", (long) inToken);
{
static const char* morkEnv_kHexDigits = "0123456789ABCDEF";
char* p = (char*) outBuf;
char* end = p + 32; // write no more than 32 digits for safety
if ( inToken )
{
// first write all the hex digits in backwards order:
while ( p < end && inToken ) // more digits to write?
{
*p++ = morkEnv_kHexDigits[ inToken & 0x0F ]; // low four bits
inToken >>= 4; // we fervently hope this does not sign extend
}
*p = 0; // end the string with a null byte
char* s = (char*) outBuf; // first byte in string
mork_size size = p - s; // distance from start
// now reverse the string in place:
// note that p starts on the null byte, so we need predecrement:
while ( --p > s ) // need to swap another byte in the string?
{
char c = *p; // temp for swap
*p = *s;
*s++ = c; // move s forward here, and p backward in the test
}
return size;
}
else // special case for zero integer
{
*p++ = '0'; // write a zero digit
*p = 0; // end with a null byte
return 1; // one digit in hex representation
}
}
char*
morkEnv::CopyString(nsIMdbHeap* ioHeap, const char* inString)
{
char* outString = 0;
if ( ioHeap && inString )
{
mork_size size = MORK_STRLEN(inString) + 1;
ioHeap->Alloc(this->AsMdbEnv(), size, (void**) &outString);
if ( outString )
MORK_STRCPY(outString, inString);
}
else
this->NilPointerError();
return outString;
}
void
morkEnv::FreeString(nsIMdbHeap* ioHeap, char* ioString)
{
if ( ioHeap )
{
if ( ioString )
ioHeap->Free(this->AsMdbEnv(), ioString);
}
else
this->NilPointerError();
}
nsIMdbEnv*
morkEnv::AcquireEnvHandle(morkEnv* ev)
{
nsIMdbEnv* outEnv = 0;
orkinEnv* e = (orkinEnv*) mObject_Handle;
if ( e ) // have an old handle?
e->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
e = orkinEnv::MakeEnv(ev, this);
mObject_Handle = e;
}
if ( e )
outEnv = e;
return outEnv;
}
void
morkEnv::NewErrorAndCode(const char* inString, mork_u2 inCode)
{
MORK_ASSERT(morkBool_kFalse); // get developer's attention
++mEnv_ErrorCount;
mEnv_ErrorCode = (inCode)? inCode: morkEnv_kGenericError;
if ( mEnv_ErrorHook )
mEnv_ErrorHook->OnErrorString(this->AsMdbEnv(), inString);
}
void
morkEnv::NewError(const char* inString)
{
MORK_ASSERT(morkBool_kFalse); // get developer's attention
++mEnv_ErrorCount;
mEnv_ErrorCode = morkEnv_kGenericError;
if ( mEnv_ErrorHook )
mEnv_ErrorHook->OnErrorString(this->AsMdbEnv(), inString);
}
void
morkEnv::NewWarning(const char* inString)
{
MORK_ASSERT(morkBool_kFalse); // get developer's attention
++mEnv_WarningCount;
if ( mEnv_ErrorHook )
mEnv_ErrorHook->OnWarningString(this->AsMdbEnv(), inString);
}
void
morkEnv::StubMethodOnlyError()
{
this->NewError("method is stub only");
}
void
morkEnv::OutOfMemoryError()
{
this->NewError("out of memory");
}
void
morkEnv::NilPointerError()
{
this->NewError("nil pointer");
}
void
morkEnv::NewNonEnvError()
{
this->NewError("non-env instance");
}
void
morkEnv::NilEnvSlotError()
{
if ( !mEnv_HandlePool || !mEnv_Factory )
{
if ( !mEnv_HandlePool )
this->NewError("nil mEnv_HandlePool");
if ( !mEnv_Factory )
this->NewError("nil mEnv_Factory");
}
else
this->NewError("unknown nil env slot");
}
void morkEnv::NonEnvTypeError(morkEnv* ev)
{
ev->NewError("non morkEnv");
}
void
morkEnv::ClearMorkErrorsAndWarnings()
{
mEnv_ErrorCount = 0;
mEnv_WarningCount = 0;
mEnv_ErrorCode = 0;
mEnv_ShouldAbort = morkBool_kFalse;
}
void
morkEnv::AutoClearMorkErrorsAndWarnings()
{
if ( this->DoAutoClear() )
{
mEnv_ErrorCount = 0;
mEnv_WarningCount = 0;
mEnv_ErrorCode = 0;
mEnv_ShouldAbort = morkBool_kFalse;
}
}
/*static*/ morkEnv*
morkEnv::FromMdbEnv(nsIMdbEnv* ioEnv) // dynamic type checking
{
morkEnv* outEnv = 0;
if ( ioEnv )
{
// Note this cast is expected to perform some address adjustment of the
// pointer, so oenv likely does not equal ioEnv. Do not cast to void*
// first to force an exactly equal pointer (we tried it and it's wrong).
orkinEnv* oenv = (orkinEnv*) ioEnv;
if ( oenv->IsHandle() )
{
if ( oenv->IsOpenNode() )
{
morkEnv* ev = (morkEnv*) oenv->mHandle_Object;
if ( ev && ev->IsEnv() )
{
if ( ev->DoAutoClear() )
{
ev->mEnv_ErrorCount = 0;
ev->mEnv_WarningCount = 0;
ev->mEnv_ErrorCode = 0;
}
outEnv = ev;
}
else
MORK_ASSERT(outEnv);
}
else
MORK_ASSERT(outEnv);
}
else
MORK_ASSERT(outEnv);
}
else
MORK_ASSERT(outEnv);
return outEnv;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,187 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKENV_
#define _MORKENV_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kEnv /*i*/ 0x4576 /* ascii 'Ev' */
#define morkEnv_kNoError 0 /* no error has happened */
#define morkEnv_kGenericError 1 /* non-specific error code */
#define morkEnv_kNonEnvTypeError 2 /* morkEnv::IsEnv() is false */
#define morkEnv_kStubMethodOnlyError 3
#define morkEnv_kOutOfMemoryError 4
#define morkEnv_kNilPointerError 5
#define morkEnv_kNewNonEnvError 6
#define morkEnv_kNilEnvSlotError 7
#define morkEnv_kBadFactoryError 8
#define morkEnv_kBadFactoryEnvError 9
#define morkEnv_kBadEnvError 10
#define morkEnv_kNonHandleTypeError 11
#define morkEnv_kNonOpenNodeError 12
#define morkEnv_kWeakRefCountEnvBonus 16 /* try to leak all env instances */
/*| morkEnv:
|*/
class morkEnv : public morkObject {
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkHandle* mObject_Handle; // weak ref to handle for this object
public: // state is public because the entire Mork system is private
morkFactory* mEnv_Factory; // NON-refcounted factory
nsIMdbHeap* mEnv_Heap; // NON-refcounted heap
nsIMdbEnv* mEnv_SelfAsMdbEnv;
nsIMdbErrorHook* mEnv_ErrorHook;
morkPool* mEnv_HandlePool; // pool for re-using handles
mork_u2 mEnv_ErrorCount;
mork_u2 mEnv_WarningCount;
mork_u4 mEnv_ErrorCode; // simple basis for mdb_err style errors
mork_bool mEnv_DoTrace;
mork_able mEnv_AutoClear;
mork_bool mEnv_ShouldAbort;
mork_bool mEnv_Pad;
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseEnv() only if open
virtual ~morkEnv(); // assert that CloseEnv() executed earlier
public: // morkEnv construction & destruction
morkEnv(const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkFactory* ioFactory, nsIMdbHeap* ioSlotHeap);
morkEnv(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
nsIMdbEnv* inSelfAsMdbEnv, morkFactory* ioFactory,
nsIMdbHeap* ioSlotHeap);
void CloseEnv(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkEnv(const morkEnv& other);
morkEnv& operator=(const morkEnv& other);
public: // dynamic type identification
mork_bool IsEnv() const
{ return IsNode() && mNode_Derived == morkDerived_kEnv; }
// } ===== end morkNode methods =====
public: // utility env methods
mork_size TokenAsHex(void* outBuf, mork_token inToken);
// TokenAsHex() is the same as sprintf(outBuf, "%lX", (long) inToken);
mork_size OidAsHex(void* outBuf, const mdbOid& inOid);
// sprintf(buf, "%lX:^%lX", (long) inOid.mOid_Id, (long) inOid.mOid_Scope);
char* CopyString(nsIMdbHeap* ioHeap, const char* inString);
void FreeString(nsIMdbHeap* ioHeap, char* ioString);
public: // other env methods
nsIMdbEnv* AcquireEnvHandle(morkEnv* ev); // mObject_Handle
// alloc and free individual handles in mEnv_HandlePool:
morkHandleFace* NewHandle(mork_size inSize)
{ return mEnv_HandlePool->NewHandle(this, inSize); }
void ZapHandle(morkHandleFace* ioHandle)
{ mEnv_HandlePool->ZapHandle(this, ioHandle); }
void EnableAutoClear() { mEnv_AutoClear = morkAble_kEnabled; }
void DisableAutoClear() { mEnv_AutoClear = morkAble_kDisabled; }
mork_bool DoAutoClear() const
{ return mEnv_AutoClear == morkAble_kEnabled; }
void NewErrorAndCode(const char* inString, mork_u2 inCode);
void NewError(const char* inString);
void NewWarning(const char* inString);
void ClearMorkErrorsAndWarnings(); // clear both errors & warnings
void AutoClearMorkErrorsAndWarnings(); // clear if auto is enabled
void StubMethodOnlyError();
void OutOfMemoryError();
void NilPointerError();
void NewNonEnvError();
void NilEnvSlotError();
void NonEnvTypeError(morkEnv* ev);
// canonical env convenience methods to check for presence of errors:
mork_bool Good() const { return ( mEnv_ErrorCount == 0 ); }
mork_bool Bad() const { return ( mEnv_ErrorCount != 0 ); }
nsIMdbEnv* AsMdbEnv() { return mEnv_SelfAsMdbEnv; }
static morkEnv* FromMdbEnv(nsIMdbEnv* ioEnv); // dynamic type checking
mork_u2 ErrorCode() const { return mEnv_ErrorCode; }
mdb_err AsErr() const { return (mdb_err) mEnv_ErrorCode; }
//mdb_err AsErr() const { return (mdb_err) ( mEnv_ErrorCount != 0 ); }
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakEnv(morkEnv* me,
morkEnv* ev, morkEnv** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongEnv(morkEnv* me,
morkEnv* ev, morkEnv** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKENV_ */

View File

@@ -0,0 +1,159 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKFACTORY_
#include "morkFactory.h"
#endif
#ifndef _ORKINFACTORY_
#include "orkinFactory.h"
#endif
#ifndef _ORKINHEAP_
#include "orkinHeap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkFactory::CloseMorkNode(morkEnv* ev) /*i*/ // CloseFactory() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseFactory(ev);
this->MarkShut();
}
}
/*public virtual*/
morkFactory::~morkFactory() /*i*/ // assert CloseFactory() executed earlier
{
MORK_ASSERT(mFactory_Env.IsShutNode());
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkFactory::morkFactory() // uses orkinHeap
: morkObject(morkUsage::kGlobal, (nsIMdbHeap*) 0)
, mFactory_Heap()
, mFactory_Env(morkUsage::kMember, (nsIMdbHeap*) 0, this,
new orkinHeap())
{
if ( mFactory_Env.Good() )
{
mNode_Derived = morkDerived_kFactory;
mNode_Refs += morkFactory_kWeakRefCountBonus;
}
}
/*public non-poly*/
morkFactory::morkFactory(nsIMdbHeap* ioHeap)
: morkObject(morkUsage::kHeap, ioHeap)
, mFactory_Heap()
, mFactory_Env(morkUsage::kMember, (nsIMdbHeap*) 0, this, ioHeap)
{
if ( mFactory_Env.Good() )
{
mNode_Derived = morkDerived_kFactory;
mNode_Refs += morkFactory_kWeakRefCountBonus;
}
}
/*public non-poly*/
morkFactory::morkFactory(morkEnv* ev, /*i*/
const morkUsage& inUsage, nsIMdbHeap* ioHeap)
: morkObject(ev, inUsage, ioHeap, (morkHandle*) 0)
, mFactory_Env(morkUsage::kMember, (nsIMdbHeap*) 0, this, ioHeap)
, mFactory_Heap()
{
if ( ev->Good() )
{
mNode_Derived = morkDerived_kFactory;
mNode_Refs += morkFactory_kWeakRefCountBonus;
}
}
/*public non-poly*/ void
morkFactory::CloseFactory(morkEnv* ev) /*i*/ // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
mFactory_Env.CloseMorkNode(ev);
this->CloseObject(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
nsIMdbFactory*
morkFactory::AcquireFactoryHandle(morkEnv* ev) // mObject_Handle
{
nsIMdbFactory* outFactory = 0;
orkinFactory* f = (orkinFactory*) mObject_Handle;
if ( f ) // have an old handle?
f->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
f = orkinFactory::MakeFactory(ev, this);
mObject_Handle = f;
}
if ( f )
outFactory = f;
return outFactory;
}
void
morkFactory::NonFactoryTypeError(morkEnv* ev)
{
ev->NewError("non morkFactory");
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,117 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKFACTORY_
#define _MORKFACTORY_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
#ifndef _ORKINHEAP_
#include "orkinHeap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class nsIMdbFactory;
#define morkDerived_kFactory /*i*/ 0x4663 /* ascii 'Fc' */
#define morkFactory_kWeakRefCountBonus 16 /* try to leak all factories */
/*| morkFactory:
|*/
class morkFactory : public morkObject { // nsIMdbObject
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkHandle* mObject_Handle; // weak ref to handle for this object
public: // state is public because the entire Mork system is private
morkEnv mFactory_Env; // private env instance used internally
orkinHeap mFactory_Heap;
// { ===== begin morkNode interface =====
public: // morkFactory virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseFactory() only if open
virtual ~morkFactory(); // assert that CloseFactory() executed earlier
public: // morkYarn construction & destruction
morkFactory(); // uses orkinHeap
morkFactory(nsIMdbHeap* ioHeap); // caller supplied heap
morkFactory(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap);
void CloseFactory(morkEnv* ev); // called by CloseMorkNode();
public: // morkNode memory management operators
void* operator new(size_t inSize)
{ return ::operator new(inSize); }
void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev)
{ return morkNode::MakeNew(inSize, ioHeap, ev); }
void operator delete(void* ioAddress)
{ morkNode::OnDeleteAssert(ioAddress); }
// do NOT call delete on morkNode instances. Call ZapOld() instead.
private: // copying is not allowed
morkFactory(const morkFactory& other);
morkFactory& operator=(const morkFactory& other);
public: // dynamic type identification
mork_bool IsFactory() const
{ return IsNode() && mNode_Derived == morkDerived_kFactory; }
// } ===== end morkNode methods =====
public: // other factory methods
nsIMdbFactory* AcquireFactoryHandle(morkEnv* ev); // mObject_Handle
void NonFactoryTypeError(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakFactory(morkFactory* me,
morkEnv* ev, morkFactory** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongFactory(morkFactory* me,
morkEnv* ev, morkFactory** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKFACTORY_ */

View File

@@ -0,0 +1,716 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKFILE_
#include "morkFile.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkFile::CloseMorkNode(morkEnv* ev) // CloseFile() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseFile(ev);
this->MarkShut();
}
}
/*public virtual*/
morkFile::~morkFile() // assert CloseFile() executed earlier
{
MORK_ASSERT(mFile_Frozen==0);
MORK_ASSERT(mFile_DoTrace==0);
MORK_ASSERT(mFile_IoOpen==0);
MORK_ASSERT(mFile_Active==0);
}
/*public non-poly*/
morkFile::morkFile(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkNode(ev, inUsage, ioHeap)
, mFile_Frozen( 0 )
, mFile_DoTrace( 0 )
, mFile_IoOpen( 0 )
, mFile_Active( 0 )
, mFile_SlotHeap( 0 )
, mFile_Name( 0 )
{
if ( ev->Good() )
{
if ( ioSlotHeap )
{
nsIMdbHeap_SlotStrongHeap(ioSlotHeap, ev, &mFile_SlotHeap);
if ( ev->Good() )
mNode_Derived = morkDerived_kFile;
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkFile::CloseFile(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
mFile_Frozen = 0;
mFile_DoTrace = 0;
mFile_IoOpen = 0;
mFile_Active = 0;
if ( mFile_Name )
this->SetFileName(ev, (const char*) 0);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*virtual*/ void
morkFile::BecomeTrunk(morkEnv* ev)
// If this file is a file version branch created by calling AcquireBud(),
// BecomeTrunk() causes this file's content to replace the original
// file's content, typically by assuming the original file's identity.
// This default implementation of BecomeTrunk() does nothing, and this
// is appropriate behavior for files which are not branches, and is
// also the right behavior for files returned from AcquireBud() which are
// in fact the original file that has been truncated down to zero length.
{
this->Flush(ev);
}
/*static*/ morkFile*
morkFile::OpenOldFile(morkEnv* ev, nsIMdbHeap* ioHeap,
const char* inFilePath, mork_bool inFrozen)
// Choose some subclass of morkFile to instantiate, in order to read
// (and write if not frozen) the file known by inFilePath. The file
// returned should be open and ready for use, and presumably positioned
// at the first byte position of the file. The exact manner in which
// files must be opened is considered a subclass specific detail, and
// other portions or Mork source code don't want to know how it's done.
{
return morkStdioFile::OpenOldStdioFile(ev, ioHeap, inFilePath, inFrozen);
}
/*static*/ morkFile*
morkFile::CreateNewFile(morkEnv* ev, nsIMdbHeap* ioHeap,
const char* inFilePath)
// Choose some subclass of morkFile to instantiate, in order to read
// (and write if not frozen) the file known by inFilePath. The file
// returned should be created and ready for use, and presumably positioned
// at the first byte position of the file. The exact manner in which
// files must be opened is considered a subclass specific detail, and
// other portions or Mork source code don't want to know how it's done.
{
return morkStdioFile::CreateNewStdioFile(ev, ioHeap, inFilePath);
}
void
morkFile::NewMissingIoError(morkEnv* ev) const
{
ev->NewError("file missing io");
}
/*static*/ void
morkFile::NilSlotHeapError(morkEnv* ev)
{
ev->NewError("nil mFile_SlotHeap");
}
/*static*/ void
morkFile::NilFileNameError(morkEnv* ev)
{
ev->NewError("nil mFile_Name");
}
void
morkFile::SetFileName(morkEnv* ev, const char* inName) // inName can be nil
{
nsIMdbHeap* heap = mFile_SlotHeap;
if ( heap )
{
char* name = mFile_Name;
if ( name )
{
mFile_Name = 0;
ev->FreeString(heap, name);
}
if ( ev->Good() && inName )
mFile_Name = ev->CopyString(heap, inName);
}
else
this->NilSlotHeapError(ev);
}
void
morkFile::NewFileDownError(morkEnv* ev) const
// call NewFileDownError() when either IsOpenAndActiveFile()
// is false, or when IsOpenActiveAndMutableFile() is false.
{
if ( this->IsOpenNode() )
{
if ( this->FileActive() )
{
if ( this->FileFrozen() )
{
ev->NewError("file frozen");
}
else
ev->NewError("unknown file problem");
}
else
ev->NewError("file not active");
}
else
ev->NewError("file not open");
}
void
morkFile::NewFileErrnoError(morkEnv* ev) const
// call NewFileErrnoError() to convert std C errno into AB fault
{
ev->NewError("errno"); // maybe pass value of strerror() instead
}
// ````` ````` ````` ````` newlines ````` ````` ````` `````
#ifdef MORK_MAC
static const char* morkFile_kNewlines =
"\015\015\015\015\015\015\015\015\015\015\015\015\015\015\015\015";
# define morkFile_kNewlinesCount 16
#else
# if defined(MORK_WIN) || defined(MORK_OS2)
static const char* morkFile_kNewlines =
"\015\012\015\012\015\012\015\012\015\012\015\012\015\012\015\012";
# define morkFile_kNewlinesCount 8
# else
# ifdef MORK_UNIX
static const char* morkFile_kNewlines =
"\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012";
# define morkFile_kNewlinesCount 16
# endif /* MORK_UNIX */
# endif /* MORK_WIN */
#endif /* MORK_MAC */
mork_size
morkFile::WriteNewlines(morkEnv* ev, mork_count inNewlines)
// WriteNewlines() returns the number of bytes written.
{
mork_size outSize = 0;
while ( inNewlines && ev->Good() ) // more newlines to write?
{
mork_u4 quantum = inNewlines;
if ( quantum > morkFile_kNewlinesCount )
quantum = morkFile_kNewlinesCount;
mork_size quantumSize = quantum * mork_kNewlineSize;
this->Write(ev, morkFile_kNewlines, quantumSize);
outSize += quantumSize;
inNewlines -= quantum;
}
return outSize;
}
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkStdioFile::CloseMorkNode(morkEnv* ev) // CloseStdioFile() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseStdioFile(ev);
this->MarkShut();
}
}
/*public virtual*/
morkStdioFile::~morkStdioFile() // assert CloseStdioFile() executed earlier
{
MORK_ASSERT(mStdioFile_File==0);
}
/*public non-poly*/ void
morkStdioFile::CloseStdioFile(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
if ( mStdioFile_File && this->FileActive() && this->FileIoOpen() )
{
this->CloseStdio(ev);
}
mStdioFile_File = 0;
this->CloseFile(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
// compatible with the morkFile::MakeFile() entry point
/*static*/ morkStdioFile*
morkStdioFile::OpenOldStdioFile(morkEnv* ev, nsIMdbHeap* ioHeap,
const char* inFilePath, mork_bool inFrozen)
{
morkStdioFile* outFile = 0;
if ( ioHeap && inFilePath )
{
const char* mode = (inFrozen)? "rb" : "wb";
outFile = new(*ioHeap, ev)
morkStdioFile(ev, morkUsage::kHeap, ioHeap, ioHeap, inFilePath, mode);
if ( outFile )
{
outFile->SetFileFrozen(inFrozen);
}
}
else
ev->NilPointerError();
return outFile;
}
/*static*/ morkStdioFile*
morkStdioFile::CreateNewStdioFile(morkEnv* ev, nsIMdbHeap* ioHeap,
const char* inFilePath)
{
morkStdioFile* outFile = 0;
if ( ioHeap && inFilePath )
{
const char* mode = "wb+";
outFile = new(*ioHeap, ev)
morkStdioFile(ev, morkUsage::kHeap, ioHeap, ioHeap, inFilePath, mode);
}
else
ev->NilPointerError();
return outFile;
}
/*public virtual*/ void
morkStdioFile:: BecomeTrunk(morkEnv* ev)
// If this file is a file version branch created by calling AcquireBud(),
// BecomeTrunk() causes this file's content to replace the original
// file's content, typically by assuming the original file's identity.
{
this->Flush(ev);
}
/*public virtual*/ morkFile*
morkStdioFile::AcquireBud(morkEnv* ev, nsIMdbHeap* ioHeap)
// AcquireBud() starts a new "branch" version of the file, empty of content,
// so that a new version of the file can be written. This new file
// can later be told to BecomeTrunk() the original file, so the branch
// created by budding the file will replace the original file. Some
// file subclasses might initially take the unsafe but expedient
// approach of simply truncating this file down to zero length, and
// then returning the same morkFile pointer as this, with an extra
// reference count increment. Note that the caller of AcquireBud() is
// expected to eventually call CutStrongRef() on the returned file
// in order to release the strong reference. High quality versions
// of morkFile subclasses will create entirely new files which later
// are renamed to become the old file, so that better transactional
// behavior is exhibited by the file, so crashes protect old files.
// Note that AcquireBud() is an illegal operation on readonly files.
{
morkFile* outFile = 0;
if ( this->IsOpenAndActiveFile() )
{
FILE* file = (FILE*) mStdioFile_File;
if ( file )
{
//#ifdef MORK_WIN
// truncate(file, /*eof*/ 0);
//#else /*MORK_WIN*/
char* name = mFile_Name;
if ( name )
{
if ( MORK_FILECLOSE(file) >= 0 )
{
this->SetFileActive(morkBool_kFalse);
this->SetFileIoOpen(morkBool_kFalse);
mStdioFile_File = 0;
file = fopen(name, "wb+"); // open for write, discarding old content
if ( file )
{
mStdioFile_File = file;
this->SetFileActive(morkBool_kTrue);
this->SetFileIoOpen(morkBool_kTrue);
this->SetFileFrozen(morkBool_kFalse);
}
else
this->new_stdio_file_fault(ev);
}
else
this->new_stdio_file_fault(ev);
}
else
this->NilFileNameError(ev);
//#endif /*MORK_WIN*/
if ( ev->Good() && this->AddStrongRef(ev) )
outFile = this;
}
else this->NewMissingIoError(ev);
}
else this->NewFileDownError(ev);
return outFile;
}
/*public virtual*/ mork_pos
morkStdioFile::Length(morkEnv* ev) const
{
mork_pos outPos = 0;
if ( this->IsOpenAndActiveFile() )
{
FILE* file = (FILE*) mStdioFile_File;
if ( file )
{
long start = MORK_FILETELL(file);
if ( start >= 0 )
{
long fore = MORK_FILESEEK(file, 0, SEEK_END);
if ( fore >= 0 )
{
long eof = MORK_FILETELL(file);
if ( eof >= 0 )
{
long back = MORK_FILESEEK(file, start, SEEK_SET);
if ( back >= 0 )
outPos = eof;
else
this->new_stdio_file_fault(ev);
}
else this->new_stdio_file_fault(ev);
}
else this->new_stdio_file_fault(ev);
}
else this->new_stdio_file_fault(ev);
}
else this->NewMissingIoError(ev);
}
else this->NewFileDownError(ev);
return outPos;
}
/*public virtual*/ mork_pos
morkStdioFile::Tell(morkEnv* ev) const
{
mork_pos outPos = 0;
if ( this->IsOpenAndActiveFile() )
{
FILE* file = (FILE*) mStdioFile_File;
if ( file )
{
long where = MORK_FILETELL(file);
if ( where >= 0 )
outPos = where;
else
this->new_stdio_file_fault(ev);
}
else this->NewMissingIoError(ev);
}
else this->NewFileDownError(ev);
return outPos;
}
/*public virtual*/ mork_size
morkStdioFile::Read(morkEnv* ev, void* outBuf, mork_size inSize)
{
mork_num outCount = 0;
if ( this->IsOpenAndActiveFile() )
{
FILE* file = (FILE*) mStdioFile_File;
if ( file )
{
long count = MORK_FILEREAD(outBuf, inSize, file);
if ( count >= 0 )
{
outCount = (mork_num) count;
}
else this->new_stdio_file_fault(ev);
}
else this->NewMissingIoError(ev);
}
else this->NewFileDownError(ev);
return outCount;
}
/*public virtual*/ mork_pos
morkStdioFile::Seek(morkEnv* ev, mork_pos inPos)
{
mork_pos outPos = 0;
if ( this->IsOpenOrClosingNode() && this->FileActive() )
{
FILE* file = (FILE*) mStdioFile_File;
if ( file )
{
long where = MORK_FILESEEK(file, inPos, SEEK_SET);
if ( where >= 0 )
outPos = inPos;
else
this->new_stdio_file_fault(ev);
}
else this->NewMissingIoError(ev);
}
else this->NewFileDownError(ev);
return outPos;
}
/*public virtual*/ mork_size
morkStdioFile::Write(morkEnv* ev, const void* inBuf, mork_size inSize)
{
mork_num outCount = 0;
if ( this->IsOpenActiveAndMutableFile() )
{
FILE* file = (FILE*) mStdioFile_File;
if ( file )
{
if ( fwrite(inBuf, 1, inSize, file) >= 0 )
outCount = inSize;
else
this->new_stdio_file_fault(ev);
}
else this->NewMissingIoError(ev);
}
else this->NewFileDownError(ev);
return outCount;
}
/*public virtual*/ void
morkStdioFile::Flush(morkEnv* ev)
{
if ( this->IsOpenOrClosingNode() && this->FileActive() )
{
FILE* file = (FILE*) mStdioFile_File;
if ( file )
{
MORK_FILEFLUSH(file);
}
else this->NewMissingIoError(ev);
}
else this->NewFileDownError(ev);
}
// ````` ````` ````` ````` ````` ````` ````` `````
//protected: // protected non-poly morkStdioFile methods
void
morkStdioFile::new_stdio_file_fault(morkEnv* ev) const
{
FILE* file = (FILE*) mStdioFile_File;
// bunch of stuff not ported here
if ( !errno && file )
errno = ferror(file);
this->NewFileErrnoError(ev);
}
// ````` ````` ````` ````` ````` ````` ````` `````
//public: // public non-poly morkStdioFile methods
/*public non-poly*/
morkStdioFile::morkStdioFile(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkFile(ev, inUsage, ioHeap, ioSlotHeap)
, mStdioFile_File( 0 )
{
if ( ev->Good() )
mNode_Derived = morkDerived_kStdioFile;
}
morkStdioFile::morkStdioFile(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap,
const char* inName, const char* inMode)
// calls OpenStdio() after construction
: morkFile(ev, inUsage, ioHeap, ioSlotHeap)
, mStdioFile_File( 0 )
{
if ( ev->Good() )
this->OpenStdio(ev, inName, inMode);
}
morkStdioFile::morkStdioFile(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap,
void* ioFile, const char* inName, mork_bool inFrozen)
// calls UseStdio() after construction
: morkFile(ev, inUsage, ioHeap, ioSlotHeap)
, mStdioFile_File( 0 )
{
if ( ev->Good() )
this->UseStdio(ev, ioFile, inName, inFrozen);
}
void
morkStdioFile::OpenStdio(morkEnv* ev, const char* inName, const char* inMode)
// Open a new FILE with name inName, using mode flags from inMode.
{
if ( ev->Good() )
{
if ( !inMode )
inMode = "";
mork_bool frozen = (*inMode == 'r'); // cursory attempt to note readonly
if ( this->IsOpenNode() )
{
if ( !this->FileActive() )
{
this->SetFileIoOpen(morkBool_kFalse);
if ( inName && *inName )
{
this->SetFileName(ev, inName);
if ( ev->Good() )
{
FILE* file = fopen(inName, inMode);
if ( file )
{
mStdioFile_File = file;
this->SetFileActive(morkBool_kTrue);
this->SetFileIoOpen(morkBool_kTrue);
this->SetFileFrozen(frozen);
}
else
this->new_stdio_file_fault(ev);
}
}
else ev->NewError("no file name");
}
else ev->NewError("file already active");
}
else this->NewFileDownError(ev);
}
}
void
morkStdioFile::UseStdio(morkEnv* ev, void* ioFile, const char* inName,
mork_bool inFrozen)
// Use an existing file, like stdin/stdout/stderr, which should not
// have the io stream closed when the file is closed. The ioFile
// parameter must actually be of type FILE (but we don't want to make
// this header file include the stdio.h header file).
{
if ( ev->Good() )
{
if ( this->IsOpenNode() )
{
if ( !this->FileActive() )
{
if ( ioFile )
{
this->SetFileIoOpen(morkBool_kFalse);
this->SetFileName(ev, inName);
if ( ev->Good() )
{
mStdioFile_File = ioFile;
this->SetFileActive(morkBool_kTrue);
this->SetFileFrozen(inFrozen);
}
}
else
ev->NilPointerError();
}
else ev->NewError("file already active");
}
else this->NewFileDownError(ev);
}
}
void
morkStdioFile::CloseStdio(morkEnv* ev)
// Close the stream io if both and FileActive() and FileIoOpen(), but
// this does not close this instances (like CloseStdioFile() does).
// If stream io was made active by means of calling UseStdio(),
// then this method does little beyond marking the stream inactive
// because FileIoOpen() is false.
{
if ( mStdioFile_File && this->FileActive() && this->FileIoOpen() )
{
FILE* file = (FILE*) mStdioFile_File;
if ( MORK_FILECLOSE(file) < 0 )
this->new_stdio_file_fault(ev);
mStdioFile_File = 0;
this->SetFileActive(morkBool_kFalse);
this->SetFileIoOpen(morkBool_kFalse);
}
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,298 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKFILE_
#define _MORKFILE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*=============================================================================
* morkFile: abstract file interface
*/
#define morkDerived_kFile /*i*/ 0x4669 /* ascii 'Fi' */
class morkFile /*d*/ : public morkNode { /* ````` simple file API ````` */
// ````` ````` ````` ````` ````` ````` ````` `````
protected: // protected morkFile members (similar to public domain IronDoc)
mork_u1 mFile_Frozen; // 'F' => file allows only read access
mork_u1 mFile_DoTrace; // 'T' trace if ev->DoTrace()
mork_u1 mFile_IoOpen; // 'O' => io stream is open (& needs a close)
mork_u1 mFile_Active; // 'A' => file is active and usable
nsIMdbHeap* mFile_SlotHeap; // heap for Name and other allocated slots
char* mFile_Name; // can be nil if SetFileName() is never called
// mFile_Name convention: managed with morkEnv::CopyString()/FreeString()
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseFile() only if open
virtual ~morkFile(); // assert that CloseFile() executed earlier
public: // morkFile construction & destruction
morkFile(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
nsIMdbHeap* ioSlotHeap);
void CloseFile(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkFile(const morkFile& other);
morkFile& operator=(const morkFile& other);
public: // dynamic type identification
mork_bool IsFile() const
{ return IsNode() && mNode_Derived == morkDerived_kFile; }
// } ===== end morkNode methods =====
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public static standard file creation entry point
static morkFile* OpenOldFile(morkEnv* ev, nsIMdbHeap* ioHeap,
const char* inFilePath, mork_bool inFrozen);
// Choose some subclass of morkFile to instantiate, in order to read
// (and write if not frozen) the file known by inFilePath. The file
// returned should be open and ready for use, and presumably positioned
// at the first byte position of the file. The exact manner in which
// files must be opened is considered a subclass specific detail, and
// other portions or Mork source code don't want to know how it's done.
static morkFile* CreateNewFile(morkEnv* ev, nsIMdbHeap* ioHeap,
const char* inFilePath);
// Choose some subclass of morkFile to instantiate, in order to read
// (and write if not frozen) the file known by inFilePath. The file
// returned should be created and ready for use, and presumably positioned
// at the first byte position of the file. The exact manner in which
// files must be opened is considered a subclass specific detail, and
// other portions or Mork source code don't want to know how it's done.
// ````` ````` ````` ````` ````` ````` ````` `````
public: // virtual morkFile methods
virtual void BecomeTrunk(morkEnv* ev);
// If this file is a file version branch created by calling AcquireBud(),
// BecomeTrunk() causes this file's content to replace the original
// file's content, typically by assuming the original file's identity.
// This default implementation of BecomeTrunk() does nothing, and this
// is appropriate behavior for files which are not branches, and is
// also the right behavior for files returned from AcquireBud() which are
// in fact the original file that has been truncated down to zero length.
virtual morkFile* AcquireBud(morkEnv* ev, nsIMdbHeap* ioHeap) = 0;
// AcquireBud() starts a new "branch" version of the file, empty of content,
// so that a new version of the file can be written. This new file
// can later be told to BecomeTrunk() the original file, so the branch
// created by budding the file will replace the original file. Some
// file subclasses might initially take the unsafe but expedient
// approach of simply truncating this file down to zero length, and
// then returning the same morkFile pointer as this, with an extra
// reference count increment. Note that the caller of AcquireBud() is
// expected to eventually call CutStrongRef() on the returned file
// in order to release the strong reference. High quality versions
// of morkFile subclasses will create entirely new files which later
// are renamed to become the old file, so that better transactional
// behavior is exhibited by the file, so crashes protect old files.
// Note that AcquireBud() is an illegal operation on readonly files.
virtual mork_pos Length(morkEnv* ev) const = 0; // eof
virtual mork_pos Tell(morkEnv* ev) const = 0;
virtual mork_size Read(morkEnv* ev, void* outBuf, mork_size inSize) = 0;
virtual mork_pos Seek(morkEnv* ev, mork_pos inPos) = 0;
virtual mork_size Write(morkEnv* ev, const void* inBuf, mork_size inSize) = 0;
virtual void Flush(morkEnv* ev) = 0;
// ````` ````` ````` ````` ````` ````` ````` `````
public: // non-poly morkFile methods
mork_bool FileFrozen() const { return mFile_Frozen == 'F'; }
mork_bool FileDoTrace() const { return mFile_DoTrace == 'T'; }
mork_bool FileIoOpen() const { return mFile_IoOpen == 'O'; }
mork_bool FileActive() const { return mFile_Active == 'A'; }
void SetFileFrozen(mork_bool b) { mFile_Frozen = (b)? 'F' : 0; }
void SetFileDoTrace(mork_bool b) { mFile_DoTrace = (b)? 'T' : 0; }
void SetFileIoOpen(mork_bool b) { mFile_IoOpen = (b)? 'O' : 0; }
void SetFileActive(mork_bool b) { mFile_Active = (b)? 'A' : 0; }
mork_bool IsOpenActiveAndMutableFile() const
{ return ( IsOpenNode() && FileActive() && !FileFrozen() ); }
// call IsOpenActiveAndMutableFile() before writing a file
mork_bool IsOpenAndActiveFile() const
{ return ( this->IsOpenNode() && this->FileActive() ); }
// call IsOpenAndActiveFile() before using a file
void SetFileName(morkEnv* ev, const char* inName); // inName can be nil
static void NilSlotHeapError(morkEnv* ev);
static void NilFileNameError(morkEnv* ev);
void NewMissingIoError(morkEnv* ev) const;
void NewFileDownError(morkEnv* ev) const;
// call NewFileDownError() when either IsOpenAndActiveFile()
// is false, or when IsOpenActiveAndMutableFile() is false.
void NewFileErrnoError(morkEnv* ev) const;
// call NewFileErrnoError() to convert std C errno into AB fault
mork_size WriteNewlines(morkEnv* ev, mork_count inNewlines);
// WriteNewlines() returns the number of bytes written.
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakFile(morkFile* me,
morkEnv* ev, morkFile** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongFile(morkFile* me,
morkEnv* ev, morkFile** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
/*=============================================================================
* morkStdioFile: concrete file using standard C file io
*/
#define morkDerived_kStdioFile /*i*/ 0x7346 /* ascii 'sF' */
class morkStdioFile /*d*/ : public morkFile { /* `` copied from IronDoc `` */
// ````` ````` ````` ````` ````` ````` ````` `````
protected: // protected morkStdioFile members
void* mStdioFile_File;
// actually type FILE*, but using opaque void* type
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseStdioFile() only if open
virtual ~morkStdioFile(); // assert that CloseStdioFile() executed earlier
public: // morkStdioFile construction & destruction
morkStdioFile(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap);
void CloseStdioFile(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkStdioFile(const morkStdioFile& other);
morkStdioFile& operator=(const morkStdioFile& other);
public: // dynamic type identification
mork_bool IsStdioFile() const
{ return IsNode() && mNode_Derived == morkDerived_kStdioFile; }
// } ===== end morkNode methods =====
public: // typing
static void NonStdioFileTypeError(morkEnv* ev);
// ````` ````` ````` ````` ````` ````` ````` `````
public: // compatible with the morkFile::OpenOldFile() entry point
static morkStdioFile* OpenOldStdioFile(morkEnv* ev, nsIMdbHeap* ioHeap,
const char* inFilePath, mork_bool inFrozen);
static morkStdioFile* CreateNewStdioFile(morkEnv* ev, nsIMdbHeap* ioHeap,
const char* inFilePath);
// ````` ````` ````` ````` ````` ````` ````` `````
public: // virtual ab_File methods
virtual void BecomeTrunk(morkEnv* ev);
// If this file is a file version branch created by calling AcquireBud(),
// BecomeTrunk() causes this file's content to replace the original
// file's content, typically by assuming the original file's identity.
virtual morkFile* AcquireBud(morkEnv* ev, nsIMdbHeap* ioHeap);
// AcquireBud() starts a new "branch" version of the file, empty of content,
// so that a new version of the file can be written. This new file
// can later be told to BecomeTrunk() the original file, so the branch
// created by budding the file will replace the original file. Some
// file subclasses might initially take the unsafe but expedient
// approach of simply truncating this file down to zero length, and
// then returning the same morkFile pointer as this, with an extra
// reference count increment. Note that the caller of AcquireBud() is
// expected to eventually call CutStrongRef() on the returned file
// in order to release the strong reference. High quality versions
// of morkFile subclasses will create entirely new files which later
// are renamed to become the old file, so that better transactional
// behavior is exhibited by the file, so crashes protect old files.
// Note that AcquireBud() is an illegal operation on readonly files.
virtual mork_pos Length(morkEnv* ev) const; // eof
virtual mork_pos Tell(morkEnv* ev) const;
virtual mork_size Read(morkEnv* ev, void* outBuf, mork_size inSize);
virtual mork_pos Seek(morkEnv* ev, mork_pos inPos);
virtual mork_size Write(morkEnv* ev, const void* inBuf, mork_size inSize);
virtual void Flush(morkEnv* ev);
// ````` ````` ````` ````` ````` ````` ````` `````
protected: // protected non-poly morkStdioFile methods
void new_stdio_file_fault(morkEnv* ev) const;
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public non-poly morkStdioFile methods
morkStdioFile(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap,
const char* inName, const char* inMode);
// calls OpenStdio() after construction
morkStdioFile(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap,
void* ioFile, const char* inName, mork_bool inFrozen);
// calls UseStdio() after construction
void OpenStdio(morkEnv* ev, const char* inName, const char* inMode);
// Open a new FILE with name inName, using mode flags from inMode.
void UseStdio(morkEnv* ev, void* ioFile, const char* inName,
mork_bool inFrozen);
// Use an existing file, like stdin/stdout/stderr, which should not
// have the io stream closed when the file is closed. The ioFile
// parameter must actually be of type FILE (but we don't want to make
// this header file include the stdio.h header file).
void CloseStdio(morkEnv* ev);
// Close the stream io if both and FileActive() and FileIoOpen(), but
// this does not close this instances (like CloseStdioFile() does).
// If stream io was made active by means of calling UseStdio(),
// then this method does little beyond marking the stream inactive
// because FileIoOpen() is false.
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakStdioFile(morkStdioFile* me,
morkEnv* ev, morkStdioFile** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongStdioFile(morkStdioFile* me,
morkEnv* ev, morkStdioFile** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKFILE_ */

View File

@@ -0,0 +1,404 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKFACTORY_
#include "morkFactory.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKHANDLE_
#include "morkHandle.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkHandle::CloseMorkNode(morkEnv* ev) // CloseHandle() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseHandle(ev);
this->MarkShut();
}
}
/*public virtual*/
morkHandle::~morkHandle() // assert CloseHandle() executed earlier
{
MORK_ASSERT(mHandle_Env==0);
MORK_ASSERT(mHandle_Face==0);
MORK_ASSERT(mHandle_Object==0);
MORK_ASSERT(mHandle_Magic==0);
}
/*public non-poly*/
morkHandle::morkHandle(morkEnv* ev, // note morkUsage is always morkUsage_kPool
morkHandleFace* ioFace, // must not be nil, cookie for this handle
morkObject* ioObject, // must not be nil, the object for this handle
mork_magic inMagic) // magic sig to denote specific subclass
: morkNode(ev, morkUsage::kPool, (nsIMdbHeap*) 0L)
, mHandle_Tag( 0 )
, mHandle_Env( ev )
, mHandle_Face( ioFace )
, mHandle_Object( 0 )
, mHandle_Magic( 0 )
{
if ( ioFace && ioObject )
{
if ( ev->Good() )
{
mHandle_Tag = morkHandle_kTag;
morkObject::SlotStrongObject(ioObject, ev, &mHandle_Object);
morkHandle::SlotWeakHandle(this, ev, &ioObject->mObject_Handle);
if ( ev->Good() )
{
mHandle_Magic = inMagic;
mNode_Derived = morkDerived_kHandle;
}
}
}
else
ev->NilPointerError();
}
/*public non-poly*/ void
morkHandle::CloseHandle(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
morkObject* obj = mHandle_Object;
mork_bool objDidRefSelf = ( obj && obj->mObject_Handle == this );
if ( objDidRefSelf )
obj->mObject_Handle = 0; // drop the reference
morkObject::SlotStrongObject((morkObject*) 0, ev, &mHandle_Object);
mHandle_Magic = 0;
// note mHandle_Tag MUST stay morkHandle_kTag for morkNode::ZapOld()
this->MarkShut();
if ( objDidRefSelf )
this->CutWeakRef(ev);
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
void morkHandle::NilFactoryError(morkEnv* ev) const
{
ev->NewError("nil mHandle_Factory");
}
void morkHandle::NilHandleObjectError(morkEnv* ev) const
{
ev->NewError("nil mHandle_Object");
}
void morkHandle::NonNodeObjectError(morkEnv* ev) const
{
ev->NewError("non-node mHandle_Object");
}
void morkHandle::NonOpenObjectError(morkEnv* ev) const
{
ev->NewError("non-open mHandle_Object");
}
void morkHandle::NewBadMagicHandleError(morkEnv* ev, mork_magic inMagic) const
{
ev->NewError("wrong mHandle_Magic");
}
void morkHandle::NewDownHandleError(morkEnv* ev) const
{
if ( this->IsHandle() )
{
if ( this->GoodHandleTag() )
{
if ( this->IsOpenNode() )
ev->NewError("unknown down morkHandle error");
else
this->NonOpenNodeError(ev);
}
else
ev->NewError("wrong morkHandle tag");
}
else
ev->NewError("non morkHandle");
}
morkObject* morkHandle::GetGoodHandleObject(morkEnv* ev,
mork_bool inMutable, mork_magic inMagicType) const
{
morkObject* outObject = 0;
if ( this->IsHandle() && this->GoodHandleTag() && this->IsOpenNode() )
{
if ( !inMagicType || mHandle_Magic == inMagicType )
{
morkObject* obj = this->mHandle_Object;
if ( obj )
{
if ( obj->IsNode() )
{
if ( obj->IsOpenNode() )
{
if ( this->IsMutable() || !inMutable )
outObject = obj;
else
this->NonMutableNodeError(ev);
}
else
this->NonOpenObjectError(ev);
}
else
this->NonNodeObjectError(ev);
}
else
this->NilHandleObjectError(ev);
}
else
this->NewBadMagicHandleError(ev, inMagicType);
}
else
this->NewDownHandleError(ev);
MORK_ASSERT(outObject);
return outObject;
}
morkEnv*
morkHandle::CanUseHandle(nsIMdbEnv* mev, mork_bool inMutable,
mdb_err* outErr) const
{
morkEnv* outEnv = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
morkObject* obj = this->GetGoodHandleObject(ev, inMutable, /*magic*/ 0);
if ( obj )
{
outEnv = ev;
}
*outErr = ev->AsErr();
}
MORK_ASSERT(outEnv);
return outEnv;
}
// { ===== begin nsIMdbObject methods =====
// { ----- begin attribute methods -----
/*virtual*/ mdb_err
morkHandle::Handle_IsFrozenMdbObject(nsIMdbEnv* mev, mdb_bool* outIsReadonly)
{
mdb_err outErr = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
MORK_ASSERT(outIsReadonly);
if ( outIsReadonly )
*outIsReadonly = mHandle_Object->IsFrozen();
outErr = ev->AsErr();
}
return outErr;
}
// same as nsIMdbPort::GetIsPortReadonly() when this object is inside a port.
// } ----- end attribute methods -----
// { ----- begin factory methods -----
/*virtual*/ mdb_err
morkHandle::Handle_GetMdbFactory(nsIMdbEnv* mev, nsIMdbFactory** acqFactory)
{
mdb_err outErr = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
morkFactory* factory = ev->mEnv_Factory;
if ( factory )
{
nsIMdbFactory* handle = factory->AcquireFactoryHandle(ev);
MORK_ASSERT(acqFactory);
if ( handle && acqFactory )
*acqFactory = handle;
}
else
this->NilFactoryError(ev);
outErr = ev->AsErr();
}
return outErr;
}
// } ----- end factory methods -----
// { ----- begin ref counting for well-behaved cyclic graphs -----
/*virtual*/ mdb_err
morkHandle::Handle_GetWeakRefCount(nsIMdbEnv* mev, // weak refs
mdb_count* outCount)
{
mdb_err outErr = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
MORK_ASSERT(outCount);
if ( outCount )
*outCount = this->WeakRefsOnly();
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
morkHandle::Handle_GetStrongRefCount(nsIMdbEnv* mev, // strong refs
mdb_count* outCount)
{
mdb_err outErr = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
MORK_ASSERT(outCount);
if ( outCount )
*outCount = this->StrongRefsOnly();
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
morkHandle::Handle_AddWeakRef(nsIMdbEnv* mev)
{
mdb_err outErr = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
this->AddWeakRef(ev);
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
morkHandle::Handle_AddStrongRef(nsIMdbEnv* mev)
{
mdb_err outErr = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
this->AddStrongRef(ev);
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
morkHandle::Handle_CutWeakRef(nsIMdbEnv* mev)
{
mdb_err outErr = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
this->CutWeakRef(ev);
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
morkHandle::Handle_CutStrongRef(nsIMdbEnv* mev)
{
mdb_err outErr = 0;
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
this->CutStrongRef(ev);
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
morkHandle::Handle_CloseMdbObject(nsIMdbEnv* mev)
{
mdb_err outErr = 0;
if ( this->IsNode() && this->IsOpenNode() )
{
morkEnv* ev = CanUseHandle(mev, /*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
this->CloseMorkNode(ev);
outErr = ev->AsErr();
}
}
return outErr;
} // called at strong refs zero
/*virtual*/ mdb_err
morkHandle::Handle_IsOpenMdbObject(nsIMdbEnv* mev, mdb_bool* outOpen)
{
mdb_err outErr = 0;
MORK_ASSERT(outOpen);
if ( outOpen )
*outOpen = this->IsOpenNode();
return outErr;
}
// } ----- end ref counting -----
// } ===== end nsIMdbObject methods =====
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,189 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKHANDLE_
#define _MORKHANDLE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKDEQUE_
#include "morkDeque.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class morkPool;
class morkObject;
class morkFactory;
#define morkDerived_kHandle /*i*/ 0x486E /* ascii 'Hn' */
#define morkHandle_kTag 0x68416E44 /* ascii 'hAnD' */
/*| morkHandle:
|*/
class morkHandle : public morkNode {
// public: // slots inherited from morkNode (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
public: // state is public because the entire Mork system is private
mork_u4 mHandle_Tag; // must equal morkHandle_kTag
morkEnv* mHandle_Env; // pool that allocated this handle
morkHandleFace* mHandle_Face; // cookie from pool containing this
morkObject* mHandle_Object; // object this handle wraps for MDB API
mork_magic mHandle_Magic; // magic sig different in each subclass
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseHandle() only if open
virtual ~morkHandle(); // assert that CloseHandle() executed earlier
public: // morkHandle construction & destruction
morkHandle(morkEnv* ev, // note morkUsage is always morkUsage_kPool
morkHandleFace* ioFace, // must not be nil, cookie for this handle
morkObject* ioObject, // must not be nil, the object for this handle
mork_magic inMagic); // magic sig to denote specific subclass
void CloseHandle(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkHandle(const morkHandle& other);
morkHandle& operator=(const morkHandle& other);
protected: // special case empty construction for morkHandleFrame
friend class morkHandleFrame;
morkHandle() { }
public: // dynamic type identification
mork_bool IsHandle() const
{ return IsNode() && mNode_Derived == morkDerived_kHandle; }
// } ===== end morkNode methods =====
public: // morkHandle memory management operators
void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev)
{ return ioPool.NewHandle(ev, inSize); }
void* operator new(size_t inSize, morkHandleFace* ioFace)
{ return ioFace; }
void operator delete(void* ioAddress)
{ morkNode::OnDeleteAssert(ioAddress); }
// do NOT call delete on morkHandle instances. They are collected.
public: // other handle methods
mork_bool GoodHandleTag() const
{ return mHandle_Tag == morkHandle_kTag; }
void NewBadMagicHandleError(morkEnv* ev, mork_magic inMagic) const;
void NewDownHandleError(morkEnv* ev) const;
void NilFactoryError(morkEnv* ev) const;
void NilHandleObjectError(morkEnv* ev) const;
void NonNodeObjectError(morkEnv* ev) const;
void NonOpenObjectError(morkEnv* ev) const;
morkObject* GetGoodHandleObject(morkEnv* ev,
mork_bool inMutabl, mork_magic inMagicType) const;
public: // interface supporting mdbObject methods
morkEnv* CanUseHandle(nsIMdbEnv* mev, mork_bool inMutable,
mdb_err* outErr) const;
// { ----- begin mdbObject style methods -----
mdb_err Handle_IsFrozenMdbObject(nsIMdbEnv* ev, mdb_bool* outIsReadonly);
mdb_err Handle_GetMdbFactory(nsIMdbEnv* ev, nsIMdbFactory** acqFactory);
mdb_err Handle_GetWeakRefCount(nsIMdbEnv* ev, mdb_count* outCount);
mdb_err Handle_GetStrongRefCount(nsIMdbEnv* ev, mdb_count* outCount);
mdb_err Handle_AddWeakRef(nsIMdbEnv* ev);
mdb_err Handle_AddStrongRef(nsIMdbEnv* ev);
mdb_err Handle_CutWeakRef(nsIMdbEnv* ev);
mdb_err Handle_CutStrongRef(nsIMdbEnv* ev);
mdb_err Handle_CloseMdbObject(nsIMdbEnv* ev);
mdb_err Handle_IsOpenMdbObject(nsIMdbEnv* ev, mdb_bool* outOpen);
// } ----- end mdbObject style methods -----
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakHandle(morkHandle* me,
morkEnv* ev, morkHandle** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongHandle(morkHandle* me,
morkEnv* ev, morkHandle** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
#define morkHandleFrame_kPadSlotCount 4
/*| morkHandleFrame: an object format used for allocating and maintaining
**| instances of morkHandle, with leading slots used to maintain this in a
**| linked list, and following slots to provide extra footprint that might
**| be needed by any morkHandle subclasses that include very little extra
**| space (by virtue of the fact that each morkHandle subclass is expected
**| to multiply inherit from another base class that has only abstact methods
**| for space overhead related only to some vtable representation).
|*/
class morkHandleFrame {
public:
morkLink mHandleFrame_Link; // list storage without trampling Handle
morkHandle mHandleFrame_Handle;
mork_ip mHandleFrame_Padding[ morkHandleFrame_kPadSlotCount ];
public:
morkHandle* AsHandle() { return &mHandleFrame_Handle; }
morkHandleFrame() {} // actually, morkHandleFrame never gets constructed
private: // copying is not allowed
morkHandleFrame(const morkHandleFrame& other);
morkHandleFrame& operator=(const morkHandleFrame& other);
};
#define morkHandleFrame_kHandleOffset \
mork_OffsetOf(morkHandleFrame,mHandleFrame_Handle)
#define morkHandle_AsHandleFrame(h) ((h)->mHandle_Block , \
((morkHandleFrame*) (((mork_u1*)(h)) - morkHandleFrame_kHandleOffset)))
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKHANDLE_ */

View File

@@ -0,0 +1,148 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKINTMAP_
#include "morkIntMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkIntMap::CloseMorkNode(morkEnv* ev) // CloseIntMap() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseIntMap(ev);
this->MarkShut();
}
}
/*public virtual*/
morkIntMap::~morkIntMap() // assert CloseIntMap() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkIntMap::morkIntMap(morkEnv* ev,
const morkUsage& inUsage, mork_size inValSize,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap, mork_bool inHoldChanges)
: morkMap(ev, inUsage, ioHeap, sizeof(mork_u4), inValSize,
morkIntMap_kStartSlotCount, ioSlotHeap, inHoldChanges)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kIntMap;
}
/*public non-poly*/ void
morkIntMap::CloseIntMap(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
this->CloseMap(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
// { ===== begin morkMap poly interface =====
/*virtual*/ mork_bool // *((mork_u4*) inKeyA) == *((mork_u4*) inKeyB)
morkIntMap::Equal(morkEnv* ev, const void* inKeyA, const void* inKeyB) const
{
return *((const mork_u4*) inKeyA) == *((const mork_u4*) inKeyB);
}
/*virtual*/ mork_u4 // some integer function of *((mork_u4*) inKey)
morkIntMap::Hash(morkEnv* ev, const void* inKey) const
{
return *((const mork_u4*) inKey);
}
// } ===== end morkMap poly interface =====
mork_bool
morkIntMap::AddInt(morkEnv* ev, mork_u4 inKey, void* ioAddress)
// the AddInt() method return value equals ev->Good().
{
if ( ev->Good() )
{
this->Put(ev, &inKey, &ioAddress,
/*key*/ (void*) 0, /*val*/ (void*) 0, (mork_change**) 0);
}
return ev->Good();
}
mork_bool
morkIntMap::CutInt(morkEnv* ev, mork_u4 inKey)
{
return this->Cut(ev, &inKey, /*key*/ (void*) 0, /*val*/ (void*) 0,
(mork_change**) 0);
}
void*
morkIntMap::GetInt(morkEnv* ev, mork_u4 inKey)
// Note the returned val does NOT have an increase in refcount for this.
{
void* val = 0; // old val in the map
this->Get(ev, &inKey, /*key*/ (void*) 0, &val, (mork_change**) 0);
return val;
}
mork_bool
morkIntMap::HasInt(morkEnv* ev, mork_u4 inKey)
// Note the returned val does NOT have an increase in refcount for this.
{
return this->Get(ev, &inKey, /*key*/ (void*) 0, /*val*/ (void*) 0,
(mork_change**) 0);
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,87 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKINTMAP_
#define _MORKINTMAP_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kIntMap /*i*/ 0x694D /* ascii 'iM' */
#define morkIntMap_kStartSlotCount 512
/*| morkIntMap: maps mork_token -> morkNode
|*/
class morkIntMap : public morkMap { // for mapping tokens to maps
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseIntMap() only if open
virtual ~morkIntMap(); // assert that CloseIntMap() executed earlier
public: // morkMap construction & destruction
// keySize for morkIntMap equals sizeof(mork_u4)
morkIntMap(morkEnv* ev, const morkUsage& inUsage, mork_size inValSize,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap, mork_bool inHoldChanges);
void CloseIntMap(morkEnv* ev); // called by CloseMorkNode();
public: // dynamic type identification
mork_bool IsIntMap() const
{ return IsNode() && mNode_Derived == morkDerived_kIntMap; }
// } ===== end morkNode methods =====
// { ===== begin morkMap poly interface =====
virtual mork_bool // *((mork_u4*) inKeyA) == *((mork_u4*) inKeyB)
Equal(morkEnv* ev, const void* inKeyA, const void* inKeyB) const;
virtual mork_u4 // some integer function of *((mork_u4*) inKey)
Hash(morkEnv* ev, const void* inKey) const;
// } ===== end morkMap poly interface =====
public: // other map methods
mork_bool AddInt(morkEnv* ev, mork_u4 inKey, void* ioAddress);
// the AddInt() boolean return equals ev->Good().
mork_bool CutInt(morkEnv* ev, mork_token inKey);
// The CutInt() boolean return indicates whether removal happened.
void* GetInt(morkEnv* ev, mork_token inKey);
// Note the returned node does NOT have an increase in refcount for this.
mork_bool HasInt(morkEnv* ev, mork_u4 inKey);
// Note the returned node does NOT have an increase in refcount for this.
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKINTMAP_ */

View File

@@ -0,0 +1,937 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
// This code is mostly a port to C++ from public domain IronDoc C sources.
// Note many code comments here come verbatim from cut-and-pasted IronDoc.
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
class morkHashArrays {
public:
nsIMdbHeap* mHashArrays_Heap; // copy of mMap_Heap
mork_count mHashArrays_Slots; // copy of mMap_Slots
mork_u1* mHashArrays_Keys; // copy of mMap_Keys
mork_u1* mHashArrays_Vals; // copy of mMap_Vals
morkAssoc* mHashArrays_Assocs; // copy of mMap_Assocs
mork_change* mHashArrays_Changes; // copy of mMap_Changes
morkAssoc** mHashArrays_Buckets; // copy of mMap_Buckets
morkAssoc* mHashArrays_FreeList; // copy of mMap_FreeList
public:
void finalize(morkEnv* ev);
};
void morkHashArrays::finalize(morkEnv* ev)
{
nsIMdbEnv* menv = ev->AsMdbEnv();
nsIMdbHeap* heap = mHashArrays_Heap;
if ( heap )
{
if ( mHashArrays_Keys )
heap->Free(menv, mHashArrays_Keys);
if ( mHashArrays_Vals )
heap->Free(menv, mHashArrays_Vals);
if ( mHashArrays_Assocs )
heap->Free(menv, mHashArrays_Assocs);
if ( mHashArrays_Changes )
heap->Free(menv, mHashArrays_Changes);
if ( mHashArrays_Buckets )
heap->Free(menv, mHashArrays_Buckets);
}
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkMap::CloseMorkNode(morkEnv* ev) // CloseMap() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseMap(ev);
this->MarkShut();
}
}
/*public virtual*/
morkMap::~morkMap() // assert CloseMap() executed earlier
{
MORK_ASSERT(mMap_FreeList==0);
MORK_ASSERT(mMap_Buckets==0);
MORK_ASSERT(mMap_Keys==0);
MORK_ASSERT(mMap_Vals==0);
MORK_ASSERT(mMap_Changes==0);
MORK_ASSERT(mMap_Assocs==0);
}
/*public non-poly*/ void
morkMap::CloseMap(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
nsIMdbHeap* heap = mMap_Heap;
if ( heap ) /* need to free the arrays? */
{
nsIMdbEnv* menv = ev->AsMdbEnv();
if ( mMap_Keys )
heap->Free(menv, mMap_Keys);
if ( mMap_Vals )
heap->Free(menv, mMap_Vals);
if ( mMap_Assocs )
heap->Free(menv, mMap_Assocs);
if ( mMap_Buckets )
heap->Free(menv, mMap_Buckets);
if ( mMap_Changes )
heap->Free(menv, mMap_Changes);
}
mMap_Keys = 0;
mMap_Vals = 0;
mMap_Buckets = 0;
mMap_Assocs = 0;
mMap_Changes = 0;
mMap_FreeList = 0;
MORK_MEMSET(&mMap_Form, 0, sizeof(morkMapForm));
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
void
morkMap::clear_map(morkEnv* ev, nsIMdbHeap* ioSlotHeap)
{
mMap_Tag = 0;
mMap_Seed = 0;
mMap_Slots = 0;
mMap_Fill = 0;
mMap_Keys = 0;
mMap_Vals = 0;
mMap_Assocs = 0;
mMap_Changes = 0;
mMap_Buckets = 0;
mMap_FreeList = 0;
MORK_MEMSET(&mMap_Form, 0, sizeof(morkMapForm));
mMap_Heap = 0;
if ( ioSlotHeap )
{
nsIMdbHeap_SlotStrongHeap(ioSlotHeap, ev, &mMap_Heap);
}
else
ev->NilPointerError();
}
morkMap::morkMap(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
mork_size inKeySize, mork_size inValSize,
mork_size inSlots, nsIMdbHeap* ioSlotHeap, mork_bool inHoldChanges)
: morkNode(ev, inUsage, ioHeap)
, mMap_Heap( 0 )
{
if ( ev->Good() )
{
this->clear_map(ev, ioSlotHeap);
if ( ev->Good() )
{
mMap_Form.mMapForm_HoldChanges = inHoldChanges;
mMap_Form.mMapForm_KeySize = inKeySize;
mMap_Form.mMapForm_ValSize = inValSize;
mMap_Form.mMapForm_KeyIsIP = ( inKeySize == sizeof(mork_ip) );
mMap_Form.mMapForm_ValIsIP = ( inValSize == sizeof(mork_ip) );
this->InitMap(ev, inSlots);
if ( ev->Good() )
mNode_Derived = morkDerived_kMap;
}
}
}
void
morkMap::NewIterOutOfSyncError(morkEnv* ev)
{
ev->NewError("map iter out of sync");
}
void morkMap::NewBadMapError(morkEnv* ev)
{
ev->NewError("bad morkMap tag");
if ( !this )
ev->NewError("nil morkMap instance");
}
void morkMap::NewSlotsUnderflowWarning(morkEnv* ev)
{
ev->NewWarning("member count underflow");
}
void morkMap::InitMap(morkEnv* ev, mork_size inSlots)
{
if ( ev->Good() )
{
morkHashArrays old;
// MORK_MEMCPY(&mMap_Form, &inForm, sizeof(morkMapForm));
if ( inSlots < 3 ) /* requested capacity absurdly small? */
inSlots = 3; /* bump it up to a minimum practical level */
else if ( inSlots > (128 * 1024) ) /* requested slots absurdly big? */
inSlots = (128 * 1024); /* decrease it to a maximum practical level */
if ( this->new_arrays(ev, &old, inSlots) )
mMap_Tag = morkMap_kTag;
MORK_MEMSET(&old, 0, sizeof(morkHashArrays)); // do NOT finalize
}
}
morkAssoc**
morkMap::find(morkEnv* ev, const void* inKey, mork_u4 inHash) const
{
mork_u1* keys = mMap_Keys;
mork_num keySize = this->FormKeySize();
// morkMap_mEqual equal = this->FormEqual();
morkAssoc** ref = mMap_Buckets + (inHash % mMap_Slots);
morkAssoc* assoc = *ref;
while ( assoc ) /* look at another assoc in the bucket? */
{
mork_pos i = assoc - mMap_Assocs; /* index of this assoc */
if ( this->Equal(ev, keys + (i * keySize), inKey) ) /* found? */
return ref;
ref = &assoc->mAssoc_Next; /* consider next assoc slot in bucket */
assoc = *ref; /* if this is null, then we are done */
}
return 0;
}
/*| get_assoc: read the key and/or value at index inPos
|*/
void
morkMap::get_assoc(void* outKey, void* outVal, mork_pos inPos) const
{
mork_num valSize = this->FormValSize();
if ( valSize && outVal ) /* map holds values? caller wants the value? */
{
const mork_u1* value = mMap_Vals + (valSize * inPos);
if ( valSize == sizeof(mork_ip) && this->FormValIsIP() ) /* ip case? */
*((mork_ip*) outVal) = *((const mork_ip*) value);
else
MORK_MEMCPY(outVal, value, valSize);
}
if ( outKey ) /* caller wants the key? */
{
mork_num keySize = this->FormKeySize();
const mork_u1* key = mMap_Keys + (keySize * inPos);
if ( keySize == sizeof(mork_ip) && this->FormKeyIsIP() ) /* ip case? */
*((mork_ip*) outKey) = *((const mork_ip*) key);
else
MORK_MEMCPY(outKey, key, keySize);
}
}
/*| put_assoc: write the key and/or value at index inPos
|*/
void
morkMap::put_assoc(const void* inKey, const void* inVal, mork_pos inPos) const
{
mork_num valSize = this->FormValSize();
if ( valSize && inVal ) /* map holds values? caller sends a value? */
{
mork_u1* value = mMap_Vals + (valSize * inPos);
if ( valSize == sizeof(mork_ip) && this->FormValIsIP() ) /* ip case? */
*((mork_ip*) value) = *((const mork_ip*) inVal);
else
MORK_MEMCPY(value, inVal, valSize);
}
if ( inKey ) /* caller sends a key? */
{
mork_num keySize = this->FormKeySize();
mork_u1* key = mMap_Keys + (keySize * inPos);
if ( keySize == sizeof(mork_ip) && this->FormKeyIsIP() ) /* ip case? */
*((mork_ip*) key) = *((const mork_ip*) inKey);
else
MORK_MEMCPY(key, inKey, keySize);
}
}
void*
morkMap::clear_alloc(morkEnv* ev, mork_size inSize)
{
void* p = 0;
nsIMdbHeap* heap = mMap_Heap;
if ( heap )
{
if ( heap->Alloc(ev->AsMdbEnv(), inSize, (void**) &p) == 0 && p )
{
MORK_MEMSET(p, 0, inSize);
return p;
}
}
else
ev->NilPointerError();
return (void*) 0;
}
void*
morkMap::alloc(morkEnv* ev, mork_size inSize)
{
void* p = 0;
nsIMdbHeap* heap = mMap_Heap;
if ( heap )
{
if ( heap->Alloc(ev->AsMdbEnv(), inSize, (void**) &p) == 0 && p )
return p;
}
else
ev->NilPointerError();
return (void*) 0;
}
/*| new_keys: allocate an array of inSlots new keys filled with zero.
|*/
mork_u1*
morkMap::new_keys(morkEnv* ev, mork_num inSlots)
{
mork_num size = inSlots * this->FormKeySize();
return (mork_u1*) this->clear_alloc(ev, size);
}
/*| new_values: allocate an array of inSlots new values filled with zero.
**| When values are zero sized, we just return a null pointer.
|*/
mork_u1*
morkMap::new_values(morkEnv* ev, mork_num inSlots)
{
mork_u1* values = 0;
mork_num size = inSlots * this->FormValSize();
if ( size )
values = (mork_u1*) this->clear_alloc(ev, size);
return values;
}
mork_change*
morkMap::new_changes(morkEnv* ev, mork_num inSlots)
{
mork_change* changes = 0;
mork_num size = inSlots * sizeof(mork_change);
if ( size && mMap_Form.mMapForm_HoldChanges )
changes = (mork_change*) this->clear_alloc(ev, size);
return changes;
}
/*| new_buckets: allocate an array of inSlots new buckets filled with zero.
|*/
morkAssoc**
morkMap::new_buckets(morkEnv* ev, mork_num inSlots)
{
mork_num size = inSlots * sizeof(morkAssoc*);
return (morkAssoc**) this->clear_alloc(ev, size);
}
/*| new_assocs: allocate an array of inSlots new assocs, with each assoc
**| linked together in a list with the first array element at the list head
**| and the last element at the list tail. (morkMap::grow() needs this.)
|*/
morkAssoc*
morkMap::new_assocs(morkEnv* ev, mork_num inSlots)
{
mork_num size = inSlots * sizeof(morkAssoc);
morkAssoc* assocs = (morkAssoc*) this->alloc(ev, size);
if ( assocs ) /* able to allocate the array? */
{
morkAssoc* a = assocs + (inSlots - 1); /* the last array element */
a->mAssoc_Next = 0; /* terminate tail element of the list with null */
while ( --a >= assocs ) /* another assoc to link into the list? */
a->mAssoc_Next = a + 1; /* each points to the following assoc */
}
return assocs;
}
mork_bool
morkMap::new_arrays(morkEnv* ev, morkHashArrays* old, mork_num inSlots)
{
mork_bool outNew = morkBool_kFalse;
/* see if we can allocate all the new arrays before we go any further: */
morkAssoc** newBuckets = this->new_buckets(ev, inSlots);
morkAssoc* newAssocs = this->new_assocs(ev, inSlots);
mork_u1* newKeys = this->new_keys(ev, inSlots);
mork_u1* newValues = this->new_values(ev, inSlots);
mork_change* newChanges = this->new_changes(ev, inSlots);
/* it is okay for newChanges to be null when changes are not held: */
mork_bool okayChanges = ( newChanges || !this->FormHoldChanges() );
/* it is okay for newValues to be null when values are zero sized: */
mork_bool okayValues = ( newValues || !this->FormValSize() );
if ( newBuckets && newAssocs && newKeys && okayChanges && okayValues )
{
outNew = morkBool_kTrue; /* yes, we created all the arrays we need */
/* init the old hashArrays with slots from this hash table: */
old->mHashArrays_Heap = mMap_Heap;
old->mHashArrays_Slots = mMap_Slots;
old->mHashArrays_Keys = mMap_Keys;
old->mHashArrays_Vals = mMap_Vals;
old->mHashArrays_Assocs = mMap_Assocs;
old->mHashArrays_Buckets = mMap_Buckets;
old->mHashArrays_Changes = mMap_Changes;
/* now replace all our array slots with the new structures: */
++mMap_Seed; /* note the map is now changed */
mMap_Keys = newKeys;
mMap_Vals = newValues;
mMap_Buckets = newBuckets;
mMap_Assocs = newAssocs;
mMap_FreeList = newAssocs; /* all are free to start with */
mMap_Changes = newChanges;
mMap_Slots = inSlots;
}
else /* free the partial set of arrays that were actually allocated */
{
nsIMdbEnv* menv = ev->AsMdbEnv();
nsIMdbHeap* heap = mMap_Heap;
if ( newBuckets )
heap->Free(menv, newBuckets);
if ( newAssocs )
heap->Free(menv, newAssocs);
if ( newKeys )
heap->Free(menv, newKeys);
if ( newValues )
heap->Free(menv, newValues);
if ( newChanges )
heap->Free(menv, newChanges);
MORK_MEMSET(old, 0, sizeof(morkHashArrays));
}
return outNew;
}
/*| grow: make the map arrays bigger by 33%. The old map is completely
**| full, or else we would not have called grow() to get more space. This
**| means the free list is empty, and also means every old key and value is in
**| use in the old arrays. So every key and value must be copied to the new
**| arrays, and since they are contiguous in the old arrays, we can efficiently
**| bitwise copy them in bulk from the old arrays to the new arrays, without
**| paying any attention to the structure of the old arrays.
**|
**|| The content of the old bucket and assoc arrays need not be copied because
**| this information is going to be completely rebuilt by rehashing all the
**| keys into their new buckets, given the new larger map capacity. The new
**| bucket array from new_arrays() is assumed to contain all zeroes, which is
**| necessary to ensure the lists in each bucket stay null terminated as we
**| build the new linked lists. (Note no old bucket ordering is preserved.)
**|
**|| If the old capacity is N, then in the new arrays the assocs with indexes
**| from zero to N-1 are still allocated and must be rehashed into the map.
**| The new free list contains all the following assocs, starting with the new
**| assoc link at index N. (We call the links in the link array "assocs"
**| because allocating a link is the same as allocating the key/value pair
**| with the same index as the link.)
**|
**|| The new free list is initialized simply by pointing at the first new link
**| in the assoc array after the size of the old assoc array. This assumes
**| that FeHashTable_new_arrays() has already linked all the new assocs into a
**| list with the first at the head of the list and the last at the tail of the
**| list. So by making the free list point to the first of the new uncopied
**| assocs, the list is already well-formed.
|*/
mork_bool morkMap::grow(morkEnv* ev)
{
if ( mMap_Heap ) /* can we grow the map? */
{
mork_num newSlots = ((mMap_Slots * 4) / 3) + 1; /* +33% */
morkHashArrays old; /* a place to temporarily hold all the old arrays */
if ( this->new_arrays(ev, &old, newSlots) ) /* have more? */
{
// morkMap_mHash hash = this->FormHash(); /* for terse loop use */
/* figure out the bulk volume sizes of old keys and values to move: */
mork_num oldSlots = old.mHashArrays_Slots; /* number of old assocs */
mork_num keyBulk = oldSlots * this->FormKeySize(); /* key volume */
mork_num valBulk = oldSlots * this->FormValSize(); /* values */
/* convenient variables for new arrays that need to be rehashed: */
morkAssoc** newBuckets = mMap_Buckets; /* new all zeroes */
morkAssoc* newAssocs = mMap_Assocs; /* hash into buckets */
morkAssoc* newFreeList = newAssocs + oldSlots; /* new room is free */
mork_u1* key = mMap_Keys; /* the first key to rehash */
--newAssocs; /* back up one before preincrement used in while loop */
/* move all old keys and values to the new arrays: */
MORK_MEMCPY(mMap_Keys, old.mHashArrays_Keys, keyBulk);
if ( valBulk ) /* are values nonzero sized? */
MORK_MEMCPY(mMap_Vals, old.mHashArrays_Vals, valBulk);
mMap_FreeList = newFreeList; /* remaining assocs are free */
while ( ++newAssocs < newFreeList ) /* rehash another old assoc? */
{
morkAssoc** top = newBuckets + (this->Hash(ev, key) % newSlots);
key += this->FormKeySize(); /* the next key to rehash */
newAssocs->mAssoc_Next = *top; /* link to prev bucket top */
*top = newAssocs; /* push assoc on top of bucket */
}
++mMap_Seed; /* note the map has changed */
old.finalize(ev); /* remember to free the old arrays */
}
}
else ev->OutOfMemoryError();
return ev->Good();
}
mork_bool
morkMap::Put(morkEnv* ev, const void* inKey, const void* inVal,
void* outKey, void* outVal, mork_change** outChange)
{
mork_bool outPut = morkBool_kFalse;
if ( this->GoodMap() ) /* looks good? */
{
mork_u4 hash = this->Hash(ev, inKey);
morkAssoc** ref = this->find(ev, inKey, hash);
if ( ref ) /* assoc was found? reuse an existing assoc slot? */
{
outPut = morkBool_kTrue; /* inKey was indeed already inside the map */
}
else /* assoc not found -- need to allocate a new assoc slot */
{
morkAssoc* assoc = this->pop_free_assoc();
if ( !assoc ) /* no slots remaining in free list? must grow map? */
{
if ( this->grow(ev) ) /* successfully made map larger? */
assoc = this->pop_free_assoc();
}
if ( assoc ) /* allocated new assoc without error? */
{
ref = mMap_Buckets + (hash % mMap_Slots);
assoc->mAssoc_Next = *ref; /* link to prev bucket top */
*ref = assoc; /* push assoc on top of bucket */
++mMap_Fill; /* one more member in the collection */
++mMap_Seed; /* note the map has changed */
}
}
if ( ref ) /* did not have an error during possible growth? */
{
mork_pos i = (*ref) - mMap_Assocs; /* index of assoc */
if ( outPut && (outKey || outVal) ) /* copy old before cobbering? */
this->get_assoc(outKey, outVal, i);
this->put_assoc(inKey, inVal, i);
++mMap_Seed; /* note the map has changed */
if ( outChange )
{
if ( mMap_Changes )
*outChange = mMap_Changes + i;
else
*outChange = this->FormDummyChange();
}
}
}
else this->NewBadMapError(ev);
return outPut;
}
mork_num
morkMap::CutAll(morkEnv* ev)
{
mork_num outCutAll = 0;
if ( this->GoodMap() ) /* map looks good? */
{
mork_num slots = mMap_Slots;
morkAssoc* before = mMap_Assocs - 1; /* before first member */
morkAssoc* assoc = before + slots; /* the very last member */
++mMap_Seed; /* note the map is changed */
/* make the assoc array a linked list headed by first & tailed by last: */
assoc->mAssoc_Next = 0; /* null terminate the new free list */
while ( --assoc > before ) /* another assoc to link into the list? */
assoc->mAssoc_Next = assoc + 1;
mMap_FreeList = mMap_Assocs; /* all are free */
outCutAll = mMap_Fill; /* we'll cut all of them of course */
mMap_Fill = 0; /* the map is completely empty */
}
else this->NewBadMapError(ev);
return outCutAll;
}
mork_bool
morkMap::Cut(morkEnv* ev, const void* inKey,
void* outKey, void* outVal, mork_change** outChange)
{
mork_bool outCut = morkBool_kFalse;
if ( this->GoodMap() ) /* looks good? */
{
mork_u4 hash = this->Hash(ev, inKey);
morkAssoc** ref = this->find(ev, inKey, hash);
if ( ref ) /* found an assoc for key? */
{
outCut = morkBool_kTrue;
morkAssoc* assoc = *ref;
mork_pos i = assoc - mMap_Assocs; /* index of assoc */
*ref = assoc->mAssoc_Next; /* unlink the found assoc */
this->push_free_assoc(assoc); /* and put it in free list */
if ( outChange )
{
if ( mMap_Changes )
*outChange = mMap_Changes + i;
else
*outChange = this->FormDummyChange();
}
++mMap_Seed; /* note the map has changed */
if ( mMap_Fill ) /* the count shows nonzero members? */
--mMap_Fill; /* one less member in the collection */
else
this->NewSlotsUnderflowWarning(ev);
}
}
else this->NewBadMapError(ev);
return outCut;
}
mork_bool
morkMap::Get(morkEnv* ev, const void* inKey,
void* outKey, void* outVal, mork_change** outChange)
{
mork_bool outGet = morkBool_kFalse;
if ( this->GoodMap() ) /* looks good? */
{
mork_u4 hash = this->Hash(ev, inKey);
morkAssoc** ref = this->find(ev, inKey, hash);
if ( ref ) /* found an assoc for inKey? */
{
mork_pos i = (*ref) - mMap_Assocs; /* index of assoc */
outGet = morkBool_kTrue;
this->get_assoc(outKey, outVal, i);
if ( outChange )
{
if ( mMap_Changes )
*outChange = mMap_Changes + i;
else
*outChange = this->FormDummyChange();
}
}
}
else this->NewBadMapError(ev);
return outGet;
}
morkMapIter::morkMapIter( )
: mMapIter_Map( 0 )
, mMapIter_Seed( 0 )
, mMapIter_Bucket( 0 )
, mMapIter_AssocRef( 0 )
, mMapIter_Assoc( 0 )
, mMapIter_Next( 0 )
{
}
void
morkMapIter::InitMapIter(morkEnv* ev, morkMap* ioMap)
{
mMapIter_Map = 0;
mMapIter_Seed = 0;
mMapIter_Bucket = 0;
mMapIter_AssocRef = 0;
mMapIter_Assoc = 0;
mMapIter_Next = 0;
if ( ioMap )
{
if ( ioMap->GoodMap() )
{
mMapIter_Map = ioMap;
mMapIter_Seed = ioMap->mMap_Seed;
}
else ioMap->NewBadMapError(ev);
}
else ev->NilPointerError();
}
morkMapIter::morkMapIter(morkEnv* ev, morkMap* ioMap)
: mMapIter_Map( 0 )
, mMapIter_Seed( 0 )
, mMapIter_Bucket( 0 )
, mMapIter_AssocRef( 0 )
, mMapIter_Assoc( 0 )
, mMapIter_Next( 0 )
{
if ( ioMap )
{
if ( ioMap->GoodMap() )
{
mMapIter_Map = ioMap;
mMapIter_Seed = ioMap->mMap_Seed;
}
else ioMap->NewBadMapError(ev);
}
else ev->NilPointerError();
}
void
morkMapIter::CloseMapIter(morkEnv* ev)
{
mMapIter_Map = 0;
mMapIter_Seed = 0;
mMapIter_Bucket = 0;
mMapIter_AssocRef = 0;
mMapIter_Assoc = 0;
mMapIter_Next = 0;
}
mork_change*
morkMapIter::First(morkEnv* ev, void* outKey, void* outVal)
{
mork_change* outFirst = 0;
morkMap* map = mMapIter_Map;
if ( map && map->GoodMap() ) /* map looks good? */
{
morkAssoc** bucket = map->mMap_Buckets;
morkAssoc** end = bucket + map->mMap_Slots; /* one past last */
mMapIter_Seed = map->mMap_Seed; /* sync the seeds */
while ( bucket < end ) /* another bucket in which to look for assocs? */
{
morkAssoc* assoc = *bucket++;
if ( assoc ) /* found the first map assoc in use? */
{
mork_pos i = assoc - map->mMap_Assocs;
mork_change* c = map->mMap_Changes;
outFirst = ( c )? (c + i) : map->FormDummyChange();
mMapIter_Assoc = assoc; /* current assoc in iteration */
mMapIter_Next = assoc->mAssoc_Next; /* more in bucket */
mMapIter_Bucket = --bucket; /* bucket for this assoc */
mMapIter_AssocRef = bucket; /* slot referencing assoc */
map->get_assoc(outKey, outVal, i);
break; /* end while loop */
}
}
}
else map->NewBadMapError(ev);
return outFirst;
}
mork_change*
morkMapIter::Next(morkEnv* ev, void* outKey, void* outVal)
{
mork_change* outNext = 0;
morkMap* map = mMapIter_Map;
if ( map && map->GoodMap() ) /* map looks good? */
{
if ( mMapIter_Seed == map->mMap_Seed ) /* in sync? */
{
morkAssoc* here = mMapIter_Assoc; /* current assoc */
if ( here ) /* iteration is not yet concluded? */
{
morkAssoc* next = mMapIter_Next;
morkAssoc* assoc = next; /* default new mMapIter_Assoc */
if ( next ) /* there are more assocs in the same bucket after Here? */
{
morkAssoc** ref = mMapIter_AssocRef;
/* (*HereRef) equals Here, except when Here has been cut, after
** which (*HereRef) always equals Next. So if (*HereRef) is not
** equal to Next, then HereRef still needs to be updated to point
** somewhere else other than Here. Otherwise it is fine.
*/
if ( *ref != next ) /* Here was not cut? must update HereRef? */
mMapIter_AssocRef = &here->mAssoc_Next;
mMapIter_Next = next->mAssoc_Next;
}
else /* look for the next assoc in the next nonempty bucket */
{
morkAssoc** bucket = map->mMap_Buckets;
morkAssoc** end = bucket + map->mMap_Slots; /* beyond */
mMapIter_Assoc = 0; /* default to no more assocs */
bucket = mMapIter_Bucket; /* last exhausted bucket */
mMapIter_Assoc = 0; /* default to iteration ended */
while ( ++bucket < end ) /* another bucket to search for assocs? */
{
assoc = *bucket;
if ( assoc ) /* found another map assoc in use? */
{
mMapIter_Bucket = bucket;
mMapIter_AssocRef = bucket; /* ref to assoc */
mMapIter_Next = assoc->mAssoc_Next; /* more */
break; /* end while loop */
}
}
}
if ( assoc ) /* did we find another assoc in the iteration? */
{
mMapIter_Assoc = assoc; /* current assoc */
mork_pos i = assoc - map->mMap_Assocs;
mork_change* c = map->mMap_Changes;
outNext = ( c )? (c + i) : map->FormDummyChange();
map->get_assoc( outKey, outVal, i);
}
}
}
else map->NewIterOutOfSyncError(ev);
}
else map->NewBadMapError(ev);
return outNext;
}
mork_change*
morkMapIter::Here(morkEnv* ev, void* outKey, void* outVal)
{
mork_change* outHere = 0;
morkMap* map = mMapIter_Map;
if ( map && map->GoodMap() ) /* map looks good? */
{
if ( mMapIter_Seed == map->mMap_Seed ) /* in sync? */
{
morkAssoc* here = mMapIter_Assoc; /* current assoc */
if ( here ) /* iteration is not yet concluded? */
{
mork_pos i = here - map->mMap_Assocs;
mork_change* c = map->mMap_Changes;
outHere = ( c )? (c + i) : map->FormDummyChange();
map->get_assoc(outKey, outVal, i);
}
}
else map->NewIterOutOfSyncError(ev);
}
else map->NewBadMapError(ev);
return outHere;
}
mork_change*
morkMapIter::CutHere(morkEnv* ev, void* outKey, void* outVal)
{
mork_change* outCutHere = 0;
morkMap* map = mMapIter_Map;
if ( map && map->GoodMap() ) /* map looks good? */
{
if ( mMapIter_Seed == map->mMap_Seed ) /* in sync? */
{
morkAssoc* here = mMapIter_Assoc; /* current assoc */
if ( here ) /* iteration is not yet concluded? */
{
morkAssoc** ref = mMapIter_AssocRef;
if ( *ref != mMapIter_Next ) /* not already cut? */
{
mork_pos i = here - map->mMap_Assocs;
mork_change* c = map->mMap_Changes;
outCutHere = ( c )? (c + i) : map->FormDummyChange();
if ( outKey || outVal )
map->get_assoc(outKey, outVal, i);
map->push_free_assoc(here); /* add to free list */
*ref = mMapIter_Next; /* unlink here from bucket list */
/* note the map has changed, but we are still in sync: */
mMapIter_Seed = ++map->mMap_Seed; /* sync */
if ( map->mMap_Fill ) /* still has nonzero value? */
--map->mMap_Fill; /* one less member in the collection */
else
map->NewSlotsUnderflowWarning(ev);
}
}
}
else map->NewIterOutOfSyncError(ev);
}
else map->NewBadMapError(ev);
return outCutHere;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,372 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKMAP_
#define _MORKMAP_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/* (These hash methods closely resemble those in public domain IronDoc.) */
/*| Equal: equal for hash table. Note equal(a,b) implies hash(a)==hash(b).
|*/
typedef mork_bool (* morkMap_mEqual)
(const morkMap* self, morkEnv* ev, const void* inKeyA, const void* inKeyB);
/*| Hash: hash for hash table. Note equal(a,b) implies hash(a)==hash(b).
|*/
typedef mork_u4 (* morkMap_mHash)
(const morkMap* self, morkEnv* ev, const void* inKey);
/*| IsNil: whether a key slot contains a "null" value denoting "no such key".
|*/
typedef mork_bool (* morkMap_mIsNil)
(const morkMap* self, morkEnv* ev, const void* inKey);
/*| Note: notify regarding a refcounting change for a key or a value.
|*/
//typedef void (* morkMap_mNote)
//(morkMap* self, morkEnv* ev, void* inKeyOrVal);
/*| morkMapForm: slots need to initialize a new dict. (This is very similar
**| to the config object for public domain IronDoc hash tables.)
|*/
class morkMapForm { // a struct of callback method pointers for morkMap
public:
// const void* mMapForm_NilKey; // externally defined 'nil' bit pattern
// void* mMapForm_NilBuf[ 8 ]; // potential place to put NilKey
// If keys are no larger than 8*sizeof(void*), NilKey can be put in NilBuf.
// Note this should be true for all Mork subclasses, and we plan usage so.
// These three methods must always be provided, so zero will cause errors:
// morkMap_mEqual mMapForm_Equal; // for comparing two keys for identity
// morkMap_mHash mMapForm_Hash; // deterministic key to hash method
// morkMap_mIsNil mMapForm_IsNil; // to query whether a key equals 'nil'
// If any of these method slots are nonzero, then morkMap will call the
// appropriate one to notify dict users when a key or value is added or cut.
// Presumably a caller wants to know this in order to perform refcounting or
// some other kind of memory management. These methods are definitely only
// called when references to keys or values are inserted or removed, and are
// never called when the actual number of references does not change (such
// as when added keys are already present or cut keys are alreading missing).
//
// morkMap_mNote mMapForm_AddKey; // if nonzero, notify about add key
// morkMap_mNote mMapForm_CutKey; // if nonzero, notify about cut key
// morkMap_mNote mMapForm_AddVal; // if nonzero, notify about add val
// morkMap_mNote mMapForm_CutVal; // if nonzero, notify about cut val
//
// These note methods have been removed because it seems difficult to
// guarantee suitable alignment of objects passed to notification methods.
// Note dict clients should pick key and val sizes that provide whatever
// alignment will be required for an array of such keys and values.
mork_size mMapForm_KeySize; // size of every key (cannot be zero)
mork_size mMapForm_ValSize; // size of every val (can indeed be zero)
mork_bool mMapForm_HoldChanges; // support changes array in the map
mork_change mMapForm_DummyChange; // change used for false HoldChanges
mork_bool mMapForm_KeyIsIP; // key is mork_ip sized
mork_bool mMapForm_ValIsIP; // key is mork_ip sized
};
/*| morkAssoc: a canonical association slot in a morkMap. A single assoc
**| instance does nothing except point to the next assoc in the same bucket
**| of a hash table. Each assoc has only two interesting attributes: 1) the
**| address of the assoc, and 2) the next assoc in a bucket's list. The assoc
**| address is interesting because in the context of an array of such assocs,
**| one can determine the index of a particular assoc in the array by address
**| arithmetic, subtracting the array address from the assoc address. And the
**| index of each assoc is the same index as the associated key and val slots
**| in the associated arrays
**|
**|| Think of an assoc instance as really also containing a key slot and a val
**| slot, where each key is mMap_Form.mMapForm_KeySize bytes in size, and
**| each val is mMap_Form.mMapForm_ValSize in size. But the key and val
**| slots are stored in separate arrays with indexes that are parallel to the
**| indexes in the array of morkAssoc instances. We have taken the variable
**| sized slots out of the morkAssoc structure, and put them into parallel
**| arrays associated with each morkAssoc by array index. And this leaves us
**| with only the link field to the next assoc in each assoc instance.
|*/
class morkAssoc {
public:
morkAssoc* mAssoc_Next;
};
#define morkDerived_kMap /*i*/ 0x4D70 /* ascii 'Mp' */
#define morkMap_kTag /*i*/ 0x6D4D6150 /* ascii 'mMaP' */
/*| morkMap: a hash table based on the public domain IronDoc hash table
**| (which is in turn rather like a similar OpenDoc hash table).
|*/
class morkMap : public morkNode {
// public: // slots inherited from morkNode (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
public: // state is public because the entire Mork system is private
nsIMdbHeap* mMap_Heap; // strong ref to heap allocating all space
mork_u4 mMap_Tag; // must equal morkMap_kTag
// When a morkMap instance is constructed, the dict form slots must be
// provided in order to properly configure a dict with all runtime needs:
morkMapForm mMap_Form; // construction time parameterization
// Whenever the dict changes structure in a way that would affect any
// iteration of the dict associations, the seed increments to show this:
mork_seed mMap_Seed; // counter for member and structural changes
// The current total assoc capacity of the dict is mMap_Slots, where
// mMap_Fill of these slots are actually holding content, so mMap_Fill
// is the actual membership count, and mMap_Slots is how larger membership
// can become before the hash table must grow the buffers being used.
mork_count mMap_Slots; // count of slots in the hash table
mork_fill mMap_Fill; // number of used slots in the hash table
// Key and value slots are bound to corresponding mMap_Assocs array slots.
// Instead of having a single array like this: {key,val,next}[ mMap_Slots ]
// we have instead three parallel arrays with essentially the same meaning:
// {key}[ mMap_Slots ], {val}[ mMap_Slots ], {assocs}[ mMap_Slots ]
mork_u1* mMap_Keys; // mMap_Slots * mMapForm_KeySize buffer
mork_u1* mMap_Vals; // mMap_Slots * mMapForm_ValSize buffer
// An assoc is "used" when it appears in a bucket's linked list of assocs.
// Until an assoc is used, it appears in the FreeList linked list. Every
// assoc that becomes used goes into the bucket determined by hashing the
// key associated with a new assoc. The key associated with a new assoc
// goes in to the slot in mMap_Keys which occupies exactly the same array
// index as the array index of the used assoc in the mMap_Assocs array.
morkAssoc* mMap_Assocs; // mMap_Slots * sizeof(morkAssoc) buffer
// The changes array is only needed when the
mork_change* mMap_Changes; // mMap_Slots * sizeof(mork_change) buffer
// The Buckets array need not be the same length as the Assocs array, but we
// usually do it that way so the average bucket depth is no more than one.
// (We could pick a different policy, or make it parameterizable, but that's
// tuning we can do some other time.)
morkAssoc** mMap_Buckets; // mMap_Slots * sizeof(morkAssoc*) buffer
// The length of the mMap_FreeList should equal (mMap_Slots - mMap_Fill).
// We need a free list instead of a simpler representation because assocs
// can be cut and returned to availability in any kind of unknown pattern.
// (However, when assocs are first allocated, or when the dict is grown, we
// know all new assocs are contiguous and can chain together adjacently.)
morkAssoc* mMap_FreeList; // list of unused mMap_Assocs array slots
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseMap() only if open
virtual ~morkMap(); // assert that CloseMap() executed earlier
public: // morkMap construction & destruction
morkMap(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioNodeHeap,
mork_size inKeySize, mork_size inValSize,
mork_size inSlots, nsIMdbHeap* ioSlotHeap, mork_bool inHoldChanges);
void CloseMap(morkEnv* ev); // called by
public: // dynamic type identification
mork_bool IsMap() const
{ return IsNode() && mNode_Derived == morkDerived_kMap; }
// } ===== end morkNode methods =====
public: // poly map hash table methods
// { ===== begin morkMap poly interface =====
virtual mork_bool // note: equal(a,b) implies hash(a) == hash(b)
Equal(morkEnv* ev, const void* inKeyA, const void* inKeyB) const = 0;
virtual mork_u4 // note: equal(a,b) implies hash(a) == hash(b)
Hash(morkEnv* ev, const void* inKey) const = 0;
// } ===== end morkMap poly interface =====
public: // open utitity methods
mork_bool GoodMapTag() const { return mMap_Tag == morkMap_kTag; }
mork_bool GoodMap() const
{ return ( IsNode() && GoodMapTag() ); }
void NewIterOutOfSyncError(morkEnv* ev);
void NewBadMapError(morkEnv* ev);
void NewSlotsUnderflowWarning(morkEnv* ev);
void InitMap(morkEnv* ev, mork_size inSlots);
protected: // internal utitity methods
friend class morkMapIter;
void clear_map(morkEnv* ev, nsIMdbHeap* ioHeap);
void* alloc(morkEnv* ev, mork_size inSize);
void* clear_alloc(morkEnv* ev, mork_size inSize);
void push_free_assoc(morkAssoc* ioAssoc)
{
ioAssoc->mAssoc_Next = mMap_FreeList;
mMap_FreeList = ioAssoc;
}
morkAssoc* pop_free_assoc()
{
morkAssoc* assoc = mMap_FreeList;
if ( assoc )
mMap_FreeList = assoc->mAssoc_Next;
return assoc;
}
morkAssoc** find(morkEnv* ev, const void* inKey, mork_u4 inHash) const;
mork_u1* new_keys(morkEnv* ev, mork_num inSlots);
mork_u1* new_values(morkEnv* ev, mork_num inSlots);
mork_change* new_changes(morkEnv* ev, mork_num inSlots);
morkAssoc** new_buckets(morkEnv* ev, mork_num inSlots);
morkAssoc* new_assocs(morkEnv* ev, mork_num inSlots);
mork_bool new_arrays(morkEnv* ev, morkHashArrays* old, mork_num inSlots);
mork_bool grow(morkEnv* ev);
void get_assoc(void* outKey, void* outVal, mork_pos inPos) const;
void put_assoc(const void* inKey, const void* inVal, mork_pos inPos) const;
public: // inlines to form slots
// const void* FormNilKey() const { return mMap_Form.mMapForm_NilKey; }
// morkMap_mEqual FormEqual() const { return mMap_Form.mMapForm_Equal; }
// morkMap_mHash FormHash() const { return mMap_Form.mMapForm_Hash; }
// orkMap_mIsNil FormIsNil() const { return mMap_Form.mMapForm_IsNil; }
// morkMap_mNote FormAddKey() const { return mMap_Form.mMapForm_AddKey; }
// morkMap_mNote FormCutKey() const { return mMap_Form.mMapForm_CutKey; }
// morkMap_mNote FormAddVal() const { return mMap_Form.mMapForm_AddVal; }
// morkMap_mNote FormCutVal() const { return mMap_Form.mMapForm_CutVal; }
mork_size FormKeySize() const { return mMap_Form.mMapForm_KeySize; }
mork_size FormValSize() const { return mMap_Form.mMapForm_ValSize; }
mork_bool FormKeyIsIP() const { return mMap_Form.mMapForm_KeyIsIP; }
mork_bool FormValIsIP() const { return mMap_Form.mMapForm_ValIsIP; }
mork_bool FormHoldChanges() const
{ return mMap_Form.mMapForm_HoldChanges; }
mork_change* FormDummyChange()
{ return &mMap_Form.mMapForm_DummyChange; }
public: // other map methods
mork_bool Put(morkEnv* ev, const void* inKey, const void* inVal,
void* outKey, void* outVal, mork_change** outChange);
mork_bool Cut(morkEnv* ev, const void* inKey,
void* outKey, void* outVal, mork_change** outChange);
mork_bool Get(morkEnv* ev, const void* inKey,
void* outKey, void* outVal, mork_change** outChange);
mork_num CutAll(morkEnv* ev);
private: // copying is not allowed
morkMap(const morkMap& other);
morkMap& operator=(const morkMap& other);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakMap(morkMap* me,
morkEnv* ev, morkMap** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongMap(morkMap* me,
morkEnv* ev, morkMap** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
/*| morkMapIter: an iterator for morkMap and subclasses. This is not a node,
**| and expected usage is as a member of some other node subclass, such as in
**| a cursor subclass or a thumb subclass. Also, iters might be as temp stack
**| objects when scanning the content of a map.
|*/
class morkMapIter{ // iterator for hash table map
protected:
morkMap* mMapIter_Map; // map to iterate, NOT refcounted
mork_seed mMapIter_Seed; // cached copy of map's seed
morkAssoc** mMapIter_Bucket; // one bucket in mMap_Buckets array
morkAssoc** mMapIter_AssocRef; // usually *AtRef equals Here
morkAssoc* mMapIter_Assoc; // the current assoc in an iteration
morkAssoc* mMapIter_Next; // mMapIter_Assoc->mAssoc_Next */
public:
morkMapIter(morkEnv* ev, morkMap* ioMap);
void CloseMapIter(morkEnv* ev);
morkMapIter( ); // everything set to zero -- need to call InitMapIter()
protected: // we want all subclasses to provide typesafe wrappers:
void InitMapIter(morkEnv* ev, morkMap* ioMap);
// The morkAssoc returned below is always either mork_change* or
// else nil (when there is no such assoc). We return a pointer to
// the change rather than a simple bool, because callers might
// want to access change info associated with an assoc.
mork_change* First(morkEnv* ev, void* outKey, void* outVal);
mork_change* Next(morkEnv* ev, void* outKey, void* outVal);
mork_change* Here(morkEnv* ev, void* outKey, void* outVal);
mork_change* CutHere(morkEnv* ev, void* outKey, void* outVal);
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKMAP_ */

View File

@@ -0,0 +1,576 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKHANDLE_
#include "morkHandle.h"
#endif
/*3456789_123456789_123456789_123456789_123456789_123456789_123456789_12345678*/
/* ===== ===== ===== ===== morkUsage ===== ===== ===== ===== */
static morkUsage morkUsage_gHeap; // ensure EnsureReadyStaticUsage()
const morkUsage& morkUsage::kHeap = morkUsage_gHeap;
static morkUsage morkUsage_gStack; // ensure EnsureReadyStaticUsage()
const morkUsage& morkUsage::kStack = morkUsage_gStack;
static morkUsage morkUsage_gMember; // ensure EnsureReadyStaticUsage()
const morkUsage& morkUsage::kMember = morkUsage_gMember;
static morkUsage morkUsage_gGlobal; // ensure EnsureReadyStaticUsage()
const morkUsage& morkUsage::kGlobal = morkUsage_gGlobal;
static morkUsage morkUsage_gPool; // ensure EnsureReadyStaticUsage()
const morkUsage& morkUsage::kPool = morkUsage_gPool;
static morkUsage morkUsage_gNone; // ensure EnsureReadyStaticUsage()
const morkUsage& morkUsage::kNone = morkUsage_gNone;
// This must be structured to allow for non-zero values in global variables
// just before static init time. We can only safely check for whether a
// global has the address of some other global. Please, do not initialize
// either of the variables below to zero, because this could break when a zero
// is assigned at static init time, but after EnsureReadyStaticUsage() runs.
static mork_u4 morkUsage_g_static_init_target; // only address of this matters
static mork_u4* morkUsage_g_static_init_done; // is address of target above?
#define morkUsage_do_static_init() \
( morkUsage_g_static_init_done = &morkUsage_g_static_init_target )
#define morkUsage_need_static_init() \
( morkUsage_g_static_init_done != &morkUsage_g_static_init_target )
/*static*/
void morkUsage::EnsureReadyStaticUsage()
{
if ( morkUsage_need_static_init() )
{
morkUsage_do_static_init();
morkUsage_gHeap.InitUsage(morkUsage_kHeap);
morkUsage_gStack.InitUsage(morkUsage_kStack);
morkUsage_gMember.InitUsage(morkUsage_kMember);
morkUsage_gGlobal.InitUsage(morkUsage_kGlobal);
morkUsage_gPool.InitUsage(morkUsage_kPool);
morkUsage_gNone.InitUsage(morkUsage_kNone);
}
}
/*static*/
const morkUsage& morkUsage::GetHeap() // kHeap safe at static init time
{
EnsureReadyStaticUsage();
return morkUsage_gHeap;
}
/*static*/
const morkUsage& morkUsage::GetStack() // kStack safe at static init time
{
EnsureReadyStaticUsage();
return morkUsage_gStack;
}
/*static*/
const morkUsage& morkUsage::GetMember() // kMember safe at static init time
{
EnsureReadyStaticUsage();
return morkUsage_gMember;
}
/*static*/
const morkUsage& morkUsage::GetGlobal() // kGlobal safe at static init time
{
EnsureReadyStaticUsage();
return morkUsage_gGlobal;
}
/*static*/
const morkUsage& morkUsage::GetPool() // kPool safe at static init time
{
EnsureReadyStaticUsage();
return morkUsage_gPool;
}
/*static*/
const morkUsage& morkUsage::GetNone() // kNone safe at static init time
{
EnsureReadyStaticUsage();
return morkUsage_gNone;
}
morkUsage::morkUsage()
{
if ( morkUsage_need_static_init() )
{
morkUsage::EnsureReadyStaticUsage();
}
}
morkUsage::morkUsage(mork_usage code)
: mUsage_Code(code)
{
if ( morkUsage_need_static_init() )
{
morkUsage::EnsureReadyStaticUsage();
}
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*static*/ void*
morkNode::MakeNew(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev)
{
void* node = 0;
if ( &ioHeap )
{
ioHeap.Alloc(ev->AsMdbEnv(), inSize, (void **) &node);
if ( !node )
ev->OutOfMemoryError();
}
else
ev->NilPointerError();
return node;
}
/*static*/ void
morkNode::OnDeleteAssert(void* ioAddress) // cannot operator delete()
{
MORK_USED_1(ioAddress);
MORK_ASSERT(morkBool_kFalse); // tell developer: must not delete nodes
}
/*public non-poly*/ void
morkNode::ZapOld(morkEnv* ev, nsIMdbHeap* ioHeap)
// relaces operator delete()
{
if ( this )
{
if ( this->IsNode() )
{
this->morkNode::~morkNode(); // first call polymorphic destructor
if ( ioHeap ) // was this node heap allocated?
ioHeap->Free(ev->AsMdbEnv(), this);
else if ( mNode_Usage == morkUsage_kPool )
{
morkHandle* h = (morkHandle*) this;
if ( h->IsHandle() && h->GoodHandleTag() )
{
if ( h->mHandle_Face )
{
ev->mEnv_HandlePool->ZapHandle(ev, h->mHandle_Face);
}
else
ev->NilPointerError();
}
}
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
/*public virtual*/ void
morkNode::CloseMorkNode(morkEnv* ev) // CloseNode() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseNode(ev);
this->MarkShut();
}
}
/*public virtual*/
morkNode::~morkNode() // assert that CloseNode() executed earlier
{
MORK_ASSERT(this->IsShutNode());
mNode_Access = morkAccess_kDead;
mNode_Usage = morkUsage_kNone;
}
/*public virtual*/
// void CloseMorkNode(morkEnv* ev) = 0; // CloseNode() only if open
// CloseMorkNode() is the polymorphic close method called when uses==0,
// which must do NOTHING at all when IsOpenNode() is not true. Otherwise,
// CloseMorkNode() should call a static close method specific to an object.
// Each such static close method should either call inherited static close
// methods, or else perform the consolidated effect of calling them, where
// subclasses should closely track any changes in base classes with care.
/*public non-poly*/
morkNode::morkNode(const morkUsage& inUsage, nsIMdbHeap* ioHeap)
: mNode_Heap( ioHeap )
, mNode_Base( morkBase_kNode )
, mNode_Derived ( 0 ) // until subclass sets appropriately
, mNode_Access( morkAccess_kOpen )
, mNode_Usage( inUsage.Code() )
, mNode_Mutable( morkAble_kEnabled )
, mNode_Load( morkLoad_kClean )
, mNode_Uses( 1 )
, mNode_Refs( 1 )
{
}
/*public non-poly*/
morkNode::morkNode(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap)
: mNode_Heap( ioHeap )
, mNode_Base( morkBase_kNode )
, mNode_Derived ( 0 ) // until subclass sets appropriately
, mNode_Access( morkAccess_kOpen )
, mNode_Usage( inUsage.Code() )
, mNode_Mutable( morkAble_kEnabled )
, mNode_Load( morkLoad_kClean )
, mNode_Uses( 1 )
, mNode_Refs( 1 )
{
if ( !ioHeap && mNode_Usage == morkUsage_kHeap )
{
this->NilHeapError(ev);
}
}
/*protected non-poly*/ void
morkNode::RefsUnderUsesWarning(morkEnv* ev) const
{
ev->NewError("mNode_Refs < mNode_Uses");
}
/*protected non-poly*/ void
morkNode::NonNodeError(morkEnv* ev) const // called when IsNode() is false
{
ev->NewError("non-morkNode");
}
/*protected non-poly*/ void
morkNode::NonOpenNodeError(morkEnv* ev) const // when IsOpenNode() is false
{
ev->NewError("non-open-morkNode");
}
/*protected non-poly*/ void
morkNode::NonMutableNodeError(morkEnv* ev) const // when IsMutable() is false
{
ev->NewError("non-mutable-morkNode");
}
/*protected non-poly*/ void
morkNode::NilHeapError(morkEnv* ev) const // zero mNode_Heap w/ kHeap usage
{
ev->NewError("nil mNode_Heap");
}
/*protected non-poly*/ void
morkNode::RefsOverflowWarning(morkEnv* ev) const // mNode_Refs overflow
{
ev->NewWarning("mNode_Refs overflow");
}
/*protected non-poly*/ void
morkNode::UsesOverflowWarning(morkEnv* ev) const // mNode_Uses overflow
{
ev->NewWarning("mNode_Uses overflow");
}
/*protected non-poly*/ void
morkNode::RefsUnderflowWarning(morkEnv* ev) const // mNode_Refs underflow
{
ev->NewWarning("mNode_Refs underflow");
}
/*protected non-poly*/ void
morkNode::UsesUnderflowWarning(morkEnv* ev) const // mNode_Uses underflow
{
ev->NewWarning("mNode_Uses underflow");
}
/*public non-poly*/ void
morkNode::CloseNode(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
this->MarkShut();
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
void // utility method very similar to morkNode::SlotStrongNode():
nsIMdbHeap_SlotStrongHeap(nsIMdbHeap* self, morkEnv* ev, nsIMdbHeap** ioSlot)
// If *ioSlot is non-nil, that heap is released by CutStrongRef() and
// then zeroed out. Then if this is non-nil, this is acquired by
// calling AddStrongRef(), and if the return value shows success,
// then this is put into slot *ioSlot. Note self can be nil, so we
// permit expression 'nsIMdbHeap_SlotStrongHeap(0, ev, &slot)'.
{
nsIMdbEnv* menv = ev->AsMdbEnv();
nsIMdbHeap* heap = *ioSlot;
if ( heap )
{
*ioSlot = 0;
heap->CutStrongRef(menv);
}
if ( self && ev->Good() && (self->AddStrongRef(menv)==0) && ev->Good() )
*ioSlot = self;
}
/*public static*/ void
morkNode::SlotStrongNode(morkNode* me, morkEnv* ev, morkNode** ioSlot)
// If *ioSlot is non-nil, that node is released by CutStrongRef() and
// then zeroed out. Then if me is non-nil, this is acquired by
// calling AddStrongRef(), and if positive is returned to show success,
// then me is put into slot *ioSlot. Note me can be nil, so we take
// expression 'morkNode::SlotStrongNode((morkNode*) 0, ev, &slot)'.
{
morkNode* node = *ioSlot;
if ( node )
{
*ioSlot = 0;
node->CutStrongRef(ev);
}
if ( me && me->AddStrongRef(ev) )
*ioSlot = me;
}
/*public static*/ void
morkNode::SlotWeakNode(morkNode* me, morkEnv* ev, morkNode** ioSlot)
// If *ioSlot is non-nil, that node is released by CutWeakRef() and
// then zeroed out. Then if me is non-nil, this is acquired by
// calling AddWeakRef(), and if positive is returned to show success,
// then me is put into slot *ioSlot. Note me can be nil, so we
// expression 'morkNode::SlotWeakNode((morkNode*) 0, ev, &slot)'.
{
morkNode* node = *ioSlot;
if ( node )
{
*ioSlot = 0;
node->CutWeakRef(ev);
}
if ( me && me->AddWeakRef(ev) )
*ioSlot = me;
}
/*public non-poly*/ mork_uses
morkNode::AddStrongRef(morkEnv* ev)
{
mork_uses outUses = 0;
if ( this )
{
if ( this->IsNode() )
{
mork_uses uses = mNode_Uses;
mork_refs refs = mNode_Refs;
if ( refs < uses ) // need to fix broken refs/uses relation?
{
this->RefsUnderUsesWarning(ev);
mNode_Refs = mNode_Uses = refs = uses;
}
if ( refs < morkNode_kMaxRefCount ) // not too great?
{
mNode_Refs = ++refs;
mNode_Uses = ++uses;
}
else
this->RefsOverflowWarning(ev);
outUses = uses;
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
return outUses;
}
/*private non-poly*/ mork_bool
morkNode::cut_use_count(morkEnv* ev) // just one part of CutStrongRef()
{
mork_bool didCut = morkBool_kFalse;
if ( this )
{
if ( this->IsNode() )
{
mork_uses uses = mNode_Uses;
if ( uses ) // not yet zero?
mNode_Uses = --uses;
else
this->UsesUnderflowWarning(ev);
didCut = morkBool_kTrue;
if ( !mNode_Uses ) // last use gone? time to close node?
{
if ( this->IsOpenNode() )
{
if ( !mNode_Refs ) // no outstanding reference?
{
this->RefsUnderflowWarning(ev);
++mNode_Refs; // prevent potential crash during close
}
this->CloseMorkNode(ev); // polymorphic self close
// (Note CutNode() is not polymorphic -- so don't call that.)
}
}
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
return didCut;
}
/*public non-poly*/ mork_uses
morkNode::CutStrongRef(morkEnv* ev)
{
mork_refs outRefs = 0;
if ( this )
{
if ( this->IsNode() )
{
if ( this->cut_use_count(ev) )
outRefs = this->CutWeakRef(ev);
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
return outRefs;
}
/*public non-poly*/ mork_refs
morkNode::AddWeakRef(morkEnv* ev)
{
mork_refs outRefs = 0;
if ( this )
{
if ( this->IsNode() )
{
mork_refs refs = mNode_Refs;
if ( refs < morkNode_kMaxRefCount ) // not too great?
mNode_Refs = ++refs;
else
this->RefsOverflowWarning(ev);
outRefs = refs;
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
return outRefs;
}
/*public non-poly*/ mork_refs
morkNode::CutWeakRef(morkEnv* ev)
{
mork_refs outRefs = 0;
if ( this )
{
if ( this->IsNode() )
{
mork_uses uses = mNode_Uses;
mork_refs refs = mNode_Refs;
if ( refs ) // not yet zero?
mNode_Refs = --refs;
else
this->RefsUnderflowWarning(ev);
if ( refs < uses ) // need to fix broken refs/uses relation?
{
this->RefsUnderUsesWarning(ev);
mNode_Refs = mNode_Uses = refs = uses;
}
outRefs = refs;
if ( !refs ) // last reference gone? time to destroy node?
this->ZapOld(ev, mNode_Heap); // self destroy, use this no longer
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
return outRefs;
}
static const char* morkNode_kBroken = "broken";
/*public non-poly*/ const char*
morkNode::GetNodeAccessAsString() const // e.g. "open", "shut", etc.
{
const char* outString = morkNode_kBroken;
switch( mNode_Access )
{
case morkAccess_kOpen: outString = "open"; break;
case morkAccess_kClosing: outString = "closing"; break;
case morkAccess_kShut: outString = "shut"; break;
case morkAccess_kDead: outString = "dead"; break;
}
return outString;
}
/*public non-poly*/ const char*
morkNode::GetNodeUsageAsString() const // e.g. "heap", "stack", etc.
{
const char* outString = morkNode_kBroken;
switch( mNode_Usage )
{
case morkUsage_kHeap: outString = "heap"; break;
case morkUsage_kStack: outString = "stack"; break;
case morkUsage_kMember: outString = "member"; break;
case morkUsage_kGlobal: outString = "global"; break;
case morkUsage_kPool: outString = "pool"; break;
case morkUsage_kNone: outString = "none"; break;
}
return outString;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,274 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKNODE_
#define _MORKNODE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkUsage_kHeap 'h'
#define morkUsage_kStack 's'
#define morkUsage_kMember 'm'
#define morkUsage_kGlobal 'g'
#define morkUsage_kPool 'p'
#define morkUsage_kNone 'n'
class morkUsage {
public:
mork_usage mUsage_Code; // kHeap, kStack, kMember, or kGhost
public:
morkUsage(mork_usage inCode);
morkUsage(); // does nothing except maybe call EnsureReadyStaticUsage()
void InitUsage( mork_usage inCode)
{ mUsage_Code = inCode; }
~morkUsage() { }
mork_usage Code() const { return mUsage_Code; }
static void EnsureReadyStaticUsage();
public:
static const morkUsage& kHeap; // morkUsage_kHeap
static const morkUsage& kStack; // morkUsage_kStack
static const morkUsage& kMember; // morkUsage_kMember
static const morkUsage& kGlobal; // morkUsage_kGlobal
static const morkUsage& kPool; // morkUsage_kPool
static const morkUsage& kNone; // morkUsage_kNone
static const morkUsage& GetHeap(); // kHeap, safe at static init time
static const morkUsage& GetStack(); // kStack, safe at static init time
static const morkUsage& GetMember(); // kMember, safe at static init time
static const morkUsage& GetGlobal(); // kGlobal, safe at static init time
static const morkUsage& GetPool(); // kPool, safe at static init time
static const morkUsage& GetNone(); // kNone, safe at static init time
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkNode_kMaxRefCount 0x0FFFF /* count sticks if it hits this */
#define morkBase_kNode /*i*/ 0x4E64 /* ascii 'Nd' */
/*| morkNode: several groups of two-byte integers that track the basic
**| status of an object that can be used to compose in-memory graphs.
**| This is the base class for nsIMdbObject (which adds members that fit
**| the needs of an nsIMdbObject subclass). The morkNode class is also used
**| as the base class for other Mork db classes with no strong relation to
**| the MDB class hierarchy.
**|
**|| Heap: the heap in which this node was allocated, when the usage equals
**| morkUsage_kHeap to show dynamic allocation. Note this heap is NOT ref-
**| counted, because that would be too great and complex a burden for all
**| the nodes allocated in that heap. So heap users should take care to
**| understand that nodes allocated in that heap are considered protected
**| by some inclusive context in which all those nodes are allocated, and
**| that context must maintain at least one strong refcount for the heap.
**| Occasionally a node subclass will indeed wish to hold a refcounted
**| reference to a heap, and possibly the same heap that is in mNode_Heap,
**| but this is always done in a separate slot that explicitly refcounts,
**| so we avoid confusing what is meant by the mNode_Heap slot.
|*/
class morkNode { // base class for constructing Mork object graphs
public: // state is public because the entire Mork system is private
nsIMdbHeap* mNode_Heap; // NON-refcounted heap pointer
mork_base mNode_Base; // must equal morkBase_kNode
mork_derived mNode_Derived; // depends on specific node subclass
mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
mork_able mNode_Mutable; // can this node be modified?
mork_load mNode_Load; // is this node clean or dirty?
mork_uses mNode_Uses; // refcount for strong refs
mork_refs mNode_Refs; // refcount for strong refs + weak refs
protected: // special case empty construction for morkHandleFrame
friend class morkHandleFrame;
morkNode() { }
public: // inlines for weird mNode_Mutable and mNode_Load constants
void SetFrozen() { mNode_Mutable = morkAble_kDisabled; }
void SetMutable() { mNode_Mutable = morkAble_kEnabled; }
void SetAsleep() { mNode_Mutable = morkAble_kAsleep; }
mork_bool IsFrozen() const { return mNode_Mutable == morkAble_kDisabled; }
mork_bool IsMutable() const { return mNode_Mutable == morkAble_kEnabled; }
mork_bool IsAsleep() const { return mNode_Mutable == morkAble_kAsleep; }
void SetClean() { mNode_Load = morkLoad_kClean; }
void SetDirty() { mNode_Load = morkLoad_kDirty; }
mork_bool IsClean() const { return mNode_Load == morkLoad_kClean; }
mork_bool IsDirty() const { return mNode_Load == morkLoad_kDirty; }
public: // morkNode memory management methods
static void* MakeNew(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev);
static void OnDeleteAssert(void* ioAddress); // cannot operator delete()
void ZapOld(morkEnv* ev, nsIMdbHeap* ioHeap); // replaces operator delete()
// this->morkNode::~morkNode(); // first call polymorphic destructor
// if ( ioHeap ) // was this node heap allocated?
// ioHeap->Free(ev->AsMdbEnv(), this);
public: // morkNode memory management operators
void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev)
{ return morkNode::MakeNew(inSize, ioHeap, ev); }
void operator delete(void* ioAddress)
{ morkNode::OnDeleteAssert(ioAddress); }
// do NOT call delete on morkNode instances. Call ZapOld() instead.
protected: // construction without an anv needed for first env constructed:
morkNode(const morkUsage& inUsage, nsIMdbHeap* ioHeap);
// { ===== begin basic node interface =====
public: // morkNode virtual methods
// virtual FlushMorkNode(morkEnv* ev, morkStream* ioStream);
// virtual WriteMorkNode(morkEnv* ev, morkStream* ioStream);
virtual ~morkNode(); // assert that CloseNode() executed earlier
virtual void CloseMorkNode(morkEnv* ev); // CloseNode() only if open
// CloseMorkNode() is the polymorphic close method called when uses==0,
// which must do NOTHING at all when IsOpenNode() is not true. Otherwise,
// CloseMorkNode() should call a static close method specific to an object.
// Each such static close method should either call inherited static close
// methods, or else perform the consolidated effect of calling them, where
// subclasses should closely track any changes in base classes with care.
public: // morkNode construction
morkNode(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap);
void CloseNode(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkNode(const morkNode& other);
morkNode& operator=(const morkNode& other);
public: // dynamic type identification
mork_bool IsNode() const
{ return mNode_Base == morkBase_kNode; }
// } ===== end basic node methods =====
public: // public error & warning methods
void RefsUnderUsesWarning(morkEnv* ev) const; // call if mNode_Refs < mNode_Uses
void NonNodeError(morkEnv* ev) const; // call when IsNode() is false
void NilHeapError(morkEnv* ev) const; // zero mNode_Heap when usage is kHeap
void NonOpenNodeError(morkEnv* ev) const; // call when IsOpenNode() is false
void NonMutableNodeError(morkEnv* ev) const; // when IsMutable() is false
void RefsOverflowWarning(morkEnv* ev) const; // call on mNode_Refs overflow
void UsesOverflowWarning(morkEnv* ev) const; // call on mNode_Uses overflow
void RefsUnderflowWarning(morkEnv* ev) const; // call on mNode_Refs underflow
void UsesUnderflowWarning(morkEnv* ev) const; // call on mNode_Uses underflow
private: // private refcounting methods
mork_bool cut_use_count(morkEnv* ev); // just one part of CutStrongRef()
public: // other morkNode methods
mork_bool GoodRefs() const { return mNode_Refs >= mNode_Uses; }
mork_bool BadRefs() const { return mNode_Refs < mNode_Uses; }
mork_uses StrongRefsOnly() const { return mNode_Uses; }
mork_refs WeakRefsOnly() const { return ( mNode_Refs - mNode_Uses ); }
// (this refcounting derives from public domain IronDoc node refcounts)
mork_refs AddStrongRef(morkEnv* ev);
mork_refs CutStrongRef(morkEnv* ev);
mork_refs AddWeakRef(morkEnv* ev);
mork_refs CutWeakRef(morkEnv* ev);
const char* GetNodeAccessAsString() const; // e.g. "open", "shut", etc.
const char* GetNodeUsageAsString() const; // e.g. "heap", "stack", etc.
mork_usage NodeUsage() const { return mNode_Usage; }
mork_bool IsHeapNode() const
{ return mNode_Usage == morkUsage_kHeap; }
mork_bool IsStackNode() const
{ return mNode_Usage == morkUsage_kStack; }
mork_bool IsGlobalNode() const
{ return mNode_Usage == morkUsage_kGlobal; }
mork_bool IsMemberNode() const
{ return mNode_Usage == morkUsage_kMember; }
mork_bool IsOpenNode() const
{ return mNode_Access == morkAccess_kOpen; }
mork_bool IsShutNode() const
{ return mNode_Access == morkAccess_kShut; }
mork_bool IsDeadNode() const
{ return mNode_Access == morkAccess_kDead; }
mork_bool IsClosingNode() const
{ return mNode_Access == morkAccess_kClosing; }
mork_bool IsOpenOrClosingNode() const
{ return IsOpenNode() || IsClosingNode(); }
mork_bool HasNodeAccess() const
{ return ( IsOpenNode() || IsShutNode() || IsClosingNode() ); }
void MarkShut() { mNode_Access = morkAccess_kShut; }
void MarkClosing() { mNode_Access = morkAccess_kClosing; }
void MarkDead() { mNode_Access = morkAccess_kDead; }
public: // refcounting for typesafe subclass inline methods
static void SlotWeakNode(morkNode* me, morkEnv* ev, morkNode** ioSlot);
// If *ioSlot is non-nil, that node is released by CutWeakRef() and
// then zeroed out. Then if me is non-nil, this is acquired by
// calling AddWeakRef(), and if positive is returned to show success,
// then this is put into slot *ioSlot. Note me can be nil, so we
// permit expression '((morkNode*) 0L)->SlotWeakNode(ev, &slot)'.
static void SlotStrongNode(morkNode* me, morkEnv* ev, morkNode** ioSlot);
// If *ioSlot is non-nil, that node is released by CutStrongRef() and
// then zeroed out. Then if me is non-nil, this is acquired by
// calling AddStrongRef(), and if positive is returned to show success,
// then me is put into slot *ioSlot. Note me can be nil, so we take
// expression 'morkNode::SlotStrongNode((morkNode*) 0, ev, &slot)'.
};
extern void // utility method very similar to morkNode::SlotStrongNode():
nsIMdbHeap_SlotStrongHeap(nsIMdbHeap* self, morkEnv* ev, nsIMdbHeap** ioSlot);
// If *ioSlot is non-nil, that heap is released by CutStrongRef() and
// then zeroed out. Then if me is non-nil, this is acquired by
// calling AddStrongRef(), and if the return value shows success,
// then me is put into slot *ioSlot. Note me can be nil, so we take
// expression 'nsIMdbHeap_SlotStrongNode(0, ev, &slot)'.
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKNODE_ */

View File

@@ -0,0 +1,173 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKINTMAP_
#include "morkIntMap.h"
#endif
#ifndef _MORKNODEMAP_
#include "morkNodeMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkNodeMap::CloseMorkNode(morkEnv* ev) // CloseNodeMap() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseNodeMap(ev);
this->MarkShut();
}
}
/*public virtual*/
morkNodeMap::~morkNodeMap() // assert CloseNodeMap() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkNodeMap::morkNodeMap(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkIntMap(ev, inUsage, /*valsize*/ sizeof(morkNode*), ioHeap, ioSlotHeap,
/*inHoldChanges*/ morkBool_kTrue)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kNodeMap;
}
/*public non-poly*/ void
morkNodeMap::CloseNodeMap(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
this->CutAllNodes(ev);
this->CloseMap(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
mork_bool
morkNodeMap::AddNode(morkEnv* ev, mork_token inToken, morkNode* ioNode)
// the AddNode() method return value equals ev->Good().
{
if ( ioNode && ev->Good() )
{
morkNode* node = 0; // old val in the map
mork_bool put = this->Put(ev, &inToken, &ioNode,
/*key*/ (void*) 0, &node, (mork_change**) 0);
if ( put ) // replaced an existing value for key inToken?
{
if ( node && node != ioNode ) // need to release old node?
node->CutStrongRef(ev);
}
if ( ev->Bad() || !ioNode->AddStrongRef(ev) )
{
// problems adding node or increasing refcount?
this->Cut(ev, &inToken, // make sure not in map
/*key*/ (void*) 0, /*val*/ (void*) 0, (mork_change**) 0);
}
}
else if ( !ioNode )
ev->NilPointerError();
return ev->Good();
}
mork_bool
morkNodeMap::CutNode(morkEnv* ev, mork_token inToken)
{
morkNode* node = 0; // old val in the map
mork_bool outCutNode = this->Cut(ev, &inToken,
/*key*/ (void*) 0, &node, (mork_change**) 0);
if ( node )
node->CutStrongRef(ev);
return outCutNode;
}
morkNode*
morkNodeMap::GetNode(morkEnv* ev, mork_token inToken)
// Note the returned node does NOT have an increase in refcount for this.
{
morkNode* node = 0; // old val in the map
this->Get(ev, &inToken, /*key*/ (void*) 0, &node, (mork_change**) 0);
return node;
}
mork_num
morkNodeMap::CutAllNodes(morkEnv* ev)
// CutAllNodes() releases all the reference node values.
{
mork_num outSlots = mMap_Slots;
mork_token key = 0; // old key token in the map
morkNode* val = 0; // old val node in the map
mork_change* c = 0;
morkNodeMapIter i(ev, this);
for ( c = i.FirstNode(ev, &key, &val); c ; c = i.NextNode(ev, &key, &val) )
{
if ( val )
val->CutStrongRef(ev);
i.CutHereNode(ev, /*key*/ (mork_token*) 0, /*val*/ (morkNode**) 0);
}
return outSlots;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,111 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKNODEMAP_
#define _MORKNODEMAP_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKINTMAP_
#include "morkIntMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kNodeMap /*i*/ 0x6E4D /* ascii 'nM' */
#define morkNodeMap_kStartSlotCount 512
/*| morkNodeMap: maps mork_token -> morkNode
|*/
class morkNodeMap : public morkIntMap { // for mapping tokens to nodes
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseNodeMap() only if open
virtual ~morkNodeMap(); // assert that CloseNodeMap() executed earlier
public: // morkMap construction & destruction
morkNodeMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap);
void CloseNodeMap(morkEnv* ev); // called by CloseMorkNode();
public: // dynamic type identification
mork_bool IsNodeMap() const
{ return IsNode() && mNode_Derived == morkDerived_kNodeMap; }
// } ===== end morkNode methods =====
// { ===== begin morkMap poly interface =====
// use the Equal() and Hash() for mork_u4 inherited from morkIntMap
// } ===== end morkMap poly interface =====
protected: // we want all subclasses to provide typesafe wrappers:
mork_bool AddNode(morkEnv* ev, mork_token inToken, morkNode* ioNode);
// the AddNode() boolean return equals ev->Good().
mork_bool CutNode(morkEnv* ev, mork_token inToken);
// The CutNode() boolean return indicates whether removal happened.
morkNode* GetNode(morkEnv* ev, mork_token inToken);
// Note the returned node does NOT have an increase in refcount for this.
mork_num CutAllNodes(morkEnv* ev);
// CutAllNodes() releases all the reference node values.
};
class morkNodeMapIter: public morkMapIter{ // typesafe wrapper class
public:
morkNodeMapIter(morkEnv* ev, morkNodeMap* ioMap)
: morkMapIter(ev, ioMap) { }
morkNodeMapIter( ) : morkMapIter() { }
void InitNodeMapIter(morkEnv* ev, morkNodeMap* ioMap)
{ this->InitMapIter(ev, ioMap); }
mork_change*
FirstNode(morkEnv* ev, mork_token* outToken, morkNode** outNode)
{ return this->First(ev, outToken, outNode); }
mork_change*
NextNode(morkEnv* ev, mork_token* outToken, morkNode** outNode)
{ return this->Next(ev, outToken, outNode); }
mork_change*
HereNode(morkEnv* ev, mork_token* outToken, morkNode** outNode)
{ return this->Here(ev, outToken, outNode); }
mork_change*
CutHereNode(morkEnv* ev, mork_token* outToken, morkNode** outNode)
{ return this->CutHere(ev, outToken, outNode); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKNODEMAP_ */

View File

@@ -0,0 +1,119 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
#ifndef _MORKHANDLE_
#include "morkHandle.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkObject::CloseMorkNode(morkEnv* ev) // CloseObject() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseObject(ev);
this->MarkShut();
}
}
/*public virtual*/
morkObject::~morkObject() // assert CloseObject() executed earlier
{
MORK_ASSERT(mObject_Handle==0);
}
/*public non-poly*/
morkObject::morkObject(const morkUsage& inUsage, nsIMdbHeap* ioHeap)
: morkNode(inUsage, ioHeap)
, mObject_Handle( 0 )
{
}
/*public non-poly*/
morkObject::morkObject(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap, morkHandle* ioHandle)
: morkNode(ev, inUsage, ioHeap)
, mObject_Handle( 0 )
{
if ( ev->Good() )
{
if ( ioHandle )
morkHandle::SlotWeakHandle(ioHandle, ev, &mObject_Handle);
if ( ev->Good() )
mNode_Derived = morkDerived_kObject;
}
}
/*public non-poly*/ void
morkObject::CloseObject(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
if ( !this->IsShutNode() )
{
if ( mObject_Handle )
morkHandle::SlotWeakHandle((morkHandle*) 0L, ev, &mObject_Handle);
this->MarkShut();
}
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
//void morkObject::NewNilHandleError(morkEnv* ev) // mObject_Handle is nil
//{
// ev->NewError("nil mObject_Handle");
//}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,94 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKOBJECT_
#define _MORKOBJECT_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kObject /*i*/ 0x6F42 /* ascii 'oB' */
/*| morkObject: subclass of morkNode that adds knowledge of db suite factory
**| and containing port to those objects that are exposed as instances of
**| nsIMdbObject in the public interface.
|*/
class morkObject : public morkNode {
// public: // slots inherited from morkNode (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
public: // state is public because the entire Mork system is private
morkHandle* mObject_Handle; // weak ref to handle for this object
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseObject() only if open
virtual ~morkObject(); // assert that CloseObject() executed earlier
protected: // special case construction of first env without preceding env
morkObject(const morkUsage& inUsage, nsIMdbHeap* ioHeap);
public: // morkEnv construction & destruction
morkObject(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkHandle* ioHandle); // ioHandle can be nil
void CloseObject(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkObject(const morkObject& other);
morkObject& operator=(const morkObject& other);
public: // dynamic type identification
mork_bool IsObject() const
{ return IsNode() && mNode_Derived == morkDerived_kObject; }
// } ===== end morkNode methods =====
// void NewNilHandleError(morkEnv* ev); // mObject_Handle is nil
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakObject(morkObject* me,
morkEnv* ev, morkObject** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongObject(morkObject* me,
morkEnv* ev, morkObject** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKOBJECT_ */

View File

@@ -0,0 +1,412 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKPARSER_
#include "morkParser.h"
#endif
#ifndef _MORKSTREAM_
#include "morkStream.h"
#endif
#ifndef _MORKBLOB_
#include "morkBlob.h"
#endif
#ifndef _MORKSINK_
#include "morkSink.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkParser::CloseMorkNode(morkEnv* ev) /*i*/ // CloseParser() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseParser(ev);
this->MarkShut();
}
}
/*public virtual*/
morkParser::~morkParser() /*i*/ // assert CloseParser() executed earlier
{
MORK_ASSERT(mParser_Heap==0);
MORK_ASSERT(mParser_Stream==0);
}
/*public non-poly*/
morkParser::morkParser(morkEnv* ev, /*i*/
const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkStream* ioStream, mdb_count inBytesPerParseSegment,
nsIMdbHeap* ioSlotHeap)
: morkNode(ev, inUsage, ioHeap)
, mParser_Heap( 0 )
, mParser_Stream( 0 )
, mParser_MoreGranularity( inBytesPerParseSegment )
, mParser_State( morkParser_kStartState )
, mParser_GroupContentStartPos( 0 )
, mParser_TableId( 0 )
, mParser_RowId( 0 )
, mParser_InPort( morkBool_kFalse )
, mParser_InDict( morkBool_kFalse )
, mParser_InCell( morkBool_kFalse )
, mParser_InMeta( morkBool_kFalse )
, mParser_InPortRow( morkBool_kFalse )
, mParser_IsBroken( morkBool_kFalse )
, mParser_IsDone( morkBool_kFalse )
, mParser_Alias()
, mParser_ScopeSpool(ev, ioHeap)
, mParser_ValueSpool(ev, ioHeap)
, mParser_ColumnSpool(ev, ioHeap)
, mParser_StringSpool(ev, ioHeap)
, mParser_ScopeSink(ev, &mParser_ScopeSpool)
, mParser_ValueSink(ev, &mParser_ValueSpool)
, mParser_ColumnSink(ev, &mParser_ColumnSpool)
, mParser_StringSink(ev, &mParser_StringSpool)
, mParser_AliasYarn(ev, morkUsage_kMember, ioHeap)
{
ev->StubMethodOnlyError();
if ( inBytesPerParseSegment < morkParser_kMinGranularity )
inBytesPerParseSegment = morkParser_kMinGranularity;
else if ( inBytesPerParseSegment > morkParser_kMaxGranularity )
inBytesPerParseSegment = morkParser_kMaxGranularity;
mParser_MoreGranularity = inBytesPerParseSegment;
if ( ev->Good() )
{
mParser_Tag = morkParser_kTag;
mNode_Derived = morkDerived_kParser;
}
}
/*public non-poly*/ void
morkParser::CloseParser(morkEnv* ev) /*i*/ // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
if ( !this->IsShutNode() )
{
mParser_ScopeSpool.CloseSpool(ev);
mParser_ValueSpool.CloseSpool(ev);
mParser_ColumnSpool.CloseSpool(ev);
mParser_StringSpool.CloseSpool(ev);
nsIMdbHeap_SlotStrongHeap((nsIMdbHeap*) 0, ev, &mParser_Heap);
morkStream::SlotStrongStream((morkStream*) 0, ev, &mParser_Stream);
this->MarkShut();
}
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*public non-poly*/ void
morkParser::SetParserStream(morkEnv* ev, morkStream* ioStream)
{
morkStream* stream = mParser_Stream;
if ( stream )
{
mParser_Stream = 0;
stream->CutStrongRef(ev);
}
if ( ioStream && ioStream->AddStrongRef(ev) )
mParser_Stream = ioStream;
}
/*protected non-poly*/ void
morkParser::NonGoodParserError(morkEnv* ev) // when GoodParserTag() is false
{
ev->NewError("non-morkNode");
}
/*protected non-poly*/ void
morkParser::NonUsableParserError(morkEnv* ev) //
{
if ( this->IsNode() )
{
if ( this->IsOpenNode() )
{
if ( this->GoodParserTag() )
{
// okay
}
else
this->NonGoodParserError(ev);
}
else
this->NonOpenNodeError(ev);
}
else
this->NonNodeError(ev);
}
/*protected non-poly*/ void
morkParser::StartParse(morkEnv* ev)
{
}
/*protected non-poly*/ void
morkParser::StopParse(morkEnv* ev)
{
if ( mParser_InCell )
{
mParser_InCell = morkBool_kFalse;
mParser_CellSpan.SetEndWithEnd(mParser_PortSpan);
this->OnCellEnd(ev, mParser_CellSpan);
}
if ( mParser_InMeta )
{
mParser_InMeta = morkBool_kFalse;
mParser_MetaSpan.SetEndWithEnd(mParser_PortSpan);
this->OnMetaEnd(ev, mParser_MetaSpan);
}
if ( mParser_InPortRow )
{
mParser_InPortRow = morkBool_kFalse;
mParser_RowSpan.SetEndWithEnd(mParser_PortSpan);
this->OnPortRowEnd(ev, mParser_RowSpan);
}
if ( mParser_RowId )
{
mParser_RowId = 0;
mParser_RowSpan.SetEndWithEnd(mParser_PortSpan);
this->OnRowEnd(ev, mParser_RowSpan);
}
if ( mParser_TableId )
{
mParser_TableId = 0;
mParser_TableSpan.SetEndWithEnd(mParser_PortSpan);
this->OnTableEnd(ev, mParser_TableSpan);
}
if ( mParser_GroupId )
{
mParser_GroupId = 0;
mParser_GroupSpan.SetEndWithEnd(mParser_PortSpan);
this->OnGroupAbortEnd(ev, mParser_GroupSpan);
}
if ( mParser_InPort )
{
mParser_InPort = morkBool_kFalse;
this->OnPortEnd(ev, mParser_PortSpan);
}
}
///*protected non-poly*/ int
//morkParser::NextChar(morkEnv* ev)
//{
//}
/*protected non-poly*/ int
morkParser::NextChar(morkEnv* ev) // next non-white content
{
register int c; // the most heavily used character variable
int outChar = -1; // the byte to return from this method
int d; // the byte after c on some occasions
morkStream* s = mParser_Stream;
if ( s )
{
while ( outChar == -1 && ev->Good() )
{
while ( (c = s->Getc(ev)) != EOF && ev->Good() )
{
if ( c == 0xA || c == 0xD ) // end of line?
{
this->AddLine();
d = s->Getc(ev); // look for another byte in #xA #xD, or #xD #xA
if (( d == 0xA || d == 0xD ) && c != d ) // eat this one too?
{
}
else if ( d != EOF ) // not trying to push back end of file
s->Ungetc(d);
}
}
if ( c == '/' ) // maybe start of comment?
{
int depth = 0;
}
else if ( c == '\\' ) // maybe start of line continuation?
{
if ( (c = s->Getc(ev)) == 0xA || c == 0xD )
;
}
if ( c == EOF ) // reached end of file?
{
if ( outChar == -1 )
outChar = 1; // end while loop
mParser_DoMore = morkBool_kFalse;
mParser_IsDone = morkBool_kTrue;
}
}
this->SetHerePos(s->Tell(ev));
}
else // nil stream pointer
{
ev->NilPointerError();
mParser_State = morkParser_kBrokenState;
mParser_DoMore = morkBool_kFalse;
mParser_IsDone = morkBool_kTrue;
mParser_IsBroken = morkBool_kTrue;
}
return outChar;
}
/*protected non-poly*/ void
morkParser::ParseLoop(morkEnv* ev)
{
mParser_Change = morkChange_kNil;
mParser_DoMore = morkBool_kTrue;
while ( mParser_DoMore )
{
switch ( mParser_State )
{
case morkParser_kCellState: // 0
break;
case morkParser_kMetaState: // 1
break;
case morkParser_kRowState: // 2
break;
case morkParser_kTableState: // 3
break;
case morkParser_kDictState: // 4
break;
case morkParser_kPortState: // 5
break;
case morkParser_kStartState: // 6
{
morkStream* s = mParser_Stream;
if ( s && s->IsNode() && s->IsOpenNode() )
{
this->StartParse(ev);
mParser_State = morkParser_kPortState;
}
else
{
mParser_State = morkParser_kBrokenState;
ev->NilPointerError();
}
}
break;
case morkParser_kDoneState: // 7
mParser_DoMore = morkBool_kFalse;
mParser_IsDone = morkBool_kTrue;
this->StopParse(ev);
break;
case morkParser_kBrokenState: // 8
mParser_DoMore = morkBool_kFalse;
mParser_IsBroken = morkBool_kTrue;
this->StopParse(ev);
break;
default: // ?
MORK_ASSERT(morkBool_kFalse);
mParser_State = morkParser_kBrokenState;
break;
}
}
}
/*public non-poly*/ mdb_count
morkParser::ParseMore( // return count of bytes consumed now
morkEnv* ev, // context
mork_pos* outPos, // current byte pos in the stream afterwards
mork_bool* outDone, // is parsing finished?
mork_bool* outBroken // is parsing irreparably dead and broken?
)
{
mdb_count outCount = 0;
if ( this->IsNode() && this->GoodParserTag() && this->IsOpenNode() )
{
mork_pos startPos = this->HerePos();
if ( !mParser_IsDone && !mParser_IsBroken )
this->ParseLoop(ev);
mork_pos endPos = this->HerePos();
if ( outDone )
*outDone = mParser_IsDone;
if ( outBroken )
*outBroken = mParser_IsBroken;
if ( outPos )
*outPos = endPos;
if ( endPos > startPos )
outCount = endPos - startPos;
}
else
{
this->NonUsableParserError(ev);
if ( outDone )
*outDone = morkBool_kTrue;
if ( outBroken )
*outBroken = morkBool_kTrue;
if ( outPos )
*outPos = 0;
}
return outCount;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,450 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKPARSER_
#define _MORKPARSER_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKPARSER_
#include "morkParser.h"
#endif
#ifndef _MORKBLOB_
#include "morkBlob.h"
#endif
#ifndef _MORKSINK_
#include "morkSink.h"
#endif
#ifndef _MORKYARN_
#include "morkYarn.h"
#endif
#ifndef _MORKCELL_
#include "morkCell.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*=============================================================================
* morkPlace: stream byte position and stream line count
*/
class morkPlace {
public:
mork_pos mPlace_Pos; // byte offset in an input stream
mork_line mPlace_Line; // line count in an input stream
void ClearPlace()
{
mPlace_Pos = 0; mPlace_Line = 0;
}
void SetPlace(mork_pos inPos, mork_line inLine)
{
mPlace_Pos = inPos; mPlace_Line = inLine;
}
morkPlace() { mPlace_Pos = 0; mPlace_Line = 0; }
morkPlace(mork_pos inPos, mork_line inLine)
{ mPlace_Pos = inPos; mPlace_Line = inLine; }
};
/*=============================================================================
* morkGlitch: stream place and error comment describing a parsing error
*/
class morkGlitch {
public:
morkPlace mGlitch_Place; // place in stream where problem happened
const char* mGlitch_Comment; // null-terminated ASCII C string
morkGlitch() { mGlitch_Comment = 0; }
};
/*=============================================================================
* morkAlias: all possible ways needed to express an alias ID in Mork syntax
*/
/*| morkAlias: an abstraction of all the variations we might need to support
**| in order to present an ID through the parser interface most cheaply and
**| with minimum transformation away from the original text format.
**|
**|| An ID can have one of four forms:
**| 1) idHex (mAlias_Oid.mOid_Id <- idHex)
**| 2) idHex:^scopeHex (mAlias_Oid.mOid_Id <- idHex, mOid_Scope <- scopeHex)
**| 3) idHex:scopeName (mAlias_Oid.mOid_Id <- idHex, mAlias_Buf <- scopeName)
**| 4) columnName (mAlias_Buf <- columnName, for columns in cells only)
**|
**|| Typically, mAlias_Oid.mOid_Id will hold a nonzero integer value for
**| an ID, but we might have an optional scope specified by either an integer
**| in hex format, or a string name. (Note that while the first ID can be
**| scoped variably, any integer ID for a scope is assumed always located in
**| the same scope, so the second ID need not be disambiguated.)
**|
**|| The only time mAlias_Oid.mOid_Id is ever zero is when mAlias_Buf alone
**| is nonzero, to indicate an explicit string instead of an alias appeared.
**| This case happens to make the representation of columns in cells somewhat
**| easier to represent, since columns can just appear as a string name; and
**| this unifies those interfaces with row and table APIs expecting IDs.
**|
**|| So when the parser passes an instance of morkAlias to a subclass, the
**| mAlias_Oid.mOid_Id slot should usually be nonzero. And the other two
**| slots, mAlias_Oid.mOid_Scope and mAlias_Buf, might both be zero, or at
**| most one of them will be nonzero to indicate an explicit scope; the
**| parser is responsible for ensuring at most one of these is nonzero.
|*/
class morkAlias {
public:
mdbOid mAlias_Oid; // mOid_Scope is zero when not specified
const morkBuf* mAlias_Buf; // points to some specific buf subclass
morkAlias()
{ mAlias_Oid.mOid_Scope = 0; mAlias_Oid.mOid_Id = morkId_kMinusOne;
mAlias_Buf = 0; }
};
/*=============================================================================
* morkSpan: start and end stream byte position and stream line count
*/
class morkSpan {
public:
morkPlace mSpan_Start;
morkPlace mSpan_End;
public: // methods
public: // inlines
morkSpan() { } // use inline empty constructor for each place
void SetSpan(mork_pos inFromPos, mork_line inFromLine,
mork_pos inToPos, mork_line inToLine)
{
mSpan_Start.SetPlace(inFromPos, inFromLine);
mSpan_End.SetPlace(inToPos,inToLine);
}
// setting end, useful to terminate a span using current port span end:
void SetEndWithEnd(const morkSpan& inSpan) // end <- span.end
{ mSpan_End = inSpan.mSpan_End; }
// setting start, useful to initiate a span using current port span end:
void SetStartWithEnd(const morkSpan& inSpan) // start <- span.end
{ mSpan_Start = inSpan.mSpan_End; }
void ClearSpan()
{
mSpan_Start.mPlace_Pos = 0; mSpan_Start.mPlace_Line = 0;
mSpan_End.mPlace_Pos = 0; mSpan_End.mPlace_Line = 0;
}
morkSpan(mork_pos inFromPos, mork_line inFromLine,
mork_pos inToPos, mork_line inToLine)
: mSpan_Start(inFromPos, inFromLine), mSpan_End(inToPos, inToLine)
{ /* empty implementation */ }
};
/*=============================================================================
* morkParser: for parsing Mork text syntax
*/
#define morkParser_kMinGranularity 512 /* parse at least half 0.5K at once */
#define morkParser_kMaxGranularity (64 * 1024) /* parse at most 64 K at once */
#define morkDerived_kParser /*i*/ 0x5073 /* ascii 'Ps' */
#define morkParser_kTag /*i*/ 0x70417253 /* ascii 'pArS' */
// These are states for the simple parsing virtual machine. Needless to say,
// these must be distinct, and preferrably in a contiguous integer range.
// Don't change these constants without looking at switch statements in code.
#define morkParser_kCellState 0 /* cell is tightest scope */
#define morkParser_kMetaState 1 /* meta is tightest scope */
#define morkParser_kRowState 2 /* row is tightest scope */
#define morkParser_kTableState 3 /* table is tightest scope */
#define morkParser_kDictState 4 /* dict is tightest scope */
#define morkParser_kPortState 5 /* port is tightest scope */
#define morkParser_kStartState 6 /* parsing has not yet begun */
#define morkParser_kDoneState 7 /* parsing is complete */
#define morkParser_kBrokenState 8 /* parsing is to broken to work */
class morkParser /*d*/ : public morkNode {
// public: // slots inherited from morkNode (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// ````` ````` ````` ````` ````` ````` ````` `````
protected: // protected morkParser members
nsIMdbHeap* mParser_Heap; // refcounted heap used for allocation
morkStream* mParser_Stream; // refcounted input stream
mork_u4 mParser_Tag; // must equal morkParser_kTag
mork_count mParser_MoreGranularity; // constructor inBytesPerParseSegment
mork_u4 mParser_State; // state where parser should resume
// after finding ends of group transactions, we can re-seek the start:
mork_pos mParser_GroupContentStartPos; // start of this group
mork_gid mParser_GroupId; // group ID if inside a group
mork_tid mParser_TableId; // table ID if inside a table
mork_rid mParser_RowId; // row ID if inside a row
mork_bool mParser_InPort; // called OnNewPort but not OnPortEnd?
mork_bool mParser_InDict; // called OnNewDict but not OnDictEnd?
mork_bool mParser_InCell; // called OnNewCell but not OnCellEnd?
mork_bool mParser_InMeta; // called OnNewMeta but not OnMetaEnd?
mork_bool mParser_InPortRow; // called OnNewPortRow but not OnPortRowEnd?
mork_bool mParser_IsBroken; // has the parse become broken?
mork_bool mParser_IsDone; // has the parse finished?
mork_bool mParser_DoMore; // mParser_MoreGranularity not exhausted?
mork_change mParser_Change; // driven by modifier in text
morkAlias mParser_Alias; // current alias being parsed
// note that mParser_Alias.mAlias_Buf points at mParser_ScopeSpool below:
// blob spools allocated in mParser_Heap
morkSpool mParser_ScopeSpool; // place to accumulate ID scope blobs
morkSpool mParser_ValueSpool; // place to accumulate value blobs
morkSpool mParser_ColumnSpool; // place to accumulate column blobs
morkSpool mParser_StringSpool; // place to accumulate string blobs
morkSpoolSink mParser_ScopeSink; // writes to mParser_ScopeSpool
morkSpoolSink mParser_ValueSink; // writes to mParser_ValueSpool
morkSpoolSink mParser_ColumnSink; // writes to mParser_ColumnSpool
morkSpoolSink mParser_StringSink; // writes to mParser_StringSpool
// yarns allocated in mParser_Heap
morkYarn mParser_AliasYarn; // place to receive from AliasToYarn()
// span showing current ongoing file position status:
morkSpan mParser_PortSpan; // span of current db port file
// various spans denoting nested subspaces inside the file's port span:
morkSpan mParser_GroupSpan; // span of current transaction group
morkSpan mParser_DictSpan;
morkSpan mParser_AliasSpan;
morkSpan mParser_MetaSpan;
morkSpan mParser_TableSpan;
morkSpan mParser_RowSpan;
morkSpan mParser_CellSpan;
morkSpan mParser_ColumnSpan;
morkSpan mParser_SlotSpan;
private: // convenience inlines
mork_pos HerePos() const
{ return mParser_PortSpan.mSpan_End.mPlace_Pos; }
void SetHerePos(mork_pos inPos)
{ mParser_PortSpan.mSpan_End.mPlace_Pos = inPos; }
void AddLine()
{ ++ mParser_PortSpan.mSpan_End.mPlace_Line; }
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseParser() only if open
virtual ~morkParser(); // assert that CloseParser() executed earlier
public: // morkYarn construction & destruction
morkParser(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkStream* ioStream, // the readonly stream for input bytes
mdb_count inBytesPerParseSegment, // target for ParseMore()
nsIMdbHeap* ioSlotHeap);
void CloseParser(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkParser(const morkParser& other);
morkParser& operator=(const morkParser& other);
public: // dynamic type identification
mork_bool IsParser() const
{ return IsNode() && mNode_Derived == morkDerived_kParser; }
// } ===== end morkNode methods =====
public: // typing
void NonParserTypeError(morkEnv* ev);
public: // other type methods
mork_bool GoodParserTag() const { return mParser_Tag == morkParser_kTag; }
void NonGoodParserError(morkEnv* ev);
void NonUsableParserError(morkEnv* ev);
// call when IsNode() or GoodParserTag() is false
// ````` ````` ````` ````` ````` ````` ````` `````
public: // in virtual morkParser methods, data flow subclass to parser
virtual void AliasToYarn(morkEnv* ev,
const morkAlias& inAlias, // typically an alias to concat with strings
mdbYarn* outYarn) = 0;
// The parser might ask that some aliases be turned into yarns, so they
// can be concatenated into longer blobs under some circumstances. This
// is an alternative to using a long and complex callback for many parts
// for a single cell value.
// ````` ````` ````` ````` ````` ````` ````` `````
public: // out virtual morkParser methods, data flow parser to subclass
// The virtual methods below will be called in a pattern corresponding
// to the following grammar isomorphic to the Mork grammar. There should
// be no exceptions, so subclasses can rely on seeing an appropriate "end"
// method whenever some "new" method has been seen earlier. In the event
// that some error occurs that causes content to be flushed, or sudden early
// termination of a larger containing entity, we will always call a more
// enclosed "end" method before we call an "end" method with greater scope.
// Note the "mp" prefix stands for "Mork Parser":
// mp:Start ::= OnNewPort mp:PortItem* OnPortEnd
// mp:PortItem ::= mp:Content | mp:Group | OnPortGlitch
// mp:Group ::= OnNewGroup mp:GroupItem* mp:GroupEnd
// mp:GroupItem ::= mp:Content | OnGroupGlitch
// mp:GroupEnd ::= OnGroupCommitEnd | OnGroupAbortEnd
// mp:Content ::= mp:PortRow | mp:Dict | mp:Table | mp:Row
// mp:PortRow ::= OnNewPortRow mp:RowItem* OnPortRowEnd
// mp:Dict ::= OnNewDict mp:DictItem* OnDictEnd
// mp:DictItem ::= OnAlias | OnAliasGlitch | mp:Meta | OnDictGlitch
// mp:Table ::= OnNewTable mp:TableItem* OnTableEnd
// mp:TableItem ::= mp:Row | mp:Meta | OnTableGlitch
// mp:Meta ::= OnNewMeta mp:MetaItem* OnMetaEnd
// mp:MetaItem ::= mp:Cell | OnMetaGlitch
// mp:Row ::= OnNewRow mp:RowItem* OnRowEnd
// mp:RowItem ::= mp:Cell | mp:Meta | OnRowGlitch
// mp:Cell ::= OnNewCell mp:CellItem? OnCellEnd
// mp:CellItem ::= mp:Slot | OnCellForm | OnCellGlitch
// mp:Slot ::= OnValue | OnValueAlias | OnRowAlias | OnTableAlias
// Note that in interfaces below, mork_change parameters kAdd and kNil
// both mean about the same thing by default. Only kCut is interesting,
// because this usually means to remove members instead of adding them.
virtual void OnNewPort(morkEnv* ev, const morkPlace& inPlace) = 0;
virtual void OnPortGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnPortEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnNewGroup(morkEnv* ev, const morkPlace& inPlace, mork_gid inGid) = 0;
virtual void OnGroupGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnGroupCommitEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnGroupAbortEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnNewPortRow(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange) = 0;
virtual void OnPortRowGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnPortRowEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnNewTable(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange) = 0;
virtual void OnTableGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnTableEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnNewMeta(morkEnv* ev, const morkPlace& inPlace) = 0;
virtual void OnMetaGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnMetaEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnNewRow(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange) = 0;
virtual void OnRowGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnRowEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnNewDict(morkEnv* ev, const morkPlace& inPlace) = 0;
virtual void OnDictGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnDictEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias) = 0;
virtual void OnAliasGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnNewCell(morkEnv* ev, const morkPlace& inPlace,
const morkAlias& inAlias, mork_change inChange) = 0;
virtual void OnCellGlitch(morkEnv* ev, const morkGlitch& inGlitch) = 0;
virtual void OnCellForm(morkEnv* ev, mork_cscode inCharsetFormat) = 0;
virtual void OnCellEnd(morkEnv* ev, const morkSpan& inSpan) = 0;
virtual void OnValue(morkEnv* ev, const morkSpan& inSpan,
const morkBuf& inBuf) = 0;
virtual void OnValueAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias) = 0;
virtual void OnRowAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias) = 0;
virtual void OnTableAlias(morkEnv* ev, const morkSpan& inSpan,
const morkAlias& inAlias) = 0;
// ````` ````` ````` ````` ````` ````` ````` `````
protected: // protected parser helper methods
void ParseLoop(morkEnv* ev); // find parse continuation and resume
void StartParse(morkEnv* ev); // prepare for parsing
void StopParse(morkEnv* ev); // terminate parsing & call needed methods
int NextChar(morkEnv* ev); // next non-white content
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public non-poly morkParser methods
void SetParserStream(morkEnv* ev, morkStream* ioStream);
mdb_count ParseMore( // return count of bytes consumed now
morkEnv* ev, // context
mork_pos* outPos, // current byte pos in the stream afterwards
mork_bool* outDone, // is parsing finished?
mork_bool* outBroken // is parsing irreparably dead and broken?
);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakParser(morkParser* me,
morkEnv* ev, morkParser** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongParser(morkParser* me,
morkEnv* ev, morkParser** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKPARSER_ */

View File

@@ -0,0 +1,366 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKATOM_
#include "morkAtom.h"
#endif
#ifndef _MORKHANDLE_
#include "morkHandle.h"
#endif
#ifndef _MORKCELL_
#include "morkCell.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
#ifndef _MORKBLOB_
#include "morkBlob.h"
#endif
#ifndef _MORKDEQUE_
#include "morkDeque.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkPool::CloseMorkNode(morkEnv* ev) // ClosePool() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->ClosePool(ev);
this->MarkShut();
}
}
/*public virtual*/
morkPool::~morkPool() // assert ClosePool() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkPool::morkPool(const morkUsage& inUsage, nsIMdbHeap* ioHeap,
nsIMdbHeap* ioSlotHeap)
: morkNode(inUsage, ioHeap)
, mPool_Heap( ioSlotHeap )
{
// mPool_Heap is NOT refcounted
MORK_ASSERT(ioSlotHeap);
if ( ioSlotHeap )
mNode_Derived = morkDerived_kPool;
}
/*public non-poly*/
morkPool::morkPool(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkNode(ev, inUsage, ioHeap)
, mPool_Heap( ioSlotHeap )
{
if ( ioSlotHeap )
{
// mPool_Heap is NOT refcounted:
// nsIMdbHeap_SlotStrongHeap(ioSlotHeap, ev, &mPool_Heap);
if ( ev->Good() )
mNode_Derived = morkDerived_kPool;
}
else
ev->NilPointerError();
}
/*public non-poly*/ void
morkPool::ClosePool(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
// mPool_Heap is NOT refcounted:
// nsIMdbHeap_SlotStrongHeap((nsIMdbHeap*) 0, ev, &mPool_Heap);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
// alloc and free individual instances of handles (inside hand frames):
morkHandleFace*
morkPool::NewHandle(morkEnv* ev, mork_size inSize)
{
void* newBlock = 0;
mPool_Heap->Alloc(ev->AsMdbEnv(), inSize, (void**) &newBlock);
return (morkHandleFace*) newBlock;
}
void
morkPool::ZapHandle(morkEnv* ev, morkHandleFace* ioHandle)
{
if ( ioHandle )
mPool_Heap->Free(ev->AsMdbEnv(), ioHandle);
}
// alloc and free individual instances of rows:
morkRow*
morkPool::NewRow(morkEnv* ev) // allocate a new row instance
{
morkRow* newRow = 0;
mPool_Heap->Alloc(ev->AsMdbEnv(), sizeof(morkRow), (void**) &newRow);
if ( newRow )
MORK_MEMSET(newRow, 0, sizeof(morkRow));
if ( newRow )
{
}
return newRow;
}
void
morkPool::ZapRow(morkEnv* ev, morkRow* ioRow) // free old row instance
{
if ( ioRow )
mPool_Heap->Free(ev->AsMdbEnv(), ioRow);
}
// alloc and free entire vectors of cells (not just one cell at a time)
morkCell*
morkPool::NewCells(morkEnv* ev, mork_size inSize)
{
morkCell* newCells = 0;
mork_size size = inSize * sizeof(morkCell);
if ( size )
mPool_Heap->Alloc(ev->AsMdbEnv(), size, (void**) &newCells);
// note morkAtom depends on having nil stored in all new mCell_Atom slots:
if ( newCells )
MORK_MEMSET(newCells, 0, size);
return newCells;
}
void
morkPool::ZapCells(morkEnv* ev, morkCell* ioVector, mork_size inSize)
{
if ( ioVector )
mPool_Heap->Free(ev->AsMdbEnv(), ioVector);
}
// resize (grow or trim) cell vectors inside a containing row instance
mork_bool
morkPool::AddRowCells(morkEnv* ev, morkRow* ioRow, mork_size inNewSize)
{
// note strong implementation similarity to morkArray::Grow()
mork_fill fill = ioRow->mRow_Length;
if ( ev->Good() && fill < inNewSize ) // need more cells?
{
morkCell* newCells = this->NewCells(ev, inNewSize);
if ( newCells )
{
morkCell* c = newCells; // for iterating during copy
morkCell* oldCells = ioRow->mRow_Cells;
morkCell* end = oldCells + fill; // copy all the old cells
while ( oldCells < end )
{
*c++ = *oldCells++; // bitwise copy each old cell struct
}
oldCells = ioRow->mRow_Cells;
ioRow->mRow_Cells = newCells;
ioRow->mRow_Length = inNewSize;
++ioRow->mRow_Seed;
this->ZapCells(ev, oldCells, fill);
}
}
return ( ev->Good() && ioRow->mRow_Length >= inNewSize );
}
mork_bool
morkPool::CutRowCells(morkEnv* ev, morkRow* ioRow,
mork_size inNewSize)
{
mork_fill fill = ioRow->mRow_Length;
if ( ev->Good() && fill > inNewSize ) // need fewer cells?
{
morkCell* newCells = this->NewCells(ev, inNewSize);
if ( newCells )
{
morkCell* oldCells = ioRow->mRow_Cells;
morkCell* oldEnd = oldCells + fill; // one past all old cells
morkCell* newEnd = oldCells + inNewSize; // copy only kept old cells
while ( oldCells < newEnd )
{
*newCells++ = *oldCells++; // bitwise copy each old cell struct
}
while ( oldCells < oldEnd )
{
if ( oldCells->mCell_Atom ) // need to unref old cell atom?
oldCells->SetAtom(ev, (morkAtom*) 0, this); // unref cell atom
++oldCells;
}
oldCells = ioRow->mRow_Cells;
ioRow->mRow_Cells = newCells;
ioRow->mRow_Length = inNewSize;
++ioRow->mRow_Seed;
this->ZapCells(ev, oldCells, fill);
}
}
return ( ev->Good() && ioRow->mRow_Length <= inNewSize );
}
// alloc & free individual instances of atoms (lots of atom subclasses):
void
morkPool::ZapAtom(morkEnv* ev, morkAtom* ioAtom) // any subclass (by kind)
{
if ( ioAtom )
mPool_Heap->Free(ev->AsMdbEnv(), ioAtom);
}
morkOidAtom*
morkPool::NewRowOidAtom(morkEnv* ev, const mdbOid& inOid)
{
morkOidAtom* newAtom = 0;
mPool_Heap->Alloc(ev->AsMdbEnv(), sizeof(morkOidAtom),(void**) &newAtom);
if ( newAtom )
newAtom->InitRowOidAtom(ev, inOid);
return newAtom;
}
morkOidAtom*
morkPool::NewTableOidAtom(morkEnv* ev, const mdbOid& inOid)
{
morkOidAtom* newAtom = 0;
mPool_Heap->Alloc(ev->AsMdbEnv(), sizeof(morkOidAtom), (void**) &newAtom);
if ( newAtom )
newAtom->InitTableOidAtom(ev, inOid);
return newAtom;
}
morkAtom*
morkPool::NewAnonAtom(morkEnv* ev, const morkBuf& inBuf,
mork_cscode inForm)
// if inForm is zero, and inBuf.mBuf_Fill is less than 256, then a 'wee'
// anon atom will be created, and otherwise a 'big' anon atom.
{
morkAtom* newAtom = 0;
mork_bool needBig = ( inForm || inBuf.mBuf_Fill > 255 );
mork_size size = ( needBig )?
morkBigAnonAtom::SizeForFill(inBuf.mBuf_Fill) :
morkWeeAnonAtom::SizeForFill(inBuf.mBuf_Fill);
mPool_Heap->Alloc(ev->AsMdbEnv(), size, (void**) &newAtom);
if ( newAtom )
{
if ( needBig )
((morkBigAnonAtom*) newAtom)->InitBigAnonAtom(ev, inBuf, inForm);
else
((morkWeeAnonAtom*) newAtom)->InitWeeAnonAtom(ev, inBuf);
}
return newAtom;
}
morkBookAtom*
morkPool::NewBookAtom(morkEnv* ev, const morkBuf& inBuf,
mork_cscode inForm, morkAtomSpace* ioSpace, mork_aid inAid)
// if inForm is zero, and inBuf.mBuf_Fill is less than 256, then a 'wee'
// book atom will be created, and otherwise a 'big' book atom.
{
morkBookAtom* newAtom = 0;
mork_bool needBig = ( inForm || inBuf.mBuf_Fill > 255 );
mork_size size = ( needBig )?
morkBigBookAtom::SizeForFill(inBuf.mBuf_Fill) :
morkWeeBookAtom::SizeForFill(inBuf.mBuf_Fill);
mPool_Heap->Alloc(ev->AsMdbEnv(), size, (void**) &newAtom);
if ( newAtom )
{
if ( needBig )
((morkBigBookAtom*) newAtom)->InitBigBookAtom(ev,
inBuf, inForm, ioSpace, inAid);
else
((morkWeeBookAtom*) newAtom)->InitWeeBookAtom(ev,
inBuf, ioSpace, inAid);
}
return newAtom;
}
morkBookAtom*
morkPool::NewBookAtomCopy(morkEnv* ev, const morkBigBookAtom& inAtom)
// make the smallest kind of book atom that can hold content in inAtom.
// The inAtom parameter is often expected to be a staged book atom in
// the store, which was used to search an atom space for existing atoms.
{
morkBookAtom* newAtom = 0;
mork_cscode form = inAtom.mBigBookAtom_Form;
mork_fill fill = inAtom.mBigBookAtom_Size;
mork_bool needBig = ( form || fill > 255 );
mork_size size = ( needBig )?
morkBigBookAtom::SizeForFill(fill) :
morkWeeBookAtom::SizeForFill(fill);
mPool_Heap->Alloc(ev->AsMdbEnv(), size, (void**) &newAtom);
if ( newAtom )
{
morkBuf buf(inAtom.mBigBookAtom_Body, fill);
if ( needBig )
((morkBigBookAtom*) newAtom)->InitBigBookAtom(ev,
buf, form, inAtom.mBookAtom_Space, inAtom.mBookAtom_Id);
else
((morkWeeBookAtom*) newAtom)->InitWeeBookAtom(ev,
buf, inAtom.mBookAtom_Space, inAtom.mBookAtom_Id);
}
return newAtom;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,158 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKPOOL_
#define _MORKPOOL_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKDEQUE_
#include "morkDeque.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class morkHandle;
class morkHandleFrame;
class morkHandleFace; // just an opaque cookie type
class morkBigBookAtom;
#define morkDerived_kPool /*i*/ 0x706C /* ascii 'pl' */
/*| morkPool: a place to manage pools of non-node objects that are memory
**| managed out of large chunks of space, so that per-object management
**| space overhead has no signficant cost.
|*/
class morkPool : public morkNode {
// public: // slots inherited from morkNode (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
public: // state is public because the entire Mork system is private
nsIMdbHeap* mPool_Heap; // NON-refcounted heap instance
morkDeque mPool_Blocks; // linked list of large blocks from heap
// These two lists contain instances of morkHandleFrame:
morkDeque mPool_UsedHandleFrames; // handle frames currently being used
morkDeque mPool_FreeHandleFrames; // handle frames currently in free list
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // ClosePool() only if open
virtual ~morkPool(); // assert that ClosePool() executed earlier
public: // morkPool construction & destruction
morkPool(const morkUsage& inUsage, nsIMdbHeap* ioHeap,
nsIMdbHeap* ioSlotHeap);
morkPool(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
nsIMdbHeap* ioSlotHeap);
void ClosePool(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkPool(const morkPool& other);
morkPool& operator=(const morkPool& other);
public: // dynamic type identification
mork_bool IsPool() const
{ return IsNode() && mNode_Derived == morkDerived_kPool; }
// } ===== end morkNode methods =====
public: // typing
void NonPoolTypeError(morkEnv* ev);
public: // morkNode memory management operators
void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev)
{ return morkNode::MakeNew(inSize, ioHeap, ev); }
void* operator new(size_t inSize)
{ return ::operator new(inSize); }
void operator delete(void* ioAddress)
{ morkNode::OnDeleteAssert(ioAddress); }
// do NOT call delete on morkNode instances. Call ZapOld() instead.
public: // other pool methods
// alloc and free individual instances of handles (inside hand frames):
morkHandleFace* NewHandle(morkEnv* ev, mork_size inSize);
void ZapHandle(morkEnv* ev, morkHandleFace* ioHandle);
// alloc and free individual instances of rows:
morkRow* NewRow(morkEnv* ev); // allocate a new row instance
void ZapRow(morkEnv* ev, morkRow* ioRow); // free old row instance
// alloc and free entire vectors of cells (not just one cell at a time)
morkCell* NewCells(morkEnv* ev, mork_size inSize);
void ZapCells(morkEnv* ev, morkCell* ioVector, mork_size inSize);
// resize (grow or trim) cell vectors inside a containing row instance
mork_bool AddRowCells(morkEnv* ev, morkRow* ioRow, mork_size inNewSize);
mork_bool CutRowCells(morkEnv* ev, morkRow* ioRow, mork_size inNewSize);
// alloc & free individual instances of atoms (lots of atom subclasses):
void ZapAtom(morkEnv* ev, morkAtom* ioAtom); // any subclass (by kind)
morkOidAtom* NewRowOidAtom(morkEnv* ev, const mdbOid& inOid);
morkOidAtom* NewTableOidAtom(morkEnv* ev, const mdbOid& inOid);
morkAtom* NewAnonAtom(morkEnv* ev, const morkBuf& inBuf,
mork_cscode inForm);
// if inForm is zero, and inBuf.mBuf_Fill is less than 256, then a 'wee'
// anon atom will be created, and otherwise a 'big' anon atom.
morkBookAtom* NewBookAtom(morkEnv* ev, const morkBuf& inBuf,
mork_cscode inForm, morkAtomSpace* ioSpace, mork_aid inAid);
// if inForm is zero, and inBuf.mBuf_Fill is less than 256, then a 'wee'
// book atom will be created, and otherwise a 'big' book atom.
morkBookAtom* NewBookAtomCopy(morkEnv* ev, const morkBigBookAtom& inAtom);
// make the smallest kind of book atom that can hold content in inAtom.
// The inAtom parameter is often expected to be a staged book atom in
// the store, which was used to search an atom space for existing atoms.
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakPool(morkPool* me,
morkEnv* ev, morkPool** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongPool(morkPool* me,
morkEnv* ev, morkPool** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKPOOL_ */

View File

@@ -0,0 +1,145 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKCURSOR_
#include "morkCursor.h"
#endif
#ifndef _MORKPORTTABLECURSOR_
#include "morkPortTableCursor.h"
#endif
#ifndef _ORKINPORTTABLECURSOR_
#include "orkinPortTableCursor.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkPortTableCursor::CloseMorkNode(morkEnv* ev) // ClosePortTableCursor() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->ClosePortTableCursor(ev);
this->MarkShut();
}
}
/*public virtual*/
morkPortTableCursor::~morkPortTableCursor() // ClosePortTableCursor() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkPortTableCursor::morkPortTableCursor(morkEnv* ev,
const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkStore* ioStore, mdb_scope inRowScope,
mdb_kind inTableKind, nsIMdbHeap* ioSlotHeap)
: morkCursor(ev, inUsage, ioHeap)
, mPortTableCursor_Store( 0 )
, mPortTableCursor_RowScope( inRowScope )
, mPortTableCursor_TableKind( inTableKind )
{
if ( ev->Good() )
{
if ( ioStore )
{
mCursor_Pos = -1;
mCursor_Seed = 0; // let the iterator do it's own seed handling
morkStore::SlotWeakStore(ioStore, ev, &mPortTableCursor_Store);
if ( ev->Good() )
mNode_Derived = morkDerived_kPortTableCursor;
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkPortTableCursor::ClosePortTableCursor(morkEnv* ev)
{
if ( this )
{
if ( this->IsNode() )
{
mCursor_Pos = -1;
mCursor_Seed = 0;
morkStore::SlotWeakStore((morkStore*) 0, ev, &mPortTableCursor_Store);
this->CloseCursor(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkPortTableCursor::NonPortTableCursorTypeError(morkEnv* ev)
{
ev->NewError("non morkPortTableCursor");
}
orkinPortTableCursor*
morkPortTableCursor::AcquirePortTableCursorHandle(morkEnv* ev)
{
orkinPortTableCursor* outCursor = 0;
orkinPortTableCursor* c = (orkinPortTableCursor*) mObject_Handle;
if ( c ) // have an old handle?
c->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
c = orkinPortTableCursor::MakePortTableCursor(ev, this);
mObject_Handle = c;
}
if ( c )
outCursor = c;
return outCursor;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,103 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKPORTTABLECURSOR_
#define _MORKPORTTABLECURSOR_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKCURSOR_
#include "morkCursor.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class orkinPortTableCursor;
#define morkDerived_kPortTableCursor /*i*/ 0x7443 /* ascii 'tC' */
class morkPortTableCursor : public morkCursor { // row iterator
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkFactory* mObject_Factory; // weak ref to suite factory
// mork_seed mCursor_Seed;
// mork_pos mCursor_Pos;
// mork_bool mCursor_DoFailOnSeedOutOfSync;
// mork_u1 mCursor_Pad[ 3 ]; // explicitly pad to u4 alignment
public: // state is public because the entire Mork system is private
morkStore* mPortTableCursor_Store; // weak ref to store
mdb_scope mPortTableCursor_RowScope;
mdb_kind mPortTableCursor_TableKind;
// $$$ need use a map iter for covering tables in port map (hash table)
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // ClosePortTableCursor()
virtual ~morkPortTableCursor(); // assert that close executed earlier
public: // morkPortTableCursor construction & destruction
morkPortTableCursor(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkStore* ioStore, mdb_scope inRowScope,
mdb_kind inTableKind, nsIMdbHeap* ioSlotHeap);
void ClosePortTableCursor(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkPortTableCursor(const morkPortTableCursor& other);
morkPortTableCursor& operator=(const morkPortTableCursor& other);
public: // dynamic type identification
mork_bool IsPortTableCursor() const
{ return IsNode() && mNode_Derived == morkDerived_kPortTableCursor; }
// } ===== end morkNode methods =====
public: // other cell cursor methods
static void NonPortTableCursorTypeError(morkEnv* ev);
orkinPortTableCursor* AcquirePortTableCursorHandle(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakPortTableCursor(morkPortTableCursor* me,
morkEnv* ev, morkPortTableCursor** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongPortTableCursor(morkPortTableCursor* me,
morkEnv* ev, morkPortTableCursor** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKPORTTABLECURSOR_ */

View File

@@ -0,0 +1,388 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKROWSPACE_
#include "morkRowSpace.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKROWOBJECT_
#include "morkRowObject.h"
#endif
#ifndef _MORKCELLOBJECT_
#include "morkCellObject.h"
#endif
#ifndef _MORKCELL_
#include "morkCell.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _MORKROWCELLCURSOR_
#include "morkRowCellCursor.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
mork_u2
morkRow::AddTableUse(morkEnv* ev)
{
if ( mRow_TableUses < morkRow_kMaxTableUses ) // not already maxed out?
++mRow_TableUses;
return mRow_TableUses;
}
mork_u2
morkRow::CutTableUse(morkEnv* ev)
{
if ( mRow_TableUses ) // any outstanding uses to cut?
{
if ( mRow_TableUses < morkRow_kMaxTableUses ) // not frozen at max?
--mRow_TableUses;
}
else
this->TableUsesUnderflowWarning(ev);
return mRow_TableUses;
}
/*static*/ void
morkRow::TableUsesUnderflowWarning(morkEnv* ev)
{
ev->NewWarning("mRow_TableUses underflow");
}
/*static*/ void
morkRow::NonRowTypeError(morkEnv* ev)
{
ev->NewError("non morkRow");
}
/*static*/ void
morkRow::NonRowTypeWarning(morkEnv* ev)
{
ev->NewWarning("non morkRow");
}
/*static*/ void
morkRow::LengthBeyondMaxError(morkEnv* ev)
{
ev->NewError("mRow_Length over max");
}
/*static*/ void
morkRow::ZeroColumnError(morkEnv* ev)
{
ev->NewError(" zero mork_column");
}
/*static*/ void
morkRow::NilCellsError(morkEnv* ev)
{
ev->NewError("nil mRow_Cells");
}
void
morkRow::InitRow(morkEnv* ev, const mdbOid* inOid, morkRowSpace* ioSpace,
mork_size inLength, morkPool* ioPool)
// if inLength is nonzero, cells will be allocated from ioPool
{
if ( ioSpace && ioPool && inOid )
{
if ( inLength <= morkRow_kMaxLength )
{
if ( inOid->mOid_Id != morkRow_kMinusOneRid )
{
mRow_Space = ioSpace;
mRow_Object = 0;
mRow_Cells = 0;
mRow_Oid = *inOid;
mRow_Length = inLength;
mRow_Seed = (mork_u2) this; // "random" assignment
mRow_TableUses = 0;
mRow_Load = morkLoad_kClean;
mRow_Tag = morkRow_kTag;
if ( inLength )
mRow_Cells = ioPool->NewCells(ev, inLength);
}
else
ioSpace->MinusOneRidError(ev);
}
else
this->LengthBeyondMaxError(ev);
}
else
ev->NilPointerError();
}
morkRowObject*
morkRow::GetRowObject(morkEnv* ev, morkStore* ioStore)
{
morkRowObject* ro = mRow_Object;
if ( !ro ) // need new row object?
{
nsIMdbHeap* heap = ioStore->mPort_Heap;
ro = new (*heap, ev)
morkRowObject(ev, morkUsage::kHeap, heap, this, ioStore);
mRow_Object = ro;
}
return ro;
}
nsIMdbRow*
morkRow::AcquireRowHandle(morkEnv* ev, morkStore* ioStore)
{
morkRowObject* object = this->GetRowObject(ev, ioStore);
if ( object )
return object->AcquireRowHandle(ev);
return (nsIMdbRow*) 0;
}
nsIMdbCell*
morkRow::AcquireCellHandle(morkEnv* ev, morkCell* ioCell,
mdb_column inCol, mork_pos inPos)
{
nsIMdbHeap* heap = ev->mEnv_Heap;
morkCellObject* cellObj = new (*heap, ev)
morkCellObject(ev, morkUsage::kHeap, heap, this, ioCell, inCol, inPos);
if ( cellObj )
return cellObj->AcquireCellHandle(ev);
return (nsIMdbCell*) 0;
}
morkCell*
morkRow::NewCell(morkEnv* ev, mdb_column inColumn,
mork_pos* outPos, morkStore* ioStore)
{
++mRow_Seed; // intend to change structure of mRow_Cells
mork_pos length = (mork_pos) mRow_Length;
*outPos = length;
morkPool* pool = ioStore->StorePool();
if ( pool->AddRowCells(ev, this, length + 1) )
{
morkCell* cell = mRow_Cells + length;
cell->SetColumnAndChange(inColumn, morkChange_kAdd);
return cell;
}
return (morkCell*) 0;
}
morkCell*
morkRow::CellAt(morkEnv* ev, mork_pos inPos) const
{
morkCell* cells = mRow_Cells;
if ( cells && inPos < mRow_Length )
{
return cells + inPos;
}
return (morkCell*) 0;
}
morkCell*
morkRow::GetCell(morkEnv* ev, mdb_column inColumn, mork_pos* outPos) const
{
morkCell* cells = mRow_Cells;
if ( cells )
{
morkCell* end = cells + mRow_Length;
while ( cells < end )
{
mork_column col = cells->GetColumn();
if ( col == inColumn ) // found the desired column?
{
*outPos = cells - mRow_Cells;
return cells;
}
else
++cells;
}
}
*outPos = -1;
return (morkCell*) 0;
}
void
morkRow::EmptyAllCells(morkEnv* ev)
{
morkCell* cells = mRow_Cells;
if ( cells )
{
morkStore* store = this->GetRowSpaceStore(ev);
if ( store )
{
morkPool* pool = store->StorePool();
morkCell* end = cells + mRow_Length;
--cells; // prepare for preincrement:
while ( ++cells < end )
{
if ( cells->mCell_Atom )
cells->SetAtom(ev, (morkAtom*) 0, pool);
}
}
}
}
void
morkRow::AddRow(morkEnv* ev, const morkRow* inSourceRow)
{
ev->StubMethodOnlyError();
// $$$$$ need to iterate over inSourceRow cells adding them to this row.
// When the atoms are book atoms, we can just incr the use count.
}
void
morkRow::OnZeroTableUse(morkEnv* ev)
// OnZeroTableUse() is called when CutTableUse() returns zero.
{
// OK, this is a P1 showstopper bug, so I'll comment it out.
// ev->NewWarning("need to implement OnZeroTableUse");
}
void
morkRow::DirtyAllRowContent(morkEnv* ev)
{
this->SetRowDirty();
morkCell* cells = mRow_Cells;
if ( cells )
{
morkCell* end = cells + mRow_Length;
--cells; // prepare for preincrement:
while ( ++cells < end )
{
cells->SetCellDirty();
}
}
}
morkStore*
morkRow::GetRowSpaceStore(morkEnv* ev) const
{
morkRowSpace* rowSpace = mRow_Space;
if ( rowSpace )
{
morkStore* store = rowSpace->mSpace_Store;
if ( store )
{
if ( store->IsStore() )
{
return store;
}
else
store->NonStoreTypeError(ev);
}
else
ev->NilPointerError();
}
else
ev->NilPointerError();
return (morkStore*) 0;
}
void morkRow::AddColumn(morkEnv* ev, mdb_column inColumn,
const mdbYarn* inYarn, morkStore* ioStore)
{
if ( ev->Good() )
{
mork_pos pos = -1;
morkCell* cell = this->GetCell(ev, inColumn, &pos);
if ( !cell ) // column does not yet exist?
cell = this->NewCell(ev, inColumn, &pos, ioStore);
else
++mRow_Seed;
if ( cell )
{
// cell->SetYarn(ev, inYarn, ioStore);
morkAtom* atom = ioStore->YarnToAtom(ev, inYarn);
if ( atom )
cell->SetAtom(ev, atom, ioStore->StorePool()); // refcounts atom
}
}
}
morkRowCellCursor*
morkRow::NewRowCellCursor(morkEnv* ev, mdb_pos inPos)
{
morkRowCellCursor* outCursor = 0;
if ( ev->Good() )
{
morkStore* store = this->GetRowSpaceStore(ev);
if ( store )
{
morkRowObject* rowObj = this->GetRowObject(ev, store);
if ( rowObj )
{
nsIMdbHeap* heap = store->mPort_Heap;
morkRowCellCursor* cursor = new (*heap, ev)
morkRowCellCursor(ev, morkUsage::kHeap, heap, rowObj);
if ( cursor )
{
if ( ev->Good() )
{
cursor->mCursor_Pos = inPos;
outCursor = cursor;
}
else
cursor->CutStrongRef(ev);
}
}
}
}
return outCursor;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,143 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKROW_
#define _MORKROW_ 1
#ifndef _MORK_
#include "mork.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class nsIMdbRow;
class nsIMdbCell;
#define morkDerived_kRow /*i*/ 0x5277 /* ascii 'Rw' */
#define morkRow_kMaxTableUses 0x0FFFF /* max for 16-bit unsigned int */
#define morkRow_kMaxLength 0x0FFFF /* max for 16-bit unsigned int */
#define morkRow_kMinusOneRid ((mork_rid) -1)
#define morkRow_kTag 'r' /* magic signature for mRow_Tag */
class morkRow { // row of cells
public: // state is public because the entire Mork system is private
morkRowSpace* mRow_Space; // mRow_Space->mSpace_Scope is the row scope
morkRowObject* mRow_Object; // refcount & other state for object sharing
morkCell* mRow_Cells;
mdbOid mRow_Oid;
mork_u2 mRow_Length; // physical count of cells in mRow_Cells
mork_u2 mRow_Seed; // count changes in mRow_Cells structure
mork_u2 mRow_TableUses; // persistent references from tables
mork_load mRow_Load; // is this row clean or dirty?
mork_u1 mRow_Tag; // one-byte tag (need u4 alignment pad)
public: // other row methods
morkRow( ) { }
morkRow(const mdbOid* inOid) :mRow_Oid(*inOid) { }
void InitRow(morkEnv* ev, const mdbOid* inOid, morkRowSpace* ioSpace,
mork_size inLength, morkPool* ioPool);
// if inLength is nonzero, cells will be allocated from ioPool
morkRowObject* GetRowObject(morkEnv* ev, morkStore* ioStore);
nsIMdbRow* AcquireRowHandle(morkEnv* ev, morkStore* ioStore);
nsIMdbCell* AcquireCellHandle(morkEnv* ev, morkCell* ioCell,
mdb_column inColumn, mork_pos inPos);
mork_u2 AddTableUse(morkEnv* ev);
mork_u2 CutTableUse(morkEnv* ev);
void SetRowClean() { mRow_Load = morkLoad_kClean; }
void SetRowDirty() { mRow_Load = morkLoad_kDirty; }
mork_bool IsRowClean() const { return mRow_Load == morkLoad_kClean; }
mork_bool IsRowDirty() const { return mRow_Load == morkLoad_kDirty; }
public: // internal row methods
morkCell* NewCell(morkEnv* ev, mdb_column inColumn, mork_pos* outPos,
morkStore* ioStore);
morkCell* GetCell(morkEnv* ev, mdb_column inColumn, mork_pos* outPos) const;
morkCell* CellAt(morkEnv* ev, mork_pos inPos) const;
public: // external row methods
void DirtyAllRowContent(morkEnv* ev);
morkStore* GetRowSpaceStore(morkEnv* ev) const;
void AddColumn(morkEnv* ev, mdb_column inColumn,
const mdbYarn* inYarn, morkStore* ioStore);
morkRowCellCursor* NewRowCellCursor(morkEnv* ev, mdb_pos inPos);
void EmptyAllCells(morkEnv* ev);
void AddRow(morkEnv* ev, const morkRow* inSourceRow);
void OnZeroTableUse(morkEnv* ev);
// OnZeroTableUse() is called when CutTableUse() returns zero.
public: // dynamic typing
mork_bool IsRow() const { return mRow_Tag == morkRow_kTag; }
public: // hash and equal
mork_u4 HashRow() const
{
return (mRow_Oid.mOid_Scope << 16) ^ mRow_Oid.mOid_Id;
}
mork_u4 EqualRow(const morkRow* ioRow) const
{
return
(
( mRow_Oid.mOid_Scope == ioRow->mRow_Oid.mOid_Scope )
&& ( mRow_Oid.mOid_Id == ioRow->mRow_Oid.mOid_Id )
);
}
mork_u4 EqualOid(const mdbOid* ioOid) const
{
return
(
( mRow_Oid.mOid_Scope == ioOid->mOid_Scope )
&& ( mRow_Oid.mOid_Id == ioOid->mOid_Id )
);
}
public: // errors
static void ZeroColumnError(morkEnv* ev);
static void LengthBeyondMaxError(morkEnv* ev);
static void NilCellsError(morkEnv* ev);
static void NonRowTypeError(morkEnv* ev);
static void NonRowTypeWarning(morkEnv* ev);
static void TableUsesUnderflowWarning(morkEnv* ev);
private: // copying is not allowed
morkRow(const morkRow& other);
morkRow& operator=(const morkRow& other);
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKROW_ */

View File

@@ -0,0 +1,165 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKCURSOR_
#include "morkCursor.h"
#endif
#ifndef _MORKROWCELLCURSOR_
#include "morkRowCellCursor.h"
#endif
#ifndef _ORKINROWCELLCURSOR_
#include "orkinRowCellCursor.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _MORKROWOBJECT_
#include "morkRowObject.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkRowCellCursor::CloseMorkNode(morkEnv* ev) // CloseRowCellCursor() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseRowCellCursor(ev);
this->MarkShut();
}
}
/*public virtual*/
morkRowCellCursor::~morkRowCellCursor() // CloseRowCellCursor() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkRowCellCursor::morkRowCellCursor(morkEnv* ev,
const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkRowObject* ioRowObject)
: morkCursor(ev, inUsage, ioHeap)
, mRowCellCursor_RowObject( 0 )
, mRowCellCursor_Col( 0 )
{
if ( ev->Good() )
{
if ( ioRowObject )
{
morkRow* row = ioRowObject->mRowObject_Row;
if ( row )
{
if ( row->IsRow() )
{
mCursor_Pos = -1;
mCursor_Seed = row->mRow_Seed;
morkRowObject::SlotStrongRowObject(ioRowObject, ev,
&mRowCellCursor_RowObject);
if ( ev->Good() )
mNode_Derived = morkDerived_kRowCellCursor;
}
else
row->NonRowTypeError(ev);
}
else
ioRowObject->NilRowError(ev);
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkRowCellCursor::CloseRowCellCursor(morkEnv* ev)
{
if ( this )
{
if ( this->IsNode() )
{
mCursor_Pos = -1;
mCursor_Seed = 0;
morkRowObject::SlotStrongRowObject((morkRowObject*) 0, ev,
&mRowCellCursor_RowObject);
this->CloseCursor(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkRowCellCursor::NonRowCellCursorTypeError(morkEnv* ev)
{
ev->NewError("non morkRowCellCursor");
}
orkinRowCellCursor*
morkRowCellCursor::AcquireRowCellCursorHandle(morkEnv* ev)
{
orkinRowCellCursor* outCursor = 0;
orkinRowCellCursor* c = (orkinRowCellCursor*) mObject_Handle;
if ( c ) // have an old handle?
c->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
c = orkinRowCellCursor::MakeRowCellCursor(ev, this);
mObject_Handle = c;
}
if ( c )
outCursor = c;
return outCursor;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,97 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKROWCELLCURSOR_
#define _MORKROWCELLCURSOR_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKCURSOR_
#include "morkCursor.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class orkinRowCellCursor;
#define morkDerived_kRowCellCursor /*i*/ 0x6343 /* ascii 'cC' */
class morkRowCellCursor : public morkCursor { // row iterator
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkFactory* mObject_Factory; // weak ref to suite factory
// mork_seed mCursor_Seed;
// mork_pos mCursor_Pos;
// mork_bool mCursor_DoFailOnSeedOutOfSync;
// mork_u1 mCursor_Pad[ 3 ]; // explicitly pad to u4 alignment
public: // state is public because the entire Mork system is private
morkRowObject* mRowCellCursor_RowObject; // strong ref to row
mork_column mRowCellCursor_Col; // col of cell last at mCursor_Pos
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseRowCellCursor()
virtual ~morkRowCellCursor(); // assert that close executed earlier
public: // morkRowCellCursor construction & destruction
morkRowCellCursor(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkRowObject* ioRowObject);
void CloseRowCellCursor(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkRowCellCursor(const morkRowCellCursor& other);
morkRowCellCursor& operator=(const morkRowCellCursor& other);
public: // dynamic type identification
mork_bool IsRowCellCursor() const
{ return IsNode() && mNode_Derived == morkDerived_kRowCellCursor; }
// } ===== end morkNode methods =====
public: // typing
static void NonRowCellCursorTypeError(morkEnv* ev);
public: // other cell cursor methods
orkinRowCellCursor* AcquireRowCellCursorHandle(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakRowCellCursor(morkRowCellCursor* me,
morkEnv* ev, morkRowCellCursor** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongRowCellCursor(morkRowCellCursor* me,
morkEnv* ev, morkRowCellCursor** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKROWCELLCURSOR_ */

View File

@@ -0,0 +1,171 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKROWMAP_
#include "morkRowMap.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkRowMap::CloseMorkNode(morkEnv* ev) // CloseRowMap() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseRowMap(ev);
this->MarkShut();
}
}
/*public virtual*/
morkRowMap::~morkRowMap() // assert CloseRowMap() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkRowMap::morkRowMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap, mork_size inSlots)
: morkMap(ev, inUsage, ioHeap,
/*inKeySize*/ sizeof(morkRow*), /*inValSize*/ 0,
inSlots, ioSlotHeap, /*inHoldChanges*/ morkBool_kFalse)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kRowMap;
}
/*public non-poly*/ void
morkRowMap::CloseRowMap(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
this->CloseMap(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
// { ===== begin morkMap poly interface =====
/*virtual*/ mork_bool //
morkRowMap::Equal(morkEnv* ev, const void* inKeyA,
const void* inKeyB) const
{
return (*(const morkRow**) inKeyA)->EqualRow(*(const morkRow**) inKeyB);
}
/*virtual*/ mork_u4 //
morkRowMap::Hash(morkEnv* ev, const void* inKey) const
{
return (*(const morkRow**) inKey)->HashRow();
}
// } ===== end morkMap poly interface =====
mork_bool
morkRowMap::AddRow(morkEnv* ev, morkRow* ioRow)
{
if ( ev->Good() )
{
this->Put(ev, &ioRow, /*val*/ (void*) 0,
/*key*/ (void*) 0, /*val*/ (void*) 0, (mork_change**) 0);
}
return ev->Good();
}
morkRow*
morkRowMap::CutOid(morkEnv* ev, const mdbOid* inOid)
{
morkRow row(inOid);
morkRow* key = &row;
morkRow* oldKey = 0;
this->Cut(ev, &key, &oldKey, /*val*/ (void*) 0,
(mork_change**) 0);
return oldKey;
}
morkRow*
morkRowMap::CutRow(morkEnv* ev, const morkRow* ioRow)
{
morkRow* oldKey = 0;
this->Cut(ev, &ioRow, &oldKey, /*val*/ (void*) 0,
(mork_change**) 0);
return oldKey;
}
morkRow*
morkRowMap::GetOid(morkEnv* ev, const mdbOid* inOid)
{
morkRow row(inOid);
morkRow* key = &row;
morkRow* oldKey = 0;
this->Get(ev, &key, &oldKey, /*val*/ (void*) 0, (mork_change**) 0);
return oldKey;
}
morkRow*
morkRowMap::GetRow(morkEnv* ev, const morkRow* ioRow)
{
morkRow* oldKey = 0;
this->Get(ev, &ioRow, &oldKey, /*val*/ (void*) 0, (mork_change**) 0);
return oldKey;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,112 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKROWMAP_
#define _MORKROWMAP_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kRowMap /*i*/ 0x724D /* ascii 'rM' */
/*| morkRowMap: maps a set of morkRow by contained Oid
|*/
class morkRowMap : public morkMap { // for mapping row IDs to rows
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseRowMap() only if open
virtual ~morkRowMap(); // assert that CloseRowMap() executed earlier
public: // morkMap construction & destruction
morkRowMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap, mork_size inSlots);
void CloseRowMap(morkEnv* ev); // called by CloseMorkNode();
public: // dynamic type identification
mork_bool IsRowMap() const
{ return IsNode() && mNode_Derived == morkDerived_kRowMap; }
// } ===== end morkNode methods =====
// { ===== begin morkMap poly interface =====
virtual mork_bool // note: equal(a,b) implies hash(a) == hash(b)
Equal(morkEnv* ev, const void* inKeyA, const void* inKeyB) const;
// implemented using morkRow::EqualRow()
virtual mork_u4 // note: equal(a,b) implies hash(a) == hash(b)
Hash(morkEnv* ev, const void* inKey) const;
// implemented using morkRow::HashRow()
// } ===== end morkMap poly interface =====
public: // other map methods
mork_bool AddRow(morkEnv* ev, morkRow* ioRow);
// AddRow() returns ev->Good()
morkRow* CutOid(morkEnv* ev, const mdbOid* inOid);
// CutRid() returns the row removed equal to inRid, if there was one
morkRow* CutRow(morkEnv* ev, const morkRow* ioRow);
// CutRow() returns the row removed equal to ioRow, if there was one
morkRow* GetOid(morkEnv* ev, const mdbOid* inOid);
// GetOid() returns the row equal to inRid, or else nil
morkRow* GetRow(morkEnv* ev, const morkRow* ioRow);
// GetRow() returns the row equal to ioRow, or else nil
// note the rows are owned elsewhere, usuall by morkRowSpace
};
class morkRowMapIter: public morkMapIter{ // typesafe wrapper class
public:
morkRowMapIter(morkEnv* ev, morkRowMap* ioMap)
: morkMapIter(ev, ioMap) { }
morkRowMapIter( ) : morkMapIter() { }
void InitRowMapIter(morkEnv* ev, morkRowMap* ioMap)
{ this->InitMapIter(ev, ioMap); }
mork_change* FirstRow(morkEnv* ev, morkRow** outRowPtr)
{ return this->First(ev, outRowPtr, /*val*/ (void*) 0); }
mork_change* NextRow(morkEnv* ev, morkRow** outRowPtr)
{ return this->Next(ev, outRowPtr, /*val*/ (void*) 0); }
mork_change* HereRow(morkEnv* ev, morkRow** outRowPtr)
{ return this->Here(ev, outRowPtr, /*val*/ (void*) 0); }
mork_change* CutHereRow(morkEnv* ev, morkRow** outRowPtr)
{ return this->CutHere(ev, outRowPtr, /*val*/ (void*) 0); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKROWMAP_ */

View File

@@ -0,0 +1,170 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKROWOBJECT_
#include "morkRowObject.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _ORKINROW_
#include "orkinRow.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkRowObject::CloseMorkNode(morkEnv* ev) // CloseRowObject() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseRowObject(ev);
this->MarkShut();
}
}
/*public virtual*/
morkRowObject::~morkRowObject() // assert CloseRowObject() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkRowObject::morkRowObject(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkRow* ioRow, morkStore* ioStore)
: morkObject(ev, inUsage, ioHeap, (morkHandle*) 0)
, mRowObject_Row( 0 )
, mRowObject_Store( 0 )
{
if ( ev->Good() )
{
if ( ioRow && ioStore )
{
mRowObject_Row = ioRow;
morkStore::SlotWeakStore(ioStore, ev, &mRowObject_Store);
if ( ev->Good() )
mNode_Derived = morkDerived_kRowObject;
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkRowObject::CloseRowObject(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
morkRow* row = mRowObject_Row;
mRowObject_Row = 0;
this->CloseObject(ev);
this->MarkShut();
if ( row )
{
if ( row->mRow_Object == this )
{
morkRowObject::SlotWeakRowObject((morkRowObject*) 0, ev,
&row->mRow_Object);
morkStore::SlotWeakStore((morkStore*) 0, ev,
&mRowObject_Store);
}
else
MORK_ASSERT(morkBool_kFalse);
}
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkRowObject::NonRowObjectTypeError(morkEnv* ev)
{
ev->NewError("non morkRowObject");
}
/*static*/ void
morkRowObject::NilRowError(morkEnv* ev)
{
ev->NewError("nil mRowObject_Row");
}
/*static*/ void
morkRowObject::NilStoreError(morkEnv* ev)
{
ev->NewError("nil mRowObject_Store");
}
/*static*/ void
morkRowObject::RowObjectRowNotSelfError(morkEnv* ev)
{
ev->NewError("mRowObject_Row->mRow_Object != self");
}
nsIMdbRow*
morkRowObject::AcquireRowHandle(morkEnv* ev) // mObject_Handle
{
nsIMdbRow* outRow = 0;
orkinRow* r = (orkinRow*) mObject_Handle;
if ( r ) // have an old handle?
r->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
r = orkinRow::MakeRow(ev, this);
mObject_Handle = r;
}
if ( r )
outRow = r;
return outRow;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,82 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKROWOBJECT_
#define _MORKROWOBJECT_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class nsIMdbRow;
#define morkDerived_kRowObject /*i*/ 0x724F /* ascii 'rO' */
class morkRowObject : public morkObject { //
public: // state is public because the entire Mork system is private
morkRow* mRowObject_Row; // non-refcounted alias to morkRow
morkStore* mRowObject_Store; // weak ref to store containing row
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseRowObject() only if open
virtual ~morkRowObject(); // assert that CloseRowObject() executed earlier
public: // morkRowObject construction & destruction
morkRowObject(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkRow* ioRow, morkStore* ioStore);
void CloseRowObject(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkRowObject(const morkRowObject& other);
morkRowObject& operator=(const morkRowObject& other);
public: // dynamic type identification
mork_bool IsRowObject() const
{ return IsNode() && mNode_Derived == morkDerived_kRowObject; }
// } ===== end morkNode methods =====
public: // typing
static void NonRowObjectTypeError(morkEnv* ev);
static void NilRowError(morkEnv* ev);
static void NilStoreError(morkEnv* ev);
static void RowObjectRowNotSelfError(morkEnv* ev);
public: // other row node methods
nsIMdbRow* AcquireRowHandle(morkEnv* ev); // mObject_Handle
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakRowObject(morkRowObject* me,
morkEnv* ev, morkRowObject** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongRowObject(morkRowObject* me,
morkEnv* ev, morkRowObject** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKROWOBJECT_ */

View File

@@ -0,0 +1,382 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKSPACE_
#include "morkSpace.h"
#endif
#ifndef _MORKNODEMAP_
#include "morkNodeMap.h"
#endif
#ifndef _MORKROWMAP_
#include "morkRowMap.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKROWSPACE_
#include "morkRowSpace.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _MORKTABLE_
#include "morkTable.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
#ifndef _MORKROWOBJECT_
#include "morkRowObject.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkRowSpace::CloseMorkNode(morkEnv* ev) // CloseRowSpace() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseRowSpace(ev);
this->MarkShut();
}
}
/*public virtual*/
morkRowSpace::~morkRowSpace() // assert CloseRowSpace() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkRowSpace::morkRowSpace(morkEnv* ev,
const morkUsage& inUsage, mork_scope inScope, morkStore* ioStore,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkSpace(ev, inUsage, inScope, ioStore, ioHeap, ioSlotHeap)
, mRowSpace_Tables(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioSlotHeap)
, mRowSpace_Rows(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioSlotHeap,
morkRowSpace_kStartRowMapSlotCount)
, mRowSpace_NextTableId( 1 )
, mRowSpace_NextRowId( 1 )
{
if ( ev->Good() )
mNode_Derived = morkDerived_kRowSpace;
}
/*public non-poly*/ void
morkRowSpace::CloseRowSpace(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
mRowSpace_Tables.CloseMorkNode(ev);
morkStore* store = mSpace_Store;
if ( store )
this->CutAllRows(ev, &store->mStore_Pool);
mRowSpace_Rows.CloseMorkNode(ev);
this->CloseSpace(ev);
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkRowSpace::NonRowSpaceTypeError(morkEnv* ev)
{
ev->NewError("non morkRowSpace");
}
/*static*/ void
morkRowSpace::ZeroKindError(morkEnv* ev)
{
ev->NewError("zero table kind");
}
/*static*/ void
morkRowSpace::ZeroScopeError(morkEnv* ev)
{
ev->NewError("zero row scope");
}
/*static*/ void
morkRowSpace::ZeroTidError(morkEnv* ev)
{
ev->NewError("zero table ID");
}
/*static*/ void
morkRowSpace::MinusOneRidError(morkEnv* ev)
{
ev->NewError("row ID is -1");
}
///*static*/ void
//morkRowSpace::ExpectAutoIdOnlyError(morkEnv* ev)
//{
// ev->NewError("zero row ID");
//}
///*static*/ void
//morkRowSpace::ExpectAutoIdNeverError(morkEnv* ev)
//{
//}
mork_num
morkRowSpace::CutAllRows(morkEnv* ev, morkPool* ioPool)
{
mork_num outSlots = mRowSpace_Rows.mMap_Fill;
morkRow* r = 0; // old key row in the map
mork_change* c = 0;
morkRowMapIter i(ev, &mRowSpace_Rows);
for ( c = i.FirstRow(ev, &r); c && ev->Good();
c = i.NextRow(ev, &r) )
{
if ( r->IsRow() )
{
if ( r->mRow_Object )
{
morkRowObject::SlotWeakRowObject((morkRowObject*) 0, ev,
&r->mRow_Object);
}
if ( r )
ioPool->ZapRow(ev, r);
}
else
r->NonRowTypeWarning(ev);
i.CutHereRow(ev, /*key*/ (morkRow**) 0);
}
return outSlots;
}
morkTable*
morkRowSpace::FindTableByKind(morkEnv* ev, mork_kind inTableKind)
{
if ( inTableKind )
{
mork_tid* key = 0; // nil pointer to suppress key access
morkTable* table = 0; // old table in the map
mork_change* c = 0;
morkTableMapIter i(ev, &mRowSpace_Tables);
for ( c = i.FirstTable(ev, key, &table); c && ev->Good();
c = i.NextTable(ev, key, &table) )
{
if ( table->mTable_Kind == inTableKind )
return table;
}
}
else
this->ZeroKindError(ev);
return (morkTable*) 0;
}
morkTable*
morkRowSpace::NewTable(morkEnv* ev, mork_kind inTableKind,
mdb_bool inMustBeUnique)
{
morkTable* outTable = 0;
if ( inTableKind )
{
if ( inMustBeUnique ) // need to look for existing table first?
outTable = this->FindTableByKind(ev, inTableKind);
if ( !outTable && ev->Good() )
{
mork_tid id = this->MakeNewTableId(ev);
if ( id )
{
nsIMdbHeap* heap = mSpace_Store->mPort_Heap;
morkTable* table = new(*heap, ev)
morkTable(ev, morkUsage::kHeap, heap, mSpace_Store, heap, this,
id, inTableKind, inMustBeUnique);
if ( table )
{
if ( mRowSpace_Tables.AddTable(ev, table) )
outTable = table;
else
table->CutStrongRef(ev);
}
}
}
}
else
this->ZeroKindError(ev);
return outTable;
}
mork_tid
morkRowSpace::MakeNewTableId(morkEnv* ev)
{
mork_tid outTid = 0;
mork_tid id = mRowSpace_NextTableId;
mork_num count = 9; // try up to eight times
while ( !outTid && --count ) // still trying to find an unused table ID?
{
if ( !mRowSpace_Tables.GetTable(ev, id) )
outTid = id;
else
{
MORK_ASSERT(morkBool_kFalse); // alert developer about ID problems
++id;
}
}
mRowSpace_NextTableId = id + 1;
return outTid;
}
mork_rid
morkRowSpace::MakeNewRowId(morkEnv* ev)
{
mork_rid outRid = 0;
mork_rid id = mRowSpace_NextRowId;
mork_num count = 9; // try up to eight times
mdbOid oid;
oid.mOid_Scope = mSpace_Scope;
while ( !outRid && --count ) // still trying to find an unused row ID?
{
oid.mOid_Id = id;
if ( !mRowSpace_Rows.GetOid(ev, &oid) )
outRid = id;
else
{
MORK_ASSERT(morkBool_kFalse); // alert developer about ID problems
++id;
}
}
mRowSpace_NextRowId = id + 1;
return outRid;
}
morkRow*
morkRowSpace::NewRowWithOid(morkEnv* ev, const mdbOid* inOid)
{
morkRow* outRow = mRowSpace_Rows.GetOid(ev, inOid);
MORK_ASSERT(outRow==0);
if ( !outRow && ev->Good() )
{
morkPool* pool = this->GetSpaceStorePool();
morkRow* row = pool->NewRow(ev);
if ( row )
{
row->InitRow(ev, inOid, this, /*length*/ 0, pool);
if ( ev->Good() && mRowSpace_Rows.AddRow(ev, row) )
outRow = row;
else
pool->ZapRow(ev, row);
}
}
return outRow;
}
morkRow*
morkRowSpace::NewRow(morkEnv* ev)
{
morkRow* outRow = 0;
if ( ev->Good() )
{
mork_rid id = this->MakeNewRowId(ev);
if ( id )
{
mdbOid oid;
oid.mOid_Scope = mSpace_Scope;
oid.mOid_Id = id;
morkPool* pool = this->GetSpaceStorePool();
morkRow* row = pool->NewRow(ev);
if ( row )
{
row->InitRow(ev, &oid, this, /*length*/ 0, pool);
if ( ev->Good() && mRowSpace_Rows.AddRow(ev, row) )
outRow = row;
else
pool->ZapRow(ev, row);
}
}
}
return outRow;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
morkRowSpaceMap::~morkRowSpaceMap()
{
}
morkRowSpaceMap::morkRowSpaceMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkNodeMap(ev, inUsage, ioHeap, ioSlotHeap)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kRowSpaceMap;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,203 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKROWSPACE_
#define _MORKROWSPACE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKSPACE_
#include "morkSpace.h"
#endif
#ifndef _MORKNODEMAP_
#include "morkNodeMap.h"
#endif
#ifndef _MORKROWMAP_
#include "morkRowMap.h"
#endif
#ifndef _MORKTABLE_
#include "morkTable.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kRowSpace /*i*/ 0x7253 /* ascii 'rS' */
#define morkRowSpace_kStartRowMapSlotCount 512
/*| morkRowSpace:
|*/
class morkRowSpace : public morkSpace { //
// public: // slots inherited from morkSpace (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkStore* mSpace_Store; // weak ref to containing store
// mork_scope mSpace_Scope; // the scope for this space
// mork_bool mSpace_DoAutoIDs; // whether db should assign member IDs
// mork_bool mSpace_HaveDoneAutoIDs; // whether actually auto assigned IDs
// mork_u1 mSpace_Pad[ 2 ]; // pad to u4 alignment
public: // state is public because the entire Mork system is private
morkRowMap mRowSpace_Rows; // hash table of morkRow instances
morkTableMap mRowSpace_Tables; // all the tables in this row scope
mork_tid mRowSpace_NextTableId; // for auto-assigning table IDs
mork_rid mRowSpace_NextRowId; // for auto-assigning row IDs
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseRowSpace() only if open
virtual ~morkRowSpace(); // assert that CloseRowSpace() executed earlier
public: // morkMap construction & destruction
morkRowSpace(morkEnv* ev, const morkUsage& inUsage, mork_scope inScope,
morkStore* ioStore, nsIMdbHeap* ioNodeHeap, nsIMdbHeap* ioSlotHeap);
void CloseRowSpace(morkEnv* ev); // called by CloseMorkNode();
public: // dynamic type identification
mork_bool IsRowSpace() const
{ return IsNode() && mNode_Derived == morkDerived_kRowSpace; }
// } ===== end morkNode methods =====
public: // typing
static void NonRowSpaceTypeError(morkEnv* ev);
static void ZeroScopeError(morkEnv* ev);
static void ZeroKindError(morkEnv* ev);
static void ZeroTidError(morkEnv* ev);
static void MinusOneRidError(morkEnv* ev);
//static void ExpectAutoIdOnlyError(morkEnv* ev);
//static void ExpectAutoIdNeverError(morkEnv* ev);
public: // other space methods
mork_num CutAllRows(morkEnv* ev, morkPool* ioPool);
// CutAllRows() puts all rows and cells back into the pool.
morkTable* NewTable(morkEnv* ev, mork_kind inTableKind,
mdb_bool inMustBeUnique);
morkTable* FindTableByKind(morkEnv* ev, mork_kind inTableKind);
morkTable* FindTableByTid(morkEnv* ev, mork_tid inTid)
{ return mRowSpace_Tables.GetTable(ev, inTid); }
mork_tid MakeNewTableId(morkEnv* ev);
mork_rid MakeNewRowId(morkEnv* ev);
// morkRow* FindRowByRid(morkEnv* ev, mork_rid inRid)
// { return (morkRow*) mRowSpace_Rows.GetRow(ev, inRid); }
morkRow* NewRowWithOid(morkEnv* ev, const mdbOid* inOid);
morkRow* NewRow(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakRowSpace(morkRowSpace* me,
morkEnv* ev, morkRowSpace** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongRowSpace(morkRowSpace* me,
morkEnv* ev, morkRowSpace** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kRowSpaceMap /*i*/ 0x725A /* ascii 'rZ' */
/*| morkRowSpaceMap: maps mork_scope -> morkRowSpace
|*/
class morkRowSpaceMap : public morkNodeMap { // for mapping tokens to tables
public:
virtual ~morkRowSpaceMap();
morkRowSpaceMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap);
public: // other map methods
mork_bool AddRowSpace(morkEnv* ev, morkRowSpace* ioRowSpace)
{ return this->AddNode(ev, ioRowSpace->mSpace_Scope, ioRowSpace); }
// the AddRowSpace() boolean return equals ev->Good().
mork_bool CutRowSpace(morkEnv* ev, mork_scope inScope)
{ return this->CutNode(ev, inScope); }
// The CutRowSpace() boolean return indicates whether removal happened.
morkRowSpace* GetRowSpace(morkEnv* ev, mork_scope inScope)
{ return (morkRowSpace*) this->GetNode(ev, inScope); }
// Note the returned space does NOT have an increase in refcount for this.
mork_num CutAllRowSpaces(morkEnv* ev)
{ return this->CutAllNodes(ev); }
// CutAllRowSpaces() releases all the referenced table values.
};
class morkRowSpaceMapIter: public morkMapIter{ // typesafe wrapper class
public:
morkRowSpaceMapIter(morkEnv* ev, morkRowSpaceMap* ioMap)
: morkMapIter(ev, ioMap) { }
morkRowSpaceMapIter( ) : morkMapIter() { }
void InitRowSpaceMapIter(morkEnv* ev, morkRowSpaceMap* ioMap)
{ this->InitMapIter(ev, ioMap); }
mork_change*
FirstRowSpace(morkEnv* ev, mork_scope* outScope, morkRowSpace** outRowSpace)
{ return this->First(ev, outScope, outRowSpace); }
mork_change*
NextRowSpace(morkEnv* ev, mork_scope* outScope, morkRowSpace** outRowSpace)
{ return this->Next(ev, outScope, outRowSpace); }
mork_change*
HereRowSpace(morkEnv* ev, mork_scope* outScope, morkRowSpace** outRowSpace)
{ return this->Here(ev, outScope, outRowSpace); }
mork_change*
CutHereRowSpace(morkEnv* ev, mork_scope* outScope, morkRowSpace** outRowSpace)
{ return this->CutHere(ev, outScope, outRowSpace); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKROWSPACE_ */

View File

@@ -0,0 +1,113 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKSINK_
#include "morkSink.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*virtual*/ morkSink::~morkSink()
{
mSink_At = 0;
mSink_End = 0;
}
/*virtual*/ void
morkSpoolSink::FlushSink(morkEnv* ev) // probably does nothing
{
ev->StubMethodOnlyError();
}
/*virtual*/ void
morkSpoolSink::SpillPutc(morkEnv* ev, int c) // grow spool and write byte
{
ev->StubMethodOnlyError();
}
// ````` ````` ````` ````` ````` ````` ````` `````
// public: // public non-poly morkSink methods
/*virtual*/
morkSpoolSink::~morkSpoolSink()
// Zero all slots to show this sink is disabled, but destroy no memory.
// Note it is typically unnecessary to flush this spool sink, since all
// content is written directly to the spool without any buffering.
{
}
morkSpoolSink::morkSpoolSink(morkEnv* ev, morkSpool* ioSpool)
// After installing the spool, calls Seek(ev, 0) to prepare for writing.
: morkSink()
, mSpoolSink_Spool( 0 )
{
if ( ev->Good() )
{
if ( ioSpool )
{
// ev->StubMethodOnlyError();
mSink_At = 0;
mSink_End = 0;
mSpoolSink_Spool = ioSpool;
}
else
ev->NilPointerError();
}
}
// ----- All boolean return values below are equal to ev->Good(): -----
mork_bool
morkSpoolSink::Seek(morkEnv* ev, mork_pos inPos)
// Changed the current write position in spool's buffer to inPos.
// For example, to start writing the spool from scratch, use inPos==0.
{
ev->StubMethodOnlyError();
return ev->Good();
}
mork_bool
morkSpoolSink::Write(morkEnv* ev, const void* inBuf, mork_size inSize)
// write inSize bytes of inBuf to current position inside spool's buffer
{
ev->StubMethodOnlyError();
return ev->Good();
}
mork_bool
morkSpoolSink::PutString(morkEnv* ev, const char* inString)
// call Write() with inBuf=inString and inSize=strlen(inString),
// unless inString is null, in which case we then do nothing at all.
{
ev->StubMethodOnlyError();
return ev->Good();
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,169 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKSINK_
#define _MORKSINK_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKBLOB_
#include "morkBlob.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*| morkSink is intended to be a very cheap buffered i/o sink which
**| writes to bufs and other strings a single byte at a time. The
**| basic idea is that writing a single byte has a very cheap average
**| cost, because a polymophic function call need only occur when the
**| space between At and End is exhausted. The rest of the time a
**| very cheap inline method will write a byte, and then bump a pointer.
**|
**|| At: the current position in some sequence of bytes at which to
**| write the next byte put into the sink. Presumably At points into
**| the private storage of some space which is not yet filled (except
**| when At reaches End, and the overflow must then spill). Note both
**| At and End are zeroed in the destructor to help show that a sink
**| is no longer usable; this is safe because At==End causes the case
**| where SpillPutc() is called to handled an exhausted buffer space.
**|
**|| End: an address one byte past the last byte which can be written
**| without needing to make a buffer larger than previously. When At
**| and End are equal, this means there is no space to write a byte,
**| and that some underlying buffer space must be grown before another
**| byte can be written. Note At must always be less than or equal to
**| End, and otherwise an important invariant has failed severely.
**|
**|| Buf: this original class slot has been commented out in the new
**| and more abstract version of this sink class, but the general idea
**| behind this slot should be explained to help design subclasses.
**| Each subclass should provide space into which At and End can point,
**| where End is beyond the last writable byte, and At is less than or
**| equal to this point inside the same buffer. With some kinds of
**| medium, such as writing to an instance of morkBlob, it is feasible
**| to point directly into the final resting place for all the content
**| written to the medium. Other mediums such as files, which write
**| only through function calls, will typically need a local buffer
**| to efficiently accumulate many bytes between such function calls.
**|
**|| FlushSink: this flush method should move any buffered content to
**| it's final destination. For example, for buffered writes to a
**| string medium, where string methods are function calls and not just
**| inline macros, it is faster to accumulate many bytes in a small
**| local buffer and then move these en masse later in a single call.
**|
**|| SpillPutc: when At is greater than or equal to End, this means an
**| underlying buffer has become full, so the buffer must be flushed
**| before a new byte can be written. The intention is that SpillPutc()
**| will be equivalent to calling FlushSink() followed by another call
**| to Putc(), where the flush is expected to make At less then End once
**| again. Except that FlushSink() need not make the underlying buffer
**| any larger, and SpillPutc() typically must make room for more bytes.
**| Note subclasses might want to guard against the case that both At
**| and End are null, which happens when a sink is destroyed, which sets
**| both these pointers to null as an indication the sink is disabled.
|*/
class morkSink {
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public sink virtual methods
virtual void FlushSink(morkEnv* ev) = 0;
virtual void SpillPutc(morkEnv* ev, int c) = 0;
// ````` ````` ````` ````` ````` ````` ````` `````
public: // member variables
mork_u1* mSink_At; // pointer into mSink_Buf
mork_u1* mSink_End; // one byte past last content byte
// define morkSink_kBufSize 256 /* small enough to go on stack */
// mork_u1 mSink_Buf[ morkSink_kBufSize + 4 ];
// want plus one for any needed end null byte; use plus 4 for alignment
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public non-poly morkSink methods
virtual ~morkSink(); // zero both At and End; virtual for subclasses
morkSink() { } // does nothing; subclasses must set At and End suitably
void Putc(morkEnv* ev, int c)
{
if ( mSink_At < mSink_End )
*mSink_At++ = (mork_u1) c;
else
this->SpillPutc(ev, c);
}
};
/*| morkSpoolSink: an output sink that efficiently writes individual bytes
**| or entire byte sequences to a spool instance, which grows as needed by
**| using the heap instance in the spool to grow the internal buffer.
**|
**|| Note we do not "own" the spool referenced by mSpoolSink_Spool, and
**| the lifetime of the spool is expected to equal or exceed that of this
**| sink by some external means. Typical usage might involve keeping an
**| instance of morkSpool and an instance of morkSpoolSink in the same
**| owning parent object, which uses the sink with the associated spool.
|*/
class morkSpoolSink : public morkSink { // for buffered i/o to a morkSpool
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public sink virtual methods
virtual void FlushSink(morkEnv* ev); // probably does nothing
virtual void SpillPutc(morkEnv* ev, int c); // grow spool and write byte
// ````` ````` ````` ````` ````` ````` ````` `````
public: // member variables
morkSpool* mSpoolSink_Spool; // destination medium for written bytes
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public non-poly morkSink methods
virtual ~morkSpoolSink();
// Zero all slots to show this sink is disabled, but destroy no memory.
// Note it is typically unnecessary to flush this spool sink, since all
// content is written directly to the spool without any buffering.
morkSpoolSink(morkEnv* ev, morkSpool* ioSpool);
// After installing the spool, calls Seek(ev, 0) to prepare for writing.
// ----- All boolean return values below are equal to ev->Good(): -----
mork_bool Seek(morkEnv* ev, mork_pos inPos);
// Changed the current write position in spool's buffer to inPos.
// For example, to start writing the spool from scratch, use inPos==0.
mork_bool Write(morkEnv* ev, const void* inBuf, mork_size inSize);
// write inSize bytes of inBuf to current position inside spool's buffer
mork_bool PutBuf(morkEnv* ev, const morkBuf& inBuffer)
{ return this->Write(ev, inBuffer.mBuf_Body, inBuffer.mBuf_Fill); }
mork_bool PutString(morkEnv* ev, const char* inString);
// call Write() with inBuf=inString and inSize=strlen(inString),
// unless inString is null, in which case we then do nothing at all.
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKSINK_ */

View File

@@ -0,0 +1,141 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKSPACE_
#include "morkSpace.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkSpace::CloseMorkNode(morkEnv* ev) // CloseSpace() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseSpace(ev);
this->MarkShut();
}
}
/*public virtual*/
morkSpace::~morkSpace() // assert CloseSpace() executed earlier
{
MORK_ASSERT(mSpace_Scope==0);
MORK_ASSERT(mSpace_Store==0);
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
//morkSpace::morkSpace(morkEnv* ev, const morkUsage& inUsage,
// nsIMdbHeap* ioNodeHeap, const morkMapForm& inForm,
// nsIMdbHeap* ioSlotHeap)
//: morkNode(ev, inUsage, ioNodeHeap)
//, mSpace_Map(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioSlotHeap)
//{
// ev->StubMethodOnlyError();
//}
/*public non-poly*/
morkSpace::morkSpace(morkEnv* ev,
const morkUsage& inUsage, mork_scope inScope, morkStore* ioStore,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkNode(ev, inUsage, ioHeap)
, mSpace_Store( 0 )
, mSpace_Scope( inScope )
, mSpace_DoAutoIDs( morkBool_kFalse )
, mSpace_HaveDoneAutoIDs( morkBool_kFalse )
{
if ( ev->Good() )
{
if ( ioStore )
{
morkStore::SlotWeakStore(ioStore, ev, &mSpace_Store);
if ( ev->Good() )
mNode_Derived = morkDerived_kSpace;
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkSpace::CloseSpace(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
morkStore::SlotWeakStore((morkStore*) 0, ev, &mSpace_Store);
mSpace_Scope = 0;
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkSpace::NonAsciiSpaceScopeName(morkEnv* ev)
{
ev->NewError("mSpace_Scope > 0x7F");
}
morkPool* morkSpace::GetSpaceStorePool() const
{
return &mSpace_Store->mStore_Pool;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,103 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKSPACE_
#define _MORKSPACE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkSpace_kInitialSpaceSlots /*i*/ 1024 /* default */
#define morkDerived_kSpace /*i*/ 0x5370 /* ascii 'Sp' */
/*| morkSpace:
|*/
class morkSpace : public morkNode { //
// public: // slots inherited from morkNode (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
public: // state is public because the entire Mork system is private
morkStore* mSpace_Store; // weak ref to containing store
mork_scope mSpace_Scope; // the scope for this space
mork_bool mSpace_DoAutoIDs; // whether db should assign member IDs
mork_bool mSpace_HaveDoneAutoIDs; // whether actually auto assigned IDs
mork_u1 mSpace_Pad[ 2 ]; // pad to u4 alignment
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseSpace() only if open
virtual ~morkSpace(); // assert that CloseSpace() executed earlier
public: // morkMap construction & destruction
//morkSpace(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioNodeHeap,
// const morkMapForm& inForm, nsIMdbHeap* ioSlotHeap);
morkSpace(morkEnv* ev, const morkUsage& inUsage,mork_scope inScope,
morkStore* ioStore, nsIMdbHeap* ioNodeHeap, nsIMdbHeap* ioSlotHeap);
void CloseSpace(morkEnv* ev); // called by CloseMorkNode();
public: // dynamic type identification
mork_bool IsSpace() const
{ return IsNode() && mNode_Derived == morkDerived_kSpace; }
// } ===== end morkNode methods =====
public: // other space methods
static void NonAsciiSpaceScopeName(morkEnv* ev);
morkPool* GetSpaceStorePool() const;
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakSpace(morkSpace* me,
morkEnv* ev, morkSpace** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongSpace(morkSpace* me,
morkEnv* ev, morkSpace** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKSPACE_ */

View File

@@ -0,0 +1,818 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKBLOB_
#include "morkBlob.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _ORKINSTORE_
#include "orkinStore.h"
#endif
#ifndef _MORKFACTORY_
#include "morkFactory.h"
#endif
#ifndef _MORKNODEMAP_
#include "morkNodeMap.h"
#endif
#ifndef _MORKFILE_
#include "morkFile.h"
#endif
#ifndef _MORKBUILDER_
#include "morkBuilder.h"
#endif
#ifndef _MORKATOMSPACE_
#include "morkAtomSpace.h"
#endif
#ifndef _MORKSTREAM_
#include "morkStream.h"
#endif
#ifndef _MORKATOMSPACE_
#include "morkAtomSpace.h"
#endif
#ifndef _MORKROWSPACE_
#include "morkRowSpace.h"
#endif
#ifndef _MORKPORTTABLECURSOR_
#include "morkPortTableCursor.h"
#endif
#ifndef _MORKTABLE_
#include "morkTable.h"
#endif
#ifndef _MORKROWMAP_
#include "morkRowMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkPort::CloseMorkNode(morkEnv* ev) // ClosePort() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->ClosePort(ev);
this->MarkShut();
}
}
/*public virtual*/
morkPort::~morkPort() // assert ClosePort() executed earlier
{
MORK_ASSERT(this->IsShutNode());
MORK_ASSERT(mPort_Factory==0);
MORK_ASSERT(mPort_Heap==0);
}
/*public non-poly*/
morkPort::morkPort(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioNodeHeap, // the heap (if any) for this node instance
morkFactory* inFactory, // the factory for this
nsIMdbHeap* ioPortHeap // the heap to hold all content in the port
)
: morkObject(ev, inUsage, ioNodeHeap, (morkHandle*) 0)
, mPort_Env( ev )
, mPort_Factory( 0 )
, mPort_Heap( 0 )
{
if ( ev->Good() )
{
if ( inFactory && ioPortHeap )
{
morkFactory::SlotWeakFactory(inFactory, ev, &mPort_Factory);
nsIMdbHeap_SlotStrongHeap(ioPortHeap, ev, &mPort_Heap);
if ( ev->Good() )
mNode_Derived = morkDerived_kPort;
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkPort::ClosePort(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
morkFactory::SlotWeakFactory((morkFactory*) 0, ev, &mPort_Factory);
nsIMdbHeap_SlotStrongHeap((nsIMdbHeap*) 0, ev, &mPort_Heap);
this->CloseObject(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkStore::CloseMorkNode(morkEnv* ev) // ClosePort() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseStore(ev);
this->MarkShut();
}
}
/*public virtual*/
morkStore::~morkStore() // assert CloseStore() executed earlier
{
MORK_ASSERT(this->IsShutNode());
MORK_ASSERT(mStore_File==0);
MORK_ASSERT(mStore_InStream==0);
MORK_ASSERT(mStore_OutStream==0);
MORK_ASSERT(mStore_Builder==0);
MORK_ASSERT(mStore_OidAtomSpace==0);
MORK_ASSERT(mStore_GroundAtomSpace==0);
MORK_ASSERT(mStore_GroundColumnSpace==0);
MORK_ASSERT(mStore_RowSpaces.IsShutNode());
MORK_ASSERT(mStore_AtomSpaces.IsShutNode());
MORK_ASSERT(mStore_Pool.IsShutNode());
}
/*public non-poly*/
morkStore::morkStore(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioNodeHeap, // the heap (if any) for this node instance
morkFactory* inFactory, // the factory for this
nsIMdbHeap* ioPortHeap // the heap to hold all content in the port
)
: morkPort(ev, inUsage, ioNodeHeap, inFactory, ioPortHeap)
, mStore_File( 0 )
, mStore_InStream( 0 )
, mStore_OutStream( 0 )
, mStore_Builder( 0 )
, mStore_OidAtomSpace( 0 )
, mStore_GroundAtomSpace( 0 )
, mStore_GroundColumnSpace( 0 )
, mStore_RowSpaces(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioPortHeap)
, mStore_AtomSpaces(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioPortHeap)
, mStore_Pool(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioPortHeap)
{
if ( ev->Good() )
{
mNode_Derived = morkDerived_kStore;
if ( ev->Good() )
mStore_CharsetToken = this->StringToToken(ev, "charset");
if ( ev->Good() )
mStore_AtomScopeToken = this->StringToToken(ev, "atomScope");
if ( ev->Good() )
mStore_RowScopeToken = this->StringToToken(ev, "rowScope");
if ( ev->Good() )
mStore_TableScopeToken = this->StringToToken(ev, "tableScope");
if ( ev->Good() )
mStore_ColumnScopeToken = this->StringToToken(ev, "columnScope");
if ( ev->Good() )
mStore_TableKindToken = this->StringToToken(ev, "tableKind");
}
}
/*public non-poly*/ void
morkStore::CloseStore(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
morkFile* file = mStore_File;
if ( file && file->IsOpenNode() )
file->CloseMorkNode(ev);
morkAtomSpace::SlotStrongAtomSpace((morkAtomSpace*) 0, ev,
&mStore_OidAtomSpace);
morkAtomSpace::SlotStrongAtomSpace((morkAtomSpace*) 0, ev,
&mStore_GroundAtomSpace);
morkAtomSpace::SlotStrongAtomSpace((morkAtomSpace*) 0, ev,
&mStore_GroundColumnSpace);
mStore_RowSpaces.CloseMorkNode(ev);
mStore_AtomSpaces.CloseMorkNode(ev);
morkBuilder::SlotStrongBuilder((morkBuilder*) 0, ev, &mStore_Builder);
morkFile::SlotStrongFile((morkFile*) 0, ev, &mStore_File);
morkStream::SlotStrongStream((morkStream*) 0, ev, &mStore_InStream);
morkStream::SlotStrongStream((morkStream*) 0, ev, &mStore_OutStream);
mStore_Pool.CloseMorkNode(ev);
this->ClosePort(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
void
morkStore::RenumberAllCollectableContent(morkEnv* ev)
{
// do nothing currently
}
nsIMdbStore*
morkStore::AcquireStoreHandle(morkEnv* ev)
{
nsIMdbStore* outStore = 0;
orkinStore* s = (orkinStore*) mObject_Handle;
if ( s ) // have an old handle?
s->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
s = orkinStore::MakeStore(ev, this);
mObject_Handle = s;
}
if ( s )
outStore = s;
return outStore;
}
morkMaxBookAtom*
morkStore::StageYarnAsBookAtom(morkEnv* ev, const mdbYarn* inYarn,
morkAtomSpace* ioSpace)
{
if ( inYarn && inYarn->mYarn_Buf )
{
mork_size length = inYarn->mYarn_Fill;
if ( length <= morkBookAtom_kMaxBodySize )
{
morkBuf buf(inYarn->mYarn_Buf, length);
mork_aid dummyAid = 1;
mStore_BookAtom.InitMaxBookAtom(ev, buf,
inYarn->mYarn_Form, ioSpace, dummyAid);
return &mStore_BookAtom;
}
}
else
ev->NilPointerError();
return (morkMaxBookAtom*) 0;
}
morkMaxBookAtom*
morkStore::StageStringAsBookAtom(morkEnv* ev, const char* inString,
mork_cscode inForm, morkAtomSpace* ioSpace)
// StageStringAsBookAtom() returns &mStore_BookAtom if inString is small
// enough, such that strlen(inString) < morkBookAtom_kMaxBodySize. And
// content inside mStore_BookAtom will be the valid atom format for
// inString. This method is the standard way to stage a string as an
// atom for searching or adding new atoms into an atom space hash table.
{
if ( inString )
{
mork_size length = MORK_STRLEN(inString);
if ( length <= morkBookAtom_kMaxBodySize )
{
morkBuf buf(inString, length);
mork_aid dummyAid = 1;
mStore_BookAtom.InitMaxBookAtom(ev, buf, inForm, ioSpace, dummyAid);
return &mStore_BookAtom;
}
}
else
ev->NilPointerError();
return (morkMaxBookAtom*) 0;
}
morkAtomSpace* morkStore::LazyGetOidAtomSpace(morkEnv* ev)
{
if ( !mStore_OidAtomSpace )
{
}
return mStore_OidAtomSpace;
}
morkAtomSpace* morkStore::LazyGetGroundAtomSpace(morkEnv* ev)
{
if ( !mStore_GroundAtomSpace )
{
mork_scope atomScope = morkStore_kGroundAtomSpace;
nsIMdbHeap* heap = mPort_Heap;
morkAtomSpace* space = new(*heap, ev)
morkAtomSpace(ev, morkUsage::kHeap, atomScope, this, heap, heap);
if ( space ) // successful space creation?
{
mStore_GroundAtomSpace = space; // transfer strong ref to this slot
mStore_AtomSpaces.AddAtomSpace(ev, space);
}
}
return mStore_GroundAtomSpace;
}
morkAtomSpace* morkStore::LazyGetGroundColumnSpace(morkEnv* ev)
{
if ( !mStore_GroundColumnSpace )
{
mork_scope atomScope = morkStore_kGroundColumnSpace;
nsIMdbHeap* heap = mPort_Heap;
morkAtomSpace* space = new(*heap, ev)
morkAtomSpace(ev, morkUsage::kHeap, atomScope, this, heap, heap);
if ( space ) // successful space creation?
{
mStore_GroundColumnSpace = space; // transfer strong ref to this slot
mStore_AtomSpaces.AddAtomSpace(ev, space);
}
}
return mStore_GroundColumnSpace;
}
morkStream* morkStore::LazyGetInStream(morkEnv* ev)
{
if ( !mStore_InStream )
{
morkFile* file = mStore_File;
if ( file )
{
morkStream* stream = new(*mPort_Heap, ev)
morkStream(ev, morkUsage::kHeap, mPort_Heap, file,
morkStore_kStreamBufSize, /*frozen*/ morkBool_kTrue);
if ( stream )
{
mStore_InStream = stream; // transfer strong ref to this slot
}
}
else
this->NilStoreFileError(ev);
}
return mStore_InStream;
}
morkStream* morkStore::LazyGetOutStream(morkEnv* ev)
{
if ( !mStore_OutStream )
{
morkFile* file = mStore_File;
if ( file )
{
morkStream* stream = new(*mPort_Heap, ev)
morkStream(ev, morkUsage::kHeap, mPort_Heap, file,
morkStore_kStreamBufSize, /*frozen*/ morkBool_kFalse);
if ( stream )
{
mStore_InStream = stream; // transfer strong ref to this slot
}
}
else
this->NilStoreFileError(ev);
}
return mStore_OutStream;
}
morkBuilder* morkStore::LazyGetBuilder(morkEnv* ev)
{
if ( !mStore_Builder )
{
morkStream* stream = this->LazyGetInStream(ev);
if ( stream )
{
nsIMdbHeap* heap = mPort_Heap;
morkBuilder* builder = new(*heap, ev)
morkBuilder(ev, morkUsage::kHeap, heap, stream,
morkBuilder_kDefaultBytesPerParseSegment, heap, this);
if ( builder )
{
mStore_Builder = builder; // transfer strong ref to this slot
}
}
}
return mStore_Builder;
}
morkRowSpace*
morkStore::LazyGetRowSpace(morkEnv* ev, mdb_scope inRowScope)
{
morkRowSpace* outSpace = mStore_RowSpaces.GetRowSpace(ev, inRowScope);
if ( !outSpace && ev->Good() ) // try to make new space?
{
nsIMdbHeap* heap = mPort_Heap;
outSpace = new(*heap, ev)
morkRowSpace(ev, morkUsage::kHeap, inRowScope, this, heap, heap);
if ( outSpace ) // successful space creation?
{
// note adding to node map creates it's own strong ref...
if ( mStore_RowSpaces.AddRowSpace(ev, outSpace) )
outSpace->CutStrongRef(ev); // ...so we can drop our strong ref
}
}
return outSpace;
}
morkAtomSpace*
morkStore::LazyGetAtomSpace(morkEnv* ev, mdb_scope inAtomScope)
{
morkAtomSpace* outSpace = mStore_AtomSpaces.GetAtomSpace(ev, inAtomScope);
if ( !outSpace && ev->Good() ) // try to make new space?
{
if ( inAtomScope == morkStore_kGroundAtomSpace )
outSpace = this->LazyGetGroundAtomSpace(ev);
else if ( inAtomScope == morkStore_kGroundColumnSpace )
outSpace = this->LazyGetGroundColumnSpace(ev);
else
{
nsIMdbHeap* heap = mPort_Heap;
outSpace = new(*heap, ev)
morkAtomSpace(ev, morkUsage::kHeap, inAtomScope, this, heap, heap);
if ( outSpace ) // successful space creation?
{
// note adding to node map creates it's own strong ref...
if ( mStore_AtomSpaces.AddAtomSpace(ev, outSpace) )
outSpace->CutStrongRef(ev); // ...so we can drop our strong ref
}
}
}
return outSpace;
}
/*static*/ void
morkStore::NonStoreTypeError(morkEnv* ev)
{
ev->NewError("non morkStore");
}
/*static*/ void
morkStore::NilStoreFileError(morkEnv* ev)
{
ev->NewError("nil mStore_File");
}
mork_bool
morkStore::OpenStoreFile(morkEnv* ev, mork_bool inFrozen,
const char* inFilePath, const mdbOpenPolicy* inOpenPolicy)
{
morkFile::SlotStrongFile((morkFile*) 0, ev, &mStore_File);
if ( ev->Good() )
{
morkFile* file = morkFile::OpenOldFile(ev, mPort_Heap,
inFilePath, inFrozen);
if ( file )
{
if ( ev->Good() )
morkFile::SlotStrongFile(file, ev, &mStore_File);
else
file->CutStrongRef(ev);
}
}
return ev->Good();
}
mork_bool
morkStore::CreateStoreFile(morkEnv* ev,
const char* inFilePath, const mdbOpenPolicy* inOpenPolicy)
{
morkFile::SlotStrongFile((morkFile*) 0, ev, &mStore_File);
if ( ev->Good() )
{
morkFile* file = morkFile::CreateNewFile(ev, mPort_Heap,
inFilePath);
if ( file )
{
if ( ev->Good() )
morkFile::SlotStrongFile(file, ev, &mStore_File);
else
file->CutStrongRef(ev);
}
}
return ev->Good();
}
morkAtom*
morkStore::YarnToAtom(morkEnv* ev, const mdbYarn* inYarn)
{
morkAtom* outAtom = 0;
if ( ev->Good() )
{
morkAtomSpace* groundSpace = this->LazyGetGroundAtomSpace(ev);
if ( groundSpace )
{
morkMaxBookAtom* keyAtom =
this->StageYarnAsBookAtom(ev, inYarn, groundSpace);
if ( keyAtom )
{
morkAtomBodyMap* map = &groundSpace->mAtomSpace_AtomBodies;
outAtom = map->GetAtom(ev, keyAtom);
if ( !outAtom )
outAtom = groundSpace->MakeBookAtomCopy(ev, *keyAtom);
}
else if ( ev->Good() )
{
morkBuf buf(inYarn->mYarn_Buf, inYarn->mYarn_Fill);
outAtom = mStore_Pool.NewAnonAtom(ev, buf, inYarn->mYarn_Form);
}
}
}
return outAtom;
}
// mork_bool
// morkStore::CutBookAtom(morkEnv* ev, morkBookAtom* ioAtom)
// {
// }
void
morkStore::TokenToString(morkEnv* ev, mdb_token inToken, mdbYarn* outTokenName)
{
if ( inToken > morkAtomSpace_kMaxSevenBitAid )
{
morkBookAtom* atom = 0;
morkAtomSpace* space = mStore_GroundColumnSpace;
if ( space )
atom = space->mAtomSpace_AtomAids.GetAid(ev, (mork_aid) inToken);
atom->GetYarn(outTokenName); // note this is safe even when atom==nil
}
else // token is an "immediate" single byte string representation?
{
mdbYarn* y = outTokenName;
if ( y->mYarn_Buf && y->mYarn_Size ) // any space in yarn at all?
{
mork_u1* buf = (mork_u1*) y->mYarn_Buf; // for byte arithmetic
buf[ 0 ] = (mork_u1) inToken; // write the single byte
y->mYarn_Fill = 1;
y->mYarn_More = 0;
}
else // just record we could not write the single byte
{
y->mYarn_More = 1;
y->mYarn_Fill = 0;
}
}
}
mork_token
morkStore::StringToToken(morkEnv* ev, const char* inTokenName)
{
mork_token outToken = 0;
if ( ev->Good() )
{
const mork_u1* s = (const mork_u1*) inTokenName;
mork_bool nonAscii = ( *s > 0x7F );
if ( nonAscii || ( *s && s[ 1 ] ) ) // more than one byte?
{
mork_cscode form = 0; // default charset
morkAtomSpace* groundSpace = this->LazyGetGroundColumnSpace(ev);
if ( groundSpace )
{
morkMaxBookAtom* keyAtom =
this->StageStringAsBookAtom(ev, inTokenName, form, groundSpace);
if ( keyAtom )
{
morkAtomBodyMap* map = &groundSpace->mAtomSpace_AtomBodies;
morkBookAtom* bookAtom = map->GetAtom(ev, keyAtom);
if ( bookAtom )
outToken = bookAtom->mBookAtom_Id;
else
{
bookAtom = groundSpace->MakeBookAtomCopy(ev, *keyAtom);
if ( bookAtom )
{
outToken = bookAtom->mBookAtom_Id;
bookAtom->MakeCellUseForever(ev);
}
}
}
}
}
else // only a single byte in inTokenName string:
outToken = *s;
}
return outToken;
}
mork_token
morkStore::QueryToken(morkEnv* ev, const char* inTokenName)
{
mork_token outToken = 0;
if ( ev->Good() )
{
const mork_u1* s = (const mork_u1*) inTokenName;
mork_bool nonAscii = ( *s > 0x7F );
if ( nonAscii || ( *s && s[ 1 ] ) ) // more than one byte?
{
mork_cscode form = 0; // default charset
morkAtomSpace* groundSpace = this->LazyGetGroundColumnSpace(ev);
if ( groundSpace )
{
morkMaxBookAtom* keyAtom =
this->StageStringAsBookAtom(ev, inTokenName, form, groundSpace);
if ( keyAtom )
{
morkAtomBodyMap* map = &groundSpace->mAtomSpace_AtomBodies;
morkBookAtom* bookAtom = map->GetAtom(ev, keyAtom);
if ( bookAtom )
{
outToken = bookAtom->mBookAtom_Id;
bookAtom->MakeCellUseForever(ev);
}
}
}
}
else // only a single byte in inTokenName string:
outToken = *s;
}
return outToken;
}
mork_bool
morkStore::HasTableKind(morkEnv* ev, mdb_scope inRowScope,
mdb_kind inTableKind, mdb_count* outTableCount)
{
mork_bool outBool = morkBool_kFalse;
return outBool;
}
morkTable*
morkStore::GetTableKind(morkEnv* ev, mdb_scope inRowScope,
mdb_kind inTableKind, mdb_count* outTableCount,
mdb_bool* outMustBeUnique)
{
morkTable* outTable = 0;
if ( ev->Good() )
{
morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inRowScope);
if ( rowSpace )
{
outTable = rowSpace->FindTableByKind(ev, inTableKind);
if ( outTable )
{
if ( outTableCount )
*outTableCount = outTable->GetRowCount();
if ( outMustBeUnique )
*outMustBeUnique = outTable->mTable_MustBeUnique;
}
}
}
return outTable;
}
morkRow*
morkStore::GetRow(morkEnv* ev, const mdbOid* inOid)
{
morkRow* outRow = 0;
if ( ev->Good() )
{
morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inOid->mOid_Scope);
if ( rowSpace )
{
outRow = rowSpace->mRowSpace_Rows.GetOid(ev, inOid);
}
}
return outRow;
}
morkTable*
morkStore::GetTable(morkEnv* ev, const mdbOid* inOid)
{
morkTable* outTable = 0;
if ( ev->Good() )
{
morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inOid->mOid_Scope);
if ( rowSpace )
{
outTable = rowSpace->FindTableByTid(ev, inOid->mOid_Id);
}
}
return outTable;
}
morkTable*
morkStore::NewTable(morkEnv* ev, mdb_scope inRowScope,
mdb_kind inTableKind, mdb_bool inMustBeUnique)
{
morkTable* outTable = 0;
if ( ev->Good() )
{
morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inRowScope);
if ( rowSpace )
outTable = rowSpace->NewTable(ev, inTableKind, inMustBeUnique);
}
return outTable;
}
morkPortTableCursor*
morkStore::GetPortTableCursor(morkEnv* ev, mdb_scope inRowScope,
mdb_kind inTableKind)
{
morkPortTableCursor* outCursor = 0;
if ( ev->Good() )
{
nsIMdbHeap* heap = mPort_Heap;
outCursor = new(*heap, ev)
morkPortTableCursor(ev, morkUsage::kHeap, heap, this,
inRowScope, inTableKind, heap);
}
return outCursor;
}
morkRow*
morkStore::NewRowWithOid(morkEnv* ev, const mdbOid* inOid)
{
morkRow* outRow = 0;
if ( ev->Good() )
{
morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inOid->mOid_Scope);
if ( rowSpace )
outRow = rowSpace->NewRowWithOid(ev, inOid);
}
return outRow;
}
morkRow*
morkStore::NewRow(morkEnv* ev, mdb_scope inRowScope)
{
morkRow* outRow = 0;
if ( ev->Good() )
{
morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inRowScope);
if ( rowSpace )
outRow = rowSpace->NewRow(ev);
}
return outRow;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,292 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKSTORE_
#define _MORKSTORE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
#ifndef _MORKNODEMAP_
#include "morkNodeMap.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKATOM_
#include "morkAtom.h"
#endif
#ifndef _MORKROWSPACE_
#include "morkRowSpace.h"
#endif
#ifndef _MORKATOMSPACE_
#include "morkAtomSpace.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kPort /*i*/ 0x7054 /* ascii 'pT' */
/*| morkPort:
|*/
class morkPort : public morkObject { // private mork port
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkHandle* mObject_Handle; // weak ref to handle for this object
public: // state is public because the entire Mork system is private
morkEnv* mPort_Env; // non-refcounted env which created port
morkFactory* mPort_Factory; // weak ref to suite factory
nsIMdbHeap* mPort_Heap; // heap in which this port allocs objects
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // ClosePort() only if open
virtual ~morkPort(); // assert that ClosePort() executed earlier
public: // morkPort construction & destruction
morkPort(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioNodeHeap, // the heap (if any) for this node instance
morkFactory* inFactory, // the factory for this
nsIMdbHeap* ioPortHeap // the heap to hold all content in the port
);
void ClosePort(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkPort(const morkPort& other);
morkPort& operator=(const morkPort& other);
public: // dynamic type identification
mork_bool IsPort() const
{ return IsNode() && mNode_Derived == morkDerived_kPort; }
// } ===== end morkNode methods =====
public: // other port methods
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakPort(morkPort* me,
morkEnv* ev, morkPort** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongPort(morkPort* me,
morkEnv* ev, morkPort** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
#define morkDerived_kStore /*i*/ 0x7354 /* ascii 'sT' */
/*| kGroundColumnSpace: we use the 'column space' as the default scope
**| for grounding column name IDs, and this is also the default scope for
**| all other explicitly tokenized strings.
|*/
#define morkStore_kGroundColumnSpace 'c' /* for mStore_GroundColumnSpace*/
#define morkStore_kGroundAtomSpace 'a' /* for mStore_GroundAtomSpace*/
#define morkStore_kStreamBufSize (8 * 1024) /* okay buffer size */
/*| morkStore:
|*/
class morkStore : public morkPort {
// public: // slots inherited from morkPort (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkEnv* mPort_Env; // non-refcounted env which created port
// morkFactory* mPort_Factory; // weak ref to suite factory
// nsIMdbHeap* mPort_Heap; // heap in which this port allocs objects
public: // state is public because the entire Mork system is private
// mStore_OidAtomSpace might be unnecessary; I don't remember why I wanted it.
morkAtomSpace* mStore_OidAtomSpace; // ground atom space for oids
morkAtomSpace* mStore_GroundAtomSpace; // ground atom space for scopes
morkAtomSpace* mStore_GroundColumnSpace; // ground column space for scopes
morkFile* mStore_File; // the file containing Mork text
morkStream* mStore_InStream; // stream using file used by the builder
morkBuilder* mStore_Builder; // to parse Mork text and build structures
morkStream* mStore_OutStream; // stream using file used by the writer
mork_column mStore_CharsetToken; // token for "charset"
mork_column mStore_AtomScopeToken; // token for "atomScope"
mork_column mStore_RowScopeToken; // token for "rowScope"
mork_column mStore_TableScopeToken; // token for "tableScope"
mork_column mStore_ColumnScopeToken; // token for "columnScope"
mork_kind mStore_TableKindToken; // token for "tableKind"
morkRowSpaceMap mStore_RowSpaces; // maps mork_scope -> morkSpace
morkAtomSpaceMap mStore_AtomSpaces; // maps mork_scope -> morkSpace
morkPool mStore_Pool;
// we alloc a max size book atom to reuse space for atom map key searches:
morkMaxBookAtom mStore_BookAtom; // staging area for atom map searches
public: // building an atom inside mStore_BookAtom from a char* string
morkMaxBookAtom* StageYarnAsBookAtom(morkEnv* ev,
const mdbYarn* inYarn, morkAtomSpace* ioSpace);
morkMaxBookAtom* StageStringAsBookAtom(morkEnv* ev,
const char* inString, mork_cscode inForm, morkAtomSpace* ioSpace);
// StageStringAsBookAtom() returns &mStore_BookAtom if inString is small
// enough, such that strlen(inString) < morkBookAtom_kMaxBodySize. And
// content inside mStore_BookAtom will be the valid atom format for
// inString. This method is the standard way to stage a string as an
// atom for searching or adding new atoms into an atom space hash table.
public: // lazy creation of members and nested row or atom spaces
morkAtomSpace* LazyGetOidAtomSpace(morkEnv* ev);
morkAtomSpace* LazyGetGroundAtomSpace(morkEnv* ev);
morkAtomSpace* LazyGetGroundColumnSpace(morkEnv* ev);
morkStream* LazyGetInStream(morkEnv* ev);
morkBuilder* LazyGetBuilder(morkEnv* ev);
morkStream* LazyGetOutStream(morkEnv* ev);
morkRowSpace* LazyGetRowSpace(morkEnv* ev, mdb_scope inRowScope);
morkAtomSpace* LazyGetAtomSpace(morkEnv* ev, mdb_scope inAtomScope);
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseStore() only if open
virtual ~morkStore(); // assert that CloseStore() executed earlier
public: // morkStore construction & destruction
morkStore(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioNodeHeap, // the heap (if any) for this node instance
morkFactory* inFactory, // the factory for this
nsIMdbHeap* ioPortHeap // the heap to hold all content in the port
);
void CloseStore(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkStore(const morkStore& other);
morkStore& operator=(const morkStore& other);
public: // dynamic type identification
mork_bool IsStore() const
{ return IsNode() && mNode_Derived == morkDerived_kStore; }
// } ===== end morkNode methods =====
public: // typing
static void NonStoreTypeError(morkEnv* ev);
static void NilStoreFileError(morkEnv* ev);
public: // store utilties
morkAtom* YarnToAtom(morkEnv* ev, const mdbYarn* inYarn);
public: // other store methods
void RenumberAllCollectableContent(morkEnv* ev);
nsIMdbStore* AcquireStoreHandle(morkEnv* ev); // mObject_Handle
morkPool* StorePool() { return &mStore_Pool; }
mork_bool OpenStoreFile(morkEnv* ev, // return value equals ev->Good()
mork_bool inFrozen,
const char* inFilePath,
const mdbOpenPolicy* inOpenPolicy);
mork_bool CreateStoreFile(morkEnv* ev, // return value equals ev->Good()
const char* inFilePath,
const mdbOpenPolicy* inOpenPolicy);
// mork_bool CutBookAtom(morkEnv* ev, morkBookAtom* ioAtom);
mork_token StringToToken(morkEnv* ev, const char* inTokenName);
mork_token QueryToken(morkEnv* ev, const char* inTokenName);
void TokenToString(morkEnv* ev, mdb_token inToken, mdbYarn* outTokenName);
mork_bool HasTableKind(morkEnv* ev, mdb_scope inRowScope,
mdb_kind inTableKind, mdb_count* outTableCount);
morkTable* GetTableKind(morkEnv* ev, mdb_scope inRowScope,
mdb_kind inTableKind, mdb_count* outTableCount,
mdb_bool* outMustBeUnique);
morkRow* GetRow(morkEnv* ev, const mdbOid* inOid);
morkTable* GetTable(morkEnv* ev, const mdbOid* inOid);
morkTable* NewTable(morkEnv* ev, mdb_scope inRowScope,
mdb_kind inTableKind, mdb_bool inMustBeUnique);
morkPortTableCursor* GetPortTableCursor(morkEnv* ev, mdb_scope inRowScope,
mdb_kind inTableKind) ;
morkRow* NewRowWithOid(morkEnv* ev, const mdbOid* inOid);
morkRow* NewRow(morkEnv* ev, mdb_scope inRowScope);
morkThumb* MakeCompressCommitThumb(morkEnv* ev, mork_bool inDoCollect);
public: // commit related methods
mork_bool MarkAllStoreContentDirty(morkEnv* ev);
// MarkAllStoreContentDirty() visits every object in the store and marks
// them dirty, including every table, row, cell, and atom. The return
// equals ev->Good(), to show whether any error happened. This method is
// intended for use in the beginning of a "compress commit" which writes
// all store content, whether dirty or not. We dirty everything first so
// that later iterations over content can mark things clean as they are
// written, and organize the process of serialization so that objects are
// written only at need (because of being dirty).
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakStore(morkStore* me,
morkEnv* ev, morkStore** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongStore(morkStore* me,
morkEnv* ev, morkStore** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKSTORE_ */

View File

@@ -0,0 +1,859 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKFILE_
#include "morkFile.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKSTREAM_
#include "morkStream.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkStream::CloseMorkNode(morkEnv* ev) // CloseStream() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseStream(ev);
this->MarkShut();
}
}
/*public virtual*/
morkStream::~morkStream() // assert CloseStream() executed earlier
{
MORK_ASSERT(mStream_ContentFile==0);
MORK_ASSERT(mStream_Buf==0);
}
/*public non-poly*/
morkStream::morkStream(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap,
morkFile* ioContentFile, mork_size inBufSize, mork_bool inFrozen)
: morkFile(ev, inUsage, ioHeap, ioHeap)
, mStream_At( 0 )
, mStream_ReadEnd( 0 )
, mStream_WriteEnd( 0 )
, mStream_ContentFile( 0 )
, mStream_Buf( 0 )
, mStream_BufSize( 0 )
, mStream_BufPos( 0 )
, mStream_Dirty( morkBool_kFalse )
, mStream_HitEof( morkBool_kFalse )
{
if ( ev->Good() )
{
if ( inBufSize < morkStream_kMinBufSize )
mStream_BufSize = inBufSize = morkStream_kMinBufSize;
else if ( inBufSize > morkStream_kMaxBufSize )
mStream_BufSize = inBufSize = morkStream_kMaxBufSize;
if ( ioContentFile && ioHeap )
{
if ( ioContentFile->FileFrozen() ) // forced to be readonly?
inFrozen = morkBool_kTrue; // override the input value
morkFile::SlotStrongFile(ioContentFile, ev, &mStream_ContentFile);
if ( ev->Good() )
{
mork_u1* buf = 0;
ioHeap->Alloc(ev->AsMdbEnv(), inBufSize, (void**) &buf);
if ( buf )
{
mStream_At = mStream_Buf = buf;
if ( !inFrozen )
{
// physical buffer end never moves:
mStream_WriteEnd = buf + inBufSize;
}
else
mStream_WriteEnd = 0; // no writing is allowed
if ( inFrozen )
{
// logical buffer end starts at Buf with no content:
mStream_ReadEnd = buf;
this->SetFileFrozen(inFrozen);
}
else
mStream_ReadEnd = 0; // no reading is allowed
this->SetFileActive(morkBool_kTrue);
this->SetFileIoOpen(morkBool_kTrue);
}
if ( ev->Good() )
mNode_Derived = morkDerived_kStream;
}
}
else ev->NilPointerError();
}
}
/*public non-poly*/ void
morkStream::CloseStream(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
morkFile::SlotStrongFile((morkFile*) 0, ev, &mStream_ContentFile);
nsIMdbHeap* heap = mFile_SlotHeap;
mork_u1* buf = mStream_Buf;
mStream_Buf = 0;
if ( heap && buf )
heap->Free(ev->AsMdbEnv(), buf);
this->CloseFile(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
#define morkStream_kSpacesPerIndent 1 /* one space per indent */
#define morkStream_kMaxIndentDepth 70 /* max indent of 70 space bytes */
static const char* morkStream_kSpaces // next line to ease length perception
= " ";
// 123456789_123456789_123456789_123456789_123456789_123456789_123456789_
// morkStream_kSpaces above must contain (at least) 70 spaces (ASCII 0x20)
mork_size
morkStream::PutIndent(morkEnv* ev, mork_count inDepth)
// PutIndent() puts a linebreak, and then
// "indents" by inDepth, and returns the line length after indentation.
{
mork_size outLength = 0;
if ( ev->Good() )
{
this->PutLineBreak(ev);
if ( ev->Good() )
{
outLength = inDepth;
if ( inDepth )
this->Write(ev, morkStream_kSpaces, inDepth);
}
}
return outLength;
}
mork_size
morkStream::PutByteThenIndent(morkEnv* ev, int inByte, mork_count inDepth)
// PutByteThenIndent() puts the byte, then a linebreak, and then
// "indents" by inDepth, and returns the line length after indentation.
{
mork_size outLength = 0;
if ( inDepth > morkStream_kMaxIndentDepth )
inDepth = morkStream_kMaxIndentDepth;
this->Putc(ev, inByte);
if ( ev->Good() )
{
this->PutLineBreak(ev);
if ( ev->Good() )
{
outLength = inDepth;
if ( inDepth )
this->Write(ev, morkStream_kSpaces, inDepth);
}
}
return outLength;
}
mork_size
morkStream::PutStringThenIndent(morkEnv* ev,
const char* inString, mork_count inDepth)
// PutStringThenIndent() puts the string, then a linebreak, and then
// "indents" by inDepth, and returns the line length after indentation.
{
mork_size outLength = 0;
if ( inDepth > morkStream_kMaxIndentDepth )
inDepth = morkStream_kMaxIndentDepth;
if ( inString )
{
mork_size length = MORK_STRLEN(inString);
if ( length && ev->Good() ) // any bytes to write?
this->Write(ev, inString, length);
}
if ( ev->Good() )
{
this->PutLineBreak(ev);
if ( ev->Good() )
{
outLength = inDepth;
if ( inDepth )
this->Write(ev, morkStream_kSpaces, inDepth);
}
}
return outLength;
}
mork_size
morkStream::PutString(morkEnv* ev, const char* inString)
{
mork_size outSize = 0;
if ( inString )
{
outSize = MORK_STRLEN(inString);
if ( outSize && ev->Good() ) // any bytes to write?
{
this->Write(ev, inString, outSize);
}
}
return outSize;
}
mork_size
morkStream::PutStringThenNewline(morkEnv* ev, const char* inString)
// PutStringThenNewline() returns total number of bytes written.
{
mork_size outSize = 0;
if ( inString )
{
outSize = MORK_STRLEN(inString);
if ( outSize && ev->Good() ) // any bytes to write?
{
this->Write(ev, inString, outSize);
if ( ev->Good() )
outSize += this->PutLineBreak(ev);
}
}
return outSize;
}
mork_size
morkStream::PutStringThenNewlineThenSpace(morkEnv* ev, const char* inString)
// PutStringThenNewlineThenSpace() returns total number of bytes written.
{
mork_size outSize = 0;
if ( inString )
{
outSize = MORK_STRLEN(inString);
if ( outSize && ev->Good() ) // any bytes to write?
{
this->Write(ev, inString, outSize);
if ( ev->Good() )
{
outSize += this->PutLineBreak(ev);
if ( ev->Good() )
{
this->Putc(ev, ' ');
++outSize;
}
}
}
}
return outSize;
}
mork_size
morkStream::PutByteThenNewline(morkEnv* ev, int inByte)
// PutByteThenNewline() returns total number of bytes written.
{
mork_size outSize = 1; // one for the following byte
this->Putc(ev, inByte);
if ( ev->Good() )
outSize += this->PutLineBreak(ev);
return outSize;
}
mork_size
morkStream::PutByteThenNewlineThenSpace(morkEnv* ev, int inByte)
// PutByteThenNewlineThenSpace() returns total number of bytes written.
{
mork_size outSize = 1; // one for the following byte
this->Putc(ev, inByte);
if ( ev->Good() )
{
outSize += this->PutLineBreak(ev);
if ( ev->Good() )
{
this->Putc(ev, ' ');
++outSize;
}
}
return outSize;
}
mork_size
morkStream::PutLineBreak(morkEnv* ev)
{
#ifdef MORK_MAC
this->Putc(ev, mork_kCR);
return 1;
#else
# if defined(MORK_WIN) || defined(MORK_OS2)
this->Putc(ev, mork_kCR);
this->Putc(ev, mork_kLF);
return 2;
# else
# ifdef MORK_UNIX
this->Putc(ev, mork_kLF);
return 1;
# endif /* MORK_UNIX */
# endif /* MORK_WIN */
#endif /* MORK_MAC */
}
// ````` ````` ````` ````` ````` ````` ````` `````
// public: // virtual morkFile methods
/*public virtual*/ void
morkStream::BecomeTrunk(morkEnv* ev)
// If this file is a file version branch created by calling AcquireBud(),
// BecomeTrunk() causes this file's content to replace the original
// file's content, typically by assuming the original file's identity.
{
ev->StubMethodOnlyError();
}
/*public virtual*/ morkFile*
morkStream::AcquireBud(morkEnv* ev, nsIMdbHeap* ioHeap)
// AcquireBud() starts a new "branch" version of the file, empty of content,
// so that a new version of the file can be written. This new file
// can later be told to BecomeTrunk() the original file, so the branch
// created by budding the file will replace the original file. Some
// file subclasses might initially take the unsafe but expedient
// approach of simply truncating this file down to zero length, and
// then returning the same morkFile pointer as this, with an extra
// reference count increment. Note that the caller of AcquireBud() is
// expected to eventually call CutStrongRef() on the returned file
// in order to release the strong reference. High quality versions
// of morkFile subclasses will create entirely new files which later
// are renamed to become the old file, so that better transactional
// behavior is exhibited by the file, so crashes protect old files.
// Note that AcquireBud() is an illegal operation on readonly files.
{
morkFile* outFile = 0;
morkFile* file = mStream_ContentFile;
if ( this->IsOpenAndActiveFile() && file )
{
// figure out how this interacts with buffering and mStream_WriteEnd:
ev->StubMethodOnlyError();
}
else this->NewFileDownError(ev);
return outFile;
}
/*public virtual*/ mork_pos
morkStream::Length(morkEnv* ev) const // eof
{
mork_pos outPos = 0;
morkFile* file = mStream_ContentFile;
if ( this->IsOpenAndActiveFile() && file )
{
mork_pos contentEof = file->Length(ev);
if ( mStream_WriteEnd ) // this stream supports writing?
{
// the local buffer might have buffered content past content eof
if ( ev->Good() ) // no error happened during Length() above?
{
mork_u1* at = mStream_At;
mork_u1* buf = mStream_Buf;
if ( at >= buf ) // expected cursor order?
{
mork_pos localContent = mStream_BufPos + (at - buf);
if ( localContent > contentEof ) // buffered past eof?
contentEof = localContent; // return new logical eof
outPos = contentEof;
}
else this->NewBadCursorOrderError(ev);
}
}
else
outPos = contentEof; // frozen files get length from content file
}
else this->NewFileDownError(ev);
return outPos;
}
void morkStream::NewBadCursorSlotsError(morkEnv* ev) const
{ ev->NewError("bad stream cursor slots"); }
void morkStream::NewNullStreamBufferError(morkEnv* ev) const
{ ev->NewError("null stream buffer"); }
void morkStream::NewCantReadSinkError(morkEnv* ev) const
{ ev->NewError("cant read stream sink"); }
void morkStream::NewCantWriteSourceError(morkEnv* ev) const
{ ev->NewError("cant write stream source"); }
void morkStream::NewPosBeyondEofError(morkEnv* ev) const
{ ev->NewError("stream pos beyond eof"); }
void morkStream::NewBadCursorOrderError(morkEnv* ev) const
{ ev->NewError("bad stream cursor order"); }
/*public virtual*/ mork_pos
morkStream::Tell(morkEnv* ev) const
{
mork_pos outPos = 0;
morkFile* file = mStream_ContentFile;
if ( this->IsOpenAndActiveFile() && file )
{
mork_u1* buf = mStream_Buf;
mork_u1* at = mStream_At;
mork_u1* readEnd = mStream_ReadEnd; // nonzero only if readonly
mork_u1* writeEnd = mStream_WriteEnd; // nonzero only if writeonly
if ( writeEnd )
{
if ( buf && at >= buf && at <= writeEnd )
{
outPos = mStream_BufPos + (at - buf);
}
else this->NewBadCursorOrderError(ev);
}
else if ( readEnd )
{
if ( buf && at >= buf && at <= readEnd )
{
outPos = mStream_BufPos + (at - buf);
}
else this->NewBadCursorOrderError(ev);
}
}
else this->NewFileDownError(ev);
return outPos;
}
/*public virtual*/ mork_size
morkStream::Read(morkEnv* ev, void* outBuf, mork_size inSize)
{
// First we satisfy the request from buffered bytes, if any. Then
// if additional bytes are needed, we satisfy these by direct reads
// from the content file without any local buffering (but we still need
// to adjust the buffer position to reflect the current i/o point).
mork_pos outActual = 0;
morkFile* file = mStream_ContentFile;
if ( this->IsOpenAndActiveFile() && file )
{
mork_u1* end = mStream_ReadEnd; // byte after last buffered byte
if ( end ) // file is open for read access?
{
if ( inSize ) // caller wants any output?
{
mork_u1* sink = (mork_u1*) outBuf; // where we plan to write bytes
if ( sink ) // caller passed good buffer address?
{
mork_u1* at = mStream_At;
mork_u1* buf = mStream_Buf;
if ( at >= buf && at <= end ) // expected cursor order?
{
mork_num remaining = end - at; // bytes left in buffer
mork_num quantum = inSize; // number of bytes to copy
if ( quantum > remaining ) // more than buffer content?
quantum = remaining; // restrict to buffered bytes
if ( quantum ) // any bytes left in the buffer?
{
MORK_MEMCPY(sink, at, quantum); // from buffer bytes
at += quantum; // advance past read bytes
mStream_At = at;
outActual += quantum; // this much copied so far
sink += quantum; // in case we need to copy more
inSize -= quantum; // filled this much of request
mStream_HitEof = morkBool_kFalse;
}
if ( inSize ) // we still need to read more content?
{
// We need to read more bytes directly from the
// content file, without local buffering. We have
// exhausted the local buffer, so we need to show
// it is now empty, and adjust the current buf pos.
mork_num posDelta = (at - buf); // old buf content
mStream_BufPos += posDelta; // past now empty buf
mStream_At = mStream_ReadEnd = buf; // empty buffer
file->Seek(ev, mStream_BufPos); // set file pos
if ( ev->Good() ) // no seek error?
{
mork_num actual = file->Read(ev, sink, inSize);
if ( ev->Good() ) // no read error?
{
if ( actual )
{
outActual += actual;
mStream_BufPos += actual;
mStream_HitEof = morkBool_kFalse;
}
else if ( !outActual )
mStream_HitEof = morkBool_kTrue;
}
}
}
}
else this->NewBadCursorOrderError(ev);
}
else this->NewNullStreamBufferError(ev);
}
}
else this->NewCantReadSinkError(ev);
}
else this->NewFileDownError(ev);
if ( ev->Bad() )
outActual = 0;
return outActual;
}
/*public virtual*/ mork_pos
morkStream::Seek(morkEnv* ev, mork_pos inPos)
{
mork_pos outPos = 0;
morkFile* file = mStream_ContentFile;
if ( this->IsOpenOrClosingNode() && this->FileActive() && file )
{
mork_u1* at = mStream_At; // current position in buffer
mork_u1* buf = mStream_Buf; // beginning of buffer
mork_u1* readEnd = mStream_ReadEnd; // nonzero only if readonly
mork_u1* writeEnd = mStream_WriteEnd; // nonzero only if writeonly
if ( writeEnd ) // file is mutable/writeonly?
{
if ( mStream_Dirty ) // need to commit buffer changes?
this->Flush(ev);
if ( ev->Good() ) // no errors during flush or earlier?
{
if ( at == buf ) // expected post flush cursor value?
{
if ( mStream_BufPos != inPos ) // need to change pos?
{
mork_pos eof = file->Length(ev);
if ( ev->Good() ) // no errors getting length?
{
if ( inPos <= eof ) // acceptable new position?
{
mStream_BufPos = inPos; // new stream position
outPos = inPos;
}
else this->NewPosBeyondEofError(ev);
}
}
}
else this->NewBadCursorOrderError(ev);
}
}
else if ( readEnd ) // file is frozen/readonly?
{
if ( at >= buf && at <= readEnd ) // expected cursor order?
{
mork_pos eof = file->Length(ev);
if ( ev->Good() ) // no errors getting length?
{
if ( inPos <= eof ) // acceptable new position?
{
outPos = inPos;
mStream_BufPos = inPos; // new stream position
mStream_At = mStream_ReadEnd = buf; // empty buffer
if ( inPos == eof ) // notice eof reached?
mStream_HitEof = morkBool_kTrue;
}
else this->NewPosBeyondEofError(ev);
}
}
else this->NewBadCursorOrderError(ev);
}
}
else this->NewFileDownError(ev);
return outPos;
}
/*public virtual*/ mork_size
morkStream::Write(morkEnv* ev, const void* inBuf, mork_size inSize)
{
mork_num outActual = 0;
morkFile* file = mStream_ContentFile;
if ( this->IsOpenActiveAndMutableFile() && file )
{
mork_u1* end = mStream_WriteEnd; // byte after last buffered byte
if ( end ) // file is open for write access?
{
if ( inSize ) // caller provided any input?
{
const mork_u1* source = (const mork_u1*) inBuf; // from where
if ( source ) // caller passed good buffer address?
{
mork_u1* at = mStream_At;
mork_u1* buf = mStream_Buf;
if ( at >= buf && at <= end ) // expected cursor order?
{
mork_num space = end - at; // space left in buffer
mork_num quantum = inSize; // number of bytes to write
if ( quantum > space ) // more than buffer size?
quantum = space; // restrict to avail space
if ( quantum ) // any space left in the buffer?
{
mStream_Dirty = morkBool_kTrue; // to ensure later flush
MORK_MEMCPY(at, source, quantum); // into buffer
mStream_At += quantum; // advance past written bytes
outActual += quantum; // this much written so far
source += quantum; // in case we need to write more
inSize -= quantum; // filled this much of request
}
if ( inSize ) // we still need to write more content?
{
// We need to write more bytes directly to the
// content file, without local buffering. We have
// exhausted the local buffer, so we need to flush
// it and empty it, and adjust the current buf pos.
// After flushing, if the rest of the write fits
// inside the buffer, we will put bytes into the
// buffer rather than write them to content file.
if ( mStream_Dirty )
this->Flush(ev); // will update mStream_BufPos
at = mStream_At;
if ( at < buf || at > end ) // bad cursor?
this->NewBadCursorOrderError(ev);
if ( ev->Good() ) // no errors?
{
space = end - at; // space left in buffer
if ( space > inSize ) // write to buffer?
{
mStream_Dirty = morkBool_kTrue; // ensure flush
MORK_MEMCPY(at, source, inSize); // copy
mStream_At += inSize; // past written bytes
outActual += inSize; // this much written
}
else // directly to content file instead
{
file->Seek(ev, mStream_BufPos); // set pos
if ( ev->Good() ) // no seek error?
{
mork_num actual =
file->Write(ev, source, inSize);
if ( ev->Good() ) // no write error?
{
outActual += actual;
mStream_BufPos += actual;
}
}
}
}
}
}
else this->NewBadCursorOrderError(ev);
}
else this->NewNullStreamBufferError(ev);
}
}
else this->NewCantWriteSourceError(ev);
}
else this->NewFileDownError(ev);
if ( ev->Bad() )
outActual = 0;
return outActual;
}
/*public virtual*/ void
morkStream::Flush(morkEnv* ev)
{
morkFile* file = mStream_ContentFile;
if ( this->IsOpenOrClosingNode() && this->FileActive() && file )
{
if ( mStream_Dirty )
this->spill_buf(ev);
file->Flush(ev);
}
else this->NewFileDownError(ev);
}
// ````` ````` ````` ````` ````` ````` ````` `````
// protected: // protected non-poly morkStream methods (for char io)
int
morkStream::fill_getc(morkEnv* ev)
{
int c = EOF;
morkFile* file = mStream_ContentFile;
if ( this->IsOpenAndActiveFile() && file )
{
mork_u1* buf = mStream_Buf;
mork_u1* end = mStream_ReadEnd; // beyond buf after earlier read
if ( end > buf ) // any earlier read bytes buffered?
{
mStream_BufPos += ( end - buf ); // advance past old read
}
if ( ev->Good() ) // no errors yet?
{
file->Seek(ev, mStream_BufPos); // set file pos
if ( ev->Good() ) // no seek error?
{
mork_num actual = file->Read(ev, buf, mStream_BufSize);
if ( ev->Good() ) // no read errors?
{
if ( actual > mStream_BufSize ) // more than asked for??
actual = mStream_BufSize;
mStream_At = buf;
mStream_ReadEnd = buf + actual;
if ( actual ) // any bytes actually read?
{
c = *mStream_At++; // return first byte from buffer
mStream_HitEof = morkBool_kFalse;
}
else
mStream_HitEof = morkBool_kTrue;
}
}
}
}
else this->NewFileDownError(ev);
return c;
}
void
morkStream::spill_putc(morkEnv* ev, int c)
{
this->spill_buf(ev);
if ( ev->Good() && mStream_At < mStream_WriteEnd )
this->Putc(ev, c);
}
void
morkStream::spill_buf(morkEnv* ev) // spill/flush from buffer to file
{
morkFile* file = mStream_ContentFile;
if ( this->IsOpenOrClosingNode() && this->FileActive() && file )
{
mork_u1* buf = mStream_Buf;
if ( mStream_Dirty )
{
mork_u1* at = mStream_At;
if ( at >= buf && at <= mStream_WriteEnd ) // order?
{
mork_num count = at - buf; // the number of bytes buffered
if ( count ) // anything to write to the string?
{
if ( count > mStream_BufSize ) // no more than max?
{
count = mStream_BufSize;
mStream_WriteEnd = buf + mStream_BufSize;
this->NewBadCursorSlotsError(ev);
}
if ( ev->Good() )
{
file->Seek(ev, mStream_BufPos);
if ( ev->Good() )
{
file->Write(ev, buf, count);
if ( ev->Good() )
{
mStream_BufPos += count; // past bytes written
mStream_At = buf; // reset buffer cursor
mStream_Dirty = morkBool_kFalse;
}
}
}
}
}
else this->NewBadCursorOrderError(ev);
}
else
{
#ifdef MORK_DEBUG
ev->NewWarning("stream:spill:not:dirty");
#endif /*MORK_DEBUG*/
}
}
else this->NewFileDownError(ev);
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,242 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKSTREAM_
#define _MORKSTREAM_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKFILE_
#include "morkFile.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/*=============================================================================
* morkStream: buffered file i/o
*/
/*| morkStream exists to define an morkFile subclass that provides buffered
**| i/o for an underlying content file. Naturally this arrangement only makes
**| sense when the underlying content file is itself not efficiently buffered
**| (especially for character by character i/o).
**|
**|| morkStream is intended for either reading use or writing use, but not
**| both simultaneously or interleaved. Pick one when the stream is created
**| and don't change your mind. This restriction is intended to avoid obscure
**| and complex bugs that might arise from interleaved reads and writes -- so
**| just don't do it. A stream is either a sink or a source, but not both.
**|
**|| (When the underlying content file is intended to support both reading and
**| writing, a developer might use two instances of morkStream where one is for
**| reading and the other is for writing. In this case, a developer must take
**| care to keep the two streams in sync because each will maintain a separate
**| buffer representing a cache consistency problem for the other. A simple
**| approach is to invalidate the buffer of one when one uses the other, with
**| the assumption that closely mixed reading and writing is not expected, so
**| that little cost is associated with changing read/write streaming modes.)
**|
**|| Exactly one of mStream_ReadEnd or mStream_WriteEnd must be a null pointer,
**| and this will cause the right thing to occur when inlines use them, because
**| mStream_At < mStream_WriteEnd (for example) will always be false and the
**| else branch of the statement calls a function that raises an appropriate
**| error to complain about either reading a sink or writing a source.
**|
**|| morkStream is a direct clone of ab_Stream from Communicator 4.5's
**| address book code, which in turn was based on the stream class in the
**| public domain Mithril programming language.
|*/
#define morkStream_kPrintBufSize /*i*/ 512 /* buffer size used by printf() */
#define morkStream_kMinBufSize /*i*/ 512 /* buffer no fewer bytes */
#define morkStream_kMaxBufSize /*i*/ (32 * 1024) /* buffer no more bytes */
#define morkDerived_kStream /*i*/ 0x7A74 /* ascii 'zt' */
class morkStream /*d*/ : public morkFile { /* from Mithril's AgStream class */
// ````` ````` ````` ````` ````` ````` ````` `````
protected: // protected morkStream members
mork_u1* mStream_At; // pointer into mStream_Buf
mork_u1* mStream_ReadEnd; // null or one byte past last readable byte
mork_u1* mStream_WriteEnd; // null or mStream_Buf + mStream_BufSize
morkFile* mStream_ContentFile; // where content is read and written
mork_u1* mStream_Buf; // dynamically allocated memory to buffer io
mork_size mStream_BufSize; // requested buf size (fixed by min and max)
mork_pos mStream_BufPos; // logical position of byte at mStream_Buf
mork_bool mStream_Dirty; // does the buffer need to be flushed?
mork_bool mStream_HitEof; // has eof been reached? (only frozen streams)
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseStream() only if open
virtual ~morkStream(); // assert that CloseStream() executed earlier
public: // morkStream construction & destruction
morkStream(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkFile* ioContentFile, mork_size inBufSize, mork_bool inFrozen);
void CloseStream(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkStream(const morkStream& other);
morkStream& operator=(const morkStream& other);
public: // dynamic type identification
mork_bool IsStream() const
{ return IsNode() && mNode_Derived == morkDerived_kStream; }
// } ===== end morkNode methods =====
public: // typing
void NonStreamTypeError(morkEnv* ev);
// ````` ````` ````` ````` ````` ````` ````` `````
public: // virtual morkFile methods
virtual void BecomeTrunk(morkEnv* ev);
// If this file is a file version branch created by calling AcquireBud(),
// BecomeTrunk() causes this file's content to replace the original
// file's content, typically by assuming the original file's identity.
virtual morkFile* AcquireBud(morkEnv* ev, nsIMdbHeap* ioHeap);
// AcquireBud() starts a new "branch" version of the file, empty of content,
// so that a new version of the file can be written. This new file
// can later be told to BecomeTrunk() the original file, so the branch
// created by budding the file will replace the original file. Some
// file subclasses might initially take the unsafe but expedient
// approach of simply truncating this file down to zero length, and
// then returning the same morkFile pointer as this, with an extra
// reference count increment. Note that the caller of AcquireBud() is
// expected to eventually call CutStrongRef() on the returned file
// in order to release the strong reference. High quality versions
// of morkFile subclasses will create entirely new files which later
// are renamed to become the old file, so that better transactional
// behavior is exhibited by the file, so crashes protect old files.
// Note that AcquireBud() is an illegal operation on readonly files.
virtual mork_pos Length(morkEnv* ev) const; // eof
virtual mork_pos Tell(morkEnv* ev) const;
virtual mork_size Read(morkEnv* ev, void* outBuf, mork_size inSize);
virtual mork_pos Seek(morkEnv* ev, mork_pos inPos);
virtual mork_size Write(morkEnv* ev, const void* inBuf, mork_size inSize);
virtual void Flush(morkEnv* ev);
// ````` ````` ````` ````` ````` ````` ````` `````
protected: // protected non-poly morkStream methods (for char io)
int fill_getc(morkEnv* ev);
void spill_putc(morkEnv* ev, int c);
void spill_buf(morkEnv* ev); // spill/flush from buffer to file
// ````` ````` ````` ````` ````` ````` ````` `````
public: // public non-poly morkStream methods
void NewBadCursorSlotsError(morkEnv* ev) const;
void NewBadCursorOrderError(morkEnv* ev) const;
void NewNullStreamBufferError(morkEnv* ev) const;
void NewCantReadSinkError(morkEnv* ev) const;
void NewCantWriteSourceError(morkEnv* ev) const;
void NewPosBeyondEofError(morkEnv* ev) const;
morkFile* GetStreamContentFile() const { return mStream_ContentFile; }
mork_size GetStreamBufferSize() const { return mStream_BufSize; }
mork_size PutIndent(morkEnv* ev, mork_count inDepth);
// PutIndent() puts a linebreak, and then
// "indents" by inDepth, and returns the line length after indentation.
mork_size PutByteThenIndent(morkEnv* ev, int inByte, mork_count inDepth);
// PutByteThenIndent() puts the byte, then a linebreak, and then
// "indents" by inDepth, and returns the line length after indentation.
mork_size PutStringThenIndent(morkEnv* ev,
const char* inString, mork_count inDepth);
// PutStringThenIndent() puts the string, then a linebreak, and then
// "indents" by inDepth, and returns the line length after indentation.
mork_size PutString(morkEnv* ev, const char* inString);
// PutString() returns the length of the string written.
mork_size PutStringThenNewline(morkEnv* ev, const char* inString);
// PutStringThenNewline() returns total number of bytes written.
mork_size PutStringThenNewlineThenSpace(morkEnv* ev, const char* inString);
// PutStringThenNewlineThenSpace() returns total number of bytes written.
mork_size PutByteThenNewline(morkEnv* ev, int inByte);
// PutByteThenNewline() returns total number of bytes written.
mork_size PutByteThenNewlineThenSpace(morkEnv* ev, int inByte);
// PutByteThenNewlineThenSpace() returns total number of bytes written.
// ````` ````` stdio type methods ````` `````
void Printf(morkEnv* ev, const char* inFormat, ...);
mork_pos Ftell(morkEnv* ev) /*i*/ { return this->Tell(ev); }
void Fsetpos(morkEnv* ev, mork_pos inPos) /*i*/ { this->Seek(ev, inPos); }
void Rewind(morkEnv* ev) /*i*/ { this->Fsetpos(ev, 0); }
void Fflush(morkEnv* ev) /*i*/ { this->Flush(ev); }
mork_bool Feof() /*i*/ { return mStream_HitEof; }
// Feof() is never true for writable stream output sinks
void Puts(morkEnv* ev, const char* inString) /*i*/
{ this->PutString(ev, inString); }
void Ungetc(int c) /*i*/
{ if ( mStream_At > mStream_Buf && c > 0 ) *--mStream_At = c; }
int Getc(morkEnv* ev) /*i*/
{ return ( mStream_At < mStream_ReadEnd )? *mStream_At++ : fill_getc(ev); }
void Putc(morkEnv* ev, int c) /*i*/
{
mStream_Dirty = morkBool_kTrue;
if ( mStream_At < mStream_WriteEnd )
*mStream_At++ = c;
else
spill_putc(ev, c);
}
mork_size PutLineBreak(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakStream(morkStream* me,
morkEnv* ev, morkStream** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongStream(morkStream* me,
morkEnv* ev, morkStream** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKSTREAM_ */

View File

@@ -0,0 +1,318 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKTABLE_
#include "morkTable.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _MORKROWSPACE_
#include "morkRowSpace.h"
#endif
#ifndef _MORKARRAY_
#include "morkArray.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
#ifndef _ORKINTABLE_
#include "orkinTable.h"
#endif
#ifndef _MORKTABLEROWCURSOR_
#include "morkTableRowCursor.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkTable::CloseMorkNode(morkEnv* ev) /*i*/ // CloseTable() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseTable(ev);
this->MarkShut();
}
}
/*public virtual*/
morkTable::~morkTable() /*i*/ // assert CloseTable() executed earlier
{
MORK_ASSERT(this->IsShutNode());
MORK_ASSERT(mTable_Store==0);
MORK_ASSERT(mTable_RowSpace==0);
}
/*public non-poly*/
morkTable::morkTable(morkEnv* ev, /*i*/
const morkUsage& inUsage, nsIMdbHeap* ioHeap,
morkStore* ioStore, nsIMdbHeap* ioSlotHeap, morkRowSpace* ioRowSpace,
mork_tid inTid, mork_kind inKind, mork_bool inMustBeUnique)
: morkObject(ev, inUsage, ioHeap, (morkHandle*) 0)
, mTable_Store( 0 )
, mTable_RowSpace( 0 )
, mTable_Id( inTid )
, mTable_RowMap(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioSlotHeap,
morkTable_kStartRowMapSlotCount)
, mTable_RowArray(ev, morkUsage::kMember, (nsIMdbHeap*) 0,
morkTable_kStartRowArraySize, ioSlotHeap)
, mTable_Kind( inKind )
, mTable_MustBeUnique( inMustBeUnique )
{
if ( ev->Good() )
{
if ( ioStore && ioSlotHeap && ioRowSpace )
{
if ( inKind )
{
morkStore::SlotWeakStore(ioStore, ev, &mTable_Store);
morkRowSpace::SlotWeakRowSpace(ioRowSpace, ev, &mTable_RowSpace);
if ( ev->Good() )
mNode_Derived = morkDerived_kTable;
}
else
ioRowSpace->ZeroKindError(ev);
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkTable::CloseTable(morkEnv* ev) /*i*/ // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
mTable_RowMap.CloseMorkNode(ev);
mTable_RowArray.CloseMorkNode(ev);
morkStore::SlotWeakStore((morkStore*) 0, ev, &mTable_Store);
morkRowSpace::SlotStrongRowSpace((morkRowSpace*) 0,
ev, &mTable_RowSpace);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkTable::NonTableTypeError(morkEnv* ev)
{
ev->NewError("non morkTable");
}
/*static*/ void
morkTable::NonTableTypeWarning(morkEnv* ev)
{
ev->NewWarning("non morkTable");
}
/*static*/ void
morkTable::NilRowSpaceError(morkEnv* ev)
{
ev->NewError("nil mTable_RowSpace");
}
void
morkTable::GetTableOid(morkEnv* ev, mdbOid* outOid)
{
morkRowSpace* space = mTable_RowSpace;
if ( space )
{
outOid->mOid_Scope = space->mSpace_Scope;
outOid->mOid_Id = mTable_Id;
}
else
this->NilRowSpaceError(ev);
}
nsIMdbTable*
morkTable::AcquireTableHandle(morkEnv* ev)
{
nsIMdbTable* outTable = 0;
orkinTable* t = (orkinTable*) mObject_Handle;
if ( t ) // have an old handle?
t->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
t = orkinTable::MakeTable(ev, this);
mObject_Handle = t;
}
if ( t )
outTable = t;
return outTable;
}
mork_pos
morkTable::ArrayHasOid(morkEnv* ev, const mdbOid* inOid)
{
mork_count count = mTable_RowArray.mArray_Fill;
mork_pos pos = -1;
while ( ++pos < count )
{
morkRow* row = (morkRow*) mTable_RowArray.At(pos);
MORK_ASSERT(row);
if ( row && row->EqualOid(inOid) )
{
return pos;
}
}
return -1;
}
mork_pos
morkTable::MapHasOid(morkEnv* ev, const mdbOid* inOid)
{
morkRow* row = mTable_RowMap.GetOid(ev, inOid);
if ( row )
return 1;
return -1;
}
mork_bool
morkTable::AddRow(morkEnv* ev, morkRow* ioRow)
{
morkRow* row = mTable_RowMap.GetRow(ev, ioRow);
if ( !row && ev->Good() )
{
mork_pos pos = mTable_RowArray.AppendSlot(ev, ioRow);
if ( ev->Good() && pos > 0 )
{
ioRow->AddTableUse(ev);
if ( mTable_RowMap.AddRow(ev, ioRow) )
{
// okay, anything else?
}
else
mTable_RowArray.CutSlot(ev, pos);
}
}
return ev->Good();
}
mork_bool
morkTable::CutRow(morkEnv* ev, morkRow* ioRow)
{
morkRow* row = mTable_RowMap.GetRow(ev, ioRow);
if ( row )
{
mork_count count = mTable_RowArray.mArray_Fill;
morkRow** rowSlots = (morkRow**) mTable_RowArray.mArray_Slots;
if ( rowSlots ) // array has vector as expected?
{
mork_pos pos = -1;
morkRow** end = rowSlots + count;
morkRow** slot = rowSlots - 1; // prepare for preincrement:
while ( ++slot < end ) // another slot to check?
{
if ( *slot == row ) // found the slot containing row?
{
pos = slot - rowSlots; // record absolute position
break; // end while loop
}
}
if ( pos >= 0 ) // need to cut if from the array?
mTable_RowArray.CutSlot(ev, pos);
else
ev->NewWarning("row not found in array");
}
else
mTable_RowArray.NilSlotsAddressError(ev);
mTable_RowMap.CutRow(ev, ioRow);
if ( ioRow->CutTableUse(ev) == 0 )
ioRow->OnZeroTableUse(ev);
}
return ev->Good();
}
morkTableRowCursor*
morkTable::NewTableRowCursor(morkEnv* ev, mork_pos inRowPos)
{
morkTableRowCursor* outCursor = 0;
if ( ev->Good() )
{
nsIMdbHeap* heap = mTable_Store->mPort_Heap;
morkTableRowCursor* cursor = new(*heap, ev)
morkTableRowCursor(ev, morkUsage::kHeap, heap, this, inRowPos);
if ( cursor )
{
if ( ev->Good() )
outCursor = cursor;
else
cursor->CutStrongRef(ev);
}
}
return outCursor;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
morkTableMap::~morkTableMap()
{
}
morkTableMap::morkTableMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap)
: morkNodeMap(ev, inUsage, ioHeap, ioSlotHeap)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kTableMap;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,207 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKTABLE_
#define _MORKTABLE_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
#ifndef _MORKARRAY_
#include "morkArray.h"
#endif
#ifndef _MORKROWMAP_
#include "morkRowMap.h"
#endif
#ifndef _MORKNODEMAP_
#include "morkNodeMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class nsIMdbTable;
#define morkDerived_kTable /*i*/ 0x5462 /* ascii 'Tb' */
#define morkTable_kStartRowArraySize 11 /* modest starting size for array */
#define morkTable_kStartRowMapSlotCount 128
class morkTable : public morkObject {
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkHandle* mObject_Handle; // weak ref to handle for this object
public: // state is public because the entire Mork system is private
morkStore* mTable_Store; // weak ref to port
// mork_seed mTable_Seed; // use TableSeed() instead
// mTable_RowSpace->mSpace_Scope is row scope
morkRowSpace* mTable_RowSpace; // weak ref to containing space
morkRowMap mTable_RowMap; // hash table of all members
morkArray mTable_RowArray; // array of morkRow pointers
mork_tid mTable_Id;
mork_kind mTable_Kind;
mork_bool mTable_MustBeUnique;
mork_u1 mTable_Pad[ 3 ]; // padding to u4 alignment
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseTable() if open
virtual ~morkTable(); // assert that close executed earlier
public: // morkTable construction & destruction
morkTable(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioNodeHeap, morkStore* ioStore,
nsIMdbHeap* ioSlotHeap, morkRowSpace* ioRowSpace,
mork_tid inTableId,
mork_kind inKind, mork_bool inMustBeUnique);
void CloseTable(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkTable(const morkTable& other);
morkTable& operator=(const morkTable& other);
public: // dynamic type identification
mork_bool IsTable() const
{ return IsNode() && mNode_Derived == morkDerived_kTable; }
// } ===== end morkNode methods =====
public: // typing
static void NonTableTypeError(morkEnv* ev);
static void NonTableTypeWarning(morkEnv* ev);
static void NilRowSpaceError(morkEnv* ev);
public: // other table methods
// void DirtyAllTableContent(morkEnv* ev);
mork_seed TableSeed() const { return mTable_RowArray.mArray_Seed; }
nsIMdbTable* AcquireTableHandle(morkEnv* ev); // mObject_Handle
mork_count GetRowCount() const { return mTable_RowArray.mArray_Fill; }
void GetTableOid(morkEnv* ev, mdbOid* outOid);
mork_pos ArrayHasOid(morkEnv* ev, const mdbOid* inOid);
mork_pos MapHasOid(morkEnv* ev, const mdbOid* inOid);
mork_bool AddRow(morkEnv* ev, morkRow* ioRow); // returns ev->Good()
mork_bool CutRow(morkEnv* ev, morkRow* ioRow); // returns ev->Good()
morkTableRowCursor* NewTableRowCursor(morkEnv* ev, mork_pos inRowPos);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakTable(morkTable* me,
morkEnv* ev, morkTable** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongTableS(morkTable* me,
morkEnv* ev, morkTable** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kTableMap /*i*/ 0x744D /* ascii 'tM' */
/*| morkTableMap: maps mork_token -> morkTable
|*/
class morkTableMap : public morkNodeMap { // for mapping tokens to tables
public:
virtual ~morkTableMap();
morkTableMap(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap);
public: // other map methods
mork_bool AddTable(morkEnv* ev, morkTable* ioTable)
{ return this->AddNode(ev, ioTable->mTable_Id, ioTable); }
// the AddTable() boolean return equals ev->Good().
mork_bool CutTable(morkEnv* ev, mork_tid inTid)
{ return this->CutNode(ev, inTid); }
// The CutTable() boolean return indicates whether removal happened.
morkTable* GetTable(morkEnv* ev, mork_tid inTid)
{ return (morkTable*) this->GetNode(ev, inTid); }
// Note the returned table does NOT have an increase in refcount for this.
mork_num CutAllTables(morkEnv* ev)
{ return this->CutAllNodes(ev); }
// CutAllTables() releases all the referenced table values.
};
class morkTableMapIter: public morkMapIter{ // typesafe wrapper class
public:
morkTableMapIter(morkEnv* ev, morkTableMap* ioMap)
: morkMapIter(ev, ioMap) { }
morkTableMapIter( ) : morkMapIter() { }
void InitTableMapIter(morkEnv* ev, morkTableMap* ioMap)
{ this->InitMapIter(ev, ioMap); }
mork_change*
FirstTable(morkEnv* ev, mork_tid* outTid, morkTable** outTable)
{ return this->First(ev, outTid, outTable); }
mork_change*
NextTable(morkEnv* ev, mork_tid* outTid, morkTable** outTable)
{ return this->Next(ev, outTid, outTable); }
mork_change*
HereTable(morkEnv* ev, mork_tid* outTid, morkTable** outTable)
{ return this->Here(ev, outTid, outTable); }
mork_change*
CutHereTable(morkEnv* ev, mork_tid* outTid, morkTable** outTable)
{ return this->CutHere(ev, outTid, outTable); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKTABLE_ */

View File

@@ -0,0 +1,208 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKCURSOR_
#include "morkCursor.h"
#endif
#ifndef _MORKTABLEROWCURSOR_
#include "morkTableRowCursor.h"
#endif
#ifndef _ORKINTABLEROWCURSOR_
#include "orkinTableRowCursor.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _MORKTABLE_
#include "morkTable.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkTableRowCursor::CloseMorkNode(morkEnv* ev) // CloseTableRowCursor() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseTableRowCursor(ev);
this->MarkShut();
}
}
/*public virtual*/
morkTableRowCursor::~morkTableRowCursor() // CloseTableRowCursor() executed earlier
{
MORK_ASSERT(this->IsShutNode());
}
/*public non-poly*/
morkTableRowCursor::morkTableRowCursor(morkEnv* ev,
const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkTable* ioTable, mork_pos inRowPos)
: morkCursor(ev, inUsage, ioHeap)
, mTableRowCursor_Table( 0 )
{
if ( ev->Good() )
{
if ( ioTable )
{
mCursor_Pos = inRowPos;
mCursor_Seed = ioTable->TableSeed();
morkTable::SlotWeakTable(ioTable, ev, &mTableRowCursor_Table);
if ( ev->Good() )
mNode_Derived = morkDerived_kTableRowCursor;
}
else
ev->NilPointerError();
}
}
/*public non-poly*/ void
morkTableRowCursor::CloseTableRowCursor(morkEnv* ev)
{
if ( this )
{
if ( this->IsNode() )
{
mCursor_Pos = -1;
mCursor_Seed = 0;
morkTable::SlotWeakTable((morkTable*) 0, ev, &mTableRowCursor_Table);
this->CloseCursor(ev);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkTableRowCursor::NonTableRowCursorTypeError(morkEnv* ev)
{
ev->NewError("non morkTableRowCursor");
}
orkinTableRowCursor*
morkTableRowCursor::AcquireTableRowCursorHandle(morkEnv* ev)
{
orkinTableRowCursor* outCursor = 0;
orkinTableRowCursor* c = (orkinTableRowCursor*) mObject_Handle;
if ( c ) // have an old handle?
c->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
c = orkinTableRowCursor::MakeTableRowCursor(ev, this);
mObject_Handle = c;
}
if ( c )
outCursor = c;
return outCursor;
}
mdb_pos
morkTableRowCursor::NextRowOid(morkEnv* ev, mdbOid* outOid)
{
mdb_pos outPos = -1;
(void) this->NextRow(ev, outOid, &outPos);
return outPos;
}
morkRow*
morkTableRowCursor::NextRow(morkEnv* ev, mdbOid* outOid, mdb_pos* outPos)
{
morkRow* outRow = 0;
mork_pos pos = -1;
morkTable* table = mTableRowCursor_Table;
if ( table )
{
if ( table->IsOpenNode() )
{
morkArray* array = &table->mTable_RowArray;
pos = mCursor_Pos;
if ( pos < 0 )
pos = 0;
else
++pos;
if ( pos < array->mArray_Fill )
{
mCursor_Pos = pos; // update for next time
morkRow* row = (morkRow*) array->At(pos);
if ( row )
{
if ( row->IsRow() )
{
outRow = row;
*outOid = row->mRow_Oid;
}
else
row->NonRowTypeError(ev);
}
else
ev->NilPointerError();
}
else
{
outOid->mOid_Scope = 0;
outOid->mOid_Id = morkId_kMinusOne;
}
}
else
table->NonOpenNodeError(ev);
}
else
ev->NilPointerError();
*outPos = pos;
return outRow;
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,103 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKTABLEROWCURSOR_
#define _MORKTABLEROWCURSOR_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKCURSOR_
#include "morkCursor.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
class orkinTableRowCursor;
#define morkDerived_kTableRowCursor /*i*/ 0x7243 /* ascii 'rC' */
class morkTableRowCursor : public morkCursor { // row iterator
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkFactory* mObject_Factory; // weak ref to suite factory
// mork_seed mCursor_Seed;
// mork_pos mCursor_Pos;
// mork_bool mCursor_DoFailOnSeedOutOfSync;
// mork_u1 mCursor_Pad[ 3 ]; // explicitly pad to u4 alignment
public: // state is public because the entire Mork system is private
morkTable* mTableRowCursor_Table; // weak ref to table
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseTableRowCursor()
virtual ~morkTableRowCursor(); // assert that close executed earlier
public: // morkTableRowCursor construction & destruction
morkTableRowCursor(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkTable* ioTable, mork_pos inRowPos);
void CloseTableRowCursor(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkTableRowCursor(const morkTableRowCursor& other);
morkTableRowCursor& operator=(const morkTableRowCursor& other);
public: // dynamic type identification
mork_bool IsTableRowCursor() const
{ return IsNode() && mNode_Derived == morkDerived_kTableRowCursor; }
// } ===== end morkNode methods =====
public: // typing
static void NonTableRowCursorTypeError(morkEnv* ev);
public: // other table row cursor methods
orkinTableRowCursor* AcquireTableRowCursorHandle(morkEnv* ev);
mdb_pos NextRowOid(morkEnv* ev, mdbOid* outOid);
morkRow* NextRow(morkEnv* ev, mdbOid* outOid, mdb_pos* outPos);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakTableRowCursor(morkTableRowCursor* me,
morkEnv* ev, morkTableRowCursor** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongTableRowCursor(morkTableRowCursor* me,
morkEnv* ev, morkTableRowCursor** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKTABLEROWCURSOR_ */

View File

@@ -0,0 +1,406 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKTHUMB_
#include "morkThumb.h"
#endif
#ifndef _ORKINTHUMB_
#include "orkinThumb.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
#ifndef _MORKFILE_
#include "morkFile.h"
#endif
#ifndef _MORKWRITER_
#include "morkWriter.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkThumb::CloseMorkNode(morkEnv* ev) // CloseThumb() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseThumb(ev);
this->MarkShut();
}
}
/*public virtual*/
morkThumb::~morkThumb() // assert CloseThumb() executed earlier
{
MORK_ASSERT(mThumb_Magic==0);
MORK_ASSERT(mThumb_Store==0);
MORK_ASSERT(mThumb_File==0);
}
/*public non-poly*/
morkThumb::morkThumb(morkEnv* ev,
const morkUsage& inUsage, nsIMdbHeap* ioHeap,
nsIMdbHeap* ioSlotHeap, mork_magic inMagic)
: morkObject(ev, inUsage, ioHeap, (morkHandle*) 0)
, mThumb_Magic( 0 )
, mThumb_Total( 0 )
, mThumb_Current( 0 )
, mThumb_Done( morkBool_kFalse )
, mThumb_Broken( morkBool_kFalse )
, mThumb_Seed( 0 )
, mThumb_Store( 0 )
, mThumb_File( 0 )
, mThumb_Writer( 0 )
, mThumb_SourcePort( 0 )
, mThumb_DoCollect( morkBool_kFalse )
{
if ( ev->Good() )
{
mThumb_Magic = inMagic;
mNode_Derived = morkDerived_kThumb;
}
}
/*public non-poly*/ void
morkThumb::CloseThumb(morkEnv* ev) // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
{
mThumb_Magic = 0;
morkWriter::SlotStrongWriter((morkWriter*) 0, ev, &mThumb_Writer);
morkFile::SlotStrongFile((morkFile*) 0, ev, &mThumb_File);
morkStore::SlotWeakStore((morkStore*) 0, ev, &mThumb_Store);
morkPort::SlotStrongPort((morkPort*) 0, ev, &mThumb_SourcePort);
this->MarkShut();
}
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void morkThumb::NonThumbTypeError(morkEnv* ev)
{
ev->NewError("non morkThumb");
}
/*static*/ void morkThumb::UnsupportedThumbMagicError(morkEnv* ev)
{
ev->NewError("unsupported mThumb_Magic");
}
/*static*/ void morkThumb::NilThumbStoreError(morkEnv* ev)
{
ev->NewError("nil mThumb_Store");
}
/*static*/ void morkThumb::NilThumbFileError(morkEnv* ev)
{
ev->NewError("nil mThumb_File");
}
/*static*/ void morkThumb::NilThumbWriterError(morkEnv* ev)
{
ev->NewError("nil mThumb_Writer");
}
/*static*/ void morkThumb::NilThumbSourcePortError(morkEnv* ev)
{
ev->NewError("nil mThumb_SourcePort");
}
nsIMdbThumb*
morkThumb::AcquireThumbHandle(morkEnv* ev)
{
nsIMdbThumb* outThumb = 0;
orkinThumb* t = (orkinThumb*) mObject_Handle;
if ( t ) // have an old handle?
t->AddStrongRef(ev->AsMdbEnv());
else // need new handle?
{
t = orkinThumb::MakeThumb(ev, this);
mObject_Handle = t;
}
if ( t )
outThumb = t;
return outThumb;
}
/*static*/ morkThumb*
morkThumb::Make_OpenFileStore(morkEnv* ev, nsIMdbHeap* ioHeap,
morkStore* ioStore)
{
morkThumb* outThumb = 0;
if ( ioHeap && ioStore )
{
outThumb = new(*ioHeap, ev)
morkThumb(ev, morkUsage::kHeap, ioHeap, ioHeap,
morkThumb_kMagic_OpenFileStore);
if ( outThumb )
{
morkStore::SlotWeakStore(ioStore, ev, &outThumb->mThumb_Store);
}
}
else
ev->NilPointerError();
return outThumb;
}
/*static*/ morkThumb*
morkThumb::Make_CompressCommit(morkEnv* ev,
nsIMdbHeap* ioHeap, morkStore* ioStore, mork_bool inDoCollect)
{
morkThumb* outThumb = 0;
if ( ioHeap && ioStore )
{
morkFile* file = ioStore->mStore_File;
if ( file )
{
outThumb = new(*ioHeap, ev)
morkThumb(ev, morkUsage::kHeap, ioHeap, ioHeap,
morkThumb_kMagic_CompressCommit);
if ( outThumb )
{
morkWriter* writer = new(*ioHeap, ev)
morkWriter(ev, morkUsage::kHeap, ioHeap, ioStore, file, ioHeap);
if ( writer )
{
writer->mWriter_NeedDirtyAll = morkBool_kTrue;
outThumb->mThumb_DoCollect = inDoCollect;
morkStore::SlotWeakStore(ioStore, ev, &outThumb->mThumb_Store);
morkFile::SlotStrongFile(file, ev, &outThumb->mThumb_File);
morkWriter::SlotStrongWriter(writer, ev, &outThumb->mThumb_Writer);
}
}
}
else
ioStore->NilStoreFileError(ev);
}
else
ev->NilPointerError();
return outThumb;
}
// { ===== begin non-poly methods imitating nsIMdbThumb =====
void morkThumb::GetProgress(morkEnv* ev, mdb_count* outTotal,
mdb_count* outCurrent, mdb_bool* outDone, mdb_bool* outBroken)
{
if ( outTotal )
*outTotal = mThumb_Total;
if ( outCurrent )
*outCurrent = mThumb_Current;
if ( outDone )
*outDone = mThumb_Done;
if ( outBroken )
*outBroken = mThumb_Broken;
}
void morkThumb::DoMore(morkEnv* ev, mdb_count* outTotal,
mdb_count* outCurrent, mdb_bool* outDone, mdb_bool* outBroken)
{
if ( !mThumb_Done && !mThumb_Broken )
{
switch ( mThumb_Magic )
{
case morkThumb_kMagic_OpenFilePort: // 1 /* factory method */
this->DoMore_OpenFilePort(ev); break;
case morkThumb_kMagic_OpenFileStore: // 2 /* factory method */
this->DoMore_OpenFileStore(ev); break;
case morkThumb_kMagic_ExportToFormat: // 3 /* port method */
this->DoMore_ExportToFormat(ev); break;
case morkThumb_kMagic_ImportContent: // 4 /* store method */
this->DoMore_ImportContent(ev); break;
case morkThumb_kMagic_LargeCommit: // 5 /* store method */
this->DoMore_LargeCommit(ev); break;
case morkThumb_kMagic_SessionCommit: // 6 /* store method */
this->DoMore_SessionCommit(ev); break;
case morkThumb_kMagic_CompressCommit: // 7 /* store method */
this->DoMore_CompressCommit(ev); break;
case morkThumb_kMagic_SearchManyColumns: // 8 /* table method */
this->DoMore_SearchManyColumns(ev); break;
case morkThumb_kMagic_NewSortColumn: // 9 /* table metho) */
this->DoMore_NewSortColumn(ev); break;
case morkThumb_kMagic_NewSortColumnWithCompare: // 10 /* table method */
this->DoMore_NewSortColumnWithCompare(ev); break;
case morkThumb_kMagic_CloneSortColumn: // 11 /* table method */
this->DoMore_CloneSortColumn(ev); break;
case morkThumb_kMagic_AddIndex: // 12 /* table method */
this->DoMore_AddIndex(ev); break;
case morkThumb_kMagic_CutIndex: // 13 /* table method */
this->DoMore_CutIndex(ev); break;
default:
this->UnsupportedThumbMagicError(ev);
break;
}
}
if ( outTotal )
*outTotal = mThumb_Total;
if ( outCurrent )
*outCurrent = mThumb_Current;
if ( outDone )
*outDone = mThumb_Done;
if ( outBroken )
*outBroken = mThumb_Broken;
}
void morkThumb::CancelAndBreakThumb(morkEnv* ev)
{
mThumb_Broken = morkBool_kTrue;
}
// } ===== end non-poly methods imitating nsIMdbThumb =====
morkStore*
morkThumb::ThumbToOpenStore(morkEnv* ev)
// for orkinFactory::ThumbToOpenStore() after OpenFileStore()
{
return mThumb_Store;
}
void morkThumb::DoMore_OpenFilePort(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_OpenFileStore(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_ExportToFormat(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_ImportContent(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_LargeCommit(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_SessionCommit(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_CompressCommit(morkEnv* ev)
{
morkWriter* writer = mThumb_Writer;
if ( writer )
{
writer->WriteMore(ev);
mThumb_Total = writer->mWriter_TotalCount;
mThumb_Current = writer->mWriter_DoneCount;
mThumb_Done = ( ev->Bad() || writer->IsWritingDone() );
mThumb_Broken = ev->Bad();
}
else
{
this->NilThumbWriterError(ev);
mThumb_Broken = morkBool_kTrue;
mThumb_Done = morkBool_kTrue;
}
}
void morkThumb::DoMore_SearchManyColumns(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_NewSortColumn(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_NewSortColumnWithCompare(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_CloneSortColumn(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_AddIndex(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
void morkThumb::DoMore_CutIndex(morkEnv* ev)
{
this->UnsupportedThumbMagicError(ev);
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,176 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKTHUMB_
#define _MORKTHUMB_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKOBJECT_
#include "morkObject.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkThumb_kMagic_OpenFilePort 1 /* factory method */
#define morkThumb_kMagic_OpenFileStore 2 /* factory method */
#define morkThumb_kMagic_ExportToFormat 3 /* port method */
#define morkThumb_kMagic_ImportContent 4 /* store method */
#define morkThumb_kMagic_LargeCommit 5 /* store method */
#define morkThumb_kMagic_SessionCommit 6 /* store method */
#define morkThumb_kMagic_CompressCommit 7 /* store method */
#define morkThumb_kMagic_SearchManyColumns 8 /* table method */
#define morkThumb_kMagic_NewSortColumn 9 /* table metho) */
#define morkThumb_kMagic_NewSortColumnWithCompare 10 /* table method */
#define morkThumb_kMagic_CloneSortColumn 11 /* table method */
#define morkThumb_kMagic_AddIndex 12 /* table method */
#define morkThumb_kMagic_CutIndex 13 /* table method */
#define morkDerived_kThumb /*i*/ 0x5468 /* ascii 'Th' */
/*| morkThumb:
|*/
class morkThumb : public morkObject {
// public: // slots inherited from morkNode (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
// morkHandle* mObject_Handle; // weak ref to handle for this object
public: // state is public because the entire Mork system is private
// might as well include all the return values here:
mork_magic mThumb_Magic; // magic sig different in each thumb type
mork_count mThumb_Total;
mork_count mThumb_Current;
mork_bool mThumb_Done;
mork_bool mThumb_Broken;
mork_u2 mThumb_Seed; // optional seed for u4 alignment padding
morkStore* mThumb_Store; // weak ref to created store
morkFile* mThumb_File; // strong ref to file (store, import, export)
morkWriter* mThumb_Writer; // strong ref to writer (for commit)
morkPort* mThumb_SourcePort; // strong ref to port for import
mork_bool mThumb_DoCollect; // influence whether a collect happens
mork_bool mThumb_Pad[ 3 ]; // padding for u4 alignment
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseThumb() only if open
virtual ~morkThumb(); // assert that CloseThumb() executed earlier
public: // morkThumb construction & destruction
morkThumb(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap, mork_magic inMagic);
void CloseThumb(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkThumb(const morkThumb& other);
morkThumb& operator=(const morkThumb& other);
public: // dynamic type identification
mork_bool IsThumb() const
{ return IsNode() && mNode_Derived == morkDerived_kThumb; }
// } ===== end morkNode methods =====
public: // typing
static void NonThumbTypeError(morkEnv* ev);
static void UnsupportedThumbMagicError(morkEnv* ev);
static void NilThumbStoreError(morkEnv* ev);
static void NilThumbFileError(morkEnv* ev);
static void NilThumbWriterError(morkEnv* ev);
static void NilThumbSourcePortError(morkEnv* ev);
public: // 'do more' methods
void DoMore_OpenFilePort(morkEnv* ev);
void DoMore_OpenFileStore(morkEnv* ev);
void DoMore_ExportToFormat(morkEnv* ev);
void DoMore_ImportContent(morkEnv* ev);
void DoMore_LargeCommit(morkEnv* ev);
void DoMore_SessionCommit(morkEnv* ev);
void DoMore_CompressCommit(morkEnv* ev);
void DoMore_SearchManyColumns(morkEnv* ev);
void DoMore_NewSortColumn(morkEnv* ev);
void DoMore_NewSortColumnWithCompare(morkEnv* ev);
void DoMore_CloneSortColumn(morkEnv* ev);
void DoMore_AddIndex(morkEnv* ev);
void DoMore_CutIndex(morkEnv* ev);
public: // other thumb methods
nsIMdbThumb* AcquireThumbHandle(morkEnv* ev); // mObject_Handle
morkStore* ThumbToOpenStore(morkEnv* ev);
// for orkinFactory::ThumbToOpenStore() after OpenFileStore()
public: // assorted thumb constructors
static morkThumb* Make_OpenFileStore(morkEnv* ev,
nsIMdbHeap* ioHeap,morkStore* ioStore);
static morkThumb* Make_CompressCommit(morkEnv* ev,
nsIMdbHeap* ioHeap,morkStore* ioStore, mork_bool inDoCollect);
// { ===== begin non-poly methods imitating nsIMdbThumb =====
void GetProgress(morkEnv* ev, mdb_count* outTotal,
mdb_count* outCurrent, mdb_bool* outDone, mdb_bool* outBroken);
void DoMore(morkEnv* ev, mdb_count* outTotal,
mdb_count* outCurrent, mdb_bool* outDone, mdb_bool* outBroken);
void CancelAndBreakThumb(morkEnv* ev);
// } ===== end non-poly methods imitating nsIMdbThumb =====
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakThumb(morkThumb* me,
morkEnv* ev, morkThumb** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongThumb(morkThumb* me,
morkEnv* ev, morkThumb** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKTHUMB_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,297 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKWRITER_
#define _MORKWRITER_ 1
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKMAP_
#include "morkMap.h"
#endif
#ifndef _MORKROWMAP_
#include "morkRowMap.h"
#endif
#ifndef _MORKTABLE_
#include "morkTable.h"
#endif
#ifndef _MORKATOMMAP_
#include "morkAtomMap.h"
#endif
#ifndef _MORKATOMSPACE_
#include "morkAtomSpace.h"
#endif
#ifndef _MORKROWSPACE_
#include "morkRowSpace.h"
#endif
#ifndef _MORKSTREAM_
#include "morkStream.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkWriter_kStreamBufSize /*i*/ (16) /* buffer size for stream */
#define morkDerived_kWriter /*i*/ 0x5772 /* ascii 'Wr' */
#define morkWriter_kPhaseNothingDone 0 /* nothing has yet been done */
#define morkWriter_kPhaseDirtyAllDone 1 /* DirtyAll() is done */
#define morkWriter_kPhasePutHeaderDone 2 /* PutHeader() is done */
#define morkWriter_kPhaseRenumberAllDone 3 /* RenumberAll() is done */
#define morkWriter_kPhaseStoreAtomSpaces 4 /*mWriter_StoreAtomSpacesIter*/
#define morkWriter_kPhaseAtomSpaceAtomAids 5 /*mWriter_AtomSpaceAtomAidsIter*/
#define morkWriter_kPhaseStoreRowSpacesTables 6 /*mWriter_StoreRowSpacesIter*/
#define morkWriter_kPhaseRowSpaceTables 7 /*mWriter_RowSpaceTablesIter*/
#define morkWriter_kPhaseTableRowArray 8 /*mWriter_TableRowArrayPos */
#define morkWriter_kPhaseStoreRowSpacesRows 9 /*mWriter_StoreRowSpacesIter*/
#define morkWriter_kPhaseRowSpaceRows 10 /*mWriter_RowSpaceRowsIter*/
#define morkWriter_kPhaseContentDone 11 /* all content written */
#define morkWriter_kPhaseWritingDone 12 /* everthing has been done */
#define morkWriter_kCountNumberOfPhases 13 /* part of mWrite_TotalCount */
#define morkWriter_kMaxColumnNameSize 128 /* longest writable col name */
#define morkWriter_kMaxIndent 48 /* default value for mWriter_MaxIndent */
#define morkWriter_kTableMetaCellDepth 4 /* */
#define morkWriter_kTableMetaCellValueDepth 6 /* */
#define morkWriter_kDictMetaCellDepth 4 /* */
#define morkWriter_kDictMetaCellValueDepth 6 /* */
#define morkWriter_kDictAliasDepth 2 /* */
#define morkWriter_kDictAliasValueDepth 4 /* */
#define morkWriter_kRowDepth 2 /* */
#define morkWriter_kRowCellDepth 4 /* */
#define morkWriter_kRowCellValueDepth 6 /* */
class morkWriter : public morkNode { // row iterator
// public: // slots inherited from morkObject (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
public: // state is public because the entire Mork system is private
morkStore* mWriter_Store; // weak ref to committing store
morkFile* mWriter_File; // strong ref to store's file
morkFile* mWriter_Bud; // strong ref to bud of mWriter_File
morkStream* mWriter_Stream; // strong ref to stream on bud file
nsIMdbHeap* mWriter_SlotHeap; // strong ref to slot heap
mork_count mWriter_TotalCount; // count of all things to be written
mork_count mWriter_DoneCount; // count of things already written
mork_size mWriter_LineSize; // length of current line being written
mork_size mWriter_MaxIndent; // line size forcing a line break
mork_cscode mWriter_TableCharset; // current charset metainfo
mork_scope mWriter_TableAtomScope; // current atom scope
mork_scope mWriter_TableRowScope; // current row scope
mork_scope mWriter_TableTableScope; // current table scope
mork_scope mWriter_TableColumnScope; // current column scope
mork_kind mWriter_TableKind; // current table kind
mork_cscode mWriter_RowCharset; // current charset metainfo
mork_scope mWriter_RowAtomScope; // current atom scope
mork_scope mWriter_RowScope; // current row scope
mork_cscode mWriter_DictCharset; // current charset metainfo
mork_scope mWriter_DictAtomScope; // current atom scope
mork_bool mWriter_NeedDirtyAll; // need to call DirtyAll()
mork_u1 mWriter_Phase; // status of writing process
mork_bool mWriter_DidStartDict; // true when a dict has been started
mork_bool mWriter_DidEndDict; // true when a dict has been ended
mork_pos mWriter_TableRowArrayPos; // index into mTable_RowArray
char mWriter_SafeNameBuf[ (morkWriter_kMaxColumnNameSize * 2) + 4 ];
// Note: extra four bytes in ColNameBuf means we can always append to yarn
char mWriter_ColNameBuf[ morkWriter_kMaxColumnNameSize + 4 ];
// Note: extra four bytes in ColNameBuf means we can always append to yarn
mdbYarn mWriter_ColYarn; // a yarn to describe space in ColNameBuf:
// mYarn_Buf == mWriter_ColNameBuf, mYarn_Size == morkWriter_kMaxColumnNameSize
mdbYarn mWriter_SafeYarn; // a yarn to describe space in ColNameBuf:
// mYarn_Buf == mWriter_SafeNameBuf, mYarn_Size == (kMaxColumnNameSize * 2)
morkAtomSpaceMapIter mWriter_StoreAtomSpacesIter; // for mStore_AtomSpaces
morkAtomAidMapIter mWriter_AtomSpaceAtomAidsIter; // for AtomSpace_AtomAids
morkRowSpaceMapIter mWriter_StoreRowSpacesIter; // for mStore_RowSpaces
morkTableMapIter mWriter_RowSpaceTablesIter; // for mRowSpace_Tables
morkRowMapIter mWriter_RowSpaceRowsIter; // for mRowSpace_Rows
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseWriter()
virtual ~morkWriter(); // assert that close executed earlier
public: // morkWriter construction & destruction
morkWriter(morkEnv* ev, const morkUsage& inUsage,
nsIMdbHeap* ioHeap, morkStore* ioStore, morkFile* ioFile,
nsIMdbHeap* ioSlotHeap);
void CloseWriter(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkWriter(const morkWriter& other);
morkWriter& operator=(const morkWriter& other);
public: // dynamic type identification
mork_bool IsWriter() const
{ return IsNode() && mNode_Derived == morkDerived_kWriter; }
// } ===== end morkNode methods =====
public: // typing & errors
static void NonWriterTypeError(morkEnv* ev);
static void NilWriterStoreError(morkEnv* ev);
static void NilWriterBudError(morkEnv* ev);
static void NilWriterStreamError(morkEnv* ev);
static void UnsupportedPhaseError(morkEnv* ev);
public: // inlines
mork_bool DidStartDict() const { return mWriter_DidStartDict; }
mork_bool DidEndDict() const { return mWriter_DidEndDict; }
mork_bool NeedLineBreak() const
{ return ( mWriter_LineSize > mWriter_MaxIndent ); }
void IndentAsNeeded(morkEnv* ev, mork_size inDepth)
{
if ( mWriter_LineSize > mWriter_MaxIndent )
mWriter_LineSize = mWriter_Stream->PutIndent(ev, inDepth);
}
public: // iterative/asynchronouse writing
mork_bool WriteMore(morkEnv* ev); // call until IsWritingDone() is true
mork_bool IsWritingDone() const // don't call WriteMore() any longer?
{ return mWriter_Phase == morkWriter_kPhaseWritingDone; }
public: // marking all content dirty
mork_bool DirtyAll(morkEnv* ev);
// DirtyAll() visits every store sub-object and marks
// them dirty, including every table, row, cell, and atom. The return
// equals ev->Good(), to show whether any error happened. This method is
// intended for use in the beginning of a "compress commit" which writes
// all store content, whether dirty or not. We dirty everything first so
// that later iterations over content can mark things clean as they are
// written, and organize the process of serialization so that objects are
// written only at need (because of being dirty). Note the method can
// stop early when any error happens, since this will abort any commit.
public: // phase methods
mork_bool OnNothingDone(morkEnv* ev);
mork_bool OnDirtyAllDone(morkEnv* ev);
mork_bool OnPutHeaderDone(morkEnv* ev);
mork_bool OnRenumberAllDone(morkEnv* ev);
mork_bool OnStoreAtomSpaces(morkEnv* ev);
mork_bool OnAtomSpaceAtomAids(morkEnv* ev);
mork_bool OnStoreRowSpacesTables(morkEnv* ev);
mork_bool OnRowSpaceTables(morkEnv* ev);
mork_bool OnTableRowArray(morkEnv* ev);
mork_bool OnStoreRowSpacesRows(morkEnv* ev);
mork_bool OnRowSpaceRows(morkEnv* ev);
mork_bool OnContentDone(morkEnv* ev);
mork_bool OnWritingDone(morkEnv* ev);
public: // writing dict items first pass
mork_bool PutTableDict(morkEnv* ev, morkTable* ioTable);
mork_bool PutRowDict(morkEnv* ev, morkRow* ioRow);
public: // writing node content second pass
mork_bool PutTable(morkEnv* ev, morkTable* ioTable);
mork_bool PutRow(morkEnv* ev, morkRow* ioRow);
mork_bool PutRowCells(morkEnv* ev, morkRow* ioRow);
public: // other writer methods
mork_size WriteYarn(morkEnv* ev, const mdbYarn* inYarn);
// return number of atom bytes written on the current line (which
// implies that escaped line breaks will make the size value smaller
// than the entire yarn's size, since only part goes on a last line).
mork_size WriteAtom(morkEnv* ev, const morkAtom* inAtom);
// return number of atom bytes written on the current line (which
// implies that escaped line breaks will make the size value smaller
// than the entire atom's size, since only part goes on a last line).
void WriteAllStoreTables(morkEnv* ev);
void WriteAtomSpaceAsDict(morkEnv* ev, morkAtomSpace* ioSpace);
void WriteTokenToTokenMetaCell(morkEnv* ev, mork_token inCol,
mork_token inValue);
void WriteStringToTokenDictCell(morkEnv* ev, const char* inCol,
mork_token inValue);
// Note inCol should begin with '(' and end with '=', with col in between.
void StartDict(morkEnv* ev);
void EndDict(morkEnv* ev);
void StartTable(morkEnv* ev, morkTable* ioTable);
void EndTable(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakWriter(morkWriter* me,
morkEnv* ev, morkWriter** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongWriter(morkWriter* me,
morkEnv* ev, morkWriter** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKTABLEROWCURSOR_ */

View File

@@ -0,0 +1,93 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKYARN_
#include "morkYarn.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====
/*public virtual*/ void
morkYarn::CloseMorkNode(morkEnv* ev) /*i*/ // CloseYarn() only if open
{
if ( this->IsOpenNode() )
{
this->MarkClosing();
this->CloseYarn(ev);
this->MarkShut();
}
}
/*public virtual*/
morkYarn::~morkYarn() /*i*/ // assert CloseYarn() executed earlier
{
MORK_ASSERT(mYarn_Body.mYarn_Buf==0);
}
/*public non-poly*/
morkYarn::morkYarn(morkEnv* ev, /*i*/
const morkUsage& inUsage, nsIMdbHeap* ioHeap)
: morkNode(ev, inUsage, ioHeap)
{
if ( ev->Good() )
mNode_Derived = morkDerived_kYarn;
}
/*public non-poly*/ void
morkYarn::CloseYarn(morkEnv* ev) /*i*/ // called by CloseMorkNode();
{
if ( this )
{
if ( this->IsNode() )
this->MarkShut();
else
this->NonNodeError(ev);
}
else
ev->NilPointerError();
}
// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````
/*static*/ void
morkYarn::NonYarnTypeError(morkEnv* ev)
{
ev->NewError("non morkYarn");
}
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,88 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MORKYARN_
#define _MORKYARN_ 1
#ifndef _MORK_
#include "mork.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkDerived_kYarn /*i*/ 0x7952 /* ascii 'yR' */
/*| morkYarn: a reference counted nsIMdbYarn C struct. This is for use in those
**| few cases where single instances of reference counted buffers are needed
**| in Mork, and we expect few enough instances that overhead is not a factor
**| in decided whether to use such a thing.
|*/
class morkYarn : public morkNode { // refcounted yarn
// public: // slots inherited from morkNode (meant to inform only)
// nsIMdbHeap* mNode_Heap;
// mork_base mNode_Base; // must equal morkBase_kNode
// mork_derived mNode_Derived; // depends on specific node subclass
// mork_access mNode_Access; // kOpen, kClosing, kShut, or kDead
// mork_usage mNode_Usage; // kHeap, kStack, kMember, kGlobal, kNone
// mork_able mNode_Mutable; // can this node be modified?
// mork_load mNode_Load; // is this node clean or dirty?
// mork_uses mNode_Uses; // refcount for strong refs
// mork_refs mNode_Refs; // refcount for strong refs + weak refs
public: // state is public because the entire Mork system is private
mdbYarn mYarn_Body;
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
virtual void CloseMorkNode(morkEnv* ev); // CloseYarn() only if open
virtual ~morkYarn(); // assert that CloseYarn() executed earlier
public: // morkYarn construction & destruction
morkYarn(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap);
void CloseYarn(morkEnv* ev); // called by CloseMorkNode();
private: // copying is not allowed
morkYarn(const morkYarn& other);
morkYarn& operator=(const morkYarn& other);
public: // dynamic type identification
mork_bool IsYarn() const
{ return IsNode() && mNode_Derived == morkDerived_kYarn; }
// } ===== end morkNode methods =====
public: // typing
static void NonYarnTypeError(morkEnv* ev);
public: // typesafe refcounting inlines calling inherited morkNode methods
static void SlotWeakYarn(morkYarn* me,
morkEnv* ev, morkYarn** ioSlot)
{ morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
static void SlotStrongYarn(morkYarn* me,
morkEnv* ev, morkYarn** ioSlot)
{ morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _MORKYARN_ */

View File

@@ -0,0 +1,673 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKHANDLE_
#include "morkHandle.h"
#endif
#ifndef _MORKCELL_
#include "morkCell.h"
#endif
#ifndef _MORKCELLOBJECT_
#include "morkCellObject.h"
#endif
#ifndef _MORKROWOBJECT_
#include "morkRowObject.h"
#endif
#ifndef _ORKINCELL_
#include "orkinCell.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _MORKPOOL_
#include "morkPool.h"
#endif
#ifndef _MORKROW_
#include "morkRow.h"
#endif
#ifndef _MORKATOM_
#include "morkAtom.h"
#endif
#ifndef _MORKSPACE_
#include "morkSpace.h"
#endif
#ifndef _MORKROWSPACE_
#include "morkRowSpace.h"
#endif
#ifndef _MORKSTORE_
#include "morkStore.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/* public virtual*/
orkinCell:: ~orkinCell() // morkHandle destructor does everything
{
}
/*protected non-poly construction*/
orkinCell::orkinCell(morkEnv* ev, // morkUsage is morkUsage_kPool
morkHandleFace* ioFace, // must not be nil, cookie for this handle
morkCellObject* ioObject) // must not be nil, the object for this handle
: morkHandle(ev, ioFace, ioObject, morkMagic_kCell)
{
// do not modify mNode_Derived; leave it equal to morkDerived_kHandle
}
/*static */ orkinCell*
orkinCell::MakeCell(morkEnv* ev, morkCellObject* ioObject)
{
mork_bool isEnv = ev->IsEnv();
MORK_ASSERT(isEnv);
if ( isEnv )
{
morkHandleFace* face = ev->NewHandle(sizeof(orkinCell));
if ( face )
return new(face) orkinCell(ev, face, ioObject);
else
ev->OutOfMemoryError();
}
return (orkinCell*) 0;
}
// ResyncWithRow() moved to the morkCellObject class:
// mork_bool
// orkinCell::ResyncWithRow(morkEnv* ev)
// {
// morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
// morkRow* row = cellObj->mCellObject_Row;
// mork_pos pos = 0;
// morkCell* cell = row->GetCell(ev, cellObj->mCellObject_Col, &pos);
// if ( cell )
// {
// cellObj->mCellObject_Pos = pos;
// cellObj->mCellObject_Cell = cell;
// cellObj->mCellObject_RowSeed = row->mRow_Seed;
// }
// else
// {
// cellObj->mCellObject_Cell = 0;
// cellObj->MissingRowColumnError(ev);
// }
// return ev->Good();
// }
morkEnv*
orkinCell::CanUseCell(nsIMdbEnv* mev, mork_bool inMutable,
mdb_err* outErr, morkCell** outCell) const
{
morkEnv* outEnv = 0;
morkCell* cell = 0;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*)
this->GetGoodHandleObject(ev, inMutable, morkMagic_kCell);
if ( cellObj )
{
if ( cellObj->IsCellObject() )
{
if ( cellObj->IsMutable() || !inMutable )
{
morkRowObject* rowObj = cellObj->mCellObject_RowObject;
if ( rowObj )
{
morkRow* row = cellObj->mCellObject_Row;
if ( row )
{
if ( rowObj->mRowObject_Row == row )
{
mork_u2 oldSeed = cellObj->mCellObject_RowSeed;
if ( row->mRow_Seed == oldSeed || cellObj->ResyncWithRow(ev) )
{
cell = cellObj->mCellObject_Cell;
if ( cell )
{
outEnv = ev;
}
else
cellObj->NilCellError(ev);
}
}
else
cellObj->WrongRowObjectRowError(ev);
}
else
cellObj->NilRowError(ev);
}
else
cellObj->NilRowObjectError(ev);
}
else
cellObj->NonMutableNodeError(ev);
}
else
cellObj->NonCellObjectTypeError(ev);
}
*outErr = ev->AsErr();
}
MORK_ASSERT(outEnv);
*outCell = cell;
return outEnv;
}
// { ===== begin nsIMdbISupports methods =====
/*virtual*/ mdb_err
orkinCell::AddRef() // add strong ref with no
{
morkEnv* ev = mHandle_Env;
if ( ev && ev->IsEnv() )
return this->Handle_AddStrongRef(ev->AsMdbEnv());
else
return morkEnv_kNonEnvTypeError;
}
/*virtual*/ mdb_err
orkinCell::Release() // cut strong ref
{
morkEnv* ev = mHandle_Env;
if ( ev && ev->IsEnv() )
return this->Handle_CutStrongRef(ev->AsMdbEnv());
else
return morkEnv_kNonEnvTypeError;
}
// } ===== end nsIMdbISupports methods =====
// { ===== begin nsIMdbObject methods =====
// { ----- begin attribute methods -----
/*virtual*/ mdb_err
orkinCell::IsFrozenMdbObject(nsIMdbEnv* mev, mdb_bool* outIsReadonly)
{
return this->Handle_IsFrozenMdbObject(mev, outIsReadonly);
}
// same as nsIMdbPort::GetIsPortReadonly() when this object is inside a port.
// } ----- end attribute methods -----
// { ----- begin factory methods -----
/*virtual*/ mdb_err
orkinCell::GetMdbFactory(nsIMdbEnv* mev, nsIMdbFactory** acqFactory)
{
return this->Handle_GetMdbFactory(mev, acqFactory);
}
// } ----- end factory methods -----
// { ----- begin ref counting for well-behaved cyclic graphs -----
/*virtual*/ mdb_err
orkinCell::GetWeakRefCount(nsIMdbEnv* mev, // weak refs
mdb_count* outCount)
{
return this->Handle_GetWeakRefCount(mev, outCount);
}
/*virtual*/ mdb_err
orkinCell::GetStrongRefCount(nsIMdbEnv* mev, // strong refs
mdb_count* outCount)
{
return this->Handle_GetStrongRefCount(mev, outCount);
}
/*virtual*/ mdb_err
orkinCell::AddWeakRef(nsIMdbEnv* mev)
{
return this->Handle_AddWeakRef(mev);
}
/*virtual*/ mdb_err
orkinCell::AddStrongRef(nsIMdbEnv* mev)
{
return this->Handle_AddStrongRef(mev);
}
/*virtual*/ mdb_err
orkinCell::CutWeakRef(nsIMdbEnv* mev)
{
return this->Handle_CutWeakRef(mev);
}
/*virtual*/ mdb_err
orkinCell::CutStrongRef(nsIMdbEnv* mev)
{
return this->Handle_CutStrongRef(mev);
}
/*virtual*/ mdb_err
orkinCell::CloseMdbObject(nsIMdbEnv* mev)
{
return this->Handle_CloseMdbObject(mev);
}
/*virtual*/ mdb_err
orkinCell::IsOpenMdbObject(nsIMdbEnv* mev, mdb_bool* outOpen)
{
return this->Handle_IsOpenMdbObject(mev, outOpen);
}
// } ----- end ref counting -----
// } ===== end nsIMdbObject methods =====
// { ===== begin nsIMdbBlob methods =====
// { ----- begin attribute methods -----
/*virtual*/ mdb_err
orkinCell::SetBlob(nsIMdbEnv* mev,
nsIMdbBlob* ioBlob)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
} // reads inBlob slots
// when inBlob is in the same suite, this might be fastest cell-to-cell
/*virtual*/ mdb_err
orkinCell::ClearBlob( // make empty (so content has zero length)
nsIMdbEnv* mev)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
}
// clearing a yarn is like SetYarn() with empty yarn instance content
/*virtual*/ mdb_err
orkinCell::GetBlobFill(nsIMdbEnv* mev,
mdb_fill* outFill)
// Same value that would be put into mYarn_Fill, if one called GetYarn()
// with a yarn instance that had mYarn_Buf==nil and mYarn_Size==0.
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
} // size of blob
/*virtual*/ mdb_err
orkinCell::SetYarn(nsIMdbEnv* mev,
const mdbYarn* inYarn)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
morkRow* row = cellObj->mCellObject_Row;
if ( row )
{
morkStore* store = row->GetRowSpaceStore(ev);
if ( store )
cell->SetYarn(ev, inYarn, store);
}
else
ev->NilPointerError();
outErr = ev->AsErr();
}
return outErr;
} // reads from yarn slots
// make this text object contain content from the yarn's buffer
/*virtual*/ mdb_err
orkinCell::GetYarn(nsIMdbEnv* mev,
mdbYarn* outYarn)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkAtom* atom = cell->GetAtom();
atom->GetYarn(outYarn);
outErr = ev->AsErr();
}
return outErr;
} // writes some yarn slots
// copy content into the yarn buffer, and update mYarn_Fill and mYarn_Form
/*virtual*/ mdb_err
orkinCell::AliasYarn(nsIMdbEnv* mev,
mdbYarn* outYarn)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkAtom* atom = cell->GetAtom();
atom->AliasYarn(outYarn);
outErr = ev->AsErr();
}
return outErr;
} // writes ALL yarn slots
// } ----- end attribute methods -----
// } ===== end nsIMdbBlob methods =====
// { ===== begin nsIMdbCell methods =====
// { ----- begin attribute methods -----
/*virtual*/ mdb_err
orkinCell::SetColumn(nsIMdbEnv* mev, mdb_column inColumn)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
orkinCell::GetColumn(nsIMdbEnv* mev, mdb_column* outColumn)
{
mdb_err outErr = 0;
mdb_column col = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
col = cellObj->mCellObject_Col;
outErr = ev->AsErr();
}
if ( outColumn )
*outColumn = col;
return outErr;
}
/*virtual*/ mdb_err
orkinCell::GetCellInfo( // all cell metainfo except actual content
nsIMdbEnv* mev,
mdb_column* outColumn, // the column in the containing row
mdb_fill* outBlobFill, // the size of text content in bytes
mdbOid* outChildOid, // oid of possible row or table child
mdb_bool* outIsRowChild) // nonzero if child, and a row child
// Checking all cell metainfo is a good way to avoid forcing a large cell
// in to memory when you don't actually want to use the content.
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
orkinCell::GetRow(nsIMdbEnv* mev, // parent row for this cell
nsIMdbRow** acqRow)
{
mdb_err outErr = 0;
nsIMdbRow* outRow = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
morkRowObject* rowObj = cellObj->mCellObject_RowObject;
outRow = rowObj->AcquireRowHandle(ev);
outErr = ev->AsErr();
}
if ( acqRow )
*acqRow = outRow;
return outErr;
}
/*virtual*/ mdb_err
orkinCell::GetPort(nsIMdbEnv* mev, // port containing cell
nsIMdbPort** acqPort)
{
mdb_err outErr = 0;
nsIMdbPort* outPort = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
morkRow* row = cellObj->mCellObject_Row;
if ( row )
{
morkStore* store = row->GetRowSpaceStore(ev);
if ( store )
outPort = store->AcquireStoreHandle(ev);
}
else
ev->NilPointerError();
outErr = ev->AsErr();
}
if ( acqPort )
*acqPort = outPort;
return outErr;
}
// } ----- end attribute methods -----
// { ----- begin children methods -----
/*virtual*/ mdb_err
orkinCell::HasAnyChild( // does cell have a child instead of text?
nsIMdbEnv* mev,
mdbOid* outOid, // out id of row or table (or unbound if no child)
mdb_bool* outIsRow) // nonzero if child is a row (rather than a table)
{
mdb_err outErr = 0;
mdb_bool isRow = morkBool_kFalse;
outOid->mOid_Scope = 0;
outOid->mOid_Id = morkId_kMinusOne;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
morkAtom* atom = cellObj->GetCellAtom(ev);
if ( atom )
{
isRow = atom->IsRowOid();
if ( isRow || atom->IsTableOid() )
*outOid = ((morkOidAtom*) atom)->mOidAtom_Oid;
}
outErr = ev->AsErr();
}
if ( outIsRow )
*outIsRow = isRow;
return outErr;
}
/*virtual*/ mdb_err
orkinCell::GetAnyChild( // access table of specific attribute
nsIMdbEnv* mev, // context
nsIMdbRow** acqRow, // child row (or null)
nsIMdbTable** acqTable) // child table (or null)
{
mdb_err outErr = 0;
nsIMdbRow* outRow = 0;
nsIMdbTable* outTable = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
MORK_ASSERT(acqTable);
if ( acqTable )
*acqTable = outTable;
MORK_ASSERT(acqRow);
if ( acqRow )
*acqRow = outRow;
return outErr;
}
/*virtual*/ mdb_err
orkinCell::SetChildRow( // access table of specific attribute
nsIMdbEnv* mev, // context
nsIMdbRow* ioRow)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
} // inRow must be bound inside this same db port
/*virtual*/ mdb_err
orkinCell::GetChildRow( // access row of specific attribute
nsIMdbEnv* mev, // context
nsIMdbRow** acqRow) // acquire child row (or nil if no child)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
orkinCell::SetChildTable( // access table of specific attribute
nsIMdbEnv* mev, // context
nsIMdbTable* inTable) // table must be bound inside this same db port
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
}
/*virtual*/ mdb_err
orkinCell::GetChildTable( // access table of specific attribute
nsIMdbEnv* mev, // context
nsIMdbTable** acqTable) // acquire child tabdle (or nil if no chil)
{
mdb_err outErr = 0;
morkCell* cell = 0;
morkEnv* ev = this->CanUseCell(mev, /*inMutable*/ morkBool_kTrue,
&outErr, &cell);
if ( ev )
{
morkCellObject* cellObj = (morkCellObject*) mHandle_Object;
ev->StubMethodOnlyError();
outErr = ev->AsErr();
}
return outErr;
}
// } ----- end children methods -----
// } ===== end nsIMdbCell methods =====
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,253 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _ORKINCELL_
#define _ORKINCELL_ 1
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKHANDLE_
#include "morkHandle.h"
#endif
#ifndef _MORKCELL_
#include "morkCell.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkMagic_kCell 0x43656C6C /* ascii 'Cell' */
class orkinCell : public morkHandle, public nsIMdbCell { // nsIMdbBlob
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
// virtual void CloseMorkNode(morkEnv* ev); // morkHandle is fine
virtual ~orkinCell(); // morkHandle destructor does everything
protected: // construction is protected (use the static Make() method)
orkinCell(morkEnv* ev, // note morkUsage is always morkUsage_kPool
morkHandleFace* ioFace, // must not be nil, cookie for this handle
morkCellObject* ioObject); // must not be nil, the object for this handle
// void CloseHandle(morkEnv* ev); // don't need to specialize closing
private: // copying is not allowed
orkinCell(const morkHandle& other);
orkinCell& operator=(const morkHandle& other);
// public: // dynamic type identification
// mork_bool IsHandle() const //
// { return IsNode() && mNode_Derived == morkDerived_kHandle; }
// } ===== end morkNode methods =====
protected: // morkHandle memory management operators
void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev)
{ return ioPool.NewHandle(ev, inSize); }
void* operator new(size_t inSize, morkHandleFace* ioFace)
{ return ioFace; }
void operator delete(void* ioAddress)
{ morkNode::OnDeleteAssert(ioAddress); }
// do NOT call delete on morkHandle instances. They are collected.
public: // construction:
static orkinCell* MakeCell(morkEnv* ev, morkCellObject* ioObject);
public: // utilities:
// ResyncWithRow() moved to the morkCellObject class:
// mork_bool ResyncWithRow(morkEnv* ev); // return ev->Good()
morkEnv* CanUseCell(nsIMdbEnv* ev, mork_bool inMutable,
mdb_err* outErr, morkCell** outCell) const;
public: // type identification
mork_bool IsOrkinCell() const
{ return mHandle_Magic == morkMagic_kCell; }
mork_bool IsOrkinCellHandle() const
{ return this->IsHandle() && this->IsOrkinCell(); }
// { ===== begin nsIMdbISupports methods =====
virtual mdb_err AddRef(); // add strong ref with no
virtual mdb_err Release(); // cut strong ref
// } ===== end nsIMdbObject methods =====
// { ===== begin nsIMdbObject methods =====
// { ----- begin attribute methods -----
virtual mdb_err IsFrozenMdbObject(nsIMdbEnv* ev, mdb_bool* outIsReadonly);
// same as nsIMdbPort::GetIsPortReadonly() when this object is inside a port.
// } ----- end attribute methods -----
// { ----- begin factory methods -----
virtual mdb_err GetMdbFactory(nsIMdbEnv* ev, nsIMdbFactory** acqFactory);
// } ----- end factory methods -----
// { ----- begin ref counting for well-behaved cyclic graphs -----
virtual mdb_err GetWeakRefCount(nsIMdbEnv* ev, // weak refs
mdb_count* outCount);
virtual mdb_err GetStrongRefCount(nsIMdbEnv* ev, // strong refs
mdb_count* outCount);
virtual mdb_err AddWeakRef(nsIMdbEnv* ev);
virtual mdb_err AddStrongRef(nsIMdbEnv* ev);
virtual mdb_err CutWeakRef(nsIMdbEnv* ev);
virtual mdb_err CutStrongRef(nsIMdbEnv* ev);
virtual mdb_err CloseMdbObject(nsIMdbEnv* ev); // called at strong refs zero
virtual mdb_err IsOpenMdbObject(nsIMdbEnv* ev, mdb_bool* outOpen);
// } ----- end ref counting -----
// } ===== end nsIMdbObject methods =====
// { ===== begin nsIMdbBlob methods =====
// { ----- begin attribute methods -----
virtual mdb_err SetBlob(nsIMdbEnv* ev,
nsIMdbBlob* ioBlob); // reads inBlob slots
// when inBlob is in the same suite, this might be fastest cell-to-cell
virtual mdb_err ClearBlob( // make empty (so content has zero length)
nsIMdbEnv* ev);
// clearing a yarn is like SetYarn() with empty yarn instance content
virtual mdb_err GetBlobFill(nsIMdbEnv* ev,
mdb_fill* outFill); // size of blob
// Same value that would be put into mYarn_Fill, if one called GetYarn()
// with a yarn instance that had mYarn_Buf==nil and mYarn_Size==0.
virtual mdb_err SetYarn(nsIMdbEnv* ev,
const mdbYarn* inYarn); // reads from yarn slots
// make this text object contain content from the yarn's buffer
virtual mdb_err GetYarn(nsIMdbEnv* ev,
mdbYarn* outYarn); // writes some yarn slots
// copy content into the yarn buffer, and update mYarn_Fill and mYarn_Form
virtual mdb_err AliasYarn(nsIMdbEnv* ev,
mdbYarn* outYarn); // writes ALL yarn slots
// AliasYarn() reveals sensitive internal text buffer state to the caller
// by setting mYarn_Buf to point into the guts of this text implementation.
//
// The caller must take great care to avoid writing on this space, and to
// avoid calling any method that would cause the state of this text object
// to change (say by directly or indirectly setting the text to hold more
// content that might grow the size of the buffer and free the old buffer).
// In particular, callers should scrupulously avoid making calls into the
// mdb interface to write any content while using the buffer pointer found
// in the returned yarn instance. Best safe usage involves copying content
// into some other kind of external content representation beyond mdb.
//
// (The original design of this method a week earlier included the concept
// of very fast and efficient cooperative locking via a pointer to some lock
// member slot. But let's ignore that complexity in the current design.)
//
// AliasYarn() is specifically intended as the first step in transferring
// content from nsIMdbBlob to a nsString representation, without forcing extra
// allocations and/or memory copies. (A standard nsIMdbBlob_AsString() utility
// will use AliasYarn() as the first step in setting a nsString instance.)
//
// This is an alternative to the GetYarn() method, which has copy semantics
// only; AliasYarn() relaxes a robust safety principle only for performance
// reasons, to accomodate the need for callers to transform text content to
// some other canonical representation that would necessitate an additional
// copy and transformation when such is incompatible with the mdbYarn format.
//
// The implementation of AliasYarn() should have extremely little overhead
// besides the virtual dispatch to the method implementation, and the code
// necessary to populate all the mdbYarn member slots with internal buffer
// address and metainformation that describes the buffer content. Note that
// mYarn_Grow must always be set to nil to indicate no resizing is allowed.
// } ----- end attribute methods -----
// } ===== end nsIMdbBlob methods =====
// { ===== begin nsIMdbCell methods =====
// { ----- begin attribute methods -----
virtual mdb_err SetColumn(nsIMdbEnv* ev, mdb_column inColumn);
virtual mdb_err GetColumn(nsIMdbEnv* ev, mdb_column* outColumn);
virtual mdb_err GetCellInfo( // all cell metainfo except actual content
nsIMdbEnv* ev,
mdb_column* outColumn, // the column in the containing row
mdb_fill* outBlobFill, // the size of text content in bytes
mdbOid* outChildOid, // oid of possible row or table child
mdb_bool* outIsRowChild); // nonzero if child, and a row child
// Checking all cell metainfo is a good way to avoid forcing a large cell
// in to memory when you don't actually want to use the content.
virtual mdb_err GetRow(nsIMdbEnv* ev, // parent row for this cell
nsIMdbRow** acqRow);
virtual mdb_err GetPort(nsIMdbEnv* ev, // port containing cell
nsIMdbPort** acqPort);
// } ----- end attribute methods -----
// { ----- begin children methods -----
virtual mdb_err HasAnyChild( // does cell have a child instead of text?
nsIMdbEnv* ev,
mdbOid* outOid, // out id of row or table (or unbound if no child)
mdb_bool* outIsRow); // nonzero if child is a row (rather than a table)
virtual mdb_err GetAnyChild( // access table of specific attribute
nsIMdbEnv* ev, // context
nsIMdbRow** acqRow, // child row (or null)
nsIMdbTable** acqTable); // child table (or null)
virtual mdb_err SetChildRow( // access table of specific attribute
nsIMdbEnv* ev, // context
nsIMdbRow* ioRow); // inRow must be bound inside this same db port
virtual mdb_err GetChildRow( // access row of specific attribute
nsIMdbEnv* ev, // context
nsIMdbRow** acqRow); // acquire child row (or nil if no child)
virtual mdb_err SetChildTable( // access table of specific attribute
nsIMdbEnv* ev, // context
nsIMdbTable* inTable); // table must be bound inside this same db port
virtual mdb_err GetChildTable( // access table of specific attribute
nsIMdbEnv* ev, // context
nsIMdbTable** acqTable); // acquire child table (or nil if no child)
// } ----- end children methods -----
// } ===== end nsIMdbCell methods =====
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _ORKINCELL_ */

View File

@@ -0,0 +1,405 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKHANDLE_
#include "morkHandle.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
#ifndef _ORKINENV_
#include "orkinEnv.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
/* public virtual*/
orkinEnv:: ~orkinEnv() // morkHandle destructor does everything
{
}
/*protected non-poly construction*/
orkinEnv::orkinEnv(morkEnv* ev, // morkUsage is morkUsage_kPool
morkHandleFace* ioFace, // must not be nil, cookie for this handle
morkEnv* ioObject) // must not be nil, the object for this handle
: morkHandle(ev, ioFace, ioObject, morkMagic_kEnv)
{
// do not modify mNode_Derived; leave it equal to morkDerived_kHandle
}
/*static */ orkinEnv*
orkinEnv::MakeEnv(morkEnv* ev, morkEnv* ioObject)
{
mork_bool isEnv = ev->IsEnv();
MORK_ASSERT(isEnv);
if ( isEnv )
{
morkHandleFace* face = ev->NewHandle(sizeof(orkinEnv));
if ( face )
return new(face) orkinEnv(ev, face, ioObject);
else
ev->OutOfMemoryError();
}
return (orkinEnv*) 0;
}
morkEnv*
orkinEnv::CanUseEnv(mork_bool inMutable, mdb_err* outErr) const
{
morkEnv* outEnv = 0;
mdb_err err = morkEnv_kBadEnvError;
if ( this->IsHandle() )
{
if ( this->IsOpenNode() )
{
morkEnv* ev = (morkEnv*) this->mHandle_Object;
if ( ev && ev->IsEnv() )
{
outEnv = ev;
err = 0;
}
else
{
err = morkEnv_kNonEnvTypeError;
MORK_ASSERT(outEnv);
}
}
else
{
err = morkEnv_kNonOpenNodeError;
MORK_ASSERT(outEnv);
}
}
else
{
err = morkEnv_kNonHandleTypeError;
MORK_ASSERT(outEnv);
}
*outErr = err;
return outEnv;
}
// { ===== begin nsIMdbISupports methods =====
/*virtual*/ mdb_err
orkinEnv::AddRef() // add strong ref with no
{
morkEnv* ev = mHandle_Env;
if ( ev && ev->IsEnv() )
return this->Handle_AddStrongRef(ev->AsMdbEnv());
else
return morkEnv_kNonEnvTypeError;
}
/*virtual*/ mdb_err
orkinEnv::Release() // cut strong ref
{
morkEnv* ev = mHandle_Env;
if ( ev && ev->IsEnv() )
return this->Handle_CutStrongRef(ev->AsMdbEnv());
else
return morkEnv_kNonEnvTypeError;
}
// } ===== end nsIMdbObject methods =====
// { ===== begin nsIMdbObject methods =====
// { ----- begin attribute methods -----
/*virtual*/ mdb_err
orkinEnv::IsFrozenMdbObject(nsIMdbEnv* mev, mdb_bool* outIsReadonly)
{
return this->Handle_IsFrozenMdbObject(mev, outIsReadonly);
}
// same as nsIMdbPort::GetIsPortReadonly() when this object is inside a port.
// } ----- end attribute methods -----
// { ----- begin factory methods -----
/*virtual*/ mdb_err
orkinEnv::GetMdbFactory(nsIMdbEnv* mev, nsIMdbFactory** acqFactory)
{
return this->Handle_GetMdbFactory(mev, acqFactory);
}
// } ----- end factory methods -----
// { ----- begin ref counting for well-behaved cyclic graphs -----
/*virtual*/ mdb_err
orkinEnv::GetWeakRefCount(nsIMdbEnv* mev, // weak refs
mdb_count* outCount)
{
return this->Handle_GetWeakRefCount(mev, outCount);
}
/*virtual*/ mdb_err
orkinEnv::GetStrongRefCount(nsIMdbEnv* mev, // strong refs
mdb_count* outCount)
{
return this->Handle_GetStrongRefCount(mev, outCount);
}
/*virtual*/ mdb_err
orkinEnv::AddWeakRef(nsIMdbEnv* mev)
{
return this->Handle_AddWeakRef(mev);
}
/*virtual*/ mdb_err
orkinEnv::AddStrongRef(nsIMdbEnv* mev)
{
return this->Handle_AddStrongRef(mev);
}
/*virtual*/ mdb_err
orkinEnv::CutWeakRef(nsIMdbEnv* mev)
{
return this->Handle_CutWeakRef(mev);
}
/*virtual*/ mdb_err
orkinEnv::CutStrongRef(nsIMdbEnv* mev)
{
return this->Handle_CutStrongRef(mev);
}
/*virtual*/ mdb_err
orkinEnv::CloseMdbObject(nsIMdbEnv* mev)
{
return this->Handle_CloseMdbObject(mev);
}
/*virtual*/ mdb_err
orkinEnv::IsOpenMdbObject(nsIMdbEnv* mev, mdb_bool* outOpen)
{
return this->Handle_IsOpenMdbObject(mev, outOpen);
}
// } ----- end ref counting -----
// } ===== end nsIMdbObject methods =====
// { ===== begin nsIMdbEnv methods =====
// { ----- begin attribute methods -----
/*virtual*/ mdb_err
orkinEnv::GetErrorCount(mdb_count* outCount,
mdb_bool* outShouldAbort)
{
mdb_err outErr = 0;
mdb_count count = 1;
mork_bool shouldAbort = morkBool_kFalse;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
count = (mdb_count) ev->mEnv_ErrorCount;
shouldAbort = ev->mEnv_ShouldAbort;
}
if ( outCount )
*outCount = count;
if ( outShouldAbort )
*outShouldAbort = shouldAbort;
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::GetWarningCount(mdb_count* outCount,
mdb_bool* outShouldAbort)
{
mdb_err outErr = 0;
mdb_count count = 1;
mork_bool shouldAbort = morkBool_kFalse;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
count = (mdb_count) ev->mEnv_WarningCount;
shouldAbort = ev->mEnv_ShouldAbort;
}
if ( outCount )
*outCount = count;
if ( outShouldAbort )
*outShouldAbort = shouldAbort;
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::GetDoTrace(mdb_bool* outDoTrace)
{
mdb_err outErr = 0;
mork_bool doTrace = morkBool_kFalse;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
doTrace = ev->mEnv_DoTrace;
}
if ( outDoTrace )
*outDoTrace = doTrace;
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::SetDoTrace(mdb_bool inDoTrace)
{
mdb_err outErr = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kTrue, &outErr);
if ( ev )
{
ev->mEnv_DoTrace = inDoTrace;
}
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::GetAutoClear(mdb_bool* outAutoClear)
{
mdb_err outErr = 0;
mork_bool autoClear = morkBool_kFalse;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
autoClear = ev->DoAutoClear();
}
if ( outAutoClear )
*outAutoClear = autoClear;
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::SetAutoClear(mdb_bool inAutoClear)
{
mdb_err outErr = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kTrue, &outErr);
if ( ev )
{
if ( inAutoClear )
ev->EnableAutoClear();
else
ev->DisableAutoClear();
}
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::GetErrorHook(nsIMdbErrorHook** acqErrorHook)
{
mdb_err outErr = 0;
nsIMdbErrorHook* outErrorHook = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
outErrorHook = ev->mEnv_ErrorHook;
}
if ( acqErrorHook )
*acqErrorHook = outErrorHook;
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::SetErrorHook(
nsIMdbErrorHook* ioErrorHook) // becomes referenced
{
mdb_err outErr = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kTrue, &outErr);
if ( ev )
{
ev->mEnv_ErrorHook = ioErrorHook;
}
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::GetHeap(nsIMdbHeap** acqHeap)
{
mdb_err outErr = 0;
nsIMdbHeap* outHeap = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kFalse, &outErr);
if ( ev )
{
nsIMdbHeap* heap = ev->mEnv_Heap;
if ( heap && heap->AddStrongRef(this) == 0 )
outHeap = heap;
}
if ( acqHeap )
*acqHeap = outHeap;
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::SetHeap(
nsIMdbHeap* ioHeap) // becomes referenced
{
mdb_err outErr = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kTrue, &outErr);
if ( ev )
{
nsIMdbHeap_SlotStrongHeap(ioHeap, ev, &ev->mEnv_Heap);
}
return outErr;
}
// } ----- end attribute methods -----
/*virtual*/ mdb_err
orkinEnv::ClearErrors() // clear errors beore re-entering db API
{
mdb_err outErr = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kTrue, &outErr);
if ( ev )
{
ev->mEnv_ErrorCount = 0;
ev->mEnv_ErrorCode = 0;
ev->mEnv_ShouldAbort = morkBool_kFalse;
}
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::ClearWarnings() // clear warning
{
mdb_err outErr = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kTrue, &outErr);
if ( ev )
{
ev->mEnv_WarningCount = 0;
}
return outErr;
}
/*virtual*/ mdb_err
orkinEnv::ClearErrorsAndWarnings() // clear both errors & warnings
{
mdb_err outErr = 0;
morkEnv* ev = this->CanUseEnv(/*inMutable*/ morkBool_kTrue, &outErr);
if ( ev )
{
ev->ClearMorkErrorsAndWarnings();
}
return outErr;
}
// } ===== end nsIMdbEnv methods =====
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

View File

@@ -0,0 +1,164 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _ORKINENV_
#define _ORKINENV_ 1
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _MORKNODE_
#include "morkNode.h"
#endif
#ifndef _MORKHANDLE_
#include "morkHandle.h"
#endif
#ifndef _MORKEnv_
#include "morkEnv.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#define morkMagic_kEnv 0x456E7669 /* ascii 'Envi' */
/*| orkinEnv:
|*/
class orkinEnv : public morkHandle, public nsIMdbEnv { // nsIMdbObject
// { ===== begin morkNode interface =====
public: // morkNode virtual methods
// virtual void CloseMorkNode(morkEnv* ev); // morkHandle is fine
virtual ~orkinEnv(); // morkHandle destructor does everything
protected: // construction is protected (use the static Make() method)
orkinEnv(morkEnv* ev, // note morkUsage is always morkUsage_kPool
morkHandleFace* ioFace, // must not be nil, cookie for this handle
morkEnv* ioObject); // must not be nil, the object for this handle
// void CloseHandle(morkEnv* ev); // don't need to specialize closing
private: // copying is not allowed
orkinEnv(const morkHandle& other);
orkinEnv& operator=(const morkHandle& other);
// public: // dynamic type identification
// mork_bool IsHandle() const //
// { return IsNode() && mNode_Derived == morkDerived_kHandle; }
// } ===== end morkNode methods =====
protected: // morkHandle memory management operators
void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev)
{ return ioPool.NewHandle(ev, inSize); }
void* operator new(size_t inSize, morkHandleFace* ioFace)
{ return ioFace; }
void operator delete(void* ioAddress)
{ morkNode::OnDeleteAssert(ioAddress); }
// do NOT call delete on morkHandle instances. They are collected.
public: // construction:
static orkinEnv* MakeEnv(morkEnv* ev, morkEnv* ioObject);
public: // utilities:
morkEnv* CanUseEnv(mork_bool inMutable, mdb_err* outErr) const;
public: // type identification
mork_bool IsOrkinEnv() const
{ return mHandle_Magic == morkMagic_kEnv; }
mork_bool IsOrkinEnvHandle() const
{ return this->IsHandle() && this->IsOrkinEnv(); }
public:
// { ===== begin nsIMdbISupports methods =====
virtual mdb_err AddRef(); // add strong ref with no
virtual mdb_err Release(); // cut strong ref
// } ===== end nsIMdbObject methods =====
// { ===== begin nsIMdbObject methods =====
// { ----- begin attribute methods -----
virtual mdb_err IsFrozenMdbObject(nsIMdbEnv* ev, mdb_bool* outIsReadonly);
// same as nsIMdbPort::GetIsPortReadonly() when this object is inside a port.
// } ----- end attribute methods -----
// { ----- begin factory methods -----
virtual mdb_err GetMdbFactory(nsIMdbEnv* ev, nsIMdbFactory** acqFactory);
// } ----- end factory methods -----
// { ----- begin ref counting for well-behaved cyclic graphs -----
virtual mdb_err GetWeakRefCount(nsIMdbEnv* ev, // weak refs
mdb_count* outCount);
virtual mdb_err GetStrongRefCount(nsIMdbEnv* ev, // strong refs
mdb_count* outCount);
virtual mdb_err AddWeakRef(nsIMdbEnv* ev);
virtual mdb_err AddStrongRef(nsIMdbEnv* ev);
virtual mdb_err CutWeakRef(nsIMdbEnv* ev);
virtual mdb_err CutStrongRef(nsIMdbEnv* ev);
virtual mdb_err CloseMdbObject(nsIMdbEnv* ev); // called at strong refs zero
virtual mdb_err IsOpenMdbObject(nsIMdbEnv* ev, mdb_bool* outOpen);
// } ----- end ref counting -----
// } ===== end nsIMdbObject methods =====
// { ===== begin nsIMdbEnv methods =====
// { ----- begin attribute methods -----
virtual mdb_err GetErrorCount(mdb_count* outCount,
mdb_bool* outShouldAbort);
virtual mdb_err GetWarningCount(mdb_count* outCount,
mdb_bool* outShouldAbort);
virtual mdb_err GetDoTrace(mdb_bool* outDoTrace);
virtual mdb_err SetDoTrace(mdb_bool inDoTrace);
virtual mdb_err GetAutoClear(mdb_bool* outAutoClear);
virtual mdb_err SetAutoClear(mdb_bool inAutoClear);
virtual mdb_err GetErrorHook(nsIMdbErrorHook** acqErrorHook);
virtual mdb_err SetErrorHook(
nsIMdbErrorHook* ioErrorHook); // becomes referenced
virtual mdb_err GetHeap(nsIMdbHeap** acqHeap);
virtual mdb_err SetHeap(
nsIMdbHeap* ioHeap); // becomes referenced
// } ----- end attribute methods -----
virtual mdb_err ClearErrors(); // clear errors beore re-entering db API
virtual mdb_err ClearWarnings(); // clear warnings
virtual mdb_err ClearErrorsAndWarnings(); // clear both errors & warnings
// } ===== end nsIMdbEnv methods =====
};
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
#endif /* _ORKINENV_ */

View File

@@ -0,0 +1,91 @@
/* -*- 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) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _MDB_
#include "mdb.h"
#endif
#ifndef _MORK_
#include "mork.h"
#endif
#ifndef _ORKINERRORHOOK_
#include "orkinErrorHook.h"
#endif
#ifndef _MORKENV_
#include "morkEnv.h"
#endif
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
orkinHeap::orkinHeap() // does nothing
{
}
/*virtual*/
orkinHeap::~orkinHeap() // does nothing
{
}
// { ===== begin nsIMdbHeap methods =====
/*virtual*/ mdb_err
orkinHeap::Alloc(nsIMdbEnv* ev, // allocate a piece of memory
mdb_size inSize, // requested size of new memory block
void** outBlock) // memory block of inSize bytes, or nil
{
mdb_err outErr = 0;
void* block = new char[ inSize ];
if ( !block )
outErr = morkEnv_kOutOfMemoryError;
MORK_ASSERT(outBlock);
if ( outBlock )
*outBlock = block;
return outErr;
}
/*virtual*/ mdb_err
orkinHeap::Free(nsIMdbEnv* ev, // free block allocated earlier by Alloc()
void* inBlock)
{
MORK_ASSERT(inBlock);
if ( inBlock )
delete [] inBlock;
return 0;
}
/*virtual*/ mdb_err
orkinHeap::AddStrongRef(nsIMdbEnv* ev) // does nothing
{
MORK_USED_1(ev);
return 0;
}
/*virtual*/ mdb_err
orkinHeap::CutStrongRef(nsIMdbEnv* ev) // does nothing
{
MORK_USED_1(ev);
return 0;
}
// } ===== end nsIMdbHeap methods =====
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

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