Compare commits

..

1103 Commits

Author SHA1 Message Date
(no author)
8b18aea027 This commit was manufactured by cvs2svn to create branch
'RemoveSillyDefines_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/RemoveSillyDefines_BRANCH@8328 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 10:43:28 +00:00
ramiro%netscape.com
933646ed20 Move the bookmarks menu to the top level menubar.
git-svn-id: svn://10.0.0.236/trunk@8327 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 10:43:27 +00:00
mcafee%netscape.com
fa3ec6839a Link with $(CCC).
git-svn-id: svn://10.0.0.236/trunk@8326 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 09:30:35 +00:00
mcafee%netscape.com
d6f87350e9 Changed project
git-svn-id: svn://10.0.0.236/trunk@8325 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 09:20:23 +00:00
mcafee%netscape.com
7de4af812b Include paths and defines from Makefile.mozilla
git-svn-id: svn://10.0.0.236/trunk@8324 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 09:18:32 +00:00
mcafee%netscape.com
e815ceb3a8 Adding test CFLAG
git-svn-id: svn://10.0.0.236/trunk@8323 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 09:16:07 +00:00
mcafee%netscape.com
6f28405e11 FE_UnloadPlugin() prototype added struct _np_handle* paramter.
git-svn-id: svn://10.0.0.236/trunk@8322 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:48:22 +00:00
mcafee%netscape.com
5aeab4a954 FE_PromptIMAPSubscriptionUpgrade() prototype changed.
git-svn-id: svn://10.0.0.236/trunk@8321 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:47:40 +00:00
mcafee%netscape.com
70ee80b38e _IMGCB_DisplayPixmap() prototype changed.
git-svn-id: svn://10.0.0.236/trunk@8320 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:47:11 +00:00
mcafee%netscape.com
72205ff75c Missing EmbedWindow calls, CheckConfirm, SelectDialog
git-svn-id: svn://10.0.0.236/trunk@8319 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:46:39 +00:00
mcafee%netscape.com
0506db4654 Added ybmisc.c, REQUIRES needs java, plugimpl, security.
git-svn-id: svn://10.0.0.236/trunk@8318 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:45:51 +00:00
mcafee%netscape.com
71b1b72d93 Initial checkin
git-svn-id: svn://10.0.0.236/trunk@8317 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:45:10 +00:00
mcafee%netscape.com
69d26fc990 nspr20 -> nsprpub
git-svn-id: svn://10.0.0.236/trunk@8316 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:31:34 +00:00
mcafee%netscape.com
b161581f85 minor comment
git-svn-id: svn://10.0.0.236/trunk@8315 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:16:20 +00:00
mcafee%netscape.com
4137f588cf Initial checkin
git-svn-id: svn://10.0.0.236/trunk@8314 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:14:20 +00:00
brendan%netscape.com
297f681a94 Insist on / after builtin at front of MIME type.
git-svn-id: svn://10.0.0.236/trunk@8313 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:12:14 +00:00
brendan%netscape.com
2ee8e38a4a Use text/html, not HTMLAREA, as value of TEXTAREA TYPE field; debloat code.
git-svn-id: svn://10.0.0.236/trunk@8312 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:11:13 +00:00
brendan%netscape.com
f2a071f8f4 Defend against null from FE_FindFileExt in CRDFImage::ProcessIcon (hyatt).
git-svn-id: svn://10.0.0.236/trunk@8311 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:09:01 +00:00
mcafee%netscape.com
3107038651 minor text formatting
git-svn-id: svn://10.0.0.236/trunk@8310 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 08:04:58 +00:00
mcafee%netscape.com
f293558ca7 Includes from Makefile.mozilla
git-svn-id: svn://10.0.0.236/trunk@8309 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 07:52:10 +00:00
mcafee%netscape.com
b31421ce85 Initial checkin
git-svn-id: svn://10.0.0.236/trunk@8308 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 07:41:49 +00:00
mcafee%netscape.com
ed2cfdfed2 Moving Mozilla-specific stuff to Makefile.mozilla for now
git-svn-id: svn://10.0.0.236/trunk@8307 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 07:31:53 +00:00
mcafee%netscape.com
9f847ad970 Initial checkin
git-svn-id: svn://10.0.0.236/trunk@8306 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 07:25:08 +00:00
mcafee%netscape.com
952af2cdc8 Initial checkin
git-svn-id: svn://10.0.0.236/trunk@8305 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 07:19:32 +00:00
valeski%netscape.com
16b4397839 fixing UMR (unitialized memory read) error in netlib timer tracing.
git-svn-id: svn://10.0.0.236/trunk@8304 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 07:01:22 +00:00
morse%netscape.com
bb272f36f1 fix build bustage on mac
git-svn-id: svn://10.0.0.236/trunk@8303 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 06:26:41 +00:00
rpotts%netscape.com
c88eb2fd9c Fixed a crash when Destroy(...) was called without first calling Init(...)
git-svn-id: svn://10.0.0.236/trunk@8302 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 06:21:52 +00:00
joki%netscape.com
375b5308ba Okay, another guess at this bustage.
git-svn-id: svn://10.0.0.236/trunk@8301 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 06:13:03 +00:00
joki%netscape.com
e2d66462b8 Why can't all those little slashes just get along.
git-svn-id: svn://10.0.0.236/trunk@8300 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 05:12:27 +00:00
morse%netscape.com
ffb6a2c5e7 added privacy central
git-svn-id: svn://10.0.0.236/trunk@8299 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 05:04:12 +00:00
morse%netscape.com
7cb07d6bc8 Makefile
git-svn-id: svn://10.0.0.236/trunk@8298 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 04:40:39 +00:00
morse%netscape.com
5b69c849ce added privacy central
git-svn-id: svn://10.0.0.236/trunk@8297 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 04:39:59 +00:00
joki%netscape.com
9c033f7d60 Fix this darned unix redness.
git-svn-id: svn://10.0.0.236/trunk@8296 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 04:38:43 +00:00
cls%seawood.org
724f7bde45 Restoring file biff'd in merge.
git-svn-id: svn://10.0.0.236/trunk@8295 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:50:48 +00:00
cls%seawood.org
e0052638a0 Restoring file biff'd in merge.
git-svn-id: svn://10.0.0.236/trunk@8293 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:34:44 +00:00
joki%netscape.com
191a3d156d Modify mouseover url messages to send empty string when leaving links.
git-svn-id: svn://10.0.0.236/trunk@8292 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:28:44 +00:00
cls%seawood.org
d50e1798e7 Fixed problem with Irix when $x_includes is not set.
git-svn-id: svn://10.0.0.236/trunk@8291 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:11:33 +00:00
clu%netscape.com
4911dc6d39 implemented FE of Convert Table to Text and Convert Text to Table. reviewed by sarri.
git-svn-id: svn://10.0.0.236/trunk@8290 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:08:41 +00:00
clu%netscape.com
d5f3797dde adding cmd ids for composer Convert_Text_To_Table and Convert_Table_To_Text. reviewed by sarri.
git-svn-id: svn://10.0.0.236/trunk@8289 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:06:20 +00:00
clu%netscape.com
7dbbfd73de #313490 - activation and deactivation of image dialog captions. reviewed by sarri.
git-svn-id: svn://10.0.0.236/trunk@8288 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:05:01 +00:00
clu%netscape.com
8c94f1f92c fix to #312039 - font toolbar update. Also implemented FE for Convert Text to Table and Convert Table to Text. reviewed by sarri.
git-svn-id: svn://10.0.0.236/trunk@8287 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:04:59 +00:00
clu%netscape.com
794ef9319b partial fix for #312859; reviewed by sarri.
git-svn-id: svn://10.0.0.236/trunk@8286 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 03:04:57 +00:00
leaf%mozilla.org
77970cfb5d added mozilla/config/autoconf.mk.in to MozillaSourceUnixOnly module
git-svn-id: svn://10.0.0.236/trunk@8284 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 02:42:59 +00:00
rickg%netscape.com
dfdf0fbcb9 Too many bugs to mention; tables, skipped content; perf; memory
git-svn-id: svn://10.0.0.236/trunk@8283 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 02:04:39 +00:00
rickg%netscape.com
71238ab307 fixed off by one error in Pop()
git-svn-id: svn://10.0.0.236/trunk@8282 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 02:03:56 +00:00
morse%netscape.com
9f0db52c2f fix problem caused by dereferencing null pointer
git-svn-id: svn://10.0.0.236/trunk@8281 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 01:53:08 +00:00
jevering%netscape.com
a4e04b1a1e Moving plugin directory stuff.
git-svn-id: svn://10.0.0.236/trunk@8280 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 01:12:53 +00:00
pinkerton%netscape.com
049d5d84a6 Fix rowRefresh() boo-boo so now it actually redraws the cell when the custom icon loads. Cells with custom icons now draw with the correct text color in all modes.
git-svn-id: svn://10.0.0.236/trunk@8279 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 00:40:34 +00:00
vidur%netscape.com
7aadac9126 Fixed build bustage
git-svn-id: svn://10.0.0.236/trunk@8278 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-21 00:24:40 +00:00
vidur%netscape.com
1336fb61cc Fixed build bustage.
git-svn-id: svn://10.0.0.236/trunk@8277 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 23:07:31 +00:00
vidur%netscape.com
5e62f96c2c Fixed build bustage.
git-svn-id: svn://10.0.0.236/trunk@8276 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 23:00:52 +00:00
mcafee%netscape.com
5587f1d8d2 Initial checkin
git-svn-id: svn://10.0.0.236/trunk@8275 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 22:46:05 +00:00
vidur%netscape.com
128b33e018 Used IIDs for nsIConnectionInfo and nsIDocumentLoadInfo
git-svn-id: svn://10.0.0.236/trunk@8274 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 22:29:22 +00:00
vidur%netscape.com
74ab64f3f0 Added nsIDocumentLoadInfo interface. Temporarily added service startup inside WebShell factory.
git-svn-id: svn://10.0.0.236/trunk@8273 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 22:28:52 +00:00
vidur%netscape.com
4c4c6f8445 Added nsIConnectionInfo interface. Temporarily special-cased javascript: URLs in URL parsing.
git-svn-id: svn://10.0.0.236/trunk@8272 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 22:28:09 +00:00
vidur%netscape.com
d5ef9d3965 Exported NET_StreamBuilder and NET_RegisterProtocolImplementation for modular netlib
git-svn-id: svn://10.0.0.236/trunk@8271 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 22:27:20 +00:00
vidur%netscape.com
693f5d1915 Exported NET_StreamBuilder for modular netlib
git-svn-id: svn://10.0.0.236/trunk@8270 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 22:26:31 +00:00
vidur%netscape.com
b9d512330b Added javascript: URL handling. Added AddNamedReference and RemovedNamedReference to script context interface.
git-svn-id: svn://10.0.0.236/trunk@8269 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 22:25:21 +00:00
jevering%netscape.com
92c2b89717 Moved the ART image hack to the tip.
git-svn-id: svn://10.0.0.236/trunk@8268 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 22:10:06 +00:00
pinkerton%netscape.com
deb24c7782 Handle d&d between multiple popdown trees. Make sure we broadcast that the current view has changed so that the title strip picks it up.
git-svn-id: svn://10.0.0.236/trunk@8267 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 21:51:10 +00:00
pinkerton%netscape.com
dc17b4d9a5 Fix hilight redraw bugs during d&d.
git-svn-id: svn://10.0.0.236/trunk@8266 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 21:50:12 +00:00
pinkerton%netscape.com
175ff9ffad Correctly do dragging between popdown trees in the same window. Also only open the first item in the selection when in a popdown.
git-svn-id: svn://10.0.0.236/trunk@8265 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 21:49:56 +00:00
pinkerton%netscape.com
990a507247 Broadcast message on mouse-up.
git-svn-id: svn://10.0.0.236/trunk@8264 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 21:49:11 +00:00
pinkerton%netscape.com
3f5a9b51ac Handle redrawing the popdown tree during d&d when one goes away and a new one appears. Also close on mouse-up when clicking outside of popdown.
git-svn-id: svn://10.0.0.236/trunk@8263 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 21:48:34 +00:00
jgellman%netscape.com
4d840695e9 2nd try; new parser from james clark
git-svn-id: svn://10.0.0.236/trunk@8262 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 21:20:50 +00:00
kmcclusk%netscape.com
5b9b614171 Added XP_UNIX code to leave the top slash for absolute file paths under UNIX.
This fixes a problem where all of the slashs get stripped off because the URL
is asked to parse a previously parsed url string.


git-svn-id: svn://10.0.0.236/trunk@8261 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 20:32:52 +00:00
jgellman%netscape.com
679d9e3f03 back out last checkin -- bad Macintosh karma, need more time
git-svn-id: svn://10.0.0.236/trunk@8260 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 20:05:26 +00:00
jgellman%netscape.com
a7f3d8c6b3 new XML parser from James Clark
git-svn-id: svn://10.0.0.236/trunk@8259 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 19:24:29 +00:00
karnaze%netscape.com
928a6de8a5 checked for null form manager & fixed memory leak in win95 hack code
git-svn-id: svn://10.0.0.236/trunk@8256 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 18:27:13 +00:00
buster%netscape.com
0e5df88ea8 verify that proportionate-width columns (1* format, or COLS attribute)
get sized to at least their minimum width


git-svn-id: svn://10.0.0.236/trunk@8255 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 17:31:20 +00:00
warren%netscape.com
cf540377a4 Fixed copyright.
git-svn-id: svn://10.0.0.236/trunk@8252 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 07:58:32 +00:00
warren%netscape.com
9abf0ee471 Added from SpiderMonkey131_BRANCH of ns/js/ref/liveconnect
git-svn-id: svn://10.0.0.236/trunk@8251 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 07:58:00 +00:00
rpotts%netscape.com
586e2e3691 moving changes in 3.55.2.1 onto the tip...
git-svn-id: svn://10.0.0.236/trunk@8250 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 06:19:11 +00:00
rpotts%netscape.com
b142e0f478 moving changes in 1.36.2.1 onto the tip...
git-svn-id: svn://10.0.0.236/trunk@8248 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 06:17:47 +00:00
rpotts%netscape.com
4b2b401905 moving 3.23.4.1 to the tip...
git-svn-id: svn://10.0.0.236/trunk@8246 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 06:16:32 +00:00
uid401
6c4b8f671a Documentation improvements.
git-svn-id: svn://10.0.0.236/trunk@8244 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 04:51:19 +00:00
mcafee%netscape.com
9cb384db89 Initial version
git-svn-id: svn://10.0.0.236/trunk@8243 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 03:24:24 +00:00
mcafee%netscape.com
1e98a8b997 Switching to test OS_ARCH for Rhapsody instead of using RHAPSODY.
git-svn-id: svn://10.0.0.236/trunk@8242 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 03:09:31 +00:00
mcafee%netscape.com
04523afd75 Woops, we should test OS_ARCH for Rhapsody instead of using RHAPSODY.
git-svn-id: svn://10.0.0.236/trunk@8241 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 03:09:01 +00:00
mcafee%netscape.com
0f70da9c01 Added FE_PromptIMAPSubscriptionUpgrade()
git-svn-id: svn://10.0.0.236/trunk@8240 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:32:50 +00:00
mcafee%netscape.com
3c5be0ed02 Added FE_ShowMinibuffer()
git-svn-id: svn://10.0.0.236/trunk@8239 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:32:25 +00:00
morse%netscape.com
78ddac7d6f remove lock from SI_LogNewURL to assure it won't deadlock
git-svn-id: svn://10.0.0.236/trunk@8238 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:31:57 +00:00
mcafee%netscape.com
560b3337b0 Added FE_AlternateCompose()
git-svn-id: svn://10.0.0.236/trunk@8237 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:31:42 +00:00
mcafee%netscape.com
66c2c448f7 _IMGCB_DisplayPixmap()'s paramters changed; added IMGCBFactory_Create().
git-svn-id: svn://10.0.0.236/trunk@8236 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:31:13 +00:00
mcafee%netscape.com
f7ebc021a8 FE_UnloadPlugin()'s parameters changed.
git-svn-id: svn://10.0.0.236/trunk@8235 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:30:38 +00:00
mcafee%netscape.com
5794639481 Added XFE_AskStreamQuestion to link stubfe.
git-svn-id: svn://10.0.0.236/trunk@8234 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:30:00 +00:00
mcafee%netscape.com
20e701cebc Added STUBFE_CreateEmbedWindow STUBFE_SaveEmbedWindow STUBFE_RestoreEmbedWindow STUBFE_DestroyEmbedWindow STUBFE_FreeBuiltinElement STUBFE_DisplayBuiltin STUBFE_CheckConfirm STUBFE_SelectDialog.
git-svn-id: svn://10.0.0.236/trunk@8233 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:29:26 +00:00
mcafee%netscape.com
3a38b24d07 Updated libraries to link this on Solaris. Stripped out release stuff. Took out some XFE hacks.
git-svn-id: svn://10.0.0.236/trunk@8232 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 02:28:32 +00:00
ftang%netscape.com
66656c9da5 add XP_ASSERT(IsUTF8String) to some HT api
git-svn-id: svn://10.0.0.236/trunk@8230 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:58:52 +00:00
mcafee%netscape.com
41f3bf64df Switch to using OS_ARCH instead of shell command. r=ramiro
git-svn-id: svn://10.0.0.236/trunk@8229 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:51:42 +00:00
pinkerton%netscape.com
191fdd6738 Don't let popdown tree go off the right side of window. Push it back to left if it would.
git-svn-id: svn://10.0.0.236/trunk@8228 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:48:01 +00:00
pinkerton%netscape.com
0f9d2f989b Fix problems with popdown tree crashing when closing on double-click (again) by making every browser window have its own version of it and have a static member which points to the currently active one so we can still do things like clip it out when blitting images in the html area w/out having to know about the browser window.
git-svn-id: svn://10.0.0.236/trunk@8227 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:40:08 +00:00
pinkerton%netscape.com
34e9f3e491 Don't call HT_CanDropURLOn with bogus data.
git-svn-id: svn://10.0.0.236/trunk@8226 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:38:45 +00:00
scullin%netscape.com
c9fa0f4535 Fix hack incompatibility.
git-svn-id: svn://10.0.0.236/trunk@8225 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:33:26 +00:00
cyeh%netscape.com
bb95f3bd18 adding file: merge from AUTOCONF_1_0
git-svn-id: svn://10.0.0.236/trunk@8224 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:31:17 +00:00
cyeh%netscape.com
72e703144e merging files from AUTOCONF_1_0 branch
git-svn-id: svn://10.0.0.236/trunk@8223 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:30:12 +00:00
scullin%netscape.com
053a936966 Move form element hack from branch.
git-svn-id: svn://10.0.0.236/trunk@8222 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:24:29 +00:00
cyeh%netscape.com
3e7e71b99a fixing biffed autoconf_1_0 merge
git-svn-id: svn://10.0.0.236/trunk@8221 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-20 00:18:03 +00:00
cyeh%netscape.com
dc77a65bd2 merge autoconf branch to tip
git-svn-id: svn://10.0.0.236/trunk@8220 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:36:20 +00:00
cyeh%netscape.com
190a99330b resurrect file toasted from tip
git-svn-id: svn://10.0.0.236/trunk@8219 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:34:46 +00:00
valeski%netscape.com
0317dc7bb0 fixed memory leak a little more safely :)
git-svn-id: svn://10.0.0.236/trunk@8217 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:33:46 +00:00
valeski%netscape.com
fe7b858a07 fixed memory leak
git-svn-id: svn://10.0.0.236/trunk@8216 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:32:43 +00:00
preed%netscape.com
0ac409a746 Fixes some bugs in the way messages of the day were stored; certain
characters could cause tinderbox to bomb out because they weren't escaped,
and the '1;' at the end was missing (which is bad because this is needed
if it's required). Reviewed by terry.


git-svn-id: svn://10.0.0.236/trunk@8215 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:31:52 +00:00
preed%netscape.com
b086f7409c Added features to allow popup menu's in showbuilds.cgi (requsted), and
modified a chop to chomp to make SURE it does what we want. Reviewed by
terry.


git-svn-id: svn://10.0.0.236/trunk@8214 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:20:45 +00:00
troy%netscape.com
3dd6745dd7 Changed web shell widget to NOT clip children
git-svn-id: svn://10.0.0.236/trunk@8213 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:13:00 +00:00
troy%netscape.com
703ca9af2b Added clipChildren option to nsWidgetInitData
git-svn-id: svn://10.0.0.236/trunk@8212 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:11:41 +00:00
valeski%netscape.com
277cec0087 webshell/public/nsIDocumentLoader.h
Extended the nsIDocumentLoader interface's LoadURL() method to take a reload type parameter.

webshell/public/nsIWebShell.h
Extended the nsIWebShell interface's LoadURL() method to take a reload type parameter.

webshell/src/nsDocLoader.cpp
1. Extended the nsIDocumentBindInfo interface's Bind() method to take a reload type parameter. The Bind() method now takes the reload parameter and passes it to the nsIUrl it creates.
2. Added support to the DocumentLoader for the extended LoadURL() parameter list. It now passes the reload type down into the Bind() method of the nsIDocumentBindInfo.

webshell/src/nsWebShell.cpp
1. Added support to the nsWebShell to use the new reload type parameter during loads.
2. Hooked up the reload type parameter in the nsWebShell::Reload() method so we actually use it.


git-svn-id: svn://10.0.0.236/trunk@8211 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:01:52 +00:00
valeski%netscape.com
b4d5c7e4ce RAPTOR ONLY CHECKIN
network/module/nsIURL.h
Added Get/Set ReloadType methods so a user can query/set the reload type for the url. The default is normal reload.

network/module/nsURL.cpp
Added support for the new nsIURL interface methods (Get/Set ReloadType).

network/module/nsNetService.cpp
OpenStream and OpenBlockingStream now query the nsIURL for it's reload type before creating the url struct. This way we can control how the url is loaded.


git-svn-id: svn://10.0.0.236/trunk@8210 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 23:00:15 +00:00
karnaze%netscape.com
fe7799e863 removed calls to DidReflow on browse button and text area
git-svn-id: svn://10.0.0.236/trunk@8206 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 21:43:46 +00:00
scullin%netscape.com
0c740efd34 Move resource hack to tip.
git-svn-id: svn://10.0.0.236/trunk@8205 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 21:38:57 +00:00
michaelp%netscape.com
f41b11459c fixed bug in loading one of the icons where the handle to load from was never
specified.


git-svn-id: svn://10.0.0.236/trunk@8204 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 21:05:50 +00:00
michaelp%netscape.com
a59b85078e added support for opening new windows with _blank url targets.
git-svn-id: svn://10.0.0.236/trunk@8203 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 21:00:51 +00:00
chuckb%netscape.com
d495a73e5b Java SDK build instructions
git-svn-id: svn://10.0.0.236/trunk@8202 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 20:57:12 +00:00
michaelp%netscape.com
0f6556178c added assert to warn you of recursive painting.
git-svn-id: svn://10.0.0.236/trunk@8201 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 20:56:52 +00:00
michaelp%netscape.com
2aa2b60dad tiny change to get things to work under the 4.1 compiler.
git-svn-id: svn://10.0.0.236/trunk@8200 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 20:56:27 +00:00
cls%seawood.org
4288391d23 AUTOCONF_1_0 landing.
git-svn-id: svn://10.0.0.236/trunk@8198 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 20:42:14 +00:00
buster%netscape.com
214f7beda3 fixes a layout bug where subsequent cells in a column when colspans are involved
could select the wrong starting width for the column, causing it to have the
wrong ending width.


git-svn-id: svn://10.0.0.236/trunk@8197 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 20:41:06 +00:00
buster%netscape.com
7adfe644b7 modified the resize reflow optimization so max element size is returned
if requested without triggering a reflow if the width hasn't changed.


git-svn-id: svn://10.0.0.236/trunk@8196 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 18:40:33 +00:00
despotdaemon%netscape.com
0e3954d4bd Pseudo-automatic update of changes made by gem@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@8195 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 18:25:53 +00:00
troy%netscape.com
88d691c869 Re-ordered code that adds loader object to the array of loaders
git-svn-id: svn://10.0.0.236/trunk@8194 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 18:07:27 +00:00
troy%netscape.com
b9f04152ae Changed call to UpdateView() to be synchronous. This keeps us from
going re-entrant


git-svn-id: svn://10.0.0.236/trunk@8193 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 17:45:28 +00:00
cyeh%netscape.com
ecc5be6ea7 change to the modules file per Chuck Boatwright, LDAP owner
git-svn-id: svn://10.0.0.236/trunk@8192 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 17:33:00 +00:00
dcone%netscape.com
539998ec1a fixed list up a little for gfx build
git-svn-id: svn://10.0.0.236/trunk@8191 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 17:26:50 +00:00
dcone%netscape.com
645dadc9f8 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8190 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 17:24:14 +00:00
dcone%netscape.com
a9d4cc2a1b Re wrote these files to reflect the correct way of building Devicecontexts
git-svn-id: svn://10.0.0.236/trunk@8189 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 17:24:13 +00:00
dcone%netscape.com
23d55d5115 Added some project info, files
git-svn-id: svn://10.0.0.236/trunk@8188 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 17:21:53 +00:00
dcone%netscape.com
ca72a23f3d Re-syn
git-svn-id: svn://10.0.0.236/trunk@8187 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 17:21:06 +00:00
dcone%netscape.com
b29ee2f9e9 Major redo based on a new GFX library
git-svn-id: svn://10.0.0.236/trunk@8186 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 17:20:31 +00:00
buster%netscape.com
ad76084cb9 improved colspan handling.
cells with colspans and specified widths divide their width provisionally between the columns they span. This provisional division is ammended by any cell in any of the effected columns that:
1) has a colspan=1, and
2) has a width specified
the widths of all other columns must be adjusted for cells like these.  Further complicating matters is that it seems <faith> that if multiple colspanning cells intersect a column and each has a width
specified such that the column would have a different width depending on which is used, only the first such cell is used </faith>.  I can neither confirm nor deny this reading the mozilla code.

I also taught the cell map how to deal with this situation:

 colspan=1 | colspan=2 | colspan=1
 colspan=1 | colspan=2 | colspan=1

This table "really" has 4 columns, but the middle cells are treated as if they have no colspan.
Trust me, it matters.  The original colspan attributes can't simply be thrown away because Mr. DOM
could come along at any time and add/remove a cell that would make them important.


git-svn-id: svn://10.0.0.236/trunk@8185 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 15:43:51 +00:00
mcafee%netscape.com
78a287cde8 Compile flag needed to get expat/xmlparse/xmlparse.c to compile correctly.
git-svn-id: svn://10.0.0.236/trunk@8184 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 08:29:56 +00:00
mcafee%netscape.com
b05ae4a7ce Adding RHAPSODY define so we don't have to do shell commands for ifdef's in Makefiles
git-svn-id: svn://10.0.0.236/trunk@8183 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 08:26:15 +00:00
mcafee%netscape.com
e2f15157aa Adding ybfe, YellowBox/Rhapsody front-end
git-svn-id: svn://10.0.0.236/trunk@8182 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 07:23:28 +00:00
joki%netscape.com
f300c374d7 Moving view selection for event handling into nsViewManager, Adding GrabMouseEvents and GrabKeyEvents
git-svn-id: svn://10.0.0.236/trunk@8181 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 05:35:20 +00:00
troy%netscape.com
e2ff812829 Added some comments
git-svn-id: svn://10.0.0.236/trunk@8180 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 05:06:59 +00:00
troy%netscape.com
2a617558d9 Changed CopyOffScreenBits() to make sure the logical palette is selected
into the screen DC.


git-svn-id: svn://10.0.0.236/trunk@8179 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 04:41:48 +00:00
troy%netscape.com
0ea8197cc3 Changed WM_QUERYNEWPALETTE code to return TRUE to indicate that
a palette was realized


git-svn-id: svn://10.0.0.236/trunk@8176 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 02:31:08 +00:00
morse%netscape.com
3bde6edabc fixed incorrect return type on NET_CookiePermission
git-svn-id: svn://10.0.0.236/trunk@8175 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 02:30:25 +00:00
clu%netscape.com
3bcc29c1be #71944. reviewed by jfrancis.
git-svn-id: svn://10.0.0.236/trunk@8174 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 02:18:02 +00:00
clu%netscape.com
154eccdf6a adding cmd ids for composer Split Cell and Merge Cell. reviewed by jfrancis.
git-svn-id: svn://10.0.0.236/trunk@8173 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 02:18:01 +00:00
clu%netscape.com
e0c34a0c13 implementing macfe Split Cell and Merge Cell. Included AutoKey in the conditional statements for backspace delete and regular key input to help with typing efficiency. reviewed by jfrancis.
git-svn-id: svn://10.0.0.236/trunk@8172 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 02:18:00 +00:00
clu%netscape.com
2ca1451b24 checking in ftang's fix for the correct positioning of the asian language input window.
git-svn-id: svn://10.0.0.236/trunk@8171 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 02:17:59 +00:00
troy%netscape.com
1067da29bd Changed to realize the palette in the background
git-svn-id: svn://10.0.0.236/trunk@8170 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 01:58:17 +00:00
peterl%netscape.com
61c45a8a04 handle body's marginwidth/height via a special style rule
git-svn-id: svn://10.0.0.236/trunk@8169 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 01:16:40 +00:00
peterl%netscape.com
a458984ea5 handle marginwidth/height via a special style rule
git-svn-id: svn://10.0.0.236/trunk@8168 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 01:16:21 +00:00
mcafee%netscape.com
21157c248b Adding support for XP_UNIX && NO_X11. r,a=warren
git-svn-id: svn://10.0.0.236/trunk@8167 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 01:13:08 +00:00
troy%netscape.com
30842a5c4b Changed palette code to get the palette from the device context
git-svn-id: svn://10.0.0.236/trunk@8166 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 00:57:02 +00:00
troy%netscape.com
1d7149f1d1 Added GetPaletteInfo()
git-svn-id: svn://10.0.0.236/trunk@8165 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 00:37:05 +00:00
valeski%netscape.com
b4eb4f5402 webshell/public/nsIDocumentLoader.h
Removed support for the underlying timer/refreshurl infrastructure.

webshell/src/nsDocLoader.cpp
1. Added support in nsDocumentBindInfo for the new nsIRefreshUrl method for cancelling.
1.5 Changed the refreshurl() method so it delegates to the container's (i.e. webshell's) refreshurl() method.
2. Removed the "actual" refresh url implementation (timers) from the nsDocumentBindInfo. It's now in the webshell and nsDocumentBindInfo's implementation of nsIRefreshUrl simply delegates to the "container" (i.e. the webshell).
3. Added call to new NS_NewURL() routine which takes an nsISupports pointer as an arg, if the nsDocumentBindInfo has a container to pass along.

webshell/src/nsWebShell.cpp
Added support for the nsIRefreshUrl interface to nsWebShell (this includes the underlying timers and callback mechanism).


git-svn-id: svn://10.0.0.236/trunk@8164 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 23:25:17 +00:00
valeski%netscape.com
a192f6bdd0 network/module/nsIRefreshUrl.h
Extended the nsIRefreshUrl interface to include a cancel method.

network/module/nsNetService.cpp
1. Added code to hook the nsConnectionInfo object up to the nsISupports pointer in the url being loaded.
2. Removed the redirect logic in bam_exit_routine(). The backend dependency on the front end is gone.

network/module/nsNetStream.cpp
Added initialization/destruction of the nsISupports pointer in the nsConnectionInfo.

network/module/nsNetStream.h
Added the nsISupports member declaration to nsConnectionInfo, and remvoed the redirect member variable.

network/module/nsNetStubs.cpp
FE_SetRefreshURLTimer() routine has been modified so it no longer relies on the pConsumer (i.e. nsDocumentBindInfo) which was causing us to leak it. Now we use the nsISupports pointer in the nsConnectionInfo object to access the nsIRefreshURL interface so we can reload the url.

network/module/nsStubContext.cpp
Modified stub_complete() so we no longer pay attention to the redirect member of the nsConnectionInfo object.

network/module/nsIURL.h
1. Added GetContainer() method to nsIURL which returns the nsISupports pointer of the container for this url.
2. created a new NS_NewURL() routine which takes an nsISupports pointer as a parameter.

network/module/nsURL.cpp
1. Added a new nsURL constructor that takes a nsISupports pointer as a param.
2. Added GetContainer() method and nsISupports pointer initialization/destruction.


git-svn-id: svn://10.0.0.236/trunk@8163 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 23:24:28 +00:00
cmanske%netscape.com
182ab83bed Fixed build bustage
git-svn-id: svn://10.0.0.236/trunk@8162 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 23:18:24 +00:00
cls%seawood.org
8ac3fcb06a Added ifdefs for MOZ_NATIVE_{JPEG,PNG,ZLIB}. Approved by pnunn%netscape.com.
git-svn-id: svn://10.0.0.236/trunk@8161 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:59:14 +00:00
kostello%netscape.com
662cb6cd5d Added nsButton to libraries
git-svn-id: svn://10.0.0.236/trunk@8160 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:49:21 +00:00
kostello%netscape.com
0c173edadd Fixed FindWidgetHit. Added conditional checks for enumerator code.
git-svn-id: svn://10.0.0.236/trunk@8159 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:48:35 +00:00
kostello%netscape.com
e5e014b0d5 Comment back in nsIButton code
git-svn-id: svn://10.0.0.236/trunk@8158 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:46:07 +00:00
kostello%netscape.com
5e64f2c123 Add support for nsButton
git-svn-id: svn://10.0.0.236/trunk@8157 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:45:21 +00:00
kostello%netscape.com
c130b91c69 Check for null
git-svn-id: svn://10.0.0.236/trunk@8156 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:44:43 +00:00
kostello%netscape.com
5eaf433084 Added mControl -- temporarily, code from nsButton will probably be moved to a superclass
git-svn-id: svn://10.0.0.236/trunk@8155 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:44:02 +00:00
kostello%netscape.com
1d4b465870 First step in converting motif code to mac code.
git-svn-id: svn://10.0.0.236/trunk@8154 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:43:08 +00:00
kostello%netscape.com
08e8a4c960 Changed comment from motif to mac
git-svn-id: svn://10.0.0.236/trunk@8153 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:42:23 +00:00
valeski%netscape.com
e05d07e172 fixed a memory leak
git-svn-id: svn://10.0.0.236/trunk@8152 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:38:03 +00:00
leif%netscape.com
fa2deda6fe *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8150 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:35:57 +00:00
leif%netscape.com
2d5d4601ca *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8149 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:26:44 +00:00
leif%netscape.com
8ef6152a7d Added the setDefaultRebindProc() function back...
git-svn-id: svn://10.0.0.236/trunk@8148 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:26:30 +00:00
pnunn%netscape.com
22b4719a0f fix for #314603. pnunn. code error introduced during the modimglib-branch
landing for nglayout.


git-svn-id: svn://10.0.0.236/trunk@8147 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:24:59 +00:00
cmanske%netscape.com
425a7c0d6d Fixed multiple-freeing of clipboard formats
git-svn-id: svn://10.0.0.236/trunk@8146 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:17:18 +00:00
michaelp%netscape.com
31d0b724ac when killing a window, we now set the GWL_USERDATA to NULL. this will basically
kill the "parent" pointer.


git-svn-id: svn://10.0.0.236/trunk@8145 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:03:34 +00:00
karnaze%netscape.com
b35734172b marginwidth, marginheight set in <frame> is passed to sub doc and added to padding
git-svn-id: svn://10.0.0.236/trunk@8144 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:02:23 +00:00
scullin%netscape.com
986f93c67c Tweek interface to be compatible with branch for now.
git-svn-id: svn://10.0.0.236/trunk@8143 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 22:01:50 +00:00
dcone%netscape.com
f69f171885 added MANIFEST file for cmd/macfe/utility
git-svn-id: svn://10.0.0.236/trunk@8142 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 21:57:10 +00:00
dcone%netscape.com
c6822e5ecf First Checked In.
git-svn-id: svn://10.0.0.236/trunk@8141 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 21:55:56 +00:00
cmanske%netscape.com
9d683269ec Removed unused strings and function
git-svn-id: svn://10.0.0.236/trunk@8140 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 20:25:19 +00:00
cmanske%netscape.com
587d0f6a3b Removed unused strings and function
git-svn-id: svn://10.0.0.236/trunk@8139 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 20:25:17 +00:00
cmanske%netscape.com
aac0f510b3 Table editing menu work, fixing cell display problems.
git-svn-id: svn://10.0.0.236/trunk@8138 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 20:24:39 +00:00
cmanske%netscape.com
148ca16ff1 More table editing work: convert Excel spreadsheet to internal table format for more flexible paste options
git-svn-id: svn://10.0.0.236/trunk@8137 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 20:24:37 +00:00
morse%netscape.com
1030b2ab89 changes for privacy-central pane
git-svn-id: svn://10.0.0.236/trunk@8136 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 20:00:37 +00:00
morse%netscape.com
7240ed73e9 added string for one-site cookie viewer
git-svn-id: svn://10.0.0.236/trunk@8135 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 19:58:45 +00:00
morse%netscape.com
9005c1b29b make it compile with rhapsody compiler
git-svn-id: svn://10.0.0.236/trunk@8134 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 19:40:55 +00:00
ftang%netscape.com
9ae659900c Add vietnam.c into libi18n (libi18l for historic mistake) . Approved by steve.
git-svn-id: svn://10.0.0.236/trunk@8133 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 19:06:24 +00:00
ftang%netscape.com
eb6d9431cc add Vietname VNI into WinFE ui. Thanks Van Le levan@hotmail.com from the net
git-svn-id: svn://10.0.0.236/trunk@8132 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 19:03:36 +00:00
pinkerton%netscape.com
8700ac667d Now generating xSYM info for nsMacMessagePump.cpp in debug target.
git-svn-id: svn://10.0.0.236/trunk@8130 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 17:54:17 +00:00
kostello%netscape.com
77000c658c Fix mac build
git-svn-id: svn://10.0.0.236/trunk@8129 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 17:24:55 +00:00
pinkerton%netscape.com
8f5a39cdcc Removed full paths to PowerPlant and replaced them with compiler relative ones in shlb target.
git-svn-id: svn://10.0.0.236/trunk@8128 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 17:24:43 +00:00
kostello%netscape.com
192779608e These were checked in by mistake
git-svn-id: svn://10.0.0.236/trunk@8127 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 16:45:33 +00:00
despotdaemon%netscape.com
fb46f2e159 Pseudo-automatic update of changes made by freier@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@8126 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 16:37:34 +00:00
dcone%netscape.com
933b9fd29b Added paint and mousemove events, messagepump
git-svn-id: svn://10.0.0.236/trunk@8125 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 16:27:05 +00:00
dcone%netscape.com
7fc549fd57 Added paint and mousemove events
git-svn-id: svn://10.0.0.236/trunk@8124 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 16:23:13 +00:00
wtc%netscape.com
be00ad7fad Define HAVE_LONG_LONG because gcc/g++ support 'long long'.
git-svn-id: svn://10.0.0.236/trunk@8123 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 15:00:22 +00:00
mcafee%netscape.com
32d514c5b4 Next attempt at getting shared libs to build properly
git-svn-id: svn://10.0.0.236/trunk@8122 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 09:07:32 +00:00
mcafee%netscape.com
fa0dd8ad23 Support DLL_SUFFIX if build overrides .so default
git-svn-id: svn://10.0.0.236/trunk@8121 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 09:06:48 +00:00
mcafee%netscape.com
4cafb49f48 Break up some logic so the Rhapsody compiler can handle it.
git-svn-id: svn://10.0.0.236/trunk@8120 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 08:06:12 +00:00
mcafee%netscape.com
bc24633161 Adding support for Unix && NO_X11
git-svn-id: svn://10.0.0.236/trunk@8119 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 07:47:59 +00:00
mcafee%netscape.com
29b92b686f Support for Intel
git-svn-id: svn://10.0.0.236/trunk@8118 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 07:29:04 +00:00
mcafee%netscape.com
b6ffcd996c Rhapsody doesn't have malloc.h
git-svn-id: svn://10.0.0.236/trunk@8117 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 04:43:46 +00:00
troy%netscape.com
ff933d5110 Added GetLogicalPalette() to nsDeviceContextWin
git-svn-id: svn://10.0.0.236/trunk@8116 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 04:11:01 +00:00
joki%netscape.com
8df994b2d9 A couple of macros for getting basic event types
git-svn-id: svn://10.0.0.236/trunk@8115 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 03:47:24 +00:00
hshaw%netscape.com
cd85334f21 Fix build bustage, moral of the story, be very careful with macros which implicitly take & of your arguments
git-svn-id: svn://10.0.0.236/trunk@8114 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 02:54:13 +00:00
troy%netscape.com
2da30889d0 Changed destructor to Interrupt() image group before realeasing reference
git-svn-id: svn://10.0.0.236/trunk@8113 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 01:43:35 +00:00
jgellman%netscape.com
22c8b015c6 changes from wtc and the net for 64 bit machines, almost certainly not the last of them either
git-svn-id: svn://10.0.0.236/trunk@8112 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 01:24:30 +00:00
hshaw%netscape.com
1f308ef5fc Fix buffering problem and memory leak for gzip compressed content. Generic problem was causing assert failure on Windows only
git-svn-id: svn://10.0.0.236/trunk@8111 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 00:14:32 +00:00
kostello%netscape.com
9cd4a71b7c Fix mac build
git-svn-id: svn://10.0.0.236/trunk@8110 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-18 00:09:48 +00:00
buster%netscape.com
2cd93059a0 fixed nested tables for the case where both parent and child table are %-width,
and the columns are any variety of width types


git-svn-id: svn://10.0.0.236/trunk@8109 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 23:37:04 +00:00
kostello%netscape.com
2441f8be8f Added WidgetDebug.o to library
git-svn-id: svn://10.0.0.236/trunk@8108 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 23:36:16 +00:00
troy%netscape.com
99d339efe3 Changed CreateILColorSpace() to GetILColorSpace() (device context now
owns the color space), and cleaned up image renderer code


git-svn-id: svn://10.0.0.236/trunk@8107 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 23:20:42 +00:00
pnunn%netscape.com
6703ee5d5a fix for #313251, migrating #312030 to mozilla. pnunn. ok'd by nisheeth.
git-svn-id: svn://10.0.0.236/trunk@8106 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 22:20:27 +00:00
raman%netscape.com
0415ac2bca Updated the code to get error messages from allxpstr.h
git-svn-id: svn://10.0.0.236/trunk@8105 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 21:12:30 +00:00
rjc%netscape.com
43815ef0da Import IE favorites and history on Mac might like how its also done on Windows.
git-svn-id: svn://10.0.0.236/trunk@8104 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 20:17:06 +00:00
norris%netscape.com
3f00361c40 Allow setting document.domain to remove the port part of the URL for later origin checks.
git-svn-id: svn://10.0.0.236/trunk@8103 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 20:04:23 +00:00
leif%netscape.com
8947cb6020 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8102 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 19:24:50 +00:00
leif%netscape.com
2d28609b8c *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8101 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 19:24:04 +00:00
leif%netscape.com
aa63828e84 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8100 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 19:21:33 +00:00
buster%netscape.com
fad7c8e1ab fixed a memory leak where a style context was not being released when
the table cell set the table column's style.


git-svn-id: svn://10.0.0.236/trunk@8098 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 19:03:36 +00:00
kmcclusk%netscape.com
c871e3a274 Implemented SetFocus.
git-svn-id: svn://10.0.0.236/trunk@8095 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 17:58:37 +00:00
karnaze%netscape.com
ec48384b65 removed text field and browse button of <input type=text> from content model.
git-svn-id: svn://10.0.0.236/trunk@8094 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 17:46:08 +00:00
rods%netscape.com
fab918d441 Add SetFocus so keyboard navigation works.
git-svn-id: svn://10.0.0.236/trunk@8093 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 16:43:07 +00:00
dcone%netscape.com
9be255dd28 fixed up messaging
git-svn-id: svn://10.0.0.236/trunk@8092 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 15:18:28 +00:00
jfrancis%netscape.com
d108641113 Correcting command handling for htmlarea form widgets. Now they no longer take over a host of browser commands like Print, Save, etc.
git-svn-id: svn://10.0.0.236/trunk@8091 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 10:41:54 +00:00
jfrancis%netscape.com
73d4b06bf1 First pass at getting a toolbar up for htmlarea form widgets. It's limping...
git-svn-id: svn://10.0.0.236/trunk@8090 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 09:23:45 +00:00
jfrancis%netscape.com
6cc6d647e1 First pass at getting a toolbar up for htmlarea form widgets. it's limping...
git-svn-id: svn://10.0.0.236/trunk@8089 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 09:22:39 +00:00
raman%netscape.com
f2d3791cf7 C++ implementation of Java objects. These files are not part of the build system yet.
git-svn-id: svn://10.0.0.236/trunk@8088 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 00:45:51 +00:00
raman%netscape.com
3c0523a89e Header files for Java to C conversion. They are not part of the build system yet.
git-svn-id: svn://10.0.0.236/trunk@8087 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 00:44:45 +00:00
ramiro%netscape.com
b30eac787c chilren was being freed twice - what a dumbass error.
Thanks to Matti Aarnio <matti.aarnio@sonera.fi> for pointing this out.


git-svn-id: svn://10.0.0.236/trunk@8086 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-17 00:12:39 +00:00
morse%netscape.com
61d94c0076 restore reference to MK_SIGNON_SELECTUSER, Linux bustage is a dependency-build problem
git-svn-id: svn://10.0.0.236/trunk@8085 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-16 22:57:02 +00:00
morse%netscape.com
cb017264a4 removed MK_SIGNON_SELECTUSER until I determine why it broke Linux dep build on Gromit
git-svn-id: svn://10.0.0.236/trunk@8084 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-16 21:12:53 +00:00
morse%netscape.com
f8d004b1a5 fixed problems when there are multiple usernames for the same form
git-svn-id: svn://10.0.0.236/trunk@8083 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-16 19:41:16 +00:00
morse%netscape.com
98736dbcfa change for single signon
git-svn-id: svn://10.0.0.236/trunk@8082 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-16 19:36:16 +00:00
morse%netscape.com
b9a8b563d0 change for single singon
git-svn-id: svn://10.0.0.236/trunk@8081 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-16 19:35:27 +00:00
mcafee%netscape.com
3869e5eb0f Fixing /* warning on Linux.
git-svn-id: svn://10.0.0.236/trunk@8078 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 18:59:11 +00:00
troy%netscape.com
931e45da01 Destructor now releases ref to image maps
git-svn-id: svn://10.0.0.236/trunk@8076 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 16:25:33 +00:00
morse%netscape.com
17ae035cd9 fix bug in cookie viewer
git-svn-id: svn://10.0.0.236/trunk@8075 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 15:42:18 +00:00
morse%netscape.com
02b6167b4f fixed bug in sigon viewer
git-svn-id: svn://10.0.0.236/trunk@8074 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 15:40:46 +00:00
jfrancis%netscape.com
6633d45f86 Fixing bug #313498
git-svn-id: svn://10.0.0.236/trunk@8073 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 10:11:34 +00:00
jfrancis%netscape.com
6d2b55c44a Adding comment to help prevent recurrences of bug #313498
git-svn-id: svn://10.0.0.236/trunk@8072 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 10:11:17 +00:00
jgellman%netscape.com
4c68be3695 add new arg for HT_PaneFromURL
git-svn-id: svn://10.0.0.236/trunk@8071 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 07:31:21 +00:00
guha%netscape.com
1feb6d428c Fix broken build
git-svn-id: svn://10.0.0.236/trunk@8070 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 06:40:13 +00:00
jgellman%netscape.com
1be8dcf35e Need to add the argument to gRDFMWContext() in one more place
git-svn-id: svn://10.0.0.236/trunk@8068 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 05:57:28 +00:00
troy%netscape.com
ed55c3c760 Added missing NS_INIT_REFCNT()
git-svn-id: svn://10.0.0.236/trunk@8065 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 03:24:27 +00:00
troy%netscape.com
098866905a Changed PR_FREEIF to delete[] (call to nsString::ToNewCString)
git-svn-id: svn://10.0.0.236/trunk@8064 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:53:38 +00:00
guha%netscape.com
2608a095ee output rfc822 (reviewed by rjc)
git-svn-id: svn://10.0.0.236/trunk@8063 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:33:39 +00:00
guha%netscape.com
885c4f8eed Some smart mail related stuff. Reviewed by rjc
git-svn-id: svn://10.0.0.236/trunk@8062 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:32:53 +00:00
mcafee%netscape.com
b9c34b08ec Some libraries (jpeg, xpcom) include nsprpub header files and need to know about USE_PTHREADS for some platforms (SparcLinux/RH5.1).
git-svn-id: svn://10.0.0.236/trunk@8061 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:27:17 +00:00
mcafee%netscape.com
a343fc80f6 Moving USE_PTHREADS define over to mozilla/config/config.mk, more than jpeg needs this.
git-svn-id: svn://10.0.0.236/trunk@8060 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:25:44 +00:00
mcafee%netscape.com
510af228fe jpeg includes nsprpub header files and thus needs to know about USE_PTHREADS for some platforms. Fixes SparcLinux.
git-svn-id: svn://10.0.0.236/trunk@8059 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:19:59 +00:00
morse%netscape.com
0c8d2da8cb fix problems in signon viewer
git-svn-id: svn://10.0.0.236/trunk@8058 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:18:40 +00:00
morse%netscape.com
a3efcf5b6f fix problems in cookie viewer
git-svn-id: svn://10.0.0.236/trunk@8057 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:17:50 +00:00
law%netscape.com
bbea53da38 Fixing bug in Default Browser dialog's Details... button processing
git-svn-id: svn://10.0.0.236/trunk@8056 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 01:01:32 +00:00
law%netscape.com
963a66acfb Adding Control Panel extension; not part of build process yet
git-svn-id: svn://10.0.0.236/trunk@8055 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 00:23:37 +00:00
radha%netscape.com
8491e73254 Declare fe_getPixelFromRGB explicitly to fix bustage in IRIX 6.2
git-svn-id: svn://10.0.0.236/trunk@8054 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 00:20:10 +00:00
joki%netscape.com
250f935f96 Sanity check return values on window.parent, window.top
git-svn-id: svn://10.0.0.236/trunk@8053 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-15 00:13:51 +00:00
gagan%netscape.com
0a8aacf896 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@8051 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 23:48:05 +00:00
toshok%netscape.com
8980cb4162 Track guha's change to allxpstr.rc
git-svn-id: svn://10.0.0.236/trunk@8050 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 23:44:26 +00:00
scullin%netscape.com
db73f7e25e Checked in api changes and some other small changes from the branch.
git-svn-id: svn://10.0.0.236/trunk@8049 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 23:08:54 +00:00
kmcclusk%netscape.com
1dfe01a8e4 Now detects Alt key during keypress and mouse events.
git-svn-id: svn://10.0.0.236/trunk@8048 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 22:58:07 +00:00
thom%netscape.com
cf7eeb834d add nsJLocation and nsLocation to project file
git-svn-id: svn://10.0.0.236/trunk@8047 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 22:53:51 +00:00
kmcclusk%netscape.com
b91145fa0b Now sets shift and control fields in the mouse and keyboard events properly.
git-svn-id: svn://10.0.0.236/trunk@8046 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 22:47:38 +00:00
joki%netscape.com
ad6f7835d1 Modify window.open method to use sizing and location parameters
git-svn-id: svn://10.0.0.236/trunk@8045 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 22:31:38 +00:00
leif%netscape.com
0dc883f526 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8043 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 22:10:29 +00:00
kmcclusk%netscape.com
e2a7a9f113 Fixed keycode translation. Now Page_Up Page_Down Arrow and control keys can
be detected.


git-svn-id: svn://10.0.0.236/trunk@8042 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 22:07:52 +00:00
leif%netscape.com
13cbf0a551 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8041 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 22:03:08 +00:00
leif%netscape.com
ef1a098d84 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@8040 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 21:45:39 +00:00
thom%netscape.com
1d944d9fe8 added nsIRefreshUrl.h to manifest
git-svn-id: svn://10.0.0.236/trunk@8039 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 21:35:42 +00:00
rods%netscape.com
0b456b77a7 Added Page Up, Page Down, Arrow up and Arrow Down key processing.
git-svn-id: svn://10.0.0.236/trunk@8038 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 21:13:40 +00:00
kmcclusk%netscape.com
f027285066 Changed DispatchMouseEvent to take a & (ref).
git-svn-id: svn://10.0.0.236/trunk@8037 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 21:09:36 +00:00
troy%netscape.com
b6c3703c9b Changed destructor to release reference to child form element, and
changed Release() to not check for external references to child form
elements


git-svn-id: svn://10.0.0.236/trunk@8036 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 21:03:16 +00:00
ftang%netscape.com
04fa44a916 add vni support from the net for WinFE. Thansk Van Le <levan@hotmail.com> and folks
git-svn-id: svn://10.0.0.236/trunk@8035 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:40:27 +00:00
ftang%netscape.com
58aaeb13e5 Check in new version of vietnam.c Thansk Van Le <levan@hotmail.com> and folks
git-svn-id: svn://10.0.0.236/trunk@8034 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:39:52 +00:00
ftang%netscape.com
9370f25853 add additional interface. Thansk Van Le <levan@hotmail.com> and folks
git-svn-id: svn://10.0.0.236/trunk@8033 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:39:29 +00:00
ftang%netscape.com
9718b4120d fix typo for last check in
git-svn-id: svn://10.0.0.236/trunk@8032 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:38:08 +00:00
ftang%netscape.com
e9cc907767 remove obsolete csid
git-svn-id: svn://10.0.0.236/trunk@8031 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:37:06 +00:00
uid402
02adef8fc4 Changed the install instructions in the README slightly.
git-svn-id: svn://10.0.0.236/trunk@8030 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:36:55 +00:00
troy%netscape.com
bebcdd15aa Changed NS_NewHTMLInputFile() to release reference to onput text and
input browse content objects


git-svn-id: svn://10.0.0.236/trunk@8029 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:36:36 +00:00
joki%netscape.com
31b1bd5683 Fix queryinterface calls on window.top and window.parent
git-svn-id: svn://10.0.0.236/trunk@8028 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:36:31 +00:00
ftang%netscape.com
0874ae8463 fix assert problem after add csid
git-svn-id: svn://10.0.0.236/trunk@8027 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:35:18 +00:00
uid402
e8010cbccf Perl script to install the Perl binaries without the Makefile. Platform
independent.
run: perl install-bin


git-svn-id: svn://10.0.0.236/trunk@8026 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:32:35 +00:00
scullin%netscape.com
c30c6b85f9 Added a COM false value.
git-svn-id: svn://10.0.0.236/trunk@8025 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:17:20 +00:00
radha%netscape.com
379bb4f52d Set HT properties for the tree view and titlebar.
git-svn-id: svn://10.0.0.236/trunk@8024 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:08:14 +00:00
radha%netscape.com
c75713c87a Register the NavCenter Context menu and HT pane with the XP api.
git-svn-id: svn://10.0.0.236/trunk@8023 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:06:37 +00:00
radha%netscape.com
57faa90884 Fix scrollbar warning messages that appear with opening NavCenter
git-svn-id: svn://10.0.0.236/trunk@8022 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 20:05:37 +00:00
despotdaemon%netscape.com
5ec399bec7 Pseudo-automatic update of changes made by srilatha@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@8021 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 17:31:19 +00:00
buster%netscape.com
b7b8a5e07f * migrated and improved some fixes from the branch to the tip
* fixes sample6, yahoo resizing
* added BasicTableLayoutStrategy::ColIsSpecifiedAsMinimumWidth helper function,
which tells us if the given column has a width attribute that means "make me as small as possible"
* nsTableFrame methods now no longer use mCellMap directly, they ask for it from
GetCellMap which gets the cell map from the first-in-flow.  Only the first-in-flow has a
cell map because the cellmap refers to the table as a single object, not to each table frame.
* Likewise, continuing table frames do not call BalanceColumnWidths or SetTableWidth
which are "global" operations.  Responsibility for these lies with the first-in-flow.


git-svn-id: svn://10.0.0.236/trunk@8020 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 16:16:43 +00:00
troy%netscape.com
00c45ce33c Added NS_RELEASE in ProcessTEXTAREATag(). This fixes a problem with
text area content objects being leaked


git-svn-id: svn://10.0.0.236/trunk@8018 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 05:21:43 +00:00
troy%netscape.com
b459abce80 Added NS_RELEASE of list box widget interface pointer
git-svn-id: svn://10.0.0.236/trunk@8017 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 04:45:30 +00:00
danm%netscape.com
2e33d85796 fix compilation error
git-svn-id: svn://10.0.0.236/trunk@8016 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 03:44:39 +00:00
troy%netscape.com
247047d6f2 Added NS_IF_RELEASE(mAttributes) to destructor
git-svn-id: svn://10.0.0.236/trunk@8015 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 03:32:39 +00:00
ramiro%netscape.com
e1893561e7 Add tool tips.
git-svn-id: svn://10.0.0.236/trunk@8014 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 03:19:24 +00:00
ramiro%netscape.com
3fa2781275 Fix geometry management.
git-svn-id: svn://10.0.0.236/trunk@8013 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 03:19:04 +00:00
ramiro%netscape.com
6d62afd5d0 Add combo test.
git-svn-id: svn://10.0.0.236/trunk@8010 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 03:06:39 +00:00
ramiro%netscape.com
f4cfbcda1f Update link behavior test.
git-svn-id: svn://10.0.0.236/trunk@8009 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 03:06:01 +00:00
cmanske%netscape.com
f9a003f82d Fixed bug that prevented placing caret in empty table cell
git-svn-id: svn://10.0.0.236/trunk@8008 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 03:04:11 +00:00
cmanske%netscape.com
e7aa118264 Tweaked fix for 311835
git-svn-id: svn://10.0.0.236/trunk@8007 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 02:44:43 +00:00
cmanske%netscape.com
01fe200e68 Tweaked fix for 312346 - enable OK button after automatically filling in Alt Text field in dialog
git-svn-id: svn://10.0.0.236/trunk@8006 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 02:35:41 +00:00
spider%netscape.com
ac462a8989 Using JULIAN_TREX_BRANCH again...
git-svn-id: svn://10.0.0.236/trunk@8005 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 01:56:17 +00:00
joki%netscape.com
0e0f4e9f83 Modify editor mode to work in frames
git-svn-id: svn://10.0.0.236/trunk@8004 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 01:51:00 +00:00
cmanske%netscape.com
1d32638925 Fixed warnings thanks to UNIX compilers
git-svn-id: svn://10.0.0.236/trunk@8003 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 01:38:35 +00:00
warren%netscape.com
76776edbf5 Fixed problem where enums were being cast to ints and misaligned causing crash.
git-svn-id: svn://10.0.0.236/trunk@8002 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 01:35:53 +00:00
warren%netscape.com
dd87774491 Fixed GetMIMEDescription for new plugin API.
git-svn-id: svn://10.0.0.236/trunk@8001 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 01:34:01 +00:00
sdagley%netscape.com
696d1114ff Fix a functionality problem with my previous checkin - change the MacFE stubs for FE_CheckConfirm and FE_SelectDialog to the workaround versions until the actual versions are implemented. Yes the tree is in flames but these files aren't related and folks are all over the problem (akkana and jfrancis have checked in fixes for X and Mac).
git-svn-id: svn://10.0.0.236/trunk@8000 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 01:21:46 +00:00
jfrancis%netscape.com
b7d0b14f7c need to use enum ED_PASTE_NORMAL instead of int 0.
git-svn-id: svn://10.0.0.236/trunk@7999 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 01:01:09 +00:00
mcafee%netscape.com
f1af70f3d3 Privacy is passing in nil arguments to ET_PostCheckConfirmBox(), we now check for this. a=joki
git-svn-id: svn://10.0.0.236/trunk@7998 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 00:57:55 +00:00
akkana%netscape.com
9b98bc699e The word from cmanske: build bustage on Mac requires use of enum types,
better do the same on Unix.


git-svn-id: svn://10.0.0.236/trunk@7997 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 00:49:22 +00:00
mcafee%netscape.com
9ef8edddc4 Stubs to fix breakage from privacy backend change.
git-svn-id: svn://10.0.0.236/trunk@7996 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 00:29:13 +00:00
mcafee%netscape.com
57344a9f71 Fixing more XFE breakage
git-svn-id: svn://10.0.0.236/trunk@7995 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 00:26:37 +00:00
leif%netscape.com
f87700665e Added instructions for using CVS.
git-svn-id: svn://10.0.0.236/trunk@7994 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 00:18:56 +00:00
cmanske%netscape.com
c9bab79483 Fixed missing () for function call Unlink. Stupid Windows compiler.
git-svn-id: svn://10.0.0.236/trunk@7993 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-14 00:07:50 +00:00
friedman%netscape.com
5747833a78 Add PerLDAP module.
git-svn-id: svn://10.0.0.236/trunk@7991 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:48:58 +00:00
joki%netscape.com
dc5a875ea9 Adding more window properties and slightly refCnt declaration.
git-svn-id: svn://10.0.0.236/trunk@7990 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:37:54 +00:00
leif
aa3ae981e5 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7989 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:34:50 +00:00
leif
d527e8e9ac First version.
git-svn-id: svn://10.0.0.236/trunk@7988 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:34:45 +00:00
leif
f0786bfcad Cleanup.
git-svn-id: svn://10.0.0.236/trunk@7987 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:34:09 +00:00
leif
00efea357c Fixed the automated installs stuff...
git-svn-id: svn://10.0.0.236/trunk@7986 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:33:49 +00:00
mcafee%netscape.com
f244ced87e Re-adding FE_CheckConfirm() and FE_Select() to match the privacy backend changes.
git-svn-id: svn://10.0.0.236/trunk@7985 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:17:36 +00:00
clu%netscape.com
3952944dd8 adding a third parameter to EDT_PasteHTML
git-svn-id: svn://10.0.0.236/trunk@7984 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:16:16 +00:00
cmanske%netscape.com
524aea47b2 Fixed lots of Composer bugs. Implemented drag/drop/paste cells into existing table. Fixed Reload problems in Navigator (must reload from net to show doc color changes) - permission by blythe
git-svn-id: svn://10.0.0.236/trunk@7983 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:14:59 +00:00
akkana%netscape.com
d733007663 Track cmanske's editor backend API change to EDT_PasteHTML().
git-svn-id: svn://10.0.0.236/trunk@7982 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:14:34 +00:00
cmanske%netscape.com
a43dcf60dd Fixed lots of bugs. Implemented drag/drop/paste cells into existing table.
git-svn-id: svn://10.0.0.236/trunk@7981 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:14:33 +00:00
cmanske%netscape.com
d94f74549a Fixed lots of bugs, more implementation of Composer table editing: drag/drop/paste into existing tables.
git-svn-id: svn://10.0.0.236/trunk@7980 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:14:29 +00:00
troy%netscape.com
4b4f5da5cc Changed enumerator class to use a nsVoidArray object to manage the
list of child widgets


git-svn-id: svn://10.0.0.236/trunk@7979 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 23:01:01 +00:00
leif
b9ac02df78 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7978 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 22:41:10 +00:00
leif
e5bbed718c *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7977 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 22:40:53 +00:00
ftang%netscape.com
46b9e3c2a8 add vietnamese support. Thanks Van Le levan@hotmail.com from the net
git-svn-id: svn://10.0.0.236/trunk@7976 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 22:25:08 +00:00
rpotts%netscape.com
964caa3cf2 Checking in changes from the branch rev 1.7.2.2...
git-svn-id: svn://10.0.0.236/trunk@7975 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 22:18:57 +00:00
sdagley%netscape.com
0f1f79fdd1 Add MacFE stubs for FE_CheckConfirm and FE_SelectDialog for morse's privacy code. danm acquired the appropriate permissions from the module owners for the XP spammage.
git-svn-id: svn://10.0.0.236/trunk@7974 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 22:17:51 +00:00
danm%netscape.com
bedd666c6c synching with FE callback API changes just made by sdagley
git-svn-id: svn://10.0.0.236/trunk@7973 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 22:14:38 +00:00
sdagley%netscape.com
d5018d8a54 Add MacFE stubs for FE_CheckConfirm and FE_SelectDialog for morse's privacy code. danm acquired the appropriate permissions from the module owners for the XP spammage.
git-svn-id: svn://10.0.0.236/trunk@7972 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 22:11:56 +00:00
leif
293e8b27b5 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7971 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 22:03:42 +00:00
rjc%netscape.com
2dab5107cd Changes for better importing of IE favorites, Win9x/NT recent documents, and start menu.
git-svn-id: svn://10.0.0.236/trunk@7970 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:55:12 +00:00
akkana%netscape.com
c5d230a0fe Enable toolbars for Ender.
git-svn-id: svn://10.0.0.236/trunk@7969 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:51:02 +00:00
leif
636d56aae6 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7968 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:32:50 +00:00
rjc%netscape.com
1a88b30501 Now always show "More Options" in properties dialog.
git-svn-id: svn://10.0.0.236/trunk@7967 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:24:29 +00:00
despotdaemon%netscape.com
b7e7517807 Pseudo-automatic update of changes made by leif@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7966 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:20:49 +00:00
dcone%netscape.com
9d748269bf fixed project a memory size
git-svn-id: svn://10.0.0.236/trunk@7965 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:09:26 +00:00
dcone%netscape.com
9b406f30e2 new creation technique
git-svn-id: svn://10.0.0.236/trunk@7964 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:09:01 +00:00
dcone%netscape.com
012700d3f9 reworked the window creation
git-svn-id: svn://10.0.0.236/trunk@7963 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:08:11 +00:00
dcone%netscape.com
b1c554316f reworked message pump and window creation
git-svn-id: svn://10.0.0.236/trunk@7962 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:07:35 +00:00
dcone%netscape.com
84b722c90b First Checked In.
git-svn-id: svn://10.0.0.236/trunk@7961 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 21:06:30 +00:00
vidur%netscape.com
dbaa6e8414 Unqualified references to location need to go through a resolve method
git-svn-id: svn://10.0.0.236/trunk@7960 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:46:11 +00:00
michaelp%netscape.com
ea5ad75fbf fixed really nasty allocation error.
git-svn-id: svn://10.0.0.236/trunk@7959 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:39:30 +00:00
pinkerton%netscape.com
e113e25c26 Tree view icon support and refreshing individual rows.
git-svn-id: svn://10.0.0.236/trunk@7958 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:13:07 +00:00
pinkerton%netscape.com
0a6ba7b96e Dispose of FE icon data and refresh appropriate rows when necessary.
git-svn-id: svn://10.0.0.236/trunk@7957 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:12:36 +00:00
valeski%netscape.com
09a03524ca network/module/Makefile -
1. 310133 - Added nsIRefreshUrl.h to the list of exports.

network/module/makefile.win -
1. 310133 - Added nsIRefreshUrl.h to the list of exports.

network/module/nsIHttpUrl.h -
1. 310133 - Extended the nsIHttpUrl interface to include the AddMimeHeader() method which adds an http header to the url.

network/module/nsHttpUrl.cpp -
310133 - 1. Added support for the AddMimeHeader() method so http urls can have headers added outside of the actual data retrieval in netlib. This method calls NET_ParseMimeHeader() directly.
2. Added a public member, a pointer to the netlib URL_Struct that was created for this nsHttpUrlImpl. This pointer is the link between netlib and the outside world; the adhesive agent between url structs and nsURLImpls.

network/module/nsNetStream.h -
1. 310133 - Added a public memeber variable to nsConnectionInfo. It's a bool that tells us whether or not a redirect has occurred.

network/module/nsNetStream.cpp -
1. 310133 - Added initialization (FALSE) of new redirect member.

network/module/nsNetStubs.cpp -
1. 310133 - Implemented FE_SetRefreshURLTimer(). This function is called from NET_GetURL() when we recognize that we have a url to refresh.

network/module/nsStubContext.cpp -
1. 310133 - Added check to see if we're redirecting in stub_complete() which gets called when a stream completes. If we are, we don't want to release/destroy the pConsumer, this will happen in nsNetService's bam_exit_routine().

network/module/nsNetService.cpp -
1. 310133 - added nsConnectionInfo->redirect check in bam_exit_routine() so we give the consumer a successful binding event if the consumer is still around. This is iffy.


git-svn-id: svn://10.0.0.236/trunk@7956 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:10:49 +00:00
valeski%netscape.com
3deae00620 310133 - Injected code into HTMLContentSink::ProcessMETATag() to check for an "http-equiv" header (specifically the Refresh header). If found, an nsIHTTPUrl interface is retrieved so the "http-equiv" header can be added to the url struct.
git-svn-id: svn://10.0.0.236/trunk@7955 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:09:10 +00:00
valeski%netscape.com
51e34f63fd webshell/src/nsDocLoader.cpp -
310133 - 1. added LoadURLOnTimer() and CancelLoadURLTimer() implementations to the nsDocLoaderImpl class.
2. Changed nsDocumentBindInfo class to support the nsIRefreshUrl interface.
3. Changed the nsDocumentBindInfo contructor to set the m_ExtraInfo variable to the aExtraInfo pointer passed in. This must have been an oversight on the part of the original implementor.
4. Added a simple data placeholder class to hold the data that will be used to load the url on the timer.

webshell/src/nsWebShell.cpp -
1. 310133 - When the webshell is destructed or about to load a new url, the loader now calls CancelLoadURLTimer() which cancels and releases the timers.


git-svn-id: svn://10.0.0.236/trunk@7954 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:08:19 +00:00
valeski%netscape.com
82dfe101eb 310133 - Extended the nsIDocumentLoader interface to include LoadURLOnTimer() and CancelLoadURLTimer() methods.
git-svn-id: svn://10.0.0.236/trunk@7953 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:07:17 +00:00
valeski%netscape.com
4fb073d7b5 310133 - Added nsIRefreshUrl.h to the build. This file defines the nsIRefreshUrl interface which simply declares a method that allows a url to be refreshed/reloaded after a given interval.
git-svn-id: svn://10.0.0.236/trunk@7952 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 20:05:13 +00:00
ftang%netscape.com
9167901dff vietnamese Unicode conversion table. Thanks Van Le <levan@hotmail.com> from the net
git-svn-id: svn://10.0.0.236/trunk@7951 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 19:36:43 +00:00
ftang%netscape.com
09aa7d4f87 add vietnamese support. Thanks Van Le <levan@hotmail.com> from the net
git-svn-id: svn://10.0.0.236/trunk@7950 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 19:33:52 +00:00
ftang%netscape.com
2fd51b0ffd add/change vietnamese csid. Thanks Van Le <levan@hotmail.com> from the net
git-svn-id: svn://10.0.0.236/trunk@7949 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 19:29:31 +00:00
ftang%netscape.com
a7f64fc9f6 extend the unicode conversion from max 64 to max 128
git-svn-id: svn://10.0.0.236/trunk@7948 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 19:26:19 +00:00
vidur%netscape.com
fed6b7c5b9 Implemented document.location.
git-svn-id: svn://10.0.0.236/trunk@7947 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 19:08:01 +00:00
vidur%netscape.com
fcc42987f9 Implemented document.location and better handling of named lookups that fail.
git-svn-id: svn://10.0.0.236/trunk@7946 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 19:07:45 +00:00
vidur%netscape.com
a7c49785ad Fixed problem with mSpec being allocated with something other than PR_Malloc
git-svn-id: svn://10.0.0.236/trunk@7945 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 19:05:36 +00:00
clayton
e09bd6817c This version contains the ldap_set_default_rebind function.
git-svn-id: svn://10.0.0.236/trunk@7944 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 13:10:24 +00:00
leif
381c9be10d *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7943 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 12:05:09 +00:00
leif
ca9f7091d0 Fixed bug with ldap_modify().
git-svn-id: svn://10.0.0.236/trunk@7942 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 12:02:27 +00:00
leif
3ae40d6231 Tons of smaller changes...
git-svn-id: svn://10.0.0.236/trunk@7941 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 11:02:56 +00:00
leif
8d40d7c328 This actually works now...
git-svn-id: svn://10.0.0.236/trunk@7940 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 11:02:40 +00:00
leif
650f5e5be6 Updated docs, minor changes...
git-svn-id: svn://10.0.0.236/trunk@7939 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 11:02:28 +00:00
leif
6795a4601b *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7938 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 11:02:16 +00:00
leif
0ff2f0e243 Lots of minor changes...
git-svn-id: svn://10.0.0.236/trunk@7937 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 11:02:11 +00:00
leif
4df7ac1232 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7936 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 09:56:03 +00:00
leif
11c4d15935 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7935 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 09:35:23 +00:00
leif
d9ee777d88 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7934 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 09:28:05 +00:00
leif
6a76ad2121 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7933 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 09:15:00 +00:00
rickg%netscape.com
bfb431615a a few more bug fixes. Ain't life grand
git-svn-id: svn://10.0.0.236/trunk@7931 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 08:51:52 +00:00
rickg%netscape.com
306a961f75 a host of propagation bugs and a comment bug to boot
git-svn-id: svn://10.0.0.236/trunk@7930 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 08:33:18 +00:00
rpotts%netscape.com
246f5b3065 Fixed OnDataAvailable(...) to abort the stream if it returns a failure code...
git-svn-id: svn://10.0.0.236/trunk@7929 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 08:19:49 +00:00
law%netscape.com
1674edc74a Add support for showing stand-alone preferences
git-svn-id: svn://10.0.0.236/trunk@7924 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 07:09:49 +00:00
law%netscape.com
a761017acc Now using new nsIDefaultBrowser interface
git-svn-id: svn://10.0.0.236/trunk@7923 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 07:07:20 +00:00
law%netscape.com
741055ce9e Adding nsIDefaultBrowser.cpp to the build
git-svn-id: svn://10.0.0.236/trunk@7922 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 07:05:48 +00:00
law%netscape.com
b5b7132400 Suppport for m_bShowPrefsOnStartup
git-svn-id: svn://10.0.0.236/trunk@7921 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 07:02:55 +00:00
law%netscape.com
6ab9e7bf1d Adding support for Details... button on Default Browser dialog
git-svn-id: svn://10.0.0.236/trunk@7920 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 06:58:58 +00:00
law%netscape.com
4b476db077 Added support for -prefs cmd line arg
git-svn-id: svn://10.0.0.236/trunk@7919 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 06:50:08 +00:00
law%netscape.com
f81a5a6de9 Adding m_bShowPrefsOnStartup to handle showing prefs on startup (duh)
git-svn-id: svn://10.0.0.236/trunk@7918 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 06:47:17 +00:00
law%netscape.com
f329135fce Enabled new Details... button on Default Browser dialog
git-svn-id: svn://10.0.0.236/trunk@7917 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 06:44:47 +00:00
law%netscape.com
3efd86a555 Added #define for new Details... button on Default Browser dialog
git-svn-id: svn://10.0.0.236/trunk@7916 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 06:42:19 +00:00
law%netscape.com
4432299836 New 'default browser' interface
git-svn-id: svn://10.0.0.236/trunk@7915 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 06:36:39 +00:00
law%netscape.com
b83f90da3f Adding support for new 'desktop' preferences
git-svn-id: svn://10.0.0.236/trunk@7914 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 06:34:31 +00:00
vidur%netscape.com
e93758344d Implemented Reload() on nsIWebShell
git-svn-id: svn://10.0.0.236/trunk@7911 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:49:16 +00:00
vidur%netscape.com
3357387df9 Correctly implemented reload
git-svn-id: svn://10.0.0.236/trunk@7910 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:48:57 +00:00
wtc%netscape.com
c73172bda1 Deleted the code that sets BYTE_ORDER to LITTLE_ENDIAN on Linux, whic
on big-endian machines.  Use __osf__ instead of __alpha to identify
Digital Unix, which has <machine/endian.h>.
Files changed: mozilla/include/mcom_db.h, mozilla/dbm/include/mcom_db.h.


git-svn-id: svn://10.0.0.236/trunk@7909 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:47:03 +00:00
clayton
1861d5eee1 Removed a few stale files
Updated the MANIFEST to reflect these removals
Made a few minor changes to the top bits of test_api


git-svn-id: svn://10.0.0.236/trunk@7908 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:40:02 +00:00
wtc%netscape.com
8d30332e71 Use $< so that VPATH works.
git-svn-id: svn://10.0.0.236/trunk@7907 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:39:45 +00:00
wtc%netscape.com
b0a48fbf1e Increase the timer interval from 1ms to 8ms.
git-svn-id: svn://10.0.0.236/trunk@7906 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:38:42 +00:00
vidur%netscape.com
0108cd6479 Added modifyHistory option to LoadURL.
git-svn-id: svn://10.0.0.236/trunk@7905 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:36:42 +00:00
vidur%netscape.com
7ea13344a9 Added better handling of search component of URL. Added GetSearch() method to nsIURL.
git-svn-id: svn://10.0.0.236/trunk@7904 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:35:37 +00:00
wtc%netscape.com
f29f8fce60 OPTIMIZER: use -O2 in optimized builds. Do not use -g (for now) in
debug builds because it would produce a huge executable.


git-svn-id: svn://10.0.0.236/trunk@7902 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:35:20 +00:00
vidur%netscape.com
b4cfda9c36 Implemented window.location
git-svn-id: svn://10.0.0.236/trunk@7901 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:34:53 +00:00
clayton
c009851510 Release Notes
git-svn-id: svn://10.0.0.236/trunk@7900 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:34:42 +00:00
clayton
fa9ddfc227 Fixed the documentation a bit. Still needs lots of work.
git-svn-id: svn://10.0.0.236/trunk@7898 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 04:11:20 +00:00
spider%netscape.com
171bde7d61 Create a GC for toplevel window to. Some app's need to modify that
DC also.


git-svn-id: svn://10.0.0.236/trunk@7896 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 02:36:40 +00:00
mcafee%netscape.com
026f6b6932 Backing out stubs, waiting for mac.
git-svn-id: svn://10.0.0.236/trunk@7895 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 01:04:47 +00:00
michaelp%netscape.com
07f92ff77f fixed build.
git-svn-id: svn://10.0.0.236/trunk@7893 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 00:07:09 +00:00
michaelp%netscape.com
c340b6115c fixed crash where widgets would return null clientdata because they were going
away, but the view was assuming the clientdata was non-null.


git-svn-id: svn://10.0.0.236/trunk@7892 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 00:03:41 +00:00
mcafee%netscape.com
3b3f387ff8 Checking in stubs for FE_CheckConfirm() and FE_SelectDialog() to match backend changes from danm.
git-svn-id: svn://10.0.0.236/trunk@7891 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-13 00:02:06 +00:00
joki%netscape.com
9248af60f9 Adding url and lineno to script evaluation
git-svn-id: svn://10.0.0.236/trunk@7890 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 23:37:50 +00:00
despotdaemon%netscape.com
9a07fcffbe Pseudo-automatic update of changes made by terry@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7889 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 23:25:07 +00:00
toshok%netscape.com
503bc43e9d Fix non windows build - FE_CheckConfirm needs to have the same number of arguments in both the XP_WIN/not XPWIN cases.
git-svn-id: svn://10.0.0.236/trunk@7888 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 22:59:36 +00:00
radha%netscape.com
bdfe2c7f8d Cut and refresh context menus fixed. basic code for "rename" context menu. It doesn't work though.
git-svn-id: svn://10.0.0.236/trunk@7887 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 22:55:16 +00:00
toshok%netscape.com
8cf64a1e7a add elements for SUPER and SUB, so that we don't lose the basline adjustment on resize (bug 313426).
git-svn-id: svn://10.0.0.236/trunk@7886 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 22:33:32 +00:00
joki%netscape.com
e3c22b329f Fix script src equals problem when src contained in quotes.
git-svn-id: svn://10.0.0.236/trunk@7885 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 22:28:50 +00:00
mccabe%netscape.com
6b768767e5 Towards running w/o crashing on alpha linux; add -mieee flag to ask
the compiler to puhleeze let us used denormalized floating point
values, as required by the ECMA spec.  Thanks to various contributors,
including Torsten Rüger <torsten@ponton-hamburg.de>, for working on
numeric issues.  Fix courtesy wtc.


git-svn-id: svn://10.0.0.236/trunk@7884 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 22:09:21 +00:00
michaelp%netscape.com
57d078a555 with -np plugins will no longer be initialized due to frames.
git-svn-id: svn://10.0.0.236/trunk@7883 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 22:06:00 +00:00
karnaze%netscape.com
4b3c007400 fixed destructor problems causing www.goto.com to crash when hitting a link
git-svn-id: svn://10.0.0.236/trunk@7882 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:50:11 +00:00
danm%netscape.com
12210d405c XP_WIN versions of the privacy FE dialogs
git-svn-id: svn://10.0.0.236/trunk@7881 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:46:09 +00:00
joki%netscape.com
7d9a5f054b Change so browser window doesn't assume it has toolbars.
git-svn-id: svn://10.0.0.236/trunk@7878 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:41:05 +00:00
spider%netscape.com
8ab71a4f33 win fix
git-svn-id: svn://10.0.0.236/trunk@7877 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:36:51 +00:00
saari%netscape.com
4a3b86fd65 Mac only I/O buffer size increases
Eliminating speed bottlenecks.


git-svn-id: svn://10.0.0.236/trunk@7875 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:30:26 +00:00
kmcclusk%netscape.com
74d9f63edf Removed bogus ValidateDocData, XP_ReBuffer and XP_Trace stubs. They exists in
their correct form in nsStubs.cpp


git-svn-id: svn://10.0.0.236/trunk@7874 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:24:25 +00:00
wtc%netscape.com
eab72fa10c Linux/Alpha needs the -mieee compiler flag to turn on IEEE floating
point arithmetics.


git-svn-id: svn://10.0.0.236/trunk@7873 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:18:20 +00:00
michaelp%netscape.com
245e23bf94 we now allocate a single offscreen buffer.
git-svn-id: svn://10.0.0.236/trunk@7872 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:17:52 +00:00
kmcclusk%netscape.com
effee43052 Added output to indicate when a stubbed function is called.
git-svn-id: svn://10.0.0.236/trunk@7871 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:13:52 +00:00
kmcclusk%netscape.com
cd2fea256c Added stubs for ValidateDocData XP_ReBuffer and XP_Trace to
get Linux build to work.


git-svn-id: svn://10.0.0.236/trunk@7870 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:04:30 +00:00
kipp%netscape.com
b2394552d2 Allocate IID's for nsLoggingSink and nsILoggingSink
git-svn-id: svn://10.0.0.236/trunk@7869 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:04:13 +00:00
ftang%netscape.com
781c66d991 add vps.u{f,t} . Thanks Van Le <levan@hotmail.com> from the net
git-svn-id: svn://10.0.0.236/trunk@7868 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 21:00:20 +00:00
ftang%netscape.com
d967652794 add credit lines
git-svn-id: svn://10.0.0.236/trunk@7867 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 20:58:12 +00:00
leif
e2da977586 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7866 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 20:56:38 +00:00
rjc%netscape.com
faf5a18763 Small context changes for HT_Properties() and HT_Find().
git-svn-id: svn://10.0.0.236/trunk@7863 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 20:17:23 +00:00
rods%netscape.com
946b729944 Changed the WindowStyle so the scrollbar appears when the list is larger
than the given bounding rectangle.


git-svn-id: svn://10.0.0.236/trunk@7862 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 20:10:41 +00:00
rods%netscape.com
2fae720c82 Change the calculation of how big the dropdown list should be. The max size
is now 20.


git-svn-id: svn://10.0.0.236/trunk@7861 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 20:05:25 +00:00
rjc%netscape.com
de0f1197c4 Export XP_StripLine (needed by RDF)
git-svn-id: svn://10.0.0.236/trunk@7860 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:58:53 +00:00
rjc%netscape.com
9a73eb510a Fix SMART_MAIL for Mac.
git-svn-id: svn://10.0.0.236/trunk@7859 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:58:08 +00:00
kmcclusk%netscape.com
5121e1c95d Save the alpha buffer in a member variable.
git-svn-id: svn://10.0.0.236/trunk@7858 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:57:05 +00:00
kmcclusk%netscape.com
93e107e40c Added unix support for PR_ProcessPendingEvents.
git-svn-id: svn://10.0.0.236/trunk@7857 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:54:39 +00:00
kmcclusk%netscape.com
77190afa2b Added support for PR_ProcessPendingEvents. This allows the unix viewer to
support clicks on links + submitting form data.


git-svn-id: svn://10.0.0.236/trunk@7856 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:52:03 +00:00
michaelp%netscape.com
12aba7b5f6 fixed *massive* memory leak.
git-svn-id: svn://10.0.0.236/trunk@7855 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:50:13 +00:00
mccabe%netscape.com
0124b1e0d6 modified #if from __alpha to __osf__, because Alpha/Linux also runs on
an alpha processor, and we really want to know osf instead.  Courtesy
wtc.


git-svn-id: svn://10.0.0.236/trunk@7854 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:45:04 +00:00
ftang%netscape.com
48bed973ed Add vps.txt for unicode conversion . Thaks Van Le <levan@hotmail.com> from the net
git-svn-id: svn://10.0.0.236/trunk@7853 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:18:59 +00:00
ftang%netscape.com
80c21af885 fix problem with #
git-svn-id: svn://10.0.0.236/trunk@7852 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:16:01 +00:00
ftang%netscape.com
67f2e2e9d0 fix # problem
git-svn-id: svn://10.0.0.236/trunk@7851 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:10:35 +00:00
ftang%netscape.com
449630c7aa Merge changes from nhotta's fix in 4.5. Approved by blythe
git-svn-id: svn://10.0.0.236/trunk@7850 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:03:57 +00:00
pinkerton%netscape.com
0d81ee22e3 Bring in edges on popdown tree for sunken bevel.
git-svn-id: svn://10.0.0.236/trunk@7849 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:48:42 +00:00
pinkerton%netscape.com
5dd51c3800 Draw popdown tree with a sunken bevel border.
git-svn-id: svn://10.0.0.236/trunk@7848 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:48:27 +00:00
pinkerton%netscape.com
952cfce6fc No longer try and cache the popdown tree. Just delete/recreate every time because of problems with LScroller and changing windows.
git-svn-id: svn://10.0.0.236/trunk@7847 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:47:54 +00:00
blythe%netscape.com
533a094be9 fix from martin.nilsson@bigfoot.com for transparency problems in bitmap
git-svn-id: svn://10.0.0.236/trunk@7846 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:47:46 +00:00
peterl%netscape.com
0b78318def made parse color compress whitespace first
git-svn-id: svn://10.0.0.236/trunk@7845 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:28:55 +00:00
spider%netscape.com
871644f0ce win fix
git-svn-id: svn://10.0.0.236/trunk@7844 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:06:34 +00:00
kostello%netscape.com
e44707e1f4 Added widgetDebug.o as a target
git-svn-id: svn://10.0.0.236/trunk@7843 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:05:30 +00:00
spider%netscape.com
8389ba629e more platform libs
git-svn-id: svn://10.0.0.236/trunk@7842 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:05:19 +00:00
kostello%netscape.com
a248b2ece8 Added support for widget project
git-svn-id: svn://10.0.0.236/trunk@7841 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:02:57 +00:00
kipp%netscape.com
50897d17a2 Use new forwarding macros
git-svn-id: svn://10.0.0.236/trunk@7840 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 18:00:04 +00:00
spider%netscape.com
2c6a47a86f Adding Verions_number
git-svn-id: svn://10.0.0.236/trunk@7839 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 17:59:45 +00:00
kipp%netscape.com
1bc6522fc6 Revised forwarding macros
git-svn-id: svn://10.0.0.236/trunk@7838 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 17:57:25 +00:00
vidur%netscape.com
f13227df6b Correctly deal with BODY tag BACKGROUND attribute that is an empty string.
git-svn-id: svn://10.0.0.236/trunk@7837 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 17:51:31 +00:00
vidur%netscape.com
1e93a4fa52 null check before we release a stream in the failure case.
git-svn-id: svn://10.0.0.236/trunk@7835 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 17:14:54 +00:00
dcone%netscape.com
9e295aa4b3 added client routine
git-svn-id: svn://10.0.0.236/trunk@7834 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 15:23:23 +00:00
dcone%netscape.com
bb56671c90 added client routine
git-svn-id: svn://10.0.0.236/trunk@7833 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 15:23:04 +00:00
dcone%netscape.com
4c73c57cc0 took out method causing link errors
git-svn-id: svn://10.0.0.236/trunk@7832 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 13:46:34 +00:00
dcone%netscape.com
efdb6ba539 took out some functions causing link problem
git-svn-id: svn://10.0.0.236/trunk@7831 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 13:46:08 +00:00
dcone%netscape.com
642ce908b4 put quit when a key is hit - temporary
git-svn-id: svn://10.0.0.236/trunk@7830 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 13:45:13 +00:00
kin%netscape.com
5a4087e268 Fix for bug #313408: Need to update HG10297 and HG81272 macros in rosetta.h
and fix for Memory leak introduced in yesterdays checkin.
Files checked in: Command.cpp, Command.h and EditorView.cpp


git-svn-id: svn://10.0.0.236/trunk@7829 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 12:38:38 +00:00
chuckb%netscape.com
931784787e inadvertant change
git-svn-id: svn://10.0.0.236/trunk@7827 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 11:01:24 +00:00
chuckb%netscape.com
fe67c57f68 Mac project
git-svn-id: svn://10.0.0.236/trunk@7822 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 10:54:12 +00:00
chuckb%netscape.com
8208d07569 Manifest file
git-svn-id: svn://10.0.0.236/trunk@7821 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 10:52:51 +00:00
chuckb%netscape.com
3b12429626 DIRECTORY_C_SDK_30_BRANCH to TRUNK merge
git-svn-id: svn://10.0.0.236/trunk@7820 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 10:44:46 +00:00
chuckb%netscape.com
371fd21165 DIRECTORY_C_SDK_30_BRANCH to TRUNK merge
git-svn-id: svn://10.0.0.236/trunk@7819 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 10:35:35 +00:00
rickg%netscape.com
2167e0743c many parser bugs; better backward propagation
git-svn-id: svn://10.0.0.236/trunk@7818 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 08:53:55 +00:00
rickg%netscape.com
a6d383461e fixed objectAT() offset error
git-svn-id: svn://10.0.0.236/trunk@7817 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 08:53:03 +00:00
troy%netscape.com
f2ddc6fce9 Fixed potential leak of alpha bits if image is destroyed before
being optimized


git-svn-id: svn://10.0.0.236/trunk@7814 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 05:40:03 +00:00
troy%netscape.com
7846ca35d8 Fixed leak of an HTML Meta content object
git-svn-id: svn://10.0.0.236/trunk@7813 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 05:27:21 +00:00
joki%netscape.com
1e5f0b9259 Adding new doc loader observer interface.
git-svn-id: svn://10.0.0.236/trunk@7812 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 05:15:38 +00:00
troy%netscape.com
828d5f7aa0 Made sure event state manager was always released
git-svn-id: svn://10.0.0.236/trunk@7811 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 05:09:07 +00:00
joki%netscape.com
9106b337ee Adding partial load event support, removing script context Run_GC method adding partial script error support
git-svn-id: svn://10.0.0.236/trunk@7810 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 04:56:40 +00:00
troy%netscape.com
96b2f94853 Eliminated circular reference between table row and table cell
git-svn-id: svn://10.0.0.236/trunk@7809 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 04:45:17 +00:00
troy%netscape.com
aa64a059e4 Added release of row group context object
git-svn-id: svn://10.0.0.236/trunk@7808 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 04:09:43 +00:00
morse%netscape.com
bbdb3cc988 improved signon viewer
git-svn-id: svn://10.0.0.236/trunk@7807 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 04:03:33 +00:00
morse%netscape.com
ddca9da0a2 improved cookie viewer, approved by valeski
git-svn-id: svn://10.0.0.236/trunk@7806 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 03:59:45 +00:00
troy%netscape.com
4293d95f15 Eliminated memory leak of a content object in ProcessInitialReflow() when
doing special processing for list-item containers


git-svn-id: svn://10.0.0.236/trunk@7804 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 03:22:24 +00:00
michaelp%netscape.com
218b5af820 added changes for using directx draw with msvc 5.0.
git-svn-id: svn://10.0.0.236/trunk@7803 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 02:21:06 +00:00
karnaze%netscape.com
1dc52f388d ref counting, destruction fixes
git-svn-id: svn://10.0.0.236/trunk@7802 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 02:04:41 +00:00
troy%netscape.com
6b980541fe Fixed a leak of the HTML title
git-svn-id: svn://10.0.0.236/trunk@7801 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 01:36:25 +00:00
spider%netscape.com
f5f5f829b6 Fix Raptor Unix bustage. SignleSignon not supported when using modular
netlib.


git-svn-id: svn://10.0.0.236/trunk@7800 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 01:31:21 +00:00
troy%netscape.com
641b8e79ca Fixed leak of a bullet content object
git-svn-id: svn://10.0.0.236/trunk@7799 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 01:26:25 +00:00
donm%netscape.com
26ba1bf6a8 Fixing 5.0 bustage. This is a big hack. Kin will fix soon.
git-svn-id: svn://10.0.0.236/trunk@7798 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 01:14:26 +00:00
michaelp%netscape.com
7d07ec46f1 fixed nasty DeleteDC() in destructor.
git-svn-id: svn://10.0.0.236/trunk@7797 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 01:05:40 +00:00
michaelp%netscape.com
1d2a0b6edf changes to support use of DirectDraw.
git-svn-id: svn://10.0.0.236/trunk@7796 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 00:59:00 +00:00
kostello%netscape.com
2902b0ff40 Synched with windows build
git-svn-id: svn://10.0.0.236/trunk@7795 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 00:52:13 +00:00
cmanske%netscape.com
ef6f578730 Removing comment that doesn't apply anymore. With permission of pnunn
git-svn-id: svn://10.0.0.236/trunk@7794 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 00:40:33 +00:00
gagan%netscape.com
d32b05510e Fixed bug #313386. Very classic example of not using const keyword. rev/cmanske app/pnunn.
git-svn-id: svn://10.0.0.236/trunk@7793 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 00:33:53 +00:00
spider%netscape.com
1eb74866f3 Use Nav45 branch instead of julian
git-svn-id: svn://10.0.0.236/trunk@7792 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 00:28:26 +00:00
spider%netscape.com
d34a9f8b08 Use Nav45_BRANCH of julian instead of TREX_BRANCH
git-svn-id: svn://10.0.0.236/trunk@7791 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 00:25:05 +00:00
peterl%netscape.com
74371d3099 re-enable non-truetype fonts
git-svn-id: svn://10.0.0.236/trunk@7789 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 23:54:29 +00:00
peterl%netscape.com
5d334db003 force aliasing of courier font
git-svn-id: svn://10.0.0.236/trunk@7788 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 23:54:04 +00:00
kostello%netscape.com
54564cce76 Added nsHTMLEntities.h
git-svn-id: svn://10.0.0.236/trunk@7787 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 23:42:06 +00:00
akkana%netscape.com
640890cfd1 Don't show caret on inactive Ender areas. Reviewed by cmanske.
git-svn-id: svn://10.0.0.236/trunk@7786 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 22:59:45 +00:00
wtc%netscape.com
e239c9639f Added dgux.mk, contributed by Marc Fraioli <fraioli@dg-rtp.dg.com>.
git-svn-id: svn://10.0.0.236/trunk@7785 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 22:47:22 +00:00
troy%netscape.com
abd69964ac Added NS_RELEASE in FlushText() of interface returned from QueryInterface()
git-svn-id: svn://10.0.0.236/trunk@7784 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 22:44:28 +00:00
ftang%netscape.com
f1bb7fc419 fix bug 302137 by fallback to - on Mac. This is not really a fix . The real fix won't be here untill we have full Unicode support
git-svn-id: svn://10.0.0.236/trunk@7783 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 22:40:06 +00:00
wtc%netscape.com
c6841eb8dc Checked in DG/UX port contributed by Marc Fraioli <fraioli@dg-rtp.dg.com>.
New files: dgux.mk, _dgux.cfg, _dgux.h, and dgux.c.
Files changed: lib/msgc/tests/Makefile, pr/include/md/Makefile,
_unixos.h, prosdep.h, prsocket.c, pr/src/md/unix/Makefile,
pr/src/md/unix/objs.mk, unix.c.


git-svn-id: svn://10.0.0.236/trunk@7782 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 22:29:48 +00:00
ftang%netscape.com
c263a0fa0b add koi8u to the cyrillic list, also fix bug 76586 by adding font list rearrange code
git-svn-id: svn://10.0.0.236/trunk@7781 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 22:22:42 +00:00
pnunn%netscape.com
50e4394083 still need jerror.h. Thanks, Rick.
git-svn-id: svn://10.0.0.236/trunk@7780 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 22:08:39 +00:00
kin%netscape.com
eb56983f0b Modifications neccessary to route commands to the correct ENDER object
(HTMLArea) on the page. Approved and reviewd by ramiro and akkana.

Command.cpp
Command.h
    - Modified the XFE_ViewCommand constructor to take a view
      argument (defaults to NULL when not provided). If not NULL,
      this view is used to dispatch the command.

EditorView.cpp
EditorView.h
    - Modified all XFE_EditorViewCommands to take a view argument
      for their constructors to pass on to XFE_ViewCommand. Only
      ENDERs pass non-NULL views to the constructors, so the Editor
      still dispatches commands the way it always has.

Frame.cpp
Frame.h
    - Modified xfe_ExecuteCommand to take a cmdDispatcher argument.
      If non-null, it is casted to either a frame or view and then
      used to dispatch the command passed in. If it is null,
      xfe_ExecuteCommand dispatches as it always has.

Menu.cpp
Menu.h
PopupMenu.cpp
PopupMenu.h
    - Modified XFE_Menu and XFE_PopupMenu constructors to take a
      cmdDispatch argument. If it is non null, it is used to dispatch
      the command that is attatched to the menuitem.

MozillaApp.cpp
    - Modified xfeDoCommandAction ENDER code to call xfe_ExecuteCommand(),
      passing in the view as the cmdDispatcher.

View.cpp
    - Removed unused local variable in removeView(), to fix compiler
      warning.
    - Modified getCommandView() to recurse down the entire View tree
      to find a view that can handle a command. The old code only looked
      one level deep.


git-svn-id: svn://10.0.0.236/trunk@7778 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 21:50:47 +00:00
jgellman%netscape.com
1aa1a35e7d got jwz's libmime changes building on windows
git-svn-id: svn://10.0.0.236/trunk@7777 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 21:30:43 +00:00
jgellman%netscape.com
b933a69e6a added ifdef's needed
git-svn-id: svn://10.0.0.236/trunk@7776 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 21:27:14 +00:00
jgellman%netscape.com
489cc97f73 got jwz's libmime changes building on windows
git-svn-id: svn://10.0.0.236/trunk@7775 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 21:24:29 +00:00
ftang%netscape.com
2583671f73 fix typo in Ukrainian
git-svn-id: svn://10.0.0.236/trunk@7774 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 21:14:47 +00:00
karnaze%netscape.com
3e00e74d71 removed references to nsIWebFrame
git-svn-id: svn://10.0.0.236/trunk@7773 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 21:13:37 +00:00
pnunn%netscape.com
c325f7569e Removed extraneous include file. Tom Lane, committed by pnunn.
git-svn-id: svn://10.0.0.236/trunk@7772 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 20:45:59 +00:00
pnunn%netscape.com
da1819c629 remove dependencies on jpeg files. Tom Lane, committed by pnunn.
git-svn-id: svn://10.0.0.236/trunk@7771 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 20:45:18 +00:00
dcone%netscape.com
f0ea5eb238 mac initialzation is now working
git-svn-id: svn://10.0.0.236/trunk@7770 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 20:26:01 +00:00
dcone%netscape.com
cba5da1580 implemented some messaging
git-svn-id: svn://10.0.0.236/trunk@7769 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 20:25:31 +00:00
dcone%netscape.com
731a26d264 started messaging
git-svn-id: svn://10.0.0.236/trunk@7768 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 20:25:18 +00:00
dcone%netscape.com
540f20c743 updated message pump
git-svn-id: svn://10.0.0.236/trunk@7767 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 20:17:06 +00:00
dcone%netscape.com
376a356f16 update to use a mac Widgettest.cpp
git-svn-id: svn://10.0.0.236/trunk@7766 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 20:16:08 +00:00
dcone%netscape.com
a56281e7e8 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@7765 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 20:15:33 +00:00
pinkerton%netscape.com
6419c99b49 Support for pop-down tree views.
git-svn-id: svn://10.0.0.236/trunk@7764 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:20:01 +00:00
pinkerton%netscape.com
3bf9b78322 Don't draw over popdown tree if showing.
git-svn-id: svn://10.0.0.236/trunk@7763 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:19:35 +00:00
pinkerton%netscape.com
4f3ff0508d Overrides for the popdown flex table to close at the right times, etc.
git-svn-id: svn://10.0.0.236/trunk@7762 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:19:18 +00:00
pinkerton%netscape.com
96f14004b1 Build a window from an HT_Resource or RDF_Resource.
git-svn-id: svn://10.0.0.236/trunk@7761 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:18:57 +00:00
pinkerton%netscape.com
d1f792fc78 Hacks for showing a container docked, popup, or standalone, with a hack for drag and drop.
git-svn-id: svn://10.0.0.236/trunk@7760 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:17:36 +00:00
pinkerton%netscape.com
dcb26bda57 Better support for opening a tree popup, docked, or standalone.
git-svn-id: svn://10.0.0.236/trunk@7759 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:17:19 +00:00
pinkerton%netscape.com
7dd8faa2dc Register popdown tree classes.
git-svn-id: svn://10.0.0.236/trunk@7758 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:16:37 +00:00
pinkerton%netscape.com
04772e56d3 API to Create panes from RDF_Resources as well.
git-svn-id: svn://10.0.0.236/trunk@7757 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:15:59 +00:00
pinkerton%netscape.com
b99e4334e1 Fix redraw problem on refresh with inline editing.
git-svn-id: svn://10.0.0.236/trunk@7756 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:15:28 +00:00
pinkerton%netscape.com
34eb41447f Don't draw over the popdown tree if one is showing.
git-svn-id: svn://10.0.0.236/trunk@7755 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:15:05 +00:00
pinkerton%netscape.com
98ebb9e586 Popdown tree.
git-svn-id: svn://10.0.0.236/trunk@7754 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:14:40 +00:00
pinkerton%netscape.com
041d22a313 Support command to popup standalone on any HT_Resource and make Bookmarks/History to do the same.
git-svn-id: svn://10.0.0.236/trunk@7753 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:14:28 +00:00
morse%netscape.com
3b61327da2 changes for cookie and single signon viewers, reviewed and approved by relliott
git-svn-id: svn://10.0.0.236/trunk@7752 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:12:45 +00:00
kin%netscape.com
81a42507bd Modified lo_BeginTextareaTag() to call XP_STRCASECMP() when looking for
"HTMLAREA". Approved by nisheeth and toshok.


git-svn-id: svn://10.0.0.236/trunk@7751 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:10:47 +00:00
valeski%netscape.com
9b9206ef08 added the transfer_encoding reset code to all builds (no longer #ifdef'd) and placed it everywhere we were doing content_encoding clearing. Also did some reformatting. Ran the transfer_encoding stuff by gagan.
git-svn-id: svn://10.0.0.236/trunk@7750 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:07:55 +00:00
karnaze%netscape.com
1a7586d04a put back previous sizing of text fields due to changes in fixed width font
git-svn-id: svn://10.0.0.236/trunk@7749 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 19:07:25 +00:00
karnaze%netscape.com
cef6bb6be9 removed nsIWebFrame
git-svn-id: svn://10.0.0.236/trunk@7748 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 18:52:35 +00:00
buster%netscape.com
06d077240f first cut at implementing %-width columns inside of auto-width tables.
This is about 50% done, which covers about 90% of the cases.


git-svn-id: svn://10.0.0.236/trunk@7747 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 18:42:10 +00:00
donm%netscape.com
76143ccc43 adding MOZ_SINGLESIGNON and MOZ_COOKIEMANAGE to MOZ_MEDIUM define.
git-svn-id: svn://10.0.0.236/trunk@7746 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 18:41:01 +00:00
kipp%netscape.com
b8c3881140 Work around frame-appended reflows that don't grow the child of the body
git-svn-id: svn://10.0.0.236/trunk@7744 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 17:38:46 +00:00
karnaze%netscape.com
83d81a5ec8 added missing NS_RELEASE statements
git-svn-id: svn://10.0.0.236/trunk@7743 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 16:52:05 +00:00
kipp%netscape.com
2b2afba13d Elminated top/bottom margins around center tags
git-svn-id: svn://10.0.0.236/trunk@7741 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 15:32:12 +00:00
ramiro%netscape.com
aa9474bd0c Move the tree widgetry from XFE_RDFView to XFE_RDFTreeView.
git-svn-id: svn://10.0.0.236/trunk@7739 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 11:51:25 +00:00
ramiro%netscape.com
12c2311fa4 Make the stand alone state of XFE_RDFView a member that can be toggled.
Fix a bunch of warnings.
Make the notif_cb a static member of XFE_NavCenterView as it should be.


git-svn-id: svn://10.0.0.236/trunk@7737 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 09:10:23 +00:00
valeski%netscape.com
45a036d316 nglayout - clear the transfer encoding field in the url_s before doing a redirect so it doesn't interfer with the redirecting url stream selection
git-svn-id: svn://10.0.0.236/trunk@7734 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 05:19:03 +00:00
valeski%netscape.com
f271e1406c another memory leak and formatting changes
git-svn-id: svn://10.0.0.236/trunk@7733 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 04:52:12 +00:00
troy%netscape.com
962a468486 Fixed a memory leak. In some error cases we weren't calling NR_RegClose()
git-svn-id: svn://10.0.0.236/trunk@7730 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 04:06:28 +00:00
nisheeth%netscape.com
4ab2c23d31 Fixes bug 311240. We were crashing in layout when a new bookmark was added.
The real problem here is that RDF is overloading the HTML stream converter to 
get at the META tags.  I have a hacky fix to layout that checks for the special 
RDF slave context type and does not layout any tag other than META and HEAD.
This will get backed out as soon as we come up with a better solution...


git-svn-id: svn://10.0.0.236/trunk@7729 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 04:03:10 +00:00
danm%netscape.com
a9e4d75b26 moved privacy prefs to their own (private) pane
git-svn-id: svn://10.0.0.236/trunk@7728 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 03:40:14 +00:00
valeski%netscape.com
f2ee0c64b3 someone forgot to add parenthesis which could cause memory leaks on redirects. Not anymore! Parenthesis added.
git-svn-id: svn://10.0.0.236/trunk@7727 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 02:59:31 +00:00
spider%netscape.com
e93ed8d2c4 Add support for DEBUG with USERNAME
git-svn-id: svn://10.0.0.236/trunk@7717 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 00:30:09 +00:00
wtc%netscape.com
f11d0a9875 Deleted obsolete code for OSF1V4.
git-svn-id: svn://10.0.0.236/trunk@7716 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 00:23:59 +00:00
wtc%netscape.com
481ad4d991 Enable pthreads-based build. The key is to ifdef all the code related
to the "Xt hack" with SW_THREADS.  I believe the Xt hack is only needed
by user-level threads (i.e., SW_THREADS).


git-svn-id: svn://10.0.0.236/trunk@7715 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 00:19:29 +00:00
kipp%netscape.com
927fe7a55a Make sure text at the end of the document is reflowed properly
git-svn-id: svn://10.0.0.236/trunk@7714 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 00:19:11 +00:00
wtc%netscape.com
afc7ecd5b1 Miscellaneous fixes: Removed redundant occurences of libcaps.a and
libxpcom.a in BASIC_LIBS.  They only need to appear in BASIC_LIBS_2.
Put $(NSPR_LIB) in front of $(OTHER_LIBS) and $(OTHER_DYN_MOTIF_LIBS).
Enable pthreads-based build for Linux.  Define DYNAMIC_SYMBOLS_F to
be null on OSF1.


git-svn-id: svn://10.0.0.236/trunk@7712 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 00:18:07 +00:00
wtc%netscape.com
89f4721199 Do not declare variables in a 'for' statement because the scope
of such variables is compiler-dependent.  (approved by kipp@netscape.com)


git-svn-id: svn://10.0.0.236/trunk@7711 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-11 00:10:36 +00:00
wtc%netscape.com
9a1521192c Shared libraries on FreeBSD must have version numbers in their names.
So set DLL_SUFFIX to so.1.0.  Thanks to Bret Ford <bford@uop.cs.uop.edu>
for reporting the problem and Thomas Mueller <tmueller@privat.prodata.de>
for verifying the fix.


git-svn-id: svn://10.0.0.236/trunk@7710 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 23:42:03 +00:00
wtc%netscape.com
542d02e511 The local threads don't work on RedHat 5.1 Sparc Linux (with glibc2).
I suspect it's because glibc2's setjmp/longjmp (Sparc version) does
not allow us to modify the jmp_buf.  So I added some comments and
a #error directive to force the build to fail.


git-svn-id: svn://10.0.0.236/trunk@7709 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 23:38:38 +00:00
wtc%netscape.com
5296156091 Enable pthreads-based Mozilla build. TO do a pthreads-based build,
set the environment variable USE_PTHREADS to 1.
Files changed: mozilla/config/OSF1.mk, mozilla/nsprpub/config/OSF1.mk.


git-svn-id: svn://10.0.0.236/trunk@7708 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 23:37:06 +00:00
ftang%netscape.com
5f4f4eb739 Add cp1252 conversion tolower table and make winfe to use it.
Thanks for from the net  Antoine.Leca@renault.fr (Antoine Leca)


git-svn-id: svn://10.0.0.236/trunk@7707 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 23:29:27 +00:00
peterl%netscape.com
192504ea49 made check font existence ignore non-truetype fonts
git-svn-id: svn://10.0.0.236/trunk@7706 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 23:29:21 +00:00
kmcclusk%netscape.com
ad9de2a9d5 Added back commented out destruction of XImages and buffers
git-svn-id: svn://10.0.0.236/trunk@7705 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 23:27:32 +00:00
peterl%netscape.com
72666bde8e connected LINKed style sheets
git-svn-id: svn://10.0.0.236/trunk@7703 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 23:02:39 +00:00
robinf%netscape.com
df61f28833 minor text updates to reflect latest UI
git-svn-id: svn://10.0.0.236/trunk@7702 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 22:57:36 +00:00
blythe%netscape.com
db8d25594d Fix bugzilla bug #120
git-svn-id: svn://10.0.0.236/trunk@7701 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 22:45:14 +00:00
kmcclusk%netscape.com
70bd69fe6e Removed debug printf's #if 0 code + moved resize code
from nsXtEventHandler.cpp nsWindow.cpp.


git-svn-id: svn://10.0.0.236/trunk@7699 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 22:37:46 +00:00
troy%netscape.com
f19ca7ceaf Added a NS_RELEASE of the URL reader in OnStartBinding()
git-svn-id: svn://10.0.0.236/trunk@7698 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 22:21:18 +00:00
kmcclusk%netscape.com
27136314b0 Removed commented out code and debug printf's.
git-svn-id: svn://10.0.0.236/trunk@7697 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 22:18:28 +00:00
wtc%netscape.com
f643011e53 Enable pthreads-based build. The macro SW_THREADS is defined only
if USE_PTHREADS is not defined.  If USE_PTHREADS is defined, add
-lpthread to OS_LIBS.


git-svn-id: svn://10.0.0.236/trunk@7695 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 22:05:33 +00:00
thom%netscape.com
43a79f53c1 added 'extern "C"' to declaration of NS_NewHTMLLoggingSink to fix mac link error...
git-svn-id: svn://10.0.0.236/trunk@7694 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:56:32 +00:00
clayton
92a6b6c8d0 Added a first draft of POD documentation for the API commands. I wrote a
script to generate most of it and am going back to fix the pieces that
couldn't be automatically generated.  I've gotten through ldap_compare
so far and will be done with all API docs by Tuesday night.


git-svn-id: svn://10.0.0.236/trunk@7693 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:56:09 +00:00
peterl%netscape.com
11ff304260 connect marginwidth & marginheight in body tag
git-svn-id: svn://10.0.0.236/trunk@7691 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:50:32 +00:00
kipp%netscape.com
ab499551e6 Disabled old entity routines
git-svn-id: svn://10.0.0.236/trunk@7690 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:38:10 +00:00
kipp%netscape.com
aa0b382d4a Used generated entities file to translate entities
git-svn-id: svn://10.0.0.236/trunk@7689 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:37:55 +00:00
kipp%netscape.com
97c07adc50 Build generate entities file
git-svn-id: svn://10.0.0.236/trunk@7688 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:37:36 +00:00
kin%netscape.com
a335158b84 Turn on ENDER by default in the builds.
git-svn-id: svn://10.0.0.236/trunk@7687 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:22:27 +00:00
kmcclusk%netscape.com
7c529e0547 Added a XtManageWidget implementation lifted from the XFE code. This fixes problems where the drawing area would
spontaneously resize itself to fit its contents.


git-svn-id: svn://10.0.0.236/trunk@7686 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:21:34 +00:00
kipp%netscape.com
a24d4696bf Open the file for writing (doh)
git-svn-id: svn://10.0.0.236/trunk@7685 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:12:10 +00:00
kipp%netscape.com
d2684b2846 Short circuit auto-detect logic (cuz it doesn't work here)
git-svn-id: svn://10.0.0.236/trunk@7684 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:11:31 +00:00
kin%netscape.com
2a4cf3eb53 Modified form_element_get_size() to call fe_HackTranslations() for all
form elements except the HTMLArea.


git-svn-id: svn://10.0.0.236/trunk@7683 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:11:07 +00:00
kipp%netscape.com
ef2aed49ad Updated
git-svn-id: svn://10.0.0.236/trunk@7682 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:10:36 +00:00
kipp%netscape.com
872b060f20 Build entities table
git-svn-id: svn://10.0.0.236/trunk@7681 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:10:04 +00:00
kipp%netscape.com
e51698ec95 Fixed assertion message
git-svn-id: svn://10.0.0.236/trunk@7680 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:08:36 +00:00
kipp%netscape.com
268de5a50d Handle EOF better for file streams
git-svn-id: svn://10.0.0.236/trunk@7679 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:08:21 +00:00
kin%netscape.com
802f04f7c5 Commented out some debug statements with ifdef DEBUG_kin.
git-svn-id: svn://10.0.0.236/trunk@7678 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:08:10 +00:00
kipp%netscape.com
b07c398579 new
git-svn-id: svn://10.0.0.236/trunk@7677 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 21:07:40 +00:00
spider%netscape.com
eefc86349a julian is 50 in free world
git-svn-id: svn://10.0.0.236/trunk@7676 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 20:38:48 +00:00
donm%netscape.com
2ea7df3487 Fixes Unix build problem with MOZ_COOKIEMANAGE and MOZ_SINGLESIGNON
flags turned on.  Approved by: Steve Morse


git-svn-id: svn://10.0.0.236/trunk@7675 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 20:38:26 +00:00
morse%netscape.com
b28b86c55a fixed bug involving freeing of memory that was never allocated, reviewed by Pinkerton
git-svn-id: svn://10.0.0.236/trunk@7674 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 20:36:41 +00:00
spider%netscape.com
82da783cbe Unix changes to support xpfc
git-svn-id: svn://10.0.0.236/trunk@7673 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 20:01:52 +00:00
spider%netscape.com
ccddf33924 Updates for XPFC ... we've moved
git-svn-id: svn://10.0.0.236/trunk@7671 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 19:56:59 +00:00
spider%netscape.com
a8e186a7d1 Updates for XPFC
git-svn-id: svn://10.0.0.236/trunk@7670 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 19:56:34 +00:00
spider%netscape.com
73adf57091 fixes for new xpfc
git-svn-id: svn://10.0.0.236/trunk@7669 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 19:46:33 +00:00
spider%netscape.com
f307a7b044 Fix build bustage
git-svn-id: svn://10.0.0.236/trunk@7668 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 18:50:59 +00:00
troy%netscape.com
d4bb51be47 Added code to delete nsBrowserWindow object
git-svn-id: svn://10.0.0.236/trunk@7667 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 18:20:20 +00:00
michaelp%netscape.com
b4b3615aa5 should fix build errors on unix.
git-svn-id: svn://10.0.0.236/trunk@7665 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 18:02:56 +00:00
rods%netscape.com
a1b9598742 Fixed edge case for selection, selection at starting of line and moving to new content.
git-svn-id: svn://10.0.0.236/trunk@7664 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 17:46:34 +00:00
troy%netscape.com
8f682521ef Stopped allocating array of size 0...
git-svn-id: svn://10.0.0.236/trunk@7663 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 17:44:54 +00:00
kipp%netscape.com
f7457a3f72 Fixed documents w/o titles bug #313016
git-svn-id: svn://10.0.0.236/trunk@7662 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 17:39:48 +00:00
troy%netscape.com
1a7be428bd Removed an extra NS_ADDREF call that was keeping the timer object from
ever getting freed


git-svn-id: svn://10.0.0.236/trunk@7661 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 17:32:57 +00:00
karnaze%netscape.com
e4a8306fd3 fixed "return" submission on a single text field
git-svn-id: svn://10.0.0.236/trunk@7660 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 17:26:20 +00:00
troy%netscape.com
e16a20aed0 Fixed ClearTimeout() to free the timer closure struct
git-svn-id: svn://10.0.0.236/trunk@7659 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 17:25:35 +00:00
troy%netscape.com
92ce65c672 Added GetClosure() member function
git-svn-id: svn://10.0.0.236/trunk@7658 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 17:24:36 +00:00
troy%netscape.com
0a2de0954f Added memset of lfFaceName array to 0 for debug builds. This eliminates
a Purify warning


git-svn-id: svn://10.0.0.236/trunk@7657 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 16:53:14 +00:00
despotdaemon%netscape.com
dca21a9bbf Pseudo-automatic update of changes made by jdunn@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7656 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 15:43:01 +00:00
jfrancis%netscape.com
e912d3d58d Turning on ENDER.
git-svn-id: svn://10.0.0.236/trunk@7655 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 15:18:32 +00:00
troy%netscape.com
c91029acf9 Added call to Shutdown() of prefs object
git-svn-id: svn://10.0.0.236/trunk@7654 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 05:12:25 +00:00
sdagley%netscape.com
1e87c9adfa Fix #309842. For some reason the call to NET_FinishInitNetLib() was commened out in the MacFE. Since this is where the cache is initialized and cookies are initially read, among other useful stuff, it seems like a bad idea to not call it.
git-svn-id: svn://10.0.0.236/trunk@7653 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 04:49:58 +00:00
karnaze%netscape.com
770938c13f adjusted sizing for text controls; default control is text; assertion cleanup
git-svn-id: svn://10.0.0.236/trunk@7652 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 04:28:17 +00:00
troy%netscape.com
f16c07c6f6 Fixed leak of an IL color space in NewPixmap()
git-svn-id: svn://10.0.0.236/trunk@7651 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 04:25:35 +00:00
jwz%mozilla.org
870d80ee1d I could tell you what this patch was for, but then I'd have to shoot you.
git-svn-id: svn://10.0.0.236/trunk@7650 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 03:50:04 +00:00
troy%netscape.com
075416e02c Fixed leak of async net context. Now there's only one net context used
for all image requests and its released when the image group is
destroyed


git-svn-id: svn://10.0.0.236/trunk@7649 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 03:33:49 +00:00
troy%netscape.com
1e7f67e20c Stopped holding a reference to the device context, because the device context
holds a reference to the font cache and this was causing a circular reference


git-svn-id: svn://10.0.0.236/trunk@7648 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 02:34:00 +00:00
joki%netscape.com
6dc09b67c8 Move disassociation of frame from view up from destructor to DeleteFrame to prevent event entrance during destruction
git-svn-id: svn://10.0.0.236/trunk@7647 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 02:28:23 +00:00
buster%netscape.com
fc65291463 percent-width nested tables in fixed-width cells now use the computed
column width if available for computing their own width.


git-svn-id: svn://10.0.0.236/trunk@7646 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 02:16:18 +00:00
joki%netscape.com
315d19a499 Additional fixes to allow child webshells in framesets to be properly released.
git-svn-id: svn://10.0.0.236/trunk@7645 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 01:36:02 +00:00
joki%netscape.com
06a2ca93d0 Add RunGC method onto ScriptContext interface. Probably temporary until we have auto-gc'ing set up.
git-svn-id: svn://10.0.0.236/trunk@7644 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 01:33:34 +00:00
joki%netscape.com
dffea3f81d Fix possible addref on null pointer
git-svn-id: svn://10.0.0.236/trunk@7643 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 01:30:29 +00:00
karnaze%netscape.com
da7fa463af added GetMarginWidth, SetMarginWidth, GetMarginHeight, SetMarginHeight to web widget, frameset codes calls it.
git-svn-id: svn://10.0.0.236/trunk@7642 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 01:01:27 +00:00
jwz%mozilla.org
252080d0bd add -DNO_SECURITY so that it works on the internal Netscape builds as well
(which do have security, but which do not have a libmime with S/MIME code.)


git-svn-id: svn://10.0.0.236/trunk@7641 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-10 00:24:00 +00:00
valeski%netscape.com
47516b0967 removed the http:// assumption code from here to nsWebShell.cpp
git-svn-id: svn://10.0.0.236/trunk@7640 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 21:23:54 +00:00
valeski%netscape.com
196f89df7e moved http:// assumption code into nsWebShell.cpp from nsBrowserWindow.cpp
git-svn-id: svn://10.0.0.236/trunk@7639 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 21:22:18 +00:00
waterson%netscape.com
213c76750c Added some info to the begin-session timing trace.
git-svn-id: svn://10.0.0.236/trunk@7638 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 20:32:48 +00:00
waterson%netscape.com
91ad084c9b Modified timing macros to include MWContext parameter.
git-svn-id: svn://10.0.0.236/trunk@7637 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 20:32:30 +00:00
waterson%netscape.com
cb3e361cc8 Added some more timing traces to WinFE. Approved by blythe.
git-svn-id: svn://10.0.0.236/trunk@7636 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 20:28:53 +00:00
waterson%netscape.com
be7874976b Added context parameter to timing macros.
git-svn-id: svn://10.0.0.236/trunk@7635 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 20:28:04 +00:00
troy%netscape.com
5a0c300836 Changed destructor to release reference to image request observer objects. This
fixes a memory leak


git-svn-id: svn://10.0.0.236/trunk@7632 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 16:53:24 +00:00
troy%netscape.com
f06d6cad13 Now deletes the images and releases the reference to the image group
git-svn-id: svn://10.0.0.236/trunk@7631 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 16:42:06 +00:00
mcafee%netscape.com
0bea3d5c5f Compiler warning on IRIX.
git-svn-id: svn://10.0.0.236/trunk@7629 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 09:10:55 +00:00
joki%netscape.com
9a4b4d35b9 Partial fix for frame based and general memory leaks of webshells and prescontexts
git-svn-id: svn://10.0.0.236/trunk@7628 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 07:43:22 +00:00
jwz%mozilla.org
fbd360d63b oops, typo'ed an extra ";" that gcc doesn't like.
git-svn-id: svn://10.0.0.236/trunk@7626 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 06:02:27 +00:00
troy%netscape.com
d545466115 Added code to destructor to delete mVisited
git-svn-id: svn://10.0.0.236/trunk@7624 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 05:00:24 +00:00
despotdaemon%netscape.com
46893f02e1 Pseudo-automatic update of changes made by terry@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7623 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 04:00:46 +00:00
despotdaemon%netscape.com
7f359d5cec Pseudo-automatic update of changes made by terry@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7622 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 03:59:28 +00:00
jwz%mozilla.org
0f2d91d145 build and link against libmime (on Unix only, until I find some victims to
test things out on the other platforms.)


git-svn-id: svn://10.0.0.236/trunk@7621 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 03:53:14 +00:00
jwz%mozilla.org
abbaaba6be various tweaks to get libmime to build, and be linkable with the
rest of Mozilla.


git-svn-id: svn://10.0.0.236/trunk@7620 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 03:51:51 +00:00
jwz%mozilla.org
94c97d19b5 in order to make libmime compile without libmsg, moved some
utility functions from libmsg/msgutil.c to new files
libxp/xp_linebuf.c and libnet/mkbuf.c:

	msg_GrowBuffer ==> XP_GrowBuffer
	msg_LineBuffer ==> XP_LineBuffer
	msg_ReBuffer ==> XP_ReBuffer
	msg_MakeRebufferingStream ==> NET_MakeRebufferingStream


git-svn-id: svn://10.0.0.236/trunk@7619 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 03:49:12 +00:00
beard%netscape.com
70c2f26e11 Added nsIPluginInstance* and NPWindow* data members to CPluginInstancePeer, fixed some reference counting bugs. Changed instance->pdata to point to the peer, so it can be accessed independently.
git-svn-id: svn://10.0.0.236/trunk@7618 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 03:17:39 +00:00
troy%netscape.com
ad1ac559f3 Added release of mAppShell
git-svn-id: svn://10.0.0.236/trunk@7617 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 02:13:29 +00:00
beard%netscape.com
230a20f31d Fixed a C string copy bug in CPluginInstancePeer::CPluginInstancePeer, added strcasecmp for XP_MAC.
git-svn-id: svn://10.0.0.236/trunk@7616 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 01:55:13 +00:00
troy%netscape.com
786bb2438d Cleaned up widget reference counting. In particular parent widgets
release their references to child widgets


git-svn-id: svn://10.0.0.236/trunk@7615 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 01:37:30 +00:00
leif
2701eafa8a - Lots of modifications, minor changes etc.
- Updated all documentation.
- Added a few new functions.


git-svn-id: svn://10.0.0.236/trunk@7614 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 01:16:55 +00:00
jevering%netscape.com
80ca6e2b8c Fixed build. forgot prenv.h
git-svn-id: svn://10.0.0.236/trunk@7613 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-09 00:02:40 +00:00
jevering%netscape.com
6c6b309e49 Set Home page for viewer.
git-svn-id: svn://10.0.0.236/trunk@7612 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 22:01:46 +00:00
beard%netscape.com
5ef3aa0f18 Changed all uses of lo_NVList to not depend on OJI being defined.
git-svn-id: svn://10.0.0.236/trunk@7610 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 20:50:22 +00:00
michaelp%netscape.com
8eeb4425f1 merged changes from branch.
git-svn-id: svn://10.0.0.236/trunk@7609 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 19:21:40 +00:00
ramiro%netscape.com
d667b404da Fix xpcom linking problem under some versions of gcc and egcs.
Add libxpcom.a to link line after libraries that reference symbols in it.


git-svn-id: svn://10.0.0.236/trunk@7608 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 06:37:47 +00:00
troy%netscape.com
06a522099a Change to object lifetime management. Views are no longer ref counted
git-svn-id: svn://10.0.0.236/trunk@7605 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 04:23:33 +00:00
despotdaemon%netscape.com
a2c1d50d52 Pseudo-automatic update of changes made by terry@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7603 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 03:38:06 +00:00
cyeh%netscape.com
9f3b6e8934 added more *.in files under JavaStubsUnix for cls autoconf work
git-svn-id: svn://10.0.0.236/trunk@7602 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 02:41:47 +00:00
jwz%mozilla.org
cbf12721dd Got libmime and the mimefilt program to build in the public Mozilla code base.
Mostly I did this by turning on -DMOZILLA_30, which eliminates most of
the, uh, "progress" made in libmime since 3.0.  That this worked highlights
the fact that the 3.x libmime had far fewer cross-dependencies on libmsg
than 4.x did.


git-svn-id: svn://10.0.0.236/trunk@7601 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 02:20:33 +00:00
jwz%mozilla.org
0a29f06a82 In 2.x/3.x, this file was lib/libmsg/addr.c.
In 4.x, it was lib/libmsg/addrutil.cpp.  (They felt the need to convert it
to C++ for no adequately explainable reason, and to add some dependencies
on the rest of libmsg.)

Since libmime needs this, and libmsg isn't being built, I converted it
back to C, removed the libmsg dep, and put a copy of this file here.

Someday, something more sensible should be done.  Like deleting the copy
in libmsg, perhaps.


git-svn-id: svn://10.0.0.236/trunk@7600 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 02:17:51 +00:00
cmanske%netscape.com
568fe32f26 Fixed P0 Composer bug 312249 (backspacing when lines wrap) with help/review/approval by nisheeth. Also layout's part of fix to 310966 (changing doc colorsof current windows)
git-svn-id: svn://10.0.0.236/trunk@7598 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 02:06:57 +00:00
cyeh%netscape.com
f10ef2e77a added corresponding Makefile.in files at request of cls for autoconf
work


git-svn-id: svn://10.0.0.236/trunk@7597 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 01:56:40 +00:00
cyeh%netscape.com
b030ceac7e \ characters are not used on the last line of a module.
git-svn-id: svn://10.0.0.236/trunk@7596 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 01:27:20 +00:00
cmanske%netscape.com
8bb7f094a7 Fixed image loading problem in composer. Bug 312056. Reviewed and checkin permission by gagan
git-svn-id: svn://10.0.0.236/trunk@7595 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-08 01:23:26 +00:00
nisheeth%netscape.com
fdf8b180d7 Fixes bugs 301002, 206090, and 312021. Blocked tags were getting misordered.
lo_FinishLayout() was getting called multiple times.  These fixes were migrated
over from the 4.06 branch.


git-svn-id: svn://10.0.0.236/trunk@7593 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 23:59:48 +00:00
nisheeth%netscape.com
da6cf88f6f lo_FillinImageGeometry() was not being called before the image load was started
for the case when an <IMG> tag was processed while layout was blocked.  Fixed.


git-svn-id: svn://10.0.0.236/trunk@7592 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 23:45:27 +00:00
vidur%netscape.com
bbd5036562 Better JSConsole return values
git-svn-id: svn://10.0.0.236/trunk@7591 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 23:19:20 +00:00
vidur%netscape.com
d6598dbb16 Implemented additional document and form interfaces. Implemented named elements for documents and forms. nsInput now implements nsIDOMHTMLInputElement.
git-svn-id: svn://10.0.0.236/trunk@7588 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 23:08:00 +00:00
vidur%netscape.com
55b6f5c540 Better support for interface families in the IDL (named elements). Netscape interfaces for HTMLDocument and HTMLFormElement (for backwards compatibility.
git-svn-id: svn://10.0.0.236/trunk@7587 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 23:01:52 +00:00
kostello%netscape.com
2582b8062f Put both AOLMAIL and html/text of the pasteboard
git-svn-id: svn://10.0.0.236/trunk@7586 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 22:35:44 +00:00
buster%netscape.com
28e4b99d4b bug #312932. fixes nested tables with percent widths that also have
content with percent widths.


git-svn-id: svn://10.0.0.236/trunk@7583 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 21:53:27 +00:00
cyeh%netscape.com
f2a8ac10f9 adding mozilla/Makefile.in and mozilla/configure.in to MozillaSourceUnix at
request of chris seawood for autoconf work.


git-svn-id: svn://10.0.0.236/trunk@7582 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 21:13:06 +00:00
rods%netscape.com
5ec76384fd Shift click (without first clicking) no longer crashes the viewer
git-svn-id: svn://10.0.0.236/trunk@7578 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 20:15:36 +00:00
rods%netscape.com
c295c87d48 Select All no turns on selection in the document and renders it selected.
git-svn-id: svn://10.0.0.236/trunk@7577 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 20:14:39 +00:00
kmcclusk%netscape.com
be82118997 Correctly set shift and control flags on mouse and keyboard events.
git-svn-id: svn://10.0.0.236/trunk@7576 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 19:38:28 +00:00
kostello%netscape.com
d10145255f Fix mac build
git-svn-id: svn://10.0.0.236/trunk@7574 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 18:34:13 +00:00
law%netscape.com
a8177a1d9a Fixing stupid off-by-one bug that breaks rel builds
git-svn-id: svn://10.0.0.236/trunk@7573 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 18:34:03 +00:00
troy%netscape.com
f5d7d63a42 Removed MoveTo() and SizeTo() member functions that were for debug
purposes, and are no longer needed


git-svn-id: svn://10.0.0.236/trunk@7571 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 18:17:34 +00:00
robinf%netscape.com
314ddcb0d7 this is help file that goest with as_html/2step.htm; re: bug 3000065
git-svn-id: svn://10.0.0.236/trunk@7568 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 18:10:18 +00:00
robinf%netscape.com
ff54448ac3 removing this file so I can replace it with renamed file "2step.htm" to fix bug # 3000065
git-svn-id: svn://10.0.0.236/trunk@7567 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 18:08:29 +00:00
karnaze%netscape.com
bdf4fa6853 removed overloaded GetAttribute on nsInput
git-svn-id: svn://10.0.0.236/trunk@7566 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 17:39:27 +00:00
kmcclusk%netscape.com
07da1c6708 Changed NSIMETHOD to NS_METHOD in nsWindow.h
Changed eCursor_arrow_east and east_plus to west and west_plus for
duplicate switch statement


git-svn-id: svn://10.0.0.236/trunk@7565 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 17:13:04 +00:00
kmcclusk%netscape.com
5e5b3e766f Changed nsFontMetrixWin to nsFontMetrixUnix for GetWidth member function.
git-svn-id: svn://10.0.0.236/trunk@7564 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 16:43:52 +00:00
rods%netscape.com
0f71b811b5 Bug fixes for memory crash, and added blue triangle instead of red line
git-svn-id: svn://10.0.0.236/trunk@7562 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 16:14:07 +00:00
ramiro%netscape.com
a2ab13ee10 Fix the unix build bustage cause of undefined NET_DisplayCookieInfoAsHTML().
git-svn-id: svn://10.0.0.236/trunk@7561 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 15:37:30 +00:00
spider%netscape.com
63940c35da Cursor support
git-svn-id: svn://10.0.0.236/trunk@7560 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 15:35:27 +00:00
despotdaemon%netscape.com
1b2c68ed55 Pseudo-automatic update of changes made by terry@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7559 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 14:56:51 +00:00
spider%netscape.com
8f307fdad4 Adding several new cursor types
git-svn-id: svn://10.0.0.236/trunk@7558 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 14:45:46 +00:00
ramiro%netscape.com
359faed83b fix attachment.
git-svn-id: svn://10.0.0.236/trunk@7557 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 11:03:30 +00:00
ramiro%netscape.com
12722e7f70 dfm's privacy tools menu.
git-svn-id: svn://10.0.0.236/trunk@7556 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 09:51:55 +00:00
clu%netscape.com
bc1b400fad modified a conditional statement in ChangeTableSelection so that table selection can be correct on the mac when the movement is ED_MOVE_NONE (unlike other platforms, macfe passes in a NULL pData). Reviewed by cmanske and brade.
git-svn-id: svn://10.0.0.236/trunk@7555 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 09:17:19 +00:00
clu%netscape.com
f1c8ac0646 changed composer table select submenu so it can now select row, col, cell, and all cells correctly. Reviewed by brade.
git-svn-id: svn://10.0.0.236/trunk@7554 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 09:11:11 +00:00
clu%netscape.com
77c7a847f5 added resource numbers 1320 through 1323 to support table menu selection. Reviewed by brade.
git-svn-id: svn://10.0.0.236/trunk@7553 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 09:06:20 +00:00
clu%netscape.com
268ac9858e implemented code to respond to table selection from the menu. reviewed by brade.
git-svn-id: svn://10.0.0.236/trunk@7552 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 09:03:54 +00:00
clu%netscape.com
242bd33386 separating #ifdef MOZ_MAIL_NEWS from #ifdef EDITOR so that CComposerFind can work with just the EDITOR but not MOZ_MAIL_NEWS turned on. #312288; reviewed by brade.
git-svn-id: svn://10.0.0.236/trunk@7551 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 09:01:50 +00:00
ramiro%netscape.com
b90bfa4721 Granting some dude's wish.
git-svn-id: svn://10.0.0.236/trunk@7550 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 08:44:04 +00:00
joki%netscape.com
6fa9146055 Fix mouseover in url messages by initializing event result messages.
git-svn-id: svn://10.0.0.236/trunk@7549 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 08:11:20 +00:00
peterl%netscape.com
e561f6fa33 IRIX build fix
git-svn-id: svn://10.0.0.236/trunk@7548 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 06:24:38 +00:00
gagan%netscape.com
0e21ceef57 Fix schtupid warning on schMac.
git-svn-id: svn://10.0.0.236/trunk@7547 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 06:24:05 +00:00
cls%seawood.org
1df7026b42 Not quite sure what happened. It was in the repository but was not
showing up on bonsai and I could not commit any changes.


git-svn-id: svn://10.0.0.236/trunk@7545 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 06:20:02 +00:00
cls%seawood.org
9dc23ae8bd Run autoconf on this file to generate the configure script.
git-svn-id: svn://10.0.0.236/trunk@7544 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 06:01:37 +00:00
troy%netscape.com
941b44b69a Added GetClientData() and SetClientData() member functions
git-svn-id: svn://10.0.0.236/trunk@7533 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 05:19:40 +00:00
joki%netscape.com
4fac7be2a1 Added support for click event on form buttons
git-svn-id: svn://10.0.0.236/trunk@7532 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 05:19:07 +00:00
morse%netscape.com
b4be9ca1a8 fix build bustage on mac
git-svn-id: svn://10.0.0.236/trunk@7531 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 05:15:03 +00:00
joki%netscape.com
e562c4ba4b Adding window.open method, fixing editormode in release builds, various event fixes
git-svn-id: svn://10.0.0.236/trunk@7528 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 04:45:03 +00:00
peterl%netscape.com
dedd0a2fc1 fix build
git-svn-id: svn://10.0.0.236/trunk@7523 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 03:43:20 +00:00
morse%netscape.com
b8f354a7e7 alphabetize entries in viewers, put up nag boxes
git-svn-id: svn://10.0.0.236/trunk@7518 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 03:15:53 +00:00
morse%netscape.com
aa83c449d4 changes for single signon
git-svn-id: svn://10.0.0.236/trunk@7517 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 03:13:05 +00:00
morse%netscape.com
b8c13329df change for single singon, reviewed by dfm
git-svn-id: svn://10.0.0.236/trunk@7516 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 03:12:04 +00:00
rickg%netscape.com
52c71bfad7 too many bug fixes to name, but all legit scopus bugs
git-svn-id: svn://10.0.0.236/trunk@7515 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 03:09:24 +00:00
peterl%netscape.com
3fc016f2ac fixed processing of font face (preserve original quotes)
git-svn-id: svn://10.0.0.236/trunk@7513 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 02:17:56 +00:00
peterl%netscape.com
289d347c74 save quote char on string tokens
git-svn-id: svn://10.0.0.236/trunk@7512 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 02:17:10 +00:00
peterl%netscape.com
56fd682070 fixed font face support
git-svn-id: svn://10.0.0.236/trunk@7511 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 02:16:38 +00:00
peterl%netscape.com
dda3150013 changed nsFont to contain face lists in name
git-svn-id: svn://10.0.0.236/trunk@7510 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 02:12:34 +00:00
buster%netscape.com
bd14f040ee synch with branch
fixed the following bugs: 312653 312656 312655
the fixes were:

1. cells now inherit their bgcolor from the row, if available.  This is the
Nav4 way of drawing row bgcolor, rather than having the row paint its own bgcolor. (Troy, I intend to make this conditional
based on the compatibility mode)

2. colspans across cols that are all specified width no longer try to proportionately
divide the width of the span between the cols.  see http://www.city.net (now it's really fixed, without breaking nested tables in
constrained situations.)  A happy side effect is nested tables in general behave better when constrained.

3. min table sizes are fixed, so min width changes to content now effect the
table correctly during incremental reflow.  This fixes the table layout portion of the bugs on the http://www.aol.com/corp tree.
Rick will check in the other half of this fix soon.  Until then, don't expect to see much improvement.

4. fixed bug 312799.  Table cell now always reserve at least the maxElementSize
of its content, fixing problems when desiredSize<maxElementSize


git-svn-id: svn://10.0.0.236/trunk@7509 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 02:11:51 +00:00
peterl%netscape.com
d854ad04ea performance tweak in trim
git-svn-id: svn://10.0.0.236/trunk@7508 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 02:11:13 +00:00
kipp%netscape.com
0e8da14ade Landed non-branch version on the tip
git-svn-id: svn://10.0.0.236/trunk@7507 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 02:10:11 +00:00
kipp%netscape.com
a817acde89 Fixed embed/flush-text bug #312433
git-svn-id: svn://10.0.0.236/trunk@7503 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 01:50:12 +00:00
kipp%netscape.com
141943b382 new
git-svn-id: svn://10.0.0.236/trunk@7502 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 01:39:40 +00:00
pinkerton%netscape.com
5bf53af107 Fix problem that made mgmt mode double-click (default property was wrong when not specified by ht).
git-svn-id: svn://10.0.0.236/trunk@7501 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 01:01:23 +00:00
amusil%netscape.com
2a64af000b Fixes Bug# 117905. This fix has been in the 4x tree since 4.04.
git-svn-id: svn://10.0.0.236/trunk@7500 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:21:42 +00:00
saari%netscape.com
3cac2c90bd Fixing a checkin error for the MacMemAllocator changes.
This fixes some recent instability in Mac Grommit.


git-svn-id: svn://10.0.0.236/trunk@7499 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:21:29 +00:00
pinkerton%netscape.com
32ab184ea2 Don't use constants from selector (or include it's header file). Define them here instead.
git-svn-id: svn://10.0.0.236/trunk@7497 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:16:47 +00:00
pinkerton%netscape.com
cc0db74b42 Don't #include selector header because it's not being used.
git-svn-id: svn://10.0.0.236/trunk@7495 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:15:50 +00:00
pinkerton%netscape.com
f0e626e6e7 Add context menus and fix scrolling in shack.
git-svn-id: svn://10.0.0.236/trunk@7494 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:15:17 +00:00
pinkerton%netscape.com
3c5713388b Remove dependance on CNavCenterSelector's constants and make the title strips LCommanders so they can have context menus.
git-svn-id: svn://10.0.0.236/trunk@7493 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:14:26 +00:00
pinkerton%netscape.com
d2bf3066eb Make single-click mode work correctly (on mouse up, not mouse down).
git-svn-id: svn://10.0.0.236/trunk@7491 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:12:49 +00:00
timm%netscape.com
490ee44a3f fix for long timeout on cancelled or dropped connections
git-svn-id: svn://10.0.0.236/trunk@7490 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:07:27 +00:00
law%netscape.com
dde56e728d Turn on new Desktop integration prefs pane
git-svn-id: svn://10.0.0.236/trunk@7489 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:07:22 +00:00
law%netscape.com
36496b7353 Added new property pane for windows (98) Desktop integration
git-svn-id: svn://10.0.0.236/trunk@7488 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:05:00 +00:00
law%netscape.com
9bf63f5436 New 'default browser' dialog
git-svn-id: svn://10.0.0.236/trunk@7487 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-07 00:02:46 +00:00
law%netscape.com
c03b26049f More tweaks
git-svn-id: svn://10.0.0.236/trunk@7486 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 23:54:37 +00:00
preed%netscape.com
8d48e7639a addition to code to allow open/closed information on tinderbox pages
(essentially turned this functionality on again). reviewed by ltabb.


git-svn-id: svn://10.0.0.236/trunk@7485 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 23:35:58 +00:00
robinf%netscape.com
6173188e4d Corrected the name of the Show More ISPs button in this help screen; removed author comment from text.
git-svn-id: svn://10.0.0.236/trunk@7483 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 23:23:02 +00:00
robinf%netscape.com
a2463063c4 updated name of this help screen so that it says "Connect to Netscape" instead of "Retrieve Accnt Plan Info".
git-svn-id: svn://10.0.0.236/trunk@7481 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 23:20:10 +00:00
timm%netscape.com
a436acef6b remove busted error logic from error.js
git-svn-id: svn://10.0.0.236/trunk@7480 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 23:18:49 +00:00
akkana%netscape.com
8c3fc93a3c ifdef Ender: calculate row/column size of Ender htmlareas, and put a
frame around embeded editor components.


git-svn-id: svn://10.0.0.236/trunk@7477 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 22:40:24 +00:00
spider%netscape.com
ac2b072cf1 Register the menus
git-svn-id: svn://10.0.0.236/trunk@7476 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 22:02:06 +00:00
spider%netscape.com
54beb36fea Separating out the shellfactory for modularity
git-svn-id: svn://10.0.0.236/trunk@7475 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 21:54:26 +00:00
dcone%netscape.com
b9abec933a updated projects to use static libs
git-svn-id: svn://10.0.0.236/trunk@7474 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 21:53:08 +00:00
dcone%netscape.com
1ffe0d0129 implemented newcwindow
git-svn-id: svn://10.0.0.236/trunk@7473 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 21:51:14 +00:00
dcone%netscape.com
9abd073417 fixed bugs, implemented new window
git-svn-id: svn://10.0.0.236/trunk@7472 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 21:50:56 +00:00
dcone%netscape.com
363d87dd98 fixed some bugs
git-svn-id: svn://10.0.0.236/trunk@7471 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 21:50:30 +00:00
spider%netscape.com
01b8b8e2c9 reordering files to appropriate directories
git-svn-id: svn://10.0.0.236/trunk@7469 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 21:32:49 +00:00
despotdaemon%netscape.com
0e060bf013 Pseudo-automatic update of changes made by dhiren@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7468 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 21:03:49 +00:00
timm%netscape.com
55301fe6ab move removal of support window to compare page
git-svn-id: svn://10.0.0.236/trunk@7467 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:55:40 +00:00
timm%netscape.com
9ffaaca2e8 added code to pull down the support window
git-svn-id: svn://10.0.0.236/trunk@7466 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:43:07 +00:00
timm%netscape.com
72cec2c321 added document close call to force pane to clear
git-svn-id: svn://10.0.0.236/trunk@7465 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:40:34 +00:00
ramiro%netscape.com
e5e3f5f701 DONT USE C++ COMMENT IN C FILES. Fix bustage.
git-svn-id: svn://10.0.0.236/trunk@7464 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:32:12 +00:00
kipp%netscape.com
3ac69641d1 new
git-svn-id: svn://10.0.0.236/trunk@7463 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:29:07 +00:00
kipp%netscape.com
9b4b2ca63d Added code to create logging sinks
git-svn-id: svn://10.0.0.236/trunk@7462 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:27:57 +00:00
kipp%netscape.com
f2811d2878 Build logging sink
git-svn-id: svn://10.0.0.236/trunk@7461 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:27:27 +00:00
pinkerton%netscape.com
69637617ce Fix 2000 link warnings problem caused by including lots o' libraries in this static lib. (rev beard).
git-svn-id: svn://10.0.0.236/trunk@7460 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:24:11 +00:00
kin%netscape.com
7563aa1e6a Updated DisplayPixmap() prototype to use PRInt32 to match function definition
in Frame.cpp.


git-svn-id: svn://10.0.0.236/trunk@7459 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:12:29 +00:00
kin%netscape.com
e4854ccbe6 Added support for the new HTMLArea form element. All changes are ifdef'd ENDER.
git-svn-id: svn://10.0.0.236/trunk@7458 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:10:37 +00:00
blythe%netscape.com
3a1663e603 Fix MOZ_LITE builds busted by previous checkin
git-svn-id: svn://10.0.0.236/trunk@7457 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 20:04:24 +00:00
kipp%netscape.com
30ebba07e7 Landed changes made on branch (bug #312572)
git-svn-id: svn://10.0.0.236/trunk@7456 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 19:52:48 +00:00
toshok%netscape.com
14538a820a actually fix the freebsd conditional.
git-svn-id: svn://10.0.0.236/trunk@7455 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 19:49:15 +00:00
toshok%netscape.com
9744146269 FreeBSD doesn't need (and complains about) -rdynamic
git-svn-id: svn://10.0.0.236/trunk@7454 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 19:48:00 +00:00
norris%netscape.com
14026ac04a Get signed JavaScript working using the non-Java capabilities code.
Also, implement a preference to run only signed JavaScript.


git-svn-id: svn://10.0.0.236/trunk@7453 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 19:46:03 +00:00
norris%netscape.com
a237948169 Add routine to initialize capabilities code.
Code was actually written by raman.


git-svn-id: svn://10.0.0.236/trunk@7452 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 19:41:12 +00:00
karnaze%netscape.com
4e121eb837 implemented border, frameborder attributes in <frameset>
git-svn-id: svn://10.0.0.236/trunk@7451 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 19:40:37 +00:00
rods%netscape.com
b3a1eadaa4 Memory Leak in selection and a crash bug where a stack varible is being deleted.
git-svn-id: svn://10.0.0.236/trunk@7450 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 19:28:44 +00:00
danm%netscape.com
48600d89cf (optionally) include GlowCode lib. a:warren,fur
git-svn-id: svn://10.0.0.236/trunk@7448 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 18:52:34 +00:00
dcone%netscape.com
aa9710597a backed out my changes for mac
git-svn-id: svn://10.0.0.236/trunk@7447 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 18:01:26 +00:00
dcone%netscape.com
b1cb10571b update to new static factory methods.
git-svn-id: svn://10.0.0.236/trunk@7446 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 17:47:55 +00:00
dcone%netscape.com
e4220c7379 update to static library factory methods
git-svn-id: svn://10.0.0.236/trunk@7445 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 17:47:21 +00:00
dcone%netscape.com
d8565d833c update to new static way
git-svn-id: svn://10.0.0.236/trunk@7444 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 17:47:02 +00:00
dcone%netscape.com
01091788dd updated to new factory methods using static libraries
git-svn-id: svn://10.0.0.236/trunk@7443 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 17:45:47 +00:00
dcone%netscape.com
5d0d0ae116 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7442 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 17:44:43 +00:00
dcone%netscape.com
8ae952d655 Raptor change, worked on factory methods
git-svn-id: svn://10.0.0.236/trunk@7441 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 17:44:15 +00:00
rods%netscape.com
7876bbcfce Commented out the FOCUS event cases, it cleared up several crashes
It's unclear whether we need to notified of these events.


git-svn-id: svn://10.0.0.236/trunk@7440 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 17:23:49 +00:00
donm%netscape.com
3785833de4 FE_Trace needed #ifdef DEBUG wrapper for optimized builds.
git-svn-id: svn://10.0.0.236/trunk@7439 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 16:59:39 +00:00
terry%netscape.com
f242f678bf Patch by Erik Bruchez <Erik.Bruchez@iname.com> -- cope with "-d" in
the modules file.


git-svn-id: svn://10.0.0.236/trunk@7437 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 16:54:50 +00:00
rods%netscape.com
568016a686 Fixed: Links now work.
Fixed: Selection cursor no longer shows when clicking on a link.
(These are the same fixes as Stability branch bugs 312562 and 312563)


git-svn-id: svn://10.0.0.236/trunk@7436 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 16:29:45 +00:00
joki%netscape.com
4c583f107e Fix links not working.
git-svn-id: svn://10.0.0.236/trunk@7433 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 07:55:05 +00:00
ftang%netscape.com
dc9435f1c2 check in viscii unicode conversion table. Thanks for
Thu Nguyen <tnn@neomagic.com> from the net


git-svn-id: svn://10.0.0.236/trunk@7432 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 06:15:27 +00:00
warren%netscape.com
1e9141a534 Removed version of file with name that's too long for the mac.
git-svn-id: svn://10.0.0.236/trunk@7431 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 05:10:35 +00:00
troy%netscape.com
4ea1793e34 Some improvements to the ref counting
git-svn-id: svn://10.0.0.236/trunk@7430 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 05:06:24 +00:00
law%netscape.com
61c35d08cb Updates for Win(98) integration feature (not yet being built)
git-svn-id: svn://10.0.0.236/trunk@7429 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 03:53:29 +00:00
ramiro%netscape.com
25b3a13b12 Change usage of jint to PRint32. Fixes the current unix build bustage.
git-svn-id: svn://10.0.0.236/trunk@7428 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 03:10:34 +00:00
troy%netscape.com
da3ff76116 Fixed shoddy reference counting in FindBrowserFor(), and changed
Destroy() to release references on six widgets


git-svn-id: svn://10.0.0.236/trunk@7426 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 02:21:23 +00:00
spider%netscape.com
f4acade67c Unix fixes
git-svn-id: svn://10.0.0.236/trunk@7425 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 02:16:51 +00:00
troy%netscape.com
aa05f15f17 Added code to Ondestroy() to do an AddRef() before calling DispatchStandardEvent()
and then a Release() afterwards. This ensures the object doesn't get destroyed until
after we've dispatched the event


git-svn-id: svn://10.0.0.236/trunk@7424 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 02:11:43 +00:00
spider%netscape.com
40fdc5ba22 win fix
git-svn-id: svn://10.0.0.236/trunk@7423 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 02:07:49 +00:00
racham%netscape.com
7c3d59e796 Correcting 1step & 2step navigational errors
git-svn-id: svn://10.0.0.236/trunk@7422 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:58:14 +00:00
spider%netscape.com
dd5f361b85 Unix updates
git-svn-id: svn://10.0.0.236/trunk@7421 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:56:22 +00:00
spider%netscape.com
4357a53292 Add julian dll to list of abstractions
git-svn-id: svn://10.0.0.236/trunk@7420 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:55:28 +00:00
rjc%netscape.com
1c0de889c0 File system is now read/write on Mac.
git-svn-id: svn://10.0.0.236/trunk@7418 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:36:42 +00:00
radha%netscape.com
8a2d9fdff0 Change usage of jint to PRint32. One of he fixes from the net.
git-svn-id: svn://10.0.0.236/trunk@7417 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:31:57 +00:00
kin%netscape.com
497c60823c Modified fe_GravityCorrectForms() to call XtMoveWidget() instead of setting
the widget's x,y values directly. This allows SHACK and ENDER widgets to scroll
with the HTML page.


git-svn-id: svn://10.0.0.236/trunk@7416 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:28:53 +00:00
rjc%netscape.com
fa64ddaf6d On remote AFP volumes, don't show invisible files/folders.
git-svn-id: svn://10.0.0.236/trunk@7415 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:27:45 +00:00
spider%netscape.com
702a43e7f8 WIP: Menubar and Popup's
git-svn-id: svn://10.0.0.236/trunk@7414 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:23:37 +00:00
rjc%netscape.com
2f5b521dac Add some prototypes for Mac, but a bug where "db" was used by not initialied to anything.
git-svn-id: svn://10.0.0.236/trunk@7411 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:15:04 +00:00
rjc%netscape.com
3317e1a21f Small changes, including bug fix regarding passed in string being potentially changed.
git-svn-id: svn://10.0.0.236/trunk@7410 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:04:20 +00:00
sudu%netscape.com
1119d39d7c Fix to build js classes when NSJVM=1.
git-svn-id: svn://10.0.0.236/trunk@7409 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 01:01:42 +00:00
michaelp%netscape.com
2bba405161 changed to work with stuff on branch.
git-svn-id: svn://10.0.0.236/trunk@7408 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 00:59:11 +00:00
beard%netscape.com
7265fcd8b5 Turning OJI on.
git-svn-id: svn://10.0.0.236/trunk@7406 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-06 00:40:45 +00:00
timm%netscape.com
24a92854b3 renamed and obsoleted
git-svn-id: svn://10.0.0.236/trunk@7405 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 23:50:07 +00:00
timm%netscape.com
ab4db5575a fix anchor ugliness
git-svn-id: svn://10.0.0.236/trunk@7404 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 23:38:32 +00:00
timm%netscape.com
f8d3c63f19 fix ugly buttons
git-svn-id: svn://10.0.0.236/trunk@7403 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 23:35:49 +00:00
racham%netscape.com
0ee27f7629 Added help file 2step mode register page
git-svn-id: svn://10.0.0.236/trunk@7402 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 23:30:52 +00:00
racham%netscape.com
9e9c3fe191 Added help file 1step mode register page
git-svn-id: svn://10.0.0.236/trunk@7401 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 23:30:30 +00:00
racham%netscape.com
570b05cd0a Added help file 2step mode dialinfo page
git-svn-id: svn://10.0.0.236/trunk@7400 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 23:29:28 +00:00
racham%netscape.com
cd33518a06 Added help file 1step mode dialinfo page
git-svn-id: svn://10.0.0.236/trunk@7399 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 23:29:02 +00:00
robinf%netscape.com
46e8d238fb updating terminology to reflect the UI
git-svn-id: svn://10.0.0.236/trunk@7398 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 23:27:24 +00:00
guha%netscape.com
3332ed7459 pop in client
git-svn-id: svn://10.0.0.236/trunk@7397 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:47:23 +00:00
guha%netscape.com
ac354900fe pop mail stuff
git-svn-id: svn://10.0.0.236/trunk@7396 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:44:29 +00:00
rods%netscape.com
c4b82f67ab Removed debug statement
git-svn-id: svn://10.0.0.236/trunk@7393 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:39:02 +00:00
rods%netscape.com
84a20c8618 Additional selection changes
git-svn-id: svn://10.0.0.236/trunk@7392 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:38:24 +00:00
pierre%netscape.com
b5b464a381 declared NSGetFactory_WIDGET_DLL() as "C" function (even though it's still out-commented for now)
git-svn-id: svn://10.0.0.236/trunk@7391 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:28:37 +00:00
karnaze%netscape.com
ed1560d42a support for frameset cells without frames, fixed nsCSSRendering paint background divide by zero
git-svn-id: svn://10.0.0.236/trunk@7390 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:24:56 +00:00
rods%netscape.com
24d1b7f443 Fixed a warning in SelectAll
git-svn-id: svn://10.0.0.236/trunk@7389 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:23:03 +00:00
rods%netscape.com
0fdb88d53c Added a new GetWidth that take a nsIDeviceContext
git-svn-id: svn://10.0.0.236/trunk@7388 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:21:21 +00:00
kipp%netscape.com
0856501791 Added decls for framesets
git-svn-id: svn://10.0.0.236/trunk@7387 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:08:33 +00:00
troy%netscape.com
3b4e4530a6 Added some release calls for mBack, mForward, and mLocation
git-svn-id: svn://10.0.0.236/trunk@7386 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 22:06:58 +00:00
kostello%netscape.com
f7e923f8f1 Transfered CollectAttributes from CNavDTD.cpp -- code which was commented out
as part of a previous checkin


git-svn-id: svn://10.0.0.236/trunk@7385 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 21:50:20 +00:00
dcone%netscape.com
cb0c2c5600 fixed the plugin checkout to pull off of the tip
git-svn-id: svn://10.0.0.236/trunk@7384 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 21:48:44 +00:00
law%netscape.com
5da5e55fa0 I take back what I said about mjudge; he did screw up. But I think I've saved his butt for sure this time.
git-svn-id: svn://10.0.0.236/trunk@7383 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 21:16:55 +00:00
kin%netscape.com
b6a0aff66a Fixed ENDER related compiler warnings.
git-svn-id: svn://10.0.0.236/trunk@7382 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 20:21:43 +00:00
kin%netscape.com
3a5af378fa Added code to define ENDER if MOZ_ENDER is set.
Approved by wtc.


git-svn-id: svn://10.0.0.236/trunk@7381 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 20:21:13 +00:00
kin%netscape.com
77adf03846 Changed C++ comment to C comment.
git-svn-id: svn://10.0.0.236/trunk@7380 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 19:13:08 +00:00
kin%netscape.com
34850048ef Initial check-in of HTMLArea (embedded composer widget) form
element feature. All Ender related code is ifdef'd ENDER.


git-svn-id: svn://10.0.0.236/trunk@7379 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 19:08:58 +00:00
law%netscape.com
6032f49576 doh! mjudge didn't screw up after all. No, I'm not talking about the upcoming nuptials. Turning his /DENDER back on...
git-svn-id: svn://10.0.0.236/trunk@7378 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 19:00:15 +00:00
dfm%netscape.com
a96c4e838d Enabled privacy policies in winfe. Approved: garrett
git-svn-id: svn://10.0.0.236/trunk@7377 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 18:36:32 +00:00
despotdaemon%netscape.com
2e01a7f9c4 Pseudo-automatic update of changes made by martinl@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7376 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 18:34:15 +00:00
despotdaemon%netscape.com
600d9aac6d Pseudo-automatic update of changes made by martinl@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7375 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 18:33:23 +00:00
kostello%netscape.com
ae3ac55caa Added GetDepth
git-svn-id: svn://10.0.0.236/trunk@7374 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 18:14:16 +00:00
kostello%netscape.com
9e4dc10edf Added GetDepth method
git-svn-id: svn://10.0.0.236/trunk@7373 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 18:12:41 +00:00
michaelp%netscape.com
11139cfbd9 we now set the correct stretchblt mode. as a result scaled images look a lot sweeter.
git-svn-id: svn://10.0.0.236/trunk@7372 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 18:06:19 +00:00
kmcclusk%netscape.com
fc4129cfcc Really fix IRIX build.
git-svn-id: svn://10.0.0.236/trunk@7371 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 17:56:56 +00:00
kmcclusk%netscape.com
9e179a6c72 Fix for Linux build.
git-svn-id: svn://10.0.0.236/trunk@7370 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 17:32:14 +00:00
dcone%netscape.com
12be85a50e First Checked In.
git-svn-id: svn://10.0.0.236/trunk@7369 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 17:24:06 +00:00
despotdaemon%netscape.com
c95ba78de0 Pseudo-automatic update of changes made by jwz@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@7368 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 17:19:56 +00:00
kmcclusk%netscape.com
7dd69421a1 Fix for animated gifs.
git-svn-id: svn://10.0.0.236/trunk@7367 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 17:06:00 +00:00
dcone%netscape.com
85037cfadf First Checked In.
git-svn-id: svn://10.0.0.236/trunk@7366 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 17:01:56 +00:00
kmcclusk%netscape.com
32b2d94a95 Changed XtSetValues to XtMoveWidget for Scrolling.
git-svn-id: svn://10.0.0.236/trunk@7365 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 16:51:54 +00:00
troy%netscape.com
640244ef6c Changed 8 bit images to use DIB_PAL_COLORS. Also changed it so that
8-bit images aren't dithered to the color cube on a true color device


git-svn-id: svn://10.0.0.236/trunk@7364 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 15:51:31 +00:00
dcone%netscape.com
e329e37de4 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@7363 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 15:44:36 +00:00
troy%netscape.com
55ab0c808f Added GetDepth() member function
git-svn-id: svn://10.0.0.236/trunk@7362 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 15:26:15 +00:00
ramiro%netscape.com
206a86201d Fix the mozilla-motif-export target linking.
git-svn-id: svn://10.0.0.236/trunk@7361 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 15:17:43 +00:00
kmcclusk%netscape.com
cc31f8a99d Changed STATUS_HEIGHT constant for unix. It wasn't big enough.
Left STATUS_HEIGHT as is for windows.


git-svn-id: svn://10.0.0.236/trunk@7360 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 15:11:46 +00:00
jfrancis%netscape.com
466ea47fda First pass of the htmlarea form element, aka Ender. Module owners dagley and brade ok'd.
git-svn-id: svn://10.0.0.236/trunk@7359 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 12:38:53 +00:00
jfrancis%netscape.com
118c97805b First pass of the htmlarea form element for macfe, aka Ender. module owners dagley and brade ok'd.
git-svn-id: svn://10.0.0.236/trunk@7358 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 12:36:53 +00:00
pierre%netscape.com
90847ac95f fix build on Windows and Unix
git-svn-id: svn://10.0.0.236/trunk@7357 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 09:02:52 +00:00
beard%netscape.com
dec5335dea Disabled object stack item caching, as stale cache entries are living longer than the PA_Tags they are associated with. This is the cause of defect ID: 311147 in bugsplat.
git-svn-id: svn://10.0.0.236/trunk@7356 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 09:01:09 +00:00
ftang%netscape.com
9d7c3da55f add viscii to unicode conversion source
thanks Thu Nguyen <tnn@neomagic.com> from the net.


git-svn-id: svn://10.0.0.236/trunk@7355 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:45:21 +00:00
pierre%netscape.com
462cbb441c build xpcom as a static lib
git-svn-id: svn://10.0.0.236/trunk@7354 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:32:38 +00:00
pierre%netscape.com
e6c188ac32 added "view", "libpref" and "plugin" groups
git-svn-id: svn://10.0.0.236/trunk@7353 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:31:41 +00:00
pierre%netscape.com
82e3a8508c added targets to build static libs
git-svn-id: svn://10.0.0.236/trunk@7352 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:30:44 +00:00
pierre%netscape.com
e5e43f569f added base64.c to fix Raptor build
git-svn-id: svn://10.0.0.236/trunk@7351 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:30:07 +00:00
pierre%netscape.com
1f117b43ba added several files in "base", "events" and "html/document" groups
git-svn-id: svn://10.0.0.236/trunk@7350 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:29:20 +00:00
pierre%netscape.com
c752f086bd added nsParserFactory.cpp
git-svn-id: svn://10.0.0.236/trunk@7349 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:28:24 +00:00
pierre%netscape.com
5dc5abc3be added the "mac" group
git-svn-id: svn://10.0.0.236/trunk@7348 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:27:38 +00:00
pierre%netscape.com
0737abbdec added header files to fix Raptor build
git-svn-id: svn://10.0.0.236/trunk@7347 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:26:45 +00:00
pierre%netscape.com
4109c4f50e fixed to compile on Mac
git-svn-id: svn://10.0.0.236/trunk@7346 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:26:03 +00:00
pierre%netscape.com
7585290428 removed NS_IMPL_IDS: it moved to nsPref.cpp
git-svn-id: svn://10.0.0.236/trunk@7345 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:25:24 +00:00
pierre%netscape.com
f7ba479251 fix build on Mac
git-svn-id: svn://10.0.0.236/trunk@7344 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:23:13 +00:00
pierre%netscape.com
e10aa9e151 include nsMacRepository.h
git-svn-id: svn://10.0.0.236/trunk@7343 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:22:38 +00:00
pierre%netscape.com
4137a7050a added dozens of missing pure virtual functions
git-svn-id: svn://10.0.0.236/trunk@7342 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:21:01 +00:00
pierre%netscape.com
61e1b08588 On Mac only, explicitly create the ImageManagerInit
git-svn-id: svn://10.0.0.236/trunk@7341 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:20:01 +00:00
pierre%netscape.com
3d3c42a6c7 renamed NSGetFactory to build on Mac
git-svn-id: svn://10.0.0.236/trunk@7340 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:17:06 +00:00
pierre%netscape.com
f3ed50246f added declaration of pure virtual functions to fix build on Mac
git-svn-id: svn://10.0.0.236/trunk@7338 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:11:01 +00:00
pierre%netscape.com
97aee721c3 defined MOZ_NGLAYOUT
git-svn-id: svn://10.0.0.236/trunk@7336 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:07:39 +00:00
pierre%netscape.com
3fc4edcce4 added nsMacRepository.h
git-svn-id: svn://10.0.0.236/trunk@7335 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:06:50 +00:00
pierre%netscape.com
07ee5e3104 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@7334 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:06:33 +00:00
pierre%netscape.com
29130e6ef7 fix build errors with Raptor
git-svn-id: svn://10.0.0.236/trunk@7333 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 08:02:20 +00:00
ftang%netscape.com
d2aca792ab check in KOI8-U support for XFE. Thanks
Dmitry Kohmanyuk dk+@ua.net from the net


git-svn-id: svn://10.0.0.236/trunk@7332 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 07:29:55 +00:00
beard%netscape.com
36e48fa33a For OJI, macroized access to LO_BuiltinStruct. Should really put these macros in layout.h.
git-svn-id: svn://10.0.0.236/trunk@7331 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 05:44:47 +00:00
beard%netscape.com
70d4ea64e6 Removed redundant declaration of gForcingRedraw.
git-svn-id: svn://10.0.0.236/trunk@7330 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 05:38:36 +00:00
beard%netscape.com
3b05b85628 Version check breaks HTML dialogs.
git-svn-id: svn://10.0.0.236/trunk@7329 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 05:25:12 +00:00
michaelp%netscape.com
f6f0263fa5 changes for plugins.
git-svn-id: svn://10.0.0.236/trunk@7328 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 04:23:21 +00:00
michaelp%netscape.com
c273de6a07 added tags for plugins.
git-svn-id: svn://10.0.0.236/trunk@7327 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 04:22:51 +00:00
michaelp%netscape.com
80cbe36b7a latest changes to get plugins working...
git-svn-id: svn://10.0.0.236/trunk@7326 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 04:21:36 +00:00
pinkerton%netscape.com
f299f54987 Comment out lines that aren't being used. Also fixes build bustage.
git-svn-id: svn://10.0.0.236/trunk@7325 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 04:07:29 +00:00
morse%netscape.com
e4811f323a fix minor bugs, alphabetize items in cookie viewer lists
git-svn-id: svn://10.0.0.236/trunk@7324 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 03:34:16 +00:00
rickg%netscape.com
945143176c fixed a potential crash in case of empty documents
git-svn-id: svn://10.0.0.236/trunk@7323 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 03:16:51 +00:00
pinkerton%netscape.com
62c171618b Register a bunch of new classes for the new aurora ui.
git-svn-id: svn://10.0.0.236/trunk@7322 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 03:01:02 +00:00
pinkerton%netscape.com
850cfd8fa1 moving CChameleonCaption out to its own class (appr brade).
git-svn-id: svn://10.0.0.236/trunk@7321 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 03:00:31 +00:00
pinkerton%netscape.com
b74f4ec3de Shack stuff.
git-svn-id: svn://10.0.0.236/trunk@7320 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 03:00:13 +00:00
pinkerton%netscape.com
efce6dbe46 Tons of stuff for color and behavior properties.
git-svn-id: svn://10.0.0.236/trunk@7319 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:59:42 +00:00
pinkerton%netscape.com
cf147546f6 Implement ListenToMessage and trap the message from the IconCache to call a pure virtual. Means subclasses don't have to override ListenToMessage.
git-svn-id: svn://10.0.0.236/trunk@7318 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:59:23 +00:00
pinkerton%netscape.com
a8a0b63ffe REmoved CCaption and added CColorCaption.
git-svn-id: svn://10.0.0.236/trunk@7317 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:58:26 +00:00
pinkerton%netscape.com
38ebbe44b8 Rewritten and broken out so that the same base class can be used for both the title strip and the command strip.
git-svn-id: svn://10.0.0.236/trunk@7316 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:57:56 +00:00
pinkerton%netscape.com
c5841c0cbd use a constant instead of hard-coded pane id.
git-svn-id: svn://10.0.0.236/trunk@7315 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:57:26 +00:00
pinkerton%netscape.com
a44f6a0bd8 sfraser's fix for less flashing when showing a window for the first time.
git-svn-id: svn://10.0.0.236/trunk@7314 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:57:06 +00:00
pinkerton%netscape.com
d32cf4e9ea More rewrites for the new UI. Command area, mode switching, colors and behavior properties fully implemented.
git-svn-id: svn://10.0.0.236/trunk@7313 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:56:24 +00:00
warren%netscape.com
33abdfdfe3 Removed
git-svn-id: svn://10.0.0.236/trunk@7312 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:56:18 +00:00
pinkerton%netscape.com
9b0f6210d7 New suite of CreateHTPane methods to take a variety of parameters.
git-svn-id: svn://10.0.0.236/trunk@7311 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:55:38 +00:00
pinkerton%netscape.com
d036475b83 Added a target to DoGetURL so shack can dispatch correctly.
git-svn-id: svn://10.0.0.236/trunk@7310 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:55:07 +00:00
warren%netscape.com
b3837b8667 lib/plugin is obsolete -- moved to modules/plugin
git-svn-id: svn://10.0.0.236/trunk@7309 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:55:03 +00:00
pinkerton%netscape.com
f4dbc31508 More stuff for RDF properties as well as fixing color parsing.
git-svn-id: svn://10.0.0.236/trunk@7308 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:54:32 +00:00
pinkerton%netscape.com
420c492a7e some new traits for Aurora.
git-svn-id: svn://10.0.0.236/trunk@7307 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:53:31 +00:00
pinkerton%netscape.com
d2c950ad1d new UI for Aurora (mode switching, command pane).
git-svn-id: svn://10.0.0.236/trunk@7306 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:53:18 +00:00
warren%netscape.com
627233819d Added av's changes back in from lib/plugin/npglue.cpp -- Adding sizing feature to the plugin API. Reviewed by Nisheeth.
git-svn-id: svn://10.0.0.236/trunk@7305 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:53:11 +00:00
pinkerton%netscape.com
c842c7a21e Updated ctyp's for CRDFCoordinator and created a new one for CBroadcastChameleonCaption
git-svn-id: svn://10.0.0.236/trunk@7304 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:52:49 +00:00
pinkerton%netscape.com
dad17cf475 Moving CChameleonCaption to a separate file. (appr brade).
git-svn-id: svn://10.0.0.236/trunk@7303 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:52:10 +00:00
pinkerton%netscape.com
5b550b6e3a First Checked In.
git-svn-id: svn://10.0.0.236/trunk@7302 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:50:38 +00:00
kin%netscape.com
47af53e22b Fix Linux build bustage when ENDER is defined. Changed C++ comment to C
comment. Approved by nisheeth.


git-svn-id: svn://10.0.0.236/trunk@7301 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:41:21 +00:00
spider%netscape.com
febb683597 Minor fix for release builds
git-svn-id: svn://10.0.0.236/trunk@7300 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:17:36 +00:00
karnaze%netscape.com
01254d8747 fixed bug when size=0 is specified on form control
git-svn-id: svn://10.0.0.236/trunk@7299 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:16:26 +00:00
rickg%netscape.com
8f5813c0a2 WIP for token reduction and a few bug fixes
git-svn-id: svn://10.0.0.236/trunk@7298 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 02:01:44 +00:00
rickg%netscape.com
6355c16731 improved deque API a tad
git-svn-id: svn://10.0.0.236/trunk@7297 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:59:34 +00:00
morse%netscape.com
fa337bf2b3 change for anonymous mode, reviewed by dfm
git-svn-id: svn://10.0.0.236/trunk@7296 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:49:15 +00:00
morse%netscape.com
80db92eef0 change for anonymous mode
git-svn-id: svn://10.0.0.236/trunk@7295 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:47:15 +00:00
kipp%netscape.com
51b373aef4 Added an assertion and a little more debug noise when nspr logging is maxed out
git-svn-id: svn://10.0.0.236/trunk@7294 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:43:42 +00:00
kipp%netscape.com
9734b7b092 Use flexible library naming
git-svn-id: svn://10.0.0.236/trunk@7293 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:40:20 +00:00
warren%netscape.com
ed2c784ba2 Fixed version umber for js3250.lib.
git-svn-id: svn://10.0.0.236/trunk@7292 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:33:36 +00:00
kipp%netscape.com
e940baebe7 Fix windows build to use js3250.dll
git-svn-id: svn://10.0.0.236/trunk@7291 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:33:07 +00:00
rickg%netscape.com
c4b5ce8b7d kipps changes
git-svn-id: svn://10.0.0.236/trunk@7290 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:31:14 +00:00
ftang%netscape.com
c42af0e216 back up cp9xx table check in rev 3.3 untill more test got perform
git-svn-id: svn://10.0.0.236/trunk@7289 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:23:24 +00:00
warren%netscape.com
1a15f88bcf Added include of config.mk so that MOZ_OJI gets defined.
git-svn-id: svn://10.0.0.236/trunk@7288 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 01:19:53 +00:00
warren%netscape.com
3dbe7c3077 Added
git-svn-id: svn://10.0.0.236/trunk@7287 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 00:50:56 +00:00
hyatt%netscape.com
2b64f6786f Improving drag feedback.
git-svn-id: svn://10.0.0.236/trunk@7286 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 00:38:41 +00:00
warren%netscape.com
35941018bd Changes to build with MOZ_OJI, and optionally build NSJVM. Changes to regenerate jar files. Changed version number to 50.
git-svn-id: svn://10.0.0.236/trunk@7285 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 00:36:13 +00:00
kin%netscape.com
009d01704d Fixed build bustage on Linux when ENDER is defined. Replaced C++ comment with
a C comment.


git-svn-id: svn://10.0.0.236/trunk@7284 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-05 00:07:19 +00:00
raman%netscape.com
87bf85eb79 Adde context as argument to all caps public methods that could be used by JS
git-svn-id: svn://10.0.0.236/trunk@7283 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 23:54:29 +00:00
av%netscape.com
4360e22d9b Adding sizing feature to the plugin API. Reviewed by Nisheeth.
git-svn-id: svn://10.0.0.236/trunk@7282 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 23:49:09 +00:00
kin%netscape.com
00a0f2f6d1 Fixed Unix build bustage when ENDER is defined.
Reviewed and approved by brendan.


git-svn-id: svn://10.0.0.236/trunk@7281 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 23:18:10 +00:00
kipp%netscape.com
48351d5ffc Init refcnt for html anchor rules
git-svn-id: svn://10.0.0.236/trunk@7280 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 23:06:39 +00:00
jgellman%netscape.com
49dff19b5f whups! cpp ifdefs aren't the same as nmake ifdefs!
git-svn-id: svn://10.0.0.236/trunk@7279 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 22:59:24 +00:00
jgellman%netscape.com
f89cd110eb link against pop3url.lib if RDF mail is being built
git-svn-id: svn://10.0.0.236/trunk@7278 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 22:58:08 +00:00
waterson%netscape.com
3d8af28698 Added timing for top-level table blockage.
git-svn-id: svn://10.0.0.236/trunk@7277 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 22:56:15 +00:00
waterson%netscape.com
1975e743f5 Added timing/tracking for cache hits.
git-svn-id: svn://10.0.0.236/trunk@7276 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 22:55:25 +00:00
toshok%netscape.com
c6a007a728 Fix problem of alignment inside table cells getting lost. fixes 311994 (www.zdnet.com) and 311983 (www.mozilla.org) initial layout.
git-svn-id: svn://10.0.0.236/trunk@7275 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 22:26:42 +00:00
robinf%netscape.com
16e28d0024 changed title and button names to match UI
git-svn-id: svn://10.0.0.236/trunk@7274 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:55:31 +00:00
despotdaemon%netscape.com
ea7619260a Pseudo-automatic update of changes made by ddrinan@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7273 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:55:02 +00:00
saari%netscape.com
b88d0a311b Merging in sfraser's MacMemAllocator changes from 4.5, along with improved MacMemAllocator/cache behavior.
git-svn-id: svn://10.0.0.236/trunk@7272 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:50:56 +00:00
troy%netscape.com
cb2e01c0ab Removed some annoying printf messages
git-svn-id: svn://10.0.0.236/trunk@7271 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:44:42 +00:00
warren%netscape.com
379619f4e4 Fixed crashes in reporting errors on failure to initialize.
git-svn-id: svn://10.0.0.236/trunk@7269 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:37:16 +00:00
radha%netscape.com
e71e2315ba Context menu changes
git-svn-id: svn://10.0.0.236/trunk@7268 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:20:45 +00:00
radha%netscape.com
3032438c7d Implement some of the RDFView context menu features.
git-svn-id: svn://10.0.0.236/trunk@7267 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:20:13 +00:00
kipp%netscape.com
8c7c80abed Reworked floater handling and sanitized space manager usage
git-svn-id: svn://10.0.0.236/trunk@7266 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:18:16 +00:00
kipp%netscape.com
af8125b945 Updates for better floater support
git-svn-id: svn://10.0.0.236/trunk@7265 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:17:56 +00:00
kipp%netscape.com
c2e7c19613 Cleanup frame-first-reflow bit
git-svn-id: svn://10.0.0.236/trunk@7264 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:17:18 +00:00
kipp%netscape.com
2c1def0a9e snapshot
git-svn-id: svn://10.0.0.236/trunk@7263 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:16:58 +00:00
kipp%netscape.com
c63ad2aed0 Tell line layout about floater
git-svn-id: svn://10.0.0.236/trunk@7262 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:16:32 +00:00
kipp%netscape.com
f6db301b4d Enable refresh after document is loaded
git-svn-id: svn://10.0.0.236/trunk@7261 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:16:13 +00:00
kipp%netscape.com
736e58effc Removed nextid tag
git-svn-id: svn://10.0.0.236/trunk@7260 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:14:19 +00:00
ftang%netscape.com
d07b10ac8d these are meaningless check in to attach comment for my last check in.
Accidentally, my last check do not include comment.
Below is the comment for last check in;
Add KOI8-U support for UNIX
Add XP_ASSERT to Unicode converter


git-svn-id: svn://10.0.0.236/trunk@7259 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:11:09 +00:00
rods%netscape.com
e197487ae9 Fixed the fix
git-svn-id: svn://10.0.0.236/trunk@7258 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:06:35 +00:00
rods%netscape.com
21f2943467 Added a check for a null hWnd on call to ScreenToClient, DESTROY event
can cause wHnd to be null


git-svn-id: svn://10.0.0.236/trunk@7257 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:04:02 +00:00
hyatt%netscape.com
440b725854 Fixes for bugs 301228 and 311949. Approved by blythe.
git-svn-id: svn://10.0.0.236/trunk@7256 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 21:00:44 +00:00
ftang%netscape.com
8297ae1a85 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7255 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 20:53:37 +00:00
ftang%netscape.com
cd1f026c73 Switch to the windows cp9xx Unicode conversion table instead
git-svn-id: svn://10.0.0.236/trunk@7254 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 20:53:11 +00:00
troy%netscape.com
e001e89faa Fixed memory leak (mObservers wasn't being freed)
git-svn-id: svn://10.0.0.236/trunk@7253 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 20:46:00 +00:00
bjorn%netscape.com
30ead9145f Additional xpcom support for JS. Currently not in use by anyone. See MyScriptable.{h,cpp}
for an example of how to use this interface.


git-svn-id: svn://10.0.0.236/trunk@7252 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 20:34:20 +00:00
troy%netscape.com
92be964d2d Moved DoSelectAll() outside of a #ifdef NS_DEBUG
git-svn-id: svn://10.0.0.236/trunk@7251 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 20:04:55 +00:00
waterson%netscape.com
d633694d11 Fixed bustage that I'd missed while merging.
git-svn-id: svn://10.0.0.236/trunk@7250 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:44:07 +00:00
rickg%netscape.com
53a4ef4f1e lets try this again
git-svn-id: svn://10.0.0.236/trunk@7249 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:38:46 +00:00
waterson%netscape.com
93138f6445 Changes to timing to support clocks. Layout changes approved by toshok, netlib changes approved by gagan.
git-svn-id: svn://10.0.0.236/trunk@7248 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:35:56 +00:00
ftang%netscape.com
7b30af3acf Comment out problemtic XP_ASSERT. We should double check editor when we
introduce Thai line breaking into mozill


git-svn-id: svn://10.0.0.236/trunk@7247 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:12:42 +00:00
beard%netscape.com
4e7e554922 Added oji[Debug].o static libraries, and access path to find them. Also added LiveConnect[Debug].shlb shared libraries, which are found via the aliases in the client[_debug] build directories.
git-svn-id: svn://10.0.0.236/trunk@7246 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:10:16 +00:00
ftang%netscape.com
c644a9b9d9 Correct KOI8-U conversion table and add .ut and .uf file.
Thanks Dmitry Kohmanyuk dk@farm.org from the net. However, we are
not sure the mapping for Bullet is correct.


git-svn-id: svn://10.0.0.236/trunk@7245 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:09:29 +00:00
beard%netscape.com
f195af1848 No longer processing mozilla/js/jsj/MANIFEST, which is superseded by mozilla/js/src/liveconnect/MANIFEST.
git-svn-id: svn://10.0.0.236/trunk@7244 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:08:47 +00:00
rickg%netscape.com
647cb7ac32 get parser back on line
git-svn-id: svn://10.0.0.236/trunk@7243 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:04:14 +00:00
nisheeth%netscape.com
bad06dcb17 Fix for bug 129639: Only add the new linefeed for preformatted text inside
lo_RelayoutTextElements().  This fixes the extra line feeds that were
being generated for regular text.


git-svn-id: svn://10.0.0.236/trunk@7242 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 19:01:27 +00:00
karnaze%netscape.com
45f1e4583c form submission on carriage return in some cases; replaced NS_RELEASE with NS_IF_RELEASE in nsFrame destructor
git-svn-id: svn://10.0.0.236/trunk@7241 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 18:19:51 +00:00
hyatt%netscape.com
871b8909f6 Fixing Windows build bustage.
git-svn-id: svn://10.0.0.236/trunk@7240 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 17:45:56 +00:00
buster%netscape.com
0438f71bc7 removed an overly-aggressive assertion that prevents nested tables from laying out
git-svn-id: svn://10.0.0.236/trunk@7239 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 17:16:56 +00:00
karnaze%netscape.com
b3c9dd780b test9 no longer uses test6
git-svn-id: svn://10.0.0.236/trunk@7238 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 16:57:44 +00:00
rickg%netscape.com
cf891caa2b fixed serious parser bug from earlier today
git-svn-id: svn://10.0.0.236/trunk@7237 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 10:16:09 +00:00
rickg%netscape.com
d9c958d147 minor tweak to remove tabs
git-svn-id: svn://10.0.0.236/trunk@7236 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 10:12:45 +00:00
hyatt%netscape.com
344492bee8 Improvements to the control strip on the nav bar. Fix for the status bar bug
where the status bar isn't taking over the whole area at the bottom like it
should.


git-svn-id: svn://10.0.0.236/trunk@7235 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 08:25:37 +00:00
troy%netscape.com
7fb8a37109 Fixed Win95 transparent image problem
git-svn-id: svn://10.0.0.236/trunk@7234 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 05:24:14 +00:00
dfm%netscape.com
32bdbc5e22 Added ifdefs around morse's single signon calls.
git-svn-id: svn://10.0.0.236/trunk@7233 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 05:15:53 +00:00
michaelp%netscape.com
9fed2ea8af hacks to get the build going on IRIX.
git-svn-id: svn://10.0.0.236/trunk@7232 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 04:57:24 +00:00
warren%netscape.com
07f21d02f5 Added cross-java jar files so we don't have to build them every time.
git-svn-id: svn://10.0.0.236/trunk@7231 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 04:21:00 +00:00
dfm%netscape.com
c8e1dac630 Removed ifdefs from dependency on privacy module.
git-svn-id: svn://10.0.0.236/trunk@7230 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 04:16:53 +00:00
michaelp%netscape.com
2201d863cf fix for unix build.
git-svn-id: svn://10.0.0.236/trunk@7229 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 04:07:59 +00:00
warren%netscape.com
329caf5f7c Added cross-java jar files so we don't have to build them every time.
git-svn-id: svn://10.0.0.236/trunk@7228 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 03:57:46 +00:00
dfm%netscape.com
6c6412630d Fixing build bustage. Removed conditional compilation of privacy.
git-svn-id: svn://10.0.0.236/trunk@7227 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 03:51:01 +00:00
leif
35b2c182d7 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7226 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 03:50:56 +00:00
michaelp%netscape.com
4cb90a9f6d attempt to fix busted Unix builds...
git-svn-id: svn://10.0.0.236/trunk@7225 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 03:21:43 +00:00
clayton
8249797f6f Fixed relatively stupid error on my part in the avref2berptrptr function.
This broke binary modifies.  Tested fix on Solaris and NT.  Works fine
without leaking memory or dumping core on both platforms.


git-svn-id: svn://10.0.0.236/trunk@7224 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 02:28:12 +00:00
morse%netscape.com
c1ca573fea back out change to fix tree bustage
git-svn-id: svn://10.0.0.236/trunk@7223 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 02:20:15 +00:00
ramiro%netscape.com
f7b46c4dff Fix privacy build bustage.
git-svn-id: svn://10.0.0.236/trunk@7222 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:58:43 +00:00
timm%netscape.com
e26eb9ad36 change compServ to .NRS
git-svn-id: svn://10.0.0.236/trunk@7221 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:44:37 +00:00
dfm%netscape.com
89354588b2 Added export of laylayer.h, as needed for privacy module.
git-svn-id: svn://10.0.0.236/trunk@7220 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:41:21 +00:00
timm%netscape.com
8cf5fc67d1 add call to SetCacheState
git-svn-id: svn://10.0.0.236/trunk@7219 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:38:43 +00:00
clu%netscape.com
b28fd3472e changed composer table insert menu items. reviewed by jfrancis.
git-svn-id: svn://10.0.0.236/trunk@7218 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:30:13 +00:00
timm%netscape.com
62cf538626 change .IAS to .NRS
git-svn-id: svn://10.0.0.236/trunk@7217 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:28:55 +00:00
dfm%netscape.com
4cf65288f8 Removed temporary privacy policy warning dialog.
git-svn-id: svn://10.0.0.236/trunk@7216 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:26:57 +00:00
timm%netscape.com
7603b93dec change extension from .IAS to .NRS to avoid conflict with those files
git-svn-id: svn://10.0.0.236/trunk@7215 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:24:52 +00:00
clu%netscape.com
54584c9b08 changes to table menu items.
git-svn-id: svn://10.0.0.236/trunk@7214 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:24:40 +00:00
dfm%netscape.com
83642a4545 Removed ifdefs from privacy calls. Approved: nisheeth
git-svn-id: svn://10.0.0.236/trunk@7213 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:17:43 +00:00
hyatt%netscape.com
0dab428c74 Added control strip, removed selector bar and HTML pane, and added support
for template data fetching from the back end.


git-svn-id: svn://10.0.0.236/trunk@7212 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:10:49 +00:00
timm%netscape.com
cc3c8aaae1 change to use compServer
git-svn-id: svn://10.0.0.236/trunk@7211 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:06:49 +00:00
timm%netscape.com
d472fba684 add support for cache writethrough
git-svn-id: svn://10.0.0.236/trunk@7210 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:06:09 +00:00
timm%netscape.com
79de90379f fix getBrowserVersionNumber
git-svn-id: svn://10.0.0.236/trunk@7209 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:05:37 +00:00
timm%netscape.com
6a78520926 fix acctSetupFolder
git-svn-id: svn://10.0.0.236/trunk@7208 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:05:22 +00:00
timm%netscape.com
3832c2eff7 add compServer form element
git-svn-id: svn://10.0.0.236/trunk@7207 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:04:41 +00:00
timm%netscape.com
d481afb151 change to use compServer not regServer
git-svn-id: svn://10.0.0.236/trunk@7206 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:04:19 +00:00
timm%netscape.com
c91fae1434 remove debugging stubs
git-svn-id: svn://10.0.0.236/trunk@7205 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 01:03:49 +00:00
buster%netscape.com
da8f241ef3 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7204 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:58:34 +00:00
buster%netscape.com
e514cbfa57 backed out a mistake from my last checkin. table min sizes are ok again
git-svn-id: svn://10.0.0.236/trunk@7203 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:56:57 +00:00
warren%netscape.com
caf7891083 Removed struct/class warning for _jobject.
git-svn-id: svn://10.0.0.236/trunk@7202 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:53:49 +00:00
morse%netscape.com
e45542c650 change for anonymous mode
git-svn-id: svn://10.0.0.236/trunk@7201 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:51:34 +00:00
preed%netscape.com
e05c2829b5 Added testfailed status; modified gz filenames to add buildates; reviewed
by ltabb.


git-svn-id: svn://10.0.0.236/trunk@7200 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:29:17 +00:00
hyatt%netscape.com
a80f62eebb Messed up the names of two properties. Approved by RJC.
git-svn-id: svn://10.0.0.236/trunk@7199 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:28:03 +00:00
gagan%netscape.com
54436a0c32 Fix for 309403. Support for WebSTAR FTP server added.
git-svn-id: svn://10.0.0.236/trunk@7198 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:24:06 +00:00
kin%netscape.com
0d93b2dba9 Fix for bug crasher bug that occurs when communicator is built with ENDER
defined and a page with a textarea is loaded.
Reviewed and approved by nisheeth.


git-svn-id: svn://10.0.0.236/trunk@7197 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:21:36 +00:00
gagan%netscape.com
c96822cc25 Prefetching enabled and architechtural changes put in. Anchor tags for prefetching is deprecated.
git-svn-id: svn://10.0.0.236/trunk@7196 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:20:38 +00:00
robinf%netscape.com
49c42adc1e fixed line endings
git-svn-id: svn://10.0.0.236/trunk@7195 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:20:24 +00:00
dfm%netscape.com
74c9764f83 Removed MOZ_PRIVACY switch, added MOZ_TRANSACTION_RECEIPTS switch.
Approved: sar


git-svn-id: svn://10.0.0.236/trunk@7194 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:20:15 +00:00
dfm%netscape.com
7477ff1f3d Changed name of privacy policy pref. Approved: garrett
git-svn-id: svn://10.0.0.236/trunk@7193 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:18:29 +00:00
gagan%netscape.com
43db707ad6 Calling PRE_fetch now. Removed a parameter from Addtoprefetch list. Approved by Nisheeth.
git-svn-id: svn://10.0.0.236/trunk@7192 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:18:07 +00:00
vidur%netscape.com
c6800e0a6e Added generation of declaration and forwarding macros. Better handling of families of interfaces.
git-svn-id: svn://10.0.0.236/trunk@7191 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:08:29 +00:00
vidur%netscape.com
c6fd3f22ca Added document.forms. Specialized interfaces for images and forms. Better handling of childNodes collection.
git-svn-id: svn://10.0.0.236/trunk@7190 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:05:22 +00:00
despotdaemon%netscape.com
2e756b326f Pseudo-automatic update of changes made by preed@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@7189 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-04 00:05:17 +00:00
dfm%netscape.com
a9eb638cb7 Removed ifdefs from inclusion of privacy module. Approved: garrett
git-svn-id: svn://10.0.0.236/trunk@7188 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:58:08 +00:00
gagan%netscape.com
c5071756e1 Prefetching changes. Removed pre-fetch values on a per tag basis. Pref is now the max number of docs to prefetch.
git-svn-id: svn://10.0.0.236/trunk@7187 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:53:58 +00:00
dfm%netscape.com
3829b4cba0 Removed ifdefs from build of privacy module. Approved: sar
git-svn-id: svn://10.0.0.236/trunk@7186 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:44:11 +00:00
hyatt%netscape.com
7c9b9b19ed Added more control strip properties. Approved by RJC.
git-svn-id: svn://10.0.0.236/trunk@7185 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:41:58 +00:00
dfm%netscape.com
10ca389632 Removed ifdefs from privacy-policy fields. Approved: gagan
git-svn-id: svn://10.0.0.236/trunk@7184 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:39:51 +00:00
rods%netscape.com
d4e21d533b Fixed the release problem on shell and doc and added a default paramenter to
Display Selection


git-svn-id: svn://10.0.0.236/trunk@7183 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:39:16 +00:00
dfm%netscape.com
3d03cc7019 Added privacy.warn_no_policy preference; default is off.
git-svn-id: svn://10.0.0.236/trunk@7182 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:32:13 +00:00
dfm%netscape.com
d103f8b2d1 Removed ifdefs from netlib privacy-policy code. Approved: gagan
git-svn-id: svn://10.0.0.236/trunk@7181 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:29:48 +00:00
troy%netscape.com
220c86b242 Added ASSERT for the case where we get passed a reflow reason of initial
when we've already been reflowed once


git-svn-id: svn://10.0.0.236/trunk@7180 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:29:35 +00:00
hyatt%netscape.com
c3e3652fa7 Fixing Mac build bustage. Approved by RJC and Pinkerton.
git-svn-id: svn://10.0.0.236/trunk@7179 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:23:30 +00:00
rods%netscape.com
114c8b9669 Added repaint is forced on Select All
git-svn-id: svn://10.0.0.236/trunk@7178 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:14:54 +00:00
kmcclusk%netscape.com
a14366b05b Derive nsDeviceContextUnix from nsDeviceContext and removed redudant methods
and fields


git-svn-id: svn://10.0.0.236/trunk@7177 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:06:05 +00:00
kmcclusk%netscape.com
1c82fde593 Derived nsDeviceContextUnix from nsDeviceContextImpl and removed redudant
methods + fields.


git-svn-id: svn://10.0.0.236/trunk@7176 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:05:13 +00:00
dfm%netscape.com
2af09e7b08 Added fields (removed ifdefs) for privacy policies. Approved: gagan
git-svn-id: svn://10.0.0.236/trunk@7175 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 23:01:13 +00:00
dfm%netscape.com
166afd5dc6 Removed temporary SD macro for privacy policy dialogs.
git-svn-id: svn://10.0.0.236/trunk@7174 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:57:37 +00:00
troy%netscape.com
ab3a9de57d Changed rendering context to use stock black brush (this reduces our GDI
usage ever so slightly), and added some XXX comments


git-svn-id: svn://10.0.0.236/trunk@7173 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:56:16 +00:00
rods%netscape.com
794fc90afc Small selection fix, force update when frane changes but content stays the same.
git-svn-id: svn://10.0.0.236/trunk@7172 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:53:27 +00:00
dfm%netscape.com
c28e6ce625 Added laylayer.h export for privacy module. Approved: nisheeth
git-svn-id: svn://10.0.0.236/trunk@7171 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:52:16 +00:00
dfm%netscape.com
071b1bb9ce Added unconditional dependency on privacy module, switch for
MOZ_TRANSACTION_RECEIPTS. Reviewed: nisheeth


git-svn-id: svn://10.0.0.236/trunk@7170 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:49:38 +00:00
dfm%netscape.com
fb88cf7972 Added export of laylayer.h for privacy module, even though the Mac build
system is cheating right now and doesn't need it. Reviewed: nisheeth


git-svn-id: svn://10.0.0.236/trunk@7169 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:45:14 +00:00
guha%netscape.com
116123ed08 One more small thing in the name of mail
git-svn-id: svn://10.0.0.236/trunk@7168 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:38:10 +00:00
rods%netscape.com
cfa99ac119 added select all and fixed the foreground colors for the URL and Status bars
git-svn-id: svn://10.0.0.236/trunk@7167 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:32:34 +00:00
hyatt%netscape.com
22d404b970 Added notion of templates to HT. Added several configurable properties.
git-svn-id: svn://10.0.0.236/trunk@7166 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:32:19 +00:00
rods%netscape.com
605968f8d8 Add method void nsTextWidget::SubclassWindow(BOOL bState)
and LRESULT CALLBACK nsTextWidget::TextWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 to filter out the "ding" when the return key is pressed.


git-svn-id: svn://10.0.0.236/trunk@7165 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:31:07 +00:00
rods%netscape.com
29c7563ade Implemented SetUpForPaint, but it doesn't do the SetBkMode
git-svn-id: svn://10.0.0.236/trunk@7164 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:28:49 +00:00
rods%netscape.com
19959a047b Added the method SetUpForPaint for setting up the proper foreground
and background colors for the WM_CTLCOLORXXXX messages


git-svn-id: svn://10.0.0.236/trunk@7163 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:28:00 +00:00
rods%netscape.com
339fff0c28 Added ref counting for nsIContent, made selection rendering changes
git-svn-id: svn://10.0.0.236/trunk@7162 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:23:32 +00:00
dfm%netscape.com
7abd0f037e Altered privacy module build to exclude receipt.c unless
MOZ_TRANSACTION_RECEIPTS is set. Reviewed: morse


git-svn-id: svn://10.0.0.236/trunk@7161 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:23:10 +00:00
guha%netscape.com
c37fed4be6 More random mail stuff
git-svn-id: svn://10.0.0.236/trunk@7160 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:22:40 +00:00
rods%netscape.com
3d6e85a342 Added ref counting for nsIContent and made a a lot of fixes to selection
git-svn-id: svn://10.0.0.236/trunk@7159 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:22:27 +00:00
guha%netscape.com
d38f09efa7 Added SMART_MAIL ifdef
git-svn-id: svn://10.0.0.236/trunk@7158 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:21:58 +00:00
rods%netscape.com
0ca0bb5fbd Added ref counting on nsIContent and changed select all to only select the body
and it's content


git-svn-id: svn://10.0.0.236/trunk@7157 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:21:53 +00:00
rods%netscape.com
b63dfc3b9d Added ref counting on nsIContent
git-svn-id: svn://10.0.0.236/trunk@7156 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:20:41 +00:00
guha%netscape.com
04f2e83271 Fix Hyatt's bug + some more
git-svn-id: svn://10.0.0.236/trunk@7155 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:20:20 +00:00
rods%netscape.com
6d0e0f6b8c Added ref counting
git-svn-id: svn://10.0.0.236/trunk@7154 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:19:40 +00:00
dfm%netscape.com
2765798f81 Created MOZ_TRANSACTION_RECEIPTS ifdef for that frozen feature; removed obsolete
MOZ_PRIVACY. Approved: sar


git-svn-id: svn://10.0.0.236/trunk@7153 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:18:53 +00:00
robinf%netscape.com
17be3d57d0 rewording this help screen title
git-svn-id: svn://10.0.0.236/trunk@7152 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:18:28 +00:00
robinf%netscape.com
a5fd82f6f0 rewordking the title of thies screen to say "Start Accnt Setup"
git-svn-id: svn://10.0.0.236/trunk@7151 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:17:46 +00:00
pierre%netscape.com
d21ba2bc87 updated build log file path for Tinderbox (again)
git-svn-id: svn://10.0.0.236/trunk@7150 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 22:06:56 +00:00
warren%netscape.com
abd529162e Fixed NPP_GetValue signature for new npapi.h header.
git-svn-id: svn://10.0.0.236/trunk@7149 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:56:21 +00:00
warren%netscape.com
6f3eccdd4c Removed ifdef NSPR20 for unix text plugin.
git-svn-id: svn://10.0.0.236/trunk@7148 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:53:49 +00:00
blythe%netscape.com
638e21f9cb VC6 compatibility, aprv kipp
git-svn-id: svn://10.0.0.236/trunk@7147 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:38:59 +00:00
rickg%netscape.com
0609a6954b fixed problem in testCRT. GetUnicode returns a const ptr
git-svn-id: svn://10.0.0.236/trunk@7146 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:33:32 +00:00
danm%netscape.com
5748a66d65 adding (optional) glowcode build stuff
git-svn-id: svn://10.0.0.236/trunk@7145 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:29:18 +00:00
clu%netscape.com
4d923a4e26 Re-checking in previous changes. Also changed all CCaption objects to LGACaption objects.
git-svn-id: svn://10.0.0.236/trunk@7144 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:14:48 +00:00
troy%netscape.com
5b71155170 Added release of throbber in the hopes that this would allow the image
group and hence the image manager to be released, but it doesn't quite do
the trick because the ref count of the throbber is 2...


git-svn-id: svn://10.0.0.236/trunk@7143 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:11:22 +00:00
ftang%netscape.com
c84a30b007 add cp936,949,950,932 conversion table based on
ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS


git-svn-id: svn://10.0.0.236/trunk@7142 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:09:36 +00:00
troy%netscape.com
e07f1e5e78 Fixed reference counting of singleton image manager
git-svn-id: svn://10.0.0.236/trunk@7141 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:05:36 +00:00
rickg%netscape.com
84cc2596cf major perf changes; a few WIP's
git-svn-id: svn://10.0.0.236/trunk@7140 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:04:54 +00:00
timm%netscape.com
0df059b336 123505 fix for NCI files not showing up in pick list
git-svn-id: svn://10.0.0.236/trunk@7139 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:04:38 +00:00
rickg%netscape.com
e325840a5d added a few assertions, just to be safe
git-svn-id: svn://10.0.0.236/trunk@7138 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 21:03:49 +00:00
akkana%netscape.com
2703eb7627 Bring Table menu and table properties dialog up to intended 5.0 functionality.
git-svn-id: svn://10.0.0.236/trunk@7137 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 20:51:45 +00:00
akkana%netscape.com
0d4603f2d4 Add new option menu convenience routine: fe_get_current_attribute_option
git-svn-id: svn://10.0.0.236/trunk@7136 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 20:49:30 +00:00
akkana%netscape.com
94099529c0 fix a warning
git-svn-id: svn://10.0.0.236/trunk@7135 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 20:48:21 +00:00
rickg%netscape.com
b8cd75c6bf major upgrade to string class implementation
git-svn-id: svn://10.0.0.236/trunk@7134 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 20:46:38 +00:00
law%netscape.com
bc049a77b2 Windows(98) integration feature
git-svn-id: svn://10.0.0.236/trunk@7133 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 20:33:38 +00:00
buster%netscape.com
ef08d853f8 fixed this case: (an image tag with no width attribute) inside (a specified-width column) inside
(a nested table with specified width) inside (an auto-width column)
inside (a specified-width table).  Got that?
The problem was that we we not setting state correctly during incremental reflow
when the image returned its proper metrics after giving default metrics that
were for its ALT text.


git-svn-id: svn://10.0.0.236/trunk@7132 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 20:27:59 +00:00
law%netscape.com
20f0381b2d Fixing res problem on Windows95-98
git-svn-id: svn://10.0.0.236/trunk@7131 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 20:24:45 +00:00
scc%netscape.com
bba26953c4 Oops. since build_project is no longer AppleScript, "false" should be 0. That's why we were building too often.
git-svn-id: svn://10.0.0.236/trunk@7130 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 20:20:53 +00:00
leif
260b4cb667 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7129 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 19:25:03 +00:00
leif
e6867c039a Now handles no extra arguments, and also weird arguments like \@foo.
git-svn-id: svn://10.0.0.236/trunk@7128 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 19:23:01 +00:00
kipp%netscape.com
d72db37d83 Fixed reference counting bugs with OPTION tag handling
git-svn-id: svn://10.0.0.236/trunk@7127 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 19:21:26 +00:00
karnaze%netscape.com
6e825c79fc fixed bug where <select> assummed all children were <option>s
git-svn-id: svn://10.0.0.236/trunk@7126 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 19:04:55 +00:00
pierre%netscape.com
b24dcd399e updated build log file path for Tinderbox
git-svn-id: svn://10.0.0.236/trunk@7125 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 18:44:01 +00:00
kostello%netscape.com
e2862d846d First Checked In.
git-svn-id: svn://10.0.0.236/trunk@7124 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 18:37:30 +00:00
kipp%netscape.com
285d26c57c Undid previous change because it didn't work right (doh)
git-svn-id: svn://10.0.0.236/trunk@7123 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 18:12:42 +00:00
kipp%netscape.com
85bb024632 Disable VerifyTree for now
git-svn-id: svn://10.0.0.236/trunk@7122 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 18:12:13 +00:00
kipp%netscape.com
7240e492ab Normalized style tag handling
git-svn-id: svn://10.0.0.236/trunk@7121 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 18:10:43 +00:00
buster%netscape.com
ca7239e43e HR's min width is its specified width, if there is one.
Otherwise, it's one pixel for "springy-ness"


git-svn-id: svn://10.0.0.236/trunk@7120 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 17:17:50 +00:00
kipp%netscape.com
0e73ea661f Stub out VerifyTree to avoid crashes; remove List methods and add in ListTag methods so that listings look better
git-svn-id: svn://10.0.0.236/trunk@7119 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 17:09:37 +00:00
kipp%netscape.com
b55b6911f1 Pre-size the text-run array to reduce the number of malloc/free's
git-svn-id: svn://10.0.0.236/trunk@7118 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 17:08:57 +00:00
kipp%netscape.com
4346e26007 Added finer grained DidReflow code and then disabled it until we solve the nested view x,y problem
git-svn-id: svn://10.0.0.236/trunk@7117 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 17:07:44 +00:00
kipp%netscape.com
e3c9c8ed12 Use FirstChild method so that implementation can be reused by subclasses
git-svn-id: svn://10.0.0.236/trunk@7116 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 17:06:42 +00:00
hshaw%netscape.com
07133ba64f DEBUG_hshaw ifdef for splash window
git-svn-id: svn://10.0.0.236/trunk@7115 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 12:54:30 +00:00
ramiro%netscape.com
0bad008399 Rename mkicons.c to mkicons.cpp. Needs to be built with c++ because of libimg
dependancy.  Libimg has recently been "improved" by being made c++ only.


git-svn-id: svn://10.0.0.236/trunk@7114 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 08:32:31 +00:00
leif
24d0734ea9 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7113 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 08:12:21 +00:00
ramiro%netscape.com
8f48ba05ed Make it work with optimized builds.
git-svn-id: svn://10.0.0.236/trunk@7112 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 08:06:17 +00:00
leif
c67cf143ce *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7111 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 07:54:08 +00:00
leif
899881af79 First version, mainly ported to the new API. Also merged in some code from
LdapUtils.pm so that this file is more self sustained.


git-svn-id: svn://10.0.0.236/trunk@7110 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 07:53:31 +00:00
leif
d578a728de Fixed the modifyRDN function.
git-svn-id: svn://10.0.0.236/trunk@7109 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 07:50:54 +00:00
leif
60dcbee3be Removed the DESTROY method.
git-svn-id: svn://10.0.0.236/trunk@7108 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:58:21 +00:00
leif
52f1012d17 * Added getLD() function.
* Fixed the getErrorCode() function, and added support for (optionally)
retrieving the match and extra error strings.

* Fixed reference bug in the add() method.


git-svn-id: svn://10.0.0.236/trunk@7107 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:58:01 +00:00
leif
7e12448830 Fixed the ldap_get_lderrno() function so that it now supports:
ldap_get_lderrno($ld, undef, undef);
ldap_get_lderrno($ld, \$match, undef);
ldap_get_lderrno($ld, undef, \$msg);
ldap_get_lderrno($ld, \$match, \$msg);


I think this should work ok, but a code review is probably a good idea.


git-svn-id: svn://10.0.0.236/trunk@7106 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:53:23 +00:00
ramiro%netscape.com
7324202ecb Deal with common pixel/pixmap/sensitive resources in SetValues().
git-svn-id: svn://10.0.0.236/trunk@7105 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:52:06 +00:00
ramiro%netscape.com
9452a0966b Change XfeManagerApply() so it can conditionaly deal with private components.
git-svn-id: svn://10.0.0.236/trunk@7104 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:51:37 +00:00
ramiro%netscape.com
6d688e1f6c Fix a SetValues() bug. XfePrimitive was not responding to changes in
XmNbackground.  Geez, unbelievably, no bitched about it before.


git-svn-id: svn://10.0.0.236/trunk@7103 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:48:31 +00:00
ramiro%netscape.com
22813daadf Add _XfeManagerPropagateSetValues().
git-svn-id: svn://10.0.0.236/trunk@7102 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:45:15 +00:00
ramiro%netscape.com
6c58d6a8ed Fix a typo.
git-svn-id: svn://10.0.0.236/trunk@7101 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:42:44 +00:00
ramiro%netscape.com
3a28cc4a40 Change top/bottom shadow change detection order. yes, im anal.
git-svn-id: svn://10.0.0.236/trunk@7100 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:42:31 +00:00
nisheeth%netscape.com
7ad3e20406 Fix for bug# 301664.
We needed to initialize the LO_CELL element's pointers
to table state inside lo_SquishSubDocToCell().  The LO_CELL element in this function
is used to hold the contents of a <CAPTION> tag and does not have a peer lo_TableCell
structure.  The uninitialized pointers to table state in this element get dereferenced
when the table is freed and cause the app to crash.  Initializing the pointers fixes
the crash.


git-svn-id: svn://10.0.0.236/trunk@7099 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:41:58 +00:00
ramiro%netscape.com
67b18412ef Get editres working again.
git-svn-id: svn://10.0.0.236/trunk@7098 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 06:38:48 +00:00
troy%netscape.com
8128f46778 Added #include of "ns_util.h"
git-svn-id: svn://10.0.0.236/trunk@7097 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 05:34:28 +00:00
troy%netscape.com
c9a599ad14 More work in progress for palette support
git-svn-id: svn://10.0.0.236/trunk@7096 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 05:32:52 +00:00
troy%netscape.com
40d67100a8 Work in progress for Windows palette support
git-svn-id: svn://10.0.0.236/trunk@7095 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 05:24:59 +00:00
troy%netscape.com
7332039d2d API changes to how an image group context is created
git-svn-id: svn://10.0.0.236/trunk@7094 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 05:10:14 +00:00
troy%netscape.com
33c952da3a API changes to image group
git-svn-id: svn://10.0.0.236/trunk@7093 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 04:55:21 +00:00
troy%netscape.com
83ab7dd4d9 Image group now holds a reference to a nsIDeviceContext and not a
nsIRenderingContext. Optimize() member function of nsIImage changed
to take a nsIDeviceContext


git-svn-id: svn://10.0.0.236/trunk@7092 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 04:53:25 +00:00
troy%netscape.com
6334db57d5 Device context changes
git-svn-id: svn://10.0.0.236/trunk@7091 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 04:51:17 +00:00
leif
6b401b57b8 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@7090 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 04:26:32 +00:00
clayton
62ace165eb Whoops...These files were last checked in after editing in VIM under NT.
Usually VIM detects UNIX format files (LF), but this time it seems to have
used CR/LF.  I've fixed this problem and checked in working versions.


git-svn-id: svn://10.0.0.236/trunk@7089 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 02:35:26 +00:00
guha%netscape.com
70a36f7935 Fix build bustage.
git-svn-id: svn://10.0.0.236/trunk@7088 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 01:39:03 +00:00
clayton
66d925b4d9 Updated version number to 1.00 to prepare for release version. Still need
to add 'all' to the EXPORT_TAGS and test.


git-svn-id: svn://10.0.0.236/trunk@7087 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 00:29:25 +00:00
clayton
de4c7422a6 Makefile.PL - Changed it quite a bit. Asks less stupid questions...now works
with LDAPv2 and LDAPv3 SDKs.

README - Write a skeleton version.  Needs lots of work.


git-svn-id: svn://10.0.0.236/trunk@7086 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 00:27:51 +00:00
clayton
a2a6dea886 API.xs - Added missing functions (bind/bind_s)
api.pl - Made a few misc changes...minor... (removed system calls/fixed rebind)

constant.h - Completely changed this file to streamline response.
    Might still want to move SUCCESS, SCOPE, and a few others out of the
    new switch/case thing.


git-svn-id: svn://10.0.0.236/trunk@7085 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 00:26:38 +00:00
toshok%netscape.com
378c43d6cc Support JavaScript version 1.4. Patch by Mike Shaver <shaver@netscape.com>
git-svn-id: svn://10.0.0.236/trunk@7084 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-03 00:11:24 +00:00
troy%netscape.com
1c6314ed8a Fixed some ref counting problems with the nsIImage
git-svn-id: svn://10.0.0.236/trunk@7083 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-02 17:04:53 +00:00
troy%netscape.com
dcdf341134 Added NS_IF_RELEASE of mImage
git-svn-id: svn://10.0.0.236/trunk@7082 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-02 17:03:08 +00:00
joki%netscape.com
2a080256d0 Fix bug 311157, mouseover crashes release builds.
git-svn-id: svn://10.0.0.236/trunk@7081 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-02 04:15:08 +00:00
michaelp%netscape.com
df05d6f25f additional plugins work.
git-svn-id: svn://10.0.0.236/trunk@7080 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-02 03:20:22 +00:00
shaver%netscape.com
4d73b7f9f2 forgot to add NPL (bad Mike\!)
git-svn-id: svn://10.0.0.236/trunk@7079 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 23:56:38 +00:00
guha%netscape.com
7413297e63 Additions for pop mail based on shack.
ifdefed out.


git-svn-id: svn://10.0.0.236/trunk@7078 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 23:18:26 +00:00
guha%netscape.com
c8c9d707e9 Additions for Pop mail. Approved by Judson.
(ifdefed out)


git-svn-id: svn://10.0.0.236/trunk@7077 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 23:17:45 +00:00
michaelp%netscape.com
2a2636582a another hack to get Unix to be happy.
git-svn-id: svn://10.0.0.236/trunk@7076 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 23:02:14 +00:00
michaelp%netscape.com
8573e8fcd1 added CheckFontExistence().
git-svn-id: svn://10.0.0.236/trunk@7075 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 22:29:55 +00:00
michaelp%netscape.com
8e72cf5556 more unix hackery...
git-svn-id: svn://10.0.0.236/trunk@7074 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 22:23:35 +00:00
michaelp%netscape.com
3a0d81fb4e tiny change to see if the unix build will come back to life.
git-svn-id: svn://10.0.0.236/trunk@7073 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 22:19:05 +00:00
michaelp%netscape.com
33c7c278ac changed to see if unix build might work again.
git-svn-id: svn://10.0.0.236/trunk@7072 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 22:17:29 +00:00
michaelp%netscape.com
27433a2ce4 fixed IRIX build problem.
git-svn-id: svn://10.0.0.236/trunk@7071 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 21:56:24 +00:00
320 changed files with 126843 additions and 171 deletions

1
CVSROOT/FilesToNotExport Normal file
View File

@@ -0,0 +1 @@
CVSROOT/history

36279
mozilla/CHANGES.html Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

75
mozilla/cmd/xfe/hot.c Normal file
View File

@@ -0,0 +1,75 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* */
/* hot.c --- bookmarks dialogs
Created: Terry Weissman <terry@netscape.com>, 20-Jul-95.
*/
#include "mozilla.h"
#include "xfe.h"
#include "bkmks.h"
extern MWContext *fe_getBookmarkContext();
Boolean
fe_SaveBookmarks (void)
{
if (fe_getBookmarkContext())
if (BM_SaveBookmarks(fe_getBookmarkContext(), NULL) < 0)
return False;
return True;
}
void
fe_AddToBookmark (MWContext *context, const char *title, URL_Struct *url,
time_t time)
{
BM_Entry *bm;
const char *new_title;
MWContext *bmcontext = NULL;
if (!title || !*title) new_title = url->address;
else new_title = title;
bm = (BM_Entry*) BM_NewUrl(new_title, url->address, NULL, time);
bmcontext = fe_getBookmarkContext();
BM_AppendToHeader (bmcontext, BM_GetAddHeader(bmcontext), bm);
}
void
fe_AddBookmarkCallback (Widget widget, XtPointer closure, XtPointer call_data)
{
MWContext *context = (MWContext *) closure;
History_entry *h = SHIST_GetCurrent (&context->hist);
BM_Entry *bm;
MWContext *bmcontext = NULL;
char *new_title;
if (!h) return;
if (!h->title || !*h->title) new_title = h->address;
else new_title = h->title;
bm = (BM_Entry*)BM_NewUrl( new_title, h->address, NULL, h->last_access);
fe_UserActivity (context);
bmcontext = fe_getBookmarkContext();
BM_AppendToHeader (bmcontext, BM_GetAddHeader(bmcontext), bm);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,243 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
BookmarkFindDialog.cpp -- dialog for finding bookmarks (duh).
Created: Chris Toshok <toshok@netscape.com>, 12-Mar-97.
*/
#include "structs.h"
#include "xp_core.h"
#include "BookmarkFrame.h"
#include "BookmarkFindDialog.h"
#include <Xm/XmP.h>
#include <Xm/LabelG.h>
#include <Xm/ToggleBG.h>
#include <Xfe/Xfe.h>
#include "xfe.h"
#include "felocale.h"
/* we only have one instance of the bookmark find dialog up at at any given time. */
static XFE_BookmarkFindDialog *theDialog = NULL;
XFE_BookmarkFindDialog::XFE_BookmarkFindDialog(Widget parent,
BM_FindInfo *info)
: XFE_Dialog(parent,
"findDialog",
TRUE, // ok
TRUE, // cancel
FALSE, // help
TRUE, //apply
TRUE, //separator
FALSE // modal
)
{
Widget form;
Arg av[10];
int ac;
Widget findlabel, lookinlabel, helplabel;
m_findInfo = info;
form = XmCreateForm(m_chrome, "bmFindForm", NULL, 0);
XtManageChild(form);
XtAddCallback(m_chrome, XmNokCallback, find_cb, this);
XtAddCallback(m_chrome, XmNcancelCallback, cancel_cb, this);
XtAddCallback(m_chrome, XmNapplyCallback, clear_cb, this);
findlabel = XtCreateManagedWidget("findLabel",
xmLabelGadgetClass,
form,
NULL, 0);
m_findText = fe_CreateTextField(form, "findText", NULL, 0);
XtManageChild(m_findText);
lookinlabel = XtCreateManagedWidget("lookinLabel",
xmLabelGadgetClass,
form,
NULL, 0);
if (XfeWidth(findlabel) < XfeWidth(lookinlabel))
XtVaSetValues (findlabel, XmNwidth, XfeWidth(lookinlabel), 0);
else
XtVaSetValues (lookinlabel, XmNwidth, XfeWidth(findlabel), 0);
ac = 0;
XtSetArg(av[ac], XmNindicatorType, XmN_OF_MANY); ac++;
m_nameToggle = XtCreateManagedWidget("nameToggle",
xmToggleButtonGadgetClass, form, av, ac);
m_locationToggle = XtCreateManagedWidget("locationToggle",
xmToggleButtonGadgetClass, form, av, ac);
m_descriptionToggle = XtCreateManagedWidget("descriptionToggle",
xmToggleButtonGadgetClass, form, av, ac);
m_caseToggle = XtCreateManagedWidget("caseSensitive",
xmToggleButtonGadgetClass, form, av, ac);
m_wordToggle = XtCreateManagedWidget("wordToggle",
xmToggleButtonGadgetClass, form, av, ac);
ac = 0;
XtSetArg(av[ac], XmNentryAlignment, XmALIGNMENT_CENTER); ac++;
helplabel = XtCreateManagedWidget("helptext",
xmLabelGadgetClass, form, av, ac);
/* Attachments */
XtVaSetValues(findlabel, XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM, 0);
XtVaSetValues(m_findText, XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, findlabel,
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, findlabel,
XmNrightAttachment, XmATTACH_FORM, 0);
XtVaSetValues(lookinlabel, XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, m_findText, 0);
XtVaSetValues(m_nameToggle, XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, lookinlabel,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, m_findText, 0);
XtVaSetValues(m_locationToggle, XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, m_nameToggle,
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, m_nameToggle, 0);
XtVaSetValues(m_descriptionToggle, XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, m_locationToggle,
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, m_nameToggle, 0);
XtVaSetValues(m_caseToggle, XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, lookinlabel,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, m_nameToggle, 0);
XtVaSetValues(m_wordToggle, XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, lookinlabel,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, m_caseToggle, 0);
XtVaSetValues(helplabel, XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, m_wordToggle, 0);
XtVaSetValues (m_chrome, XmNinitialFocus, m_findText, 0);
setValues();
}
XFE_BookmarkFindDialog::~XFE_BookmarkFindDialog()
{
theDialog = NULL;
}
void
XFE_BookmarkFindDialog::getValues()
{
/* Should we free findInfo->textToFind */
XP_FREE(m_findInfo->textToFind);
m_findInfo->textToFind = fe_GetTextField(m_findText);
XtVaGetValues(m_nameToggle, XmNset, &m_findInfo->checkName, 0);
XtVaGetValues(m_locationToggle, XmNset, &m_findInfo->checkLocation, 0);
XtVaGetValues(m_descriptionToggle, XmNset, &m_findInfo->checkDescription, 0);
XtVaGetValues(m_caseToggle, XmNset, &m_findInfo->matchCase, 0);
XtVaGetValues(m_wordToggle, XmNset, &m_findInfo->matchWholeWord, 0);
}
void
XFE_BookmarkFindDialog::setValues()
{
fe_SetTextField(m_findText, m_findInfo->textToFind);
XtVaSetValues(m_nameToggle, XmNset, m_findInfo->checkName, 0);
XtVaSetValues(m_locationToggle, XmNset, m_findInfo->checkLocation, 0);
XtVaSetValues(m_descriptionToggle, XmNset, m_findInfo->checkDescription, 0);
XtVaSetValues(m_caseToggle, XmNset, m_findInfo->matchCase, 0);
XtVaSetValues(m_wordToggle, XmNset, m_findInfo->matchWholeWord, 0);
}
void
XFE_BookmarkFindDialog::find()
{
getValues();
hide();
BM_DoFindBookmark(XFE_BookmarkFrame::main_bm_context, m_findInfo);
}
void
XFE_BookmarkFindDialog::clear()
{
if (m_findInfo->textToFind)
m_findInfo->textToFind[0] = '\0';
fe_SetTextField(m_findText, m_findInfo->textToFind);
XmProcessTraversal (m_findText, XmTRAVERSE_CURRENT);
}
void
XFE_BookmarkFindDialog::cancel()
{
hide();
}
void
XFE_BookmarkFindDialog::find_cb(Widget, XtPointer clientData, XtPointer)
{
XFE_BookmarkFindDialog *obj = (XFE_BookmarkFindDialog*)clientData;
obj->find();
}
void
XFE_BookmarkFindDialog::clear_cb(Widget, XtPointer clientData, XtPointer)
{
XFE_BookmarkFindDialog *obj = (XFE_BookmarkFindDialog*)clientData;
obj->clear();
}
void
XFE_BookmarkFindDialog::cancel_cb(Widget, XtPointer clientData, XtPointer)
{
XFE_BookmarkFindDialog *obj = (XFE_BookmarkFindDialog*)clientData;
obj->cancel();
}
extern "C" void
fe_showBMFindDialog(Widget parent, BM_FindInfo *info)
{
if (!theDialog)
{
theDialog = new XFE_BookmarkFindDialog(parent, info);
}
theDialog->show();
}

View File

@@ -0,0 +1,60 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
BookmarkFindDialog.h -- dialog for finding bookmarks (duh).
Created: Chris Toshok <toshok@netscape.com>, 12-Mar-97.
*/
#ifndef _xfe_bookmarkfinddialog_h
#define _xfe_bookmarkfinddialog_h
#include "Dialog.h"
#include "bkmks.h"
class XFE_BookmarkFindDialog : public XFE_Dialog
{
public:
XFE_BookmarkFindDialog(Widget parent,
BM_FindInfo *info);
virtual ~XFE_BookmarkFindDialog();
private:
Widget m_findText;
Widget m_nameToggle, m_locationToggle, m_descriptionToggle;
Widget m_caseToggle, m_wordToggle;
BM_FindInfo *m_findInfo;
void find();
void clear();
void cancel();
void getValues(); // fills in m_findInfo
void setValues(); // alters UI to match m_findInfo
static void find_cb(Widget, XtPointer, XtPointer);
static void clear_cb(Widget, XtPointer, XtPointer);
static void cancel_cb(Widget, XtPointer, XtPointer);
};
extern "C" void fe_showBMFindDialog(Widget parent, BM_FindInfo *info);
#endif /* xfe_bookmarkfinddialog_h */

View File

@@ -0,0 +1,417 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
BookmarkPropDialog.cpp -- Dialog to edit bookmark properties.
Created: Stephen Lamm <slamm@netscape.com>, 10-Mar-97.
*/
#include "BookmarkPropDialog.h"
#include "BookmarkView.h"
#include "bkmks.h"
#include "felocale.h" // for fe_GetTextField()
#include "xfe.h"
#include "xfe2_extern.h"
#include "xpgetstr.h"
#include <Xm/Form.h>
#include <Xm/LabelG.h>
#include <Xm/PushBG.h>
#include <Xm/SelectioB.h>
#include <Xm/TextF.h>
extern int XFE_BM_ALIAS; // "This is an alias to the following Bookmark:"
XFE_BookmarkPropDialog::XFE_BookmarkPropDialog(MWContext *context, Widget parent)
: XFE_Dialog(parent, "bookmarkProps",
TRUE, // ok
TRUE, // cancel
FALSE, // help
FALSE, // apply
TRUE, // Separator
FALSE // Modal
)
{
int ac;
Arg av[20];
Widget kids[20];
int i;
m_context = context;
m_entry = NULL;
Widget form = 0;
Widget name_label = 0;
Widget description_label = 0;
Widget addedOn_label = 0;
fe_UnmanageChild_safe (XmSelectionBoxGetChild (m_chrome,
XmDIALOG_SELECTION_LABEL));
fe_UnmanageChild_safe (XmSelectionBoxGetChild (m_chrome,
XmDIALOG_TEXT));
fe_UnmanageChild_safe (XmSelectionBoxGetChild (m_chrome,
XmDIALOG_APPLY_BUTTON));
fe_UnmanageChild_safe (XmSelectionBoxGetChild (m_chrome,
XmDIALOG_HELP_BUTTON));
XtAddCallback(m_chrome, XmNdestroyCallback, destroy_cb, this);
XtAddCallback(m_chrome, XmNokCallback, ok_cb, this);
XtAddCallback(m_chrome, XmNcancelCallback, close_cb, this);
ac = 0;
form = XmCreateForm (m_chrome, "form", av, ac);
m_title = XmCreateLabelGadget(form, "title", av, ac);
m_aliasLabel = XmCreateLabelGadget(form, "aliasLabel", av, ac);
m_aliasButton = XmCreatePushButtonGadget (form, "aliasButton", av, ac);
name_label = XmCreateLabelGadget(form, "nameLabel", av, ac);
m_locationLabel = XmCreateLabelGadget(form, "locationLabel", av, ac);
description_label = XmCreateLabelGadget(form, "descriptionLabel", av, ac);
if (m_context->type == MWContextBookmarks) {
m_lastVisitedLabel = XmCreateLabelGadget(form, "lastvisitedLabel", av, ac);
addedOn_label = XmCreateLabelGadget(form, "addedonLabel", av, ac);
}
XtAddCallback(m_aliasButton, XmNactivateCallback, selectalias_cb, this);
ac = 0;
m_name = fe_CreateTextField(form, "nameText", av, ac);
m_location = fe_CreateTextField(form, "locationText", av, ac);
ac = 0;
XtSetArg (av[ac], XmNeditMode, XmMULTI_LINE_EDIT); ac++;
m_description = fe_CreateText(form, "descriptionText", av, ac);
ac = 0;
m_lastVisited = XmCreateLabelGadget(form, "lastVisited", av, ac);
m_addedOn = XmCreateLabelGadget(form, "addedOn", av, ac);
XtVaSetValues(m_title,
XmNtopAttachment, XmATTACH_FORM,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
0);
XtVaSetValues(name_label,
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, m_name,
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNbottomWidget, m_name,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_WIDGET,
XmNrightWidget, m_name,
0);
XtVaSetValues(m_locationLabel,
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, m_location,
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNbottomWidget, m_location,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_WIDGET,
XmNrightWidget, m_location,
0);
XtVaSetValues(description_label,
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, m_description,
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNbottomWidget, m_description,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_WIDGET,
XmNrightWidget, m_description,
0);
XtVaSetValues(m_lastVisitedLabel,
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, m_lastVisited,
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNbottomWidget, m_lastVisited,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_WIDGET,
XmNrightWidget, m_lastVisited,
0);
XtVaSetValues(addedOn_label,
XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNtopWidget, m_addedOn,
XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNbottomWidget, m_addedOn,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_WIDGET,
XmNrightWidget, m_addedOn,
0);
ac = 0;
kids[ac++] = m_title;
kids[ac++] = m_name;
kids[ac++] = m_location;
kids[ac++] = m_description;
kids[ac++] = m_lastVisited;
kids[ac++] = m_addedOn;
XtVaSetValues(kids[1],
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, kids[0],
XmNleftAttachment, XmATTACH_NONE,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_NONE,
0);
for (i=2 ; i<ac ; i++) {
XtVaSetValues(kids[i],
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, kids[i-1],
XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
XmNleftWidget, kids[i-1],
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_NONE,
0);
}
XtVaSetValues(m_aliasLabel,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, kids[ac-1],
XmNleftAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_WIDGET,
XmNrightWidget, m_aliasButton,
0);
XtVaSetValues(m_aliasButton,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, kids[ac-1],
XmNleftAttachment, XmATTACH_NONE,
XmNbottomAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
0);
fe_attach_field_to_labels(m_name, name_label, m_locationLabel,
description_label, m_lastVisitedLabel,
addedOn_label, 0);
kids[ac++] = m_aliasLabel;
kids[ac++] = m_aliasButton;
kids[ac++] = name_label;
kids[ac++] = m_locationLabel;
kids[ac++] = description_label;
kids[ac++] = m_lastVisitedLabel;
kids[ac++] = addedOn_label;
XtManageChildren(kids, ac);
XtManageChild(form);
fe_HackDialogTranslations (m_chrome);
}
XFE_BookmarkPropDialog::~XFE_BookmarkPropDialog()
{
close();
}
void
XFE_BookmarkPropDialog::selectAlias()
{
if (m_entry)
BM_SelectAliases(m_context, m_entry);
}
void
XFE_BookmarkPropDialog::selectalias_cb(Widget widget,
XtPointer closure, XtPointer call_data)
{
XFE_BookmarkPropDialog* obj = (XFE_BookmarkPropDialog *)closure;
obj->selectAlias();
}
void
XFE_BookmarkPropDialog::destroy_cb(Widget widget,
XtPointer closure, XtPointer call_data)
{
XFE_BookmarkPropDialog* obj = (XFE_BookmarkPropDialog *)closure;
obj->close();
}
void
XFE_BookmarkPropDialog::close()
{
if (m_entry)
{
BM_CancelEdit(m_context, m_entry);
m_entry = NULL;
}
}
void
XFE_BookmarkPropDialog::close_cb(Widget widget,
XtPointer closure, XtPointer call_data)
{
XFE_BookmarkPropDialog* obj = (XFE_BookmarkPropDialog *)closure;
obj->close();
XtDestroyWidget(obj->getBaseWidget());
}
void
XFE_BookmarkPropDialog::ok()
{
if (m_entry)
{
commitChanges();
m_entry = NULL;
}
}
void
XFE_BookmarkPropDialog::ok_cb(Widget widget,
XtPointer closure, XtPointer call_data)
{
XFE_BookmarkPropDialog* obj = (XFE_BookmarkPropDialog *)closure;
obj->ok();
XtDestroyWidget(obj->getBaseWidget());
}
void
XFE_BookmarkPropDialog::editItem(BM_Entry *entry)
{
const char* str;
char* tmp;
/* Raise the edit shell to view */
if (XtIsManaged (CONTEXT_WIDGET (m_context))) {
XRaiseWindow(XtDisplay(CONTEXT_WIDGET (m_context)),
XtWindow(CONTEXT_WIDGET (m_context)));
}
commitChanges();
/* Alias stuff */
if (BM_IsAlias(entry)) {
fe_SetString(m_title, XmNlabelString, XP_GetString(XFE_BM_ALIAS));
entry = BM_GetAliasOriginal(entry);
}
else
fe_SetString(m_title, XmNlabelString, " ");
m_entry = entry;
if (BM_IsUrl(entry)) {
str = BM_GetName(entry);
fe_SetTextField(m_name, str?str:"");
str = BM_GetAddress(entry);
fe_SetTextField(m_location, str?str:"");
XtVaSetValues(m_location, XmNsensitive, True, 0);
XtVaSetValues(m_locationLabel, XmNsensitive, True, 0);
str = BM_GetDescription(entry);
fe_SetTextField(m_description, str?str:"");
tmp = BM_PrettyLastVisitedDate(entry);
if (!tmp || !*tmp) tmp = " ";
fe_SetString(m_lastVisited, XmNlabelString, tmp);
XtVaSetValues(m_lastVisited, XmNsensitive, True, 0);
XtVaSetValues(m_lastVisitedLabel, XmNsensitive, True, 0);
fe_SetString(m_addedOn, XmNlabelString, BM_PrettyAddedOnDate(entry));
fe_SetString(m_aliasLabel, XmNlabelString,
BM_PrettyAliasCount(m_context, entry));
if (BM_CountAliases(m_context, entry) > 0)
XtVaSetValues(m_aliasButton, XmNsensitive, True, 0);
else
XtVaSetValues(m_aliasButton, XmNsensitive, False, 0);
}
else if (BM_IsHeader(entry)) {
str = BM_GetName(entry);
fe_SetTextField(m_name, str?str:"");
fe_SetTextField(m_location, "");
XtVaSetValues(m_location, XmNsensitive, False, 0);
XtVaSetValues(m_locationLabel, XmNsensitive, False, 0);
str = BM_GetDescription(entry);
fe_SetTextField(m_description, str?str:"");
fe_SetString(m_lastVisited, XmNlabelString, " ");
XtVaSetValues(m_lastVisited, XmNsensitive, False, 0);
XtVaSetValues(m_lastVisitedLabel, XmNsensitive, False, 0);
fe_SetString(m_addedOn, XmNlabelString, BM_PrettyAddedOnDate(entry));
fe_SetString(m_aliasLabel, XmNlabelString, "" );
XtVaSetValues(m_aliasButton, XmNsensitive, False, 0);
}
}
void
XFE_BookmarkPropDialog::entryGoingAway(BM_Entry *entry)
{
if (m_entry == entry) {
m_entry = NULL;
if (m_chrome) {
fe_SetTextField(m_name, "");
fe_SetTextField(m_location, "");
fe_SetTextField(m_description, "");
if (m_lastVisited) fe_SetString(m_lastVisited, XmNlabelString, " ");
if (m_addedOn) fe_SetString(m_addedOn, XmNlabelString, " ");
}
}
}
char *
XFE_BookmarkPropDialog::getAndCleanText(Widget widget,
Boolean new_lines_too_p)
{
char *str;
str = fe_GetTextField(widget);
if (!str) {
return NULL;
}
fe_forms_clean_text(m_context, INTL_DefaultWinCharSetID(NULL), str,
new_lines_too_p);
return str;
}
XP_Bool
XFE_BookmarkPropDialog::commitChanges()
{
XFE_BookmarkView *view = (XFE_BookmarkView*)BM_GetFEData(m_context);
char* ptr = 0;
if (!m_entry) return(True);
ptr = getAndCleanText(m_name, True);
if (!ptr) {
return(False);
}
// Have the view set the name so it can keep track
// of the personal toolbar.
if (view)
view->setName(m_entry, ptr);
XP_FREE(ptr);
ptr = getAndCleanText(m_location, True);
if (!ptr) {
return(False);
}
BM_SetAddress(m_context, m_entry, ptr);
XP_FREE(ptr);
ptr = getAndCleanText(m_description, False);
if (!ptr) {
return(False);
}
BM_SetDescription(m_context, m_entry, ptr);
XP_FREE(ptr);
return(True);
}

View File

@@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
BookmarkPropDialog.h -- class definitions for edit properties dialog
Created: Stephen Lamm <slamm@netscape.com>, 10-Mar-97.
*/
#ifndef _xfe_bookmark_prop_dialog_h
#define _xfe_bookmark_prop_dialog_h
#include "Component.h"
#include "Dialog.h"
#include "mozilla.h" /* for MWContext ! */
class XFE_BookmarkPropDialog : public XFE_Dialog
{
public:
// Constructors, Destructors
XFE_BookmarkPropDialog(MWContext *context, Widget parent);
virtual ~XFE_BookmarkPropDialog();
void editItem(BM_Entry *entry);
void entryGoingAway(BM_Entry *entry);
void selectAlias();
void close();
void ok();
XP_Bool commitChanges();
//virtual void show();
//virtual void hide();
static void selectalias_cb(Widget widget,
XtPointer closure, XtPointer call_data);
static void destroy_cb(Widget widget,
XtPointer closure, XtPointer call_data);
static void close_cb(Widget widget,
XtPointer closure, XtPointer call_data);
static void ok_cb(Widget widget,
XtPointer closure, XtPointer call_data);
protected:
char *getAndCleanText(Widget widget, Boolean new_lines_too_p);
/* Parent class members
Widget m_wParent; // parent widget
Widget m_chrome; // dialog chrome - selection box
Widget m_okButton;
Widget m_cancelButton;
Widget m_helpButton;
Widget m_applyButton;
*/
MWContext *m_context;
BM_Entry *m_entry;
Widget m_title;
Widget m_nickname;
Widget m_name;
Widget m_location;
Widget m_locationLabel;
Widget m_description;
Widget m_lastVisited;
Widget m_lastVisitedLabel;
Widget m_addedOn;
Widget m_aliasLabel;
Widget m_aliasButton;
};
#endif /* _xfe_dialog_h */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,228 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
BookmarkView.h -- class definition for XFE_BookmarkView
Created: Chris Toshok <toshok@netscape.com>, 7-Aug-96.
*/
#ifndef _xfe_bookmarkview_h
#define _xfe_bookmarkview_h
#include "View.h"
#include "Outliner.h"
#include "Outlinable.h"
#include "PopupMenu.h"
#include "BookmarkPropDialog.h"
#include "BookmarkWhatsNewDialog.h"
#include "bkmks.h"
typedef struct BookmarkClipboard {
void *block;
int32 length;
} BookmarkClipboard;
class XFE_BookmarkView : public XFE_View, public XFE_Outlinable
{
public:
XFE_BookmarkView(XFE_Component *toplevel, Widget parent, XFE_View *parent_view, MWContext *context);
virtual ~XFE_BookmarkView();
// Methods we override from XFE_View
virtual Boolean isCommandEnabled(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* i = NULL);
virtual void doCommand(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* i = NULL);
virtual Boolean handlesCommand(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* i = NULL);
virtual XP_Bool isCommandSelected(CommandType cmd, void *calldata,
XFE_CommandInfo* info);
virtual char *commandToString(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* i = NULL);
// Our equivalent to the BMFE_* calls
void refreshCells(int first = 1, int last = BM_LAST_CELL,
XP_Bool now = TRUE);
void gotoBookmark(const char *url);
void scrollIntoView(BM_Entry *entry);
void setClipContents(void *block, int32 length);
void *getClipContents(int32 *length);
void freeClipContents();
void startWhatsChanged();
void updateWhatsChanged(const char *url, int32 done, int32 total, const char *totaltime);
void finishedWhatsChanged(int32 totalchecked, int32 numreached, int32 numchanged);
void startBatch();
void endBatch();
void bookmarkMenuInvalid();
// Wrapper around BM_SetName() that handles personal toolbar folder
void setName(BM_Entry *entry, char *name);
Boolean loadBookmarks(char *filename);
Boolean copyBookmarksFile(char *dst, char *src);
// The Outlinable interface.
virtual void *ConvFromIndex(int index);
virtual int ConvToIndex(void *item);
virtual char *getColumnName(int column);
virtual char *getColumnHeaderText(int column);
virtual fe_icon *getColumnHeaderIcon(int column);
virtual EOutlinerTextStyle getColumnHeaderStyle(int column);
virtual void *acquireLineData(int line);
virtual void getTreeInfo(XP_Bool *expandable, XP_Bool *is_expanded,
int *depth, OutlinerAncestorInfo **ancestor);
virtual EOutlinerTextStyle getColumnStyle(int column);
virtual char *getColumnText(int column);
virtual fe_icon *getColumnIcon(int column);
virtual void releaseLineData();
virtual void Buttonfunc(const OutlineButtonFuncData *data);
virtual void Flippyfunc(const OutlineFlippyFuncData *data);
virtual XFE_Outliner *getOutliner();
// Get tooltipString & docString;
// returned string shall be freed by the callee
// row < 0 indicates heading row; otherwise it is a content row
// (starting from 0)
//
virtual char *getCellTipString(int /* row */, int /* column */) {return NULL;}
virtual char *getCellDocString(int /* row */, int /* column */) {return NULL;}
// columns for the Outliner
static const int OUTLINER_COLUMN_NAME;
static const int OUTLINER_COLUMN_LOCATION;
static const int OUTLINER_COLUMN_LASTVISITED;
static const int OUTLINER_COLUMN_CREATEDON;
static const char *bookmarksChangedCallback; // the user has added/editted/deleted a bookmark entry.
static const char *bookmarkDoubleClickedCallback; // the user has double clicked a bookmark entry.
static const char *bookmarkClickedCallback; // the user has single clicked a bookmark entry.
// Open properties dialog
void openBookmarksWindow();
void closeBookmarksWindow();
// Edit an item in the properties dialog if it's open
void editItem(BM_Entry *entry);
void entryGoingAway(BM_Entry *entry);
void makeEditItemDialog();
#if defined(USE_MOTIF_DND)
/* motif drag and drop interface. */
fe_icon_data *GetDragIconData(int row, int column);
static fe_icon_data *getDragIconData(void *this_ptr,
int row, int column);
void GetDragTargets(int row, int column, Atom **targets, int *num_targets);
static void getDragTargets(void *this_ptr,
int row, int col,
Atom **targets, int *num_targets);
char *DragConvert(Atom atom);
static char* dragConvert(void *this_ptr,
Atom atom);
int ProcessTargets(int row, int col,
Atom *targets,
const char **data,
int numItems);
static int processTargets(void *this_ptr,
int row, int col,
Atom *targets,
const char **data,
int numItems);
/* no instance method needed for getDropTargets */
static void getDropTargets(void *this_ptr,
Atom **targets, int *num_targets);
#endif /* USE_MOTIF_DND */
private:
BM_Entry *m_entry; // needed by the outlinable interface methods.
int m_entryDepth; // needed by the outlinable interface methods.
OutlinerAncestorInfo *m_ancestorInfo; // needed by the outlinable interface methods.
XFE_Outliner *m_outliner; // the outliner object used to display everything.
XFE_PopupMenu *m_popup;
XP_Bool m_sortDescending;
CommandType m_lastSort;
BookmarkClipboard clip; // our clipboard.
BM_Entry *m_editentry; // the entry currently being editted
XFE_BookmarkPropDialog *m_propertiesDialog;
XFE_BookmarkWhatsNewDialog *m_whatsNewDialog;
// Use these to avoid multiple FE updates
XP_Bool m_batchDepth;
XP_Bool m_menuIsInvalid;
static MenuSpec open_popup_spec[];
static MenuSpec new_popup_spec[];
static MenuSpec set_popup_spec[];
static MenuSpec saveas_popup_spec[];
static MenuSpec cutcopy_popup_spec[];
static MenuSpec copylink_popup_spec[];
static MenuSpec paste_popup_spec[];
static MenuSpec delete_popup_spec[];
static MenuSpec makealias_popup_spec[];
static MenuSpec properties_popup_spec[];
// Remove our reference to the dialog when it goes away
static void properties_destroy_cb(Widget widget,
XtPointer closure, XtPointer call_data);
static void whats_new_destroy_cb(Widget widget,
XtPointer closure, XtPointer call_data);
BM_CommandType commandToBMCmd(CommandType cmd);
#if !defined(USE_MOTIF_DND)
void dropfunc(Widget dropw, fe_dnd_Event type, fe_dnd_Source *source, XEvent *event);
static void drop_func(Widget dropw, void *closure, fe_dnd_Event type,
fe_dnd_Source *source, XEvent* event);
#endif
void doPopup(XEvent *event);
// icons for use in the bookmark window.
static fe_icon bookmark;
static fe_icon mailBookmark;
static fe_icon newsBookmark;
static fe_icon changedBookmark;
// static fe_icon unknownBookmark;
static fe_icon closedFolder;
static fe_icon openedFolder;
static fe_icon closedPersonalFolder;
static fe_icon openedPersonalFolder;
static fe_icon closedFolderDest;
static fe_icon openedFolderDest;
static fe_icon closedFolderMenu;
static fe_icon openedFolderMenu;
static fe_icon closedFolderMenuDest;
static fe_icon openedFolderMenuDest;
};
#endif /* _xfe_bookmarkview_h */

View File

@@ -0,0 +1,202 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
BookmarkWhatsNewDialog.cpp -- dialog for checking "What's New".
Created: Stephen Lamm <slamm@netscape.com>, 28-May-97.
*/
#include "BookmarkWhatsNewDialog.h"
#include "bkmks.h"
#include "xfe.h"
#include "xpgetstr.h"
extern int XFE_LOOK_FOR_DOCUMENTS_THAT_HAVE_CHANGED_ON;
extern int XFE_ESTIMATED_TIME_REMAINING_CHECKED;
extern int XFE_ESTIMATED_TIME_REMAINING_CHECKING;
extern int XFE_DONE_CHECKING_ETC;
XFE_BookmarkWhatsNewDialog::XFE_BookmarkWhatsNewDialog(MWContext *context, Widget parent)
: XFE_Dialog(parent, "bookmarksWhatsChanged",
TRUE, // ok
TRUE, // cancel
FALSE, // help
TRUE, // apply
TRUE, // Separator
FALSE // Modal
)
{
m_context = context;
fe_UnmanageChild_safe (m_okButton);
XtVaSetValues(m_chrome, XmNchildPlacement, XmPLACE_BELOW_SELECTION, NULL);
m_text = XmSelectionBoxGetChild (m_chrome, XmDIALOG_SELECTION_LABEL);
XtManageChild(m_text);
XtAddCallback(m_chrome, XmNdestroyCallback, destroy_cb, this);
XtAddCallback(m_chrome, XmNcancelCallback, close_cb, this);
XtAddCallback(m_chrome, XmNapplyCallback, apply_cb, this);
XtAddCallback(m_chrome, XmNokCallback, ok_cb, this);
m_radioBox =
XmVaCreateSimpleRadioBox(m_chrome, "radiobox", 0, NULL,
XmVaRADIOBUTTON, NULL, NULL, NULL, NULL,
XmVaRADIOBUTTON, NULL, NULL, NULL, NULL,
NULL);
int numKids;
Widget* kids;
XtVaGetValues(m_radioBox, XmNnumChildren, &numKids, XmNchildren, &kids, 0);
XP_ASSERT(numKids == 2);
m_doAll = kids[0];
m_doSelected = kids[1];
XtManageChildren(kids, numKids);
XtManageChild(m_radioBox);
XmString str = XmStringCreate( XP_GetString( XFE_LOOK_FOR_DOCUMENTS_THAT_HAVE_CHANGED_ON ),
XmFONTLIST_DEFAULT_TAG);
XtVaSetValues(m_text, XmNlabelString, str, NULL);
XmStringFree(str);
fe_HackDialogTranslations (m_chrome);
}
XFE_BookmarkWhatsNewDialog::~XFE_BookmarkWhatsNewDialog()
{
close();
}
void
XFE_BookmarkWhatsNewDialog::destroy_cb(Widget /*widget*/,
XtPointer closure, XtPointer /*call_data*/)
{
XFE_BookmarkWhatsNewDialog* obj = (XFE_BookmarkWhatsNewDialog *)closure;
obj->close();
}
void
XFE_BookmarkWhatsNewDialog::close()
{
BM_CancelWhatsChanged(m_context);
}
void
XFE_BookmarkWhatsNewDialog::close_cb(Widget /*widget*/,
XtPointer closure, XtPointer /*call_data*/)
{
XFE_BookmarkWhatsNewDialog* obj = (XFE_BookmarkWhatsNewDialog *)closure;
XtDestroyWidget(obj->getBaseWidget());
}
void
XFE_BookmarkWhatsNewDialog::apply()
{
Boolean doselected = FALSE;
XtVaGetValues(m_doSelected, XmNset, &doselected, NULL);
BM_StartWhatsChanged(m_context, doselected);
}
void
XFE_BookmarkWhatsNewDialog::apply_cb(Widget /*widget*/,
XtPointer closure, XtPointer /*call_data*/)
{
XFE_BookmarkWhatsNewDialog* obj = (XFE_BookmarkWhatsNewDialog *)closure;
obj->apply();
}
void
XFE_BookmarkWhatsNewDialog::ok()
{
; // nothing more to do
}
void
XFE_BookmarkWhatsNewDialog::ok_cb(Widget /*widget*/,
XtPointer closure, XtPointer /*call_data*/)
{
XFE_BookmarkWhatsNewDialog* obj = (XFE_BookmarkWhatsNewDialog *)closure;
obj->ok();
XtDestroyWidget(obj->getBaseWidget());
}
void
XFE_BookmarkWhatsNewDialog::updateWhatsChanged(const char* url,
int32 done, int32 total,
const char* totaltime)
{
char buf[1024];
XmString str;
if (!m_chrome) return;
if (m_radioBox) {
fe_UnmanageChild_safe(m_radioBox);
fe_UnmanageChild_safe(m_applyButton);
m_radioBox = NULL;
}
if ( url )
PR_snprintf(buf, sizeof(buf),
XP_GetString( XFE_ESTIMATED_TIME_REMAINING_CHECKED ),
url,
total - done,
total > 0 ? done * 100 / total : 0,
totaltime);
else
PR_snprintf(buf, sizeof(buf),
XP_GetString( XFE_ESTIMATED_TIME_REMAINING_CHECKING ),
total - done,
total > 0 ? done * 100 / total : 0,
totaltime);
str = XmStringCreateLtoR(buf, XmFONTLIST_DEFAULT_TAG);
XtVaSetValues(m_text, XmNlabelString, str, NULL);
XmStringFree(str);
}
void
XFE_BookmarkWhatsNewDialog::finishedWhatsChanged(int32 totalchecked,
int32 numreached,
int32 numchanged)
{
char buf[1024];
XmString str;
fe_UnmanageChild_safe(m_radioBox);
fe_UnmanageChild_safe(m_cancelButton);
XtManageChild(m_okButton);
PR_snprintf(buf, sizeof(buf), XP_GetString( XFE_DONE_CHECKING_ETC ),
totalchecked, numreached, numchanged);
str = XmStringCreateLtoR(buf, XmFONTLIST_DEFAULT_TAG);
XtVaSetValues(m_text, XmNlabelString, str, NULL);
XmStringFree(str);
}

View File

@@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
BookmarkWhatsNewDialog.h -- dialog for checking "What's New".
Created: Stephen Lamm <slamm@netscape.com>, 28-May-97.
*/
#ifndef _xfe_bookmarkwhatsnewdialog_h
#define _xfe_bookmarkwhatsnewdialog_h
#include "Dialog.h"
#include "bkmks.h"
class XFE_BookmarkWhatsNewDialog : public XFE_Dialog
{
public:
XFE_BookmarkWhatsNewDialog(MWContext *context, Widget parent);
virtual ~XFE_BookmarkWhatsNewDialog();
void updateWhatsChanged(const char *url, int32 done, int32 total, const char *totaltime);
void finishedWhatsChanged(int32 totalchecked, int32 numreached, int32 numchanged);
private:
void close();
void apply();
void ok();
static void destroy_cb(Widget widget,
XtPointer closure, XtPointer call_data);
static void close_cb(Widget, XtPointer, XtPointer);
static void apply_cb(Widget, XtPointer, XtPointer);
static void ok_cb(Widget, XtPointer, XtPointer);
MWContext *m_context;
Widget m_text;
Widget m_radioBox;
Widget m_doAll;
Widget m_doSelected;
};
#endif /* xfe_bookmarkwhatsnewdialog_h */

View File

@@ -0,0 +1,184 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
HistoryFrame.cpp -- History window stuff
Created: Stephen Lamm <slamm@netscape.com>, 24-Feb-96.
*/
#include "HistoryFrame.h"
#include "HistoryView.h"
#include "xpassert.h"
#include "xfe2_extern.h"
#include "abdefn.h" // for kMaxFullNameLength
#include "xpgetstr.h" // for XP_GetString()
#include "Dashboard.h"
extern int XFE_HISTORY_FRAME_TITLE;
static XFE_HistoryFrame *theFrame = NULL;
// Basically, anything with "" around it hasn't been wired-up/implemented.
MenuSpec XFE_HistoryFrame::file_menu_spec[] = {
{ "newSubmenu", CASCADEBUTTON,
(MenuSpec*)&XFE_Frame::new_menu_spec },
MENU_SEPARATOR,
{ xfeCmdSaveAs, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdOpenSelected, PUSHBUTTON },
{ xfeCmdAddBookmark, PUSHBUTTON },
{ xfeCmdAddToToolbar, PUSHBUTTON },
//{ xfeCmdCreateShortcut, PUSHBUTTON }, // Create desktop shortcut
//MENU_SEPARATOR,
//{ xfeCmdPrintSetup, PUSHBUTTON },
//{ xfeCmdPrint, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdClose, PUSHBUTTON },
{ xfeCmdExit, PUSHBUTTON },
{ NULL }
};
MenuSpec XFE_HistoryFrame::edit_menu_spec[] = {
{ xfeCmdUndo, PUSHBUTTON },
{ xfeCmdRedo, PUSHBUTTON },
MENU_SEPARATOR,
{ xfeCmdCut, PUSHBUTTON },
{ xfeCmdCopy, PUSHBUTTON },
{ xfeCmdDelete, PUSHBUTTON },
{ xfeCmdSelectAll, PUSHBUTTON },
MENU_SEPARATOR,
//{ xfeCmdSearch, PUSHBUTTON }, // We should have this, but it isn't ready
#ifdef MOZ_MAIL_NEWS
{ xfeCmdSearchAddress, PUSHBUTTON },
MENU_SEPARATOR,
#endif
{ xfeCmdEditPreferences, PUSHBUTTON },
{ NULL }
};
MenuSpec XFE_HistoryFrame::view_menu_spec[] = {
{ xfeCmdSortByTitle, TOGGLEBUTTON, NULL, "sortByRadioGroup",
False, (void*)eHSC_TITLE },
{ xfeCmdSortByLocation, TOGGLEBUTTON, NULL, "sortByRadioGroup",
False, (void*)eHSC_LOCATION },
{ xfeCmdSortByDateFirstVisited, TOGGLEBUTTON, NULL, "sortByRadioGroup",
False, (void*)eHSC_FIRSTVISIT },
{ xfeCmdSortByDateLastVisited, TOGGLEBUTTON, NULL, "sortByRadioGroup",
False, (void*)eHSC_LASTVISIT },
{ xfeCmdSortByExpirationDate, TOGGLEBUTTON, NULL, "sortByRadioGroup",
False, (void*)eHSC_EXPIRES },
{ xfeCmdSortByVisitCount, TOGGLEBUTTON, NULL, "sortByRadioGroup",
False, (void*)eHSC_VISITCOUNT },
MENU_SEPARATOR,
{ xfeCmdSortAscending, TOGGLEBUTTON, NULL, "ascendDescendRadioGroup",
False },
{ xfeCmdSortDescending, TOGGLEBUTTON, NULL, "ascendDescendRadioGroup",
False },
//MENU_SEPARATOR,
//{ xfeCmdMoreOptions, PUSHBUTTON },
//{ xfeCmdFewerOptions, PUSHBUTTON },
{ NULL }
};
MenuSpec XFE_HistoryFrame::menu_bar_spec[] = {
{ xfeMenuFile, CASCADEBUTTON, file_menu_spec },
{ xfeMenuEdit, CASCADEBUTTON, edit_menu_spec },
{ xfeMenuView, CASCADEBUTTON, view_menu_spec },
{ xfeMenuWindow, CASCADEBUTTON, XFE_Frame::window_menu_spec },
{ "bookmarksSubmenu", CASCADEBUTTON, XFE_Frame::bookmark_submenu_spec },
{ xfeMenuHelp, CASCADEBUTTON, XFE_Frame::help_menu_spec },
{ NULL }
};
//////////////////////////////////////////////////////////////////////////
XFE_HistoryFrame::XFE_HistoryFrame(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec)
: XFE_Frame("history", toplevel, parent_frame,
FRAME_HISTORY, chromespec, False, True, False, True, False)
{
// create the History view
XFE_HistoryView *view = new XFE_HistoryView(this,
getChromeParent(),
NULL,
m_context);
setView(view);
setMenubar(menu_bar_spec);
//
// Make the bookmark frame title more reasonable
//
char title[kMaxFullNameLength+64];
PR_snprintf(title,
sizeof(title),
XP_GetString(XFE_HISTORY_FRAME_TITLE),
FE_UsersFullName());
setTitle(title);
view->show();
m_dashboard->setShowStatusBar(True);
m_dashboard->setShowProgressBar(True);
resize(600,580); //XXX Default size for now
}
//////////////////////////////////////////////////////////////////////////
XFE_HistoryFrame::~XFE_HistoryFrame()
{
}
//////////////////////////////////////////////////////////////////////////
void
XFE_HistoryFrame::showHistory(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec)
{
fe_showHistory(toplevel, parent_frame, chromespec);
}
//////////////////////////////////////////////////////////////////////////
XP_Bool
XFE_HistoryFrame::isCommandEnabled(CommandType cmd,
void *calldata, XFE_CommandInfo*)
{
if (cmd == xfeCmdClose)
return True;
else
return XFE_Frame::isCommandEnabled(cmd, calldata);
}
extern "C" MWContext*
fe_showHistory(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec)
{
/* Check to see if we have access to the global history database. */
if (fe_globalData.all_databases_locked)
return NULL;
fe_createHistory(toplevel, parent_frame, chromespec);
theFrame->show();
return theFrame->getContext();
}
extern "C" void
fe_createHistory(Widget toplevel,
XFE_Frame *parent_frame,
Chrome *chromespec)
{
if (theFrame == NULL)
theFrame = new XFE_HistoryFrame(toplevel, parent_frame, chromespec);
}

View File

@@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
HistoryFrame.h -- class definitions for history frames
Created: Stephen Lamm <slamm@netscape.com>, 24-Feb-96.
*/
#ifndef _xfe_historyframe_h
#define _xfe_historyframe_h
#include "Frame.h"
#include "xp_core.h"
#include <Xm/Xm.h>
class XFE_HistoryFrame : public XFE_Frame
{
public:
XFE_HistoryFrame(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
virtual ~XFE_HistoryFrame();
static void showHistory(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec);
// To allow window close (we need a more graceful way of doing this)
virtual XP_Bool isCommandEnabled(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* = NULL);
private:
static MenuSpec menu_bar_spec[];
static MenuSpec file_menu_spec[];
static MenuSpec edit_menu_spec[];
static MenuSpec view_menu_spec[];
};
#endif /* _xfe_historyframe_h */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,189 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
HistoryView.h -- class definition for HistoryView
Created: Stephen Lamm <slamm@netscape.com>, 24-Feb-96.
*/
#ifndef _xfe_historyview_h
#define _xfe_historyview_h
#include "View.h"
#include "Outliner.h"
#include "Outlinable.h"
#include "glhist.h"
#include "xp.h"
enum enHistSortCol
{
eHSC_INVALID = -1,
eHSC_TITLE,
eHSC_LOCATION,
eHSC_FIRSTVISIT,
eHSC_LASTVISIT,
eHSC_EXPIRES,
eHSC_VISITCOUNT
};
typedef struct HistoryClipboard {
void *block;
int32 length;
} HistoryClipboard;
class XFE_HistoryView : public XFE_View, public XFE_Outlinable
{
public:
XFE_HistoryView(XFE_Component *toplevel, Widget parent, XFE_View *parent_view, MWContext *context);
~XFE_HistoryView();
// Methods we override from XFE_View
virtual Boolean isCommandEnabled(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* i = NULL);
virtual void doCommand(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* i = NULL);
virtual Boolean handlesCommand(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* i = NULL);
virtual char *commandToString(CommandType cmd, void *calldata = NULL,
XFE_CommandInfo* i = NULL);
virtual XP_Bool isCommandSelected(CommandType cmd,
void *calldata = NULL,
XFE_CommandInfo* info = NULL);
// Our equivalent to the backend calls
void refreshCells(int first, int last, XP_Bool now);
void scrollIntoView(gh_HistEntry *entry);
void setClipContents(void *block, int32 length);
void *getClipContents(int32 *length);
void freeClipContents();
// void openHistoryWindow();
// public access to history list
virtual gh_HistEntry *getEntry(int);
//Boolean loadHistory(char *filename);
// The Outlinable interface.
virtual void *ConvFromIndex(int index);
virtual int ConvToIndex(void *item);
virtual char *getColumnName(int column);
virtual char *getColumnHeaderText(int column);
virtual fe_icon *getColumnHeaderIcon(int column);
virtual EOutlinerTextStyle getColumnHeaderStyle(int column);
virtual void *acquireLineData(int line);
virtual void getTreeInfo(XP_Bool *expandable, XP_Bool *is_expanded,
int *depth, OutlinerAncestorInfo **ancestor);
virtual EOutlinerTextStyle getColumnStyle(int column);
virtual char *getColumnText(int column);
virtual fe_icon *getColumnIcon(int column);
virtual void releaseLineData();
virtual void Buttonfunc(const OutlineButtonFuncData *data);
virtual void Flippyfunc(const OutlineFlippyFuncData *data);
virtual XFE_Outliner *getOutliner();
// Get tooltipString & docString;
// returned string shall be freed by the callee
// row < 0 indicates heading row; otherwise it is a content row
// (starting from 0)
//
virtual char *getCellTipString(int /* row */, int /* column */) {return NULL;}
virtual char *getCellDocString(int /* row */, int /* column */) {return NULL;}
// columns for the Outliner
static const int OUTLINER_COLUMN_TITLE;
static const int OUTLINER_COLUMN_LOCATION;
static const int OUTLINER_COLUMN_FIRSTVISITED;
static const int OUTLINER_COLUMN_LASTVISITED;
static const int OUTLINER_COLUMN_EXPIRES;
static const int OUTLINER_COLUMN_VISITCOUNT;
#if defined(USE_MOTIF_DND)
/* motif drag and drop interface. */
fe_icon_data *GetDragIconData(int row, int column);
static fe_icon_data *getDragIconData(void *this_ptr,
int row, int column);
void GetDragTargets(int row, int column, Atom **targets, int *num_targets);
static void getDragTargets(void *this_ptr,
int row, int col,
Atom **targets, int *num_targets);
char *DragConvert(Atom atom);
static char* dragConvert(void *this_ptr,
Atom atom);
#endif /* USE_MOTIF_DND */
static const char *historysChangedCallback; // the user has added/editted/deleted a history entry.
static const char *historyDoubleClickedCallback; // the user has double clicked a history entry.
static const char *historyClickedCallback; // the user has single clicked a history entry.
private:
GHHANDLE m_histCursor;
int m_totalLines;
XP_Bool m_dirty;
enHistSortCol m_sortBy;
XP_Bool m_sortDescending;
gh_Filter* m_filter;
// needed by the outlinable interface methods.
OutlinerAncestorInfo *m_ancestorInfo;
gh_HistEntry *m_entry;
#if defined(USE_MOTIF_DND)
/* the entry that we're currently dragging. */
gh_HistEntry *m_dragentry;
#endif /* USE_MOTIF_DND */
XFE_Outliner *m_outliner;
XP_List *m_selectList;
// icons for use in the history window.
static fe_icon historyIcon;
void dropfunc(Widget dropw, fe_dnd_Event type,
fe_dnd_Source *source, XEvent *event);
static void drop_func(Widget dropw, void *closure, fe_dnd_Event type,
fe_dnd_Source *source, XEvent* event);
gh_HistEntry *getSelection();
void openSelected();
void reflectSelected();
void saveSelected();
void restoreSelected();
int notify(gh_NotifyMsg *msg);
static int notify_cb(gh_NotifyMsg *msg);
void resort(enHistSortCol sortBy, XP_Bool sortDescending);
void refresh();
static void refresh_cb(XtPointer closure, XtIntervalId *id);
};
#endif /* _xfe_historyview_h */

View File

@@ -0,0 +1,514 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
TreeView.cpp -- class definition for XFE_TreeView
Created: spence murray <spence@netscape.com>, 3-Nov-97.
*/
#include "TreeView.h"
#include "Outlinable.h"
#include "BookmarkView.h"
#include "AddrBookView.h"
#include "HistoryView.h"
#include "ViewGlue.h"
#include "Frame.h"
#include "mozilla.h"
#define TREE_OUTLINER_GEOMETRY_PREF "tree.outliner_geometry"
extern "C" MWContext *fe_WidgetToMWContext (Widget);
// Sanity check on the context. Throughout the progress stuff below,
// the context (and fe_data) needs to be checked for validity before
// dereferencing the members.
#define CHECK_CONTEXT_AND_DATA(c) \
((c) && CONTEXT_DATA(c) && !CONTEXT_DATA(context)->being_destroyed)
static XFE_Frame *
fe_frameFromMWContext(MWContext *context)
{
XFE_Frame * frame = NULL;
// Sanity check for possible invocation of this function from a frame
// that was just destroyed (or is being destroyed)
if (!CHECK_CONTEXT_AND_DATA(context))
{
return NULL;
}
// Try to use context's frame
frame = ViewGlue_getFrame(XP_GetNonGridContext(context));
// Try to use the active frame
// if (!frame)
// {
// frame = XFE_Frame::getActiveFrame();
// }
// Make sure the frame is alive
if (frame && !frame->isAlive())
{
frame = NULL;
}
return frame;
}
XFE_TreeView::XFE_TreeView (const char *name,
Widget parent,
int tree_type,
int width,
int height)
{
#ifdef DEBUG_spence
printf ("XFE_TreeView: %s\n", name);
#endif
// get the toplevel
MWContext *context = fe_WidgetToMWContext (parent);
XFE_Component *toplevel = fe_frameFromMWContext (context);
/* empty tree */
if (tree_type == 0)
{
int i, n, size;
XmLTreeRowDefinition *rows;
static struct
{
Boolean expands;
int level;
char *string;
} data[] =
{
{ True, 0, "Root" },
{ True, 1, "Level 1 Parent" },
{ False, 2, "1st Child of Level 1 Parent" },
{ False, 2, "2nd Child of Level 1 Parent" },
{ True, 2, "Level 2 Parent" },
{ False, 3, "Child of Level 2 Parent" },
{ True, 1, "Level 1 Parent" },
{ False, 2, "Child of Level 1 Parent" },
};
#ifdef DEBUG_spence
printf ("empty tree\n");
#endif
// create the tree
m_tree = XtVaCreateManagedWidget("tree",
xmlTreeWidgetClass, parent,
XmNvisibleRows, 10,
NULL);
XtVaSetValues(m_tree,
XmNcellDefaults, True,
NULL);
/* Create a TreeRowDefinition array from the data array */
/* and add rows to the Tree */
n = 8;
size = sizeof(XmLTreeRowDefinition) * n;
rows = (XmLTreeRowDefinition *)malloc(size);
for (i = 0; i < n; i++)
{
rows[i].level = data[i].level;
rows[i].expands = data[i].expands;
rows[i].isExpanded = True;
rows[i].pixmap = XmUNSPECIFIED_PIXMAP;
rows[i].pixmask = XmUNSPECIFIED_PIXMAP;
rows[i].string = XmStringCreateSimple(data[i].string);
}
XmLTreeAddRows(m_tree, rows, n, -1);
/* Free the TreeRowDefintion array (and XmStrings) we created above */
for (i = 0; i < n; i++)
XmStringFree(rows[i].string);
free((char *)rows);
#if 0
// Save vertical scroller for keyboard accelerators
CONTEXT_DATA(context)->vscroll = m_outliner->getScroller();
m_outliner->show();
#endif
#ifdef DEBUG_spence
printf ("width = %d, height = %d\n", width, height);
#endif
XtVaSetValues (m_tree, XmNwidth, width, XmNheight, height, NULL);
// load rdf database
getRDFDB();
} else if (tree_type == 1) {
#ifdef DEBUG_spence
printf ("bookmark tree\n");
#endif
// bookmark tree
// create the bookmark view
XFE_BookmarkView *view = new XFE_BookmarkView(toplevel,
parent,
NULL,
context);
XtVaSetValues(view->getBaseWidget(),
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
NULL);
view->show ();
m_outliner = view->getOutliner ();
} else if (tree_type == 2) {
#ifdef DEBUG_spence
printf ("addressbook tree\n");
#endif
// create the addressbook view;
// import from XFE_BookmarkFrame::XFE_BookmarkFrame
XFE_AddrBookView *view = new XFE_AddrBookView(toplevel,
parent,
NULL,
context);
} else if (tree_type == 3) {
#ifdef DEBUG_spence
printf ("history tree\n");
#endif
// create the History view
XFE_HistoryView *view = new XFE_HistoryView(toplevel, parent, NULL, context);
}
if (m_tree == NULL && m_outliner == NULL)
{
#ifdef DEBUG_spence
printf ("XFE_TreeView: outliner create failed!\n");
#endif
return;
}
}
XFE_TreeView::~XFE_TreeView()
{
/* nothing to do here */
}
void
XFE_TreeView::getRDFDB()
{
HT_Notification ns;
RDF_Resources std;
#ifdef DEBUG_spence
printf ("getRDFDB:\n");
#endif
#if 0
ns = (HT_Notification) XP_ALLOC (sizeof (HT_NotificationStruct));
if (ns == NULL)
{
printf ("couldn't allocate NotificationStruct\n");
return;
}
#endif
ns = new HT_NotificationStruct;
ns->notifyProc = (HT_NotificationProc) xfe_handleRDFNotify;
ns->data = this;
#if 0
std = RDF_StdVocab();
#endif
// now create the HT_View - the backend representation of our tree
m_htPane = HT_NewPane (ns);
m_htView = HT_GetNthView (m_htPane, 0);
// m_htView = HT_NewView (std->RDF_Top, m_htPane);
// now populate the tree
drawTree ();
}
void
XFE_TreeView::handleRDFNotify (HT_Notification ns,
HT_Resource node,
HT_Event event)
{
#ifdef DEBUG_spence
printf ("handleRDFNotify\n");
#endif
}
void
XFE_TreeView::drawTree ()
{
HT_Pane pane;
// fe_Data *feData = (fe_Data *) HT_GetViewFEData (m_htView);
int count = HT_GetItemListCount (m_htView);
int n = 0;
#ifdef DEBUG_spence
printf ("drawTree\n");
#endif
while (n < count) {
HT_Resource node = HT_GetNthItem (m_htView, n);
// add element to tree widget
drawNode (node);
++n;
}
}
void
XFE_TreeView::drawNode (HT_Resource node)
{
HT_Cursor cursor;
PRBool isContainer, isOpen, isSelected;
uint16 colNum, depth;
uint32 colWidth, colTokenType;
void *data, *colToken;
struct tm *time;
time_t dateVal;
char buffer [128];
if (isContainer = HT_IsContainer(node))
{
isOpen = HT_IsContainerOpen(node);
// draw the node
#ifdef DEBUG_spence
printf ("node draw\n");
#endif
}
if ((cursor = HT_NewColumnCursor(HT_GetView(node))) == NULL) {
return;
}
isSelected = HT_IsSelected(node);
colNum = 0;
while (HT_GetNextColumn(cursor, NULL, &colWidth, &colToken, &colTokenType) == TRUE)
{
if (HT_GetNodeData(node, colToken, colTokenType, &data) == TRUE)
{
switch(colTokenType)
{
case HT_COLUMN_DATE_STRING:
if (data == NULL) break;
if ((dateVal = (time_t)atol((char *)data)) == 0) break;
if ((time = localtime(&dateVal)) == NULL) break;
strftime(buffer,sizeof(buffer),"%#m/%#d/%Y %#I:%M %p",time);
#ifdef DEBUG_spence
printf ("node: %s\n", buffer);
#endif
break;
case HT_COLUMN_DATE_INT:
if (data == 0L) break;
if ((time = localtime((time_t *) &data)) == NULL) break;
strftime(buffer,sizeof(buffer),"%#m/%#d/%Y %#I:%M %p",time);
#ifdef DEBUG_spence
printf ("node: %s\n", buffer);
#endif
break;
case HT_COLUMN_INT:
sprintf(buffer,"%d",(int)data);
#ifdef DEBUG_spence
printf ("node: %s\n", buffer);
#endif
break;
case HT_COLUMN_STRING:
if (data == NULL) break;
if (colNum==0)
{
depth = HT_GetItemIndentation(node) - 1;
#ifdef DEBUG_spence
printf ("node: %s\n", (char *)data);
#endif
}
else
{
#ifdef DEBUG_spence
printf ("node: %s\n", (char *)data);
#endif
}
break;
}
}
if (isContainer) break;
}
HT_DeleteColumnCursor(cursor);
}
// Outlinable interface methods
void *
XFE_TreeView::ConvFromIndex (int /* index */)
{
return NULL;
}
int
XFE_TreeView::ConvToIndex (void * /* item */)
{
return 0;
}
char *
XFE_TreeView::getColumnName (int /* column */)
{
return NULL;
}
char *
XFE_TreeView::getColumnHeaderText (int /* column */)
{
return NULL;
}
fe_icon *
XFE_TreeView::getColumnHeaderIcon (int /* column */)
{
return NULL;
}
EOutlinerTextStyle
XFE_TreeView::getColumnHeaderStyle (int /* column */)
{
return (EOutlinerTextStyle) NULL;
}
void *
XFE_TreeView::acquireLineData (int /* line */)
{
return NULL;
}
void
XFE_TreeView::getTreeInfo (XP_Bool * /* expandable */, XP_Bool * /* is_expanded */,
int * /* depth */, OutlinerAncestorInfo ** /* ancestor */)
{
}
EOutlinerTextStyle
XFE_TreeView::getColumnStyle (int /* column */)
{
return (EOutlinerTextStyle) NULL;
}
char *
XFE_TreeView::getColumnText (int /* column */)
{
return NULL;
}
fe_icon *
XFE_TreeView::getColumnIcon (int /* column */)
{
return NULL;
}
void
XFE_TreeView::releaseLineData()
{
}
void
XFE_TreeView::Buttonfunc (const OutlineButtonFuncData * /* data */)
{
}
void
XFE_TreeView::Flippyfunc (const OutlineFlippyFuncData * /* data */)
{
}
XFE_Outliner *
XFE_TreeView::getOutliner()
{
return m_outliner;
}
char *
XFE_TreeView::getCellTipString (int /* row */, int /* column */)
{
return NULL;
}
char *
XFE_TreeView::getCellDocString (int /* row */, int /* column */)
{
return NULL;
}
extern "C" void
fe_showTreeView (Widget parent, int tree_type, int width, int height)
{
static XP_Bool been_here = FALSE;
#ifdef DEBUG_spence
printf ("XFE_TreeView: showTreeView()\n");
#endif
if (!been_here) {
#ifdef DEBUG_spence
printf ("RDF_Init()\n");
#endif
RDF_Init("file://./"); // assume it hasn't been initialized yet
been_here = TRUE;
}
XFE_TreeView *tree = new XFE_TreeView ("tree",
parent,
tree_type,
width,
height);
XtRealizeWidget (parent);
#ifdef DEBUG_spence
if (tree == NULL)
{
printf ("fe_showTreeView: create failed!\n");
return;
}
#endif
}
extern "C" void
xfe_handleRDFNotify (HT_Notification ns,
HT_Resource node,
HT_Event event,
void *token,
uint32 tokenType)
{
#ifdef DEBUG_spence
printf ("handleRDFNotify\n");
#endif
XFE_TreeView *tree = (XFE_TreeView *) ns->data;
tree->handleRDFNotify (ns, node, event);
}

View File

@@ -0,0 +1,120 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
TreeView.h -- class definition for XFE_TreeView
Created: spence murray <spence@netscape.com>, 3-Nov-97.
*/
#ifndef _xfe_treeview_h
#define _xfe_treeview_h
#include "NotificationCenter.h"
#include "Outlinable.h"
#include "XmL/Tree.h"
extern "C"
{
#include "gridpopup.h"
#include "htrdf.h"
#include "rdf.h"
}
class XFE_TreeView : public XFE_Outlinable
{
public:
XFE_TreeView(const char *name,
Widget parent,
int tree_type,
int width,
int height);
XFE_TreeView();
virtual ~XFE_TreeView();
// The Outlinable interface.
void *ConvFromIndex(int index);
virtual int ConvToIndex(void *item);
virtual char *getColumnName(int column);
virtual char *getColumnHeaderText(int column);
virtual fe_icon *getColumnHeaderIcon(int column);
virtual EOutlinerTextStyle getColumnHeaderStyle(int column);
virtual void *acquireLineData(int line);
virtual void getTreeInfo(XP_Bool *expandable, XP_Bool *is_expanded, int *depth,
OutlinerAncestorInfo **ancestor);
virtual EOutlinerTextStyle getColumnStyle(int column);
virtual char *getColumnText(int column);
virtual fe_icon *getColumnIcon(int column);
// Tells the Outlinable object that the line data is no
// longer needed, and it can free any storage associated with
// it.
virtual void releaseLineData();
virtual void Buttonfunc(const OutlineButtonFuncData *data);
virtual void Flippyfunc(const OutlineFlippyFuncData *data);
// return the outliner associated with this outlinable.
virtual XFE_Outliner *getOutliner();
// Get tooltipString & docString;
// returned string shall be freed by the callee
// row < 0 indicates heading row; otherwise it is a content row
// (starting from 0)
//
virtual char *getCellTipString(int row, int column);
virtual char *getCellDocString(int row, int column);
// the notifyProc
void handleRDFNotify (HT_Notification ns,
HT_Resource node,
HT_Event event);
private:
// load the RDF database
void getRDFDB ();
// fill the tree with the current RDF database
void drawTree ();
// draw a node
void drawNode (HT_Resource node);
protected:
XFE_Outliner *m_outliner;
Widget m_tree;
// rdf handles
RDF_Resources m_rdfResources;
HT_Pane m_htPane;
HT_View m_htView;
};
extern "C" void
fe_showTreeView (Widget parent, int tree_type, int width, int height);
// the notifyProc
extern "C" void
xfe_handleRDFNotify (HT_Notification ns,
HT_Resource node,
HT_Event event,
void *token,
uint32 tokenType);
#endif /* _xfe_treeview_h */

81
mozilla/config/dgux.mk Normal file
View File

@@ -0,0 +1,81 @@
#
# 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.
#
######################################################################
# Config stuff for Data General DG/UX
#
# Initial DG/UX port by Marc Fraioli <fraioli@dg-rtp.dg.com>
######################################################################
#
######################################################################
# Version-independent
######################################################################
ARCH := dgux
CPU_ARCH := x86
GFX_ARCH := x
OS_INCLUDES =
G++INCLUDES =
LOC_LIB_DIR =
MOTIF =
MOTIFLIB = -lXm -lXt -lXmu -lX11
OS_LIBS = -lgen -lresolv -lsocket -lnsl
#DSO_LDFLAGS = -lXm -lXt -lX11 -lsocket -lnsl
PLATFORM_FLAGS = -DDGUX -Di386 -D_DGUX_SOURCE -D_POSIX4A_DRAFT6_SOURCE
MOVEMAIL_FLAGS = -DUSG -DHAVE_STRERROR
PORT_FLAGS = -DSVR4 -DSYSV -DNO_CDEFS_H -DNEED_S_ISSOCK -DSYS_BYTEORDER_H -DUSE_NODL_TABS -DMOTIF_WARNINGS_UPSET_JAVA -DMITSHM -DNO_MULTICAST -DHAVE_NETINET_IN_H -DHAVE_REMAINDER
PDJAVA_FLAGS =
OS_CFLAGS = $(PLATFORM_FLAGS) $(PORT_FLAGS) $(MOVEMAIL_FLAGS)
LOCALE_MAP = $(DEPTH)/cmd/xfe/intl/unixware.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
# BUILD_UNIX_PLUGINS = 1
######################################################################
# Version-specific stuff
######################################################################
######################################################################
# Overrides for defaults in config.mk (or wherever)
######################################################################
EMACS = /bin/true
PERL = /usr/bin/perl
ifdef BUILD_OPT
OPTIMIZER = -O2
else
# -g would produce a huge executable.
OPTIMIZER =
endif
######################################################################
# Other
######################################################################

View File

@@ -0,0 +1,67 @@
#! 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.
#
#
#
# You need to have checked out the LDAP tree at the same level as ns
# in order to build LDAP.
#
LDAP_DEPTH = ..
DEPTH = ..
include $(LDAP_DEPTH)/config/rules.mk
all export:: FORCE
@if [ -d $(LDAP_DEPTH)/directory/c-sdk/ldap ]; then \
cd $(LDAP_DEPTH)/directory/c-sdk/ldap; \
$(MAKE) -f Makefile.client $(MFLAGS) export; \
else \
echo "No LDAP directory -- skipping"; \
exit 0; \
fi
libs install:: FORCE
@if [ -d $(LDAP_DEPTH)/directory/c-sdk/ldap ]; then \
cd $(LDAP_DEPTH)/directory/c-sdk/ldap; \
$(MAKE) -f Makefile.client $(MFLAGS) install; \
else \
echo "No LDAP directory -- skipping"; \
exit 0; \
fi
clean clobber:: FORCE
@if [ -d $(LDAP_DEPTH)/directory/c-sdk/ldap ]; then \
cd $(LDAP_DEPTH)/directory/c-sdk/ldap; \
$(MAKE) -f Makefile.client $(MFLAGS) clean; \
else \
echo "No LDAP directory -- skipping"; \
exit 0; \
fi
realclean clobber_all:: FORCE
@if [ -d $(LDAP_DEPTH)/directory/c-sdk/ldap ]; then \
cd $(LDAP_DEPTH)/directory/c-sdk/ldap; \
$(MAKE) -f Makefile.client $(MFLAGS) realclean; \
else \
echo "No LDAP directory -- skipping"; \
exit 0; \
fi
FORCE:

View File

@@ -0,0 +1,137 @@
======================================================================
NETSCAPE DIRECTORY SDK FOR JAVA:
BUILD INSTRUCTIONS
Last updated: July 29, 1998
======================================================================
For information on the Netscape Directory SDK source release,
see http://www.mozilla.org/directory/
Note the following:
- The LDAP filter classes (in the netscape.ldap.util package)
use the OROMatcher(tm) regular expression package (from ORO Inc.).
This is not provided with the source code release. If you want this
package, you need to get it from ORO, Inc. (For details, see the
ORO, Inc. home page at http://www.oroinc.com/.)
Unix/Linux Build Instructions
-----------------------------
System Requirements:
32MB of RAM, 128MB of swap, recommended 64MB of RAM.
Tool Requirements:
Sun Microsystems Java Development Kit (JDK) 1.1.5
(or a more recent version)
GNU make 3.74 or a more recent version
Instructions:
1. Uncompress and extract the source files by entering the
following command (or your preferred variant of this command):
gzip -dc <filename>.tar.gz | tar -xvf -
2. Set and unset the following environment variables.
In csh/tcsh:
setenv JAVA_HOME "<directory where the JDK is installed>"
For example:
setenv JAVA_HOME "/usr/local/jdk1.1.5"
setenv CLASSPATH "<location of the JDK classes.zip file>"
For example:
setenv CLASSPATH "/usr/local/jdk1.1.5/lib/classes.zip"
In sh/bash/ksh:
JAVA_HOME="<directory where the JDK is installed>"
CLASSPATH="<location of the JDK classes.zip file>"
export JAVA_HOME CLASSPATH
3. Build the LDAP Java classes by entering the following commands:
cd mozilla/directory/java-sdk
gmake -f ldap.mk
If you also want the classes packaged in a JAR file,
specify "basepackage" as the target:
gmake -f ldap.mk basepackage
The SDK will be built and copied into the following directories:
mozilla/directory/java-sdk/dist/classes - class files and manifest file
mozilla/directory/java-sdk/dist/packages - ldapjdk.jar JAR file
(if you've specified "basepackage" as the target)
Windows Build Instructions
--------------------------
System Requirements:
Windows NT 3.51 or 4.0 (4.0 preferred).
Tool Requirements:
Sun Microsystems Java Development Kit (JDK) 1.1.5
(or a more recent version)
GNU Tools for Windows (you can find these on the Internet).
Specifically, you'll need:
cp.exe
rm.exe
Here are some sample download sites to find these:
Cygnus (http://www.cygnus.com/misc/gnu-win32)
GNU (http://www.gnu.org/order/ftp.html)
MIT (ftp://prep.ai.mit.edu/pub/gnu)
Netscape uses internally modified versions of the following tools:
gmake.exe
shmsdos.exe
uname.exe
You can download them from http://www.mozilla.org/download-mozilla.html
(click the Windows Build Tools link). When you unzip the file, the
tools will be located in the windows\bin\x86 directory.
All of these tools need to be put in your path.
Extracting the Source Files:
The source files for the Directory SDK are zipped in a file.
When unzipping the file, make sure to specify that you want to
preserve the directory structure. For example,
make sure that "Use Folder Names" is checked.
Instructions:
NOTE: Make sure to run the commands from a standard Windows NT
command prompt. Although you may be able to use other shells
to build the SDK, you may need to adjust the makefiles for
the shell that you are using.
1. Set the following environment variables (within the command session,
either manually or via a script), or within the system environment
through the Control Panel | System control panel):
set MOZ_SRC=(top of your source tree, drive letter and path.
For example, set MOZ_SRC=d:\mozilla_src, if the mozilla
directory is at d:\mozilla_src\mozilla.)
set JAVA_HOME=(directory where the JDK is installed)
For example:
set JAVA_HOME=D:\jdk1.1.5
set CLASSPATH=(location of the JDK classes.zip file)
For example:
set CLASSPATH=D:\jdk1.1.5\lib\classes.zip
In addition, make sure to set your PATH environment variable to
include the tools that you have downloaded.
2. Enter the following commands to build the LDAP Java classes:
cd mozilla\directory\java-sdk
gmake -f ldap.mk
If you also want the classes packaged in a JAR file,
specify "basepackage" as the target:
gmake -f ldap.mk basepackage
The SDK will be built and copied into the following directories:
mozilla\directory\java-sdk\dist\classes - class files and manifest file
mozilla\directory\java-sdk\dist\packages - ldapjdk.jar JAR file
(if you've specified "basepackage" as the target)
--------------------------------------------------------
Copyright (c) 1998 Netscape Communications Corporation.
(http://home.netscape.com/misc/contact_info.html)

View File

@@ -0,0 +1,154 @@
======================================================================
NETSCAPE DIRECTORY SDK FOR C:
BUILD INSTRUCTIONS
Last updated: May 31, 1998
======================================================================
For information on the Netscape Directory SDK source release,
see http://www.mozilla.org/directory/
Unix/Linux Build Instructions
-----------------------------
System Requirements:
32MB of RAM, 128MB of swap, recommended 64MB of RAM.
Tool Requirements:
Native C compiler or GNU C/C++ compiler 2.7.2
(or a more recent version)
GNU make 3.74 or a more recent version
Instructions:
1. Uncompress and extract the source files by entering the
following command (or your preferred variant of this command):
gzip -dc <filename>.tar.gz | tar -xvf -
2. Set and unset the following environment variables.
In csh/tcsh:
setenv MOZILLA_CLIENT 1
setenv NO_MDUPDATE 1
setenv MOZ_LDAP_SDK 1
unsetenv MOZ_LI
unsetenv MOZ_LITE
unsetenv MOZ_MEDIUM
unsetenv NO_SECURITY
In sh/bash/ksh:
MOZILLA_CLIENT=1
NO_MDUPDATE=1
MOZ_LDAP_SDK=1
export MOZILLA_CLIENT NO_MDUPDATE MOZ_LDAP_SDK
unset MOZ_LI
unset MOZ_LITE
unset MOZ_MEDIUM
unset NO_SECURITY
3. Build the SDK by entering the following commands:
cd mozilla
gmake -f directory/ldapsdk.mk build
The SDK will be built and copied into the following directories:
mozilla/dist/public/ldap - header files
mozilla/dist/<architecture>/bin - LDAP API shared object/libraries
(libldap.so, liblber.so)
Windows Build Instructions
--------------------------
System Requirements:
Windows NT 3.51 or 4.0 (4.0 preferred).
Tool Requirements:
Microsoft Visual C++ version 4.2 or a more recent version
GNU Tools for Windows (you can find these on the Internet).
Specifically, you'll need:
cp.exe
rm.exe
Here are some sample download sites to find these:
Cygnus (http://www.cygnus.com/misc/gnu-win32)
GNU (http://www.gnu.org/order/ftp.html)
MIT (ftp://prep.ai.mit.edu/pub/gnu)
Netscape uses internally modified versions of the following tools:
gmake.exe
shmsdos.exe
uname.exe
You can download them from http://www.mozilla.org/download-mozilla.html
(click the Windows Build Tools link). When you unzip the file, the
tools will be located in the windows\bin\x86 directory.
Netscape-developed tools (makedep.exe, txt2rc.exe, waitfor.exe),
which are located in the mozilla\cmd\winfe\mkfiles32 directory
All of these tools need to be put in your path.
Extracting the Source Files:
The source files for the Directory C SDK are zipped in the file
ldap-c-sdk.zip. When unzipping the file, make sure to specify
that you want to preserve the directory structure. For example,
make sure that "Use Folder Names" is checked.
Instructions:
NOTE: Make sure to run the commands from a standard Windows NT
command prompt. Although you may be able to use other shells
to build the SDK, you may need to adjust the makefiles for
the shell that you are using.
1. Set the following environment variables (within the command session,
either manually or via a script), or within the system environment
through the Control Panel | System control panel):
set HOME=(your home directory)
set MOZ_BITS=32
set MOZ_DEBUG=1
set MOZ_GOLD=0
set MOZ_JAVA=0
set MOZ_NT=351 (if running NT 3.51, don't set otherwise)
set MOZ_SRC=(top of your source tree, drive letter and path.
For example, set MOZ_SRC=d:\mozilla_src, if the mozilla
directory is at d:\mozilla_src\mozilla.)
set MOZ_TOOLS=(location of the bin directory containing your
GNU tools. The build looks for MOZ_TOOLS\bin\gmake.exe,
so make sure that the MOZ_TOOLS environment variable
is set correctly.)
set PATH=%MOZ_TOOLS%\bin;%PATH%
set TEMP=(your temp directory)
set TMP=(your temp directory)
set VERBOSE=1
Unset the following environment variables:
set MOZ_LI=
set MOZ_LITE=
set MOZ_MEDIUM=
2. Enter the following commands to build the SDK:
cd mozilla\directory
nmake -f ldapsdk.mak
The SDK will be built and copied into the following directories:
mozilla\dist\public\ldap - header files
mozilla\dist\Win32_d.obj\bin - LDAP API DLL (nsldap32.dll)
mozilla\dist\Win32_d.obj\lib - import and static libraries
(nsldap32.lib, nsldap32s.lib)
Notes:
This build process does not use Visual C++ generated project files.
(Reasons for this include size, maintainability, and the long-term
desire to use tools like gmake or plug-and-play developer tools.)
This does not preclude you from using the Visual C++ IDE or its debugger.
Common Build Problems:
If the build fails with the message "'.\WIN32' unexpected",
you didn't set the environment variables correctly. Check for
extra spaces at the end of the set statements (this is a
common problem when copying and pasting commands).
If directory-related errors are reported, check the full path to
the source for any spaces. Make sure that when you originally extracted
the source files, you used a utility that understands long filenames.
If you are not sure if your extraction utility understands long filenames,
use Info-Zip. (You can get this from ftp://ftp.cdrom.com/pub/infozip.)
--------------------------------------------------------
Copyright (c) 1998 Netscape Communications Corporation.
(http://home.netscape.com/misc/contact_info.html)

View File

@@ -0,0 +1,32 @@
DEPTH = ../../..
SRCDIRS = build include libraries
include $(DEPTH)/config/rules.mk
all export:: FORCE
@for i in $(SRCDIRS); do \
echo " cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export ); \
done
libs install:: FORCE
@for i in $(SRCDIRS); do \
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install ); \
done
clean clobber:: FORCE
@for i in $(SRCDIRS); do \
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean ); \
done
realclean clobber_all:: FORCE
@for i in $(SRCDIRS); do \
echo "cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean ); \
done
FORCE:

View File

@@ -0,0 +1,23 @@
DEPTH = ../../../..
CSRCS = dirver.c
include $(DEPTH)/config/rules.mk
TARGETS = $(OBJDIR)/dirver$(BIN_SUFFIX)
GARBAGE += $(TARGETS)
ifeq ($(OS_ARCH), OS2)
$(OBJS) = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.o))
$(TARGETS): $(OBJS)
@$(MAKE_OBJDIR)
$(LINK_EXE) -OUT:$@ $(OBJS)
endif
export:: $(TARGETS)
$(INSTALL) -m 555 $(TARGETS) $(DIST)/bin
install:: export

View File

@@ -0,0 +1,193 @@
/*--------------------------------------------------------------------------
/ Copyright (C) 1996, 1997 Netscape Communications Corporation
/ --------------------------------------------------------------------------
/
/ Name: Netscape File Version Generator
/ Platforms: WIN32
/ ......................................................................
/ This program generates an ascii format of the 64-bit FILEVERSION
/ resource identifier used by Windows executable binaries.
/
/ Usage Syntax:
/ fversion <major.minor.patch> [mm/dd/yyyy] [outfile]
/ If date is not specified, the current GMT date is used. yyyy must be
/ greater than 1980
/
/ Usage Example:
/ fversion 3.0.0
/ fversion 6.5.4 1/30/2001
/ fversion 6.5.4 1/30/2001 fileversion.h
/
/ see http://ntsbuild/sd/30ver.htm for specification
/ ......................................................................
/ Revision History:
/ 01-30-97 Initial Version, Andy Hakim (ahakim@netscape.com)
/ --------------------------------------------------------------------------*/
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
unsigned _CalcVersion(unsigned nMajor, unsigned nMinor, unsigned nPatch)
{
unsigned nVersion;
nVersion = nMajor;
nVersion <<= 5;
nVersion += nMinor;
nVersion <<= 7;
nVersion += nPatch;
nVersion &= 0xFFFF;
return(nVersion);
}
static void _GetVersions(char *szVer, unsigned *nMajor, unsigned *nMinor,
unsigned *nPatch)
{
char szVersion[128];
unsigned nReturn = 0;
char *szToken;
*nMajor = 0;
*nMinor = 0;
*nPatch = 0;
strcpy(szVersion, szVer);
if(szToken = strtok(szVersion, ".\n"))
{
*nMajor = atoi(szToken);
if(szToken = strtok(NULL, ".\n"))
{
*nMinor = atoi(szToken);
if(szToken = strtok(NULL, ".\n"))
{
*nPatch = atoi(szToken);
}
}
}
}
unsigned _CalcBuildDate(unsigned nYear, unsigned nMonth, unsigned nDay)
{
unsigned nBuildDate = 0;
if(nYear < 100) /* they really mean 19xx */
nYear += 1900;
nYear -= 1980;
nBuildDate = nYear;
nBuildDate <<= 5;
nBuildDate += nMonth;
nBuildDate <<= 4;
nBuildDate += nDay;
nBuildDate &= 0xFFFF;
return(nBuildDate);
}
unsigned _GenBuildDate(char *szBuildDate)
{
unsigned nReturn = 0;
char *szToken;
unsigned nYear = 0;
unsigned nMonth = 0;
unsigned nDay = 0;
if((szBuildDate) && (strchr(szBuildDate, '\\') || strchr(szBuildDate, '/')) && (szToken = strtok(szBuildDate, "\\/")))
{
nMonth = atoi(szToken);
if(szToken = strtok(NULL, "\\/"))
{
nDay = atoi(szToken);
if(szToken = strtok(NULL, "\\/"))
{
nYear = atoi(szToken);
}
}
}
else
{
struct tm *newtime;
time_t ltime;
time( &ltime );
/* Obtain coordinated universal time: */
newtime = gmtime( &ltime );
nYear = newtime->tm_year;
nMonth = newtime->tm_mon;
nDay = newtime->tm_mday;
}
nReturn = _CalcBuildDate(nYear, nMonth, nDay);
return(nReturn);
}
static void ShowHelp(char *szFilename)
{
char szTemp[128];
fprintf(stdout, "%s: Generates ascii format #define for FILEVERSION\n", szFilename);
fprintf(stdout, " resource identifier used by Windows executable binaries.\n");
fprintf(stdout, "\n");
fprintf(stdout, "Usage: %s <major.minor.patch> [mm/dd/yy] [outfile]\n", szFilename);
fprintf(stdout, "\n");
fprintf(stdout, "Examples:\n");
fprintf(stdout, "%s 3.0.0\n", szFilename);
fprintf(stdout, "%s 6.5.2 1/30/2001\n", szFilename);
fprintf(stdout, "%s 6.5.2 1/30/2001 fileversion.h\n", szFilename);
}
main(int nArgc, char **lpArgv)
{
int nReturn = 0;
unsigned nVersion = 0;
unsigned nBuildDate = 0;
if(nArgc < 2)
{
ShowHelp(lpArgv[0]);
nReturn = 1;
}
else
{
char *szVersion = NULL;
char *szDate = NULL;
char *szOutput = NULL;
FILE *f = stdout;
unsigned nMajor = 0;
unsigned nMinor = 0;
unsigned nPatch = 0;
szVersion = (char *)lpArgv[1];
szDate = (char *)lpArgv[2];
szOutput = (char *)lpArgv[3];
_GetVersions( szVersion, &nMajor, &nMinor, &nPatch );
nVersion = _CalcVersion(nMajor, nMinor, nPatch);
nBuildDate = _GenBuildDate(szDate);
if(nArgc >= 4)
f = fopen(szOutput, "w");
fprintf(f, "#define VI_PRODUCTVERSION %u.%u\n", nMajor, nMinor);
fprintf(f, "#define PRODUCTTEXT \"%u.%u\"\n", nMajor, nMinor);
fprintf(f, "#define VI_FILEVERSION %u, 0, 0,%u\n",
nVersion, nBuildDate);
fprintf(f, "#define VI_FileVersion \"%s Build %u\\0\"\n",
szVersion, nBuildDate);
if(nArgc >= 4)
fclose(f);
nReturn = (nVersion && !nBuildDate);
}
return(nReturn);
}

View File

@@ -0,0 +1,4 @@
disptmpl.h
lber.h
ldap.h
srchpref.h

View File

@@ -0,0 +1,48 @@
DEPTH = ../../../..
CHMOD = chmod
RM = rm -f
SED = sed
HEADERS = \
disptmpl.h \
lber.h \
ldap.h \
srchpref.h \
$(NULL)
include $(DEPTH)/config/rules.mk
GARBAGE += sdkver.h dirver.h
ETCDIR = $(DIST)/etc
INCLUDEDIR = $(XPDIST)/public/ldap
DIR_VERSION := 2.0
DIRSDK_VERSION := 1.0
ifeq ($(OS_ARCH), WINNT)
# Is this correct?
DIRVER_PATH = $(DEPTH)/netsite/ldap/build
else
DIRVER_PATH = $(DIST)/bin
endif
DIRVER_PROG = $(DIRVER_PATH)/dirver$(BIN_SUFFIX)
###########################################################################
all export:: sdkver.h dirver.h FORCE
$(INSTALL) $(INSTALLFLAGS) -m 644 $(HEADERS) $(INCLUDEDIR)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(HEADERS) $(DIST)/include
sdkver.h: $(DIRVER_PROG)
@$< $(DIRSDK_VERSION) UseSystemDate $@
dirver.h: $(DIRVER_PROG)
@$< $(DIR_VERSION) UseSystemDate $@
install:: export
FORCE:

View File

@@ -0,0 +1,343 @@
/*
* Copyright (c) 1993, 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*
* disptmpl.h: display template library defines
* 7 March 1994 by Mark C Smith
*/
#ifndef _DISPTMPL_H
#define _DISPTMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/* calling conventions used by library */
#ifndef LDAP_CALL
#if defined( _WINDOWS ) || defined( _WIN32 )
#define LDAP_C __cdecl
#ifndef _WIN32
#define __stdcall _far _pascal
#define LDAP_CALLBACK _loadds
#else
#define LDAP_CALLBACK
#endif /* _WIN32 */
#define LDAP_PASCAL __stdcall
#define LDAP_CALL LDAP_PASCAL
#else /* _WINDOWS */
#define LDAP_C
#define LDAP_CALLBACK
#define LDAP_PASCAL
#define LDAP_CALL
#endif /* _WINDOWS */
#endif /* LDAP_CALL */
#define LDAP_TEMPLATE_VERSION 1
/*
* general types of items (confined to most significant byte)
*/
#define LDAP_SYN_TYPE_TEXT 0x01000000L
#define LDAP_SYN_TYPE_IMAGE 0x02000000L
#define LDAP_SYN_TYPE_BOOLEAN 0x04000000L
#define LDAP_SYN_TYPE_BUTTON 0x08000000L
#define LDAP_SYN_TYPE_ACTION 0x10000000L
/*
* syntax options (confined to second most significant byte)
*/
#define LDAP_SYN_OPT_DEFER 0x00010000L
/*
* display template item syntax ids (defined by common agreement)
* these are the valid values for the ti_syntaxid of the tmplitem
* struct (defined below). A general type is encoded in the
* most-significant 8 bits, and some options are encoded in the next
* 8 bits. The lower 16 bits are reserved for the distinct types.
*/
#define LDAP_SYN_CASEIGNORESTR ( 1 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_MULTILINESTR ( 2 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_DN ( 3 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_BOOLEAN ( 4 | LDAP_SYN_TYPE_BOOLEAN )
#define LDAP_SYN_JPEGIMAGE ( 5 | LDAP_SYN_TYPE_IMAGE )
#define LDAP_SYN_JPEGBUTTON ( 6 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
#define LDAP_SYN_FAXIMAGE ( 7 | LDAP_SYN_TYPE_IMAGE )
#define LDAP_SYN_FAXBUTTON ( 8 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
#define LDAP_SYN_AUDIOBUTTON ( 9 | LDAP_SYN_TYPE_BUTTON | LDAP_SYN_OPT_DEFER )
#define LDAP_SYN_TIME ( 10 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_DATE ( 11 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_LABELEDURL ( 12 | LDAP_SYN_TYPE_TEXT )
#define LDAP_SYN_SEARCHACTION ( 13 | LDAP_SYN_TYPE_ACTION )
#define LDAP_SYN_LINKACTION ( 14 | LDAP_SYN_TYPE_ACTION )
#define LDAP_SYN_ADDDNACTION ( 15 | LDAP_SYN_TYPE_ACTION )
#define LDAP_SYN_VERIFYDNACTION ( 16 | LDAP_SYN_TYPE_ACTION )
#define LDAP_SYN_RFC822ADDR ( 17 | LDAP_SYN_TYPE_TEXT )
/*
* handy macros
*/
#define LDAP_GET_SYN_TYPE( syid ) ((syid) & 0xFF000000L )
#define LDAP_GET_SYN_OPTIONS( syid ) ((syid) & 0x00FF0000L )
/*
* display options for output routines (used by entry2text and friends)
*/
/*
* use calculated label width (based on length of longest label in
* template) instead of contant width
*/
#define LDAP_DISP_OPT_AUTOLABELWIDTH 0x00000001L
#define LDAP_DISP_OPT_HTMLBODYONLY 0x00000002L
/*
* perform search actions (applies to ldap_entry2text_search only)
*/
#define LDAP_DISP_OPT_DOSEARCHACTIONS 0x00000002L
/*
* include additional info. relevant to "non leaf" entries only
* used by ldap_entry2html and ldap_entry2html_search to include "Browse"
* and "Move Up" HREFs
*/
#define LDAP_DISP_OPT_NONLEAF 0x00000004L
/*
* display template item options (may not apply to all types)
* if this bit is set in ti_options, it applies.
*/
#define LDAP_DITEM_OPT_READONLY 0x00000001L
#define LDAP_DITEM_OPT_SORTVALUES 0x00000002L
#define LDAP_DITEM_OPT_SINGLEVALUED 0x00000004L
#define LDAP_DITEM_OPT_HIDEIFEMPTY 0x00000008L
#define LDAP_DITEM_OPT_VALUEREQUIRED 0x00000010L
#define LDAP_DITEM_OPT_HIDEIFFALSE 0x00000020L /* booleans only */
/*
* display template item structure
*/
struct ldap_tmplitem {
unsigned long ti_syntaxid;
unsigned long ti_options;
char *ti_attrname;
char *ti_label;
char **ti_args;
struct ldap_tmplitem *ti_next_in_row;
struct ldap_tmplitem *ti_next_in_col;
void *ti_appdata;
};
#define NULLTMPLITEM ((struct ldap_tmplitem *)0)
#define LDAP_SET_TMPLITEM_APPDATA( ti, datap ) \
(ti)->ti_appdata = (void *)(datap)
#define LDAP_GET_TMPLITEM_APPDATA( ti, type ) \
(type)((ti)->ti_appdata)
#define LDAP_IS_TMPLITEM_OPTION_SET( ti, option ) \
(((ti)->ti_options & option ) != 0 )
/*
* object class array structure
*/
struct ldap_oclist {
char **oc_objclasses;
struct ldap_oclist *oc_next;
};
#define NULLOCLIST ((struct ldap_oclist *)0)
/*
* add defaults list
*/
struct ldap_adddeflist {
int ad_source;
#define LDAP_ADSRC_CONSTANTVALUE 1
#define LDAP_ADSRC_ADDERSDN 2
char *ad_attrname;
char *ad_value;
struct ldap_adddeflist *ad_next;
};
#define NULLADLIST ((struct ldap_adddeflist *)0)
/*
* display template global options
* if this bit is set in dt_options, it applies.
*/
/*
* users should be allowed to try to add objects of these entries
*/
#define LDAP_DTMPL_OPT_ADDABLE 0x00000001L
/*
* users should be allowed to do "modify RDN" operation of these entries
*/
#define LDAP_DTMPL_OPT_ALLOWMODRDN 0x00000002L
/*
* this template is an alternate view, not a primary view
*/
#define LDAP_DTMPL_OPT_ALTVIEW 0x00000004L
/*
* display template structure
*/
struct ldap_disptmpl {
char *dt_name;
char *dt_pluralname;
char *dt_iconname;
unsigned long dt_options;
char *dt_authattrname;
char *dt_defrdnattrname;
char *dt_defaddlocation;
struct ldap_oclist *dt_oclist;
struct ldap_adddeflist *dt_adddeflist;
struct ldap_tmplitem *dt_items;
void *dt_appdata;
struct ldap_disptmpl *dt_next;
};
#define NULLDISPTMPL ((struct ldap_disptmpl *)0)
#define LDAP_SET_DISPTMPL_APPDATA( dt, datap ) \
(dt)->dt_appdata = (void *)(datap)
#define LDAP_GET_DISPTMPL_APPDATA( dt, type ) \
(type)((dt)->dt_appdata)
#define LDAP_IS_DISPTMPL_OPTION_SET( dt, option ) \
(((dt)->dt_options & option ) != 0 )
#define LDAP_TMPL_ERR_VERSION 1
#define LDAP_TMPL_ERR_MEM 2
#define LDAP_TMPL_ERR_SYNTAX 3
#define LDAP_TMPL_ERR_FILE 4
/*
* buffer size needed for entry2text and vals2text
*/
#define LDAP_DTMPL_BUFSIZ 8192
typedef int (*writeptype)( void *writeparm, char *p, int len );
LDAP_API(int)
LDAP_CALL
ldap_init_templates( char *file, struct ldap_disptmpl **tmpllistp );
LDAP_API(int)
LDAP_CALL
ldap_init_templates_buf( char *buf, long buflen,
struct ldap_disptmpl **tmpllistp );
LDAP_API(void)
LDAP_CALL
ldap_free_templates( struct ldap_disptmpl *tmpllist );
LDAP_API(struct ldap_disptmpl *)
LDAP_CALL
ldap_first_disptmpl( struct ldap_disptmpl *tmpllist );
LDAP_API(struct ldap_disptmpl *)
LDAP_CALL
ldap_next_disptmpl( struct ldap_disptmpl *tmpllist,
struct ldap_disptmpl *tmpl );
LDAP_API(struct ldap_disptmpl *)
LDAP_CALL
ldap_name2template( char *name, struct ldap_disptmpl *tmpllist );
LDAP_API(struct ldap_disptmpl *)
LDAP_CALL
ldap_oc2template( char **oclist, struct ldap_disptmpl *tmpllist );
LDAP_API(char **)
LDAP_CALL
ldap_tmplattrs( struct ldap_disptmpl *tmpl, char **includeattrs, int exclude,
unsigned long syntaxmask );
LDAP_API(struct ldap_tmplitem *)
LDAP_CALL
ldap_first_tmplrow( struct ldap_disptmpl *tmpl );
LDAP_API(struct ldap_tmplitem *)
LDAP_CALL
ldap_next_tmplrow( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row );
LDAP_API(struct ldap_tmplitem *)
LDAP_CALL
ldap_first_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row );
LDAP_API(struct ldap_tmplitem *)
LDAP_CALL
ldap_next_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row,
struct ldap_tmplitem *col );
LDAP_API(int)
LDAP_CALL
ldap_entry2text( LDAP *ld, char *buf, LDAPMessage *entry,
struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
writeptype writeproc, void *writeparm, char *eol, int rdncount,
unsigned long opts );
LDAP_API(int)
LDAP_CALL
ldap_vals2text( LDAP *ld, char *buf, char **vals, char *label, int labelwidth,
unsigned long syntaxid, writeptype writeproc, void *writeparm,
char *eol, int rdncount );
LDAP_API(int)
LDAP_CALL
ldap_entry2text_search( LDAP *ld, char *dn, char *base, LDAPMessage *entry,
struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals,
writeptype writeproc, void *writeparm, char *eol, int rdncount,
unsigned long opts );
LDAP_API(int)
LDAP_CALL
ldap_entry2html( LDAP *ld, char *buf, LDAPMessage *entry,
struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals,
writeptype writeproc, void *writeparm, char *eol, int rdncount,
unsigned long opts, char *urlprefix, char *base );
LDAP_API(int)
LDAP_CALL
ldap_vals2html( LDAP *ld, char *buf, char **vals, char *label, int labelwidth,
unsigned long syntaxid, writeptype writeproc, void *writeparm,
char *eol, int rdncount, char *urlprefix );
LDAP_API(int)
LDAP_CALL
ldap_entry2html_search( LDAP *ld, char *dn, char *base, LDAPMessage *entry,
struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals,
writeptype writeproc, void *writeparm, char *eol, int rdncount,
unsigned long opts, char *urlprefix );
LDAP_API(char *)
LDAP_CALL
ldap_tmplerr2string( int err );
#ifdef __cplusplus
}
#endif
#endif /* _DISPTMPL_H */

View File

@@ -0,0 +1,257 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* lber.h - header file for ber_* functions */
#ifndef _LBER_H
#define _LBER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h> /* to pick up size_t typedef */
/*
* Note that LBER_ERROR and LBER_DEFAULT are values that can never appear
* as valid BER tags, and so it is safe to use them to report errors. In
* fact, any tag for which the following is true is invalid:
* (( tag & 0x00000080 ) != 0 ) && (( tag & 0xFFFFFF00 ) != 0 )
*/
#define LBER_ERROR 0xffffffffL
#define LBER_DEFAULT LBER_ERROR
#define LBER_END_OF_SEQORSET 0xfffffffeL
/* BER classes and mask */
#define LBER_CLASS_UNIVERSAL 0x00
#define LBER_CLASS_APPLICATION 0x40
#define LBER_CLASS_CONTEXT 0x80
#define LBER_CLASS_PRIVATE 0xc0
#define LBER_CLASS_MASK 0xc0
/* BER encoding type and mask */
#define LBER_PRIMITIVE 0x00
#define LBER_CONSTRUCTED 0x20
#define LBER_ENCODING_MASK 0x20
#define LBER_BIG_TAG_MASK 0x1f
#define LBER_MORE_TAG_MASK 0x80
/* general BER types we know about */
#define LBER_BOOLEAN 0x01L
#define LBER_INTEGER 0x02L
#define LBER_BITSTRING 0x03L
#define LBER_OCTETSTRING 0x04L
#define LBER_NULL 0x05L
#define LBER_ENUMERATED 0x0aL
#define LBER_SEQUENCE 0x30L
#define LBER_SET 0x31L
/* BerElement set/get options */
#define LBER_OPT_REMAINING_BYTES 0x01
#define LBER_OPT_TOTAL_BYTES 0x02
#define LBER_OPT_USE_DER 0x04
#define LBER_OPT_TRANSLATE_STRINGS 0x08
#define LBER_OPT_BYTES_TO_WRITE 0x10
#define LBER_OPT_MEMALLOC_FN_PTRS 0x20
/* Sockbuf set/get options */
#define LBER_SOCKBUF_OPT_TO_FILE 0x001
#define LBER_SOCKBUF_OPT_TO_FILE_ONLY 0x002
#define LBER_SOCKBUF_OPT_MAX_INCOMING_SIZE 0x004
#define LBER_SOCKBUF_OPT_NO_READ_AHEAD 0x008
#define LBER_SOCKBUF_OPT_DESC 0x010
#define LBER_SOCKBUF_OPT_COPYDESC 0x020
#define LBER_SOCKBUF_OPT_READ_FN 0x040
#define LBER_SOCKBUF_OPT_WRITE_FN 0x080
#define LBER_OPT_ON ((void *) 1)
#define LBER_OPT_OFF ((void *) 0)
extern int lber_debug;
struct berval {
unsigned long bv_len;
char *bv_val;
};
typedef struct berelement BerElement;
typedef struct sockbuf Sockbuf;
typedef int (*BERTranslateProc)( char **bufp, unsigned long *buflenp,
int free_input );
#ifndef macintosh
#if defined( _WINDOWS ) || defined( _WIN32) || defined( _CONSOLE )
#include <winsock.h> /* for SOCKET */
typedef SOCKET LBER_SOCKET;
#else
typedef int LBER_SOCKET;
#endif /* _WINDOWS */
#else /* macintosh */
typedef void *LBER_SOCKET;
#endif /* macintosh */
/* calling conventions used by library */
#ifndef LDAP_CALL
#if defined( _WINDOWS ) || defined( _WIN32 )
#define LDAP_C __cdecl
#ifndef _WIN32
#define __stdcall _far _pascal
#define LDAP_CALLBACK _loadds
#else
#define LDAP_CALLBACK
#endif /* _WIN32 */
#define LDAP_PASCAL __stdcall
#define LDAP_CALL LDAP_PASCAL
#else /* _WINDOWS */
#define LDAP_C
#define LDAP_CALLBACK
#define LDAP_PASCAL
#define LDAP_CALL
#endif /* _WINDOWS */
#endif /* LDAP_CALL */
/*
* function prototypes for lber library
*/
#ifndef LDAP_API
#if defined( _WINDOWS ) || defined( _WIN32 )
#define LDAP_API(rt) rt
#else /* _WINDOWS */
#define LDAP_API(rt) rt
#endif /* _WINDOWS */
#endif /* LDAP_API */
/*
* libldap read and write I/O function callbacks. The rest of the I/O callback
* types are in ldap.h
*/
typedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_READ_CALLBACK)( LBER_SOCKET,
void *, int );
typedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_WRITE_CALLBACK)( LBER_SOCKET,
const void *, int );
/*
* liblber memory allocation callback functions. These are global to all
* Sockbufs and BerElements. Install your own functions by using a call
* like this: ber_set_option( NULL, LBER_OPT_MEMALLOC_FN_PTRS, &memalloc_fns );
*/
typedef void * (LDAP_C LDAP_CALLBACK LDAP_MALLOC_CALLBACK)( size_t size );
typedef void * (LDAP_C LDAP_CALLBACK LDAP_CALLOC_CALLBACK)( size_t nelem,
size_t elsize );
typedef void * (LDAP_C LDAP_CALLBACK LDAP_REALLOC_CALLBACK)( void *ptr,
size_t size );
typedef void (LDAP_C LDAP_CALLBACK LDAP_FREE_CALLBACK)( void *ptr );
struct lber_memalloc_fns {
LDAP_MALLOC_CALLBACK *lbermem_malloc;
LDAP_CALLOC_CALLBACK *lbermem_calloc;
LDAP_REALLOC_CALLBACK *lbermem_realloc;
LDAP_FREE_CALLBACK *lbermem_free;
};
/*
* decode routines
*/
LDAP_API(unsigned long) LDAP_CALL ber_get_tag( BerElement *ber );
LDAP_API(unsigned long) LDAP_CALL ber_skip_tag( BerElement *ber,
unsigned long *len );
LDAP_API(unsigned long) LDAP_CALL ber_peek_tag( BerElement *ber,
unsigned long *len );
LDAP_API(unsigned long) LDAP_CALL ber_get_int( BerElement *ber, long *num );
LDAP_API(unsigned long) LDAP_CALL ber_get_stringb( BerElement *ber, char *buf,
unsigned long *len );
LDAP_API(unsigned long) LDAP_CALL ber_get_stringa( BerElement *ber,
char **buf );
LDAP_API(unsigned long) LDAP_CALL ber_get_stringal( BerElement *ber,
struct berval **bv );
LDAP_API(unsigned long) LDAP_CALL ber_get_bitstringa( BerElement *ber,
char **buf, unsigned long *len );
LDAP_API(unsigned long) LDAP_CALL ber_get_null( BerElement *ber );
LDAP_API(unsigned long) LDAP_CALL ber_get_boolean( BerElement *ber,
int *boolval );
LDAP_API(unsigned long) LDAP_CALL ber_first_element( BerElement *ber,
unsigned long *len, char **last );
LDAP_API(unsigned long) LDAP_CALL ber_next_element( BerElement *ber,
unsigned long *len, char *last );
LDAP_API(unsigned long) LDAP_C ber_scanf( BerElement *ber, char *fmt, ... );
LDAP_API(void) LDAP_CALL ber_bvfree( struct berval *bv );
LDAP_API(void) LDAP_CALL ber_bvecfree( struct berval **bv );
LDAP_API(struct berval *) LDAP_CALL ber_bvdup( struct berval *bv );
LDAP_API(void) LDAP_CALL ber_set_string_translators( BerElement *ber,
BERTranslateProc encode_proc, BERTranslateProc decode_proc );
LDAP_API(BerElement *) LDAP_CALL ber_init ( struct berval *bv );
/*
* encoding routines
*/
LDAP_API(int) LDAP_CALL ber_put_enum( BerElement *ber, long num,
unsigned long tag );
LDAP_API(int) LDAP_CALL ber_put_int( BerElement *ber, long num,
unsigned long tag );
LDAP_API(int) LDAP_CALL ber_put_ostring( BerElement *ber, char *str,
unsigned long len, unsigned long tag );
LDAP_API(int) LDAP_CALL ber_put_string( BerElement *ber, char *str,
unsigned long tag );
LDAP_API(int) LDAP_CALL ber_put_bitstring( BerElement *ber, char *str,
unsigned long bitlen, unsigned long tag );
LDAP_API(int) LDAP_CALL ber_put_null( BerElement *ber, unsigned long tag );
LDAP_API(int) LDAP_CALL ber_put_boolean( BerElement *ber, int boolval,
unsigned long tag );
LDAP_API(int) LDAP_CALL ber_start_seq( BerElement *ber, unsigned long tag );
LDAP_API(int) LDAP_CALL ber_start_set( BerElement *ber, unsigned long tag );
LDAP_API(int) LDAP_CALL ber_put_seq( BerElement *ber );
LDAP_API(int) LDAP_CALL ber_put_set( BerElement *ber );
LDAP_API(int) LDAP_C ber_printf( BerElement *ber, char *fmt, ... );
LDAP_API(int) LDAP_CALL ber_flatten( BerElement *ber, struct berval **bvPtr );
/*
* miscellaneous routines
*/
LDAP_API(void) LDAP_CALL ber_free( BerElement *ber, int freebuf );
LDAP_API(void) LDAP_CALL ber_special_free(void* buf, BerElement *ber);
LDAP_API(int) LDAP_CALL ber_flush( Sockbuf *sb, BerElement *ber, int freeit );
LDAP_API(BerElement*) LDAP_CALL ber_alloc( void );
LDAP_API(BerElement*) LDAP_CALL der_alloc( void );
LDAP_API(BerElement*) LDAP_CALL ber_alloc_t( int options );
LDAP_API(void*) LDAP_CALL ber_special_alloc(size_t size, BerElement **ppBer);
LDAP_API(BerElement*) LDAP_CALL ber_dup( BerElement *ber );
LDAP_API(unsigned long) LDAP_CALL ber_get_next( Sockbuf *sb, unsigned long *len,
BerElement *ber );
LDAP_API(unsigned long) LDAP_CALL ber_get_next_buffer( void *buffer,
size_t buffer_size, unsigned long *len, BerElement *ber,
unsigned long *Bytes_Scanned );
LDAP_API(long) LDAP_CALL ber_read( BerElement *ber, char *buf,
unsigned long len );
LDAP_API(long) LDAP_CALL ber_write( BerElement *ber, char *buf,
unsigned long len, int nosos );
LDAP_API(void) LDAP_CALL ber_init_w_nullchar( BerElement *ber, int options );
LDAP_API(void) LDAP_CALL ber_reset( BerElement *ber, int was_writing );
LDAP_API(int) LDAP_CALL ber_set_option( BerElement *ber, int option,
void *value );
LDAP_API(int) LDAP_CALL ber_get_option( BerElement *ber, int option,
void *value );
LDAP_API(Sockbuf*) LDAP_CALL ber_sockbuf_alloc( void );
LDAP_API(void) LDAP_CALL ber_sockbuf_free( Sockbuf* p );
LDAP_API(int) LDAP_CALL ber_sockbuf_set_option( Sockbuf *sb, int option,
void *value );
LDAP_API(int) LDAP_CALL ber_sockbuf_get_option( Sockbuf *sb, int option,
void *value );
#ifdef __cplusplus
}
#endif
#endif /* _LBER_H */

View File

@@ -0,0 +1,964 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* ldap.h - general header file for libldap */
#ifndef _LDAP_H
#define _LDAP_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined( XP_OS2 )
#include "os2sock.h"
#elif defined (WIN32) || defined (_WIN32) || defined( _CONSOLE )
#include <windows.h>
# if defined( _WINDOWS )
# include <winsock.h>
# endif
#elif defined(macintosh)
#include <utime.h>
#include "macsocket.h"
#else
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#endif
#ifdef _AIX
#include <sys/select.h>
#endif /* _AIX */
#include "lber.h"
#define LDAP_PORT 389
#define LDAPS_PORT 636
#define LDAP_PORT_MAX 65535
#define LDAP_VERSION1 1
#define LDAP_VERSION2 2
#define LDAP_VERSION3 3
#define LDAP_VERSION LDAP_VERSION2 /* default should stay as LDAPv2 */
#define LDAP_VERSION_MAX LDAP_VERSION3
#define LDAP_ROOT_DSE ""
#define LDAP_NO_ATTRS "1.1"
#define LDAP_ALL_USER_ATTRS "*"
#define LDAP_OPT_DESC 1
#define LDAP_OPT_DEREF 2
#define LDAP_OPT_SIZELIMIT 3
#define LDAP_OPT_TIMELIMIT 4
#define LDAP_OPT_THREAD_FN_PTRS 5
#define LDAP_OPT_REBIND_FN 6
#define LDAP_OPT_REBIND_ARG 7
#define LDAP_OPT_REFERRALS 8
#define LDAP_OPT_RESTART 9
#define LDAP_OPT_SSL 10
#define LDAP_OPT_IO_FN_PTRS 11
#define LDAP_OPT_CACHE_FN_PTRS 13
#define LDAP_OPT_CACHE_STRATEGY 14
#define LDAP_OPT_CACHE_ENABLE 15
#define LDAP_OPT_REFERRAL_HOP_LIMIT 16
#define LDAP_OPT_PROTOCOL_VERSION 17
#define LDAP_OPT_SERVER_CONTROLS 18
#define LDAP_OPT_CLIENT_CONTROLS 19
#define LDAP_OPT_PREFERRED_LANGUAGE 20
#define LDAP_OPT_ERROR_NUMBER 49
#define LDAP_OPT_ERROR_STRING 50
/* for on/off options */
#define LDAP_OPT_ON ((void *)1)
#define LDAP_OPT_OFF ((void *)0)
extern int ldap_debug;
/* On UNIX, there's only one copy of ldap_debug */
/* On NT, each dll keeps its own module_ldap_debug, which */
/* points to the process' ldap_debug and needs initializing after load */
#ifdef _WIN32
extern int *module_ldap_debug;
typedef void (*set_debug_level_fn_t)(int*);
#endif
typedef struct ldap LDAP; /* opaque connection handle */
typedef struct ldapmsg LDAPMessage; /* opaque result/entry handle */
#define NULLMSG ((LDAPMessage *)0)
/* structure representing an LDAP modification */
typedef struct ldapmod {
int mod_op; /* kind of mod + form of values*/
#define LDAP_MOD_ADD 0x00
#define LDAP_MOD_DELETE 0x01
#define LDAP_MOD_REPLACE 0x02
#define LDAP_MOD_BVALUES 0x80
char *mod_type; /* attribute name to modify */
union {
char **modv_strvals;
struct berval **modv_bvals;
} mod_vals; /* values to add/delete/replace */
#define mod_values mod_vals.modv_strvals
#define mod_bvalues mod_vals.modv_bvals
} LDAPMod;
/*
* thread function callbacks
*/
typedef void *(LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_ALLOC_CALLBACK)( void );
typedef void (LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_FREE_CALLBACK)( void * );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_LOCK_CALLBACK)( void * );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_UNLOCK_CALLBACK)( void * );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_GET_ERRNO_CALLBACK)( void );
typedef void (LDAP_C LDAP_CALLBACK LDAP_TF_SET_ERRNO_CALLBACK)( int );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_GET_LDERRNO_CALLBACK)( char **,
char **, void * );
typedef void (LDAP_C LDAP_CALLBACK LDAP_TF_SET_LDERRNO_CALLBACK)( int,
char *, char *, void * );
/*
* structure to hold thread function pointers
*/
struct ldap_thread_fns {
LDAP_TF_MUTEX_ALLOC_CALLBACK *ltf_mutex_alloc;
LDAP_TF_MUTEX_FREE_CALLBACK *ltf_mutex_free;
LDAP_TF_MUTEX_LOCK_CALLBACK *ltf_mutex_lock;
LDAP_TF_MUTEX_UNLOCK_CALLBACK *ltf_mutex_unlock;
LDAP_TF_GET_ERRNO_CALLBACK *ltf_get_errno;
LDAP_TF_SET_ERRNO_CALLBACK *ltf_set_errno;
LDAP_TF_GET_LDERRNO_CALLBACK *ltf_get_lderrno;
LDAP_TF_SET_LDERRNO_CALLBACK *ltf_set_lderrno;
void *ltf_lderrno_arg;
};
/*
* I/O function callbacks. Note that types for the read and write callbacks
* are actually in lber.h
*/
typedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_SELECT_CALLBACK)( int, fd_set *,
fd_set *, fd_set *, struct timeval * );
typedef LBER_SOCKET (LDAP_C LDAP_CALLBACK LDAP_IOF_SOCKET_CALLBACK)( int,
int, int );
typedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_IOCTL_CALLBACK)( LBER_SOCKET,
int, ... );
typedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_CONNECT_CALLBACK )( LBER_SOCKET,
struct sockaddr *, int );
typedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_CLOSE_CALLBACK )( LBER_SOCKET );
typedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_SSL_ENABLE_CALLBACK )( LBER_SOCKET );
/*
* structure to hold I/O function pointers
*/
struct ldap_io_fns {
LDAP_IOF_READ_CALLBACK *liof_read;
LDAP_IOF_WRITE_CALLBACK *liof_write;
LDAP_IOF_SELECT_CALLBACK *liof_select;
LDAP_IOF_SOCKET_CALLBACK *liof_socket;
LDAP_IOF_IOCTL_CALLBACK *liof_ioctl;
LDAP_IOF_CONNECT_CALLBACK *liof_connect;
LDAP_IOF_CLOSE_CALLBACK *liof_close;
LDAP_IOF_SSL_ENABLE_CALLBACK *liof_ssl_enable;
};
/*
* structure for holding ldapv3 controls
*/
typedef struct ldapcontrol {
char *ldctl_oid;
struct berval ldctl_value;
char ldctl_iscritical;
} LDAPControl, *PLDAPControl;
/*
* structure for ldap friendly mapping routines
*/
typedef struct friendly {
char *f_unfriendly;
char *f_friendly;
} *FriendlyMap;
/*
* structure for a sort-key
*/
typedef struct LDAPsortkey {
char * sk_attrtype;
char * sk_matchruleoid;
int sk_reverseorder;
} LDAPsortkey;
/*
* structures for ldap getfilter routines
*/
typedef struct ldap_filt_info {
char *lfi_filter;
char *lfi_desc;
int lfi_scope; /* LDAP_SCOPE_BASE, etc */
int lfi_isexact; /* exact match filter? */
struct ldap_filt_info *lfi_next;
} LDAPFiltInfo;
#define LDAP_FILT_MAXSIZ 1024
typedef struct ldap_filt_list LDAPFiltList; /* opaque filter list handle */
typedef struct ldap_filt_desc LDAPFiltDesc; /* opaque filter desc handle */
/*
* structure that describes a VirtualListViewRequest control.
* note that ldvlist_index and ldvlist_size are only relevant to
* ldap_create_virtuallist_control() if ldvlist_attrvalue is NULL.
*/
typedef struct ldapvirtuallist {
unsigned long ldvlist_before_count; /* # entries before target */
unsigned long ldvlist_after_count; /* # entries after target */
char *ldvlist_attrvalue; /* jump to this value */
unsigned long ldvlist_index; /* list offset */
unsigned long ldvlist_size; /* number of items in vlist */
void *ldvlist_extradata; /* for use by application */
} LDAPVirtualList;
/*
* types for ldap URL handling
*/
typedef struct ldap_url_desc {
char *lud_host;
int lud_port;
char *lud_dn;
char **lud_attrs;
int lud_scope;
char *lud_filter;
unsigned long lud_options;
#define LDAP_URL_OPT_SECURE 0x01
char *lud_string; /* for internal use only */
} LDAPURLDesc;
#define NULLLDAPURLDESC ((LDAPURLDesc *)NULL)
/* Version reporting */
typedef struct _LDAPVersion {
int sdk_version; /* Version of the SDK, * 100 */
int protocol_version; /* Highest protocol version
supported by the SDK, * 100 */
int SSL_version; /* SSL version if this SDK
version supports it, * 100 */
int security_level; /* highest level available */
int reserved[4];
} LDAPVersion;
#define LDAP_SECURITY_NONE 0
#define LDAP_URL_ERR_NOTLDAP 1 /* URL doesn't begin with "ldap://" */
#define LDAP_URL_ERR_NODN 2 /* URL has no DN (required) */
#define LDAP_URL_ERR_BADSCOPE 3 /* URL scope string is invalid */
#define LDAP_URL_ERR_MEM 4 /* can't allocate memory space */
#define LDAP_URL_ERR_PARAM 5 /* bad parameter to an URL function */
/* possible result types a server can return */
#define LDAP_RES_BIND 0x61L /* 97 */
#define LDAP_RES_SEARCH_ENTRY 0x64L /* 100 */
#define LDAP_RES_SEARCH_RESULT 0x65L /* 101 */
#define LDAP_RES_MODIFY 0x67L /* 103 */
#define LDAP_RES_ADD 0x69L /* 105 */
#define LDAP_RES_DELETE 0x6bL /* 107 */
#define LDAP_RES_MODRDN 0x6dL /* 109 */
#define LDAP_RES_RENAME 0x6dL /* same as LDAP_RES_MODRDN */
#define LDAP_RES_COMPARE 0x6fL /* 111 */
#define LDAP_RES_SEARCH_REFERENCE 0x73L /* 115 */
#define LDAP_RES_EXTENDED 0x78L /* 120 */
#define LDAP_RES_ANY (-1L)
/* authentication methods available */
#define LDAP_AUTH_NONE 0x00L
#define LDAP_AUTH_SIMPLE 0x80L
#define LDAP_AUTH_SASL 0xa3L
/* supported SASL methods */
#define LDAP_SASL_SIMPLE 0 /* special value used for simple bind */
#define LDAP_SASL_EXTERNAL "EXTERNAL"
/* search scopes */
#define LDAP_SCOPE_BASE 0x00
#define LDAP_SCOPE_ONELEVEL 0x01
#define LDAP_SCOPE_SUBTREE 0x02
/* alias dereferencing */
#define LDAP_DEREF_NEVER 0
#define LDAP_DEREF_SEARCHING 1
#define LDAP_DEREF_FINDING 2
#define LDAP_DEREF_ALWAYS 3
/* size/time limits */
#define LDAP_NO_LIMIT 0
/* allowed values for "all" ldap_result() parameter */
#define LDAP_MSG_ONE 0
#define LDAP_MSG_ALL 1
#define LDAP_MSG_RECEIVED 2
/* possible error codes we can be returned */
#define LDAP_SUCCESS 0x00 /* 0 */
#define LDAP_OPERATIONS_ERROR 0x01 /* 1 */
#define LDAP_PROTOCOL_ERROR 0x02 /* 2 */
#define LDAP_TIMELIMIT_EXCEEDED 0x03 /* 3 */
#define LDAP_SIZELIMIT_EXCEEDED 0x04 /* 4 */
#define LDAP_COMPARE_FALSE 0x05 /* 5 */
#define LDAP_COMPARE_TRUE 0x06 /* 6 */
#define LDAP_AUTH_METHOD_NOT_SUPPORTED 0x07 /* 7 */
#define LDAP_STRONG_AUTH_NOT_SUPPORTED LDAP_AUTH_METHOD_NOT_SUPPORTED
#define LDAP_STRONG_AUTH_REQUIRED 0x08 /* 8 */
#define LDAP_PARTIAL_RESULTS 0x09 /* 9 (UMich LDAPv2 extn) */
#define LDAP_REFERRAL 0x0a /* 10 - LDAPv3 */
#define LDAP_ADMINLIMIT_EXCEEDED 0x0b /* 11 - LDAPv3 */
#define LDAP_UNAVAILABLE_CRITICAL_EXTENSION 0x0c /* 12 - LDAPv3 */
#define LDAP_CONFIDENTIALITY_REQUIRED 0x0d /* 13 */
#define LDAP_SASL_BIND_IN_PROGRESS 0x0e /* 14 - LDAPv3 */
#define LDAP_NO_SUCH_ATTRIBUTE 0x10 /* 16 */
#define LDAP_UNDEFINED_TYPE 0x11 /* 17 */
#define LDAP_INAPPROPRIATE_MATCHING 0x12 /* 18 */
#define LDAP_CONSTRAINT_VIOLATION 0x13 /* 19 */
#define LDAP_TYPE_OR_VALUE_EXISTS 0x14 /* 20 */
#define LDAP_INVALID_SYNTAX 0x15 /* 21 */
#define LDAP_NO_SUCH_OBJECT 0x20 /* 32 */
#define LDAP_ALIAS_PROBLEM 0x21 /* 33 */
#define LDAP_INVALID_DN_SYNTAX 0x22 /* 34 */
#define LDAP_IS_LEAF 0x23 /* 35 (not used in LDAPv3) */
#define LDAP_ALIAS_DEREF_PROBLEM 0x24 /* 36 */
#define NAME_ERROR(n) ((n & 0xf0) == 0x20)
#define LDAP_INAPPROPRIATE_AUTH 0x30 /* 48 */
#define LDAP_INVALID_CREDENTIALS 0x31 /* 49 */
#define LDAP_INSUFFICIENT_ACCESS 0x32 /* 50 */
#define LDAP_BUSY 0x33 /* 51 */
#define LDAP_UNAVAILABLE 0x34 /* 52 */
#define LDAP_UNWILLING_TO_PERFORM 0x35 /* 53 */
#define LDAP_LOOP_DETECT 0x36 /* 54 */
#define LDAP_SORT_CONTROL_MISSING 0x3C /* 60 */
#define LDAP_NAMING_VIOLATION 0x40 /* 64 */
#define LDAP_OBJECT_CLASS_VIOLATION 0x41 /* 65 */
#define LDAP_NOT_ALLOWED_ON_NONLEAF 0x42 /* 66 */
#define LDAP_NOT_ALLOWED_ON_RDN 0x43 /* 67 */
#define LDAP_ALREADY_EXISTS 0x44 /* 68 */
#define LDAP_NO_OBJECT_CLASS_MODS 0x45 /* 69 */
#define LDAP_RESULTS_TOO_LARGE 0x46 /* 70 - CLDAP */
#define LDAP_AFFECTS_MULTIPLE_DSAS 0x47 /* 71 */
#define LDAP_OTHER 0x50 /* 80 */
#define LDAP_SERVER_DOWN 0x51 /* 81 */
#define LDAP_LOCAL_ERROR 0x52 /* 82 */
#define LDAP_ENCODING_ERROR 0x53 /* 83 */
#define LDAP_DECODING_ERROR 0x54 /* 84 */
#define LDAP_TIMEOUT 0x55 /* 85 */
#define LDAP_AUTH_UNKNOWN 0x56 /* 86 */
#define LDAP_FILTER_ERROR 0x57 /* 87 */
#define LDAP_USER_CANCELLED 0x58 /* 88 */
#define LDAP_PARAM_ERROR 0x59 /* 89 */
#define LDAP_NO_MEMORY 0x5a /* 90 */
#define LDAP_CONNECT_ERROR 0x5b /* 91 */
#define LDAP_NOT_SUPPORTED 0x5c /* 92 - LDAPv3 */
#define LDAP_CONTROL_NOT_FOUND 0x5d /* 93 - LDAPv3 */
#define LDAP_NO_RESULTS_RETURNED 0x5e /* 94 - LDAPv3 */
#define LDAP_MORE_RESULTS_TO_RETURN 0x5f /* 95 - LDAPv3 */
#define LDAP_CLIENT_LOOP 0x60 /* 96 - LDAPv3 */
#define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61 /* 97 - LDAPv3 */
/*
* LDAPv3 server controls we know about
*/
#define LDAP_CONTROL_MANAGEDSAIT "2.16.840.1.113730.3.4.2"
#define LDAP_CONTROL_SORTREQUEST "1.2.840.113556.1.4.473"
#define LDAP_CONTROL_SORTRESPONSE "1.2.840.113556.1.4.474"
#define LDAP_CONTROL_PERSISTENTSEARCH "2.16.840.1.113730.3.4.3"
#define LDAP_CONTROL_ENTRYCHANGE "2.16.840.1.113730.3.4.7"
#define LDAP_CONTROL_VLVREQUEST "2.16.840.1.113730.3.4.9"
#define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
/* Password information sent back to client */
#define LDAP_CONTROL_PWEXPIRED "2.16.840.1.113730.3.4.4"
#define LDAP_CONTROL_PWEXPIRING "2.16.840.1.113730.3.4.5"
/*
* Client controls we know about
*/
#define LDAP_CONTROL_REFERRALS "1.2.840.113556.1.4.616"
/* function prototypes for ldap library */
#ifndef LDAP_API
#if defined( _WINDOWS ) || defined( _WIN32 )
#define LDAP_API(rt) rt
#else /* _WINDOWS */
#define LDAP_API(rt) rt
#endif /* _WINDOWS */
#endif /* LDAP_API */
typedef int (LDAP_CALL LDAP_CALLBACK LDAP_REBINDPROC_CALLBACK)( LDAP *ld,
char **dnp, char **passwdp, int *authmethodp, int freeit, void *arg);
typedef const struct berval* (LDAP_C LDAP_CALLBACK
LDAP_KEYGEN_CALLBACK)( void *arg, LDAP *ld, LDAPMessage *entry );
typedef int (LDAP_C LDAP_CALLBACK
LDAP_KEYCMP_CALLBACK)( void *arg, const struct berval*, const struct berval* );
typedef void (LDAP_C LDAP_CALLBACK
LDAP_KEYFREE_CALLBACK)( void *arg, const struct berval* );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CMP_CALLBACK)(const char*,
const char*);
typedef int (LDAP_C LDAP_CALLBACK LDAP_VALCMP_CALLBACK)(const char**,
const char**);
typedef int (LDAP_C LDAP_CALLBACK LDAP_CANCELPROC_CALLBACK)( void *cl );
LDAP_API(LDAP *) LDAP_CALL ldap_open( const char *host, int port );
LDAP_API(LDAP *) LDAP_CALL ldap_init( const char *defhost, int defport );
LDAP_API(int) LDAP_CALL ldap_set_option( LDAP *ld, int option, void *optdata );
LDAP_API(int) LDAP_CALL ldap_get_option( LDAP *ld, int option, void *optdata );
LDAP_API(int) LDAP_CALL ldap_unbind( LDAP *ld );
LDAP_API(int) LDAP_CALL ldap_unbind_s( LDAP *ld );
LDAP_API(int) LDAP_CALL ldap_version( LDAPVersion *ver );
/*
* perform ldap operations and obtain results
*/
LDAP_API(int) LDAP_CALL ldap_abandon( LDAP *ld, int msgid );
LDAP_API(int) LDAP_CALL ldap_add( LDAP *ld, const char *dn, LDAPMod **attrs );
LDAP_API(int) LDAP_CALL ldap_add_s( LDAP *ld, const char *dn, LDAPMod **attrs );
LDAP_API(void) LDAP_CALL ldap_set_rebind_proc( LDAP *ld,
LDAP_REBINDPROC_CALLBACK *rebindproc, void *arg );
LDAP_API(int) LDAP_CALL ldap_simple_bind( LDAP *ld, const char *who,
const char *passwd );
LDAP_API(int) LDAP_CALL ldap_simple_bind_s( LDAP *ld, const char *who,
const char *passwd );
LDAP_API(int) LDAP_CALL ldap_modify( LDAP *ld, const char *dn, LDAPMod **mods );
LDAP_API(int) LDAP_CALL ldap_modify_s( LDAP *ld, const char *dn,
LDAPMod **mods );
LDAP_API(int) LDAP_CALL ldap_modrdn( LDAP *ld, const char *dn,
const char *newrdn );
LDAP_API(int) LDAP_CALL ldap_modrdn_s( LDAP *ld, const char *dn,
const char *newrdn );
LDAP_API(int) LDAP_CALL ldap_modrdn2( LDAP *ld, const char *dn,
const char *newrdn, int deleteoldrdn );
LDAP_API(int) LDAP_CALL ldap_modrdn2_s( LDAP *ld, const char *dn,
const char *newrdn, int deleteoldrdn);
LDAP_API(int) LDAP_CALL ldap_compare( LDAP *ld, const char *dn,
const char *attr, const char *value );
LDAP_API(int) LDAP_CALL ldap_compare_s( LDAP *ld, const char *dn,
const char *attr, const char *value );
LDAP_API(int) LDAP_CALL ldap_delete( LDAP *ld, const char *dn );
LDAP_API(int) LDAP_CALL ldap_delete_s( LDAP *ld, const char *dn );
LDAP_API(int) LDAP_CALL ldap_search( LDAP *ld, const char *base, int scope,
const char *filter, char **attrs, int attrsonly );
LDAP_API(int) LDAP_CALL ldap_search_s( LDAP *ld, const char *base, int scope,
const char *filter, char **attrs, int attrsonly, LDAPMessage **res );
LDAP_API(int) LDAP_CALL ldap_search_st( LDAP *ld, const char *base, int scope,
const char *filter, char **attrs, int attrsonly,
struct timeval *timeout, LDAPMessage **res );
LDAP_API(int) LDAP_CALL ldap_result( LDAP *ld, int msgid, int all,
struct timeval *timeout, LDAPMessage **result );
LDAP_API(int) LDAP_CALL ldap_msgfree( LDAPMessage *lm );
LDAP_API(void) LDAP_CALL ldap_mods_free( LDAPMod **mods, int freemods );
LDAP_API(int) LDAP_CALL ldap_msgid( LDAPMessage *lm );
LDAP_API(int) LDAP_CALL ldap_msgtype( LDAPMessage *lm );
/*
* parse/create controls
*/
LDAP_API(int) LDAP_CALL ldap_create_sort_control( LDAP *ld,
LDAPsortkey **sortKeyList, const char ctl_iscritical,
LDAPControl **ctrlp );
LDAP_API(int) LDAP_CALL ldap_parse_sort_control( LDAP *ld,
LDAPControl **ctrls, unsigned long *result, char **attribute );
LDAP_API(int) LDAP_CALL ldap_controls_count( LDAPControl **ctrls );
/*
* parse/deal with results and errors returned
*/
LDAP_API(int) LDAP_CALL ldap_get_lderrno( LDAP *ld, char **m, char **s );
LDAP_API(int) LDAP_CALL ldap_set_lderrno( LDAP *ld, int e, char *m, char *s );
LDAP_API(int) LDAP_CALL ldap_result2error( LDAP *ld, LDAPMessage *r,
int freeit );
LDAP_API(char *) LDAP_CALL ldap_err2string( int err );
LDAP_API(void) LDAP_CALL ldap_perror( LDAP *ld, const char *s );
LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_entry( LDAP *ld,
LDAPMessage *chain );
LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_entry( LDAP *ld,
LDAPMessage *entry );
LDAP_API(int) LDAP_CALL ldap_count_entries( LDAP *ld, LDAPMessage *chain );
LDAP_API(char *) LDAP_CALL ldap_get_dn( LDAP *ld, LDAPMessage *entry );
LDAP_API(char *) LDAP_CALL ldap_dn2ufn( const char *dn );
LDAP_API(char **) LDAP_CALL ldap_explode_dn( const char *dn,
const int notypes );
LDAP_API(char **) LDAP_CALL ldap_explode_rdn( const char *dn,
const int notypes );
LDAP_API(char **) LDAP_CALL ldap_explode_dns( const char *dn );
LDAP_API(char *) LDAP_CALL ldap_first_attribute( LDAP *ld, LDAPMessage *entry,
BerElement **ber );
LDAP_API(char *) LDAP_CALL ldap_next_attribute( LDAP *ld, LDAPMessage *entry,
BerElement *ber );
LDAP_API(void) LDAP_CALL ldap_ber_free( BerElement *ber, int freebuf );
LDAP_API(char **) LDAP_CALL ldap_get_values( LDAP *ld, LDAPMessage *entry,
const char *target );
LDAP_API(struct berval **) LDAP_CALL ldap_get_values_len( LDAP *ld,
LDAPMessage *entry, const char *target );
LDAP_API(char **) LDAP_CALL ldap_get_lang_values( LDAP *ld, LDAPMessage *entry,
const char *target, char **type );
LDAP_API(struct berval **) LDAP_CALL ldap_get_lang_values_len( LDAP *ld,
LDAPMessage *entry, const char *target, char **type );
LDAP_API(int) LDAP_CALL ldap_count_values( char **vals );
LDAP_API(int) LDAP_CALL ldap_count_values_len( struct berval **vals );
LDAP_API(void) LDAP_CALL ldap_value_free( char **vals );
LDAP_API(void) LDAP_CALL ldap_value_free_len( struct berval **vals );
LDAP_API(void) LDAP_CALL ldap_memfree( void *p );
/*
* LDAPv3 extended operation calls
*/
/*
* Note: all of the new asynchronous calls return an LDAP error code,
* not a message id. A message id is returned via the int *msgidp
* parameter (usually the last parameter) if appropriate.
*/
LDAP_API(int) LDAP_CALL ldap_abandon_ext( LDAP *ld, int msgid,
LDAPControl **serverctrls, LDAPControl **clientctrls );
LDAP_API(int) LDAP_CALL ldap_add_ext( LDAP *ld, const char *dn, LDAPMod **attrs,
LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
LDAP_API(int) LDAP_CALL ldap_add_ext_s( LDAP *ld, const char *dn,
LDAPMod **attrs, LDAPControl **serverctrls, LDAPControl **clientctrls );
LDAP_API(int) LDAP_CALL ldap_sasl_bind( LDAP *ld, const char *dn,
const char *mechanism, struct berval *cred, LDAPControl **serverctrls,
LDAPControl **clientctrls, int *msgidp );
LDAP_API(int) LDAP_CALL ldap_sasl_bind_s( LDAP *ld, const char *dn,
const char *mechanism, struct berval *cred, LDAPControl **serverctrls,
LDAPControl **clientctrls, struct berval **servercredp );
LDAP_API(int) LDAP_CALL ldap_modify_ext( LDAP *ld, const char *dn,
LDAPMod **mods, LDAPControl **serverctrls, LDAPControl **clientctrls,
int *msgidp );
LDAP_API(int) LDAP_CALL ldap_modify_ext_s( LDAP *ld, const char *dn,
LDAPMod **mods, LDAPControl **serverctrls, LDAPControl **clientctrls );
LDAP_API(int) LDAP_CALL ldap_rename( LDAP *ld, const char *dn,
const char *newrdn, const char *newparent, int deleteoldrdn,
LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
LDAP_API(int) LDAP_CALL ldap_rename_s( LDAP *ld, const char *dn,
const char *newrdn, const char *newparent, int deleteoldrdn,
LDAPControl **serverctrls, LDAPControl **clientctrls );
LDAP_API(int) LDAP_CALL ldap_compare_ext( LDAP *ld, const char *dn,
const char *attr, struct berval *bvalue, LDAPControl **serverctrls,
LDAPControl **clientctrls, int *msgidp );
LDAP_API(int) LDAP_CALL ldap_compare_ext_s( LDAP *ld, const char *dn,
const char *attr, struct berval *bvalue, LDAPControl **serverctrls,
LDAPControl **clientctrls );
LDAP_API(int) LDAP_CALL ldap_delete_ext( LDAP *ld, const char *dn,
LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
LDAP_API(int) LDAP_CALL ldap_delete_ext_s( LDAP *ld, const char *dn,
LDAPControl **serverctrls, LDAPControl **clientctrls );
LDAP_API(int) LDAP_CALL ldap_search_ext( LDAP *ld, const char *base,
int scope, const char *filter, char **attrs, int attrsonly,
LDAPControl **serverctrls, LDAPControl **clientctrls,
struct timeval *timeoutp, int sizelimit, int *msgidp );
LDAP_API(int) LDAP_CALL ldap_search_ext_s( LDAP *ld, const char *base,
int scope, const char *filter, char **attrs, int attrsonly,
LDAPControl **serverctrls, LDAPControl **clientctrls,
struct timeval *timeoutp, int sizelimit, LDAPMessage **res );
LDAP_API(int) LDAP_CALL ldap_extended_operation( LDAP *ld,
const char *requestoid, struct berval *requestdata,
LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
LDAP_API(int) LDAP_CALL ldap_extended_operation_s( LDAP *ld,
const char *requestoid, struct berval *requestdata,
LDAPControl **serverctrls, LDAPControl **clientctrls,
char **retoidp, struct berval **retdatap );
/*
* Routines for manipulating sort key lists, used for making sort controls
*/
LDAP_API(void) LDAP_CALL ldap_free_sort_keylist (LDAPsortkey **sortKeyList);
LDAP_API(int) LDAP_CALL ldap_create_sort_keylist (LDAPsortkey ***sortKeyList,char *string_rep);
/*
* LDAPv3 extended parsing / result handling calls
*/
LDAP_API(int) LDAP_CALL ldap_parse_sasl_bind_result( LDAP *ld,
LDAPMessage *res, struct berval **servercredp, int freeit );
LDAP_API(int) LDAP_CALL ldap_parse_result( LDAP *ld, LDAPMessage *res,
int *errcodep, char **matcheddnp, char **errmsgp, char ***referralsp,
LDAPControl ***serverctrlsp, int freeit );
LDAP_API(int) LDAP_CALL ldap_parse_extended_result( LDAP *ld, LDAPMessage *res,
char **retoidp, struct berval **retdatap, int freeit );
LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_message( LDAP *ld,
LDAPMessage *res );
LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_message( LDAP *ld,
LDAPMessage *msg );
LDAP_API(int) LDAP_CALL ldap_count_messages( LDAP *ld, LDAPMessage *res );
LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_reference( LDAP *ld,
LDAPMessage *res );
LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_reference( LDAP *ld,
LDAPMessage *ref );
LDAP_API(int) LDAP_CALL ldap_count_references( LDAP *ld, LDAPMessage *res );
LDAP_API(int) LDAP_CALL ldap_parse_reference( LDAP *ld, LDAPMessage *ref,
char ***referralsp, LDAPControl ***serverctrlsp, int freeit );
LDAP_API(int) LDAP_CALL ldap_get_entry_controls( LDAP *ld, LDAPMessage *entry,
LDAPControl ***serverctrlsp );
LDAP_API(void) LDAP_CALL ldap_control_free( LDAPControl *ctrl );
LDAP_API(void) LDAP_CALL ldap_controls_free( LDAPControl **ctrls );
/*
* virtual list view support
*/
LDAP_API(int) LDAP_CALL ldap_create_virtuallist_control( LDAP *ld,
LDAPVirtualList *ldvlistp, LDAPControl **ctrlp );
LDAP_API(int) LDAP_CALL ldap_parse_virtuallist_control( LDAP *ld,
LDAPControl **ctrls, unsigned long *target_posp,
unsigned long *list_sizep, int *errcodep );
/*
* entry sorting routines
*/
LDAP_API(int) LDAP_CALL ldap_keysort_entries( LDAP *ld, LDAPMessage **chain,
void *arg, LDAP_KEYGEN_CALLBACK *gen, LDAP_KEYCMP_CALLBACK *cmp, LDAP_KEYFREE_CALLBACK *fre);
LDAP_API(int) LDAP_CALL ldap_multisort_entries( LDAP *ld, LDAPMessage **chain,
char **attr, LDAP_CMP_CALLBACK *cmp);
LDAP_API(int) LDAP_CALL ldap_sort_entries( LDAP *ld, LDAPMessage **chain,
char *attr, LDAP_CMP_CALLBACK *cmp);
LDAP_API(int) LDAP_CALL ldap_sort_values( LDAP *ld, char **vals,
LDAP_VALCMP_CALLBACK *cmp);
LDAP_API(int) LDAP_C LDAP_CALLBACK ldap_sort_strcasecmp( const char **a,
const char **b );
/*
* getfilter routines
*/
LDAP_API(LDAPFiltDesc *) LDAP_CALL ldap_init_getfilter( char *fname );
LDAP_API(LDAPFiltDesc *) LDAP_CALL ldap_init_getfilter_buf( char *buf,
long buflen );
LDAP_API(LDAPFiltInfo *) LDAP_CALL ldap_getfirstfilter( LDAPFiltDesc *lfdp,
char *tagpat, char *value );
LDAP_API(LDAPFiltInfo *) LDAP_CALL ldap_getnextfilter( LDAPFiltDesc *lfdp );
LDAP_API(int) LDAP_CALL ldap_set_filter_additions( LDAPFiltDesc *lfdp,
char *prefix, char *suffix );
LDAP_API(int) LDAP_CALL ldap_create_filter( char *buf, unsigned long buflen,
char *pattern, char *prefix, char *suffix, char *attr,
char *value, char **valwords );
LDAP_API(void) LDAP_CALL ldap_getfilter_free( LDAPFiltDesc *lfdp );
/*
* friendly routines
*/
LDAP_API(char *) LDAP_CALL ldap_friendly_name( char *filename, char *name,
FriendlyMap *map );
LDAP_API(void) LDAP_CALL ldap_free_friendlymap( FriendlyMap *map );
/*
* ldap url routines
*/
LDAP_API(int) LDAP_CALL ldap_is_ldap_url( char *url );
LDAP_API(int) LDAP_CALL ldap_url_parse( char *url, LDAPURLDesc **ludpp );
LDAP_API(void) LDAP_CALL ldap_free_urldesc( LDAPURLDesc *ludp );
LDAP_API(int) LDAP_CALL ldap_url_search( LDAP *ld, char *url, int attrsonly );
LDAP_API(int) LDAP_CALL ldap_url_search_s( LDAP *ld, char *url, int attrsonly,
LDAPMessage **res );
LDAP_API(int) LDAP_CALL ldap_url_search_st( LDAP *ld, char *url, int attrsonly,
struct timeval *timeout, LDAPMessage **res );
/*
* routines for creating persistent search controls and for handling
* "entry changed notification" controls (an LDAPv3 extension).
*/
#define LDAP_CHANGETYPE_ADD 1
#define LDAP_CHANGETYPE_DELETE 2
#define LDAP_CHANGETYPE_MODIFY 4
#define LDAP_CHANGETYPE_MODDN 8
#define LDAP_CHANGETYPE_ANY (1|2|4|8)
LDAP_API(int) LDAP_CALL ldap_create_persistentsearch_control( LDAP *ld,
int changetypes, int changesonly, int return_echg_ctls,
char ctl_iscritical, LDAPControl **ctrlp );
LDAP_API(int) LDAP_CALL ldap_parse_entrychange_control( LDAP *ld,
LDAPControl **ctrls, int *chgtypep, char **prevdnp,
int *chgnumpresentp, long *chgnump );
typedef struct ldapmemcache LDAPMemCache; /* opaque in-memory cache handle */
/*
* cacheing routines
*/
LDAP_API(int) LDAP_CALL ldap_memcache_init( unsigned long ttl,
unsigned long size, char **baseDNs, struct ldap_thread_fns *thread_fns,
LDAPMemCache **cachep );
LDAP_API(int) LDAP_CALL ldap_memcache_set( LDAP *ld, LDAPMemCache *cache );
LDAP_API(int) LDAP_CALL ldap_memcache_get( LDAP *ld, LDAPMemCache **cachep );
LDAP_API(void) LDAP_CALL ldap_memcache_flush( LDAPMemCache *cache, char *dn,
int scope );
LDAP_API(void) LDAP_CALL ldap_memcache_destroy( LDAPMemCache *cache );
LDAP_API(void) LDAP_CALL ldap_memcache_update( LDAPMemCache *cache );
/*
* DNS resolver callbacks. for now, we only use gethostbyname()
*/
typedef struct LDAPHostEnt {
char *ldaphe_name; /* official name of host */
char **ldaphe_aliases; /* alias list */
int ldaphe_addrtype; /* host address type */
int ldaphe_length; /* length of address */
char **ldaphe_addr_list; /* list of addresses from name server */
} LDAPHostEnt;
typedef LDAPHostEnt * (LDAP_C LDAP_CALLBACK LDAP_DNSFN_GETHOSTBYNAME)(
const char *name, LDAPHostEnt *result, char *buffer,
int buflen, int *statusp, void *extradata );
typedef LDAPHostEnt * (LDAP_C LDAP_CALLBACK LDAP_DNSFN_GETHOSTBYADDR)(
const char *addr, int length, int type, LDAPHostEnt *result,
char *buffer, int buflen, int *statusp, void *extradata );
struct ldap_dns_fns {
void *lddnsfn_extradata;
int lddnsfn_bufsize;
LDAP_DNSFN_GETHOSTBYNAME *lddnsfn_gethostbyname;
LDAP_DNSFN_GETHOSTBYADDR *lddnsfn_gethostbyaddr;
};
#define LDAP_OPT_DNS_FN_PTRS 96 /* Netscape extension */
/************** the functions in this section are experimental ***************/
/*
* libldap memory allocation callback functions. These are global and can
* not be set on a per-LDAP session handle basis. Install your own
* functions by making a call like this:
* ldap_set_option( NULL, LDAP_OPT_MEMALLOC_FN_PTRS, &memalloc_fns );
*
* look in lber.h for the function typedefs themselves.
*/
struct ldap_memalloc_fns {
LDAP_MALLOC_CALLBACK *ldapmem_malloc;
LDAP_CALLOC_CALLBACK *ldapmem_calloc;
LDAP_REALLOC_CALLBACK *ldapmem_realloc;
LDAP_FREE_CALLBACK *ldapmem_free;
};
#define LDAP_OPT_MEMALLOC_FN_PTRS 97 /* Netscape extension */
#define LDAP_OPT_RECONNECT 98 /* Netscape extension */
#define LDAP_OPT_EXTRA_THREAD_FN_PTRS 101 /* Netscape extension */
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_TRYLOCK_CALLBACK)( void * );
typedef void *(LDAP_C LDAP_CALLBACK LDAP_TF_SEMA_ALLOC_CALLBACK)( void );
typedef void (LDAP_C LDAP_CALLBACK LDAP_TF_SEMA_FREE_CALLBACK)( void * );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_SEMA_WAIT_CALLBACK)( void * );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_SEMA_POST_CALLBACK)( void * );
struct ldap_extra_thread_fns {
LDAP_TF_MUTEX_TRYLOCK_CALLBACK *ltf_mutex_trylock;
LDAP_TF_SEMA_ALLOC_CALLBACK *ltf_sema_alloc;
LDAP_TF_SEMA_FREE_CALLBACK *ltf_sema_free;
LDAP_TF_SEMA_WAIT_CALLBACK *ltf_sema_wait;
LDAP_TF_SEMA_POST_CALLBACK *ltf_sema_post;
};
#define LDAP_OPT_ASYNC_CONNECT 99 /* Netscape extension */
#define LDAP_OPT_ASYNC_RECONNECT_FN_PTR 100 /* Netscape extension */
/*
* this function sets the connect status of the ld so that a client
* can do dns and connect, and then tell the sdk to ignore the connect phase
*/
LDAP_API(int) LDAP_CALL ldap_set_connected( LDAP *ld,
const int currentstatus );
/*
* callback definition for reconnect request from a referral
*/
typedef int( LDAP_C LDAP_CALLBACK LDAP_ASYNC_RECONNECT)( LBER_SOCKET,
struct sockaddr *,
int );
struct ldap_async_connect_fns
{
LDAP_ASYNC_RECONNECT *lac_reconnect;
};
/************************ end of experimental section ************************/
/********** the functions, etc. below are unsupported at this time ***********/
#ifdef LDAP_DNS
#define LDAP_OPT_DNS 12
#endif
#define LDAP_OPT_HOST_NAME 48 /* MSFT extension */
#define LDAP_OPT_RETURN_REFERRALS 51 /* MSFT extension */
/*
* generalized bind
*/
LDAP_API(int) LDAP_CALL ldap_bind( LDAP *ld, const char *who,
const char *passwd, int authmethod );
LDAP_API(int) LDAP_CALL ldap_bind_s( LDAP *ld, const char *who,
const char *cred, int method );
/*
* experimental DN format support
*/
LDAP_API(int) LDAP_CALL ldap_is_dns_dn( const char *dn );
/*
* user friendly naming/searching routines
*/
LDAP_API(int) LDAP_CALL ldap_ufn_search_c( LDAP *ld, char *ufn,
char **attrs, int attrsonly, LDAPMessage **res,
LDAP_CANCELPROC_CALLBACK *cancelproc, void *cancelparm );
LDAP_API(int) LDAP_CALL ldap_ufn_search_ct( LDAP *ld, char *ufn,
char **attrs, int attrsonly, LDAPMessage **res,
LDAP_CANCELPROC_CALLBACK *cancelproc, void *cancelparm,
char *tag1, char *tag2, char *tag3 );
LDAP_API(int) LDAP_CALL ldap_ufn_search_s( LDAP *ld, char *ufn,
char **attrs, int attrsonly, LDAPMessage **res );
LDAP_API(LDAPFiltDesc *) LDAP_CALL ldap_ufn_setfilter( LDAP *ld, char *fname );
LDAP_API(void) LDAP_CALL ldap_ufn_setprefix( LDAP *ld, char *prefix );
LDAP_API(int) LDAP_C ldap_ufn_timeout( void *tvparam );
/*
* utility routines
*/
LDAP_API(int) LDAP_CALL ldap_charray_add( char ***a, char *s );
LDAP_API(int) LDAP_CALL ldap_charray_merge( char ***a, char **s );
LDAP_API(void) LDAP_CALL ldap_charray_free( char **array );
LDAP_API(int) LDAP_CALL ldap_charray_inlist( char **a, char *s );
LDAP_API(char **) LDAP_CALL ldap_charray_dup( char **a );
LDAP_API(char **) LDAP_CALL ldap_str2charray( char *str, char *brkstr );
LDAP_API(int) LDAP_CALL ldap_charray_position( char **a, char *s );
/*
* UTF-8 routines (should these move into libnls?)
*/
/* number of bytes in character */
LDAP_API(int) LDAP_CALL ldap_utf8len( const char* );
/* find next character */
LDAP_API(char*) LDAP_CALL ldap_utf8next( char* );
/* find previous character */
LDAP_API(char*) LDAP_CALL ldap_utf8prev( char* );
/* copy one character */
LDAP_API(int) LDAP_CALL ldap_utf8copy( char* dst, const char* src );
/* total number of characters */
LDAP_API(size_t) LDAP_CALL ldap_utf8characters( const char* );
/* get one UCS-4 character, and move *src to the next character */
LDAP_API(unsigned long) LDAP_CALL ldap_utf8getcc( const char** src );
/* UTF-8 aware strtok_r() */
LDAP_API(char*) LDAP_CALL ldap_utf8strtok_r( char* src, const char* brk, char** next);
/* like isalnum(*s) in the C locale */
LDAP_API(int) LDAP_CALL ldap_utf8isalnum( char* s );
/* like isalpha(*s) in the C locale */
LDAP_API(int) LDAP_CALL ldap_utf8isalpha( char* s );
/* like isdigit(*s) in the C locale */
LDAP_API(int) LDAP_CALL ldap_utf8isdigit( char* s );
/* like isxdigit(*s) in the C locale */
LDAP_API(int) LDAP_CALL ldap_utf8isxdigit(char* s );
/* like isspace(*s) in the C locale */
LDAP_API(int) LDAP_CALL ldap_utf8isspace( char* s );
#define LDAP_UTF8LEN(s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8len (s) : 1)
#define LDAP_UTF8NEXT(s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8next(s) : (s)+1)
#define LDAP_UTF8INC(s) ((0x80 & *(unsigned char*)(s)) ? s=ldap_utf8next(s) : ++s)
#define LDAP_UTF8PREV(s) ldap_utf8prev(s)
#define LDAP_UTF8DEC(s) (s=ldap_utf8prev(s))
#define LDAP_UTF8COPY(d,s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8copy(d,s) : ((*(d) = *(s)), 1))
#define LDAP_UTF8GETCC(s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8getcc (&s) : *s++)
#define LDAP_UTF8GETC(s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8getcc ((const char**)&s) : *s++)
/*
* functions that have been replaced by new improved ones
*/
/* use ldap_create_filter() instead of ldap_build_filter() */
LDAP_API(void) LDAP_CALL ldap_build_filter( char *buf, unsigned long buflen,
char *pattern, char *prefix, char *suffix, char *attr,
char *value, char **valwords );
/* use ldap_set_filter_additions() instead of ldap_setfilteraffixes() */
LDAP_API(void) LDAP_CALL ldap_setfilteraffixes( LDAPFiltDesc *lfdp,
char *prefix, char *suffix );
/* cache strategies */
#define LDAP_CACHE_CHECK 0
#define LDAP_CACHE_POPULATE 1
#define LDAP_CACHE_LOCALDB 2
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_BIND_CALLBACK)( LDAP *, int,
unsigned long, const char *, struct berval *, int );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_UNBIND_CALLBACK)( LDAP *, int,
unsigned long );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_SEARCH_CALLBACK)( LDAP *,
int, unsigned long, const char *, int, const char LDAP_CALLBACK *,
char **, int );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_COMPARE_CALLBACK)( LDAP *, int,
unsigned long, const char *, const char *, struct berval * );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_ADD_CALLBACK)( LDAP *, int,
unsigned long, const char *, LDAPMod ** );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_DELETE_CALLBACK)( LDAP *, int,
unsigned long, const char * );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_MODIFY_CALLBACK)( LDAP *, int,
unsigned long, const char *, LDAPMod ** );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_MODRDN_CALLBACK)( LDAP *, int,
unsigned long, const char *, const char *, int );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_RESULT_CALLBACK)( LDAP *, int,
int, struct timeval *, LDAPMessage ** );
typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_FLUSH_CALLBACK)( LDAP *,
const char *, const char * );
struct ldap_cache_fns {
void *lcf_private;
LDAP_CF_BIND_CALLBACK *lcf_bind;
LDAP_CF_UNBIND_CALLBACK *lcf_unbind;
LDAP_CF_SEARCH_CALLBACK *lcf_search;
LDAP_CF_COMPARE_CALLBACK *lcf_compare;
LDAP_CF_ADD_CALLBACK *lcf_add;
LDAP_CF_DELETE_CALLBACK *lcf_delete;
LDAP_CF_MODIFY_CALLBACK *lcf_modify;
LDAP_CF_MODRDN_CALLBACK *lcf_modrdn;
LDAP_CF_RESULT_CALLBACK *lcf_result;
LDAP_CF_FLUSH_CALLBACK *lcf_flush;
};
LDAP_API(int) LDAP_CALL ldap_cache_flush( LDAP *ld, const char *dn,
const char *filter );
/*********************** end of unsupported functions ************************/
#ifdef __cplusplus
}
#endif
#endif /* _LDAP_H */

View File

@@ -0,0 +1,68 @@
#ifndef _LDAPLOG_H
#define _LDAPLOG_H
#ifdef __cplusplus
extern "C" {
#endif
#define LDAP_DEBUG_TRACE 0x00001
#define LDAP_DEBUG_PACKETS 0x00002
#define LDAP_DEBUG_ARGS 0x00004
#define LDAP_DEBUG_CONNS 0x00008
#define LDAP_DEBUG_BER 0x00010
#define LDAP_DEBUG_FILTER 0x00020
#define LDAP_DEBUG_CONFIG 0x00040
#define LDAP_DEBUG_ACL 0x00080
#define LDAP_DEBUG_STATS 0x00100
#define LDAP_DEBUG_STATS2 0x00200
#define LDAP_DEBUG_SHELL 0x00400
#define LDAP_DEBUG_PARSE 0x00800
#define LDAP_DEBUG_HOUSE 0x01000
#define LDAP_DEBUG_REPL 0x02000
#define LDAP_DEBUG_ANY 0x04000
#define LDAP_DEBUG_CACHE 0x08000
#define LDAP_DEBUG_PLUGIN 0x10000
/* debugging stuff */
/* Disable by default */
#define LDAPDebug( level, fmt, arg1, arg2, arg3 )
#ifdef LDAP_DEBUG
# undef LDAPDebug
/* SLAPD_LOGGING should not be on for WINSOCK (16-bit Windows) */
# if defined(SLAPD_LOGGING)
# ifdef _WIN32
extern int *module_ldap_debug;
# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
{ \
if ( *module_ldap_debug & level ) { \
slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
} \
}
# else /* _WIN32 */
extern int ldap_debug;
# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
{ \
if ( ldap_debug & level ) { \
slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
} \
}
# endif /* Win32 */
# else /* no SLAPD_LOGGING */
extern void ber_err_print( char * );
extern int ldap_debug;
# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
if ( ldap_debug & level ) { \
char msg[256]; \
sprintf( msg, fmt, arg1, arg2, arg3 ); \
ber_err_print( msg ); \
}
# endif /* SLAPD_LOGGING */
#endif /* LDAP_DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _LDAP_H */

View File

@@ -0,0 +1,158 @@
#ifndef _LDAPROT_H
#define _LDAPROT_H
#ifdef __cplusplus
extern "C" {
#endif
#define LDAP_VERSION1 1
#define LDAP_VERSION2 2
#define LDAP_VERSION3 3
#define LDAP_VERSION LDAP_VERSION2
#define COMPAT20
#define COMPAT30
#if defined(COMPAT20) || defined(COMPAT30)
#define COMPAT
#endif
#define LDAP_URL_PREFIX "ldap://"
#define LDAP_URL_PREFIX_LEN 7
#define LDAPS_URL_PREFIX "ldaps://"
#define LDAPS_URL_PREFIX_LEN 8
#define LDAP_REF_STR "Referral:\n"
#define LDAP_REF_STR_LEN 10
/*
* specific LDAP instantiations of BER types we know about
*/
/* general stuff */
#define LDAP_TAG_MESSAGE 0x30L /* tag is 16 + constructed bit */
#define OLD_LDAP_TAG_MESSAGE 0x10L /* forgot the constructed bit */
#define LDAP_TAG_MSGID 0x02L /* INTEGER */
#define LDAP_TAG_LDAPDN 0x04L /* OCTET STRING */
#define LDAP_TAG_CONTROLS 0xa0L /* context specific + constructed + 0 */
#define LDAP_TAG_REFERRAL 0xa3L /* context specific + constructed */
#define LDAP_TAG_NEWSUPERIOR 0x80L /* context specific + primitive */
#define LDAP_TAG_MRA_OID 0x81L /* context specific + primitive */
#define LDAP_TAG_MRA_TYPE 0x82L /* context specific + primitive */
#define LDAP_TAG_MRA_VALUE 0x83L /* context specific + primitive */
#define LDAP_TAG_MRA_DNATTRS 0x84L /* context specific + primitive */
#define LDAP_TAG_EXOP_REQ_OID 0x80L /* context specific + primitive */
#define LDAP_TAG_EXOP_REQ_VALUE 0x81L /* context specific + primitive */
#define LDAP_TAG_EXOP_RES_OID 0x8aL /* context specific + primitive */
#define LDAP_TAG_EXOP_RES_VALUE 0x8bL /* context specific + primitive */
#define LDAP_TAG_SK_MATCHRULE 0x80L /* context specific + primitive */
#define LDAP_TAG_SK_REVERSE 0x81L /* context specific + primitive */
#define LDAP_TAG_SR_ATTRTYPE 0x80L /* context specific + primitive */
#define LDAP_TAG_SASL_RES_CREDS 0x87L /* context specific + primitive */
#define LDAP_TAG_VLV_BY_INDEX 0xa0L /* context specific + constructed + 0 */
#define LDAP_TAG_VLV_BY_VALUE 0x81L /* context specific + primitive + 1 */
/* possible operations a client can invoke */
#define LDAP_REQ_BIND 0x60L /* application + constructed */
#define LDAP_REQ_UNBIND 0x42L /* application + primitive */
#define LDAP_REQ_SEARCH 0x63L /* application + constructed */
#define LDAP_REQ_MODIFY 0x66L /* application + constructed */
#define LDAP_REQ_ADD 0x68L /* application + constructed */
#define LDAP_REQ_DELETE 0x4aL /* application + primitive */
#define LDAP_REQ_MODRDN 0x6cL /* application + constructed */
#define LDAP_REQ_MODDN 0x6cL /* application + constructed */
#define LDAP_REQ_RENAME 0x6cL /* application + constructed */
#define LDAP_REQ_COMPARE 0x6eL /* application + constructed */
#define LDAP_REQ_ABANDON 0x50L /* application + primitive */
#define LDAP_REQ_EXTENDED 0x77L /* application + constructed */
/* U-M LDAP release 3.0 compatibility stuff */
#define LDAP_REQ_UNBIND_30 0x62L
#define LDAP_REQ_DELETE_30 0x6aL
#define LDAP_REQ_ABANDON_30 0x70L
/*
* old broken stuff for backwards compatibility - forgot application tag
* and constructed/primitive bit
*/
#define OLD_LDAP_REQ_BIND 0x00L
#define OLD_LDAP_REQ_UNBIND 0x02L
#define OLD_LDAP_REQ_SEARCH 0x03L
#define OLD_LDAP_REQ_MODIFY 0x06L
#define OLD_LDAP_REQ_ADD 0x08L
#define OLD_LDAP_REQ_DELETE 0x0aL
#define OLD_LDAP_REQ_MODRDN 0x0cL
#define OLD_LDAP_REQ_MODDN 0x0cL
#define OLD_LDAP_REQ_COMPARE 0x0eL
#define OLD_LDAP_REQ_ABANDON 0x10L
/* old broken stuff for backwards compatibility */
#define OLD_LDAP_RES_BIND 0x01L
#define OLD_LDAP_RES_SEARCH_ENTRY 0x04L
#define OLD_LDAP_RES_SEARCH_RESULT 0x05L
#define OLD_LDAP_RES_MODIFY 0x07L
#define OLD_LDAP_RES_ADD 0x09L
#define OLD_LDAP_RES_DELETE 0x0bL
#define OLD_LDAP_RES_MODRDN 0x0dL
#define OLD_LDAP_RES_MODDN 0x0dL
#define OLD_LDAP_RES_COMPARE 0x0fL
/* 3.0 compatibility auth methods */
#define LDAP_AUTH_SIMPLE_30 0xa0L /* context specific + constructed */
#define LDAP_AUTH_KRBV41_30 0xa1L /* context specific + constructed */
#define LDAP_AUTH_KRBV42_30 0xa2L /* context specific + constructed */
/* old broken stuff */
#define OLD_LDAP_AUTH_SIMPLE 0x00L
#define OLD_LDAP_AUTH_KRBV4 0x01L
#define OLD_LDAP_AUTH_KRBV42 0x02L
/* 3.0 compatibility filter types */
#define LDAP_FILTER_PRESENT_30 0xa7L /* context specific + constructed */
/* filter types */
#define LDAP_FILTER_AND 0xa0L /* context specific + constructed */
#define LDAP_FILTER_OR 0xa1L /* context specific + constructed */
#define LDAP_FILTER_NOT 0xa2L /* context specific + constructed */
#define LDAP_FILTER_EQUALITY 0xa3L /* context specific + constructed */
#define LDAP_FILTER_SUBSTRINGS 0xa4L /* context specific + constructed */
#define LDAP_FILTER_GE 0xa5L /* context specific + constructed */
#define LDAP_FILTER_LE 0xa6L /* context specific + constructed */
#define LDAP_FILTER_PRESENT 0x87L /* context specific + primitive */
#define LDAP_FILTER_APPROX 0xa8L /* context specific + constructed */
#define LDAP_FILTER_EXTENDED 0xa9L /* context specific + constructed */
/* old broken stuff */
#define OLD_LDAP_FILTER_AND 0x00L
#define OLD_LDAP_FILTER_OR 0x01L
#define OLD_LDAP_FILTER_NOT 0x02L
#define OLD_LDAP_FILTER_EQUALITY 0x03L
#define OLD_LDAP_FILTER_SUBSTRINGS 0x04L
#define OLD_LDAP_FILTER_GE 0x05L
#define OLD_LDAP_FILTER_LE 0x06L
#define OLD_LDAP_FILTER_PRESENT 0x07L
#define OLD_LDAP_FILTER_APPROX 0x08L
/* substring filter component types */
#define LDAP_SUBSTRING_INITIAL 0x80L /* context specific */
#define LDAP_SUBSTRING_ANY 0x81L /* context specific */
#define LDAP_SUBSTRING_FINAL 0x82L /* context specific */
/* extended filter component types */
#define LDAP_FILTER_EXTENDED_OID 0x81L /* context specific */
#define LDAP_FILTER_EXTENDED_TYPE 0x82L /* context specific */
#define LDAP_FILTER_EXTENDED_VALUE 0x83L /* context specific */
#define LDAP_FILTER_EXTENDED_DNATTRS 0x84L /* context specific */
/* 3.0 compatibility substring filter component types */
#define LDAP_SUBSTRING_INITIAL_30 0xa0L /* context specific */
#define LDAP_SUBSTRING_ANY_30 0xa1L /* context specific */
#define LDAP_SUBSTRING_FINAL_30 0xa2L /* context specific */
/* old broken stuff */
#define OLD_LDAP_SUBSTRING_INITIAL 0x00L
#define OLD_LDAP_SUBSTRING_ANY 0x01L
#define OLD_LDAP_SUBSTRING_FINAL 0x02L
#ifdef __cplusplus
}
#endif
#endif /* _LDAPROT_H */

View File

@@ -0,0 +1,57 @@
/*
* Copyright (c) 1996 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
#ifndef _LDIF_H
#define _LDIF_H
#ifdef __cplusplus
extern "C" {
#endif
#define LDIF_MAX_LINE_WIDTH 76 /* maximum length of LDIF lines */
/*
* Macro to calculate maximum number of bytes that the base64 equivalent
* of an item that is "vlen" bytes long will take up. Base64 encoding
* uses one byte for every six bits in the value plus up to two pad bytes.
*/
#define LDIF_BASE64_LEN(vlen) (((vlen) * 4 / 3 ) + 3)
/*
* Macro to calculate maximum size that an LDIF-encoded type (length
* tlen) and value (length vlen) will take up: room for type + ":: " +
* first newline + base64 value + continued lines. Each continued line
* needs room for a newline and a leading space character.
*/
#define LDIF_SIZE_NEEDED(tlen,vlen) \
((tlen) + 4 + LDIF_BASE64_LEN(vlen) \
+ ((LDIF_BASE64_LEN(vlen) + tlen + 3) / LDIF_MAX_LINE_WIDTH * 2 ))
int ldif_parse_line( char *line, char **type, char **value, int *vlen);
char * ldif_getline( char **next );
void ldif_put_type_and_value( char **out, char *t, char *val, int vlen );
void ldif_put_type_and_value_nowrap( char **out, char *t, char *val, int vlen );
char *ldif_type_and_value( char *type, char *val, int vlen );
char *ldif_type_and_value_nowrap( char *type, char *val, int vlen );
int ldif_base64_decode( char *src, unsigned char *dst );
int ldif_base64_encode( unsigned char *src, char *dst, int srclen,
int lenused );
int ldif_base64_encode_nowrap( unsigned char *src, char *dst, int srclen,
int lenused );
char *ldif_get_entry( FILE *fp, int *lineno );
#ifdef __cplusplus
}
#endif
#endif /* _LDIF_H */

View File

@@ -0,0 +1,362 @@
/*
* Copyright (c) 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
#ifndef _PORTABLE_H
#define _PORTABLE_H
/*
* portable.h for LDAP -- this is where we define common stuff to make
* life easier on various Unix systems.
*
* Unless you are porting LDAP to a new platform, you should not need to
* edit this file.
*/
#ifndef SYSV
#if defined( hpux ) || defined( sunos5 ) || defined ( sgi ) || defined( SVR4 )
#define SYSV
#endif
#endif
/*
* under System V, use sysconf() instead of getdtablesize
*/
#if !defined( USE_SYSCONF ) && defined( SYSV )
#define USE_SYSCONF
#endif
/*
* under System V, daemons should use setsid() instead of detaching from their
* tty themselves
*/
#if !defined( USE_SETSID ) && defined( SYSV )
#define USE_SETSID
#endif
/*
* System V has socket options in filio.h
*/
#if !defined( NEED_FILIO ) && defined( SYSV ) && !defined( hpux ) && !defined( AIX )
#define NEED_FILIO
#endif
/*
* use lockf() under System V
*/
#if !defined( USE_LOCKF ) && ( defined( SYSV ) || defined( aix ))
#define USE_LOCKF
#endif
/*
* on many systems, we should use waitpid() instead of waitN()
*/
#if !defined( USE_WAITPID ) && ( defined( SYSV ) || defined( sunos4 ) || defined( ultrix ) || defined( aix ))
#define USE_WAITPID
#endif
/*
* define the wait status argument type
*/
#if ( defined( SunOS ) && SunOS < 40 ) || defined( nextstep )
#define WAITSTATUSTYPE union wait
#else
#define WAITSTATUSTYPE int
#endif
/*
* define the flags for wait
*/
#ifdef sunos5
#define WAIT_FLAGS ( WNOHANG | WUNTRACED | WCONTINUED )
#else
#define WAIT_FLAGS ( WNOHANG | WUNTRACED )
#endif
/*
* defined the options for openlog (syslog)
*/
#ifdef ultrix
#define OPENLOG_OPTIONS LOG_PID
#else
#define OPENLOG_OPTIONS ( LOG_PID | LOG_NOWAIT )
#endif
/*
* some systems don't have the BSD re_comp and re_exec routines
*/
#ifndef NEED_BSDREGEX
#if ( defined( SYSV ) || defined( VMS ) || defined( netbsd ) || defined( freebsd ) || defined( linux )) && !defined(sgi)
#define NEED_BSDREGEX
#endif
#endif
/*
* many systems do not have the setpwfile() library routine... we just
* enable use for those systems we know have it.
*/
#ifndef HAVE_SETPWFILE
#if defined( sunos4 ) || defined( ultrix ) || defined( OSF1 )
#define HAVE_SETPWFILE
#endif
#endif
/*
* Are sys_errlist and sys_nerr declared in stdio.h?
*/
#ifndef SYSERRLIST_IN_STDIO
#if defined( freebsd )
#define SYSERRLIST_IN_STDIO
#endif
#endif
/*
* for select()
*/
#if !defined(WINSOCK) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)
#if defined(hpux) || defined(LINUX2_0)
#include <sys/time.h>
#else
#include <sys/select.h>
#endif
#if !defined(FD_SET)
#define NFDBITS 32
#define FD_SETSIZE 32
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
#endif /* !FD_SET */
#endif /* !WINSOCK && !_WINDOWS && !macintosh */
/*
* for connect() -- must we block signals when calling connect()? This
* is necessary on some buggy UNIXes.
*/
#if !defined(LDAP_CONNECT_MUST_NOT_BE_INTERRUPTED) && \
( defined(AIX) || defined(IRIX) || defined(HPUX) || defined(SUNOS4) \
|| defined(SOLARIS))
#define LDAP_CONNECT_MUST_NOT_BE_INTERRUPTED
#endif
/*
* for signal() -- what do signal handling functions return?
*/
#ifndef SIG_FN
#ifdef sunos5
# define SIG_FN void /* signal-catching functions return void */
#else /* sunos5 */
# ifdef BSD
# if (BSD >= 199006) || defined(NeXT) || defined(OSF1) || defined(sun) || defined(ultrix) || defined(apollo) || defined(POSIX_SIGNALS)
# define SIG_FN void /* signal-catching functions return void */
# else
# define SIG_FN int /* signal-catching functions return int */
# endif
# else /* BSD */
# define SIG_FN void /* signal-catching functions return void */
# endif /* BSD */
#endif /* sunos5 */
#endif /* SIG_FN */
/*
* toupper and tolower macros are different under bsd and sys v
*/
#if defined( SYSV ) && !defined( hpux )
#define TOUPPER(c) (isascii(c) && islower(c) ? _toupper(c) : c)
#define TOLOWER(c) (isascii(c) && isupper(c) ? _tolower(c) : c)
#else
#define TOUPPER(c) (isascii(c) && islower(c) ? toupper(c) : c)
#define TOLOWER(c) (isascii(c) && isupper(c) ? tolower(c) : c)
#endif
/*
* put a cover on the tty-related ioctl calls we need to use
*/
#if defined( NeXT ) || (defined(SunOS) && SunOS < 40)
#define TERMIO_TYPE struct sgttyb
#define TERMFLAG_TYPE int
#define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop))
#define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop))
#define GETFLAGS( tio ) (tio).sg_flags
#define SETFLAGS( tio, flags ) (tio).sg_flags = (flags)
#else
#define USE_TERMIOS
#define TERMIO_TYPE struct termios
#define TERMFLAG_TYPE tcflag_t
#define GETATTR( fd, tiop ) tcgetattr((fd), (tiop))
#define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop))
#define GETFLAGS( tio ) (tio).c_lflag
#define SETFLAGS( tio, flags ) (tio).c_lflag = (flags)
#endif
#if ( !defined( HPUX9 )) && ( !defined( sunos4 )) && ( !defined( SNI )) && \
( !defined( HAVE_TIME_R ))
#define HAVE_TIME_R
#endif
#if defined( sunos5 ) || defined( aix )
#define HAVE_GETPWNAM_R
#define HAVE_GETGRNAM_R
#endif
#if defined(SNI) || defined(LINUX1_2)
int strcasecmp(const char *, const char *);
#ifdef SNI
int strncasecmp(const char *, const char *, int);
#endif /* SNI */
#ifdef LINUX1_2
int strncasecmp(const char *, const char *, size_t);
#endif /* LINUX1_2 */
#endif /* SNI || LINUX1_2 */
#if defined(_WINDOWS) || defined(macintosh) || defined(XP_OS2)
#define GETHOSTBYNAME( n, r, b, l, e ) gethostbyname( n )
#define CTIME( c, b, l ) ctime( c )
#define STRTOK( s1, s2, l ) strtok( s1, s2 )
#else /* UNIX */
#if defined(sgi) || defined(HPUX9) || defined(LINUX1_2) || defined(SCOOS) || \
defined(UNIXWARE) || defined(SUNOS4) || defined(SNI) || defined(BSDI) || \
defined(NCR) || defined(OSF1) || defined(NEC) || \
( defined(HPUX10) && !defined(_REENTRANT)) || defined(HPUX11) || \
defined(UnixWare) || defined(LINUX2_0)
#define GETHOSTBYNAME( n, r, b, l, e ) gethostbyname( n )
#elif defined(AIX)
/* Maybe this is for another version of AIX?
Commenting out for AIX 4.1 for Nova
Replaced with following to lines, stolen from the #else below
#define GETHOSTBYNAME_BUF_T struct hostent_data
*/
typedef char GETHOSTBYNAME_buf_t [BUFSIZ /* XXX might be too small */];
#define GETHOSTBYNAME_BUF_T GETHOSTBYNAME_buf_t
#define GETHOSTBYNAME( n, r, b, l, e ) \
(memset (&b, 0, l), gethostbyname_r (n, r, &b) ? NULL : r)
#elif defined(HPUX10)
#define GETHOSTBYNAME_BUF_T struct hostent_data
#define GETHOSTBYNAME( n, r, b, l, e ) nsldapi_compat_gethostbyname_r( n, r, (char *)&b, l, e )
#else
#include <stdio.h> /* BUFSIZ */
typedef char GETHOSTBYNAME_buf_t [BUFSIZ /* XXX might be too small */];
#define GETHOSTBYNAME_BUF_T GETHOSTBYNAME_buf_t
#define GETHOSTBYNAME( n, r, b, l, e ) gethostbyname_r( n, r, b, l, e )
#endif
#if defined(HPUX9) || defined(LINUX1_2) || defined(SUNOS4) || defined(SNI) || \
defined(SCOOS) || defined(BSDI) || defined(NCR) || \
defined(NEC) || ( defined(HPUX10) && !defined(_REENTRANT))
#define CTIME( c, b, l ) ctime( c )
#elif defined(HPUX10) && defined(_REENTRANT)
#define CTIME( c, b, l ) nsldapi_compat_ctime_r( c, b, l )
#elif defined( IRIX6_2 ) || defined( IRIX6_3 ) || defined(UNIXWARE) \
|| defined(OSF1V4) || defined(AIX) || defined(UnixWare) || defined(hpux)
#define CTIME( c, b, l ) ctime_r( c, b )
#elif defined( OSF1V3 )
#define CTIME( c, b, l ) (ctime_r( c, b, l ) ? NULL : b)
#else
#define CTIME( c, b, l ) ctime_r( c, b, l )
#endif
#if defined(hpux9) || defined(LINUX1_2) || defined(SUNOS4) || defined(SNI) || \
defined(SCOOS) || defined(BSDI) || defined(NCR) || \
defined(NEC) || defined(LINUX2_0)
#define STRTOK( s1, s2, l ) strtok( s1, s2 )
#else
#define HAVE_STRTOK_R
char *strtok_r(char *, const char *, char **);
#define STRTOK( s1, s2, l ) (char *)strtok_r( s1, s2, l )
#endif /* STRTOK */
#endif /* UNIX */
#if defined( ultrix ) || defined( nextstep )
extern char *strdup();
#endif /* ultrix || nextstep */
#if defined( sunos4 ) || defined( OSF1 )
#define BSD_TIME 1 /* for servers/slapd/log.h */
#endif /* sunos4 || osf */
#ifdef SOLARIS
#include <netinet/in.h>
#include <arpa/inet.h> /* for inet_addr() */
#endif /* SOLARIS */
#ifdef SUNOS4
#include <pcfs/pc_dir.h> /* for toupper() */
int fprintf(FILE *, char *, ...);
int fseek(FILE *, long, int);
int fread(char *, int, int, FILE *);
int fclose(FILE *);
int fflush(FILE *);
int rewind(FILE *);
void *memmove(void *, const void *, size_t);
int strcasecmp(char *, char *);
int strncasecmp(char *, char *, int);
time_t time(time_t *);
void perror(char *);
int fputc(char, FILE *);
int fputs(char *, FILE *);
int LDAP_CALL re_exec(char *);
int socket(int, int, int);
void bzero(char *, int);
unsigned long inet_addr(char *);
char * inet_ntoa(struct in_addr);
int getdtablesize();
int connect(int, struct sockaddr *, int);
#endif /* SUNOS4 */
/* #if defined(SUNOS4) || defined(SNI) */
#if defined(SUNOS4)
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
#endif /* SUNOS4 || SNI */
/*
* SAFEMEMCPY is an overlap-safe copy from s to d of n bytes
*/
#ifdef macintosh
#define SAFEMEMCPY( d, s, n ) BlockMoveData( (Ptr)s, (Ptr)d, n )
#else /* macintosh */
#ifdef sunos4
#define SAFEMEMCPY( d, s, n ) bcopy( s, d, n )
#else /* sunos4 */
#define SAFEMEMCPY( d, s, n ) memmove( d, s, n )
#endif /* sunos4 */
#endif /* macintosh */
#ifdef _WINDOWS
#define strcasecmp strcmpi
#define strncasecmp _strnicmp
#define bzero(a, b) memset( a, 0, b )
#define getpid _getpid
#define ioctl ioctlsocket
#define sleep(a) Sleep( a*1000 )
#define EMSGSIZE WSAEMSGSIZE
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EHOSTUNREACH WSAEHOSTUNREACH
#ifndef MAXPATHLEN
#define MAXPATHLEN _MAX_PATH
#endif
#define DS_MAX_NT_SOCKET_CONNECTIONS 2000
#elif defined(XP_OS2)
#define strcasecmp strcmpi
#define strncasecmp strnicmp
#define bzero(a, b) memset( a, 0, b )
#include "dirent.h"
#include <string.h> /*for strcmpi()*/
#include <time.h> /*for ctime()*/
#endif
#endif /* _PORTABLE_H */

View File

@@ -0,0 +1,58 @@
#if defined( macintosh ) || defined( DOS ) || defined( _WINDOWS ) || defined( NEED_BSDREGEX ) || defined( XP_OS2 )
/*
* Copyright (c) 1993 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/*
* regex.h -- includes for regular expression matching routines
* 13 August 1993 Mark C Smith
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "ldap.h"
#if !defined( NEEDPROTOS ) && defined( __STDC__ )
#define NEEDPROTOS
#endif
#ifdef _SLDAPD_H_ /* server build: no need to use LDAP_CALL stuff */
#ifdef LDAP_CALL
#undef LDAP_CALL
#define LDAP_CALL
#endif
#endif
#ifdef NEEDPROTOS
int re_init( void );
void re_lock( void );
int re_unlock( void );
char * LDAP_CALL re_comp( char *pat );
int LDAP_CALL re_exec( char *lp );
void LDAP_CALL re_modw( char *s );
int LDAP_CALL re_subs( char *src, char *dst );
#else /* NEEDPROTOS */
int re_init();
void re_lock();
int re_unlock();
char * LDAP_CALL re_comp();
int LDAP_CALL re_exec();
void LDAP_CALL re_modw();
int LDAP_CALL re_subs();
#endif /* NEEDPROTOS */
#define re_fail( m, p )
#ifdef __cplusplus
}
#endif
#endif /* macintosh or DOS or or _WIN32 or NEED_BSDREGEX */

View File

@@ -0,0 +1,118 @@
/*
* Copyright (c) 1993, 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*
* searchpref.h: display template library defines
* 16 May 1994 by Gordon Good
*/
#ifndef _SRCHPREF_H
#define _SRCHPREF_H
#ifdef __cplusplus
extern "C" {
#endif
/* calling conventions used by library */
#ifndef LDAP_CALL
#if defined( _WINDOWS ) || defined( _WIN32 )
#define LDAP_C __cdecl
#ifndef _WIN32
#define __stdcall _far _pascal
#define LDAP_CALLBACK _loadds
#else
#define LDAP_CALLBACK
#endif /* _WIN32 */
#define LDAP_PASCAL __stdcall
#define LDAP_CALL LDAP_PASCAL
#else /* _WINDOWS */
#define LDAP_C
#define LDAP_CALLBACK
#define LDAP_PASCAL
#define LDAP_CALL
#endif /* _WINDOWS */
#endif /* LDAP_CALL */
struct ldap_searchattr {
char *sa_attrlabel;
char *sa_attr;
/* max 32 matchtypes for now */
unsigned long sa_matchtypebitmap;
char *sa_selectattr;
char *sa_selecttext;
struct ldap_searchattr *sa_next;
};
struct ldap_searchmatch {
char *sm_matchprompt;
char *sm_filter;
struct ldap_searchmatch *sm_next;
};
struct ldap_searchobj {
char *so_objtypeprompt;
unsigned long so_options;
char *so_prompt;
short so_defaultscope;
char *so_filterprefix;
char *so_filtertag;
char *so_defaultselectattr;
char *so_defaultselecttext;
struct ldap_searchattr *so_salist;
struct ldap_searchmatch *so_smlist;
struct ldap_searchobj *so_next;
};
#define NULLSEARCHOBJ ((struct ldap_searchobj *)0)
/*
* global search object options
*/
#define LDAP_SEARCHOBJ_OPT_INTERNAL 0x00000001
#define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option ) \
(((so)->so_options & option ) != 0 )
#define LDAP_SEARCHPREF_VERSION_ZERO 0
#define LDAP_SEARCHPREF_VERSION 1
#define LDAP_SEARCHPREF_ERR_VERSION 1
#define LDAP_SEARCHPREF_ERR_MEM 2
#define LDAP_SEARCHPREF_ERR_SYNTAX 3
#define LDAP_SEARCHPREF_ERR_FILE 4
LDAP_API(int)
LDAP_CALL
ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp );
LDAP_API(int)
LDAP_CALL
ldap_init_searchprefs_buf( char *buf, long buflen,
struct ldap_searchobj **solistp );
LDAP_API(void)
LDAP_CALL
ldap_free_searchprefs( struct ldap_searchobj *solist );
LDAP_API(struct ldap_searchobj *)
LDAP_CALL
ldap_first_searchobj( struct ldap_searchobj *solist );
LDAP_API(struct ldap_searchobj *)
LDAP_CALL
ldap_next_searchobj( struct ldap_searchobj *sollist,
struct ldap_searchobj *so );
#ifdef __cplusplus
}
#endif
#endif /* _SRCHPREF_H */

View File

@@ -0,0 +1,30 @@
DEPTH = ../../../..
UNIXDIRLIST = liblber libldap
include $(DEPTH)/config/rules.mk
all export:: FORCE
@for i in $(UNIXDIRLIST); do \
echo " cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) export ); \
done
libs install:: FORCE
@for i in $(UNIXDIRLIST); do \
echo " cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) install ); \
done
clean clobber:: FORCE
@for i in $(UNIXDIRLIST); do \
echo " cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) clean ); \
done
realclean clobber_all:: FORCE
@for i in $(UNIXDIRLIST); do \
echo " cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean"; \
( cd $$i; $(MAKE) -f Makefile.client $(MFLAGS) realclean ); \
done
FORCE:

View File

@@ -0,0 +1,79 @@
DEPTH = ../../../../..
LDAPSRC = ../..
RM = rm -f
SED = sed
SRCS = decode.c \
encode.c \
io.c \
bprint.c
REALOBJS = $(SRCS:.c=.o)
#OBJS = $(REALOBJS) versiont.o
OBJS = $(REALOBJS)
HDIR = $(LDAPSRC)/include
LIBRARY_NAME = lber
#
# DEFS are included in CFLAGS
#
DEFS = $(PLATFORMCFLAGS) $(LDAP_DEBUG) $(KERBEROS) $(AFSKERBEROS) \
$(UOFM) $(UOFA) $(NO_USERINTERFACE) $(CLDAP) $(NO_CACHE) \
$(LDAP_REFERRALS) $(LDAP_DNS) $(STR_TRANSLATION) \
$(LIBLDAP_CHARSETS) $(LIBLDAP_DEF_CHARSET) \
$(SLAPD_BACKENDS) $(LDBMBACKEND) $(LDBMINCLUDE) $(PHONETIC)
include $(DEPTH)/config/rules.mk
LOCAL_INCLUDES = -I$(PUBLIC)/nspr
INCLUDES += -I$(HDIR)
DEFINES += $(DEFS)
PLATFORMCFLAGS = -DUSE_WAITPID -DNEEDPROTOS
PLATFORMLIBS =
THREADS =
THREADSLIB =
#
# To build slapd (the stand-alone ldap daemon), uncomment the MAKESLAPD
# line and select the SLAPD_BACKENDS you want to use. If you enable the
# LDBM backend, also select one of the LDBM backends.
#
MAKESLAPD = yes
SLAPD_BACKENDS = -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD
LDBMBACKEND = -DLDBM_USE_NDBM
#
# uncomment this line to enable debugging code (a good idea)
#
ifndef BUILD_OPT
LDAP_DEBUG = -DLDAP_DEBUG
endif
#
# uncomment this line to enable support for LDAP referrals in libldap
#
LDAP_REFERRALS = -DLDAP_REFERRALS
###########################################################################
versiont.c: Makefile.client Version.c
@$(RM) $@
@(u="$${USER-root}" v="$(shell cat ../../build/version)" d="$(shell pwd)" \
h="$(shell hostname)" t="$(shell date)"; $(SED) -e "s|%WHEN%|$${t}|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
-e "s|%VERSION%|$${v}|" \
< Version.c > $@)
$(LIBRARY): $(OBJS)
install::
$(INSTALL) -m 444 $(LIBRARY) $(DIST)/ldap/lib
ifdef MKSHLIB
$(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/ldap/bin
endif

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) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* bprint.c - a printing utility for debuging output */
#include <string.h>
#include "lber-int.h"
#ifdef LDAP_DEBUG
/*
* Print arbitrary stuff, for debugging.
*/
#define BPLEN 48
void
lber_bprint( char *data, int len )
{
static char hexdig[] = "0123456789abcdef";
char out[ BPLEN ];
int i = 0;
memset( out, 0, BPLEN );
for ( ;; ) {
if ( len < 1 ) {
char msg[BPLEN + 80];
sprintf( msg, "\t%s\n", ( i == 0 ) ? "(end)" : out );
ber_err_print( msg );
break;
}
#ifndef HEX
if ( isgraph( (unsigned char)*data )) {
out[ i ] = ' ';
out[ i+1 ] = *data;
} else {
#endif
out[ i ] = hexdig[ ( *data & 0xf0 ) >> 4 ];
out[ i+1 ] = hexdig[ *data & 0x0f ];
#ifndef HEX
}
#endif
i += 2;
len--;
data++;
if ( i > BPLEN - 2 ) {
char msg[BPLEN + 80];
sprintf( msg, "\t%s\n", out );
ber_err_print( msg );
memset( out, 0, BPLEN );
i = 0;
continue;
}
out[ i++ ] = ' ';
}
}
#endif
void ber_err_print( char *data )
{
#ifdef USE_DEBUG_WIN
OutputDebugString( data );
#else
fputs( data, stderr );
fflush( stderr );
#endif
}

View File

@@ -0,0 +1,621 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/* decode.c - ber input decoding routines */
#include "lber-int.h"
/* return the tag - LBER_DEFAULT returned means trouble */
unsigned long
LDAP_CALL
ber_get_tag( BerElement *ber )
{
unsigned char xbyte;
unsigned long tag;
char *tagp;
int i;
if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 )
return( LBER_DEFAULT );
if ( (xbyte & LBER_BIG_TAG_MASK) != LBER_BIG_TAG_MASK )
return( (unsigned long) xbyte );
tagp = (char *) &tag;
tagp[0] = xbyte;
for ( i = 1; i < sizeof(long); i++ ) {
if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 )
return( LBER_DEFAULT );
tagp[i] = xbyte;
if ( ! (xbyte & LBER_MORE_TAG_MASK) )
break;
}
/* tag too big! */
if ( i == sizeof(long) )
return( LBER_DEFAULT );
/* want leading, not trailing 0's */
return( tag >> (sizeof(long) - i - 1) );
}
unsigned long
LDAP_CALL
ber_skip_tag( BerElement *ber, unsigned long *len )
{
unsigned long tag;
unsigned char lc;
int noctets, diff;
unsigned long netlen;
/*
* Any ber element looks like this: tag length contents.
* Assuming everything's ok, we return the tag byte (we
* can assume a single byte), and return the length in len.
*
* Assumptions:
* 1) definite lengths
* 2) primitive encodings used whenever possible
*/
/*
* First, we read the tag.
*/
if ( (tag = ber_get_tag( ber )) == LBER_DEFAULT )
return( LBER_DEFAULT );
/*
* Next, read the length. The first byte contains the length of
* the length. If bit 8 is set, the length is the long form,
* otherwise it's the short form. We don't allow a length that's
* greater than what we can hold in an unsigned long.
*/
*len = netlen = 0;
if ( ber_read( ber, (char *) &lc, 1 ) != 1 )
return( LBER_DEFAULT );
if ( lc & 0x80 ) {
noctets = (lc & 0x7f);
if ( noctets > sizeof(unsigned long) )
return( LBER_DEFAULT );
diff = sizeof(unsigned long) - noctets;
if ( ber_read( ber, (char *) &netlen + diff, noctets )
!= noctets )
return( LBER_DEFAULT );
*len = LBER_NTOHL( netlen );
} else {
*len = lc;
}
return( tag );
}
unsigned long
LDAP_CALL
ber_peek_tag( BerElement *ber, unsigned long *len )
{
char *save;
unsigned long tag;
save = ber->ber_ptr;
tag = ber_skip_tag( ber, len );
ber->ber_ptr = save;
return( tag );
}
static int
ber_getnint( BerElement *ber, long *num, int len )
{
int i;
long value;
unsigned char buffer[sizeof(long)];
/*
* The tag and length have already been stripped off. We should
* be sitting right before len bytes of 2's complement integer,
* ready to be read straight into an int. We may have to sign
* extend after we read it in.
*/
if ( len > sizeof(long) )
return( -1 );
/* read into the low-order bytes of netnum */
if ( ber_read( ber, (char *) buffer, len ) != len )
return( -1 );
/* This sets the required sign extension */
if ( len != 0) {
value = 0x80 & buffer[0] ? (-1L) : 0;
} else {
value = 0;
}
for ( i = 0; i < len; i++ )
value = (value << 8) | buffer[i];
*num = value;
return( len );
}
unsigned long
LDAP_CALL
ber_get_int( BerElement *ber, long *num )
{
unsigned long tag, len;
if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT )
return( LBER_DEFAULT );
if ( ber_getnint( ber, num, (int)len ) != len )
return( LBER_DEFAULT );
else
return( tag );
}
unsigned long
LDAP_CALL
ber_get_stringb( BerElement *ber, char *buf, unsigned long *len )
{
unsigned long datalen, tag;
#ifdef STR_TRANSLATION
char *transbuf;
#endif /* STR_TRANSLATION */
if ( (tag = ber_skip_tag( ber, &datalen )) == LBER_DEFAULT )
return( LBER_DEFAULT );
if ( datalen > (*len - 1) )
return( LBER_DEFAULT );
if ( ber_read( ber, buf, datalen ) != datalen )
return( LBER_DEFAULT );
buf[datalen] = '\0';
#ifdef STR_TRANSLATION
if ( datalen > 0 && ( ber->ber_options & LBER_OPT_TRANSLATE_STRINGS )
!= 0 && ber->ber_decode_translate_proc != NULL ) {
transbuf = buf;
++datalen;
if ( (*(ber->ber_decode_translate_proc))( &transbuf, &datalen,
0 ) != 0 ) {
return( LBER_DEFAULT );
}
if ( datalen > *len ) {
NSLBERI_FREE( transbuf );
return( LBER_DEFAULT );
}
SAFEMEMCPY( buf, transbuf, datalen );
NSLBERI_FREE( transbuf );
--datalen;
}
#endif /* STR_TRANSLATION */
*len = datalen;
return( tag );
}
unsigned long
LDAP_CALL
ber_get_stringa( BerElement *ber, char **buf )
{
unsigned long datalen, tag;
if ( (tag = ber_skip_tag( ber, &datalen )) == LBER_DEFAULT )
return( LBER_DEFAULT );
if ( (*buf = (char *)NSLBERI_MALLOC( (size_t)datalen + 1 )) == NULL )
return( LBER_DEFAULT );
if ( ber_read( ber, *buf, datalen ) != datalen )
return( LBER_DEFAULT );
(*buf)[datalen] = '\0';
#ifdef STR_TRANSLATION
if ( datalen > 0 && ( ber->ber_options & LBER_OPT_TRANSLATE_STRINGS )
!= 0 && ber->ber_decode_translate_proc != NULL ) {
++datalen;
if ( (*(ber->ber_decode_translate_proc))( buf, &datalen, 1 )
!= 0 ) {
NSLBERI_FREE( *buf );
return( LBER_DEFAULT );
}
}
#endif /* STR_TRANSLATION */
return( tag );
}
unsigned long
LDAP_CALL
ber_get_stringal( BerElement *ber, struct berval **bv )
{
unsigned long len, tag;
if ( (*bv = (struct berval *)NSLBERI_MALLOC( sizeof(struct berval) ))
== NULL ) {
return( LBER_DEFAULT );
}
if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT ) {
return( LBER_DEFAULT );
}
if ( ((*bv)->bv_val = (char *)NSLBERI_MALLOC( (size_t)len + 1 ))
== NULL ) {
return( LBER_DEFAULT );
}
if ( ber_read( ber, (*bv)->bv_val, len ) != len )
return( LBER_DEFAULT );
((*bv)->bv_val)[len] = '\0';
(*bv)->bv_len = len;
#ifdef STR_TRANSLATION
if ( len > 0 && ( ber->ber_options & LBER_OPT_TRANSLATE_STRINGS ) != 0
&& ber->ber_decode_translate_proc != NULL ) {
++len;
if ( (*(ber->ber_decode_translate_proc))( &((*bv)->bv_val),
&len, 1 ) != 0 ) {
NSLBERI_FREE( (*bv)->bv_val );
return( LBER_DEFAULT );
}
(*bv)->bv_len = len - 1;
}
#endif /* STR_TRANSLATION */
return( tag );
}
unsigned long
LDAP_CALL
ber_get_bitstringa( BerElement *ber, char **buf, unsigned long *blen )
{
unsigned long datalen, tag;
unsigned char unusedbits;
if ( (tag = ber_skip_tag( ber, &datalen )) == LBER_DEFAULT )
return( LBER_DEFAULT );
--datalen;
if ( (*buf = (char *)NSLBERI_MALLOC( (size_t)datalen )) == NULL )
return( LBER_DEFAULT );
if ( ber_read( ber, (char *)&unusedbits, 1 ) != 1 )
return( LBER_DEFAULT );
if ( ber_read( ber, *buf, datalen ) != datalen )
return( LBER_DEFAULT );
*blen = datalen * 8 - unusedbits;
return( tag );
}
unsigned long
LDAP_CALL
ber_get_null( BerElement *ber )
{
unsigned long len, tag;
if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT )
return( LBER_DEFAULT );
if ( len != 0 )
return( LBER_DEFAULT );
return( tag );
}
unsigned long
LDAP_CALL
ber_get_boolean( BerElement *ber, int *boolval )
{
long longbool;
int rc;
rc = ber_get_int( ber, &longbool );
*boolval = longbool;
return( rc );
}
unsigned long
LDAP_CALL
ber_first_element( BerElement *ber, unsigned long *len, char **last )
{
/* skip the sequence header, use the len to mark where to stop */
if ( ber_skip_tag( ber, len ) == LBER_DEFAULT ) {
return( LBER_ERROR );
}
*last = ber->ber_ptr + *len;
if ( *last == ber->ber_ptr ) {
return( LBER_END_OF_SEQORSET );
}
return( ber_peek_tag( ber, len ) );
}
unsigned long
LDAP_CALL
ber_next_element( BerElement *ber, unsigned long *len, char *last )
{
if ( ber->ber_ptr == last ) {
return( LBER_END_OF_SEQORSET );
}
return( ber_peek_tag( ber, len ) );
}
/* VARARGS */
unsigned long
LDAP_C
ber_scanf( BerElement *ber, char *fmt, ... )
{
va_list ap;
char *last;
char *s, **ss, ***sss;
struct berval ***bv, **bvp, *bval;
int *i, j;
long *l, rc, tag;
unsigned long *t;
unsigned long len;
size_t array_size;
va_start( ap, fmt );
#ifdef LDAP_DEBUG
if ( lber_debug & 64 ) {
char msg[80];
sprintf( msg, "ber_scanf fmt (%s) ber:\n", fmt );
ber_err_print( msg );
ber_dump( ber, 1 );
}
#endif
for ( rc = 0; *fmt && rc != LBER_DEFAULT; fmt++ ) {
switch ( *fmt ) {
case 'a': /* octet string - allocate storage as needed */
ss = va_arg( ap, char ** );
rc = ber_get_stringa( ber, ss );
break;
case 'b': /* boolean */
i = va_arg( ap, int * );
rc = ber_get_boolean( ber, i );
break;
case 'e': /* enumerated */
case 'i': /* int */
l = va_arg( ap, long * );
rc = ber_get_int( ber, l );
break;
case 'l': /* length of next item */
l = va_arg( ap, long * );
rc = ber_peek_tag( ber, (unsigned long *)l );
break;
case 'n': /* null */
rc = ber_get_null( ber );
break;
case 's': /* octet string - in a buffer */
s = va_arg( ap, char * );
l = va_arg( ap, long * );
rc = ber_get_stringb( ber, s, (unsigned long *)l );
break;
case 'o': /* octet string in a supplied berval */
bval = va_arg( ap, struct berval * );
ber_peek_tag( ber, &bval->bv_len );
rc = ber_get_stringa( ber, &bval->bv_val );
break;
case 'O': /* octet string - allocate & include length */
bvp = va_arg( ap, struct berval ** );
rc = ber_get_stringal( ber, bvp );
break;
case 'B': /* bit string - allocate storage as needed */
ss = va_arg( ap, char ** );
l = va_arg( ap, long * ); /* for length, in bits */
rc = ber_get_bitstringa( ber, ss, (unsigned long *)l );
break;
case 't': /* tag of next item */
t = va_arg( ap, unsigned long * );
*t = rc = ber_peek_tag( ber, &len );
break;
case 'T': /* skip tag of next item */
t = va_arg( ap, unsigned long * );
*t = rc = ber_skip_tag( ber, &len );
break;
case 'v': /* sequence of strings */
sss = va_arg( ap, char *** );
*sss = NULL;
j = 0;
array_size = 0;
for ( tag = ber_first_element( ber, &len, &last );
tag != LBER_DEFAULT && tag != LBER_END_OF_SEQORSET
&& rc != LBER_DEFAULT;
tag = ber_next_element( ber, &len, last ) ) {
if ( *sss == NULL ) {
/* Make room for at least 15 strings */
*sss = (char **)NSLBERI_MALLOC(16 * sizeof(char *) );
array_size = 16;
} else {
if ( (j+2) > array_size) {
/* We'v overflowed our buffer */
*sss = (char **)NSLBERI_REALLOC( *sss, (array_size * 2) * sizeof(char *) );
array_size = array_size * 2;
}
}
rc = ber_get_stringa( ber, &((*sss)[j]) );
j++;
}
if ( rc != LBER_DEFAULT &&
tag != LBER_END_OF_SEQORSET ) {
rc = LBER_DEFAULT;
}
if ( j > 0 )
(*sss)[j] = NULL;
break;
case 'V': /* sequence of strings + lengths */
bv = va_arg( ap, struct berval *** );
*bv = NULL;
j = 0;
for ( tag = ber_first_element( ber, &len, &last );
tag != LBER_DEFAULT && tag != LBER_END_OF_SEQORSET
&& rc != LBER_DEFAULT;
tag = ber_next_element( ber, &len, last ) ) {
if ( *bv == NULL ) {
*bv = (struct berval **)NSLBERI_MALLOC(
2 * sizeof(struct berval *) );
} else {
*bv = (struct berval **)NSLBERI_REALLOC(
*bv,
(j + 2) * sizeof(struct berval *) );
}
rc = ber_get_stringal( ber, &((*bv)[j]) );
j++;
}
if ( rc != LBER_DEFAULT &&
tag != LBER_END_OF_SEQORSET ) {
rc = LBER_DEFAULT;
}
if ( j > 0 )
(*bv)[j] = NULL;
break;
case 'x': /* skip the next element - whatever it is */
if ( (rc = ber_skip_tag( ber, &len )) == LBER_DEFAULT )
break;
ber->ber_ptr += len;
break;
case '{': /* begin sequence */
case '[': /* begin set */
if ( *(fmt + 1) != 'v' && *(fmt + 1) != 'V' )
rc = ber_skip_tag( ber, &len );
break;
case '}': /* end sequence */
case ']': /* end set */
break;
default:
{
char msg[80];
sprintf( msg, "unknown fmt %c\n", *fmt );
ber_err_print( msg );
}
rc = LBER_DEFAULT;
break;
}
}
va_end( ap );
return( rc );
}
void
LDAP_CALL
ber_bvfree( struct berval *bv )
{
if ( bv != NULL ) {
if ( bv->bv_val != NULL ) {
NSLBERI_FREE( bv->bv_val );
}
NSLBERI_FREE( (char *) bv );
}
}
void
LDAP_CALL
ber_bvecfree( struct berval **bv )
{
int i;
for ( i = 0; bv[i] != NULL; i++ ) {
ber_bvfree( bv[i] );
}
NSLBERI_FREE( (char *) bv );
}
struct berval *
LDAP_CALL
ber_bvdup( struct berval *bv )
{
struct berval *new;
if ( (new = (struct berval *)NSLBERI_MALLOC( sizeof(struct berval) ))
== NULL ) {
return( NULL );
}
if ( bv->bv_val == NULL ) {
new->bv_val = NULL;
new->bv_len = 0;
} else {
if ( (new->bv_val = (char *)NSLBERI_MALLOC( bv->bv_len + 1 ))
== NULL ) {
return( NULL );
}
SAFEMEMCPY( new->bv_val, bv->bv_val, (size_t) bv->bv_len );
new->bv_val[bv->bv_len] = '\0';
new->bv_len = bv->bv_len;
}
return( new );
}
#ifdef STR_TRANSLATION
void
LDAP_CALL
ber_set_string_translators(
BerElement *ber,
BERTranslateProc encode_proc,
BERTranslateProc decode_proc
)
{
ber->ber_encode_translate_proc = encode_proc;
ber->ber_decode_translate_proc = decode_proc;
}
#endif /* STR_TRANSLATION */

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) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/* dtest.c - lber decoding test program */
#include <stdio.h>
#include <string.h>
#ifdef MACOS
#include <stdlib.h>
#include <console.h>
#else /* MACOS */
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#endif /* _WIN32 */
#endif /* MACOS */
#include "lber.h"
int
SSL_Recv( int s, char *b, unsigned l, int dummy )
{
return( read( s, b, l ) );
}
SSL_Send( int s, char *b, unsigned l, int dummy )
{
return( write( s, b, l ) );
}
static void usage( char *name )
{
fprintf( stderr, "usage: %s < berfile\n", name );
}
main( int argc, char **argv )
{
long i, fd;
unsigned long len;
int tag;
BerElement *ber;
Sockbuf *sb;
extern int lber_debug;
lber_debug = 255;
if ( argc > 1 ) {
usage( argv[0] );
exit( 1 );
}
sb = ber_sockbuf_alloc();
fd = 0;
ber_sockbuf_set_option( sb, LBER_SOCKBUF_OPT_DESC, &fd );
if ( (ber = der_alloc()) == NULL ) {
perror( "ber_alloc" );
exit( 1 );
}
if ( (tag = ber_get_next( sb, &len, ber )) == LBER_ERROR ) {
perror( "ber_get_next" );
exit( 1 );
}
printf( "message has tag 0x%x and length %ld\n", tag, len );
return( 0 );
}

View File

@@ -0,0 +1,656 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/* encode.c - ber output encoding routines */
#include "lber-int.h"
static int
ber_calc_taglen( unsigned long tag )
{
int i;
long mask;
/* find the first non-all-zero byte in the tag */
for ( i = sizeof(long) - 1; i > 0; i-- ) {
mask = (0xffL << (i * 8));
/* not all zero */
if ( tag & mask )
break;
}
return( i + 1 );
}
static int
ber_put_tag( BerElement *ber, unsigned long tag, int nosos )
{
int taglen;
unsigned long ntag;
taglen = ber_calc_taglen( tag );
ntag = LBER_HTONL( tag );
return( ber_write( ber, ((char *) &ntag) + sizeof(long) - taglen,
taglen, nosos ) );
}
static int
ber_calc_lenlen( unsigned long len )
{
/*
* short len if it's less than 128 - one byte giving the len,
* with bit 8 0.
*/
if ( len <= 0x7F )
return( 1 );
/*
* long len otherwise - one byte with bit 8 set, giving the
* length of the length, followed by the length itself.
*/
if ( len <= 0xFF )
return( 2 );
if ( len <= 0xFFFFL )
return( 3 );
if ( len <= 0xFFFFFFL )
return( 4 );
return( 5 );
}
static int
ber_put_len( BerElement *ber, unsigned long len, int nosos )
{
int i;
char lenlen;
long mask;
unsigned long netlen;
/*
* short len if it's less than 128 - one byte giving the len,
* with bit 8 0.
*/
if ( len <= 127 ) {
netlen = LBER_HTONL( len );
return( ber_write( ber, (char *) &netlen + sizeof(long) - 1,
1, nosos ) );
}
/*
* long len otherwise - one byte with bit 8 set, giving the
* length of the length, followed by the length itself.
*/
/* find the first non-all-zero byte */
for ( i = sizeof(long) - 1; i > 0; i-- ) {
mask = (0xffL << (i * 8));
/* not all zero */
if ( len & mask )
break;
}
lenlen = ++i;
if ( lenlen > 4 )
return( -1 );
lenlen |= 0x80;
/* write the length of the length */
if ( ber_write( ber, &lenlen, 1, nosos ) != 1 )
return( -1 );
/* write the length itself */
netlen = LBER_HTONL( len );
if ( ber_write( ber, (char *) &netlen + (sizeof(long) - i), i, nosos )
!= i )
return( -1 );
return( i + 1 );
}
static int
ber_put_int_or_enum( BerElement *ber, long num, unsigned long tag )
{
int i, sign, taglen;
int len, lenlen;
long netnum, mask;
sign = (num < 0);
/*
* high bit is set - look for first non-all-one byte
* high bit is clear - look for first non-all-zero byte
*/
for ( i = sizeof(long) - 1; i > 0; i-- ) {
mask = (0xffL << (i * 8));
if ( sign ) {
/* not all ones */
if ( (num & mask) != mask )
break;
} else {
/* not all zero */
if ( num & mask )
break;
}
}
/*
* we now have the "leading byte". if the high bit on this
* byte matches the sign bit, we need to "back up" a byte.
*/
mask = (num & (0x80L << (i * 8)));
if ( (mask && !sign) || (sign && !mask) )
i++;
len = i + 1;
if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 )
return( -1 );
if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 )
return( -1 );
i++;
netnum = LBER_HTONL( num );
if ( ber_write( ber, (char *) &netnum + (sizeof(long) - i), i, 0 )
== i)
/* length of tag + length + contents */
return( taglen + lenlen + i );
return( -1 );
}
int
LDAP_CALL
ber_put_enum( BerElement *ber, long num, unsigned long tag )
{
if ( tag == LBER_DEFAULT )
tag = LBER_ENUMERATED;
return( ber_put_int_or_enum( ber, num, tag ) );
}
int
LDAP_CALL
ber_put_int( BerElement *ber, long num, unsigned long tag )
{
if ( tag == LBER_DEFAULT )
tag = LBER_INTEGER;
return( ber_put_int_or_enum( ber, num, tag ) );
}
int
LDAP_CALL
ber_put_ostring( BerElement *ber, char *str, unsigned long len,
unsigned long tag )
{
int taglen, lenlen, rc;
#ifdef STR_TRANSLATION
int free_str;
#endif /* STR_TRANSLATION */
if ( tag == LBER_DEFAULT )
tag = LBER_OCTETSTRING;
if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 )
return( -1 );
#ifdef STR_TRANSLATION
if ( len > 0 && ( ber->ber_options & LBER_OPT_TRANSLATE_STRINGS ) != 0
&& ber->ber_encode_translate_proc != NULL ) {
if ( (*(ber->ber_encode_translate_proc))( &str, &len, 0 )
!= 0 ) {
return( -1 );
}
free_str = 1;
} else {
free_str = 0;
}
#endif /* STR_TRANSLATION */
if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 ||
ber_write( ber, str, len, 0 ) != len ) {
rc = -1;
} else {
/* return length of tag + length + contents */
rc = taglen + lenlen + len;
}
#ifdef STR_TRANSLATION
if ( free_str ) {
NSLBERI_FREE( str );
}
#endif /* STR_TRANSLATION */
return( rc );
}
int
LDAP_CALL
ber_put_string( BerElement *ber, char *str, unsigned long tag )
{
return( ber_put_ostring( ber, str, strlen( str ), tag ));
}
int
LDAP_CALL
ber_put_bitstring( BerElement *ber, char *str,
unsigned long blen /* in bits */, unsigned long tag )
{
int taglen, lenlen, len;
unsigned char unusedbits;
if ( tag == LBER_DEFAULT )
tag = LBER_BITSTRING;
if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 )
return( -1 );
len = ( blen + 7 ) / 8;
unusedbits = len * 8 - blen;
if ( (lenlen = ber_put_len( ber, len + 1, 0 )) == -1 )
return( -1 );
if ( ber_write( ber, (char *)&unusedbits, 1, 0 ) != 1 )
return( -1 );
if ( ber_write( ber, str, len, 0 ) != len )
return( -1 );
/* return length of tag + length + unused bit count + contents */
return( taglen + 1 + lenlen + len );
}
int
LDAP_CALL
ber_put_null( BerElement *ber, unsigned long tag )
{
int taglen;
if ( tag == LBER_DEFAULT )
tag = LBER_NULL;
if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 )
return( -1 );
if ( ber_put_len( ber, 0, 0 ) != 1 )
return( -1 );
return( taglen + 1 );
}
int
LDAP_CALL
ber_put_boolean( BerElement *ber, int boolval, unsigned long tag )
{
int taglen;
unsigned char trueval = 0xff;
unsigned char falseval = 0x00;
if ( tag == LBER_DEFAULT )
tag = LBER_BOOLEAN;
if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 )
return( -1 );
if ( ber_put_len( ber, 1, 0 ) != 1 )
return( -1 );
if ( ber_write( ber, (char *)(boolval ? &trueval : &falseval), 1, 0 )
!= 1 )
return( -1 );
return( taglen + 2 );
}
#define FOUR_BYTE_LEN 5
/* the idea here is roughly this: we maintain a stack of these Seqorset
* structures. This is pushed when we see the beginning of a new set or
* sequence. It is popped when we see the end of a set or sequence.
* Since we don't want to malloc and free these structures all the time,
* we pre-allocate a small set of them within the ber element structure.
* thus we need to spot when we've overflowed this stack and fall back to
* malloc'ing instead.
*/
static int
ber_start_seqorset( BerElement *ber, unsigned long tag )
{
Seqorset *new_sos;
/* can we fit into the local stack ? */
if (ber->ber_sos_stack_posn < SOS_STACK_SIZE) {
/* yes */
new_sos = &ber->ber_sos_stack[ber->ber_sos_stack_posn];
} else {
/* no */
if ( (new_sos = (Seqorset *)NSLBERI_MALLOC( sizeof(Seqorset)))
== NULLSEQORSET ) {
return( -1 );
}
}
ber->ber_sos_stack_posn++;
if ( ber->ber_sos == NULLSEQORSET )
new_sos->sos_first = ber->ber_ptr;
else
new_sos->sos_first = ber->ber_sos->sos_ptr;
/* Set aside room for a 4 byte length field */
new_sos->sos_ptr = new_sos->sos_first + ber_calc_taglen( tag ) + FOUR_BYTE_LEN;
new_sos->sos_tag = tag;
new_sos->sos_next = ber->ber_sos;
new_sos->sos_clen = 0;
ber->ber_sos = new_sos;
return( 0 );
}
int
LDAP_CALL
ber_start_seq( BerElement *ber, unsigned long tag )
{
if ( tag == LBER_DEFAULT )
tag = LBER_SEQUENCE;
return( ber_start_seqorset( ber, tag ) );
}
int
LDAP_CALL
ber_start_set( BerElement *ber, unsigned long tag )
{
if ( tag == LBER_DEFAULT )
tag = LBER_SET;
return( ber_start_seqorset( ber, tag ) );
}
static int
ber_put_seqorset( BerElement *ber )
{
unsigned long len, netlen;
int taglen, lenlen;
unsigned char ltag = 0x80 + FOUR_BYTE_LEN - 1;
Seqorset *next;
Seqorset **sos = &ber->ber_sos;
/*
* If this is the toplevel sequence or set, we need to actually
* write the stuff out. Otherwise, it's already been put in
* the appropriate buffer and will be written when the toplevel
* one is written. In this case all we need to do is update the
* length and tag.
*/
len = (*sos)->sos_clen;
netlen = LBER_HTONL( len );
if ( sizeof(long) > 4 && len > 0xFFFFFFFFL )
return( -1 );
if ( ber->ber_options & LBER_OPT_USE_DER ) {
lenlen = ber_calc_lenlen( len );
} else {
lenlen = FOUR_BYTE_LEN;
}
if ( (next = (*sos)->sos_next) == NULLSEQORSET ) {
/* write the tag */
if ( (taglen = ber_put_tag( ber, (*sos)->sos_tag, 1 )) == -1 )
return( -1 );
if ( ber->ber_options & LBER_OPT_USE_DER ) {
/* Write the length in the minimum # of octets */
if ( ber_put_len( ber, len, 1 ) == -1 )
return( -1 );
if (lenlen != FOUR_BYTE_LEN) {
/*
* We set aside FOUR_BYTE_LEN bytes for
* the length field. Move the data if
* we don't actually need that much
*/
SAFEMEMCPY( (*sos)->sos_first + taglen +
lenlen, (*sos)->sos_first + taglen +
FOUR_BYTE_LEN, len );
}
} else {
/* Fill FOUR_BYTE_LEN bytes for length field */
/* one byte of length length */
if ( ber_write( ber, (char *)&ltag, 1, 1 ) != 1 )
return( -1 );
/* the length itself */
if ( ber_write( ber, (char *) &netlen + sizeof(long)
- (FOUR_BYTE_LEN - 1), FOUR_BYTE_LEN - 1, 1 )
!= FOUR_BYTE_LEN - 1 )
return( -1 );
}
/* The ber_ptr is at the set/seq start - move it to the end */
ber->ber_ptr += len;
} else {
unsigned long ntag;
/* the tag */
taglen = ber_calc_taglen( (*sos)->sos_tag );
ntag = LBER_HTONL( (*sos)->sos_tag );
SAFEMEMCPY( (*sos)->sos_first, (char *) &ntag +
sizeof(long) - taglen, taglen );
if ( ber->ber_options & LBER_OPT_USE_DER ) {
ltag = (lenlen == 1) ? len : 0x80 + (lenlen - 1);
}
/* one byte of length length */
SAFEMEMCPY( (*sos)->sos_first + 1, &ltag, 1 );
if ( ber->ber_options & LBER_OPT_USE_DER ) {
if (lenlen > 1) {
/* Write the length itself */
SAFEMEMCPY( (*sos)->sos_first + 2,
(char *)&netlen + sizeof(unsigned long) -
(lenlen - 1),
lenlen - 1 );
}
if (lenlen != FOUR_BYTE_LEN) {
/*
* We set aside FOUR_BYTE_LEN bytes for
* the length field. Move the data if
* we don't actually need that much
*/
SAFEMEMCPY( (*sos)->sos_first + taglen +
lenlen, (*sos)->sos_first + taglen +
FOUR_BYTE_LEN, len );
}
} else {
/* the length itself */
SAFEMEMCPY( (*sos)->sos_first + taglen + 1,
(char *) &netlen + sizeof(long) -
(FOUR_BYTE_LEN - 1), FOUR_BYTE_LEN - 1 );
}
next->sos_clen += (taglen + lenlen + len);
next->sos_ptr += (taglen + lenlen + len);
}
/* we're done with this seqorset, so free it up */
/* was this one from the local stack ? */
if (ber->ber_sos_stack_posn <= SOS_STACK_SIZE) {
/* yes */
} else {
/* no */
NSLBERI_FREE( (char *) (*sos) );
}
ber->ber_sos_stack_posn--;
*sos = next;
return( taglen + lenlen + len );
}
int
LDAP_CALL
ber_put_seq( BerElement *ber )
{
return( ber_put_seqorset( ber ) );
}
int
LDAP_CALL
ber_put_set( BerElement *ber )
{
return( ber_put_seqorset( ber ) );
}
/* VARARGS */
int
LDAP_C
ber_printf( BerElement *ber, char *fmt, ... )
{
va_list ap;
char *s, **ss;
struct berval **bv;
int rc, i;
unsigned long len;
va_start( ap, fmt );
#ifdef LDAP_DEBUG
if ( lber_debug & 64 ) {
char msg[80];
sprintf( msg, "ber_printf fmt (%s)\n", fmt );
ber_err_print( msg );
}
#endif
for ( rc = 0; *fmt && rc != -1; fmt++ ) {
switch ( *fmt ) {
case 'b': /* boolean */
i = va_arg( ap, int );
rc = ber_put_boolean( ber, i, ber->ber_tag );
break;
case 'i': /* int */
i = va_arg( ap, int );
rc = ber_put_int( ber, i, ber->ber_tag );
break;
case 'e': /* enumeration */
i = va_arg( ap, int );
rc = ber_put_enum( ber, i, ber->ber_tag );
break;
case 'n': /* null */
rc = ber_put_null( ber, ber->ber_tag );
break;
case 'o': /* octet string (non-null terminated) */
s = va_arg( ap, char * );
len = va_arg( ap, int );
rc = ber_put_ostring( ber, s, len, ber->ber_tag );
break;
case 's': /* string */
s = va_arg( ap, char * );
rc = ber_put_string( ber, s, ber->ber_tag );
break;
case 'B': /* bit string */
s = va_arg( ap, char * );
len = va_arg( ap, int ); /* in bits */
rc = ber_put_bitstring( ber, s, len, ber->ber_tag );
break;
case 't': /* tag for the next element */
ber->ber_tag = va_arg( ap, unsigned long );
ber->ber_usertag = 1;
break;
case 'v': /* vector of strings */
if ( (ss = va_arg( ap, char ** )) == NULL )
break;
for ( i = 0; ss[i] != NULL; i++ ) {
if ( (rc = ber_put_string( ber, ss[i],
ber->ber_tag )) == -1 )
break;
}
break;
case 'V': /* sequences of strings + lengths */
if ( (bv = va_arg( ap, struct berval ** )) == NULL )
break;
for ( i = 0; bv[i] != NULL; i++ ) {
if ( (rc = ber_put_ostring( ber, bv[i]->bv_val,
bv[i]->bv_len, ber->ber_tag )) == -1 )
break;
}
break;
case '{': /* begin sequence */
rc = ber_start_seq( ber, ber->ber_tag );
break;
case '}': /* end sequence */
rc = ber_put_seqorset( ber );
break;
case '[': /* begin set */
rc = ber_start_set( ber, ber->ber_tag );
break;
case ']': /* end set */
rc = ber_put_seqorset( ber );
break;
default: {
char msg[80];
sprintf( msg, "unknown fmt %c\n", *fmt );
ber_err_print( msg );
rc = -1;
break;
}
}
if ( ber->ber_usertag == 0 )
ber->ber_tag = LBER_DEFAULT;
else
ber->ber_usertag = 0;
}
va_end( ap );
return( rc );
}

View File

@@ -0,0 +1,168 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/* test.c - lber encoding test program */
#include <stdio.h>
#include <string.h>
#ifdef MACOS
#include <stdlib.h>
#include <unix.h>
#include <fcntl.h>
#include <console.h>
#else /* MACOS */
#include <sys/types.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/socket.h>
#endif /* _WIN32 */
#endif /* MACOS */
#include "lber.h"
int
SSL_Recv( int s, char *b, unsigned l, int dummy )
{
return( read( s, b, l ) );
}
SSL_Send( int s, char *b, unsigned l, int dummy )
{
return( write( s, b, l ) );
}
int
getline( char *prompt, char c, char *buf, int bsize )
{
char *p;
if ( prompt != NULL ) {
fprintf( stderr, "%s: ", prompt );
} else {
fprintf( stderr, "enter value for '%c': ", c );
}
if ( fgets( buf, bsize, stdin ) == NULL ) {
return( -1 );
}
if ( (p = strchr( buf, '\n' )) != NULL ) {
*p = '\0';
}
return( 0 );
}
static void usage( char *name )
{
fprintf( stderr, "usage: %s fmtstring\n", name );
}
main( int argc, char **argv )
{
int rc, fd;
char *s, *p;
void *arg1, *arg2;
Sockbuf *sb;
BerElement *ber;
char fmt[2];
char buf[BUFSIZ];
extern int lber_debug;
lber_debug = 255;
if ( argc < 2 ) {
usage( argv[0] );
exit( 1 );
}
sb = ber_sockbuf_alloc();
fd = 1;
ber_sockbuf_set_option( sb, LBER_SOCKBUF_OPT_DESC, &fd );
if ( (ber = der_alloc()) == NULL ) {
perror( "ber_alloc" );
exit( 1 );
}
rc = 0;
fmt[1] = '\0';
for ( s = argv[1]; *s; s++ ) {
switch ( *s ) {
case 'i': /* int */
case 'b': /* boolean */
case 'e': /* enumeration */
getline( NULL, *s, buf, sizeof(buf) );
arg1 = (void *) atoi( buf );
break;
case 'n': /* null */
arg1 = NULL;
break;
case 'o': /* octet string (non-null terminated) */
getline( NULL, *s, buf, sizeof(buf) );
arg1 = (void *) buf;
arg2 = (void *) strlen( buf );
break;
case 's': /* string */
getline( NULL, *s, buf, sizeof(buf) );
arg1 = (void *) buf;
break;
case 'B': /* bit string */
getline( NULL, *s, buf, sizeof(buf) );
arg1 = (void *) buf;
arg2 = (void *) strlen( buf );
break;
case 't': /* tag for the next element */
getline( NULL, *s, buf, sizeof(buf) );
arg1 = (void *) buf;
break;
case '{': /* begin sequence */
case '}': /* end sequence */
case '[': /* begin set */
case ']': /* end set */
break;
default:
fprintf( stderr, "unknown fmt %c\n", *s );
rc = -1;
break;
}
fmt[0] = *s;
if ( ber_printf( ber, fmt, arg1, arg2 ) == -1 ) {
fprintf( stderr, "ber_printf\n" );
exit( 1 );
}
}
if ( ber_flush( sb, ber, 1 ) != 0 ) {
perror( "ber_flush" );
rc = -1;
}
return( rc );
}

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) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/* idtest.c - ber decoding test program using isode libraries */
#include <stdio.h>
#include <psap.h>
#include <quipu/attr.h>
static usage( char *name )
{
fprintf( stderr, "usage: %s\n", name );
}
main( int argc, char **argv )
{
PE pe;
PS psin, psout, pserr;
/* read the pe from standard in */
if ( (psin = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
exit( 1 );
}
if ( std_setup( psin, stdin ) == NOTOK ) {
perror( "std_setup" );
exit( 1 );
}
/* write the pe to standard out */
if ( (psout = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
exit( 1 );
}
if ( std_setup( psout, stdout ) == NOTOK ) {
perror( "std_setup" );
exit( 1 );
}
/* pretty print it to standard error */
if ( (pserr = ps_alloc( std_open )) == NULLPS ) {
perror( "ps_alloc" );
exit( 1 );
}
if ( std_setup( pserr, stderr ) == NOTOK ) {
perror( "std_setup" );
exit( 1 );
}
while ( (pe = ps2pe( psin )) != NULLPE ) {
pe2pl( pserr, pe );
pe2ps( psout, pe );
}
exit( 0 );
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,231 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/* lbet-int.h - internal header file for liblber */
#ifndef _LBERINT_H
#define _LBERINT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#ifdef macintosh
# include "ldap-macos.h"
#else /* macintosh */
#if !defined(BSDI)
# include <malloc.h>
#endif
# include <errno.h>
# include <sys/types.h>
#if defined(SUNOS4) || defined(SCOOS)
# include <sys/time.h>
#endif
#if defined( _WINDOWS )
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <time.h>
/* No stderr in a 16-bit Windows DLL */
# if defined(_WINDLL) && !defined(_WIN32)
# define USE_DBG_WIN
# endif
# else
#if !defined(XP_OS2)
/* # include <sys/varargs.h> */
# include <sys/socket.h>
# include <netinet/in.h>
# include <unistd.h>
#endif
# endif /* defined( _WINDOWS ) */
#endif /* macintosh */
#include <memory.h>
#include <string.h>
#include "portable.h"
#ifdef _WINDOWS
#include <winsock.h>
#include <io.h>
#endif /* _WINDOWS */
#ifdef XP_OS2
#include <os2sock.h>
#include <io.h>
#endif /* XP_OS2 */
/* No stderr in a 16-bit Windows DLL */
#if defined(_WINDLL) && !defined(_WIN32)
#define stderr NULL
#endif
#include "lber.h"
#define OLD_LBER_SEQUENCE 0x10L /* w/o constructed bit - broken */
#define OLD_LBER_SET 0x11L /* w/o constructed bit - broken */
#ifndef _IFP
#define _IFP
typedef int (LDAP_C LDAP_CALLBACK *IFP)();
#endif
extern struct lber_memalloc_fns nslberi_memalloc_fns;
typedef struct seqorset {
unsigned long sos_clen;
unsigned long sos_tag;
char *sos_first;
char *sos_ptr;
struct seqorset *sos_next;
} Seqorset;
#define NULLSEQORSET ((Seqorset *) 0)
#define SOS_STACK_SIZE 8 /* depth of the pre-allocated sos structure stack */
struct berelement {
char *ber_buf;
char *ber_ptr;
char *ber_end;
struct seqorset *ber_sos;
unsigned long ber_tag;
unsigned long ber_len;
int ber_usertag;
char ber_options;
char *ber_rwptr;
BERTranslateProc ber_encode_translate_proc;
BERTranslateProc ber_decode_translate_proc;
int ber_flags;
#define LBER_FLAG_NO_FREE_BUFFER 1 /* don't free ber_buf */
int ber_sos_stack_posn;
Seqorset ber_sos_stack[SOS_STACK_SIZE];
};
#define NULLBER ((BerElement *)NULL)
struct sockbuf {
LBER_SOCKET sb_sd;
BerElement sb_ber;
int sb_naddr; /* > 0 implies using CLDAP (UDP) */
void *sb_useaddr; /* pointer to sockaddr to use next */
void *sb_fromaddr; /* pointer to message source sockaddr */
void **sb_addrs; /* actually an array of pointers to
sockaddrs */
int sb_options; /* to support copying ber elements */
LBER_SOCKET sb_fd;
long sb_max_incoming;
LDAP_IOF_READ_CALLBACK *sb_read_fn;
LDAP_IOF_WRITE_CALLBACK *sb_write_fn;
};
#define NULLSOCKBUF ((Sockbuf *)NULL)
#define READBUFSIZ 8192
/*
* macros used to check validity of data structures and parameters
*/
#define NSLBERI_VALID_BERELEMENT_POINTER( ber ) \
( (ber) != NULLBER )
#define NSLBERI_VALID_SOCKBUF_POINTER( sb ) \
( (sb) != NULLSOCKBUF )
#if defined(_WIN32) && defined(_ALPHA)
#define LBER_HTONL( _l ) \
((((_l)&0xff)<<24) + (((_l)&0xff00)<<8) + \
(((_l)&0xff0000)>>8) + (((_l)&0xff000000)>>24))
#define LBER_NTOHL(_l) LBER_HTONL(_l)
#elif !defined(__alpha) || defined(VMS)
#define LBER_HTONL( l ) htonl( l )
#define LBER_NTOHL( l ) ntohl( l )
#else /* __alpha */
/*
* htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the
* lower-order 32-bits of a (64-bit) long, so we define correct versions
* here.
*/
#define LBER_HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \
| htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
#define LBER_NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \
| ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
#endif /* __alpha */
/* function prototypes */
#ifdef LDAP_DEBUG
void ber_dump( BerElement *ber, int inout );
void lber_bprint( char *data, int len );
#endif
void ber_err_print( char *data );
void *nslberi_malloc( size_t size );
void *nslberi_calloc( size_t nelem, size_t elsize );
void *nslberi_realloc( void *ptr, size_t size );
void nslberi_free( void *ptr );
/* blame: dboreham
* slapd spends much of its time doing memcpy's for the ber code.
* Most of these are single-byte, so we special-case those and speed
* things up considerably.
*/
#ifdef sunos4
#define THEMEMCPY( d, s, n ) bcopy( s, d, n )
#else /* sunos4 */
#define THEMEMCPY( d, s, n ) memmove( d, s, n )
#endif /* sunos4 */
#ifdef SAFEMEMCPY
#undef SAFEMEMCPY
#define SAFEMEMCPY(d,s,n) if (1 == n) *((char*)d) = *((char*)s); else THEMEMCPY(d,s,n);
#endif
/*
* Memory allocation done in liblber should all go through one of the
* following macros. This is so we can plug-in alternative memory
* allocators, etc. as the need arises.
*/
#define NSLBERI_MALLOC( size ) nslberi_malloc( size )
#define NSLBERI_CALLOC( nelem, elsize ) nslberi_calloc( nelem, elsize )
#define NSLBERI_REALLOC( ptr, size ) nslberi_realloc( ptr, size )
#define NSLBERI_FREE( ptr ) nslberi_free( ptr )
#ifdef __cplusplus
}
#endif
#endif /* _LBERINT_H */

View File

@@ -0,0 +1,162 @@
DEPTH = ../../../../..
NS_DEPTH = ../../../..
LDAPSRC = ../..
RM = rm -f
SED = sed
SRCS = abandon.c \
add.c \
bind.c \
cache.c \
charray.c \
charset.c \
compare.c \
compat.c \
control.c \
countvalues.c \
delete.c \
disptmpl.c \
dsparse.c \
error.c \
extendop.c \
free.c \
freevalues.c \
friendly.c \
getattr.c \
getdn.c \
getdxbyname.c \
getentry.c \
getfilter.c \
getoption.c \
getvalues.c \
memcache.c \
message.c \
modify.c \
open.c \
os-ip.c \
psearch.c \
referral.c \
regex.c \
rename.c \
request.c \
reslist.c \
result.c \
saslbind.c \
sbind.c \
search.c \
setoption.c \
sort.c \
sortctrl.c \
srchpref.c \
tmplout.c \
ufn.c \
unbind.c \
unescape.c \
url.c \
utf8.c \
vlistctrl.c
REALOBJS = $(SRCS:.c=.o)
#OBJS = $(REALOBJS) versiont.o
OBJS = $(REALOBJS)
HDIR = $(LDAPSRC)/include
CFLAGS = $(INCLUDES) $(DEFINES)
LIBRARY_NAME = ldap
#
# DEFS are included in CFLAGS
#
DEFS = $(PLATFORMCFLAGS) $(LDAP_DEBUG) $(KERBEROS) $(AFSKERBEROS) \
$(UOFM) $(UOFA) $(NO_USERINTERFACE) $(CLDAP) $(NO_CACHE) \
$(LDAP_REFERRALS) $(LDAP_DNS) $(STR_TRANSLATION) \
$(LIBLDAP_CHARSETS) $(LIBLDAP_DEF_CHARSET) \
$(SLAPD_BACKENDS) $(LDBMBACKEND) $(LDBMINCLUDE) $(PHONETIC) \
$(LDAP_SSLIO_HOOKS)
include $(DEPTH)/config/rules.mk
LOCAL_INCLUDES = -I$(PUBLIC)/nspr
INCLUDES += -I$(HDIR) $(KRBINCLUDEFLAG)
DEFINES += $(DEFS) -DFILTERFILE="\"$(RUNTIMEETCDIR)/ldapfilter.conf\"" \
-DTEMPLATEFILE="\"$(RUNTIMEETCDIR)/ldaptemplates.conf\"" \
-DNET_SSL -UMOZILLA_CLIENT
# So we actually get the definition of hostent_data....
ifeq ($(OS_ARCH),AIX)
DEFINES += -D_THREAD_SAFE
endif
GARBAGE += $(ETCDIR)/ldapfriendly $(ETCDIR)/ldapfilter.conf \
$(ETCDIR)/ldaptemplates.conf $(ETCDIR)/ldapsearchprefs.conf
PLATFORMCFLAGS = -DUSE_WAITPID -DNEEDPROTOS
PLATFORMLIBS =
THREADS =
THREADSLIB =
ETCFILES = ldapfilter.conf \
ldapfriendly \
ldapsearchprefs.conf \
ldaptemplates.conf \
$(NULL)
ETCDIR = $(DIST)/etc
#
# if you want things to run in a different directory from where they
# are installed, set this accordingly (this path gets compiled into a
# few binaries). otherwise, leave it alone.
#
RUNTIMEETCDIR = $(ETCDIR)
#
# To build slapd (the stand-alone ldap daemon), uncomment the MAKESLAPD
# line and select the SLAPD_BACKENDS you want to use. If you enable the
# LDBM backend, also select one of the LDBM backends.
#
MAKESLAPD = yes
SLAPD_BACKENDS = -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD
LDBMBACKEND = -DLDBM_USE_NDBM
#
# uncomment this line to enable debugging code (a good idea)
#
ifndef BUILD_OPT
LDAP_DEBUG = -DLDAP_DEBUG
endif
#
# uncomment this line to enable support for LDAP referrals in libldap
#
LDAP_REFERRALS = -DLDAP_REFERRALS
#
# uncomment this line to enable support for SSL I/O in libldap
#
LDAP_SSLIO_HOOKS = -DLDAP_SSLIO_HOOKS
###########################################################################
versiont.c: Makefile.client Version.c
@$(RM) $@
@(u="$${USER-root}" v="$(shell cat ../../build/version)" d="$(shell pwd)" \
h="$(shell hostname)" t="$(shell date)"; $(SED) -e "s|%WHEN%|$${t}|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
-e "s|%VERSION%|$${v}|" \
< Version.c > $@)
$(LIBRARY): $(OBJS)
install:: $(LIBRARY) $(ETCFILES)
$(INSTALL) -m 444 $(LIBRARY) $(DIST)/ldap/lib
ifdef MKSHLIB
$(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/ldap/bin
endif
$(INSTALL) $(INSTALLFLAGS) -m 644 $(ETCFILES) $(ETCDIR)

View File

@@ -0,0 +1,224 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* abandon.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
static int do_abandon( LDAP *ld, int origid, int msgid,
LDAPControl **serverctrls, LDAPControl **clientctrls );
/*
* ldap_abandon - perform an ldap (and X.500) abandon operation. Parameters:
*
* ld LDAP descriptor
* msgid The message id of the operation to abandon
*
* ldap_abandon returns 0 if everything went ok, -1 otherwise.
*
* Example:
* ldap_abandon( ld, msgid );
*/
int
LDAP_CALL
ldap_abandon( LDAP *ld, int msgid )
{
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_abandon %d\n", msgid, 0, 0 );
if ( ldap_abandon_ext( ld, msgid, NULL, NULL ) == LDAP_SUCCESS ) {
return( 0 );
}
return( -1 );
}
/*
* LDAPv3 extended abandon.
* Returns an LDAP error code.
*/
int
LDAP_CALL
ldap_abandon_ext( LDAP *ld, int msgid, LDAPControl **serverctrls,
LDAPControl **clientctrls )
{
int rc;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_abandon_ext %d\n", msgid, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
LDAP_MUTEX_LOCK( ld, LDAP_REQ_LOCK );
LDAP_MUTEX_LOCK( ld, LDAP_CONN_LOCK );
rc = do_abandon( ld, msgid, msgid, serverctrls, clientctrls );
/*
* XXXmcs should use cache function pointers to hook in memcache
*/
ldap_memcache_abandon( ld, msgid );
LDAP_MUTEX_UNLOCK( ld, LDAP_CONN_LOCK );
LDAP_MUTEX_UNLOCK( ld, LDAP_REQ_LOCK );
return( rc );
}
/*
* Abandon all outstanding requests for msgid (included child requests
* spawned when chasing referrals). This function calls itself recursively.
* No locking is done is this function so it must be done by the caller.
* Returns an LDAP error code and sets it in LDAP *ld as well
*/
static int
do_abandon( LDAP *ld, int origid, int msgid, LDAPControl **serverctrls,
LDAPControl **clientctrls )
{
BerElement *ber;
int i, bererr, lderr, sendabandon;
Sockbuf *sb;
LDAPRequest *lr;
/*
* An abandon request looks like this:
* AbandonRequest ::= MessageID
*/
LDAPDebug( LDAP_DEBUG_TRACE, "do_abandon origid %d, msgid %d\n",
origid, msgid, 0 );
lderr = LDAP_SUCCESS; /* optimistic */
sendabandon = 1;
/* find the request that we are abandoning */
for ( lr = ld->ld_requests; lr != NULL; lr = lr->lr_next ) {
if ( lr->lr_msgid == msgid ) { /* this message */
break;
}
if ( lr->lr_origid == msgid ) { /* child: abandon it */
(void)do_abandon( ld, msgid, lr->lr_msgid,
serverctrls, clientctrls );
/* we ignore errors from child abandons... */
}
}
if ( lr != NULL ) {
if ( origid == msgid && lr->lr_parent != NULL ) {
/* don't let caller abandon child requests! */
lderr = LDAP_PARAM_ERROR;
goto set_errorcode_and_return;
}
if ( lr->lr_status != LDAP_REQST_INPROGRESS ) {
/* no need to send abandon message */
sendabandon = 0;
}
}
if ( ldap_msgdelete( ld, msgid ) == 0 ) {
/* we had all the results and deleted them */
goto set_errorcode_and_return;
}
if ( sendabandon ) {
/* create a message to send */
if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) ==
LDAP_SUCCESS ) {
LDAP_MUTEX_LOCK( ld, LDAP_MSGID_LOCK );
#ifdef CLDAP
if ( ld->ld_dbp->sb_naddr > 0 ) {
bererr = ber_printf( ber, "{isti",
++ld->ld_msgid, ld->ld_cldapdn,
LDAP_REQ_ABANDON, msgid );
} else {
#endif /* CLDAP */
bererr = ber_printf( ber, "{iti",
++ld->ld_msgid, LDAP_REQ_ABANDON, msgid );
#ifdef CLDAP
}
#endif /* CLDAP */
LDAP_MUTEX_UNLOCK( ld, LDAP_MSGID_LOCK );
if ( bererr == -1 ||
( lderr = nsldapi_put_controls( ld, serverctrls,
1, ber )) != LDAP_SUCCESS ) {
lderr = LDAP_ENCODING_ERROR;
ber_free( ber, 1 );
} else {
/* send the message */
if ( lr != NULL ) {
sb = lr->lr_conn->lconn_sb;
} else {
sb = ld->ld_sbp;
}
if ( nsldapi_ber_flush( ld, sb, ber, 1, 0 )
!= 0 ) {
lderr = LDAP_SERVER_DOWN;
}
}
}
}
if ( lr != NULL ) {
if ( sendabandon ) {
nsldapi_free_connection( ld, lr->lr_conn, 0, 1 );
}
if ( origid == msgid ) {
nsldapi_free_request( ld, lr, 0 );
}
}
LDAP_MUTEX_LOCK( ld, LDAP_ABANDON_LOCK );
if ( ld->ld_abandoned == NULL ) {
if ( (ld->ld_abandoned = (int *)NSLDAPI_MALLOC( 2
* sizeof(int) )) == NULL ) {
lderr = LDAP_NO_MEMORY;
LDAP_MUTEX_UNLOCK( ld, LDAP_ABANDON_LOCK );
goto set_errorcode_and_return;
}
i = 0;
} else {
for ( i = 0; ld->ld_abandoned[i] != -1; i++ )
; /* NULL */
if ( (ld->ld_abandoned = (int *)NSLDAPI_REALLOC( (char *)
ld->ld_abandoned, (i + 2) * sizeof(int) )) == NULL ) {
lderr = LDAP_NO_MEMORY;
LDAP_MUTEX_UNLOCK( ld, LDAP_ABANDON_LOCK );
goto set_errorcode_and_return;
}
}
ld->ld_abandoned[i] = msgid;
ld->ld_abandoned[i + 1] = -1;
LDAP_MUTEX_UNLOCK( ld, LDAP_ABANDON_LOCK );
set_errorcode_and_return:
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
return( lderr );
}

View File

@@ -0,0 +1,201 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* add.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
/*
* ldap_add - initiate an ldap (and X.500) add operation. Parameters:
*
* ld LDAP descriptor
* dn DN of the entry to add
* mods List of attributes for the entry. This is a null-
* terminated array of pointers to LDAPMod structures.
* only the type and values in the structures need be
* filled in.
*
* Example:
* LDAPMod *attrs[] = {
* { 0, "cn", { "babs jensen", "babs", 0 } },
* { 0, "sn", { "jensen", 0 } },
* { 0, "objectClass", { "person", 0 } },
* 0
* }
* msgid = ldap_add( ld, dn, attrs );
*/
int
LDAP_CALL
ldap_add( LDAP *ld, const char *dn, LDAPMod **attrs )
{
int msgid;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_add\n", 0, 0, 0 );
if ( ldap_add_ext( ld, dn, attrs, NULL, NULL, &msgid )
== LDAP_SUCCESS ) {
return( msgid );
} else {
return( -1 ); /* error is in ld handle */
}
}
/*
* LDAPv3 extended add.
* Returns an LDAP error code.
*/
int
LDAP_CALL
ldap_add_ext( LDAP *ld, const char *dn, LDAPMod **attrs,
LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp )
{
BerElement *ber;
int i, rc, lderr;
/*
* An add request looks like this:
* AddRequest ::= SEQUENCE {
* entry DistinguishedName,
* attrs SEQUENCE OF SEQUENCE {
* type AttributeType,
* values SET OF AttributeValue
* }
* }
*/
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_add_ext\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
if ( !NSLDAPI_VALID_NONEMPTY_LDAPMOD_ARRAY( attrs )
|| msgidp == NULL ) {
lderr = LDAP_PARAM_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
return( lderr );
}
if ( dn == NULL ) {
dn = "";
}
LDAP_MUTEX_LOCK( ld, LDAP_MSGID_LOCK );
*msgidp = ++ld->ld_msgid;
LDAP_MUTEX_UNLOCK( ld, LDAP_MSGID_LOCK );
/* see if we should add to the cache */
if ( ld->ld_cache_on && ld->ld_cache_add != NULL ) {
LDAP_MUTEX_LOCK( ld, LDAP_CACHE_LOCK );
if ( (rc = (ld->ld_cache_add)( ld, *msgidp, LDAP_REQ_ADD, dn,
attrs )) != 0 ) {
*msgidp = rc;
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
return( LDAP_SUCCESS );
}
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
}
/* create a message to send */
if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber ))
!= LDAP_SUCCESS ) {
return( lderr );
}
if ( ber_printf( ber, "{it{s{", *msgidp, LDAP_REQ_ADD, dn )
== -1 ) {
lderr = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
ber_free( ber, 1 );
return( lderr );
}
/* for each attribute in the entry... */
for ( i = 0; attrs[i] != NULL; i++ ) {
if ( ( attrs[i]->mod_op & LDAP_MOD_BVALUES) != 0 ) {
rc = ber_printf( ber, "{s[V]}", attrs[i]->mod_type,
attrs[i]->mod_bvalues );
} else {
rc = ber_printf( ber, "{s[v]}", attrs[i]->mod_type,
attrs[i]->mod_values );
}
if ( rc == -1 ) {
lderr = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
ber_free( ber, 1 );
return( lderr );
}
}
if ( ber_printf( ber, "}}" ) == -1 ) {
lderr = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
ber_free( ber, 1 );
return( lderr );
}
if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber ))
!= LDAP_SUCCESS ) {
ber_free( ber, 1 );
return( lderr );
}
/* send the message */
rc = nsldapi_send_initial_request( ld, *msgidp, LDAP_REQ_ADD,
(char *) dn, ber );
*msgidp = rc;
return( rc < 0 ? LDAP_GET_LDERRNO( ld, NULL, NULL ) : LDAP_SUCCESS );
}
int
LDAP_CALL
ldap_add_s( LDAP *ld, const char *dn, LDAPMod **attrs )
{
return( ldap_add_ext_s( ld, dn, attrs, NULL, NULL ));
}
int LDAP_CALL
ldap_add_ext_s( LDAP *ld, const char *dn, LDAPMod **attrs,
LDAPControl **serverctrls, LDAPControl **clientctrls )
{
int err, msgid;
LDAPMessage *res;
if (( err = ldap_add_ext( ld, dn, attrs, serverctrls, clientctrls,
&msgid )) != LDAP_SUCCESS ) {
return( err );
}
if ( ldap_result( ld, msgid, 1, (struct timeval *)NULL, &res ) == -1 ) {
return( LDAP_GET_LDERRNO( ld, NULL, NULL ) );
}
return( ldap_result2error( ld, res, 1 ) );
}

View File

@@ -0,0 +1,155 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* bind.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
/*
* ldap_bind - bind to the ldap server (and X.500). The dn and password
* of the entry to which to bind are supplied, along with the authentication
* method to use. The msgid of the bind request is returned on success,
* -1 if there's trouble. Note, the kerberos support assumes the user already
* has a valid tgt for now. ldap_result() should be called to find out the
* outcome of the bind request.
*
* Example:
* ldap_bind( ld, "cn=manager, o=university of michigan, c=us", "secret",
* LDAP_AUTH_SIMPLE )
*/
int
LDAP_CALL
ldap_bind( LDAP *ld, const char *dn, const char *passwd, int authmethod )
{
/*
* The bind request looks like this:
* BindRequest ::= SEQUENCE {
* version INTEGER,
* name DistinguishedName, -- who
* authentication CHOICE {
* simple [0] OCTET STRING -- passwd
* }
* }
* all wrapped up in an LDAPMessage sequence.
*/
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_bind\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( -1 );
}
switch ( authmethod ) {
case LDAP_AUTH_SIMPLE:
return( ldap_simple_bind( ld, dn, passwd ) );
default:
LDAP_SET_LDERRNO( ld, LDAP_AUTH_UNKNOWN, NULL, NULL );
return( -1 );
}
}
/*
* ldap_bind_s - bind to the ldap server (and X.500). The dn and password
* of the entry to which to bind are supplied, along with the authentication
* method to use. This routine just calls whichever bind routine is
* appropriate and returns the result of the bind (e.g. LDAP_SUCCESS or
* some other error indication). Note, the kerberos support assumes the
* user already has a valid tgt for now.
*
* Examples:
* ldap_bind_s( ld, "cn=manager, o=university of michigan, c=us",
* "secret", LDAP_AUTH_SIMPLE )
* ldap_bind_s( ld, "cn=manager, o=university of michigan, c=us",
* NULL, LDAP_AUTH_KRBV4 )
*/
int
LDAP_CALL
ldap_bind_s( LDAP *ld, const char *dn, const char *passwd, int authmethod )
{
int err;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_bind_s\n", 0, 0, 0 );
switch ( authmethod ) {
case LDAP_AUTH_SIMPLE:
return( ldap_simple_bind_s( ld, dn, passwd ) );
default:
err = LDAP_AUTH_UNKNOWN;
LDAP_SET_LDERRNO( ld, err, NULL, NULL );
return( err );
}
}
void
LDAP_CALL
ldap_set_rebind_proc( LDAP *ld, LDAP_REBINDPROC_CALLBACK *rebindproc,
void *arg )
{
if ( ld == NULL ) {
if ( !nsldapi_initialized ) {
nsldapi_initialize_defaults();
}
ld = &nsldapi_ld_defaults;
}
if ( NSLDAPI_VALID_LDAP_POINTER( ld )) {
LDAP_MUTEX_LOCK( ld, LDAP_OPTION_LOCK );
ld->ld_rebind_fn = rebindproc;
ld->ld_rebind_arg = arg;
LDAP_MUTEX_UNLOCK( ld, LDAP_OPTION_LOCK );
}
}
/*
* return a pointer to the bind DN for the default connection (a copy is
* not made). If there is no bind DN available, NULL is returned.
*/
char *
nsldapi_get_binddn( LDAP *ld )
{
char *binddn;
binddn = NULL; /* default -- assume they are not bound */
LDAP_MUTEX_LOCK( ld, LDAP_CONN_LOCK );
if ( NULL != ld->ld_defconn && LDAP_CONNST_CONNECTED ==
ld->ld_defconn->lconn_status && ld->ld_defconn->lconn_bound ) {
if (( binddn = ld->ld_defconn->lconn_binddn ) == NULL ) {
binddn = "";
}
}
LDAP_MUTEX_UNLOCK( ld, LDAP_CONN_LOCK );
return( binddn );
}

View File

@@ -0,0 +1,126 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1993 The Regents of the University of Michigan.
* All rights reserved.
*/
/*
* cache.c - generic caching support for LDAP
*/
#include "ldap-int.h"
/*
* ldap_cache_flush - flush part of the LDAP cache. returns an
* ldap error code (LDAP_SUCCESS, LDAP_NO_SUCH_OBJECT, etc.).
*/
int
LDAP_CALL
ldap_cache_flush( LDAP *ld, const char *dn, const char *filter )
{
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
if ( dn == NULL ) {
dn = "";
}
return( (ld->ld_cache_flush)( ld, dn, filter ) );
}
/*
* nsldapi_add_result_to_cache - add an ldap entry we just read off the network
* to the ldap cache. this routine parses the ber for the entry and
* constructs the appropriate add request. this routine calls the
* cache add routine to actually add the entry.
*/
void
nsldapi_add_result_to_cache( LDAP *ld, LDAPMessage *m )
{
char *dn;
LDAPMod **mods;
int i, max, rc;
char *a;
BerElement *ber;
char buf[50];
struct berval bv;
struct berval *bvp[2];
LDAPDebug( LDAP_DEBUG_TRACE, "=> nsldapi_add_result_to_cache id %d type %d\n",
m->lm_msgid, m->lm_msgtype, 0 );
if ( m->lm_msgtype != LDAP_RES_SEARCH_ENTRY ||
ld->ld_cache_add == NULL ) {
LDAPDebug( LDAP_DEBUG_TRACE,
"<= nsldapi_add_result_to_cache not added\n", 0, 0, 0 );
return;
}
#define GRABSIZE 5
dn = ldap_get_dn( ld, m );
mods = (LDAPMod **)NSLDAPI_MALLOC( GRABSIZE * sizeof(LDAPMod *) );
max = GRABSIZE;
for ( i = 0, a = ldap_first_attribute( ld, m, &ber ); a != NULL;
a = ldap_next_attribute( ld, m, ber ), i++ ) {
if ( i == (max - 1) ) {
max += GRABSIZE;
mods = (LDAPMod **)NSLDAPI_REALLOC( mods,
sizeof(LDAPMod *) * max );
}
mods[i] = (LDAPMod *)NSLDAPI_CALLOC( 1, sizeof(LDAPMod) );
mods[i]->mod_op = LDAP_MOD_BVALUES;
mods[i]->mod_type = a;
mods[i]->mod_bvalues = ldap_get_values_len( ld, m, a );
}
if ( ber != NULL ) {
ber_free( ber, 0 );
}
if (( rc = LDAP_GET_LDERRNO( ld, NULL, NULL )) != LDAP_SUCCESS ) {
LDAPDebug( LDAP_DEBUG_TRACE,
"<= nsldapi_add_result_to_cache error: failed to construct mod list (%s)\n",
ldap_err2string( rc ), 0, 0 );
ldap_mods_free( mods, 1 );
return;
}
/* update special cachedtime attribute */
if ( i == (max - 1) ) {
max++;
mods = (LDAPMod **)NSLDAPI_REALLOC( mods,
sizeof(LDAPMod *) * max );
}
mods[i] = (LDAPMod *)NSLDAPI_CALLOC( 1, sizeof(LDAPMod) );
mods[i]->mod_op = LDAP_MOD_BVALUES;
mods[i]->mod_type = "cachedtime";
sprintf( buf, "%d", time( NULL ) );
bv.bv_val = buf;
bv.bv_len = strlen( buf );
bvp[0] = &bv;
bvp[1] = NULL;
mods[i]->mod_bvalues = bvp;
mods[++i] = NULL;
/* msgid of -1 means don't send the result */
rc = (ld->ld_cache_add)( ld, -1, m->lm_msgtype, dn, mods );
LDAPDebug( LDAP_DEBUG_TRACE,
"<= nsldapi_add_result_to_cache added (rc %d)\n", rc, 0, 0 );
}

View File

@@ -0,0 +1,225 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* charray.c - routines for dealing with char * arrays */
#include "ldap-int.h"
/*
* Add s at the end of the array of strings *a.
* Return 0 for success, -1 for failure.
*/
int
LDAP_CALL
ldap_charray_add(
char ***a,
char *s
)
{
int n;
if ( *a == NULL ) {
*a = (char **)NSLDAPI_MALLOC( 2 * sizeof(char *) );
if ( *a == NULL ) {
return -1;
}
n = 0;
} else {
for ( n = 0; *a != NULL && (*a)[n] != NULL; n++ ) {
; /* NULL */
}
*a = (char **)NSLDAPI_REALLOC( (char *) *a,
(n + 2) * sizeof(char *) );
if ( *a == NULL ) {
return -1;
}
}
(*a)[n++] = s;
(*a)[n] = NULL;
return 0;
}
/*
* Add array of strings s at the end of the array of strings *a.
* Return 0 for success, -1 for failure.
*/
int
LDAP_CALL
ldap_charray_merge(
char ***a,
char **s
)
{
int i, n, nn;
if ( (s == NULL) || (s[0] == NULL) )
return 0;
for ( n = 0; *a != NULL && (*a)[n] != NULL; n++ ) {
; /* NULL */
}
for ( nn = 0; s[nn] != NULL; nn++ ) {
; /* NULL */
}
*a = (char **)NSLDAPI_REALLOC( (char *) *a,
(n + nn + 1) * sizeof(char *) );
if ( *a == NULL ) {
return -1;
}
for ( i = 0; i < nn; i++ ) {
(*a)[n + i] = s[i];
}
(*a)[n + nn] = NULL;
return 0;
}
void
LDAP_CALL
ldap_charray_free( char **array )
{
char **a;
if ( array == NULL ) {
return;
}
for ( a = array; *a != NULL; a++ ) {
if ( *a != NULL ) {
NSLDAPI_FREE( *a );
}
}
NSLDAPI_FREE( (char *) array );
}
int
LDAP_CALL
ldap_charray_inlist(
char **a,
char *s
)
{
int i;
if ( a == NULL )
return( 0 );
for ( i = 0; a[i] != NULL; i++ ) {
if ( strcasecmp( s, a[i] ) == 0 ) {
return( 1 );
}
}
return( 0 );
}
/*
* Duplicate the array of strings a, return NULL upon any memory failure.
*/
char **
LDAP_CALL
ldap_charray_dup( char **a )
{
int i;
char **new;
for ( i = 0; a[i] != NULL; i++ )
; /* NULL */
new = (char **)NSLDAPI_MALLOC( (i + 1) * sizeof(char *) );
if ( new == NULL ) {
return NULL;
}
for ( i = 0; a[i] != NULL; i++ ) {
new[i] = nsldapi_strdup( a[i] );
if ( new[i] == NULL ) {
int j;
for ( j = 0; j < i; j++ )
NSLDAPI_FREE( new[j] );
NSLDAPI_FREE( new );
return NULL;
}
}
new[i] = NULL;
return( new );
}
/*
* Tokenize the string str, return NULL upon any memory failure.
* XXX: on many platforms this function is not thread safe because it
* uses strtok().
*/
char **
LDAP_CALL
ldap_str2charray( char *str, char *brkstr )
/* This implementation fails if brkstr contains multibyte characters.
But it works OK if str is UTF-8 and brkstr is 7-bit ASCII.
*/
{
char **res;
char *s;
int i;
i = 1;
for ( s = str; *s; s++ ) {
if ( strchr( brkstr, *s ) != NULL ) {
i++;
}
}
res = (char **)NSLDAPI_MALLOC( (i + 1) * sizeof(char *) );
if ( res == NULL ) {
return NULL;
}
i = 0;
for ( s = strtok( str, brkstr ); s != NULL; s = strtok( NULL,
brkstr ) ) {
res[i++] = nsldapi_strdup( s );
if ( res[i - 1] == NULL ) {
int j;
for ( j = 0; j < (i - 1); j++ )
NSLDAPI_FREE( res[j] );
NSLDAPI_FREE( res );
return NULL;
}
}
res[i] = NULL;
return( res );
}
int
LDAP_CALL
ldap_charray_position( char **a, char *s )
{
int i;
for ( i = 0; a[i] != NULL; i++ ) {
if ( strcasecmp( s, a[i] ) == 0 ) {
return( i );
}
}
return( -1 );
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,564 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990, 1994 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* cldap.c - synchronous, retrying interface to the cldap protocol
*/
#ifdef CLDAP
XXX not MT-safe XXX
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990, 1994 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
#ifdef macintosh
#include <stdlib.h>
#include "macos.h"
#else /* macintosh */
#ifdef DOS
#include "msdos.h"
#else /* DOS */
#ifdef _WINDOWS
#include <windows.h>
#else /* _WINDOWS */
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#endif /* _WINDOWS */
#endif /* DOS */
#endif /* macintosh */
#include "ldap-int.h"
#define DEF_CLDAP_TIMEOUT 3
#define DEF_CLDAP_TRIES 4
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
#endif
struct cldap_retinfo {
int cri_maxtries;
int cri_try;
int cri_useaddr;
long cri_timeout;
};
#ifdef NEEDPROTOS
static int add_addr( LDAP *ld, struct sockaddr *sap );
static int cldap_result( LDAP *ld, int msgid, LDAPMessage **res,
struct cldap_retinfo *crip, char *base );
static int cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber,
LDAPMessage **res, char *base );
#else /* NEEDPROTOS */
static int add_addr();
static int cldap_result();
static int cldap_parsemsg();
#endif /* NEEDPROTOS */
/*
* cldap_open - initialize and connect to an ldap server. A magic cookie to
* be used for future communication is returned on success, NULL on failure.
*
* Example:
* LDAP *ld;
* ld = cldap_open( hostname, port );
*/
LDAP *
cldap_open( char *host, int port )
{
int s;
unsigned long address;
struct sockaddr_in sock;
struct hostent *hp;
LDAP *ld;
char *p;
int i;
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_open\n", 0, 0, 0 );
if ( port == 0 ) {
port = LDAP_PORT;
}
if ( (s = socket( AF_INET, SOCK_DGRAM, 0 )) < 0 ) {
return( NULL );
}
sock.sin_addr.s_addr = 0;
sock.sin_family = AF_INET;
sock.sin_port = 0;
if ( bind(s, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
close( s );
return( NULL );
}
if (( ld = ldap_init( host, port )) == NULL ) {
close( s );
return( NULL );
}
if ( (ld->ld_sbp->sb_fromaddr = (void *)NSLDAPI_CALLOC( 1,
sizeof( struct sockaddr ))) == NULL ) {
NSLDAPI_FREE( ld );
close( s );
return( NULL );
}
ld->ld_sbp->sb_sd = s;
ld->ld_sbp->sb_naddr = 0;
ld->ld_version = LDAP_VERSION;
sock.sin_family = AF_INET;
sock.sin_port = htons( port );
/*
* 'host' may be a space-separated list.
*/
if ( host != NULL ) {
for ( ; host != NULL; host = p ) {
if (( p = strchr( host, ' ' )) != NULL ) {
for (*p++ = '\0'; *p == ' '; p++) {
;
}
}
if ( (address = inet_addr( host )) == -1 ) {
/* XXXmcs: need to use DNS callbacks here XXX */
XXX
if ( (hp = gethostbyname( host )) == NULL ) {
LDAP_SET_ERRNO( ld, EHOSTUNREACH );
continue;
}
for ( i = 0; hp->h_addr_list[ i ] != 0; ++i ) {
SAFEMEMCPY( (char *)&sock.sin_addr.s_addr,
(char *)hp->h_addr_list[ i ],
sizeof(sock.sin_addr.s_addr));
if ( add_addr( ld, (struct sockaddr *)&sock ) < 0 ) {
close( s );
NSLDAPI_FREE( ld );
return( NULL );
}
}
} else {
sock.sin_addr.s_addr = address;
if ( add_addr( ld, (struct sockaddr *)&sock ) < 0 ) {
close( s );
NSLDAPI_FREE( ld );
return( NULL );
}
}
if ( ld->ld_host == NULL ) {
ld->ld_host = nsldapi_strdup( host );
}
}
} else {
address = INADDR_LOOPBACK;
sock.sin_addr.s_addr = htonl( address );
if ( add_addr( ld, (struct sockaddr *)&sock ) < 0 ) {
close( s );
NSLDAPI_FREE( ld );
return( NULL );
}
}
if ( ld->ld_sbp->sb_addrs == NULL
|| ( ld->ld_defconn = nsldapi_new_connection( ld, NULL, 1,0,0 )) == NULL ) {
NSLDAPI_FREE( ld );
return( NULL );
}
ld->ld_sbp->sb_useaddr = ld->ld_sbp->sb_addrs[ 0 ];
cldap_setretryinfo( ld, 0, 0 );
#ifdef LDAP_DEBUG
putchar( '\n' );
for ( i = 0; i < ld->ld_sbp->sb_naddr; ++i ) {
LDAPDebug( LDAP_DEBUG_TRACE, "end of cldap_open address %d is %s\n",
i, inet_ntoa( ((struct sockaddr_in *)
ld->ld_sbp->sb_addrs[ i ])->sin_addr ), 0 );
}
#endif
return( ld );
}
void
cldap_close( LDAP *ld )
{
ldap_ld_free( ld, 0 );
}
void
cldap_setretryinfo( LDAP *ld, int tries, int timeout )
{
ld->ld_cldaptries = ( tries <= 0 ) ? DEF_CLDAP_TRIES : tries;
ld->ld_cldaptimeout = ( timeout <= 0 ) ? DEF_CLDAP_TIMEOUT : timeout;
}
int
cldap_search_s( LDAP *ld, char *base, int scope, char *filter, char **attrs,
int attrsonly, LDAPMessage **res, char *logdn )
{
int ret, msgid;
struct cldap_retinfo cri;
*res = NULLMSG;
(void) memset( &cri, 0, sizeof( cri ));
if ( logdn != NULL ) {
ld->ld_cldapdn = logdn;
} else if ( ld->ld_cldapdn == NULL ) {
ld->ld_cldapdn = "";
}
do {
if ( cri.cri_try != 0 ) {
--ld->ld_msgid; /* use same id as before */
}
ld->ld_sbp->sb_useaddr = ld->ld_sbp->sb_addrs[ cri.cri_useaddr ];
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_search_s try %d (to %s)\n",
cri.cri_try, inet_ntoa( ((struct sockaddr_in *)
ld->ld_sbp->sb_useaddr)->sin_addr ), 0 );
if ( (msgid = ldap_search( ld, base, scope, filter, attrs,
attrsonly )) == -1 ) {
return( LDAP_GET_LDERRNO( ld, NULL, NULL ) );
}
#ifndef NO_CACHE
if ( ld->ld_cache != NULL && ld->ld_responses != NULL ) {
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_search_s res from cache\n",
0, 0, 0 );
*res = ld->ld_responses;
ld->ld_responses = ld->ld_responses->lm_next;
return( ldap_result2error( ld, *res, 0 ));
}
#endif /* NO_CACHE */
ret = cldap_result( ld, msgid, res, &cri, base );
} while (ret == -1);
return( ret );
}
static int
add_addr( LDAP *ld, struct sockaddr *sap )
{
struct sockaddr *newsap, **addrs;
if (( newsap = (struct sockaddr *)NSLDAPI_MALLOC(
sizeof( struct sockaddr ))) == NULL ) {
LDAP_SET_LDERRNO( ld, LDAP_NO_MEMORY, NULL, NULL );
return( -1 );
}
if ( ld->ld_sbp->sb_naddr == 0 ) {
addrs = (struct sockaddr **)NSLDAPI_MALLOC( sizeof(struct sockaddr *));
} else {
addrs = (struct sockaddr **)NSLDAPI_REALLOC( ld->ld_sbp->sb_addrs,
( ld->ld_sbp->sb_naddr + 1 ) * sizeof(struct sockaddr *));
}
if ( addrs == NULL ) {
NSLDAPI_FREE( newsap );
LDAP_SET_LDERRNO( ld, LDAP_NO_MEMORY, NULL, NULL );
return( -1 );
}
SAFEMEMCPY( (char *)newsap, (char *)sap, sizeof( struct sockaddr ));
addrs[ ld->ld_sbp->sb_naddr++ ] = newsap;
ld->ld_sbp->sb_addrs = (void **)addrs;
return( 0 );
}
static int
cldap_result( LDAP *ld, int msgid, LDAPMessage **res,
struct cldap_retinfo *crip, char *base )
{
Sockbuf *sb = ld->ld_sbp;
BerElement ber;
char *logdn;
int ret, id, fromaddr, i;
struct timeval tv;
fromaddr = -1;
if ( crip->cri_try == 0 ) {
crip->cri_maxtries = ld->ld_cldaptries * sb->sb_naddr;
crip->cri_timeout = ld->ld_cldaptimeout;
crip->cri_useaddr = 0;
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_result tries %d timeout %d\n",
ld->ld_cldaptries, ld->ld_cldaptimeout, 0 );
}
if ((tv.tv_sec = crip->cri_timeout / sb->sb_naddr) < 1 ) {
tv.tv_sec = 1;
}
tv.tv_usec = 0;
LDAPDebug( LDAP_DEBUG_TRACE,
"cldap_result waiting up to %d seconds for a response\n",
tv.tv_sec, 0, 0 );
ber_init_w_nullchar( &ber, 0 );
nsldapi_set_ber_options( ld, &ber );
if ( cldap_getmsg( ld, &tv, &ber ) == -1 ) {
ret = LDAP_GET_LDERRNO( ld, NULL, NULL );
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_getmsg returned -1 (%d)\n",
ret, 0, 0 );
} else if ( LDAP_GET_LDERRNO( ld, NULL, NULL ) == LDAP_TIMEOUT ) {
LDAPDebug( LDAP_DEBUG_TRACE,
"cldap_result timed out\n", 0, 0, 0 );
/*
* It timed out; is it time to give up?
*/
if ( ++crip->cri_try >= crip->cri_maxtries ) {
ret = LDAP_TIMEOUT;
--crip->cri_try;
} else {
if ( ++crip->cri_useaddr >= sb->sb_naddr ) {
/*
* new round: reset address to first one and
* double the timeout
*/
crip->cri_useaddr = 0;
crip->cri_timeout <<= 1;
}
ret = -1;
}
} else {
/*
* Got a response. It should look like:
* { msgid, logdn, { searchresponse...}}
*/
logdn = NULL;
if ( ber_scanf( &ber, "ia", &id, &logdn ) == LBER_ERROR ) {
NSLDAPI_FREE( ber.ber_buf ); /* gack! */
ret = LDAP_DECODING_ERROR;
LDAPDebug( LDAP_DEBUG_TRACE,
"cldap_result: ber_scanf returned LBER_ERROR (%d)\n",
ret, 0, 0 );
} else if ( id != msgid ) {
NSLDAPI_FREE( ber.ber_buf ); /* gack! */
LDAPDebug( LDAP_DEBUG_TRACE,
"cldap_result: looking for msgid %d; got %d\n",
msgid, id, 0 );
ret = -1; /* ignore and keep looking */
} else {
/*
* got a result: determine which server it came from
* decode into ldap message chain
*/
for ( fromaddr = 0; fromaddr < sb->sb_naddr; ++fromaddr ) {
if ( memcmp( &((struct sockaddr_in *)
sb->sb_addrs[ fromaddr ])->sin_addr,
&((struct sockaddr_in *)sb->sb_fromaddr)->sin_addr,
sizeof( struct in_addr )) == 0 ) {
break;
}
}
ret = cldap_parsemsg( ld, msgid, &ber, res, base );
NSLDAPI_FREE( ber.ber_buf ); /* gack! */
LDAPDebug( LDAP_DEBUG_TRACE,
"cldap_result got result (%d)\n", ret, 0, 0 );
}
if ( logdn != NULL ) {
NSLDAPI_FREE( logdn );
}
}
/*
* If we are giving up (successfully or otherwise) then
* abandon any outstanding requests.
*/
if ( ret != -1 ) {
i = crip->cri_try;
if ( i >= sb->sb_naddr ) {
i = sb->sb_naddr - 1;
}
for ( ; i >= 0; --i ) {
if ( i == fromaddr ) {
continue;
}
sb->sb_useaddr = sb->sb_addrs[ i ];
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_result abandoning id %d (to %s)\n",
msgid, inet_ntoa( ((struct sockaddr_in *)
sb->sb_useaddr)->sin_addr ), 0 );
(void) ldap_abandon( ld, msgid );
}
}
LDAP_SET_LDERRNO( ld, ret, NULL, NULL );
return( ret );
}
static int
cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber,
LDAPMessage **res, char *base )
{
unsigned long tag, len;
int baselen, slen, rc;
char *dn, *p, *cookie;
LDAPMessage *chain, *prev, *ldm;
struct berval *bv;
rc = LDAP_DECODING_ERROR; /* pessimistic */
ldm = chain = prev = NULLMSG;
baselen = ( base == NULL ) ? 0 : strlen( base );
bv = NULL;
for ( tag = ber_first_element( ber, &len, &cookie );
tag != LBER_ERROR && tag != LBER_END_OF_SEQOFSET
&& rc != LDAP_SUCCESS;
tag = ber_next_element( ber, &len, cookie )) {
if (( ldm = (LDAPMessage *)NSLDAPI_CALLOC( 1, sizeof(LDAPMessage)))
== NULL ) {
rc = LDAP_NO_MEMORY;
break; /* return with error */
} else if (( rc = nsldapi_alloc_ber_with_options( ld, &ldm->lm_ber ))
!= LDAP_SUCCESS ) {
break; /* return with error*/
}
ldm->lm_msgid = msgid;
ldm->lm_msgtype = tag;
if ( tag == LDAP_RES_SEARCH_RESULT ) {
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_parsemsg got search result\n",
0, 0, 0 );
if ( ber_get_stringal( ber, &bv ) == LBER_DEFAULT ) {
break; /* return w/error */
}
if ( ber_printf( ldm->lm_ber, "to", tag, bv->bv_val,
bv->bv_len ) == -1 ) {
break; /* return w/error */
}
ber_bvfree( bv );
bv = NULL;
rc = LDAP_SUCCESS;
} else if ( tag == LDAP_RES_SEARCH_ENTRY ) {
if ( ber_scanf( ber, "{aO", &dn, &bv ) == LBER_ERROR ) {
break; /* return w/error */
}
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_parsemsg entry %s\n", dn, 0, 0 );
if ( dn != NULL && *(dn + ( slen = strlen(dn)) - 1) == '*' &&
baselen > 0 ) {
/*
* substitute original searchbase for trailing '*'
*/
if (( p = (char *)NSLDAPI_MALLOC( slen + baselen )) == NULL ) {
rc = LDAP_NO_MEMORY;
NSLDAPI_FREE( dn );
break; /* return w/error */
}
strcpy( p, dn );
strcpy( p + slen - 1, base );
NSLDAPI_FREE( dn );
dn = p;
}
if ( ber_printf( ldm->lm_ber, "t{so}", tag, dn, bv->bv_val,
bv->bv_len ) == -1 ) {
break; /* return w/error */
}
NSLDAPI_FREE( dn );
ber_bvfree( bv );
bv = NULL;
} else {
LDAPDebug( LDAP_DEBUG_TRACE, "cldap_parsemsg got unknown tag %d\n",
tag, 0, 0 );
rc = LDAP_PROTOCOL_ERROR;
break; /* return w/error */
}
/* Reset message ber so we can read from it later. Gack! */
ldm->lm_ber->ber_end = ldm->lm_ber->ber_ptr;
ldm->lm_ber->ber_ptr = ldm->lm_ber->ber_buf;
#ifdef LDAP_DEBUG
if ( ldap_debug & LDAP_DEBUG_PACKETS ) {
char msg[80];
sprintf( msg, "cldap_parsemsg add message id %d type %d:\n",
ldm->lm_msgid, ldm->lm_msgtype );
ber_err_print( msg );
ber_dump( ldm->lm_ber, 1 );
}
#endif /* LDAP_DEBUG */
#ifndef NO_CACHE
if ( ld->ld_cache != NULL ) {
nsldapi_add_result_to_cache( ld, ldm );
}
#endif /* NO_CACHE */
if ( chain == NULL ) {
chain = ldm;
} else {
prev->lm_chain = ldm;
}
prev = ldm;
ldm = NULL;
}
/* dispose of any leftovers */
if ( ldm != NULL ) {
if ( ldm->lm_ber != NULLBER ) {
ber_free( ldm->lm_ber, 1 );
}
NSLDAPI_FREE( ldm );
}
if ( bv != NULL ) {
ber_bvfree( bv );
}
/* return chain, calling result2error if we got anything at all */
*res = chain;
return(( *res == NULLMSG ) ? rc : ldap_result2error( ld, *res, 0 ));
}
#endif /* CLDAP */

View File

@@ -0,0 +1,174 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* compare.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
/*
* ldap_compare - perform an ldap (and X.500) compare operation. The dn
* of the entry to compare to and the attribute and value to compare (in
* attr and value) are supplied. The msgid of the response is returned.
*
* Example:
* ldap_compare( ld, "c=us@cn=bob", "userPassword", "secret" )
*/
int
LDAP_CALL
ldap_compare( LDAP *ld, const char *dn, const char *attr, const char *value )
{
int msgid;
struct berval bv;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 );
bv.bv_val = (char *)value;
bv.bv_len = ( value == NULL ) ? 0 : strlen( value );
if ( ldap_compare_ext( ld, dn, attr, &bv, NULL, NULL, &msgid )
== LDAP_SUCCESS ) {
return( msgid );
} else {
return( -1 ); /* error is in ld handle */
}
}
int
LDAP_CALL
ldap_compare_ext( LDAP *ld, const char *dn, const char *attr,
struct berval *bvalue, LDAPControl **serverctrls,
LDAPControl **clientctrls, int *msgidp )
{
BerElement *ber;
int rc, lderr;
/* The compare request looks like this:
* CompareRequest ::= SEQUENCE {
* entry DistinguishedName,
* ava SEQUENCE {
* type AttributeType,
* value AttributeValue
* }
* }
* and must be wrapped in an LDAPMessage.
*/
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_compare_ext\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
if ( attr == NULL || bvalue == NULL || bvalue->bv_len == 0
|| msgidp == NULL ) {
lderr = LDAP_PARAM_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
return( lderr );
}
if ( dn == NULL ) {
dn = "";
}
LDAP_MUTEX_LOCK( ld, LDAP_MSGID_LOCK );
*msgidp = ++ld->ld_msgid;
LDAP_MUTEX_UNLOCK( ld, LDAP_MSGID_LOCK );
/* check the cache */
if ( ld->ld_cache_on && ld->ld_cache_compare != NULL ) {
LDAP_MUTEX_LOCK( ld, LDAP_CACHE_LOCK );
if ( (rc = (ld->ld_cache_compare)( ld, *msgidp,
LDAP_REQ_COMPARE, dn, attr, bvalue )) != 0 ) {
*msgidp = rc;
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
return( LDAP_SUCCESS );
}
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
}
/* create a message to send */
if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber ))
!= LDAP_SUCCESS ) {
return( lderr );
}
if ( ber_printf( ber, "{it{s{so}}", *msgidp, LDAP_REQ_COMPARE,
dn, attr, bvalue->bv_val, bvalue->bv_len ) == -1 ) {
lderr = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
ber_free( ber, 1 );
return( lderr );
}
if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber ))
!= LDAP_SUCCESS ) {
ber_free( ber, 1 );
return( lderr );
}
/* send the message */
rc = nsldapi_send_initial_request( ld, *msgidp, LDAP_REQ_COMPARE,
(char *)dn, ber );
*msgidp = rc;
return( rc < 0 ? LDAP_GET_LDERRNO( ld, NULL, NULL ) : LDAP_SUCCESS );
}
int
LDAP_CALL
ldap_compare_s( LDAP *ld, const char *dn, const char *attr,
const char *value )
{
struct berval bv;
bv.bv_val = (char *)value;
bv.bv_len = ( value == NULL ) ? 0 : strlen( value );
return( ldap_compare_ext_s( ld, dn, attr, &bv, NULL, NULL ));
}
int
LDAP_CALL
ldap_compare_ext_s( LDAP *ld, const char *dn, const char *attr,
struct berval *bvalue, LDAPControl **serverctrls,
LDAPControl **clientctrls )
{
int err, msgid;
LDAPMessage *res;
if (( err = ldap_compare_ext( ld, dn, attr, bvalue, serverctrls,
clientctrls, &msgid )) != LDAP_SUCCESS ) {
return( err );
}
if ( ldap_result( ld, msgid, 1, (struct timeval *)NULL, &res )
== -1 ) {
return( LDAP_GET_LDERRNO( ld, NULL, NULL ) );
}
return( ldap_result2error( ld, res, 1 ) );
}

View File

@@ -0,0 +1,63 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1994 The Regents of the University of Michigan.
* All rights reserved.
*/
/*
* compat.c - compatibility routines.
*
*/
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1994 The Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#include "ldap-int.h"
#if defined( HPUX10 ) && defined( _REENTRANT )
extern int h_errno;
struct hostent *
nsldapi_compat_gethostbyname_r( const char *name, struct hostent *result,
char *buffer, int buflen, int *h_errnop )
{
struct hostent_data *hep;
if ( buflen < sizeof(struct hostent_data)) { /* sanity check */
*h_errnop = NO_RECOVERY; /* XXX best error code to use? */
return( NULL );
}
hep = (struct hostent_data *)buffer;
hep->current = NULL;
if ( gethostbyname_r( name, result, hep ) == -1) {
*h_errnop = h_errno; /* XXX don't see anywhere else to get this */
return NULL;
}
return result;
}
char *
nsldapi_compat_ctime_r( const time_t *clock, char *buf, int buflen )
{
(void) ctime_r( clock, buf, buflen );
return buf;
}
#endif /* HPUX10 && _REENTRANT */

View File

@@ -0,0 +1,499 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* control.c - routines to handle ldapv3 controls */
#include "ldap-int.h"
static LDAPControl *ldap_control_dup( LDAPControl *ctrl );
static int ldap_control_copy_contents( LDAPControl *ctrl_dst,
LDAPControl *ctrl_src );
/*
* Append a list of LDAPv3 controls to ber. If ctrls is NULL, use default
* set of controls from ld.
* Return an LDAP error code (LDAP_SUCCESS if all goes well).
* If closeseq is non-zero, we do an extra ber_put_seq() as well.
*/
int
nsldapi_put_controls( LDAP *ld, LDAPControl **ctrls, int closeseq,
BerElement *ber )
{
LDAPControl *c;
int rc, i;
rc = LDAP_ENCODING_ERROR; /* the most popular error */
/* if no controls were passed in, use global list from LDAP * */
LDAP_MUTEX_LOCK( ld, LDAP_CTRL_LOCK );
if ( ctrls == NULL ) {
ctrls = ld->ld_servercontrols;
}
/* if there are no controls then we are done */
if ( ctrls == NULL || ctrls[ 0 ] == NULL ) {
goto clean_exit;
}
/*
* If we're using LDAPv2 or earlier we can't send any controls, so
* we just ignore them unless one is marked critical, in which case
* we return an error.
*/
if ( NSLDAPI_LDAP_VERSION( ld ) < LDAP_VERSION3 ) {
for ( i = 0; ctrls != NULL && ctrls[i] != NULL; i++ ) {
if ( ctrls[i]->ldctl_iscritical ) {
rc = LDAP_NOT_SUPPORTED;
goto error_exit;
}
}
goto clean_exit;
}
/*
* encode the controls as a Sequence of Sequence
*/
if ( ber_printf( ber, "t{", LDAP_TAG_CONTROLS ) == -1 ) {
goto error_exit;
}
for ( i = 0; ctrls[i] != NULL; i++ ) {
c = ctrls[i];
if ( ber_printf( ber, "{s", c->ldctl_oid ) == -1 ) {
goto error_exit;
}
/* criticality is "BOOLEAN DEFAULT FALSE" */
/* therefore, it should only be encoded if it exists AND is TRUE */
if ( c->ldctl_iscritical ) {
if ( ber_printf( ber, "b", c->ldctl_iscritical )
== -1 ) {
goto error_exit;
}
}
if ( c->ldctl_value.bv_val != NULL ) {
if ( ber_printf( ber, "o", c->ldctl_value.bv_val,
c->ldctl_value.bv_len ) == -1 ) {
goto error_exit;
}
}
if ( ber_put_seq( ber ) == -1 ) {
goto error_exit;
}
}
if ( ber_put_seq( ber ) == -1 ) {
goto error_exit;
}
clean_exit:
LDAP_MUTEX_UNLOCK( ld, LDAP_CTRL_LOCK );
if ( closeseq && ber_put_seq( ber ) == -1 ) {
goto error_exit;
}
return( LDAP_SUCCESS );
error_exit:
LDAP_MUTEX_UNLOCK( ld, LDAP_CTRL_LOCK );
LDAP_SET_LDERRNO( ld, rc, NULL, NULL );
return( rc );
}
/*
* Pull controls out of "ber" (if any present) and return them in "controlsp."
* Returns an LDAP error code.
*/
int
nsldapi_get_controls( BerElement *ber, LDAPControl ***controlsp )
{
LDAPControl *newctrl;
unsigned long tag, len;
int rc, maxcontrols, curcontrols;
char *last;
/*
* Each LDAPMessage can have a set of controls appended
* to it. Controls are used to extend the functionality
* of an LDAP operation (e.g., add an attribute size limit
* to the search operation). These controls look like this:
*
* Controls ::= SEQUENCE OF Control
*
* Control ::= SEQUENCE {
* controlType LDAPOID,
* criticality BOOLEAN DEFAULT FALSE,
* controlValue OCTET STRING
* }
*/
LDAPDebug( LDAP_DEBUG_TRACE, "=> nsldapi_get_controls\n", 0, 0, 0 );
*controlsp = NULL;
/*
* check to see if controls were included
*/
if ( ber_get_option( ber, LBER_OPT_REMAINING_BYTES, &len ) != 0 ) {
return( LDAP_DECODING_ERROR ); /* unexpected error */
}
if ( len == 0 ) {
LDAPDebug( LDAP_DEBUG_TRACE,
"<= nsldapi_get_controls no controls\n", 0, 0, 0 );
return( LDAP_SUCCESS ); /* no controls */
}
if (( tag = ber_peek_tag( ber, &len )) != LDAP_TAG_CONTROLS ) {
if ( tag == LBER_ERROR ) {
LDAPDebug( LDAP_DEBUG_TRACE,
"<= nsldapi_get_controls LDAP_PROTOCOL_ERROR\n",
0, 0, 0 );
return( LDAP_DECODING_ERROR ); /* decoding error */
}
/*
* We found something other than controls. This should never
* happen in LDAPv3, but we don't treat this is a hard error --
* we just ignore the extra stuff.
*/
LDAPDebug( LDAP_DEBUG_TRACE,
"<= nsldapi_get_controls ignoring unrecognized data in message (tag 0x%x)\n",
tag, 0, 0 );
return( LDAP_SUCCESS );
}
maxcontrols = curcontrols = 0;
for ( tag = ber_first_element( ber, &len, &last );
tag != LBER_ERROR && tag != LBER_END_OF_SEQORSET;
tag = ber_next_element( ber, &len, last ) ) {
if ( curcontrols >= maxcontrols - 1 ) {
#define CONTROL_GRABSIZE 5
maxcontrols += CONTROL_GRABSIZE;
*controlsp = (struct ldapcontrol **)NSLDAPI_REALLOC(
(char *)*controlsp, maxcontrols *
sizeof(struct ldapcontrol *) );
if ( *controlsp == NULL ) {
rc = LDAP_NO_MEMORY;
goto free_and_return;
}
}
if (( newctrl = (struct ldapcontrol *)NSLDAPI_CALLOC( 1,
sizeof(LDAPControl))) == NULL ) {
rc = LDAP_NO_MEMORY;
goto free_and_return;
}
(*controlsp)[curcontrols++] = newctrl;
(*controlsp)[curcontrols] = NULL;
if ( ber_scanf( ber, "{a", &newctrl->ldctl_oid )
== LBER_ERROR ) {
rc = LDAP_DECODING_ERROR;
goto free_and_return;
}
/* the criticality is optional */
if ( ber_peek_tag( ber, &len ) == LBER_BOOLEAN ) {
if ( ber_scanf( ber, "b", &newctrl->ldctl_iscritical )
== LBER_ERROR ) {
rc = LDAP_DECODING_ERROR;
goto free_and_return;
}
} else {
/* absent is synonomous with FALSE */
newctrl->ldctl_iscritical = 0;
}
/* the control value is optional */
if ( ber_peek_tag( ber, &len ) == LBER_OCTETSTRING ) {
if ( ber_scanf( ber, "o", &newctrl->ldctl_value )
== LBER_ERROR ) {
rc = LDAP_DECODING_ERROR;
goto free_and_return;
}
} else {
(newctrl->ldctl_value).bv_val = NULL;
(newctrl->ldctl_value).bv_len = 0;
}
}
if ( tag == LBER_ERROR ) {
rc = LDAP_DECODING_ERROR;
goto free_and_return;
}
LDAPDebug( LDAP_DEBUG_TRACE,
"<= nsldapi_get_controls found %d controls\n", curcontrols, 0, 0 );
return( LDAP_SUCCESS );
free_and_return:;
ldap_controls_free( *controlsp );
*controlsp = NULL;
LDAPDebug( LDAP_DEBUG_TRACE,
"<= nsldapi_get_controls error 0x%x\n", rc, 0, 0 );
return( rc );
}
void
LDAP_CALL
ldap_control_free( LDAPControl *ctrl )
{
if ( ctrl != NULL ) {
if ( ctrl->ldctl_oid != NULL ) {
NSLDAPI_FREE( ctrl->ldctl_oid );
}
if ( ctrl->ldctl_value.bv_val != NULL ) {
NSLDAPI_FREE( ctrl->ldctl_value.bv_val );
}
NSLDAPI_FREE( (char *)ctrl );
}
}
void
LDAP_CALL
ldap_controls_free( LDAPControl **ctrls )
{
int i;
if ( ctrls != NULL ) {
for ( i = 0; ctrls[i] != NULL; i++ ) {
ldap_control_free( ctrls[i] );
}
NSLDAPI_FREE( (char *)ctrls );
}
}
int
LDAP_CALL
ldap_controls_count( LDAPControl **ctrls )
{
int nctrls = 0;
if ( NULL != ctrls ) {
while( NULL != ctrls[nctrls] ) {
nctrls++;
}
}
return nctrls;
}
#if 0
LDAPControl **
LDAP_CALL
ldap_control_append( LDAPControl **ctrl_src, LDAPControl *ctrl )
{
int nctrls = 0;
LDAPControl **ctrlp;
int i;
if ( NULL == ctrl )
return ( NULL );
/* Count the existing controls */
if ( NULL != ctrl_src ) {
while( NULL != ctrl_src[nctrls] ) {
nctrls++;
}
}
/* allocate the new control structure */
if ( ( ctrlp = (LDAPControl **)NSLDAPI_MALLOC( sizeof(LDAPControl *)
* (nctrls + 2) ) ) == NULL ) {
return( NULL );
}
memset( ctrlp, 0, sizeof(*ctrlp) * (nctrls + 2) );
for( i = 0; i < (nctrls + 1); i++ ) {
if ( i < nctrls ) {
ctrlp[i] = ldap_control_dup( ctrl_src[i] );
} else {
ctrlp[i] = ldap_control_dup( ctrl );
}
if ( NULL == ctrlp[i] ) {
ldap_controls_free( ctrlp );
return( NULL );
}
}
return ctrlp;
}
#endif /* 0 */
/*
* Replace *ldctrls with a copy of newctrls.
* returns 0 if successful.
* return -1 if not and set error code inside LDAP *ld.
*/
int
nsldapi_dup_controls( LDAP *ld, LDAPControl ***ldctrls, LDAPControl **newctrls )
{
int count;
if ( *ldctrls != NULL ) {
ldap_controls_free( *ldctrls );
}
if ( newctrls == NULL || newctrls[0] == NULL ) {
*ldctrls = NULL;
return( 0 );
}
for ( count = 0; newctrls[ count ] != NULL; ++count ) {
;
}
if (( *ldctrls = (LDAPControl **)NSLDAPI_MALLOC(( count + 1 ) *
sizeof( LDAPControl *))) == NULL ) {
LDAP_SET_LDERRNO( ld, LDAP_NO_MEMORY, NULL, NULL );
return( -1 );
}
(*ldctrls)[ count ] = NULL;
for ( count = 0; newctrls[ count ] != NULL; ++count ) {
if (( (*ldctrls)[ count ] =
ldap_control_dup( newctrls[ count ] )) == NULL ) {
ldap_controls_free( *ldctrls );
*ldctrls = NULL;
LDAP_SET_LDERRNO( ld, LDAP_NO_MEMORY, NULL, NULL );
return( -1 );
}
}
return( 0 );
}
/*
* return a malloc'd copy of "ctrl" (NULL if memory allocation fails)
*/
static LDAPControl *
/* LDAP_CALL */ /* keep this routine internal for now */
ldap_control_dup( LDAPControl *ctrl )
{
LDAPControl *rctrl;
if (( rctrl = (LDAPControl *)NSLDAPI_MALLOC( sizeof( LDAPControl )))
== NULL ) {
return( NULL );
}
if ( ldap_control_copy_contents( rctrl, ctrl ) != LDAP_SUCCESS ) {
NSLDAPI_FREE( rctrl );
return( NULL );
}
return( rctrl );
}
/*
* duplicate the contents of "ctrl_src" and place in "ctrl_dst"
*/
static int
/* LDAP_CALL */ /* keep this routine internal for now */
ldap_control_copy_contents( LDAPControl *ctrl_dst, LDAPControl *ctrl_src )
{
size_t len;
if ( NULL == ctrl_dst || NULL == ctrl_src ) {
return( LDAP_PARAM_ERROR );
}
ctrl_dst->ldctl_iscritical = ctrl_src->ldctl_iscritical;
/* fill in the fields of this new control */
if (( ctrl_dst->ldctl_oid = nsldapi_strdup( ctrl_src->ldctl_oid ))
== NULL ) {
return( LDAP_NO_MEMORY );
}
len = (size_t)(ctrl_src->ldctl_value).bv_len;
if ( ctrl_src->ldctl_value.bv_val == NULL || len <= 0 ) {
ctrl_dst->ldctl_value.bv_len = 0;
ctrl_dst->ldctl_value.bv_val = NULL;
} else {
ctrl_dst->ldctl_value.bv_len = len;
if (( ctrl_dst->ldctl_value.bv_val = NSLDAPI_MALLOC( len ))
== NULL ) {
NSLDAPI_FREE( ctrl_dst->ldctl_oid );
return( LDAP_NO_MEMORY );
}
SAFEMEMCPY( ctrl_dst->ldctl_value.bv_val,
ctrl_src->ldctl_value.bv_val, len );
}
return ( LDAP_SUCCESS );
}
/*
* build an allocated LDAPv3 control. Returns an LDAP error code.
*/
int
nsldapi_build_control( char *oid, BerElement *ber, int freeber, char iscritical,
LDAPControl **ctrlp )
{
int rc;
struct berval *bvp;
if ( ber == NULL ) {
bvp = NULL;
} else {
/* allocate struct berval with contents of the BER encoding */
rc = ber_flatten( ber, &bvp );
if ( freeber ) {
ber_free( ber, 1 );
}
if ( rc == -1 ) {
return( LDAP_NO_MEMORY );
}
}
/* allocate the new control structure */
if (( *ctrlp = (LDAPControl *)NSLDAPI_MALLOC( sizeof(LDAPControl)))
== NULL ) {
if ( bvp != NULL ) {
ber_bvfree( bvp );
}
return( LDAP_NO_MEMORY );
}
/* fill in the fields of this new control */
(*ctrlp)->ldctl_iscritical = iscritical;
if (( (*ctrlp)->ldctl_oid = nsldapi_strdup( oid )) == NULL ) {
NSLDAPI_FREE( *ctrlp );
if ( bvp != NULL ) {
ber_bvfree( bvp );
}
return( LDAP_NO_MEMORY );
}
if ( bvp == NULL ) {
(*ctrlp)->ldctl_value.bv_len = 0;
(*ctrlp)->ldctl_value.bv_val = NULL;
} else {
(*ctrlp)->ldctl_value = *bvp; /* struct copy */
NSLDAPI_FREE( bvp ); /* free container, not contents! */
}
return( LDAP_SUCCESS );
}

View File

@@ -0,0 +1,48 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* countvalues.c
*/
#include "ldap-int.h"
int
LDAP_CALL
ldap_count_values( char **vals )
{
int i;
if ( vals == NULL )
return( 0 );
for ( i = 0; vals[i] != NULL; i++ )
; /* NULL */
return( i );
}
int
LDAP_CALL
ldap_count_values_len( struct berval **vals )
{
return( ldap_count_values( (char **) vals ) );
}

View File

@@ -0,0 +1,149 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* delete.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
/*
* ldap_delete - initiate an ldap (and X.500) delete operation. Parameters:
*
* ld LDAP descriptor
* dn DN of the object to delete
*
* Example:
* msgid = ldap_delete( ld, dn );
*/
int
LDAP_CALL
ldap_delete( LDAP *ld, const char *dn )
{
int msgid;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_delete\n", 0, 0, 0 );
if ( ldap_delete_ext( ld, dn, NULL, NULL, &msgid ) == LDAP_SUCCESS ) {
return( msgid );
} else {
return( -1 ); /* error is in ld handle */
}
}
int
LDAP_CALL
ldap_delete_ext( LDAP *ld, const char *dn, LDAPControl **serverctrls,
LDAPControl **clientctrls, int *msgidp )
{
BerElement *ber;
int rc, lderr;
/*
* A delete request looks like this:
* DelRequet ::= DistinguishedName,
*/
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_delete_ext\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
if ( dn == NULL ) {
dn = "";
}
LDAP_MUTEX_LOCK( ld, LDAP_MSGID_LOCK );
*msgidp = ++ld->ld_msgid;
LDAP_MUTEX_UNLOCK( ld, LDAP_MSGID_LOCK );
/* see if we should add to the cache */
if ( ld->ld_cache_on && ld->ld_cache_delete != NULL ) {
LDAP_MUTEX_LOCK( ld, LDAP_CACHE_LOCK );
if ( (rc = (ld->ld_cache_delete)( ld, *msgidp, LDAP_REQ_DELETE,
dn )) != 0 ) {
*msgidp = rc;
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
return( LDAP_SUCCESS );
}
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
}
/* create a message to send */
if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber ))
!= LDAP_SUCCESS ) {
return( lderr );
}
if ( ber_printf( ber, "{its", *msgidp, LDAP_REQ_DELETE, dn )
== -1 ) {
lderr = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
ber_free( ber, 1 );
return( lderr );
}
if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber ))
!= LDAP_SUCCESS ) {
ber_free( ber, 1 );
return( lderr );
}
/* send the message */
rc = nsldapi_send_initial_request( ld, *msgidp, LDAP_REQ_DELETE,
(char *)dn, ber );
*msgidp = rc;
return( rc < 0 ? LDAP_GET_LDERRNO( ld, NULL, NULL ) : LDAP_SUCCESS );
}
int
LDAP_CALL
ldap_delete_s( LDAP *ld, const char *dn )
{
return( ldap_delete_ext_s( ld, dn, NULL, NULL ));
}
int
LDAP_CALL
ldap_delete_ext_s( LDAP *ld, const char *dn, LDAPControl **serverctrls,
LDAPControl **clientctrls )
{
int err, msgid;
LDAPMessage *res;
if (( err = ldap_delete_ext( ld, dn, serverctrls, clientctrls,
&msgid )) != LDAP_SUCCESS ) {
return( err );
}
if ( ldap_result( ld, msgid, 1, (struct timeval *)NULL, &res ) == -1 ) {
return( LDAP_GET_LDERRNO( ld, NULL, NULL ) );
}
return( ldap_result2error( ld, res, 1 ) );
}

View File

@@ -0,0 +1,753 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1993, 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/*
* disptmpl.c: display template library routines for LDAP clients
*/
#include "ldap-int.h"
#include "disptmpl.h"
static void free_disptmpl( struct ldap_disptmpl *tmpl );
static int read_next_tmpl( char **bufp, long *blenp,
struct ldap_disptmpl **tmplp, int dtversion );
int nsldapi_next_line_tokens( char **bufp, long *blenp, char ***toksp );
void nsldapi_free_strarray( char **sap );
static char *tmploptions[] = {
"addable", "modrdn",
"altview",
NULL
};
static unsigned long tmploptvals[] = {
LDAP_DTMPL_OPT_ADDABLE, LDAP_DTMPL_OPT_ALLOWMODRDN,
LDAP_DTMPL_OPT_ALTVIEW,
};
static char *itemtypes[] = {
"cis", "mls", "dn",
"bool", "jpeg", "jpegbtn",
"fax", "faxbtn", "audiobtn",
"time", "date", "url",
"searchact", "linkact", "adddnact",
"addact", "verifyact", "mail",
NULL
};
static unsigned long itemsynids[] = {
LDAP_SYN_CASEIGNORESTR, LDAP_SYN_MULTILINESTR, LDAP_SYN_DN,
LDAP_SYN_BOOLEAN, LDAP_SYN_JPEGIMAGE, LDAP_SYN_JPEGBUTTON,
LDAP_SYN_FAXIMAGE, LDAP_SYN_FAXBUTTON, LDAP_SYN_AUDIOBUTTON,
LDAP_SYN_TIME, LDAP_SYN_DATE, LDAP_SYN_LABELEDURL,
LDAP_SYN_SEARCHACTION, LDAP_SYN_LINKACTION, LDAP_SYN_ADDDNACTION,
LDAP_SYN_ADDDNACTION, LDAP_SYN_VERIFYDNACTION,LDAP_SYN_RFC822ADDR,
};
static char *itemoptions[] = {
"ro", "sort",
"1val", "hide",
"required", "hideiffalse",
NULL
};
static unsigned long itemoptvals[] = {
LDAP_DITEM_OPT_READONLY, LDAP_DITEM_OPT_SORTVALUES,
LDAP_DITEM_OPT_SINGLEVALUED, LDAP_DITEM_OPT_HIDEIFEMPTY,
LDAP_DITEM_OPT_VALUEREQUIRED, LDAP_DITEM_OPT_HIDEIFFALSE,
};
#define ADDEF_CONSTANT "constant"
#define ADDEF_ADDERSDN "addersdn"
int
LDAP_CALL
ldap_init_templates( char *file, struct ldap_disptmpl **tmpllistp )
{
FILE *fp;
char *buf;
long rlen, len;
int rc, eof;
*tmpllistp = NULLDISPTMPL;
if (( fp = fopen( file, "r" )) == NULL ) {
return( LDAP_TMPL_ERR_FILE );
}
if ( fseek( fp, 0L, SEEK_END ) != 0 ) { /* move to end to get len */
fclose( fp );
return( LDAP_TMPL_ERR_FILE );
}
len = ftell( fp );
if ( fseek( fp, 0L, SEEK_SET ) != 0 ) { /* back to start of file */
fclose( fp );
return( LDAP_TMPL_ERR_FILE );
}
if (( buf = NSLDAPI_MALLOC( (size_t)len )) == NULL ) {
fclose( fp );
return( LDAP_TMPL_ERR_MEM );
}
rlen = fread( buf, 1, (size_t)len, fp );
eof = feof( fp );
fclose( fp );
if ( rlen != len && !eof ) { /* error: didn't get the whole file */
NSLDAPI_FREE( buf );
return( LDAP_TMPL_ERR_FILE );
}
rc = ldap_init_templates_buf( buf, rlen, tmpllistp );
NSLDAPI_FREE( buf );
return( rc );
}
int
LDAP_CALL
ldap_init_templates_buf( char *buf, long buflen,
struct ldap_disptmpl **tmpllistp )
{
int rc = 0, version;
char **toks;
struct ldap_disptmpl *prevtmpl, *tmpl;
*tmpllistp = prevtmpl = NULLDISPTMPL;
if ( nsldapi_next_line_tokens( &buf, &buflen, &toks ) != 2 ||
strcasecmp( toks[ 0 ], "version" ) != 0 ) {
nsldapi_free_strarray( toks );
return( LDAP_TMPL_ERR_SYNTAX );
}
version = atoi( toks[ 1 ] );
nsldapi_free_strarray( toks );
if ( version != LDAP_TEMPLATE_VERSION ) {
return( LDAP_TMPL_ERR_VERSION );
}
while ( buflen > 0 && ( rc = read_next_tmpl( &buf, &buflen, &tmpl,
version )) == 0 && tmpl != NULLDISPTMPL ) {
if ( prevtmpl == NULLDISPTMPL ) {
*tmpllistp = tmpl;
} else {
prevtmpl->dt_next = tmpl;
}
prevtmpl = tmpl;
}
if ( rc != 0 ) {
ldap_free_templates( *tmpllistp );
}
return( rc );
}
void
LDAP_CALL
ldap_free_templates( struct ldap_disptmpl *tmpllist )
{
struct ldap_disptmpl *tp, *nexttp;
if ( tmpllist != NULL ) {
for ( tp = tmpllist; tp != NULL; tp = nexttp ) {
nexttp = tp->dt_next;
free_disptmpl( tp );
}
}
}
static void
free_disptmpl( struct ldap_disptmpl *tmpl )
{
if ( tmpl != NULL ) {
if ( tmpl->dt_name != NULL ) {
NSLDAPI_FREE( tmpl->dt_name );
}
if ( tmpl->dt_pluralname != NULL ) {
NSLDAPI_FREE( tmpl->dt_pluralname );
}
if ( tmpl->dt_iconname != NULL ) {
NSLDAPI_FREE( tmpl->dt_iconname );
}
if ( tmpl->dt_authattrname != NULL ) {
NSLDAPI_FREE( tmpl->dt_authattrname );
}
if ( tmpl->dt_defrdnattrname != NULL ) {
NSLDAPI_FREE( tmpl->dt_defrdnattrname );
}
if ( tmpl->dt_defaddlocation != NULL ) {
NSLDAPI_FREE( tmpl->dt_defaddlocation );
}
if ( tmpl->dt_oclist != NULL ) {
struct ldap_oclist *ocp, *nextocp;
for ( ocp = tmpl->dt_oclist; ocp != NULL; ocp = nextocp ) {
nextocp = ocp->oc_next;
nsldapi_free_strarray( ocp->oc_objclasses );
NSLDAPI_FREE( ocp );
}
}
if ( tmpl->dt_adddeflist != NULL ) {
struct ldap_adddeflist *adp, *nextadp;
for ( adp = tmpl->dt_adddeflist; adp != NULL; adp = nextadp ) {
nextadp = adp->ad_next;
if( adp->ad_attrname != NULL ) {
NSLDAPI_FREE( adp->ad_attrname );
}
if( adp->ad_value != NULL ) {
NSLDAPI_FREE( adp->ad_value );
}
NSLDAPI_FREE( adp );
}
}
if ( tmpl->dt_items != NULL ) {
struct ldap_tmplitem *rowp, *nextrowp, *colp, *nextcolp;
for ( rowp = tmpl->dt_items; rowp != NULL; rowp = nextrowp ) {
nextrowp = rowp->ti_next_in_col;
for ( colp = rowp; colp != NULL; colp = nextcolp ) {
nextcolp = colp->ti_next_in_row;
if ( colp->ti_attrname != NULL ) {
NSLDAPI_FREE( colp->ti_attrname );
}
if ( colp->ti_label != NULL ) {
NSLDAPI_FREE( colp->ti_label );
}
if ( colp->ti_args != NULL ) {
nsldapi_free_strarray( colp->ti_args );
}
NSLDAPI_FREE( colp );
}
}
}
NSLDAPI_FREE( tmpl );
}
}
struct ldap_disptmpl *
LDAP_CALL
ldap_first_disptmpl( struct ldap_disptmpl *tmpllist )
{
return( tmpllist );
}
struct ldap_disptmpl *
LDAP_CALL
ldap_next_disptmpl( struct ldap_disptmpl *tmpllist,
struct ldap_disptmpl *tmpl )
{
return( tmpl == NULLDISPTMPL ? tmpl : tmpl->dt_next );
}
struct ldap_disptmpl *
LDAP_CALL
ldap_name2template( char *name, struct ldap_disptmpl *tmpllist )
{
struct ldap_disptmpl *dtp;
for ( dtp = ldap_first_disptmpl( tmpllist ); dtp != NULLDISPTMPL;
dtp = ldap_next_disptmpl( tmpllist, dtp )) {
if ( strcasecmp( name, dtp->dt_name ) == 0 ) {
return( dtp );
}
}
return( NULLDISPTMPL );
}
struct ldap_disptmpl *
LDAP_CALL
ldap_oc2template( char **oclist, struct ldap_disptmpl *tmpllist )
{
struct ldap_disptmpl *dtp;
struct ldap_oclist *oclp;
int i, j, needcnt, matchcnt;
if ( tmpllist == NULL || oclist == NULL || oclist[ 0 ] == NULL ) {
return( NULLDISPTMPL );
}
for ( dtp = ldap_first_disptmpl( tmpllist ); dtp != NULLDISPTMPL;
dtp = ldap_next_disptmpl( tmpllist, dtp )) {
for ( oclp = dtp->dt_oclist; oclp != NULLOCLIST;
oclp = oclp->oc_next ) {
needcnt = matchcnt = 0;
for ( i = 0; oclp->oc_objclasses[ i ] != NULL; ++i ) {
for ( j = 0; oclist[ j ] != NULL; ++j ) {
if ( strcasecmp( oclist[ j ], oclp->oc_objclasses[ i ] )
== 0 ) {
++matchcnt;
}
}
++needcnt;
}
if ( matchcnt == needcnt ) {
return( dtp );
}
}
}
return( NULLDISPTMPL );
}
struct ldap_tmplitem *
LDAP_CALL
ldap_first_tmplrow( struct ldap_disptmpl *tmpl )
{
return( tmpl->dt_items );
}
struct ldap_tmplitem *
LDAP_CALL
ldap_next_tmplrow( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row )
{
return( row == NULLTMPLITEM ? row : row->ti_next_in_col );
}
struct ldap_tmplitem *
LDAP_CALL
ldap_first_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row )
{
return( row );
}
struct ldap_tmplitem *
LDAP_CALL
ldap_next_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row,
struct ldap_tmplitem *col )
{
return( col == NULLTMPLITEM ? col : col->ti_next_in_row );
}
char **
LDAP_CALL
ldap_tmplattrs( struct ldap_disptmpl *tmpl, char **includeattrs,
int exclude, unsigned long syntaxmask )
{
/*
* this routine should filter out duplicate attributes...
*/
struct ldap_tmplitem *tirowp, *ticolp;
int i, attrcnt, memerr;
char **attrs;
attrcnt = 0;
memerr = 0;
if (( attrs = (char **)NSLDAPI_MALLOC( sizeof( char * ))) == NULL ) {
return( NULL );
}
if ( includeattrs != NULL ) {
for ( i = 0; !memerr && includeattrs[ i ] != NULL; ++i ) {
if (( attrs = (char **)NSLDAPI_REALLOC( attrs, ( attrcnt + 2 ) *
sizeof( char * ))) == NULL || ( attrs[ attrcnt++ ] =
nsldapi_strdup( includeattrs[ i ] )) == NULL ) {
memerr = 1;
} else {
attrs[ attrcnt ] = NULL;
}
}
}
for ( tirowp = ldap_first_tmplrow( tmpl );
!memerr && tirowp != NULLTMPLITEM;
tirowp = ldap_next_tmplrow( tmpl, tirowp )) {
for ( ticolp = ldap_first_tmplcol( tmpl, tirowp );
ticolp != NULLTMPLITEM;
ticolp = ldap_next_tmplcol( tmpl, tirowp, ticolp )) {
if ( syntaxmask != 0 ) {
if (( exclude &&
( syntaxmask & ticolp->ti_syntaxid ) != 0 ) ||
( !exclude &&
( syntaxmask & ticolp->ti_syntaxid ) == 0 )) {
continue;
}
}
if ( ticolp->ti_attrname != NULL ) {
if (( attrs = (char **)NSLDAPI_REALLOC( attrs, ( attrcnt + 2 )
* sizeof( char * ))) == NULL || ( attrs[ attrcnt++ ] =
nsldapi_strdup( ticolp->ti_attrname )) == NULL ) {
memerr = 1;
} else {
attrs[ attrcnt ] = NULL;
}
}
}
}
if ( memerr || attrcnt == 0 ) {
for ( i = 0; i < attrcnt; ++i ) {
if ( attrs[ i ] != NULL ) {
NSLDAPI_FREE( attrs[ i ] );
}
}
NSLDAPI_FREE( (char *)attrs );
return( NULL );
}
return( attrs );
}
static int
read_next_tmpl( char **bufp, long *blenp, struct ldap_disptmpl **tmplp,
int dtversion )
{
int i, j, tokcnt, samerow, adsource;
char **toks, *itemopts;
struct ldap_disptmpl *tmpl = NULL;
struct ldap_oclist *ocp = NULL, *prevocp = NULL;
struct ldap_adddeflist *adp = NULL, *prevadp = NULL;
struct ldap_tmplitem *rowp = NULL, *ip = NULL, *previp = NULL;
/*
* template name comes first
*/
if (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
nsldapi_free_strarray( toks );
return( tokcnt == 0 ? 0 : LDAP_TMPL_ERR_SYNTAX );
}
if (( tmpl = (struct ldap_disptmpl *)NSLDAPI_CALLOC( 1,
sizeof( struct ldap_disptmpl ))) == NULL ) {
nsldapi_free_strarray( toks );
return( LDAP_TMPL_ERR_MEM );
}
tmpl->dt_name = toks[ 0 ];
NSLDAPI_FREE( (char *)toks );
/*
* template plural name comes next
*/
if (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
tmpl->dt_pluralname = toks[ 0 ];
NSLDAPI_FREE( (char *)toks );
/*
* template icon name is next
*/
if (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
tmpl->dt_iconname = toks[ 0 ];
NSLDAPI_FREE( (char *)toks );
/*
* template options come next
*/
if (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) < 1 ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
for ( i = 0; toks[ i ] != NULL; ++i ) {
for ( j = 0; tmploptions[ j ] != NULL; ++j ) {
if ( strcasecmp( toks[ i ], tmploptions[ j ] ) == 0 ) {
tmpl->dt_options |= tmploptvals[ j ];
}
}
}
nsldapi_free_strarray( toks );
/*
* object class list is next
*/
while (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) > 0 ) {
if (( ocp = (struct ldap_oclist *)NSLDAPI_CALLOC( 1,
sizeof( struct ldap_oclist ))) == NULL ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
ocp->oc_objclasses = toks;
if ( tmpl->dt_oclist == NULL ) {
tmpl->dt_oclist = ocp;
} else {
prevocp->oc_next = ocp;
}
prevocp = ocp;
}
if ( tokcnt < 0 ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
/*
* read name of attribute to authenticate as
*/
if (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if ( toks[ 0 ][ 0 ] != '\0' ) {
tmpl->dt_authattrname = toks[ 0 ];
} else {
NSLDAPI_FREE( toks[ 0 ] );
}
NSLDAPI_FREE( (char *)toks );
/*
* read default attribute to use for RDN
*/
if (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
tmpl->dt_defrdnattrname = toks[ 0 ];
NSLDAPI_FREE( (char *)toks );
/*
* read default location for new entries
*/
if (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) != 1 ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if ( toks[ 0 ][ 0 ] != '\0' ) {
tmpl->dt_defaddlocation = toks[ 0 ];
} else {
NSLDAPI_FREE( toks[ 0 ] );
}
NSLDAPI_FREE( (char *)toks );
/*
* read list of rules used to define default values for new entries
*/
while (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) > 0 ) {
if ( strcasecmp( ADDEF_CONSTANT, toks[ 0 ] ) == 0 ) {
adsource = LDAP_ADSRC_CONSTANTVALUE;
} else if ( strcasecmp( ADDEF_ADDERSDN, toks[ 0 ] ) == 0 ) {
adsource = LDAP_ADSRC_ADDERSDN;
} else {
adsource = 0;
}
if ( adsource == 0 || tokcnt < 2 ||
( adsource == LDAP_ADSRC_CONSTANTVALUE && tokcnt != 3 ) ||
( adsource == LDAP_ADSRC_ADDERSDN && tokcnt != 2 )) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if (( adp = (struct ldap_adddeflist *)NSLDAPI_CALLOC( 1,
sizeof( struct ldap_adddeflist ))) == NULL ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
adp->ad_source = adsource;
adp->ad_attrname = toks[ 1 ];
if ( adsource == LDAP_ADSRC_CONSTANTVALUE ) {
adp->ad_value = toks[ 2 ];
}
NSLDAPI_FREE( toks[ 0 ] );
NSLDAPI_FREE( (char *)toks );
if ( tmpl->dt_adddeflist == NULL ) {
tmpl->dt_adddeflist = adp;
} else {
prevadp->ad_next = adp;
}
prevadp = adp;
}
/*
* item list is next
*/
samerow = 0;
while (( tokcnt = nsldapi_next_line_tokens( bufp, blenp, &toks )) > 0 ) {
if ( strcasecmp( toks[ 0 ], "item" ) == 0 ) {
if ( tokcnt < 4 ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
if (( ip = (struct ldap_tmplitem *)NSLDAPI_CALLOC( 1,
sizeof( struct ldap_tmplitem ))) == NULL ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
/*
* find syntaxid from config file string
*/
while (( itemopts = strrchr( toks[ 1 ], ',' )) != NULL ) {
*itemopts++ = '\0';
for ( i = 0; itemoptions[ i ] != NULL; ++i ) {
if ( strcasecmp( itemopts, itemoptions[ i ] ) == 0 ) {
break;
}
}
if ( itemoptions[ i ] == NULL ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
ip->ti_options |= itemoptvals[ i ];
}
for ( i = 0; itemtypes[ i ] != NULL; ++i ) {
if ( strcasecmp( toks[ 1 ], itemtypes[ i ] ) == 0 ) {
break;
}
}
if ( itemtypes[ i ] == NULL ) {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
NSLDAPI_FREE( toks[ 0 ] );
NSLDAPI_FREE( toks[ 1 ] );
ip->ti_syntaxid = itemsynids[ i ];
ip->ti_label = toks[ 2 ];
if ( toks[ 3 ][ 0 ] == '\0' ) {
ip->ti_attrname = NULL;
NSLDAPI_FREE( toks[ 3 ] );
} else {
ip->ti_attrname = toks[ 3 ];
}
if ( toks[ 4 ] != NULL ) { /* extra args. */
for ( i = 0; toks[ i + 4 ] != NULL; ++i ) {
;
}
if (( ip->ti_args = (char **)NSLDAPI_CALLOC( i + 1,
sizeof( char * ))) == NULL ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_MEM );
}
for ( i = 0; toks[ i + 4 ] != NULL; ++i ) {
ip->ti_args[ i ] = toks[ i + 4 ];
}
}
NSLDAPI_FREE( (char *)toks );
if ( tmpl->dt_items == NULL ) {
tmpl->dt_items = rowp = ip;
} else if ( samerow ) {
previp->ti_next_in_row = ip;
} else {
rowp->ti_next_in_col = ip;
rowp = ip;
}
previp = ip;
samerow = 0;
} else if ( strcasecmp( toks[ 0 ], "samerow" ) == 0 ) {
nsldapi_free_strarray( toks );
samerow = 1;
} else {
nsldapi_free_strarray( toks );
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
}
if ( tokcnt < 0 ) {
free_disptmpl( tmpl );
return( LDAP_TMPL_ERR_SYNTAX );
}
*tmplp = tmpl;
return( 0 );
}
struct tmplerror {
int e_code;
char *e_reason;
};
static struct tmplerror ldap_tmplerrlist[] = {
LDAP_TMPL_ERR_VERSION, "Bad template version",
LDAP_TMPL_ERR_MEM, "Out of memory",
LDAP_TMPL_ERR_SYNTAX, "Bad template syntax",
LDAP_TMPL_ERR_FILE, "File error reading template",
-1, 0
};
char *
LDAP_CALL
ldap_tmplerr2string( int err )
{
int i;
for ( i = 0; ldap_tmplerrlist[i].e_code != -1; i++ ) {
if ( err == ldap_tmplerrlist[i].e_code )
return( ldap_tmplerrlist[i].e_reason );
}
return( "Unknown error" );
}

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) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Microsoft Windows specifics for LIBLDAP DLL
*/
#include "ldap.h"
#include "lber.h"
#ifdef _WIN32
/* Lifted from Q125688
* How to Port a 16-bit DLL to a Win32 DLL
* on the MSVC 4.0 CD
*/
BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
/* Code from LibMain inserted here. Return TRUE to keep the
DLL loaded or return FALSE to fail loading the DLL.
You may have to modify the code in your original LibMain to
account for the fact that it may be called more than once.
You will get one DLL_PROCESS_ATTACH for each process that
loads the DLL. This is different from LibMain which gets
called only once when the DLL is loaded. The only time this
is critical is when you are using shared data sections.
If you are using shared data sections for statically
allocated data, you will need to be careful to initialize it
only once. Check your code carefully.
Certain one-time initializations may now need to be done for
each process that attaches. You may also not need code from
your original LibMain because the operating system may now
be doing it for you.
*/
/*
* 16 bit code calls UnlockData()
* which is mapped to UnlockSegment in windows.h
* in 32 bit world UnlockData is not defined anywhere
* UnlockSegment is mapped to GlobalUnfix in winbase.h
* and the docs for both UnlockSegment and GlobalUnfix say
* ".. function is oboslete. Segments have no meaning
* in the 32-bit environment". So we do nothing here.
*/
/* If we are building a version that includes the security libraries,
* we have to initialize Winsock here. If not, we can defer until the
* first real socket call is made (in mozock.c).
*/
#ifdef LINK_SSL
{
WSADATA wsaData;
WSAStartup(0x0101, &wsaData);
}
#endif
break;
case DLL_THREAD_ATTACH:
/* Called each time a thread is created in a process that has
already loaded (attached to) this DLL. Does not get called
for each thread that exists in the process before it loaded
the DLL.
Do thread-specific initialization here.
*/
break;
case DLL_THREAD_DETACH:
/* Same as above, but called when a thread in the process
exits.
Do thread-specific cleanup here.
*/
break;
case DLL_PROCESS_DETACH:
/* Code from _WEP inserted here. This code may (like the
LibMain) not be necessary. Check to make certain that the
operating system is not doing it for you.
*/
#ifdef LINK_SSL
WSACleanup();
#endif
break;
}
/* The return value is only used for DLL_PROCESS_ATTACH; all other
conditions are ignored. */
return TRUE; // successful DLL_PROCESS_ATTACH
}
#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
BOOL CALLBACK __loadds WEP(BOOL fSystemExit)
{
WSACleanup();
return TRUE;
}
#endif
#ifdef LDAP_DEBUG
#ifndef _WIN32
#include <stdarg.h>
#include <stdio.h>
void LDAP_C LDAPDebug( int level, char* fmt, ... )
{
static char debugBuf[1024];
if (ldap_debug & level)
{
va_list ap;
va_start (ap, fmt);
_snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
va_end (ap);
OutputDebugString (debugBuf);
}
}
#endif
#endif
#ifndef _WIN32
/* The 16-bit version of the RTL does not implement perror() */
#include <stdio.h>
void perror( const char *msg )
{
char buf[128];
wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
OutputDebugString( buf );
}
#endif

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) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1993, 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/*
* dsparse.c: parsing routines used by display template and search
* preference file library routines for LDAP clients.
*
*/
#include "ldap-int.h"
static int next_line( char **bufp, long *blenp, char **linep );
static char *next_token( char ** sp );
int
nsldapi_next_line_tokens( char **bufp, long *blenp, char ***toksp )
{
char *p, *line, *token, **toks;
int rc, tokcnt;
*toksp = NULL;
if (( rc = next_line( bufp, blenp, &line )) <= 0 ) {
return( rc );
}
if (( toks = (char **)NSLDAPI_CALLOC( 1, sizeof( char * ))) == NULL ) {
NSLDAPI_FREE( line );
return( -1 );
}
tokcnt = 0;
p = line;
while (( token = next_token( &p )) != NULL ) {
if (( toks = (char **)NSLDAPI_REALLOC( toks, ( tokcnt + 2 ) *
sizeof( char * ))) == NULL ) {
NSLDAPI_FREE( (char *)toks );
NSLDAPI_FREE( line );
return( -1 );
}
toks[ tokcnt ] = token;
toks[ ++tokcnt ] = NULL;
}
if ( tokcnt == 1 && strcasecmp( toks[ 0 ], "END" ) == 0 ) {
tokcnt = 0;
nsldapi_free_strarray( toks );
toks = NULL;
}
NSLDAPI_FREE( line );
if ( tokcnt == 0 ) {
if ( toks != NULL ) {
NSLDAPI_FREE( (char *)toks );
}
} else {
*toksp = toks;
}
return( tokcnt );
}
static int
next_line( char **bufp, long *blenp, char **linep )
{
char *linestart, *line, *p;
long plen;
linestart = *bufp;
p = *bufp;
plen = *blenp;
do {
for ( linestart = p; plen > 0; ++p, --plen ) {
if ( *p == '\r' ) {
if ( plen > 1 && *(p+1) == '\n' ) {
++p;
--plen;
}
break;
}
if ( *p == '\n' ) {
if ( plen > 1 && *(p+1) == '\r' ) {
++p;
--plen;
}
break;
}
}
++p;
--plen;
} while ( plen > 0 && ( *linestart == '#' || linestart + 1 == p ));
*bufp = p;
*blenp = plen;
if ( plen <= 0 ) {
*linep = NULL;
return( 0 ); /* end of file */
}
if (( line = NSLDAPI_MALLOC( p - linestart )) == NULL ) {
*linep = NULL;
return( -1 ); /* fatal error */
}
SAFEMEMCPY( line, linestart, p - linestart );
line[ p - linestart - 1 ] = '\0';
*linep = line;
return( strlen( line ));
}
static char *
next_token( char **sp )
{
int in_quote = 0;
char *p, *tokstart, *t;
if ( **sp == '\0' ) {
return( NULL );
}
p = *sp;
while ( ldap_utf8isspace( p )) { /* skip leading white space */
++p;
}
if ( *p == '\0' ) {
return( NULL );
}
if ( *p == '\"' ) {
in_quote = 1;
++p;
}
t = tokstart = p;
for ( ;; ) {
if ( *p == '\0' || ( ldap_utf8isspace( p ) && !in_quote )) {
if ( *p != '\0' ) {
++p;
}
*t++ = '\0'; /* end of token */
break;
}
if ( *p == '\"' ) {
in_quote = !in_quote;
++p;
} else {
*t++ = *p++;
}
}
*sp = p;
if ( t == tokstart ) {
return( NULL );
}
return( nsldapi_strdup( tokstart ));
}
void
nsldapi_free_strarray( char **sap )
{
int i;
if ( sap != NULL ) {
for ( i = 0; sap[ i ] != NULL; ++i ) {
NSLDAPI_FREE( sap[ i ] );
}
NSLDAPI_FREE( (char *)sap );
}
}

View File

@@ -0,0 +1,436 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "ldap-int.h"
struct ldaperror {
int e_code;
char *e_reason;
};
static struct ldaperror ldap_errlist[] = {
{ LDAP_SUCCESS, "Success" },
{ LDAP_OPERATIONS_ERROR, "Operations error" },
{ LDAP_PROTOCOL_ERROR, "Protocol error" },
{ LDAP_TIMELIMIT_EXCEEDED, "Timelimit exceeded" },
{ LDAP_SIZELIMIT_EXCEEDED, "Sizelimit exceeded" },
{ LDAP_COMPARE_FALSE, "Compare false" },
{ LDAP_COMPARE_TRUE, "Compare true" },
{ LDAP_STRONG_AUTH_NOT_SUPPORTED, "Strong authentication not supported" },
{ LDAP_STRONG_AUTH_REQUIRED, "Strong authentication required" },
{ LDAP_PARTIAL_RESULTS, "Partial results and referral received" },
{ LDAP_REFERRAL, "Referral received" },
{ LDAP_ADMINLIMIT_EXCEEDED, "Administrative limit exceeded" },
{ LDAP_UNAVAILABLE_CRITICAL_EXTENSION, "Unavailable critical extension" },
{ LDAP_CONFIDENTIALITY_REQUIRED, "Confidentiality required" },
{ LDAP_SASL_BIND_IN_PROGRESS, "SASL bind in progress" },
{ LDAP_NO_SUCH_ATTRIBUTE, "No such attribute" },
{ LDAP_UNDEFINED_TYPE, "Undefined attribute type" },
{ LDAP_INAPPROPRIATE_MATCHING, "Inappropriate matching" },
{ LDAP_CONSTRAINT_VIOLATION, "Constraint violation" },
{ LDAP_TYPE_OR_VALUE_EXISTS, "Type or value exists" },
{ LDAP_INVALID_SYNTAX, "Invalid syntax" },
{ LDAP_NO_SUCH_OBJECT, "No such object" },
{ LDAP_ALIAS_PROBLEM, "Alias problem" },
{ LDAP_INVALID_DN_SYNTAX, "Invalid DN syntax" },
{ LDAP_IS_LEAF, "Object is a leaf" },
{ LDAP_ALIAS_DEREF_PROBLEM, "Alias dereferencing problem" },
{ LDAP_INAPPROPRIATE_AUTH, "Inappropriate authentication" },
{ LDAP_INVALID_CREDENTIALS, "Invalid credentials" },
{ LDAP_INSUFFICIENT_ACCESS, "Insufficient access" },
{ LDAP_BUSY, "DSA is busy" },
{ LDAP_UNAVAILABLE, "DSA is unavailable" },
{ LDAP_UNWILLING_TO_PERFORM, "DSA is unwilling to perform" },
{ LDAP_LOOP_DETECT, "Loop detected" },
{ LDAP_NAMING_VIOLATION, "Naming violation" },
{ LDAP_OBJECT_CLASS_VIOLATION, "Object class violation" },
{ LDAP_NOT_ALLOWED_ON_NONLEAF, "Operation not allowed on nonleaf" },
{ LDAP_NOT_ALLOWED_ON_RDN, "Operation not allowed on RDN" },
{ LDAP_ALREADY_EXISTS, "Already exists" },
{ LDAP_NO_OBJECT_CLASS_MODS, "Cannot modify object class" },
{ LDAP_RESULTS_TOO_LARGE, "Results too large" },
{ LDAP_AFFECTS_MULTIPLE_DSAS, "Affects multiple servers" },
{ LDAP_OTHER, "Unknown error" },
{ LDAP_SERVER_DOWN, "Can't contact LDAP server" },
{ LDAP_LOCAL_ERROR, "Local error" },
{ LDAP_ENCODING_ERROR, "Encoding error" },
{ LDAP_DECODING_ERROR, "Decoding error" },
{ LDAP_TIMEOUT, "Timed out" },
{ LDAP_AUTH_UNKNOWN, "Unknown authentication method" },
{ LDAP_FILTER_ERROR, "Bad search filter" },
{ LDAP_USER_CANCELLED, "User cancelled operation" },
{ LDAP_PARAM_ERROR, "Bad parameter to an ldap routine" },
{ LDAP_NO_MEMORY, "Out of memory" },
{ LDAP_CONNECT_ERROR, "Can't connect to the LDAP server" },
{ LDAP_NOT_SUPPORTED, "Not supported by this version of the LDAP protocol" },
{ LDAP_CONTROL_NOT_FOUND, "Requested LDAP control not found" },
{ LDAP_NO_RESULTS_RETURNED, "No results returned" },
{ LDAP_MORE_RESULTS_TO_RETURN, "More results to return" },
{ LDAP_CLIENT_LOOP, "Client detected loop" },
{ LDAP_REFERRAL_LIMIT_EXCEEDED, "Referral hop limit exceeded" },
{ -1, 0 }
};
char *
LDAP_CALL
ldap_err2string( int err )
{
int i;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_err2string\n", 0, 0, 0 );
for ( i = 0; ldap_errlist[i].e_code != -1; i++ ) {
if ( err == ldap_errlist[i].e_code )
return( ldap_errlist[i].e_reason );
}
return( "Unknown error" );
}
void
LDAP_CALL
ldap_perror( LDAP *ld, const char *s )
{
int i, err;
char *matched, *errmsg, *separator;
char msg[1024];
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_perror\n", 0, 0, 0 );
if ( s == NULL ) {
s = separator = "";
} else {
separator = ": ";
}
if ( ld == NULL ) {
sprintf( msg, "%s%s%s", s, separator, strerror( errno ) );
ber_err_print( msg );
return;
}
LDAP_MUTEX_LOCK( ld, LDAP_ERR_LOCK );
err = LDAP_GET_LDERRNO( ld, &matched, &errmsg );
for ( i = 0; ldap_errlist[i].e_code != -1; i++ ) {
if ( err == ldap_errlist[i].e_code ) {
sprintf( msg, "%s%s%s", s, separator,
ldap_errlist[i].e_reason );
ber_err_print( msg );
if ( err == LDAP_CONNECT_ERROR ) {
ber_err_print( " - " );
ber_err_print( strerror( LDAP_GET_ERRNO( ld )));
}
ber_err_print( "\n" );
if ( matched != NULL && *matched != '\0' ) {
sprintf( msg, "%s%smatched: %s\n",
s, separator, matched );
ber_err_print( msg );
}
if ( errmsg != NULL && *errmsg != '\0' ) {
sprintf( msg, "%s%sadditional info: %s\n",
s, separator, errmsg );
ber_err_print( msg );
}
LDAP_MUTEX_UNLOCK( ld, LDAP_ERR_LOCK );
return;
}
}
sprintf( msg, "%s%sNot an LDAP errno %d\n", s, separator, err );
ber_err_print( msg );
LDAP_MUTEX_UNLOCK( ld, LDAP_ERR_LOCK );
}
int
LDAP_CALL
ldap_result2error( LDAP *ld, LDAPMessage *r, int freeit )
{
int lderr_parse, lderr;
lderr_parse = ldap_parse_result( ld, r, &lderr, NULL, NULL, NULL,
NULL, freeit );
if ( lderr_parse != LDAP_SUCCESS ) {
return( lderr_parse );
}
return( lderr );
}
int
LDAP_CALL
ldap_get_lderrno( LDAP *ld, char **m, char **s )
{
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR ); /* punt */
}
if ( ld->ld_get_lderrno_fn == NULL ) {
if ( m != NULL ) {
*m = ld->ld_matched;
}
if ( s != NULL ) {
*s = ld->ld_error;
}
return( ld->ld_errno );
} else {
return( ld->ld_get_lderrno_fn( m, s, ld->ld_lderrno_arg ) );
}
}
/*
* Note: there is no need for callers of ldap_set_lderrno() to lock the
* ld mutex. If applications intend to share an LDAP session handle
* between threads they *must* perform their own locking around the
* session handle or they must install a "set lderrno" thread callback
* function.
*/
int
LDAP_CALL
ldap_set_lderrno( LDAP *ld, int e, char *m, char *s )
{
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
LDAP_MUTEX_LOCK( ld, LDAP_ERR_LOCK );
if ( ld->ld_set_lderrno_fn != NULL ) {
ld->ld_set_lderrno_fn( e, m, s, ld->ld_lderrno_arg );
} else {
ld->ld_errno = e;
if ( ld->ld_matched ) {
NSLDAPI_FREE( ld->ld_matched );
}
ld->ld_matched = m;
if ( ld->ld_error ) {
NSLDAPI_FREE( ld->ld_error );
}
ld->ld_error = s;
}
LDAP_MUTEX_UNLOCK( ld, LDAP_ERR_LOCK );
return( LDAP_SUCCESS );
}
/*
* Returns an LDAP error that says whether parse succeeded. The error code
* from the LDAP result itself is returned in the errcodep result parameter.
* If any of the result params. (errcodep, matchednp, errmsgp, referralsp,
* or serverctrlsp) are NULL we don't return that info.
*/
int
LDAP_CALL
ldap_parse_result( LDAP *ld, LDAPMessage *res, int *errcodep, char **matchednp,
char **errmsgp, char ***referralsp, LDAPControl ***serverctrlsp,
int freeit )
{
LDAPMessage *lm;
int err, errcode;
char *m, *e;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_parse_result\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld ) ||
!NSLDAPI_VALID_LDAPMESSAGE_POINTER( res )) {
return( LDAP_PARAM_ERROR );
}
/* skip over entries and references to find next result in this chain */
for ( lm = res; lm != NULL; lm = lm->lm_chain ) {
if ( lm->lm_msgtype != LDAP_RES_SEARCH_ENTRY &&
lm->lm_msgtype != LDAP_RES_SEARCH_REFERENCE ) {
break;
}
}
if ( lm == NULL ) {
err = LDAP_NO_RESULTS_RETURNED;
LDAP_SET_LDERRNO( ld, err, NULL, NULL );
return( err );
}
err = nsldapi_parse_result( ld, lm->lm_msgtype, lm->lm_ber, &errcode,
&m, &e, referralsp, serverctrlsp );
if ( err == LDAP_SUCCESS ) {
if ( errcodep != NULL ) {
*errcodep = errcode;
}
if ( matchednp != NULL ) {
*matchednp = nsldapi_strdup( m );
}
if ( errmsgp != NULL ) {
*errmsgp = nsldapi_strdup( e );
}
/*
* if there are more result messages in the chain, arrange to
* return the special LDAP_MORE_RESULTS_TO_RETURN "error" code.
*/
for ( lm = lm->lm_chain; lm != NULL; lm = lm->lm_chain ) {
if ( lm->lm_msgtype != LDAP_RES_SEARCH_ENTRY &&
lm->lm_msgtype != LDAP_RES_SEARCH_REFERENCE ) {
err = LDAP_MORE_RESULTS_TO_RETURN;
break;
}
}
} else {
m = e = NULL;
}
if ( freeit ) {
ldap_msgfree( res );
}
LDAP_SET_LDERRNO( ld, ( err == LDAP_SUCCESS ) ? errcode : err, m, e );
return( err );
}
/*
* returns an LDAP error code indicating success or failure of parsing
* does NOT set any error information inside "ld"
*/
int
nsldapi_parse_result( LDAP *ld, int msgtype, BerElement *rber, int *errcodep,
char **matchednp, char **errmsgp, char ***referralsp,
LDAPControl ***serverctrlsp )
{
BerElement ber;
unsigned long len;
int berrc, err, errcode;
char *m, *e;
/*
* Parse the result message. LDAPv3 result messages look like this:
*
* LDAPResult ::= SEQUENCE {
* resultCode ENUMERATED { ... },
* matchedDN LDAPDN,
* errorMessage LDAPString,
* referral [3] Referral OPTIONAL
* opSpecificStuff OPTIONAL
* }
*
* all wrapped up in an LDAPMessage sequence which looks like this:
* LDAPMessage ::= SEQUENCE {
* messageID MessageID,
* LDAPResult CHOICE { ... }, // message type
* controls [0] Controls OPTIONAL
* }
*
* LDAPv2 messages don't include referrals or controls.
* LDAPv1 messages don't include matchedDN, referrals, or controls.
*
* ldap_result() pulls out the message id, so by the time a result
* message gets here we are sitting at the start of the LDAPResult.
*/
err = LDAP_SUCCESS; /* optimistic */
m = e = NULL;
if ( matchednp != NULL ) {
*matchednp = NULL;
}
if ( errmsgp != NULL ) {
*errmsgp = NULL;
}
if ( referralsp != NULL ) {
*referralsp = NULL;
}
if ( serverctrlsp != NULL ) {
*serverctrlsp = NULL;
}
ber = *rber; /* struct copy */
if ( NSLDAPI_LDAP_VERSION( ld ) < LDAP_VERSION2 ) {
berrc = ber_scanf( &ber, "{ia}", &errcode, &e );
} else {
if (( berrc = ber_scanf( &ber, "{iaa", &errcode, &m, &e ))
!= LBER_ERROR ) {
/* check for optional referrals */
if ( ber_peek_tag( &ber, &len ) == LDAP_TAG_REFERRAL ) {
if ( referralsp == NULL ) {
/* skip referrals */
berrc = ber_scanf( &ber, "x" );
} else {
/* suck out referrals */
berrc = ber_scanf( &ber, "v",
referralsp );
}
} else if ( referralsp != NULL ) {
*referralsp = NULL;
}
}
if ( berrc != LBER_ERROR ) {
/*
* skip past optional operation-specific elements:
* bind results - serverSASLcreds
* extendedop results - OID plus value
*/
if ( msgtype == LDAP_RES_BIND ) {
if ( ber_peek_tag( &ber, &len ) ==
LDAP_TAG_SASL_RES_CREDS ) {
berrc = ber_scanf( &ber, "x" );
}
} else if ( msgtype == LDAP_RES_EXTENDED ) {
if ( ber_peek_tag( &ber, &len ) ==
LDAP_TAG_EXOP_RES_OID ) {
berrc = ber_scanf( &ber, "x" );
}
if ( berrc != LBER_ERROR &&
ber_peek_tag( &ber, &len ) ==
LDAP_TAG_EXOP_RES_VALUE ) {
berrc = ber_scanf( &ber, "x" );
}
}
}
/* pull out controls (if requested and any are present) */
if ( berrc != LBER_ERROR && serverctrlsp != NULL &&
( berrc = ber_scanf( &ber, "}" )) != LBER_ERROR ) {
err = nsldapi_get_controls( &ber, serverctrlsp );
}
}
if ( berrc == LBER_ERROR && err == LDAP_SUCCESS ) {
err = LDAP_DECODING_ERROR;
}
if ( errcodep != NULL ) {
*errcodep = errcode;
}
if ( matchednp != NULL ) {
*matchednp = m;
} else if ( m != NULL ) {
NSLDAPI_FREE( m );
}
if ( errmsgp != NULL ) {
*errmsgp = e;
} else if ( e != NULL ) {
NSLDAPI_FREE( e );
}
return( err );
}

View File

@@ -0,0 +1,246 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "ldap-int.h"
/*
* ldap_extended_operation - initiate an arbitrary ldapv3 extended operation.
* the oid and data of the extended operation are supplied. Returns an
* LDAP error code.
*
* Example:
* struct berval exdata;
* char *exoid;
* int err, msgid;
* ... fill in oid and data ...
* err = ldap_extended_operation( ld, exoid, &exdata, NULL, NULL, &msgid );
*/
int
LDAP_CALL
ldap_extended_operation(
LDAP *ld,
const char *exoid,
struct berval *exdata,
LDAPControl **serverctrls,
LDAPControl **clientctrls,
int *msgidp
)
{
BerElement *ber;
int rc, msgid;
/*
* the ldapv3 extended operation request looks like this:
*
* ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
* requestName LDAPOID,
* requestValue OCTET STRING
* }
*
* all wrapped up in an LDAPMessage sequence.
*/
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_extended_operation\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
/* only ldapv3 or higher can do extended operations */
if ( NSLDAPI_LDAP_VERSION( ld ) < LDAP_VERSION3 ) {
rc = LDAP_NOT_SUPPORTED;
LDAP_SET_LDERRNO( ld, rc, NULL, NULL );
return( rc );
}
if ( msgidp == NULL || exoid == NULL || *exoid == '\0' ) {
rc = LDAP_PARAM_ERROR;
LDAP_SET_LDERRNO( ld, rc, NULL, NULL );
return( rc );
}
LDAP_MUTEX_LOCK( ld, LDAP_MSGID_LOCK );
msgid = ++ld->ld_msgid;
LDAP_MUTEX_UNLOCK( ld, LDAP_MSGID_LOCK );
#if 0
if ( ld->ld_cache_on && ld->ld_cache_extendedop != NULL ) {
LDAP_MUTEX_LOCK( ld, LDAP_CACHE_LOCK );
if ( (rc = (ld->ld_cache_extendedop)( ld, msgid,
LDAP_REQ_EXTENDED, exoid, cred )) != 0 ) {
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
return( rc );
}
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
}
#endif
/* create a message to send */
if (( rc = nsldapi_alloc_ber_with_options( ld, &ber ))
!= LDAP_SUCCESS ) {
return( rc );
}
/* fill it in */
if ( ber_printf( ber, "{it{tsto}", msgid, LDAP_REQ_EXTENDED,
LDAP_TAG_EXOP_REQ_OID, exoid, LDAP_TAG_EXOP_REQ_VALUE,
exdata->bv_val, exdata->bv_len ) == -1 ) {
rc = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, rc, NULL, NULL );
ber_free( ber, 1 );
return( rc );
}
if (( rc = nsldapi_put_controls( ld, serverctrls, 1, ber ))
!= LDAP_SUCCESS ) {
ber_free( ber, 1 );
return( rc );
}
/* send the message */
rc = nsldapi_send_initial_request( ld, *msgidp, LDAP_REQ_EXTENDED, NULL,
ber );
*msgidp = rc;
return( rc < 0 ? LDAP_GET_LDERRNO( ld, NULL, NULL ) : LDAP_SUCCESS );
}
/*
* ldap_extended_operation_s - perform an arbitrary ldapv3 extended operation.
* the oid and data of the extended operation are supplied. LDAP_SUCCESS
* is returned upon success, the ldap error code otherwise.
*
* Example:
* struct berval exdata, exretval;
* char *exoid;
* int rc;
* ... fill in oid and data ...
* rc = ldap_extended_operation_s( ld, exoid, &exdata, &exretval );
*/
int
LDAP_CALL
ldap_extended_operation_s(
LDAP *ld,
const char *requestoid,
struct berval *requestdata,
LDAPControl **serverctrls,
LDAPControl **clientctrls,
char **retoidp,
struct berval **retdatap
)
{
int err, msgid;
LDAPMessage *result;
if (( err = ldap_extended_operation( ld, requestoid, requestdata,
serverctrls, clientctrls, &msgid )) != LDAP_SUCCESS ) {
return( err );
}
if ( ldap_result( ld, msgid, 1, (struct timeval *) 0, &result )
== -1 ) {
return( LDAP_GET_LDERRNO( ld, NULL, NULL ) );
}
if (( err = ldap_parse_extended_result( ld, result, retoidp, retdatap,
0 )) != LDAP_SUCCESS ) {
ldap_msgfree( result );
return( err );
}
return( ldap_result2error( ld, result, 1 ) );
}
/*
* Pull the oid returned by the server and the data out of an extended
* operation result. Return an LDAP error code.
*/
int
LDAP_CALL
ldap_parse_extended_result(
LDAP *ld,
LDAPMessage *res,
char **retoidp, /* may be NULL */
struct berval **retdatap, /* may be NULL */
int freeit
)
{
struct berelement ber;
unsigned long len;
long err;
char *m, *e, *roid;
struct berval *rdata;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_parse_extended_result\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
if ( !NSLDAPI_VALID_LDAPMESSAGE_EXRESULT_POINTER( res )) {
return( LDAP_PARAM_ERROR );
}
m = e = NULL;
ber = *(res->lm_ber);
if ( NSLDAPI_LDAP_VERSION( ld ) < LDAP_VERSION3 ) {
LDAP_SET_LDERRNO( ld, LDAP_NOT_SUPPORTED, NULL, NULL );
return( LDAP_NOT_SUPPORTED );
}
if ( ber_scanf( &ber, "{iaa", &err, &m, &e ) == LBER_ERROR ) {
goto decoding_error;
}
roid = NULL;
if ( ber_peek_tag( &ber, &len ) == LDAP_TAG_EXOP_RES_OID ) {
if ( ber_scanf( &ber, "a", &roid ) == LBER_ERROR ) {
goto decoding_error;
}
}
if ( retoidp != NULL ) {
*retoidp = roid;
} else if ( roid != NULL ) {
NSLDAPI_FREE( roid );
}
rdata = NULL;
if ( ber_peek_tag( &ber, &len ) == LDAP_TAG_EXOP_RES_VALUE ) {
if ( ber_scanf( &ber, "O", &rdata ) == LBER_ERROR ) {
goto decoding_error;
}
}
if ( retdatap != NULL ) {
*retdatap = rdata;
} else if ( rdata != NULL ) {
ber_bvfree( rdata );
}
LDAP_SET_LDERRNO( ld, err, m, e );
if ( freeit ) {
ldap_msgfree( res );
}
return( LDAP_SUCCESS );
decoding_error:;
LDAP_SET_LDERRNO( ld, LDAP_DECODING_ERROR, NULL, NULL );
return( LDAP_DECODING_ERROR );
}

View File

@@ -0,0 +1,134 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1994 The Regents of the University of Michigan.
* All rights reserved.
*/
/*
* free.c - some free routines are included here to avoid having to
* link in lots of extra code when not using certain features
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1994 The Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
void
LDAP_CALL
ldap_getfilter_free( LDAPFiltDesc *lfdp )
{
LDAPFiltList *flp, *nextflp;
LDAPFiltInfo *fip, *nextfip;
if ( lfdp == NULL ) {
return;
}
for ( flp = lfdp->lfd_filtlist; flp != NULL; flp = nextflp ) {
for ( fip = flp->lfl_ilist; fip != NULL; fip = nextfip ) {
nextfip = fip->lfi_next;
NSLDAPI_FREE( fip->lfi_filter );
NSLDAPI_FREE( fip->lfi_desc );
NSLDAPI_FREE( fip );
}
nextflp = flp->lfl_next;
NSLDAPI_FREE( flp->lfl_pattern );
NSLDAPI_FREE( flp->lfl_delims );
NSLDAPI_FREE( flp->lfl_tag );
NSLDAPI_FREE( flp );
}
if ( lfdp->lfd_curvalcopy != NULL ) {
NSLDAPI_FREE( lfdp->lfd_curvalcopy );
}
if ( lfdp->lfd_curvalwords != NULL ) {
NSLDAPI_FREE( lfdp->lfd_curvalwords );
}
if ( lfdp->lfd_filtprefix != NULL ) {
NSLDAPI_FREE( lfdp->lfd_filtprefix );
}
if ( lfdp->lfd_filtsuffix != NULL ) {
NSLDAPI_FREE( lfdp->lfd_filtsuffix );
}
NSLDAPI_FREE( lfdp );
}
/*
* free a null-terminated array of pointers to mod structures. the
* structures are freed, not the array itself, unless the freemods
* flag is set.
*/
void
LDAP_CALL
ldap_mods_free( LDAPMod **mods, int freemods )
{
int i;
if ( !NSLDAPI_VALID_LDAPMOD_ARRAY( mods )) {
return;
}
for ( i = 0; mods[i] != NULL; i++ ) {
if ( mods[i]->mod_op & LDAP_MOD_BVALUES ) {
if ( mods[i]->mod_bvalues != NULL ) {
ber_bvecfree( mods[i]->mod_bvalues );
}
} else if ( mods[i]->mod_values != NULL ) {
ldap_value_free( mods[i]->mod_values );
}
if ( mods[i]->mod_type != NULL ) {
NSLDAPI_FREE( mods[i]->mod_type );
}
NSLDAPI_FREE( (char *) mods[i] );
}
if ( freemods )
NSLDAPI_FREE( (char *) mods );
}
/*
* ldap_memfree() is needed to ensure that memory allocated by the C runtime
* assocated with libldap is freed by the same runtime code.
*/
void
LDAP_CALL
ldap_memfree( void *s )
{
if ( s != NULL ) {
NSLDAPI_FREE( s );
}
}
/*
* ldap_ber_free() is just a cover for ber_free()
* ber_free() checks for ber == NULL, so we don't bother.
*/
void
LDAP_CALL
ldap_ber_free( BerElement *ber, int freebuf )
{
ber_free( ber, freebuf );
}

View File

@@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* freevalues.c
*/
#include "ldap-int.h"
void
LDAP_CALL
ldap_value_free( char **vals )
{
int i;
if ( vals == NULL )
return;
for ( i = 0; vals[i] != NULL; i++ )
NSLDAPI_FREE( vals[i] );
NSLDAPI_FREE( (char *) vals );
}
void
LDAP_CALL
ldap_value_free_len( struct berval **vals )
{
int i;
if ( vals == NULL )
return;
for ( i = 0; vals[i] != NULL; i++ ) {
NSLDAPI_FREE( vals[i]->bv_val );
NSLDAPI_FREE( vals[i] );
}
NSLDAPI_FREE( (char *) vals );
}

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 "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.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* friendly.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
char *
LDAP_CALL
ldap_friendly_name( char *filename, char *name, FriendlyMap *map )
{
int i, entries;
FILE *fp;
char *s;
char buf[BUFSIZ];
if ( map == NULL ) {
return( name );
}
if ( *map == NULL ) {
if ( (fp = fopen( filename, "r" )) == NULL )
return( name );
entries = 0;
while ( fgets( buf, sizeof(buf), fp ) != NULL ) {
if ( buf[0] != '#' )
entries++;
}
rewind( fp );
if ( (*map = (FriendlyMap)NSLDAPI_MALLOC( (entries + 1) *
sizeof(struct friendly) )) == NULL ) {
fclose( fp );
return( name );
}
i = 0;
while ( fgets( buf, sizeof(buf), fp ) != NULL && i < entries ) {
if ( buf[0] == '#' )
continue;
if ( (s = strchr( buf, '\n' )) != NULL )
*s = '\0';
if ( (s = strchr( buf, '\t' )) == NULL )
continue;
*s++ = '\0';
if ( *s == '"' ) {
int esc = 0, found = 0;
for ( ++s; *s && !found; s++ ) {
switch ( *s ) {
case '\\':
esc = 1;
break;
case '"':
if ( !esc )
found = 1;
/* FALL */
default:
esc = 0;
break;
}
}
}
(*map)[i].f_unfriendly = nsldapi_strdup( buf );
(*map)[i].f_friendly = nsldapi_strdup( s );
i++;
}
fclose( fp );
(*map)[i].f_unfriendly = NULL;
}
for ( i = 0; (*map)[i].f_unfriendly != NULL; i++ ) {
if ( strcasecmp( name, (*map)[i].f_unfriendly ) == 0 )
return( (*map)[i].f_friendly );
}
return( name );
}
void
LDAP_CALL
ldap_free_friendlymap( FriendlyMap *map )
{
struct friendly* pF;
if ( map == NULL || *map == NULL ) {
return;
}
for ( pF = *map; pF->f_unfriendly; pF++ ) {
NSLDAPI_FREE( pF->f_unfriendly );
NSLDAPI_FREE( pF->f_friendly );
}
NSLDAPI_FREE( *map );
*map = NULL;
}

View File

@@ -0,0 +1,131 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* getattr.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
static unsigned long
bytes_remaining( BerElement *ber )
{
unsigned long len;
if ( ber_get_option( ber, LBER_OPT_REMAINING_BYTES, &len ) != 0 ) {
return( 0 ); /* not sure what else to do.... */
}
return( len );
}
char *
LDAP_CALL
ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber )
{
char *attr;
int err;
long seqlength;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( NULL ); /* punt */
}
if ( ber == NULL || !NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( entry )) {
LDAP_SET_LDERRNO( ld, LDAP_PARAM_ERROR, NULL, NULL );
return( NULL );
}
if ( nsldapi_alloc_ber_with_options( ld, ber ) != LDAP_SUCCESS ) {
return( NULL );
}
**ber = *entry->lm_ber;
attr = NULL; /* pessimistic */
err = LDAP_DECODING_ERROR; /* ditto */
/*
* Skip past the sequence, dn, and sequence of sequence.
* Reset number of bytes remaining so we confine the rest of our
* decoding to the current sequence.
*/
if ( ber_scanf( *ber, "{xl{", &seqlength ) != LBER_ERROR &&
ber_set_option( *ber, LBER_OPT_REMAINING_BYTES, &seqlength )
== 0 ) {
/* snarf the attribute type, and skip the set of values,
* leaving us positioned right before the next attribute
* type/value sequence.
*/
if ( ber_scanf( *ber, "{ax}", &attr ) != LBER_ERROR ||
bytes_remaining( *ber ) == 0 ) {
err = LDAP_SUCCESS;
}
}
LDAP_SET_LDERRNO( ld, err, NULL, NULL );
if ( attr == NULL || err != LDAP_SUCCESS ) {
ber_free( *ber, 0 );
*ber = NULL;
}
return( attr );
}
/* ARGSUSED */
char *
LDAP_CALL
ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
{
char *attr;
int err;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( NULL ); /* punt */
}
if ( ber == NULL || !NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( entry )) {
LDAP_SET_LDERRNO( ld, LDAP_PARAM_ERROR, NULL, NULL );
return( NULL );
}
attr = NULL; /* pessimistic */
err = LDAP_DECODING_ERROR; /* ditto */
/* skip sequence, snarf attribute type, skip values */
if ( ber_scanf( ber, "{ax}", &attr ) != LBER_ERROR ||
bytes_remaining( ber ) == 0 ) {
err = LDAP_SUCCESS;
}
LDAP_SET_LDERRNO( ld, err, NULL, NULL );
return( attr );
}

View File

@@ -0,0 +1,343 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1994 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* getdn.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
char *
LDAP_CALL
ldap_get_dn( LDAP *ld, LDAPMessage *entry )
{
char *dn;
struct berelement tmp;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_get_dn\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( NULL ); /* punt */
}
if ( !NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( entry )) {
LDAP_SET_LDERRNO( ld, LDAP_PARAM_ERROR, NULL, NULL );
return( NULL );
}
tmp = *entry->lm_ber; /* struct copy */
if ( ber_scanf( &tmp, "{a", &dn ) == LBER_ERROR ) {
LDAP_SET_LDERRNO( ld, LDAP_DECODING_ERROR, NULL, NULL );
return( NULL );
}
return( dn );
}
char *
LDAP_CALL
ldap_dn2ufn( const char *dn )
{
char *p, *ufn, *r;
size_t plen;
int state;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_dn2ufn\n", 0, 0, 0 );
if ( dn == NULL ) {
dn = "";
}
if ( ldap_is_dns_dn( dn ) || ( p = strchr( dn, '=' )) == NULL )
return( nsldapi_strdup( (char *)dn ));
ufn = nsldapi_strdup( ++p );
#define INQUOTE 1
#define OUTQUOTE 2
state = OUTQUOTE;
for ( p = ufn, r = ufn; *p; p += plen ) {
plen = 1;
switch ( *p ) {
case '\\':
if ( *++p == '\0' )
plen=0;
else {
*r++ = '\\';
r += (plen = LDAP_UTF8COPY(r,p));
}
break;
case '"':
if ( state == INQUOTE )
state = OUTQUOTE;
else
state = INQUOTE;
*r++ = *p;
break;
case ';':
case ',':
if ( state == OUTQUOTE )
*r++ = ',';
else
*r++ = *p;
break;
case '=':
if ( state == INQUOTE )
*r++ = *p;
else {
char *rsave = r;
LDAP_UTF8DEC(r);
*rsave = '\0';
while ( !ldap_utf8isspace( r ) && *r != ';'
&& *r != ',' && r > ufn )
LDAP_UTF8DEC(r);
LDAP_UTF8INC(r);
if ( strcasecmp( r, "c" )
&& strcasecmp( r, "o" )
&& strcasecmp( r, "ou" )
&& strcasecmp( r, "st" )
&& strcasecmp( r, "l" )
&& strcasecmp( r, "cn" ) ) {
r = rsave;
*r++ = '=';
}
}
break;
default:
r += (plen = LDAP_UTF8COPY(r,p));
break;
}
}
*r = '\0';
return( ufn );
}
char **
LDAP_CALL
ldap_explode_dns( const char *dn )
{
int ncomps, maxcomps;
char *s, *cpydn;
char **rdns;
#ifdef HAVE_STRTOK_R /* defined in portable.h */
char *lasts;
#endif
if ( dn == NULL ) {
dn = "";
}
if ( (rdns = (char **)NSLDAPI_MALLOC( 8 * sizeof(char *) )) == NULL ) {
return( NULL );
}
maxcomps = 8;
ncomps = 0;
cpydn = nsldapi_strdup( (char *)dn );
for ( s = STRTOK( cpydn, "@.", &lasts ); s != NULL;
s = STRTOK( NULL, "@.", &lasts ) ) {
if ( ncomps == maxcomps ) {
maxcomps *= 2;
if ( (rdns = (char **)NSLDAPI_REALLOC( rdns, maxcomps *
sizeof(char *) )) == NULL ) {
NSLDAPI_FREE( cpydn );
return( NULL );
}
}
rdns[ncomps++] = nsldapi_strdup( s );
}
rdns[ncomps] = NULL;
NSLDAPI_FREE( cpydn );
return( rdns );
}
#define LDAP_DN 1
#define LDAP_RDN 2
static char **
ldap_explode( const char *dn, const int notypes, const int nametype )
{
char *p, *q, *rdnstart, **rdns = NULL;
size_t plen = 0;
int state, count = 0, endquote, len, goteq;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_explode\n", 0, 0, 0 );
if ( dn == NULL ) {
dn = "";
}
#if 0
if ( ldap_is_dns_dn( dn ) ) {
return( ldap_explode_dns( dn ) );
}
#endif
while ( ldap_utf8isspace( (char *)dn )) { /* ignore leading spaces */
++dn;
}
p = rdnstart = (char *) dn;
state = OUTQUOTE;
goteq = 0;
do {
p += plen;
plen = 1;
switch ( *p ) {
case '\\':
if ( *++p == '\0' )
p--;
else
plen = LDAP_UTF8LEN(p);
break;
case '"':
if ( state == INQUOTE )
state = OUTQUOTE;
else
state = INQUOTE;
break;
case '+': if ( nametype != LDAP_RDN ) break;
case ';':
case ',':
case '\0':
if ( state == OUTQUOTE ) {
/*
* semicolon and comma are not valid RDN
* separators.
*/
if ( nametype == LDAP_RDN &&
( *p == ';' || *p == ',' || !goteq)) {
ldap_charray_free( rdns );
return NULL;
}
if ( (*p == ',' || *p == ';') && !goteq ) {
/* If we get here, we have a case similar
* to <attr>=<value>,<string>,<attr>=<value>
* This is not a valid dn */
ldap_charray_free( rdns );
return NULL;
}
goteq = 0;
++count;
if ( rdns == NULL ) {
if (( rdns = (char **)NSLDAPI_MALLOC( 8
* sizeof( char *))) == NULL )
return( NULL );
} else if ( count >= 8 ) {
if (( rdns = (char **)NSLDAPI_REALLOC(
rdns, (count+1) *
sizeof( char *))) == NULL )
return( NULL );
}
rdns[ count ] = NULL;
endquote = 0;
if ( notypes ) {
for ( q = rdnstart;
q < p && *q != '='; ++q ) {
;
}
if ( q < p ) { /* *q == '=' */
rdnstart = ++q;
}
if ( *rdnstart == '"' ) {
++rdnstart;
}
if ( *(p-1) == '"' ) {
endquote = 1;
--p;
}
}
len = p - rdnstart;
if (( rdns[ count-1 ] = (char *)NSLDAPI_CALLOC(
1, len + 1 )) != NULL ) {
SAFEMEMCPY( rdns[ count-1 ], rdnstart,
len );
if ( !endquote ) {
/* trim trailing spaces */
while ( len > 0 &&
ldap_utf8isspace(
&rdns[count-1][len-1] )) {
--len;
}
}
rdns[ count-1 ][ len ] = '\0';
}
/*
* Don't forget to increment 'p' back to where
* it should be. If we don't, then we will
* never get past an "end quote."
*/
if ( endquote == 1 )
p++;
rdnstart = *p ? p + 1 : p;
while ( ldap_utf8isspace( rdnstart ))
++rdnstart;
}
break;
case '=':
if ( state == OUTQUOTE ) {
goteq = 1;
}
/* FALL */
default:
plen = LDAP_UTF8LEN(p);
break;
}
} while ( *p );
return( rdns );
}
char **
LDAP_CALL
ldap_explode_dn( const char *dn, const int notypes )
{
return( ldap_explode( dn, notypes, LDAP_DN ) );
}
char **
LDAP_CALL
ldap_explode_rdn( const char *rdn, const int notypes )
{
return( ldap_explode( rdn, notypes, LDAP_RDN ) );
}
int
LDAP_CALL
ldap_is_dns_dn( const char *dn )
{
return( dn != NULL && dn[ 0 ] != '\0' && strchr( dn, '=' ) == NULL &&
strchr( dn, ',' ) == NULL );
}

View File

@@ -0,0 +1,246 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1995 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* nsldapi_getdxbyname - retrieve DX records from the DNS (from
* TXT records for now)
*/
#include <stdio.h>
#ifdef LDAP_DNS
XXX not MT-safe XXX
#include <string.h>
#include <ctype.h>
#ifdef macintosh
#include <stdlib.h>
#include "macos.h"
#endif /* macintosh */
#ifdef _WINDOWS
#include <windows.h>
#endif
#if !defined(macintosh) && !defined(DOS) && !defined( _WINDOWS )
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <resolv.h>
#endif
#include "ldap-int.h"
#if defined( DOS )
#include "msdos.h"
#endif /* DOS */
#ifdef NEEDPROTOS
static char ** decode_answer( unsigned char *answer, int len );
#else /* NEEDPROTOS */
static char **decode_answer();
#endif /* NEEDPROTOS */
extern int h_errno;
extern char *h_errlist[];
#define MAX_TO_SORT 32
/*
* nsldapi_getdxbyname - lookup DNS DX records for domain and return an ordered
* array.
*/
char **
nsldapi_getdxbyname( char *domain )
{
unsigned char buf[ PACKETSZ ];
char **dxs;
int rc;
LDAPDebug( LDAP_DEBUG_TRACE, "nsldapi_getdxbyname( %s )\n", domain, 0, 0 );
memset( buf, 0, sizeof( buf ));
/* XXX not MT safe XXX */
if (( rc = res_search( domain, C_IN, T_TXT, buf, sizeof( buf ))) < 0
|| ( dxs = decode_answer( buf, rc )) == NULL ) {
/*
* punt: return list conisting of the original domain name only
*/
if (( dxs = (char **)NSLDAPI_MALLOC( 2 * sizeof( char * ))) == NULL ||
( dxs[ 0 ] = nsldapi_strdup( domain )) == NULL ) {
if ( dxs != NULL ) {
NSLDAPI_FREE( dxs );
}
dxs = NULL;
} else {
dxs[ 1 ] = NULL;
}
}
return( dxs );
}
static char **
decode_answer( unsigned char *answer, int len )
{
HEADER *hp;
char buf[ 256 ], **dxs;
unsigned char *eom, *p;
int ancount, err, rc, type, class, dx_count, rr_len;
int dx_pref[ MAX_TO_SORT ];
#ifdef LDAP_DEBUG
if ( ldap_debug & LDAP_DEBUG_PACKETS ) {
/* __p_query( answer ); */
}
#endif /* LDAP_DEBUG */
dxs = NULL;
hp = (HEADER *)answer;
eom = answer + len;
if ( ntohs( hp->qdcount ) != 1 ) {
h_errno = NO_RECOVERY;
return( NULL );
}
ancount = ntohs( hp->ancount );
if ( ancount < 1 ) {
h_errno = NO_DATA;
return( NULL );
}
/*
* skip over the query
*/
p = answer + HFIXEDSZ;
if (( rc = dn_expand( answer, eom, p, buf, sizeof( buf ))) < 0 ) {
h_errno = NO_RECOVERY;
return( NULL );
}
p += ( rc + QFIXEDSZ );
/*
* pull out the answers we are interested in
*/
err = dx_count = 0;
while ( ancount > 0 && err == 0 && p < eom ) {
if (( rc = dn_expand( answer, eom, p, buf, sizeof( buf ))) < 0 ) {
err = NO_RECOVERY;
continue;
}
p += rc; /* skip over name */
type = _getshort( p );
p += INT16SZ;
class = _getshort( p );
p += INT16SZ;
p += INT32SZ; /* skip over TTL */
rr_len = _getshort( p );
p += INT16SZ;
if ( class == C_IN && type == T_TXT ) {
int i, n, pref, txt_len;
char *q, *r;
q = (char *)p;
while ( q < (char *)p + rr_len && err == 0 ) {
if ( *q >= 3 && strncasecmp( q + 1, "dx:", 3 ) == 0 ) {
txt_len = *q - 3;
r = q + 4;
while ( isspace( *r )) {
++r;
--txt_len;
}
pref = 0;
while ( isdigit( *r )) {
pref *= 10;
pref += ( *r - '0' );
++r;
--txt_len;
}
if ( dx_count < MAX_TO_SORT - 1 ) {
dx_pref[ dx_count ] = pref;
}
while ( isspace( *r )) {
++r;
--txt_len;
}
if ( dx_count == 0 ) {
dxs = (char **)NSLDAPI_MALLOC( 2 * sizeof( char * ));
} else {
dxs = (char **)NSLDAPI_REALLOC( dxs,
( dx_count + 2 ) * sizeof( char * ));
}
if ( dxs == NULL || ( dxs[ dx_count ] =
(char *)NSLDAPI_CALLOC( 1, txt_len + 1 ))
== NULL ) {
err = NO_RECOVERY;
continue;
}
SAFEMEMCPY( dxs[ dx_count ], r, txt_len );
dxs[ ++dx_count ] = NULL;
}
q += ( *q + 1 ); /* move past last TXT record */
}
}
p += rr_len;
}
if ( err == 0 ) {
if ( dx_count == 0 ) {
err = NO_DATA;
} else {
/*
* sort records based on associated preference value
*/
int i, j, sort_count, tmp_pref;
char *tmp_dx;
sort_count = ( dx_count < MAX_TO_SORT ) ? dx_count : MAX_TO_SORT;
for ( i = 0; i < sort_count; ++i ) {
for ( j = i + 1; j < sort_count; ++j ) {
if ( dx_pref[ i ] > dx_pref[ j ] ) {
tmp_pref = dx_pref[ i ];
dx_pref[ i ] = dx_pref[ j ];
dx_pref[ j ] = tmp_pref;
tmp_dx = dxs[ i ];
dxs[ i ] = dxs[ j ];
dxs[ j ] = tmp_dx;
}
}
}
}
}
h_errno = err;
return( dxs );
}
#endif /* LDAP_DNS */

View File

@@ -0,0 +1,122 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* getentry.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
LDAPMessage *
LDAP_CALL
ldap_first_entry( LDAP *ld, LDAPMessage *chain )
{
if ( !NSLDAPI_VALID_LDAP_POINTER( ld ) || chain == NULLMSG ) {
return( NULLMSG );
}
if ( chain->lm_msgtype == LDAP_RES_SEARCH_ENTRY ) {
return( chain );
}
return( ldap_next_entry( ld, chain ));
}
LDAPMessage *
LDAP_CALL
ldap_next_entry( LDAP *ld, LDAPMessage *entry )
{
if ( !NSLDAPI_VALID_LDAP_POINTER( ld ) || entry == NULLMSG ) {
return( NULLMSG );
}
for ( entry = entry->lm_chain; entry != NULLMSG;
entry = entry->lm_chain ) {
if ( entry->lm_msgtype == LDAP_RES_SEARCH_ENTRY ) {
return( entry );
}
}
return( NULLMSG );
}
int
LDAP_CALL
ldap_count_entries( LDAP *ld, LDAPMessage *chain )
{
int i;
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( -1 );
}
for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
if ( chain->lm_msgtype == LDAP_RES_SEARCH_ENTRY ) {
++i;
}
}
return( i );
}
int
LDAP_CALL
ldap_get_entry_controls( LDAP *ld, LDAPMessage *entry,
LDAPControl ***serverctrlsp )
{
int rc;
BerElement tmpber;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_get_entry_controls\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
if ( !NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( entry )
|| serverctrlsp == NULL ) {
rc = LDAP_PARAM_ERROR;
goto report_error_and_return;
}
*serverctrlsp = NULL;
tmpber = *entry->lm_ber; /* struct copy */
/* skip past dn and entire attribute/value list */
if ( ber_scanf( &tmpber, "{xx" ) == LBER_ERROR ) {
rc = LDAP_DECODING_ERROR;
goto report_error_and_return;
}
rc = nsldapi_get_controls( &tmpber, serverctrlsp );
report_error_and_return:
LDAP_SET_LDERRNO( ld, rc, NULL, NULL );
return( rc );
}

View File

@@ -0,0 +1,525 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1993 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* getfilter.c -- optional add-on to libldap
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
#include "regex.h"
#include <stdio.h> /* sprintf */
static int break_into_words( char *str, char *delims, char ***wordsp );
int nsldapi_next_line_tokens( char **bufp, long *blenp, char ***toksp );
void nsldapi_free_strarray( char **sap );
#if !defined( macintosh ) && !defined( DOS )
extern char * LDAP_CALL re_comp();
#endif
#define FILT_MAX_LINE_LEN 1024
LDAPFiltDesc *
LDAP_CALL
ldap_init_getfilter( char *fname )
{
FILE *fp;
char *buf;
long rlen, len;
int eof;
LDAPFiltDesc *lfdp;
if (( fp = fopen( fname, "r" )) == NULL ) {
return( NULL );
}
if ( fseek( fp, 0L, SEEK_END ) != 0 ) { /* move to end to get len */
fclose( fp );
return( NULL );
}
len = ftell( fp );
if ( fseek( fp, 0L, SEEK_SET ) != 0 ) { /* back to start of file */
fclose( fp );
return( NULL );
}
if (( buf = NSLDAPI_MALLOC( (size_t)len )) == NULL ) {
fclose( fp );
return( NULL );
}
rlen = fread( buf, 1, (size_t)len, fp );
eof = feof( fp );
fclose( fp );
if ( rlen != len && !eof ) { /* error: didn't get the whole file */
NSLDAPI_FREE( buf );
return( NULL );
}
lfdp = ldap_init_getfilter_buf( buf, rlen );
NSLDAPI_FREE( buf );
return( lfdp );
}
LDAPFiltDesc *
LDAP_CALL
ldap_init_getfilter_buf( char *buf, long buflen )
{
LDAPFiltDesc *lfdp;
LDAPFiltList *flp, *nextflp;
LDAPFiltInfo *fip, *nextfip;
char *tag, **tok;
int tokcnt, i;
if ( buflen < 0 || ( lfdp = (LDAPFiltDesc *)NSLDAPI_CALLOC( 1,
sizeof( LDAPFiltDesc))) == NULL ) {
return( NULL );
}
flp = nextflp = NULL;
fip = NULL;
tag = NULL;
while ( buflen > 0 && ( tokcnt = nsldapi_next_line_tokens( &buf, &buflen,
&tok )) > 0 ) {
switch( tokcnt ) {
case 1: /* tag line */
if ( tag != NULL ) {
NSLDAPI_FREE( tag );
}
tag = tok[ 0 ];
NSLDAPI_FREE( tok );
break;
case 4:
case 5: /* start of filter info. list */
if (( nextflp = (LDAPFiltList *)NSLDAPI_CALLOC( 1,
sizeof( LDAPFiltList ))) == NULL ) {
ldap_getfilter_free( lfdp );
return( NULL );
}
nextflp->lfl_tag = nsldapi_strdup( tag );
nextflp->lfl_pattern = tok[ 0 ];
if ( re_comp( nextflp->lfl_pattern ) != NULL ) {
char msg[256];
ldap_getfilter_free( lfdp );
sprintf( msg, "bad regular expresssion %s\n",
nextflp->lfl_pattern );
ber_err_print( msg );
nsldapi_free_strarray( tok );
return( NULL );
}
nextflp->lfl_delims = tok[ 1 ];
nextflp->lfl_ilist = NULL;
nextflp->lfl_next = NULL;
if ( flp == NULL ) { /* first one */
lfdp->lfd_filtlist = nextflp;
} else {
flp->lfl_next = nextflp;
}
flp = nextflp;
fip = NULL;
for ( i = 2; i < 5; ++i ) {
tok[ i - 2 ] = tok[ i ];
}
/* fall through */
case 2:
case 3: /* filter, desc, and optional search scope */
if ( nextflp != NULL ) { /* add to info list */
if (( nextfip = (LDAPFiltInfo *)NSLDAPI_CALLOC( 1,
sizeof( LDAPFiltInfo ))) == NULL ) {
ldap_getfilter_free( lfdp );
nsldapi_free_strarray( tok );
return( NULL );
}
if ( fip == NULL ) { /* first one */
nextflp->lfl_ilist = nextfip;
} else {
fip->lfi_next = nextfip;
}
fip = nextfip;
nextfip->lfi_next = NULL;
nextfip->lfi_filter = tok[ 0 ];
nextfip->lfi_desc = tok[ 1 ];
if ( tok[ 2 ] != NULL ) {
if ( strcasecmp( tok[ 2 ], "subtree" ) == 0 ) {
nextfip->lfi_scope = LDAP_SCOPE_SUBTREE;
} else if ( strcasecmp( tok[ 2 ], "onelevel" ) == 0 ) {
nextfip->lfi_scope = LDAP_SCOPE_ONELEVEL;
} else if ( strcasecmp( tok[ 2 ], "base" ) == 0 ) {
nextfip->lfi_scope = LDAP_SCOPE_BASE;
} else {
nsldapi_free_strarray( tok );
ldap_getfilter_free( lfdp );
return( NULL );
}
NSLDAPI_FREE( tok[ 2 ] );
tok[ 2 ] = NULL;
} else {
nextfip->lfi_scope = LDAP_SCOPE_SUBTREE; /* default */
}
nextfip->lfi_isexact = ( strchr( tok[ 0 ], '*' ) == NULL &&
strchr( tok[ 0 ], '~' ) == NULL );
NSLDAPI_FREE( tok );
}
break;
default:
nsldapi_free_strarray( tok );
ldap_getfilter_free( lfdp );
return( NULL );
}
}
if ( tag != NULL ) {
NSLDAPI_FREE( tag );
}
return( lfdp );
}
int
LDAP_CALL
ldap_set_filter_additions( LDAPFiltDesc *lfdp, char *prefix, char *suffix )
{
if ( lfdp == NULL ) {
return( LDAP_PARAM_ERROR );
}
if ( lfdp->lfd_filtprefix != NULL ) {
NSLDAPI_FREE( lfdp->lfd_filtprefix );
}
lfdp->lfd_filtprefix = ( prefix == NULL ) ? NULL : nsldapi_strdup( prefix );
if ( lfdp->lfd_filtsuffix != NULL ) {
NSLDAPI_FREE( lfdp->lfd_filtsuffix );
}
lfdp->lfd_filtsuffix = ( suffix == NULL ) ? NULL : nsldapi_strdup( suffix );
return( LDAP_SUCCESS );
}
/*
* ldap_setfilteraffixes() is deprecated -- use ldap_set_filter_additions()
*/
void
LDAP_CALL
ldap_setfilteraffixes( LDAPFiltDesc *lfdp, char *prefix, char *suffix )
{
(void)ldap_set_filter_additions( lfdp, prefix, suffix );
}
LDAPFiltInfo *
LDAP_CALL
ldap_getfirstfilter( LDAPFiltDesc *lfdp, char *tagpat, char *value )
{
LDAPFiltList *flp;
if ( lfdp == NULL ) {
return( NULL ); /* punt */
}
if ( lfdp->lfd_curvalcopy != NULL ) {
NSLDAPI_FREE( lfdp->lfd_curvalcopy );
NSLDAPI_FREE( lfdp->lfd_curvalwords );
}
lfdp->lfd_curval = value;
lfdp->lfd_curfip = NULL;
for ( flp = lfdp->lfd_filtlist; flp != NULL; flp = flp->lfl_next ) {
if ( re_comp( tagpat ) == NULL && re_exec( flp->lfl_tag ) == 1
&& re_comp( flp->lfl_pattern ) == NULL
&& re_exec( lfdp->lfd_curval ) == 1 ) {
lfdp->lfd_curfip = flp->lfl_ilist;
break;
}
}
if ( lfdp->lfd_curfip == NULL ) {
return( NULL );
}
if (( lfdp->lfd_curvalcopy = nsldapi_strdup( value )) == NULL ) {
return( NULL );
}
if ( break_into_words( lfdp->lfd_curvalcopy, flp->lfl_delims,
&lfdp->lfd_curvalwords ) < 0 ) {
NSLDAPI_FREE( lfdp->lfd_curvalcopy );
lfdp->lfd_curvalcopy = NULL;
return( NULL );
}
return( ldap_getnextfilter( lfdp ));
}
LDAPFiltInfo *
LDAP_CALL
ldap_getnextfilter( LDAPFiltDesc *lfdp )
{
LDAPFiltInfo *fip;
if ( lfdp == NULL || ( fip = lfdp->lfd_curfip ) == NULL ) {
return( NULL );
}
lfdp->lfd_curfip = fip->lfi_next;
ldap_build_filter( lfdp->lfd_filter, LDAP_FILT_MAXSIZ, fip->lfi_filter,
lfdp->lfd_filtprefix, lfdp->lfd_filtsuffix, NULL,
lfdp->lfd_curval, lfdp->lfd_curvalwords );
lfdp->lfd_retfi.lfi_filter = lfdp->lfd_filter;
lfdp->lfd_retfi.lfi_desc = fip->lfi_desc;
lfdp->lfd_retfi.lfi_scope = fip->lfi_scope;
lfdp->lfd_retfi.lfi_isexact = fip->lfi_isexact;
return( &lfdp->lfd_retfi );
}
static char*
filter_add_strn( char *f, char *flimit, char *v, size_t vlen )
/* Copy v into f. If flimit is too small, return NULL;
* otherwise return (f + vlen).
*/
{
auto size_t flen = flimit - f;
if ( vlen > flen ) { /* flimit is too small */
if ( flen > 0 ) SAFEMEMCPY( f, v, flen );
return NULL;
}
if ( vlen > 0 ) SAFEMEMCPY( f, v, vlen );
return f + vlen;
}
static char*
filter_add_value( char *f, char *flimit, char *v, int escape_all )
/* Copy v into f, but with parentheses escaped. But only escape * and \
* if escape_all is non-zero so that either "*" or "\2a" can be used in
* v, with different meanings.
* If flimit is too small, return NULL; otherwise
* return (f + the number of bytes copied).
*/
{
auto char x[4];
auto size_t slen;
while ( f && *v ) {
switch ( *v ) {
case '*':
if ( escape_all ) {
f = filter_add_strn( f, flimit, "\\2a", 3 );
v++;
} else {
if ( f < flimit ) {
*f++ = *v++;
} else {
f = NULL; /* overflow */
}
}
break;
case '(':
case ')':
sprintf( x, "\\%02x", (unsigned)*v );
f = filter_add_strn( f, flimit, x, 3 );
v++;
break;
case '\\':
if ( escape_all ) {
f = filter_add_strn( f, flimit, "\\5c", 3 );
v++;
} else {
slen = (ldap_utf8isxdigit( v+1 ) &&
ldap_utf8isxdigit( v+2 )) ? 3 : (v[1] ? 2 : 1);
f = filter_add_strn( f, flimit, v, slen );
v += slen;
}
break;
default:
if ( f < flimit ) {
*f++ = *v++;
} else {
f = NULL; /* overflow */
}
break;
}
}
return f;
}
int
LDAP_CALL
ldap_create_filter( char *filtbuf, unsigned long buflen, char *pattern,
char *prefix, char *suffix, char *attr, char *value, char **valwords )
{
char *p, *f, *flimit;
int i, wordcount, wordnum, endwordnum, escape_all;
if ( filtbuf == NULL || buflen == 0 || pattern == NULL ) {
return( LDAP_PARAM_ERROR );
}
if ( valwords == NULL ) {
wordcount = 0;
} else {
for ( wordcount = 0; valwords[ wordcount ] != NULL; ++wordcount ) {
;
}
}
f = filtbuf;
flimit = filtbuf + buflen - 1;
if ( prefix != NULL ) {
f = filter_add_strn( f, flimit, prefix, strlen( prefix ));
}
for ( p = pattern; f != NULL && *p != '\0'; ++p ) {
if ( *p == '%' ) {
++p;
if ( *p == 'v' || *p == 'e' ) {
escape_all = ( *p == 'e' );
if ( ldap_utf8isdigit( p+1 )) {
++p;
wordnum = *p - '1';
if ( *(p+1) == '-' ) {
++p;
if ( ldap_utf8isdigit( p+1 )) {
++p;
endwordnum = *p - '1'; /* e.g., "%v2-4" */
if ( endwordnum > wordcount - 1 ) {
endwordnum = wordcount - 1;
}
} else {
endwordnum = wordcount - 1; /* e.g., "%v2-" */
}
} else {
endwordnum = wordnum; /* e.g., "%v2" */
}
if ( wordcount > 0 ) {
for ( i = wordnum; i <= endwordnum; ++i ) {
if ( i > wordnum ) { /* add blank btw words */
f = filter_add_strn( f, flimit, " ", 1 );
if ( f == NULL ) break;
}
f = filter_add_value( f, flimit, valwords[ i ],
escape_all );
if ( f == NULL ) break;
}
}
} else if ( *(p+1) == '$' ) {
++p;
if ( wordcount > 0 ) {
wordnum = wordcount - 1;
f = filter_add_value( f, flimit,
valwords[ wordnum ], escape_all );
}
} else if ( value != NULL ) {
f = filter_add_value( f, flimit, value, escape_all );
}
} else if ( *p == 'a' && attr != NULL ) {
f = filter_add_strn( f, flimit, attr, strlen( attr ));
} else {
*f++ = *p;
}
} else {
*f++ = *p;
}
if ( f > flimit ) { /* overflow */
f = NULL;
}
}
if ( suffix != NULL && f != NULL) {
f = filter_add_strn( f, flimit, suffix, strlen( suffix ));
}
if ( f == NULL ) {
*flimit = '\0';
return( LDAP_SIZELIMIT_EXCEEDED );
}
*f = '\0';
return( LDAP_SUCCESS );
}
/*
* ldap_build_filter() is deprecated -- use ldap_create_filter() instead
*/
void
LDAP_CALL
ldap_build_filter( char *filtbuf, unsigned long buflen, char *pattern,
char *prefix, char *suffix, char *attr, char *value, char **valwords )
{
(void)ldap_create_filter( filtbuf, buflen, pattern, prefix, suffix, attr,
value, valwords );
}
static int
break_into_words( char *str, char *delims, char ***wordsp )
{
char *word, **words;
int count;
char *lasts;
if (( words = (char **)NSLDAPI_CALLOC( 1, sizeof( char * ))) == NULL ) {
return( -1 );
}
count = 0;
words[ count ] = NULL;
word = ldap_utf8strtok_r( str, delims, &lasts );
while ( word != NULL ) {
if (( words = (char **)NSLDAPI_REALLOC( words,
( count + 2 ) * sizeof( char * ))) == NULL ) {
return( -1 );
}
words[ count ] = word;
words[ ++count ] = NULL;
word = ldap_utf8strtok_r( NULL, delims, &lasts );
}
*wordsp = words;
return( count );
}

View File

@@ -0,0 +1,180 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "ldap-int.h"
#define LDAP_GET_BITOPT( ld, bit ) \
((ld)->ld_options & bit ) != 0 ? 1 : 0
int
LDAP_CALL
ldap_get_option( LDAP *ld, int option, void *optdata )
{
int rc;
if ( !nsldapi_initialized ) {
nsldapi_initialize_defaults();
}
/*
* process global options (not associated with an LDAP session handle)
*/
if ( option == LDAP_OPT_MEMALLOC_FN_PTRS ) {
/* struct copy */
*((struct ldap_memalloc_fns *)optdata) = nsldapi_memalloc_fns;
return( 0 );
}
/*
* if ld is NULL, arrange to return options from our default settings
*/
if ( ld == NULL ) {
ld = &nsldapi_ld_defaults;
}
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( -1 ); /* punt */
}
LDAP_MUTEX_LOCK( ld, LDAP_OPTION_LOCK );
LDAP_SET_LDERRNO( ld, LDAP_SUCCESS, NULL, NULL );
switch( option ) {
#ifdef LDAP_DNS
case LDAP_OPT_DNS:
*((int *) optdata) = LDAP_GET_BITOPT( ld, LDAP_BITOPT_DNS );
break;
#endif
case LDAP_OPT_REFERRALS:
*((int *) optdata) =
LDAP_GET_BITOPT( ld, LDAP_BITOPT_REFERRALS );
break;
#ifdef LDAP_SSLIO_HOOKS
case LDAP_OPT_SSL:
*((int *) optdata) = LDAP_GET_BITOPT( ld, LDAP_BITOPT_SSL );
break;
#endif
case LDAP_OPT_RESTART:
*((int *) optdata) = LDAP_GET_BITOPT( ld, LDAP_BITOPT_RESTART );
break;
case LDAP_OPT_RECONNECT:
*((int *) optdata) =
LDAP_GET_BITOPT( ld, LDAP_BITOPT_RECONNECT );
break;
case LDAP_OPT_ASYNC_CONNECT:
*((int *) optdata) =
LDAP_GET_BITOPT( ld, LDAP_BITOPT_ASYNC );
break;
/* stuff in the sockbuf */
case LDAP_OPT_DESC:
rc = ber_sockbuf_get_option( ld->ld_sbp,
LBER_SOCKBUF_OPT_DESC, optdata );
LDAP_MUTEX_UNLOCK( ld, LDAP_OPTION_LOCK );
return( rc );
/* fields in the LDAP structure */
case LDAP_OPT_DEREF:
*((int *) optdata) = ld->ld_deref;
break;
case LDAP_OPT_SIZELIMIT:
*((int *) optdata) = ld->ld_sizelimit;
break;
case LDAP_OPT_TIMELIMIT:
*((int *) optdata) = ld->ld_timelimit;
break;
case LDAP_OPT_REFERRAL_HOP_LIMIT:
*((int *) optdata) = ld->ld_refhoplimit;
break;
case LDAP_OPT_PROTOCOL_VERSION:
*((int *) optdata) = ld->ld_version;
break;
case LDAP_OPT_SERVER_CONTROLS:
*((LDAPControl ***)optdata) = ld->ld_servercontrols;
break;
case LDAP_OPT_CLIENT_CONTROLS:
*((LDAPControl ***)optdata) = ld->ld_clientcontrols;
break;
/* rebind proc */
case LDAP_OPT_REBIND_FN:
*((LDAP_REBINDPROC_CALLBACK **) optdata) = ld->ld_rebind_fn;
break;
case LDAP_OPT_REBIND_ARG:
*((void **) optdata) = ld->ld_rebind_arg;
break;
#ifdef LDAP_SSLIO_HOOKS
/* i/o function pointers */
case LDAP_OPT_IO_FN_PTRS:
/* struct copy */
*((struct ldap_io_fns *) optdata) = ld->ld_io;
break;
#endif /* LDAP_SSLIO_HOOKS */
/* thread function pointers */
case LDAP_OPT_THREAD_FN_PTRS:
/* struct copy */
*((struct ldap_thread_fns *) optdata) = ld->ld_thread;
break;
/* DNS function pointers */
case LDAP_OPT_DNS_FN_PTRS:
/* struct copy */
*((struct ldap_dns_fns *) optdata) = ld->ld_dnsfn;
break;
/* cache function pointers */
case LDAP_OPT_CACHE_FN_PTRS:
/* struct copy */
*((struct ldap_cache_fns *) optdata) = ld->ld_cache;
break;
case LDAP_OPT_CACHE_STRATEGY:
*((int *) optdata) = ld->ld_cache_strategy;
break;
case LDAP_OPT_CACHE_ENABLE:
*((int *) optdata) = ld->ld_cache_on;
break;
case LDAP_OPT_ERROR_NUMBER:
*((int *) optdata) = LDAP_GET_LDERRNO( ld, NULL, NULL );
break;
case LDAP_OPT_ERROR_STRING:
(void)LDAP_GET_LDERRNO( ld, NULL, (char **)optdata );
break;
case LDAP_OPT_PREFERRED_LANGUAGE:
if ( NULL != ld->ld_preferred_language ) {
*((char **) optdata) =
nsldapi_strdup(ld->ld_preferred_language);
} else {
*((char **) optdata) = NULL;
}
break;
default:
LDAP_SET_LDERRNO( ld, LDAP_PARAM_ERROR, NULL, NULL );
LDAP_MUTEX_UNLOCK( ld, LDAP_OPTION_LOCK );
return( -1 );
}
LDAP_MUTEX_UNLOCK( ld, LDAP_OPTION_LOCK );
return( 0 );
}

View File

@@ -0,0 +1,461 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* getvalues.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
static void **
internal_ldap_get_values( LDAP *ld, LDAPMessage *entry, const char *target,
int lencall )
{
struct berelement ber;
char *attr;
int rc;
void **vals;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_get_values\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( NULL ); /* punt */
}
if ( target == NULL ||
!NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( entry )) {
LDAP_SET_LDERRNO( ld, LDAP_PARAM_ERROR, NULL, NULL );
return( NULL );
}
ber = *entry->lm_ber;
/* skip sequence, dn, sequence of, and snag the first attr */
if ( ber_scanf( &ber, "{x{{a", &attr ) == LBER_ERROR ) {
LDAP_SET_LDERRNO( ld, LDAP_DECODING_ERROR, NULL, NULL );
return( NULL );
}
rc = strcasecmp( (char *)target, attr );
NSLDAPI_FREE( attr );
if ( rc != 0 ) {
while ( 1 ) {
if ( ber_scanf( &ber, "x}{a", &attr ) == LBER_ERROR ) {
LDAP_SET_LDERRNO( ld, LDAP_DECODING_ERROR,
NULL, NULL );
return( NULL );
}
rc = strcasecmp( (char *)target, attr );
if ( rc == 0 ) {
NSLDAPI_FREE( attr );
break;
}
NSLDAPI_FREE( attr );
}
}
/*
* if we get this far, we've found the attribute and are sitting
* just before the set of values.
*/
if ( lencall ) {
rc = ber_scanf( &ber, "[V]", &vals );
} else {
rc = ber_scanf( &ber, "[v]", &vals );
}
if ( rc == LBER_ERROR ) {
rc = LDAP_DECODING_ERROR;
} else {
rc = LDAP_SUCCESS;
}
LDAP_SET_LDERRNO( ld, rc, NULL, NULL );
return(( rc == LDAP_SUCCESS ) ? vals : NULL );
}
/* For language-sensitive attribute matching, we are looking for a
language tag that looks like one of the following:
cn
cn;lang-en
cn;lang-en-us
cn;lang-ja
cn;lang-ja-JP-kanji
The base language specification consists of two letters following
"lang-". After that, there may be additional language-specific
narrowings preceded by a "-". In our processing we go from the
specific to the general, preferring a complete subtype match, but
accepting a partial one. For example:
For a request for "cn;lang-en-us", we would return cn;lang-en-us
if present, otherwise cn;lang-en if present, otherwise cn.
Besides the language subtype, there may be other subtypes:
cn;lang-ja;binary (Unlikely!)
cn;lang-ja;phonetic
If not in the target, they are ignored. If they are in the target,
they must be in the attribute to match.
*/
#define LANG_SUBTYPE_INDEX_NONE -1
#define LANG_SUBTYPE_INDEX_DUPLICATE -2
typedef struct {
int start;
int length;
} _SubStringIndex;
static int
parse_subtypes( const char *target, int *baseLenp, char **langp,
_SubStringIndex **subs, int *nsubtypes )
{
int nSubtypes = 0;
int ind = 0;
char *nextToken;
_SubStringIndex *result = NULL;
int langIndex;
int targetLen;
int subtypeStart;
langIndex = LANG_SUBTYPE_INDEX_NONE;
*subs = NULL;
*langp = NULL;
*baseLenp = 0;
*nsubtypes = 0;
targetLen = strlen( target );
/* Parse past base attribute */
nextToken = strchr( target, ';' );
if ( NULL != nextToken ) {
subtypeStart = nextToken - target + 1;
*baseLenp = subtypeStart - 1;
}
else {
subtypeStart = targetLen;
*baseLenp = subtypeStart;
}
ind = subtypeStart;
/* How many subtypes? */
nextToken = (char *)target + subtypeStart;
while ( nextToken && *nextToken ) {
char *thisToken = nextToken;
nextToken = strchr( thisToken, ';' );
if ( NULL != nextToken )
nextToken++;
if ( 0 == strncasecmp( thisToken, "lang-", 5 ) ) {
/* If there was a previous lang tag, this is illegal! */
if ( langIndex != LANG_SUBTYPE_INDEX_NONE ) {
langIndex = LANG_SUBTYPE_INDEX_DUPLICATE;
return langIndex;
}
else {
langIndex = nSubtypes;
}
} else {
nSubtypes++;
}
}
/* No language subtype? */
if ( langIndex < 0 )
return langIndex;
/* Allocate array of non-language subtypes */
if ( nSubtypes > 0 ) {
result = (_SubStringIndex *)NSLDAPI_MALLOC( sizeof(*result)
* nSubtypes );
memset( result, 0, sizeof(*result) * nSubtypes );
}
ind = 0;
nSubtypes = 0;
ind = subtypeStart;
nextToken = (char *)target + subtypeStart;
while ( nextToken && *nextToken ) {
char *thisToken = nextToken;
int len;
nextToken = strchr( thisToken, ';' );
if ( NULL != nextToken ) {
len = nextToken - thisToken;
nextToken++;
}
else {
nextToken = (char *)target + targetLen;
len = nextToken - thisToken;
}
if ( 0 == strncasecmp( thisToken, "lang-", 5 ) ) {
int i;
*langp = (char *)NSLDAPI_MALLOC( len + 1 );
for( i = 0; i < len; i++ )
(*langp)[i] = toupper( target[ind+i] );
(*langp)[len] = 0;
}
else {
result[nSubtypes].start = thisToken - target;
result[nSubtypes].length = len;
nSubtypes++;
}
}
*subs = result;
*nsubtypes = nSubtypes;
return langIndex;
}
static int
check_lang_match( const char *target, const char *baseTarget,
_SubStringIndex *targetTypes,
int ntargetTypes, char *targetLang, char *attr )
{
int langIndex;
_SubStringIndex *subtypes;
int baseLen;
char *lang;
int nsubtypes;
int mismatch = 0;
int match = -1;
int i;
/* Get all subtypes in the attribute name */
langIndex = parse_subtypes( attr, &baseLen, &lang, &subtypes, &nsubtypes );
/* Check if there any required non-language subtypes which are
not in this attribute */
for( i = 0; i < ntargetTypes; i++ ) {
char *t = (char *)target+targetTypes[i].start;
int tlen = targetTypes[i].length;
int j;
for( j = 0; j < nsubtypes; j++ ) {
char *a = attr + subtypes[j].start;
int alen = subtypes[j].length;
if ( (tlen == alen) && !strncasecmp( t, a, tlen ) )
break;
}
if ( j >= nsubtypes ) {
mismatch = 1;
break;
}
}
if ( mismatch ) {
if ( NULL != subtypes )
NSLDAPI_FREE( subtypes );
if ( NULL != lang )
NSLDAPI_FREE( lang );
return -1;
}
/* If there was no language subtype... */
if ( langIndex < 0 ) {
if ( NULL != subtypes )
NSLDAPI_FREE( subtypes );
if ( NULL != lang )
NSLDAPI_FREE( lang );
if ( LANG_SUBTYPE_INDEX_NONE == langIndex )
return 0;
else
return -1;
}
/* Okay, now check the language subtag */
i = 0;
while( targetLang[i] && lang[i] &&
(toupper(targetLang[i]) == toupper(lang[i])) )
i++;
/* The total length can't be longer than the requested subtype */
if ( !lang[i] || (lang[i] == ';') ) {
/* If the found subtype is shorter than the requested one, the next
character in the requested one should be "-" */
if ( !targetLang[i] || (targetLang[i] == '-') )
match = i;
}
return match;
}
static int check_base_match( const char *target, char *attr )
{
int i = 0;
int rc;
while( target[i] && attr[i] && (toupper(target[i]) == toupper(attr[i])) )
i++;
rc = ( !target[i] && (!attr[i] || (';' == attr[i])) );
return rc;
}
static void **
internal_ldap_get_lang_values( LDAP *ld, LDAPMessage *entry,
const char *target, char **type, int lencall )
{
struct berelement ber;
char *attr = NULL;
int rc;
void **vals = NULL;
int langIndex;
_SubStringIndex *subtypes;
int nsubtypes;
char *baseTarget = NULL;
int bestMatch = 0;
char *lang = NULL;
int len;
int firstAttr = 1;
char *bestType = NULL;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_get_values\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( NULL );
}
if ( (target == NULL) ||
!NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( entry )) {
LDAP_SET_LDERRNO( ld, LDAP_PARAM_ERROR, NULL, NULL );
return( NULL );
}
/* A language check was requested, so see if there really is a
language subtype in the attribute spec */
langIndex = parse_subtypes( target, &len, &lang,
&subtypes, &nsubtypes );
if ( langIndex < 0 ) {
if ( NULL != subtypes ) {
NSLDAPI_FREE( subtypes );
subtypes = NULL;
}
vals = internal_ldap_get_values( ld, entry, target, lencall );
if ( NULL != type )
*type = nsldapi_strdup( target );
return vals;
} else {
/* Get just the base attribute name */
baseTarget = (char *)NSLDAPI_MALLOC( len + 1 );
memcpy( baseTarget, target, len );
baseTarget[len] = 0;
}
ber = *entry->lm_ber;
/* Process all attributes in the entry */
while ( 1 ) {
int foundMatch = 0;
if ( NULL != attr )
NSLDAPI_FREE( attr );
if ( firstAttr ) {
firstAttr = 0;
/* skip sequence, dn, sequence of, and snag the first attr */
if ( ber_scanf( &ber, "{x{{a", &attr ) == LBER_ERROR ) {
break;
}
} else {
if ( ber_scanf( &ber, "{a", &attr ) == LBER_ERROR ) {
break;
}
}
if ( check_base_match( (const char *)baseTarget, attr ) ) {
int thisMatch = check_lang_match( target, baseTarget,
subtypes, nsubtypes, lang, attr );
if ( thisMatch > bestMatch ) {
if ( vals )
NSLDAPI_FREE( vals );
foundMatch = 1;
bestMatch = thisMatch;
if ( NULL != bestType )
NSLDAPI_FREE( bestType );
bestType = attr;
attr = NULL;
}
}
if ( foundMatch ) {
if ( lencall ) {
rc = ber_scanf( &ber, "[V]}", &vals );
} else {
rc = ber_scanf( &ber, "[v]}", &vals );
}
} else {
ber_scanf( &ber, "x}" );
}
}
NSLDAPI_FREE( lang );
NSLDAPI_FREE( baseTarget );
NSLDAPI_FREE( subtypes );
if ( NULL != type )
*type = bestType;
else if ( NULL != bestType )
NSLDAPI_FREE( bestType );
if ( NULL == vals ) {
rc = LDAP_DECODING_ERROR;
} else {
rc = LDAP_SUCCESS;
}
LDAP_SET_LDERRNO( ld, rc, NULL, NULL );
return( vals );
}
char **
LDAP_CALL
ldap_get_values( LDAP *ld, LDAPMessage *entry, const char *target )
{
return( (char **) internal_ldap_get_values( ld, entry, target, 0 ) );
}
struct berval **
LDAP_CALL
ldap_get_values_len( LDAP *ld, LDAPMessage *entry, const char *target )
{
return( (struct berval **) internal_ldap_get_values( ld, entry, target,
1 ) );
}
char **
LDAP_CALL
ldap_get_lang_values( LDAP *ld, LDAPMessage *entry, const char *target,
char **type )
{
return( (char **) internal_ldap_get_lang_values( ld, entry,
target, type, 0 ) );
}
struct berval **
LDAP_CALL
ldap_get_lang_values_len( LDAP *ld, LDAPMessage *entry, const char *target,
char **type )
{
return( (struct berval **) internal_ldap_get_lang_values( ld, entry,
target, type, 1 ) );
}

View File

@@ -0,0 +1,29 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1996 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* LIBLDAP globals.c -- LDAP library global variables
*/
#ifdef LDAP_DEBUG
int ldap_debug;
#endif

View File

@@ -0,0 +1,710 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _LDAPINT_H
#define _LDAPINT_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#ifdef hpux
#include <strings.h>
#include <time.h>
#endif /* hpux */
#ifdef _WINDOWS
# define FD_SETSIZE 256 /* number of connections we support */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <time.h>
#elif defined(macintosh)
#include "ldap-macos.h"
# include <time.h>
#elif defined(XP_OS2)
#include <os2sock.h>
#else /* _WINDOWS */
# include <sys/time.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netdb.h>
#if !defined(hpux) && !defined(SUNOS4) && !defined(LINUX1_2) && !defined(LINUX2_0)
# include <sys/select.h>
#endif /* !defined(hpux) and others */
#endif /* _WINDOWS */
#if defined(BSDI) || defined(LINUX1_2) || defined(SNI) || defined(IRIX)
#include <arpa/inet.h>
#endif /* BSDI */
#if defined(IRIX)
#include <bstring.h>
#endif /* IRIX */
#ifdef macintosh
#include "lber-int.h"
#else /* macintosh */
#include "../liblber/lber-int.h"
#endif /* macintosh */
#include "ldap.h"
#include "ldaprot.h"
#include "ldaplog.h"
#include "portable.h"
#ifdef LDAP_ASYNC_IO
#ifdef NEED_FILIO
#include <sys/filio.h> /* to get FIONBIO for ioctl() call */
#else /* NEED_FILIO */
#include <sys/ioctl.h> /* to get FIONBIO for ioctl() call */
#endif /* NEED_FILIO */
#endif /* LDAP_ASYNC_IO */
#ifdef USE_SYSCONF
# include <unistd.h>
#endif /* USE_SYSCONF */
#if !defined(_WINDOWS) && !defined(macintosh) && !defined(LINUX2_0)
#define NSLDAPI_HAVE_POLL 1
#endif
/* SSL version, or 0 if not built with SSL */
#if defined(NET_SSL)
# define SSL_VERSION 3
#else
# define SSL_VERSION 0
#endif
#define LDAP_URL_URLCOLON "URL:"
#define LDAP_URL_URLCOLON_LEN 4
#define LDAP_LDAP_REF_STR LDAP_URL_PREFIX
#define LDAP_LDAP_REF_STR_LEN LDAP_URL_PREFIX_LEN
#define LDAP_LDAPS_REF_STR LDAPS_URL_PREFIX
#define LDAP_LDAPS_REF_STR_LEN LDAPS_URL_PREFIX_LEN
/* default limit on nesting of referrals */
#define LDAP_DEFAULT_REFHOPLIMIT 5
#ifdef LDAP_DNS
#define LDAP_DX_REF_STR "dx://"
#define LDAP_DX_REF_STR_LEN 5
#endif /* LDAP_DNS */
typedef enum { LDAP_CACHE_LOCK, LDAP_MEMCACHE_LOCK, LDAP_MSGID_LOCK,
LDAP_REQ_LOCK, LDAP_RESP_LOCK, LDAP_ABANDON_LOCK, LDAP_CTRL_LOCK,
LDAP_OPTION_LOCK, LDAP_ERR_LOCK, LDAP_CONN_LOCK, LDAP_SELECT_LOCK,
LDAP_RESULT_LOCK, LDAP_PEND_LOCK, LDAP_MAX_LOCK } LDAPLock;
/*
* This structure represents both ldap messages and ldap responses.
* These are really the same, except in the case of search responses,
* where a response has multiple messages.
*/
struct ldapmsg {
int lm_msgid; /* the message id */
int lm_msgtype; /* the message type */
BerElement *lm_ber; /* the ber encoded message contents */
struct ldapmsg *lm_chain; /* for search - next msg in the resp */
struct ldapmsg *lm_next; /* next response */
int lm_fromcache; /* memcache: origin of message */
};
/*
* structure for tracking LDAP server host, ports, DNs, etc.
*/
typedef struct ldap_server {
char *lsrv_host;
char *lsrv_dn; /* if NULL, use default */
int lsrv_port;
unsigned long lsrv_options; /* boolean options */
#define LDAP_SRV_OPT_SECURE 0x01
struct ldap_server *lsrv_next;
} LDAPServer;
/*
* structure for representing an LDAP server connection
*/
typedef struct ldap_conn {
Sockbuf *lconn_sb;
BerElement *lconn_ber; /* non-NULL if in midst of msg. */
int lconn_version; /* LDAP protocol version */
int lconn_refcnt;
unsigned long lconn_lastused; /* time */
int lconn_status;
#define LDAP_CONNST_NEEDSOCKET 1
#define LDAP_CONNST_CONNECTING 2
#define LDAP_CONNST_CONNECTED 3
#define LDAP_CONNST_DEAD 4
LDAPServer *lconn_server;
char *lconn_binddn; /* DN of last successful bind */
int lconn_bound; /* has a bind been done? */
char *lconn_krbinstance;
struct ldap_conn *lconn_next;
} LDAPConn;
/*
* structure used to track outstanding requests
*/
typedef struct ldapreq {
int lr_msgid; /* the message id */
int lr_status; /* status of request */
#define LDAP_REQST_INPROGRESS 1
#define LDAP_REQST_CHASINGREFS 2
#define LDAP_REQST_NOTCONNECTED 3
#define LDAP_REQST_WRITING 4
#define LDAP_REQST_CONNDEAD 5 /* associated conn. has failed */
int lr_outrefcnt; /* count of outstanding referrals */
int lr_origid; /* original request's message id */
int lr_parentcnt; /* count of parent requests */
int lr_res_msgtype; /* result message type */
int lr_res_errno; /* result LDAP errno */
char *lr_res_error; /* result error string */
char *lr_res_matched;/* result matched DN string */
BerElement *lr_ber; /* ber encoded request contents */
LDAPConn *lr_conn; /* connection used to send request */
char *lr_binddn; /* request is a bind for this DN */
struct ldapreq *lr_parent; /* request that spawned this referral */
struct ldapreq *lr_refnext; /* next referral spawned */
struct ldapreq *lr_prev; /* previous request */
struct ldapreq *lr_next; /* next request */
} LDAPRequest;
typedef struct ldappend {
void *lp_sema; /* semaphore to post */
int lp_msgid; /* message id */
LDAPMessage *lp_result; /* result storage */
struct ldappend *lp_prev; /* previous pending */
struct ldappend *lp_next; /* next pending */
} LDAPPend;
/*
* structure representing an ldap connection
*/
struct ldap {
struct sockbuf *ld_sbp; /* pointer to socket desc. & buffer */
char *ld_host;
int ld_version; /* LDAP protocol version */
char ld_lberoptions;
int ld_deref;
int ld_timelimit;
int ld_sizelimit;
struct ldap_filt_desc *ld_filtd; /* from getfilter for ufn searches */
char *ld_ufnprefix; /* for incomplete ufn's */
int ld_errno;
char *ld_error;
char *ld_matched;
int ld_msgid;
/* do not mess with these */
LDAPRequest *ld_requests; /* list of outstanding requests */
LDAPMessage *ld_responses; /* list of outstanding responses */
int *ld_abandoned; /* array of abandoned requests */
char *ld_cldapdn; /* DN used in connectionless search */
/* it is OK to change these next four values directly */
int ld_cldaptries; /* connectionless search retry count */
int ld_cldaptimeout;/* time between retries */
int ld_refhoplimit; /* limit on referral nesting */
unsigned long ld_options; /* boolean options */
#define LDAP_BITOPT_REFERRALS 0x80000000
#define LDAP_BITOPT_SSL 0x40000000
#define LDAP_BITOPT_DNS 0x20000000
#define LDAP_BITOPT_RESTART 0x10000000
#define LDAP_BITOPT_RECONNECT 0x08000000
#define LDAP_BITOPT_ASYNC 0x04000000
/* do not mess with the rest though */
char *ld_defhost; /* full name of default server */
int ld_defport; /* port of default server */
BERTranslateProc ld_lber_encode_translate_proc;
BERTranslateProc ld_lber_decode_translate_proc;
LDAPConn *ld_defconn; /* default connection */
LDAPConn *ld_conns; /* list of all server connections */
void *ld_selectinfo; /* platform specifics for select */
int ld_selectreadcnt; /* count of read sockets */
int ld_selectwritecnt; /* count of write sockets */
LDAP_REBINDPROC_CALLBACK *ld_rebind_fn;
void *ld_rebind_arg;
/* function pointers, etc. for io */
struct ldap_io_fns ld_io;
#define ld_read_fn ld_io.liof_read
#define ld_write_fn ld_io.liof_write
#define ld_select_fn ld_io.liof_select
#define ld_socket_fn ld_io.liof_socket
#define ld_ioctl_fn ld_io.liof_ioctl
#define ld_connect_fn ld_io.liof_connect
#define ld_close_fn ld_io.liof_close
#define ld_ssl_enable_fn ld_io.liof_ssl_enable
/* function pointers, etc. for DNS */
struct ldap_dns_fns ld_dnsfn;
#define ld_dns_extradata ld_dnsfn.lddnsfn_extradata
#define ld_dns_bufsize ld_dnsfn.lddnsfn_bufsize
#define ld_dns_gethostbyname_fn ld_dnsfn.lddnsfn_gethostbyname
#define ld_dns_gethostbyaddr_fn ld_dnsfn.lddnsfn_gethostbyaddr
/* function pointers, etc. for threading */
struct ldap_thread_fns ld_thread;
#define ld_mutex_alloc_fn ld_thread.ltf_mutex_alloc
#define ld_mutex_free_fn ld_thread.ltf_mutex_free
#define ld_mutex_lock_fn ld_thread.ltf_mutex_lock
#define ld_mutex_unlock_fn ld_thread.ltf_mutex_unlock
#define ld_get_errno_fn ld_thread.ltf_get_errno
#define ld_set_errno_fn ld_thread.ltf_set_errno
#define ld_get_lderrno_fn ld_thread.ltf_get_lderrno
#define ld_set_lderrno_fn ld_thread.ltf_set_lderrno
#define ld_lderrno_arg ld_thread.ltf_lderrno_arg
void **ld_mutex;
/* function pointers, etc. for caching */
int ld_cache_on;
int ld_cache_strategy;
struct ldap_cache_fns ld_cache;
#define ld_cache_config ld_cache.lcf_config
#define ld_cache_bind ld_cache.lcf_bind
#define ld_cache_unbind ld_cache.lcf_unbind
#define ld_cache_search ld_cache.lcf_search
#define ld_cache_compare ld_cache.lcf_compare
#define ld_cache_add ld_cache.lcf_add
#define ld_cache_delete ld_cache.lcf_delete
#if 0
#define ld_cache_rename ld_cache.lcf_rename
#endif
#define ld_cache_modify ld_cache.lcf_modify
#define ld_cache_modrdn ld_cache.lcf_modrdn
#define ld_cache_abandon ld_cache.lcf_abandon
#define ld_cache_result ld_cache.lcf_result
#define ld_cache_flush ld_cache.lcf_flush
#define ld_cache_arg ld_cache.lcf_arg
/* ldapv3 controls */
LDAPControl **ld_servercontrols;
LDAPControl **ld_clientcontrols;
/* Preferred language */
char *ld_preferred_language;
/* MemCache */
LDAPMemCache *ld_memcache;
/* Pending results */
LDAPPend *ld_pend; /* list of pending results */
/* extra thread function pointers */
struct ldap_extra_thread_fns ld_thread2;
#define ld_mutex_trylock_fn ld_thread2.ltf_mutex_trylock
#define ld_sema_alloc_fn ld_thread2.ltf_sema_alloc
#define ld_sema_free_fn ld_thread2.ltf_sema_free
#define ld_sema_wait_fn ld_thread2.ltf_sema_wait
#define ld_sema_post_fn ld_thread2.ltf_sema_post
};
/* allocate/free mutex */
#define LDAP_MUTEX_ALLOC( ld ) \
(((ld)->ld_mutex_alloc_fn != NULL) ? (ld)->ld_mutex_alloc_fn() : NULL)
/* allocate/free mutex */
#define LDAP_MUTEX_FREE( ld, m ) \
if ( (ld)->ld_mutex_free_fn != NULL && m != NULL ) { \
(ld)->ld_mutex_free_fn( m ); \
}
/* enter/exit critical sections */
#define LDAP_MUTEX_TRYLOCK( ld, i ) \
( (ld)->ld_mutex_trylock_fn == NULL ) ? 0 : \
(ld)->ld_mutex_trylock_fn( (ld)->ld_mutex[i] )
#define LDAP_MUTEX_LOCK( ld, i ) \
if ( (ld)->ld_mutex_lock_fn != NULL ) { \
(ld)->ld_mutex_lock_fn( (ld)->ld_mutex[i] ); \
}
#define LDAP_MUTEX_UNLOCK( ld, i ) \
if ( (ld)->ld_mutex_unlock_fn != NULL ) { \
(ld)->ld_mutex_unlock_fn( (ld)->ld_mutex[i] ); \
}
/* Backword compatibility locks */
#define LDAP_MUTEX_BC_LOCK( ld, i ) \
if( (ld)->ld_mutex_trylock_fn == NULL ) { \
if ( (ld)->ld_mutex_lock_fn != NULL ) { \
(ld)->ld_mutex_lock_fn( (ld)->ld_mutex[i] ); \
} \
}
#define LDAP_MUTEX_BC_UNLOCK( ld, i ) \
if( (ld)->ld_mutex_trylock_fn == NULL ) { \
if ( (ld)->ld_mutex_unlock_fn != NULL ) { \
(ld)->ld_mutex_unlock_fn( (ld)->ld_mutex[i] ); \
} \
}
/* allocate/free semaphore */
#define LDAP_SEMA_ALLOC( ld ) \
(((ld)->ld_sema_alloc_fn != NULL) ? (ld)->ld_sema_alloc_fn() : NULL)
#define LDAP_SEMA_FREE( ld, m ) \
if ( (ld)->ld_sema_free_fn != NULL && m != NULL ) { \
(ld)->ld_sema_free_fn( m ); \
}
/* wait/post binary semaphore */
#define LDAP_SEMA_WAIT( ld, lp ) \
if ( (ld)->ld_sema_wait_fn != NULL ) { \
(ld)->ld_sema_wait_fn( lp->lp_sema ); \
}
#define LDAP_SEMA_POST( ld, lp ) \
if ( (ld)->ld_sema_post_fn != NULL ) { \
(ld)->ld_sema_post_fn( lp->lp_sema ); \
}
#define POST( ld, y, z ) \
if( (ld)->ld_mutex_trylock_fn != NULL ) { \
nsldapi_post_result( ld, y, z ); \
}
/* get/set errno */
#ifndef macintosh
#define LDAP_SET_ERRNO( ld, e ) \
if ( (ld)->ld_set_errno_fn != NULL ) { \
(ld)->ld_set_errno_fn( e ); \
} else { \
errno = e; \
}
#define LDAP_GET_ERRNO( ld ) \
(((ld)->ld_get_errno_fn != NULL) ? \
(ld)->ld_get_errno_fn() : errno)
#else /* macintosh */
#define LDAP_SET_ERRNO( ld, e ) \
if ( (ld)->ld_set_errno_fn != NULL ) { \
(ld)->ld_set_errno_fn( e ); \
}
#define LDAP_GET_ERRNO( ld ) \
(((ld)->ld_get_errno_fn != NULL) ? \
(ld)->ld_get_errno_fn() : 0)
#endif
/* get/set ldap-specific errno */
#define LDAP_SET_LDERRNO( ld, e, m, s ) ldap_set_lderrno( ld, e, m, s )
#define LDAP_GET_LDERRNO( ld, m, s ) ldap_get_lderrno( ld, m, s )
/*
* your standard "mimimum of two values" macro
*/
#define NSLDAPI_MIN(a, b) (((a) < (b)) ? (a) : (b))
/*
* handy macro to check whether LDAP struct is set up for CLDAP or not
*/
#define LDAP_IS_CLDAP( ld ) ( ld->ld_sbp->sb_naddr > 0 )
/*
* handy macro to check errno "e" for an "in progress" sort of error
*/
#if defined(macintosh) || defined(_WINDOWS)
#define NSLDAPI_ERRNO_IO_INPROGRESS( e ) ((e) == EWOULDBLOCK || (e) == EAGAIN)
#else
#ifdef EAGAIN
#define NSLDAPI_ERRNO_IO_INPROGRESS( e ) ((e) == EWOULDBLOCK || (e) == EINPROGRESS || (e) == EAGAIN)
#else /* EAGAIN */
#define NSLDAPI_ERRNO_IO_INPROGRESS( e ) ((e) == EWOULDBLOCK || (e) == EINPROGRESS)
#endif /* EAGAIN */
#endif /* macintosh || _WINDOWS*/
/*
* macro to return the LDAP protocol version we are using
*/
#define NSLDAPI_LDAP_VERSION( ld ) ( (ld)->ld_defconn == NULL ? \
(ld)->ld_version : \
(ld)->ld_defconn->lconn_version )
/*
* Structures used for handling client filter lists.
*/
#define LDAP_FILT_MAXSIZ 1024
struct ldap_filt_list {
char *lfl_tag;
char *lfl_pattern;
char *lfl_delims;
struct ldap_filt_info *lfl_ilist;
struct ldap_filt_list *lfl_next;
};
struct ldap_filt_desc {
LDAPFiltList *lfd_filtlist;
LDAPFiltInfo *lfd_curfip;
LDAPFiltInfo lfd_retfi;
char lfd_filter[ LDAP_FILT_MAXSIZ ];
char *lfd_curval;
char *lfd_curvalcopy;
char **lfd_curvalwords;
char *lfd_filtprefix;
char *lfd_filtsuffix;
};
/*
* "internal" globals used to track defaults and memory allocation callbacks:
* (the actual definitions are in open.c)
*/
extern struct ldap nsldapi_ld_defaults;
extern struct ldap_memalloc_fns nsldapi_memalloc_fns;
extern int nsldapi_initialized;
/*
* Memory allocation done in liblber should all go through one of the
* following macros. This is so we can plug-in alternative memory
* allocators, etc. as the need arises.
*/
#define NSLDAPI_MALLOC( size ) nsldapi_malloc( size )
#define NSLDAPI_CALLOC( nelem, elsize ) nsldapi_calloc( nelem, elsize )
#define NSLDAPI_REALLOC( ptr, size ) nsldapi_realloc( ptr, size )
#define NSLDAPI_FREE( ptr ) nsldapi_free( ptr )
/*
* macros used to check validity of data structures and parameters
*/
#define NSLDAPI_VALID_LDAP_POINTER( ld ) \
( (ld) != NULL )
#define NSLDAPI_VALID_LDAPMESSAGE_POINTER( lm ) \
( (lm) != NULL )
#define NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( lm ) \
( (lm) != NULL && (lm)->lm_msgtype == LDAP_RES_SEARCH_ENTRY )
#define NSLDAPI_VALID_LDAPMESSAGE_REFERENCE_POINTER( lm ) \
( (lm) != NULL && (lm)->lm_msgtype == LDAP_RES_SEARCH_REFERENCE )
#define NSLDAPI_VALID_LDAPMESSAGE_BINDRESULT_POINTER( lm ) \
( (lm) != NULL && (lm)->lm_msgtype == LDAP_RES_BIND )
#define NSLDAPI_VALID_LDAPMESSAGE_EXRESULT_POINTER( lm ) \
( (lm) != NULL && (lm)->lm_msgtype == LDAP_RES_EXTENDED )
#define NSLDAPI_VALID_LDAPMOD_ARRAY( mods ) \
( (mods) != NULL )
#define NSLDAPI_VALID_NONEMPTY_LDAPMOD_ARRAY( mods ) \
( (mods) != NULL && (mods)[0] != NULL )
#define NSLDAPI_IS_SEARCH_ENTRY( code ) \
((code) == LDAP_RES_SEARCH_ENTRY)
#define NSLDAPI_IS_SEARCH_RESULT( code ) \
((code) == LDAP_RES_SEARCH_RESULT)
#define NSLDAPI_SEARCH_RELATED_RESULT( code ) \
(NSLDAPI_IS_SEARCH_RESULT( code ) || NSLDAPI_IS_SEARCH_ENTRY( code ))
/*
* in bind.c
*/
char *nsldapi_get_binddn( LDAP *ld );
/*
* in cache.c
*/
void nsldapi_add_result_to_cache( LDAP *ld, LDAPMessage *result );
/*
* in dsparse.c
*/
int nsldapi_next_line_tokens( char **bufp, long *blenp, char ***toksp );
void nsldapi_free_strarray( char **sap );
/*
* in error.c
*/
int nsldapi_parse_result( LDAP *ld, int msgtype, BerElement *rber,
int *errcodep, char **matchednp, char **errmsgp, char ***referralsp,
LDAPControl ***serverctrlsp );
/*
* in open.c
*/
void nsldapi_initialize_defaults( void );
int nsldapi_open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host,
int defport, char **krbinstancep, int async, int secure );
int nsldapi_open_ldap_defconn( LDAP *ld );
void *nsldapi_malloc( size_t size );
void *nsldapi_calloc( size_t nelem, size_t elsize );
void *nsldapi_realloc( void *ptr, size_t size );
void nsldapi_free( void *ptr );
char *nsldapi_strdup( const char *s );
/*
* in os-ip.c
*/
int nsldapi_connect_to_host( LDAP *ld, Sockbuf *sb, char *host,
unsigned long address, int port, int async, int secure );
void nsldapi_close_connection( LDAP *ld, Sockbuf *sb );
int nsldapi_do_ldap_select( LDAP *ld, struct timeval *timeout );
void *nsldapi_new_select_info( void );
void nsldapi_free_select_info( void *vsip );
void nsldapi_mark_select_write( LDAP *ld, Sockbuf *sb );
void nsldapi_mark_select_read( LDAP *ld, Sockbuf *sb );
void nsldapi_mark_select_clear( LDAP *ld, Sockbuf *sb );
int nsldapi_is_read_ready( LDAP *ld, Sockbuf *sb );
int nsldapi_is_write_ready( LDAP *ld, Sockbuf *sb );
/*
* if referral.c
*/
int nsldapi_parse_reference( LDAP *ld, BerElement *rber, char ***referralsp,
LDAPControl ***serverctrlsp );
/*
* in result.c
*/
int ldap_msgdelete( LDAP *ld, int msgid );
int nsldapi_result_nolock( LDAP *ld, int msgid, int all, int unlock_permitted,
struct timeval *timeout, LDAPMessage **result );
int nsldapi_wait_result( LDAP *ld, int msgid, int all, struct timeval *timeout,
LDAPMessage **result );
int nsldapi_post_result( LDAP *ld, int msgid, LDAPMessage *result );
/*
* in request.c
*/
int nsldapi_send_initial_request( LDAP *ld, int msgid, unsigned long msgtype,
char *dn, BerElement *ber );
int nsldapi_alloc_ber_with_options( LDAP *ld, BerElement **berp );
void nsldapi_set_ber_options( LDAP *ld, BerElement *ber );
int nsldapi_ber_flush( LDAP *ld, Sockbuf *sb, BerElement *ber, int freeit,
int async );
int nsldapi_send_server_request( LDAP *ld, BerElement *ber, int msgid,
LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc,
char *bindreqdn, int bind );
LDAPConn *nsldapi_new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
int connect, int bind );
LDAPRequest *nsldapi_find_request_by_msgid( LDAP *ld, int msgid );
void nsldapi_free_request( LDAP *ld, LDAPRequest *lr, int free_conn );
void nsldapi_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
void nsldapi_dump_connection( LDAP *ld, LDAPConn *lconns, int all );
void nsldapi_dump_requests_and_responses( LDAP *ld );
int nsldapi_chase_v2_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp,
int *totalcountp, int *chasingcountp );
int nsldapi_chase_v3_refs( LDAP *ld, LDAPRequest *lr, char **refs,
int is_reference, int *totalcountp, int *chasingcountp );
int nsldapi_append_referral( LDAP *ld, char **referralsp, char *s );
void nsldapi_connection_lost_nolock( LDAP *ld, Sockbuf *sb );
/*
* in search.c
*/
int ldap_build_search_req( LDAP *ld, char *base, int scope,
char *filter, char **attrs, int attrsonly, LDAPControl **serverctrls,
LDAPControl **clientctrls, struct timeval *timeoutp, int sizelimit,
int msgid, BerElement **berp );
/*
* in unbind.c
*/
int ldap_ld_free( LDAP *ld, int close );
int nsldapi_send_unbind( LDAP *ld, Sockbuf *sb );
#ifdef LDAP_DNS
/*
* in getdxbyname.c
*/
char **nsldapi_getdxbyname( char *domain );
#endif /* LDAP_DNS */
/*
* in unescape.c
*/
void nsldapi_hex_unescape( char *s );
/*
* in reslist.c
*/
LDAPMessage *ldap_delete_result_entry( LDAPMessage **list, LDAPMessage *e );
void ldap_add_result_entry( LDAPMessage **list, LDAPMessage *e );
/*
* in compat.c
*/
#ifdef hpux
char *nsldapi_compat_ctime_r( const time_t *clock, char *buf, int buflen );
struct hostent *nsldapi_compat_gethostbyname_r( const char *name,
struct hostent *result, char *buffer, int buflen, int *h_errnop );
#endif /* hpux */
/*
* in control.c
*/
int nsldapi_put_controls( LDAP *ld, LDAPControl **ctrls, int closeseq,
BerElement *ber );
int nsldapi_get_controls( BerElement *ber, LDAPControl ***controlsp );
int nsldapi_dup_controls( LDAP *ld, LDAPControl ***ldctrls,
LDAPControl **newctrls );
int nsldapi_build_control( char *oid, BerElement *ber, int freeber,
char iscritical, LDAPControl **ctrlp );
/*
* in url.c
*/
int nsldapi_url_parse( char *url, LDAPURLDesc **ludpp, int dn_required );
/*
* in charset.c
*
* If we ever want to expose character set translation functionality to
* users of libldap, all of these prototypes will need to be moved to ldap.h
*/
#ifdef STR_TRANSLATION
void ldap_set_string_translators( LDAP *ld,
BERTranslateProc encode_proc, BERTranslateProc decode_proc );
int ldap_translate_from_t61( LDAP *ld, char **bufp,
unsigned long *lenp, int free_input );
int ldap_translate_to_t61( LDAP *ld, char **bufp,
unsigned long *lenp, int free_input );
void ldap_enable_translation( LDAP *ld, LDAPMessage *entry,
int enable );
#ifdef LDAP_CHARSET_8859
int ldap_t61_to_8859( char **bufp, unsigned long *buflenp,
int free_input );
int ldap_8859_to_t61( char **bufp, unsigned long *buflenp,
int free_input );
#endif /* LDAP_CHARSET_8859 */
#endif /* STR_TRANSLATION */
/*
* in memcache.h
*/
int ldap_memcache_createkey( LDAP *ld, const char *base, int scope,
const char *filter, char **attrs, int attrsonly,
LDAPControl **serverctrls, LDAPControl **clientctrls,
unsigned long *keyp );
int ldap_memcache_result( LDAP *ld, int msgid, unsigned long key );
int ldap_memcache_new( LDAP *ld, int msgid, unsigned long key,
const char *basedn );
int ldap_memcache_append( LDAP *ld, int msgid, int bLast, LDAPMessage *result );
int ldap_memcache_abandon( LDAP *ld, int msgid );
#endif /* _LDAPINT_H */

View File

@@ -0,0 +1,105 @@
# ldap filter file
#
# lines like this that start with # or empty lines are ignored
#
# syntax:
#
# <tag>
# <pattern1> <delimiters> <filter1-1> <desc1-1> [<scope>]
# <filter1-2> <desc1-2> [<scope>]
#
# <pattern2> <delimiters> <filter2-1> <desc2-1> [<scope>] ...
#
# The "desc" should describe the filter and it should correctly complete
# both of the following phrases:
#
# One <desc> match was found for...
# Three <desc> matches were found for...
#
# The scope is optional, and should be one of:
# "base"
# "onelevel"
# "subtree"
# if it is included.
#
"finger and ud and go500 and go500gw subtree and web500gw subtree and rp500 and rcpt500 and ufn last"
"=" " " "%v" "arbitrary filter"
"^[0-9][0-9-]*$" " " "(telephoneNumber=*%v)" "phone number"
"@" " " "(mail=%v)" "email address"
"(mail=%v*)" "start of email address"
"^.[. _].*" ". _" "(cn=%v1* %v2-)" "first initial"
".*[. _].$" ". _" "(cn=%v1-*)" "last initial"
"[. _]" ". _" "(|(sn=%v1-)(cn=%v1-))" "exact"
"(|(sn~=%v1-)(cn~=%v1-))" "approximate"
".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1))" "exact"
"(|(cn~=%v1)(sn~=%v1))" "approximate"
"go500gw onelevel and web500gw onelevel and ufn first and ufn intermediate"
"=" " " "%v" "arbitrary filter"
"^..$" " " "(|(o=%v)(c=%v)(l=%v)(co=%v))" "exact"
"(|(o~=%v)(c~=%v)(l~=%v)(co~=%v))" "approximate"
" " " " "(|(o=%v)(l=%v)(co=%v)(ou=%v))" "exact"
"(|(o~=%v)(l~=%v)(co~=%v)(ou~=%v))" "approximate"
"\." " " "(associatedDomain=%v)" "exact"
".*" " " "(|(o=%v)(l=%v)(co=%v)(ou=%v))" "exact"
"(|(o~=%v)(l~=%v)(co~=%v)(ou~=%v))" "approximate"
#
# xax500
#
"xax500"
"=" " " "(%v)" "arbitrary filter"
"^[0-9][0-9-]*$" " " "(telephoneNumber=*%v)" "phone number"
"@" " " "(mail=%v)" "email address"
"(mail=%v*)" "start of email address"
"^.[. _].*" ". _" "(cn=%v1* %v2-)" "first initial"
".*[. _].$" ". _" "(cn=%v1-*)" "last initial"
"[. _]" ". _" "(|(sn=%v1-)(cn=%v1-))" "exact"
"(|(sn~=%v1-)(cn~=%v1-))" "approximate"
".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1))" "exact"
"(|(cn=%v1)(sn~=%v1))" "approximate"
"xax500-auth"
"=" " " "(%v)" "arbitrary filter"
"^[0-9][0-9-]*$" " " "(telephoneNumber=*%v)" "phone number"
"@" " " "(mail=%v)" "email address"
"(mail=%v*)" "start of email address"
"^.[. _].*" ". _" "(cn=%v1* %v2-)" "first initial"
".*[. _].$" ". _" "(cn=%v1-*)" "last initial"
"[. _]" ". _" "(|(sn=%v1-)(cn=%v1-))" "exact"
"(|(sn~=%v1-)(cn~=%v1-))" "approximate"
".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1))" "exact"
"(|(cn=%v1)(sn~=%v1))" "approximate"
"list500"
"[. _]" ". _" "(|(sn=%v1-)(cn=%v1-))" "exact"
"(|(sn~=%v1-)(cn~=%v1-))" "approximate"
".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1))" "exact"
"(|(cn~=%v1)(sn~=%v1))" "approximate"

View File

@@ -0,0 +1,242 @@
AD Andorra
AE United Arab Emirates
AF Afghanistan
AG Antigua and Barbuda
AI Anguilla
AL Albania
AM Armenia
AN Netherlands Antilles
AO Angola
AQ Antarctica
AR Argentina
AS American Samoa
AT Austria
AU Australia
AW Aruba
AZ Azerbaijan
BA Bosnia and Herzegowina
BB Barbados
BD Bangladesh
BE Belgium
BF Burkina Faso
BG Bulgaria
BH Bahrain
BI Burundi
BJ Benin
BM Bermuda
BN Brunei Darussalam
BO Bolivia
BR Brazil
BS Bahamas
BT Bhutan
BV Bouvet Island
BW Botswana
BY Belarus
BZ Belize
CA Canada
CC Cocos (Keeling) Islands
CF Central African Republic
CG Congo
CH Switzerland
CI Cote d'Ivoire
CK Cook Islands
CL Chile
CM Cameroon
CN China
CO Colombia
CR Costa Rica
CS Former Czechoslovakia
CU Cuba
CV Cape Verde
CX Christmas Island
CY Cyprus
CZ Czech Republic
DE Germany
DJ Djibouti
DK Denmark
DM Dominica
DO Dominican Republic
DZ Algeria
EC Ecuador
EE Estonia
EG Egypt
EH Western Sahara
ER Eritrea
ES Spain
ET Ethiopia
FI Finland
FJ Fiji
FK Falkland Islands (Malvinas)
FM Micronesia
FO Faroe Islands
FR France
FX France, Metropolitan
GA Gabon
GB United Kingdom
GD Grenada
GE Georgia
GF French Guiana
GH Ghana
GI Gibraltar
GL Greenland
GM Gambia
GN Guinea
GP Guadeloupe
GQ Equatorial Guinea
GR Greece
GS South Georgia and the South Sandwich Islands
GT Guatemala
GU Guam
GW Guinea-Bissau
GY Guyana
HK Hong Kong
HM Heard and McDonald Islands
HN Honduras
HR Croatia
HT Haiti
HU Hungary
ID Indonesia
IE Ireland
IL Israel
IN India
IO British Indian Ocean Territory
IQ Iraq
IR Iran
IS Iceland
IT Italy
JM Jamaica
JO Jordan
JP Japan
KE Kenya
KG Kyrgyzstan
KH Cambodia
KI Kiribati
KM Comoros
KN Saint Kitts and Nevis
KP Korea, Democratic People's Republic of
KR Korea, Republic of
KW Kuwait
KY Cayman Islands
KZ Kazakhstan
LA Laos
LB Lebanon
LC Saint Lucia
LI Liechtenstein
LK Sri Lanka
LR Liberia
LS Lesotho
LT Lithuania
LU Luxembourg
LV Latvia
LY Libya
MA Morocco
MC Monaco
MD Moldova
MG Madagascar
MH Marshall Islands
MK Macedonia
ML Mali
MM Myanmar
MN Mongolia
MO Macau
MP Northern Mariana Islands
MQ Martinique
MR Mauritania
MS Montserrat
MT Malta
MU Mauritius
MV Maldives
MW Malawi
MX Mexico
MY Malaysia
MZ Mozambique
NA Namibia
NC New Caledonia
NE Niger
NF Norfolk Island
NG Nigeria
NI Nicaragua
NL Netherlands
NO Norway
NP Nepal
NR Nauru
NU Niue
NZ New Zealand
OM Oman
PA Panama
PE Peru
PF French Polynesia
PG Papua New Guinea
PH Philippines
PK Pakistan
PL Poland
PM St. Pierre and Miquelon
PN Pitcairn
PR Puerto Rico
PT Portugal
PW Palau
PY Paraguay
QA Qatar
RE Reunion
RO Romania
RU Russian Federation
RW Rwanda
SA Saudi Arabia
SB Solomon Islands
SC Seychelles
SD Sudan
SE Sweden
SG Singapore
SH St. Helena
SI Slovenia
SJ Svalbard and Jan Mayen Islands
SK Slovakia (Slovak Republic)
SL Sierra Leone
SM San Marino
SN Senegal
SO Somalia
SR Suriname
ST Sao Tome and Principe
SU Former Soviet Union
SV El Salvador
SY Syria
SZ Swaziland
TC Turks and Caicos Islands
TD Chad
TF French Southern Territories
TG Togo
TH Thailand
TJ Tajikistan
TK Tokelau
TM Turkmenistan
TN Tunisia
TO Tonga
TP East Timor
TR Turkey
TT Trinidad and Tobago
TV Tuvalu
TW Taiwan
TZ Tanzania
UA Ukraine
UG Uganda
UK United Kingdom
UM United States Minor Outlying Islands
US United States of America
UY Uruguay
UZ Uzbekistan
VA Vatican City State (Holy See)
VC Saint Vincent and the Grenadines
VE Venezuela
VG Virgin Islands (British)
VI Virgin Islands (U.S.)
VN Viet Nam
VU Vanuatu
WF Wallis and Futuna Islands
WS Samoa
YE Yemen
YT Mayotte
YU Yugoslavia
ZA South Africa
ZM Zambia
ZR Zaire
ZW Zimbabwe

View File

@@ -0,0 +1,153 @@
# Version should be 1 now
Version 1
#
#
# Name for this search object
People
# options (the only one supported right now is "internal" which means that
# this search object should not be presented directly to the user)
# use "" for none
""
# Label to place before text box user types in
"Search For:"
# Filter prefix to append to all "More Choices" searches
"(&(objectClass=person)"
# Tag to use for "Fewer Choices" searches - from ldapfilter.conf file
"xax500"
# If a search results in > 1 match, retrieve this attribute to help
# user disambiguate the entries...
title
# ...and label it with this string:
"Title"
# Search scope to use when searching
subtree
# Follows a list of "More Choices" search options. Format is:
# Label, attribute, select-bitmap, extra attr display name, extra attr ldap name
# If last two are null, "Fewer Choices" name/attributes used
"Common Name" cn 11111 "" ""
"Surname" sn 11111 "" ""
"Business Phone" "telephoneNumber" 11101 "" ""
"E-Mail Address" "mail" 11111 "" ""
"Uniqname" "uid" 11111 "" ""
"Title" title 11111 "" ""
END
# Match types
"exactly matches" "(%a=%v))"
"approximately matches" "(%a~=%v))"
"starts with" "(%a=%v*))"
"ends with" "(%a=*%v))"
"contains" "(%a=*%v*))"
END
#
#
#
Groups
""
"Search For:"
"(&(objectClass=rfc822MailGroup)"
"xax500"
multilineDescription
"Description"
subtree
"Common Name" cn 11111 "" ""
"Description" multilineDescription 11101 "" ""
"Owner" "owner" 00001 "owner" "Owner"
"X.500 Member" "member" 00001 "" ""
"E-Mail Member" "mail" 00101 "" ""
END
"exactly matches" "(%a=%v))"
"approximately matches" "(%a~=%v))"
"starts with" "(%a=%v*))"
"ends with" "(%a=*%v))"
"contains" "(%a=*%v*))"
END
#
#
#
"Joinable Groups"
""
"Search For:"
"(&(&(objectClass=rfc822MailGroup)(joinable=TRUE))"
"xax500"
multilineDescription
"Description"
subtree
"Common Name" cn 11111 "" ""
"Description" multilineDescription 11101 "" ""
"Owner" "owner" 00001 "owner" "Owner"
"X.500 Member" "member" 00001 "" ""
"E-Mail Member" "mail" 00101 "" ""
END
"exactly matches" "(%a=%v))"
"approximately matches" "(%a~=%v))"
"starts with" "(%a=%v*))"
"ends with" "(%a=*%v))"
"contains" "(%a=*%v*))"
END
#
#
#
Services
""
"Search For:"
"(&(objectClass=service)"
"xax500"
multilineDescription
"Description"
subtree
"Common Name" cn 11111 "" ""
"Description" multilineDescription 11101 "" ""
"Owner" "owner" 00001 "owner" "Owner"
"Keywords" "keywords" 11111 "" ""
"Hours" "hoursOfOperation" 11111 "" ""
END
"exactly matches" "(%a=%v))"
"approximately matches" "(%a~=%v))"
"starts with" "(%a=%v*))"
"ends with" "(%a=*%v))"
"contains" "(%a=*%v*))"
END
#
#
#
Organizations
""
"Search For:"
"(&(objectClass=organization)"
"xax500"
multilineDescription
"Description"
subtree
"Name" organizationName 01111 "" ""
"Location" localityName 11111 "" ""
"Phone Number" "telephoneNumber" 10111 "" ""
"Description" description 10111 "" ""
END
"exactly matches" "(%a=%v))"
"approximately matches" "(%a~=%v))"
"starts with" "(%a=%v*))"
"ends with" "(%a=*%v))"
"contains" "(%a=*%v*))"
END
#
#
#
Documents
""
"Search For:"
"(&(objectClass=document)"
"xax500"
multilineDescription
"Description"
subtree
"Document Title" cn 11111 "" ""
"Keyword" "keywords" 11111 "" ""
"Category" "category" 11111 "" ""
"Document Number" "documentIdentifier" 11111 "" ""
END
"exactly matches" "(%a=%v))"
"approximately matches" "(%a~=%v))"
"starts with" "(%a=%v*))"
"ends with" "(%a=*%v))"
"contains" "(%a=*%v*))"
END

View File

@@ -0,0 +1,677 @@
##########################################################################
# LDAP display templates
##########################################################################
#
# Version must be 1
#
Version 1
##########################################################################
# U-M Person template
##########################################################################
#
# template name and plural name come first
"U-M Person"
"U-M People"
# name of the icon that is associated with this template
"person icon"
# blank-separated list of template options ("" for none)
# addable - end-user should be allowed to add these types of entries
# modrdn - end-user can change the name of these entries
# altview - this template is referred to in another template's
# "linkact" item
"addable"
#
# objectclass list
umichPerson person
END
#
# name of attribute to authenticate as ("" means auth as this entry)
""
#
# default attribute name to use when forming RDN of a new entry
#
cn
#
# default location when adding new entries (DN; "" means no default)
"o=University of Michigan, c=US"
#
# rules used to define default values for new entries
END
#
#
# list of items for display
# each line is either:
# item (type) (attribute) (attr name) (extra args...)
# to define an item or
# samerow
# to keep the next item on the same row as the previous
#
# valid types are:
# cis - case ignore string
# mls - multiline string
# dn -
# mail - case ignore string that contains an RFC822 mail address
# bool - boolean value
# jpeg - inlined JPEG image
# jpegbtn - JPEG image button
# fax - inlined Fax image
# faxbtn - Fax image button
# audiobtn - audio button
# time - time value
# date - time value displayed as a date only
# url - labeled URL for links to items in WWW
# searchact - search action
# linkact - link to another template
#
# valid options (comma separated list appended to the type) are:
# ro - attribute is read only; don't let user edit it
# sort - order the values of this attribute
# 1val - disallow entry of multiple values
# required - this attribute should have at least one value
# hide - don't show this item if attribute has no values
# hideiffalse - hide item if value is FALSE (for type 'bool' only)
#
item jpegbtn "View Photo" jpegPhoto "Next Photo"
item audiobtn "Play Sound" audio
item cis,ro,sort "Also Known As" cn
item mail "E-Mail Address" mail
item cis "Work Phone" telephoneNumber
item cis "Fax Number" facsimileTelephoneNumber
item cis "Pager Number" pager
item mls "Work Address" postalAddress
item cis,sort "Title" title
item cis,ro "Uniqname" uid
item mls "Description" multiLineDescription
item cis "Home Phone" homePhone
item mls "Home Address" homePostalAddress
item url "More Info (URL)" labeledURL
item dn,sort "See Also" seeAlso
item cis "Favorite Beverage" drink
item cis "Notice" notice
item bool,hideiffalse "On Vacation" onVacation
item mls,1val "Vacation Message" vacationMessage
item bool,hideiffalse "Do Not Allow Updates" noBatchUpdates
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
item searchact "Find Groups Added To" "" "-dnt" "(&(objectclass=rfc822mailgroup)(member=%v))" "multiLineDescription" "Description" ""
item searchact "List Owned Groups" "" "-dnt" "(&(objectclass=rfc822mailgroup)(owner=%v))" "title" "Title" ""
item linkact "Other Addresses" "" "other addresses"
END
##########################################################################
# Person template
##########################################################################
"Person"
"People"
"person icon"
# template options
addable
#
# objectclass list
person
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
#
cn
# default location when adding new entries
""
#
# rules used to define default values for new entries
END
#
# list of items for display
item jpegbtn "View Photo" jpegPhoto "Next Photo"
item audiobtn "Play Sound" audio
item cis,sort "Also Known As" cn
item cis,sort "Title" title
item mls "Work Address" postalAddress
item cis "Work Phone" telephoneNumber
item cis "Fax Number" facsimileTelephoneNumber
item cis "Pager Number" pager
item mls "Home Address" homePostalAddress
item cis "Home Phone" homePhone
item cis "User ID" uid
item mail "E-Mail Address" mail
item cis "Description" description
item cis "Favorite Beverage" drink
item dn,sort "See Also" seeAlso
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
END
##########################################################################
# Group template
##########################################################################
"Group"
"Groups"
"group icon"
# template options
addable modrdn
# objectclass list
rfc822MailGroup
END
# name of attribute to authenticate as
"owner"
# default attribute name to use when forming RDN of a new entry
#
cn
# default location when adding new entries
"ou=User Groups, ou=Groups, o=University of Michigan, c=US"
#
# rules used to define default values for new entries
constant "associatedDomain" "umich.edu"
constant "joinable" "FALSE"
addersdn "owner"
addersdn "member"
addersdn "errorsTo"
addersdn "requestsTo"
END
#
#
# list of items for display
# each line is either:
# item (type) (attribute) (attr name) (extra args...)
# to define an item or
# samerow
#
# list of items for display
item cis,sort "Also Known As" cn
item mls "Description" multiLineDescription
item cis "Phone Number" telephoneNumber
item cis "Fax Number" facsimileTelephoneNumber
item mls "Address" postalAddress
item dn,required,sort "Owner" owner
item url "More Info (URL)" labeledURL
item dn,sort "See Also" seeAlso
item dn,sort "Errors To" errorsTo
item dn,sort "Requests To" requestsTo
item cis "Associated Domain" associatedDomain
item cis "Moderator" moderator
item bool "Suppress 'No E-Mail Address' Errors" suppressNoEmailError
item bool "Others May Join" joinable
item dn,sort "X.500 Members" member
item mail,sort "E-Mail Errors To" rfc822ErrorsTo
item mail,sort "E-Mail Requests To" rfc822RequestsTo
item mail,sort "E-Mail Members" mail
item cis "Notice" notice
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
item searchact "Subscribers" "" "-dnt" "memberOfGroup=%v" "title" "Title" "joinable"
item verifyact "Verify Members" "member" "mail" "E-Mail Address"
END
##########################################################################
# Organization template
##########################################################################
"Organization"
"Organizations"
"organization icon"
# template options
""
# objectclass list
organization
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
o
# default location when adding new entries
""
# rules used to define default values for new entries
constant "o" "foo"
END
#
#
# list of items for display
# each line is either:
# item (type) (attribute) (attr name) (extra args...)
# to define an item or
# samerow
#
# list of items for display
item cis,sort "Name" o
item cis "Location" l
item mls "Address" postalAddress
item cis "Phone Number" telephoneNumber
item cis "Fax Number" facsimileTelephoneNumber
item cis "Description" description
item dn,sort "See Also" seeAlso
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
END
##########################################################################
# Service template
##########################################################################
"Service"
"Services"
"service icon"
# template options
"addable"
# objectclass list
service
END
# name of attribute to authenticate as
"owner"
# default attribute name to use when forming RDN of a new entry
cn
# default location when adding new entries
"ou=Services, o=University of Michigan, c=US"
# rules used to define default values for new entries
addersdn "owner"
END
#
#
# list of items for display
# each line is either:
# item (type) (attribute) (attr name) (extra args...)
# to define an item or
# samerow
#
# list of items for display
item jpegbtn "View Photo" jpegPhoto
item cis,sort "Name" cn
item mls "Description" multilineDescription
item cis "Provider" provider
item cis,sort "Service Area" serviceArea
item mail "E-mail Address" mail
item cis "Phone" telephoneNumber
item cis "Fax Number" facsimileTelephoneNumber
item mls "Postal Address" postalAddress
item cis "Hours" hoursOfOperation
item url "More Info (URL)" labeledURL
item dn,sort "Depends On" dependentUpon
item dn,sort "See Also" seeAlso
item cis,sort "Platform" platform
item cis,sort "Product" product
item cis,sort "Keywords" keywords
item cis "FCE Rating" serviceRating
item date "Date Rated" ratingTime
item mls "Rating Description" ratingDescription
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
item dn,required,sort "Owner" owner
END
##########################################################################
# Organizational Role template
##########################################################################
"Organizational Role"
"Organizational Roles"
"person icon"
# template options
""
# objectclass list
organizationalRole
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
cn
# default location when adding new entries
""
# rules used to define default values for new entries
END
#
#
# list of items for display
# each line is either:
# item (type) (attribute) (attr name) (extra args...)
# to define an item or
# samerow
#
# list of items for display
item cis,sort "Name" cn
item cis "Description" description
item dn "Role Occupant" roleOccupant
item dn,sort "See Also" seeAlso
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
END
##########################################################################
# Organizational Unit template
##########################################################################
"Organizational Unit"
"Organizational Units"
"organization icon"
# template options
""
# objectclass list
organizationalUnit
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
cn
# default location when adding new entries
""
# rules used to define default values for new entries
END
# Item list
item cis "Organization Unit Name" ou
item cis "Title" title
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
END
##########################################################################
# Application Entity template
##########################################################################
"Application Entity"
"Application Entities"
"application icon"
# template options
""
# objectclass list
applicationEntity
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
cn
# default location when adding new entries
""
# rules used to define default values for new entries
END
# Item list
item cis,sort "Name" cn
item cis "Location" l
item cis "Description" description
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
END
##########################################################################
# Document template
##########################################################################
"Document"
"Documents"
"document icon"
# template options
""
# objectclass list
document
umichDocument
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
cn
# default location when adding new entries
""
# rules used to define default values for new entries
END
#
# Item list
item cis "Document ID" documentIdentifier
item cis "Title" documentTitle
item cis "Series Title" documentSeriesTitle
item cis "Version" documentVersion
item cis,sort "Service Area" serviceArea
item mls "Abstract" multiLineAbstract
item url "More Info (URL)" labeledURL
item dn,sort "Availability" documentAvailable
item dn,sort "See Also" seeAlso
item cis,sort "Platform" platform
item cis,sort "Product" product
item cis,sort "Keyword" keywords
item dn,sort "Author" documentAuthor
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
item dn,required "Owner" owner
END
##########################################################################
# Document description template
##########################################################################
"DocumentDescription"
"DocumentDescriptions"
"document description icon"
# template options
""
# objectclass list
documentDescription
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
cn
# default location when adding new entries
""
# rules used to define default values for new entries
END
#
# Item list
item mls "Description" multilineDescription
item url "More Info (URL)" labeledURL
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
item dn,required "Owner" owner
END
##########################################################################
# Image template
##########################################################################
"Image"
"Images"
"image icon"
# template options
""
# objectclass list
image
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
cn
# default location when adding new entries
""
# rules used to define default values for new entries
END
#
# Item list
item cis "Name" cn
item mls "Description" multilineDescription
item jpegbtn "View Photo(s)" jpegPhoto
item cis "Citation" citation
item cis "Copyright" copyright
item cis "Keywords" keywords
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
item dn,required "Owner" owner
END
##########################################################################
# Country template
##########################################################################
"Country"
"Countries"
"country icon"
# template options
""
# objectclass list
friendlyCountry
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
c
# default location when adding new entries
""
# rules used to define default values for new entries
END
# Item list
item cis "Country Name" co
item cis "Country Code" c
item cis "Description" description
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
END
##########################################################################
# Locality template
##########################################################################
"Locality"
"Localities"
"locality icon"
# template options
""
# objectclass list
locality
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
l
# default location when adding new entries
""
# rules used to define default values for new entries
END
#
# Item list
item cis "Name" l
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
END
##########################################################################
# "Other Addresses" template
##########################################################################
"Others Addresses"
"Other Addresses"
"other addr icon"
# template options
"altview"
# objectclass list
END
# name of attribute to authenticate as
""
# default attribute name to use when forming RDN of a new entry
""
# default location when adding new entries
""
# rules used to define default values for new entries
END
# Item list
item cis "Street Address" streetAddress
item cis "Locality" l
item cis "State or Province" st
item cis "Postal Code" postalCode
item cis,hide "X.400 Address" mhsORAddresses
item cis,hide "X.400 Address" textEncodedORAddress
Item cis "Other Mailbox" otherMailbox
item time,ro "Last Modified" lastModifiedTime
item dn,ro "Modified By" lastModifiedBy
END

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,86 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "ldap-int.h"
int
LDAP_CALL
ldap_msgid( LDAPMessage *lm )
{
if ( !NSLDAPI_VALID_LDAPMESSAGE_POINTER( lm )) {
return( -1 );
}
return( lm->lm_msgid );
}
int
LDAP_CALL
ldap_msgtype( LDAPMessage *lm )
{
if ( !NSLDAPI_VALID_LDAPMESSAGE_POINTER( lm )) {
return( -1 );
}
return( lm->lm_msgtype );
}
LDAPMessage *
LDAP_CALL
ldap_first_message( LDAP *ld, LDAPMessage *chain )
{
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( NULLMSG ); /* punt */
}
return( chain );
}
LDAPMessage *
LDAP_CALL
ldap_next_message( LDAP *ld, LDAPMessage *msg )
{
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( NULLMSG ); /* punt */
}
if ( msg == NULLMSG || msg->lm_chain == NULLMSG ) {
return( NULLMSG );
}
return( msg->lm_chain );
}
int
LDAP_CALL
ldap_count_messages( LDAP *ld, LDAPMessage *chain )
{
int i;
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( -1 );
}
for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
i++;
}
return( i );
}

View File

@@ -0,0 +1,202 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* modify.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
/*
* ldap_modify - initiate an ldap (and X.500) modify operation. Parameters:
*
* ld LDAP descriptor
* dn DN of the object to modify
* mods List of modifications to make. This is null-terminated
* array of struct ldapmod's, specifying the modifications
* to perform.
*
* Example:
* LDAPMod *mods[] = {
* { LDAP_MOD_ADD, "cn", { "babs jensen", "babs", 0 } },
* { LDAP_MOD_REPLACE, "sn", { "jensen", 0 } },
* 0
* }
* msgid = ldap_modify( ld, dn, mods );
*/
int
LDAP_CALL
ldap_modify( LDAP *ld, const char *dn, LDAPMod **mods )
{
int msgid;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_modify\n", 0, 0, 0 );
if ( ldap_modify_ext( ld, dn, mods, NULL, NULL, &msgid )
== LDAP_SUCCESS ) {
return( msgid );
} else {
return( -1 ); /* error is in ld handle */
}
}
int
LDAP_CALL
ldap_modify_ext( LDAP *ld, const char *dn, LDAPMod **mods,
LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp )
{
BerElement *ber;
int i, rc, lderr;
/*
* A modify request looks like this:
* ModifyRequet ::= SEQUENCE {
* object DistinguishedName,
* modifications SEQUENCE OF SEQUENCE {
* operation ENUMERATED {
* add (0),
* delete (1),
* replace (2)
* },
* modification SEQUENCE {
* type AttributeType,
* values SET OF AttributeValue
* }
* }
* }
*/
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_modify_ext\n", 0, 0, 0 );
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
if ( !NSLDAPI_VALID_NONEMPTY_LDAPMOD_ARRAY( mods )) {
lderr = LDAP_PARAM_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
return( lderr );
}
if ( dn == NULL ) {
dn = "";
}
LDAP_MUTEX_LOCK( ld, LDAP_MSGID_LOCK );
*msgidp = ++ld->ld_msgid;
LDAP_MUTEX_UNLOCK( ld, LDAP_MSGID_LOCK );
/* see if we should add to the cache */
if ( ld->ld_cache_on && ld->ld_cache_modify != NULL ) {
LDAP_MUTEX_LOCK( ld, LDAP_CACHE_LOCK );
if ( (rc = (ld->ld_cache_modify)( ld, *msgidp, LDAP_REQ_MODIFY,
dn, mods )) != 0 ) {
*msgidp = rc;
LDAP_MUTEX_LOCK( ld, LDAP_CACHE_LOCK );
return( LDAP_SUCCESS );
}
LDAP_MUTEX_UNLOCK( ld, LDAP_CACHE_LOCK );
}
/* create a message to send */
if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber ))
!= LDAP_SUCCESS ) {
return( lderr );
}
if ( ber_printf( ber, "{it{s{", *msgidp, LDAP_REQ_MODIFY, dn )
== -1 ) {
lderr = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
ber_free( ber, 1 );
return( lderr );
}
/* for each modification to be performed... */
for ( i = 0; mods[i] != NULL; i++ ) {
if (( mods[i]->mod_op & LDAP_MOD_BVALUES) != 0 ) {
rc = ber_printf( ber, "{e{s[V]}}",
mods[i]->mod_op & ~LDAP_MOD_BVALUES,
mods[i]->mod_type, mods[i]->mod_bvalues );
} else {
rc = ber_printf( ber, "{e{s[v]}}", mods[i]->mod_op,
mods[i]->mod_type, mods[i]->mod_values );
}
if ( rc == -1 ) {
lderr = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
ber_free( ber, 1 );
return( lderr );
}
}
if ( ber_printf( ber, "}}" ) == -1 ) {
lderr = LDAP_ENCODING_ERROR;
LDAP_SET_LDERRNO( ld, lderr, NULL, NULL );
ber_free( ber, 1 );
return( lderr );
}
if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber ))
!= LDAP_SUCCESS ) {
ber_free( ber, 1 );
return( lderr );
}
/* send the message */
rc = nsldapi_send_initial_request( ld, *msgidp, LDAP_REQ_MODIFY,
(char *)dn, ber );
*msgidp = rc;
return( rc < 0 ? LDAP_GET_LDERRNO( ld, NULL, NULL ) : LDAP_SUCCESS );
}
int
LDAP_CALL
ldap_modify_s( LDAP *ld, const char *dn, LDAPMod **mods )
{
return( ldap_modify_ext_s( ld, dn, mods, NULL, NULL ));
}
int
LDAP_CALL
ldap_modify_ext_s( LDAP *ld, const char *dn, LDAPMod **mods,
LDAPControl **serverctrls, LDAPControl **clientctrls )
{
int msgid, err;
LDAPMessage *res;
if (( err = ldap_modify_ext( ld, dn, mods, serverctrls, clientctrls,
&msgid )) != LDAP_SUCCESS ) {
return( err );
}
if ( ldap_result( ld, msgid, 1, (struct timeval *)NULL, &res ) == -1 ) {
return( LDAP_GET_LDERRNO( ld, NULL, NULL ) );
}
return( ldap_result2error( ld, res, 1 ) );
}

View File

@@ -0,0 +1,690 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <windows.h>
#include <winsock.h>
#include <string.h>
// Purpose of this file is to implement an intermediate layer to our network
// services, the winsock.
// This intermediate layer will be able to function with and without a working
// winsock being present.
// The attempt to activate the winsock happens as would normally be expected,
// through the calling application's entry point to us, WSAStartup.
// Name of the winsock we would like to load.
// Diffs between OSs, Win32s is out in the cold if running 32 bits unless
// they also have a winsock name wsock32.dll.
#ifndef _WIN32
#define SZWINSOCK "winsock.dll"
#else
#define SZWINSOCK "wsock32.dll"
#endif
// Here is the enumeration for the winsock functions we have currently
// overridden (needed to run). Add more when needed.
// We use these to access proc addresses, and to hold a table of strings
// to obtain the proc addresses.
enum SockProc {
sp_WSAAsyncGetHostByName = 0,
sp_WSAAsyncSelect,
sp_WSACleanup,
sp_WSAGetLastError,
sp_WSASetLastError,
sp_WSAStartup,
sp___WSAFDIsSet,
sp_accept,
sp_bind,
sp_closesocket,
sp_connect,
sp_gethostbyname,
sp_gethostbyaddr,
sp_gethostname,
sp_getpeername,
sp_getsockname,
sp_getsockopt,
sp_getprotobyname,
sp_htonl,
sp_htons,
sp_inet_addr,
sp_ioctlsocket,
sp_listen,
sp_ntohl,
sp_ntohs,
sp_recv,
sp_select,
sp_send,
sp_setsockopt,
sp_shutdown,
sp_socket,
sp_inet_ntoa,
sp_MaxProcs // Total count.
};
// Array of function names used in GetProcAddress to fill in our
// proc array when needed.
// This array must match the enumerations exactly.
char *spName[(int)sp_MaxProcs] = {
"WSAAsyncGetHostByName",
"WSAAsyncSelect",
"WSACleanup",
"WSAGetLastError",
"WSASetLastError",
"WSAStartup",
"__WSAFDIsSet",
"accept",
"bind",
"closesocket",
"connect",
"gethostbyname",
"gethostbyaddr",
"gethostname",
"getpeername",
"getsockname",
"getsockopt",
"getprotobyname",
"htonl",
"htons",
"inet_addr",
"ioctlsocket",
"listen",
"ntohl",
"ntohs",
"recv",
"select",
"send",
"setsockopt",
"shutdown",
"socket",
"inet_ntoa"
};
// Array of proc addresses to the winsock functions.
// These can be NULL, indicating their absence (as in the case we couldn't
// load the winsock.dll or one of the functions wasn't loaded).
// The procs assigned in must corellate with the enumerations exactly.
FARPROC spArray[(int)sp_MaxProcs];
// Typedef all the different types of functions that we must cast the
// procs to in order to call without the compiler barfing.
// Prefix is always sp.
// Retval is next, spelled out.
// Parameters in their order are next, spelled out.
typedef int (PASCAL FAR *sp_int_WORD_LPWSADATA)(WORD, LPWSADATA);
typedef int (PASCAL FAR *sp_int_void)(void);
typedef HANDLE (PASCAL FAR *sp_HANDLE_HWND_uint_ccharFARp_charFARp_int)(HWND, unsigned int, const char FAR *, char FAR *, int);
typedef int (PASCAL FAR *sp_int_SOCKET_HWND_uint_long)(SOCKET, HWND, unsigned int, long);
typedef void (PASCAL FAR *sp_void_int)(int);
typedef int (PASCAL FAR *sp_int_SOCKET_fdsetFARp)(SOCKET, fd_set FAR *);
typedef SOCKET(PASCAL FAR *sp_SOCKET_SOCKET_sockaddrFARp_intFARp)(SOCKET, struct sockaddr FAR *, int FAR *);
typedef int (PASCAL FAR *sp_int_SOCKET_csockaddrFARp_int)(SOCKET, const struct sockaddr FAR *, int);
typedef int (PASCAL FAR *sp_int_SOCKET)(SOCKET);
typedef struct hostent FAR *(PASCAL FAR *sp_hostentFARp_ccharFARp)(const char FAR *);
typedef struct hostent FAR *(PASCAL FAR *sp_hostentFARp_ccharFARp_int_int)(const char FAR *, int, int);
typedef int (PASCAL FAR *sp_int_charFARp_int)(char FAR *, int);
typedef int (PASCAL FAR *sp_int_SOCKET_sockaddrFARp_intFARp)(SOCKET, struct sockaddr FAR *, int FAR *);
typedef int (PASCAL FAR *sp_int_SOCKET_int_int_charFARp_intFARp)(SOCKET, int, int, char FAR *, int FAR *);
typedef u_long (PASCAL FAR *sp_ulong_ulong)(u_long);
typedef u_short (PASCAL FAR *sp_ushort_ushort)(u_short);
typedef unsigned long (PASCAL FAR *sp_ulong_ccharFARp)(const char FAR *);
typedef int (PASCAL FAR *sp_int_SOCKET_long_ulongFARp)(SOCKET, long, u_long FAR *);
typedef int (PASCAL FAR *sp_int_SOCKET_int)(SOCKET, int);
typedef int (PASCAL FAR *sp_int_SOCKET_charFARp_int_int)(SOCKET, char FAR *, int, int);
typedef int (PASCAL FAR *sp_int_int_fdsetFARp_fdsetFARp_fdsetFARp_ctimevalFARp)(int,fd_set FAR *,fd_set FAR *,fd_set FAR *,const struct timeval FAR*);
typedef int (PASCAL FAR *sp_int_SOCKET_ccharFARp_int_int)(SOCKET, const char FAR *, int, int);
typedef int (PASCAL FAR *sp_int_SOCKET_int_int_ccharFARp_int)(SOCKET, int, int, const char FAR *, int);
typedef SOCKET (PASCAL FAR *sp_SOCKET_int_int_int)(int, int, int);
typedef char FAR * (PASCAL FAR *sp_charFARp_in_addr)(struct in_addr in);
typedef struct protoent FAR * (PASCAL FAR *sp_protoentFARcchar)(const char FAR *);
// Handle to the winsock, if loaded.
HINSTANCE hWinsock = NULL;
#ifndef _WIN32
// Last error code for the winsock.
int ispError = 0;
#endif
BOOL IsWinsockLoaded (int sp)
{
if (hWinsock == NULL)
{
WSADATA wsaData;
#ifdef _WIN32
static LONG sc_init = 0;
static DWORD sc_done = 0;
static CRITICAL_SECTION sc;
#endif
/* We need to wait here because another thread might be
in the routine already */
#ifdef _WIN32
if (0 == InterlockedExchange(&sc_init,1)) {
InitializeCriticalSection(&sc);
sc_done = 1;
}
while (0 == sc_done) Sleep(0);
EnterCriticalSection(&sc);
if (hWinsock == NULL) {
#endif
WSAStartup(0x0101, &wsaData);
#ifdef _WIN32
}
LeaveCriticalSection(&sc);
#endif
}
// Quick macro to tell if the winsock has actually loaded for a particular
// function.
// Debug version is a little more strict to make sure you get the names right.
#ifdef DEBUG
return hWinsock != NULL && spArray[(int)(sp)] != NULL;
#else // A little faster
return hWinsock != NULL;
#endif
}
// Here are the functions that we have taken over by not directly linking
// with the winsock import library or importing through the def file.
/* In win16 we simulate blocking commands as follows. Prior to issuing the
* command we make the socket not-blocking (WSAAsyncSelect does that).
* We then issue the command and see if it would have blocked. If so, we
* yield the processor and go to sleep until an event occurs that unblocks
* us (WSAAsyncSelect allowed us to register what that condition is). We
* keep repeating until we do not get a would-block indication when issuing
* the command. At that time we unregister the notification condition and
* return the result of the command to the caller.
*/
//#ifndef _WIN32
#if 0
#define NON_BLOCKING(command,condition,index,type) \
type iret; \
HWND hWndFrame = AfxGetApp()->m_pMainWnd->m_hWnd; \
while (TRUE) { \
if (WSAAsyncSelect(s, hWndFrame, msg_NetActivity, condition) \
== SOCKET_ERROR) { \
break; \
} \
if(IsWinsockLoaded(index)) { \
iret=command; \
if (!(iret==SOCKET_ERROR && WSAGetLastError()==WSAEWOULDBLOCK)) { \
WSAAsyncSelect(s, hWndFrame, msg_NetActivity, 0); \
return iret; \
} \
PR_Yield(); \
} else { \
break; \
} \
}
#else
#define NON_BLOCKING(command,condition,index,type) \
if(IsWinsockLoaded(index)) { \
return command; \
}
#endif
int PASCAL FAR WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData) {
// Our default return value is failure, though we change this regardless.
int iRetval = WSAVERNOTSUPPORTED;
HINSTANCE MyHandle;
// Before doing anything, clear out our proc array.
memset(spArray, 0, sizeof(spArray));
// attempt to load the real winsock.
MyHandle = LoadLibrary(SZWINSOCK);
#ifdef _WIN32
if(MyHandle != NULL) {
#else
if(MyHandle > HINSTANCE_ERROR) {
#endif
// Winsock was loaded.
// Get the proc addresses for each needed function next.
int spTraverse;
for(spTraverse = 0; spTraverse < (int)sp_MaxProcs; spTraverse++) {
spArray[spTraverse] = GetProcAddress(MyHandle, spName[spTraverse]);
if ( NULL == spArray[spTraverse] )
return iRetval;// Bad winsock? Bad function name?
}
hWinsock = MyHandle;
// AllRight, attempt to make our first proxied call.
if(IsWinsockLoaded(sp_WSAStartup)) {
iRetval = ((sp_int_WORD_LPWSADATA)spArray[sp_WSAStartup])(wVersionRequested, lpWSAData);
}
// If the return value is still an error at this point, we unload the DLL,
// so that we can act as though nothing happened and the user
// gets no network access.
if(iRetval != 0) {
// Clear out our proc array.
memset(spArray, 0, sizeof(spArray));
// Free up the winsock.
FreeLibrary(MyHandle);
MyHandle = NULL;
}
}
#ifndef _WIN32
else {
// Failed to load.
// Set this to NULL so it is clear.
hWinsock = NULL;
}
#endif
// Check our return value, if it isn't success, then we need to fake
// our own winsock implementation.
if(iRetval != 0) {
// We always return success.
iRetval = 0;
// Fill in the structure.
// Return the version requested as the version supported.
lpWSAData->wVersion = wVersionRequested;
lpWSAData->wHighVersion = wVersionRequested;
// Fill in a discription.
strcpy(lpWSAData->szDescription, "Mozock DLL internal implementation.");
strcpy(lpWSAData->szSystemStatus, "Winsock running, allowing no network access.");
// Report a nice round number for sockets and datagram sizes.
lpWSAData->iMaxSockets = 4096;
lpWSAData->iMaxUdpDg = 4096;
// No vendor information.
lpWSAData->lpVendorInfo = NULL;
}
return(iRetval);
}
int PASCAL FAR WSACleanup(void) {
int iRetval = 0;
// Handling normally or internally.
// When IsWinsockLoaded() is called and hWinsock is NULL, it winds up calling WSAStartup
// which wedges rpcrt4.dll on win95 with some winsock implementations. Bug: 81359.
if(hWinsock && IsWinsockLoaded(sp_WSACleanup)) {
// Call their cleanup routine.
// We could set the return value here, but it is meaning less.
// We always return success.
iRetval = ((sp_int_void)spArray[sp_WSACleanup])();
//ASSERT(iRetval == 0);
iRetval = 0;
}
// Wether or not it succeeded, we free off the library here.
// Clear out our proc table too.
memset(spArray, 0, sizeof(spArray));
if(hWinsock != NULL) {
FreeLibrary(hWinsock);
hWinsock = NULL;
}
return(iRetval);
}
HANDLE PASCAL FAR WSAAsyncGetHostByName(HWND hWnd, unsigned int wMsg, const char FAR *name, char FAR *buf, int buflen) {
// Normal or shim.
if(IsWinsockLoaded(sp_WSAAsyncGetHostByName)) {
return(((sp_HANDLE_HWND_uint_ccharFARp_charFARp_int)spArray[sp_WSAAsyncGetHostByName])(hWnd, wMsg, name, buf, buflen));
}
// Must return error here.
// Set our last error value to be that the net is down.
WSASetLastError(WSAENETDOWN);
return(NULL);
}
int PASCAL FAR WSAAsyncSelect(SOCKET s, HWND hWnd, unsigned int wMsg, long lEvent) {
// Normal or shim.
if(IsWinsockLoaded(sp_WSAAsyncSelect)) {
return(((sp_int_SOCKET_HWND_uint_long)spArray[sp_WSAAsyncSelect])(s, hWnd, wMsg, lEvent));
}
// Must return error here.
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR WSAGetLastError(void) {
// See if someone else can handle.
if(IsWinsockLoaded(sp_WSAGetLastError)) {
return(((sp_int_void)spArray[sp_WSAGetLastError])());
}
#ifndef _WIN32
{
// Fake it.
int iRetval = ispError;
ispError = 0;
return(iRetval);
}
#else
// Use default OS handler.
return(GetLastError());
#endif
}
void PASCAL FAR WSASetLastError(int iError) {
// See if someone else can handle.
if(IsWinsockLoaded(sp_WSASetLastError)) {
((sp_void_int)spArray[sp_WSASetLastError])(iError);
return;
}
#ifndef _WIN32
// Fake it.
ispError = iError;
return;
#else
// Use default OS handler.
SetLastError(iError);
return;
#endif
}
int PASCAL FAR __WSAFDIsSet(SOCKET fd, fd_set FAR *set) {
int i;
// See if someone else will handle.
if(IsWinsockLoaded(sp___WSAFDIsSet)) {
return(((sp_int_SOCKET_fdsetFARp)spArray[sp___WSAFDIsSet])(fd, set));
}
// Default implementation.
i = set->fd_count;
while (i--) {
if (set->fd_array[i] == fd) {
return 1;
}
}
return 0;
}
SOCKET PASCAL FAR accept(SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen) {
// Internally or shim
NON_BLOCKING(
(((sp_SOCKET_SOCKET_sockaddrFARp_intFARp)spArray[sp_accept])(s, addr, addrlen)),
FD_ACCEPT, sp_accept, SOCKET);
// Fail.
WSASetLastError(WSAENETDOWN);
return(INVALID_SOCKET);
}
int PASCAL FAR bind(SOCKET s, const struct sockaddr FAR *name, int namelen) {
// Internally or shim
if(IsWinsockLoaded(sp_bind)) {
return(((sp_int_SOCKET_csockaddrFARp_int)spArray[sp_bind])(s, name, namelen));
}
// Fail.
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR closesocket(SOCKET s) {
// Internally or shim.
NON_BLOCKING(
(((sp_int_SOCKET)spArray[sp_closesocket])(s)),
FD_CLOSE, sp_closesocket, int);
// Error.
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR connect(SOCKET s, const struct sockaddr FAR *name, int namelen) {
// Internally or shim.
if(IsWinsockLoaded(sp_connect)) {
/* This could block and so it would seem that the NON_BLOCK
* macro should be used here. However it was causing a crash
* and so it was decided to allow blocking here instead
*/
return (((sp_int_SOCKET_csockaddrFARp_int)spArray[sp_connect])(s, name, namelen));
}
// Err.
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
struct hostent FAR * PASCAL FAR gethostbyname(const char FAR *name) {
if(IsWinsockLoaded(sp_gethostbyname)) {
return(((sp_hostentFARp_ccharFARp)spArray[sp_gethostbyname])(name));
}
WSASetLastError(WSAENETDOWN);
return(NULL);
}
struct hostent FAR * PASCAL FAR gethostbyaddr(const char FAR *addr, int len, int type) {
if(IsWinsockLoaded(sp_gethostbyaddr)) {
return(((sp_hostentFARp_ccharFARp_int_int)spArray[sp_gethostbyaddr])(addr, len, type));
}
WSASetLastError(WSAENETDOWN);
return(NULL);
}
int PASCAL FAR gethostname(char FAR *name, int namelen) {
if(IsWinsockLoaded(sp_gethostname)) {
return(((sp_int_charFARp_int)spArray[sp_gethostname])(name, namelen));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR getpeername(SOCKET s, struct sockaddr FAR *name, int FAR *namelen) {
if(IsWinsockLoaded(sp_getpeername)) {
return(((sp_int_SOCKET_sockaddrFARp_intFARp)spArray[sp_getpeername])(s, name, namelen));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR getsockname(SOCKET s, struct sockaddr FAR *name, int FAR *namelen) {
if(IsWinsockLoaded(sp_getsockname)) {
return(((sp_int_SOCKET_sockaddrFARp_intFARp)spArray[sp_getsockname])(s, name, namelen));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR getsockopt(SOCKET s, int level, int optname, char FAR *optval, int FAR *optlen) {
if(IsWinsockLoaded(sp_getsockopt)) {
return(((sp_int_SOCKET_int_int_charFARp_intFARp)spArray[sp_getsockopt])(s, level, optname, optval, optlen));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
struct protoent FAR * PASCAL getprotobyname(const char FAR * name) {
if(IsWinsockLoaded(sp_getprotobyname)) {
return(((sp_protoentFARcchar)spArray[sp_getprotobyname])(name));
}
WSASetLastError(WSAENETDOWN);
return NULL;
}
u_long PASCAL FAR htonl(u_long hostlong) {
if(IsWinsockLoaded(sp_htonl)) {
return(((sp_ulong_ulong)spArray[sp_htonl])(hostlong));
}
#ifndef _WIN32
return
(((hostlong&0xff)<<24) + ((hostlong&0xff00)<<8) +
((hostlong&0xff0000)>>8) + ((hostlong&0xff000000)>>24));
#else
// Just return what was passed in.
return(hostlong);
#endif
}
u_short PASCAL FAR htons(u_short hostshort) {
if(IsWinsockLoaded(sp_htons)) {
return(((sp_ushort_ushort)spArray[sp_htons])(hostshort));
}
#ifndef _WIN32
return (((hostshort&0xff)<<8) + ((hostshort&0xff00)>>8));
#else
// Just return what was passed in.
return(hostshort);
#endif
}
u_long PASCAL FAR ntohl(u_long hostlong) {
if(IsWinsockLoaded(sp_ntohl)) {
return(((sp_ulong_ulong)spArray[sp_ntohl])(hostlong));
}
#ifndef _WIN32
return
(((hostlong&0xff)<<24) + ((hostlong&0xff00)<<8) +
((hostlong&0xff0000)>>8) + ((hostlong&0xff000000)>>24));
#else
// Just return what was passed in.
return(hostlong);
#endif
}
u_short PASCAL FAR ntohs(u_short hostshort) {
if(IsWinsockLoaded(sp_ntohs)) {
return(((sp_ushort_ushort)spArray[sp_ntohs])(hostshort));
}
#ifndef _WIN32
return (((hostshort&0xff)<<8) + ((hostshort&0xff00)>>8));
#else
// Just return what was passed in.
return(hostshort);
#endif
}
unsigned long PASCAL FAR inet_addr(const char FAR *cp) {
if(IsWinsockLoaded(sp_inet_addr)) {
return(((sp_ulong_ccharFARp)spArray[sp_inet_addr])(cp));
}
return(INADDR_NONE);
}
int PASCAL FAR ioctlsocket(SOCKET s, long cmd, u_long FAR *argp) {
if(IsWinsockLoaded(sp_ioctlsocket)) {
return(((sp_int_SOCKET_long_ulongFARp)spArray[sp_ioctlsocket])(s, cmd, argp));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR listen(SOCKET s, int backlog) {
if(IsWinsockLoaded(sp_listen)) {
return(((sp_int_SOCKET_int)spArray[sp_listen])(s, backlog));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR recv(SOCKET s, char FAR *buf, int len, int flags) {
NON_BLOCKING(
(((sp_int_SOCKET_charFARp_int_int)spArray[sp_recv])(s, buf, len, flags)),
FD_READ, sp_recv, int);
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR select(int nfds, fd_set FAR *readfds, fd_set FAR *writefds, fd_set FAR *exceptfds, const struct timeval FAR *timeout) {
// If there's nothing to do, stop now before we go off into dll land.
// Optimization, boyz.
if((readfds && readfds->fd_count) || (writefds && writefds->fd_count) || (exceptfds && exceptfds->fd_count)) {
if(IsWinsockLoaded(sp_select)) {
return(((sp_int_int_fdsetFARp_fdsetFARp_fdsetFARp_ctimevalFARp)spArray[sp_select])(nfds,readfds,writefds,exceptfds,timeout));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
// No need to go to the DLL, there is nothing to do.
return(0);
}
int PASCAL FAR send(SOCKET s, const char FAR *buf, int len, int flags) {
NON_BLOCKING(
(((sp_int_SOCKET_ccharFARp_int_int)spArray[sp_send])(s, buf, len, flags)),
FD_WRITE, sp_send, int);
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR setsockopt(SOCKET s, int level, int optname, const char FAR *optval, int optlen) {
if(IsWinsockLoaded(sp_setsockopt)) {
return(((sp_int_SOCKET_int_int_ccharFARp_int)spArray[sp_setsockopt])(s, level, optname, optval, optlen));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
int PASCAL FAR shutdown(SOCKET s, int how) {
if(IsWinsockLoaded(sp_shutdown)) {
return(((sp_int_SOCKET_int)spArray[sp_shutdown])(s, how));
}
WSASetLastError(WSAENETDOWN);
return(SOCKET_ERROR);
}
SOCKET PASCAL FAR socket(int af, int type, int protocol) {
if(IsWinsockLoaded(sp_socket)) {
return(((sp_SOCKET_int_int_int)spArray[sp_socket])(af, type, protocol));
}
WSASetLastError(WSAENETDOWN);
return(INVALID_SOCKET);
}
char FAR * PASCAL FAR inet_ntoa(struct in_addr in) {
if(IsWinsockLoaded(sp_inet_ntoa)) {
return ((sp_charFARp_in_addr)spArray[sp_inet_ntoa])(in);
}
WSASetLastError(WSAENETDOWN);
return NULL;
}

View File

@@ -0,0 +1,602 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <nspr.h>
#include <stdio.h>
#include <ldap.h>
#define NAME "cn=Directory Manager"
#define PASSWORD "secret99"
#define BASE "o=Airius.com"
static int simplebind( LDAP *ld, char *msg, int tries );
static void search_thread( void * );
static void modify_thread( void * );
static void add_thread( void * );
static void delete_thread( void * );
static void set_ld_error();
static int get_ld_error();
static void set_errno();
static int get_errno();
static void tsd_setup();
static void *my_mutex_alloc( void );
static void my_mutex_free( void * );
static int my_mutex_lock( void * );
static int my_mutex_unlock( void * );
static LDAPHostEnt *my_gethostbyname( const char *name, LDAPHostEnt *result,
char *buffer, int buflen, int *statusp, void *extradata );
static LDAPHostEnt *my_gethostbyaddr( const char *addr, int length,
int type, LDAPHostEnt *result, char *buffer, int buflen,
int *statusp, void *extradata );
static LDAPHostEnt *copyPRHostEnt2LDAPHostEnt( LDAPHostEnt *ldhp,
PRHostEnt *prhp );
typedef struct ldapmsgwrapper {
LDAPMessage *lmw_messagep;
struct ldapmsgwrapper *lmw_next;
} ldapmsgwrapper;
#define CONNECTION_ERROR( lderr ) ( (lderr) == LDAP_SERVER_DOWN || \
(lderr) == LDAP_CONNECT_ERROR )
LDAP *ld;
PRUintn tsdindex;
#ifdef LDAP_MEMCACHE
LDAPMemCache *memcache = NULL;
#define MEMCACHE_SIZE (256*1024) /* 256K bytes */
#define MEMCACHE_TTL (15*60) /* 15 minutes */
#endif
main( int argc, char **argv )
{
PRThread *search_tid, *search_tid2, *search_tid3;
PRThread *search_tid4, *modify_tid, *add_tid;
PRThread *delete_tid;
struct ldap_thread_fns tfns;
struct ldap_dns_fns dnsfns;
int rc;
if ( argc != 3 ) {
fprintf( stderr, "usage: %s host port\n", argv[0] );
exit( 1 );
}
PR_Init( PR_USER_THREAD, PR_PRIORITY_NORMAL, 0 );
if ( PR_NewThreadPrivateIndex( &tsdindex, NULL ) != PR_SUCCESS ) {
perror( "PR_NewThreadPrivateIndex" );
exit( 1 );
}
tsd_setup(); /* for main thread */
if ( (ld = ldap_init( argv[1], atoi( argv[2] ) )) == NULL ) {
perror( "ldap_open" );
exit( 1 );
}
/* set thread function pointers */
memset( &tfns, '\0', sizeof(struct ldap_thread_fns) );
tfns.ltf_mutex_alloc = my_mutex_alloc;
tfns.ltf_mutex_free = my_mutex_free;
tfns.ltf_mutex_lock = my_mutex_lock;
tfns.ltf_mutex_unlock = my_mutex_unlock;
tfns.ltf_get_errno = get_errno;
tfns.ltf_set_errno = set_errno;
tfns.ltf_get_lderrno = get_ld_error;
tfns.ltf_set_lderrno = set_ld_error;
tfns.ltf_lderrno_arg = NULL;
if ( ldap_set_option( ld, LDAP_OPT_THREAD_FN_PTRS, (void *) &tfns )
!= 0 ) {
ldap_perror( ld, "ldap_set_option: thread functions" );
exit( 1 );
}
/* set DNS function pointers */
memset( &dnsfns, '\0', sizeof(struct ldap_dns_fns) );
dnsfns.lddnsfn_bufsize = PR_NETDB_BUF_SIZE;
dnsfns.lddnsfn_gethostbyname = my_gethostbyname;
dnsfns.lddnsfn_gethostbyaddr = my_gethostbyaddr;
if ( ldap_set_option( ld, LDAP_OPT_DNS_FN_PTRS, (void *)&dnsfns )
!= 0 ) {
ldap_perror( ld, "ldap_set_option: DNS functions" );
exit( 1 );
}
#ifdef LDAP_MEMCACHE
/* create the in-memory cache */
if (( rc = ldap_memcache_init( MEMCACHE_TTL, MEMCACHE_SIZE, NULL,
&tfns, &memcache )) != LDAP_SUCCESS ) {
fprintf( stderr, "ldap_memcache_init failed - %s\n",
ldap_err2string( rc ));
exit( 1 );
}
if (( rc = ldap_memcache_set( ld, memcache )) != LDAP_SUCCESS ) {
fprintf( stderr, "ldap_memcache_set failed - %s\n",
ldap_err2string( rc ));
exit( 1 );
}
#endif
/*
* set option so that the next call to ldap_simple_bind_s() after
* the server connection is lost will attempt to reconnect.
*/
if ( ldap_set_option( ld, LDAP_OPT_RECONNECT, LDAP_OPT_ON ) != 0 ) {
ldap_perror( ld, "ldap_set_option: reconnect" );
exit( 1 );
}
/* initial bind */
if ( simplebind( ld, "ldap_simple_bind_s/main", 1 ) != LDAP_SUCCESS ) {
exit( 1 );
}
/* create the operation threads */
if ( (search_tid = PR_CreateThread( PR_USER_THREAD, search_thread,
"1", PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD,
0 )) == NULL ) {
perror( "PR_CreateThread search_thread" );
exit( 1 );
}
if ( (modify_tid = PR_CreateThread( PR_USER_THREAD, modify_thread,
"2", PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD,
0 )) == NULL ) {
perror( "PR_CreateThread modify_thread" );
exit( 1 );
}
if ( (search_tid2 = PR_CreateThread( PR_USER_THREAD, search_thread,
"3", PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD,
0 )) == NULL ) {
perror( "PR_CreateThread search_thread 2" );
exit( 1 );
}
if ( (add_tid = PR_CreateThread( PR_USER_THREAD, add_thread,
"4", PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD,
0 )) == NULL ) {
perror( "PR_CreateThread add_thread" );
exit( 1 );
}
if ( (search_tid3 = PR_CreateThread( PR_USER_THREAD, search_thread,
"5", PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD,
0 )) == NULL ) {
perror( "PR_CreateThread search_thread 3" );
exit( 1 );
}
if ( (delete_tid = PR_CreateThread( PR_USER_THREAD, delete_thread,
"6", PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD,
0 )) == NULL ) {
perror( "PR_CreateThread delete_thread" );
exit( 1 );
}
if ( (search_tid4 = PR_CreateThread( PR_USER_THREAD, search_thread,
"7", PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD,
0 )) == NULL ) {
perror( "PR_CreateThread search_thread 4" );
exit( 1 );
}
PR_Cleanup();
return( 0 );
}
static int
simplebind( LDAP *ld, char *msg, int tries )
{
int rc;
while ( tries-- > 0 ) {
rc = ldap_simple_bind_s( ld, NAME, PASSWORD );
if ( rc != LDAP_SUCCESS ) {
ldap_perror( ld, msg );
}
if ( tries == 0 || !CONNECTION_ERROR( rc )) {
return( rc );
}
fprintf( stderr,
"%s: sleeping for 5 secs - will try %d more time(s)...\n",
msg, tries );
sleep( 5 );
}
return( rc );
}
static void
search_thread( void *arg1 )
{
LDAPMessage *res;
LDAPMessage *e;
char *a;
char **v;
char *dn;
BerElement *ber;
int i, rc, msgid;
void *tsd;
char *id = arg1;
printf( "search_thread\n" );
tsd_setup();
for ( ;; ) {
printf( "%sSearching...\n", id );
if ( (msgid = ldap_search( ld, BASE, LDAP_SCOPE_SUBTREE,
"(objectclass=*)", NULL, 0 )) == -1 ) {
ldap_perror( ld, "ldap_search_s" );
rc = ldap_get_lderrno( ld, NULL, NULL );
if ( CONNECTION_ERROR( rc ) && simplebind( ld,
"bind-search_thread", 5 ) != LDAP_SUCCESS ) {
return;
}
continue;
}
while ( (rc = ldap_result( ld, msgid, 0, NULL, &res ))
== LDAP_RES_SEARCH_ENTRY ) {
for ( e = ldap_first_entry( ld, res ); e != NULL;
e = ldap_next_entry( ld, e ) ) {
dn = ldap_get_dn( ld, e );
/* printf( "%sdn: %s\n", id, dn ); */
free( dn );
for ( a = ldap_first_attribute( ld, e, &ber );
a != NULL; a = ldap_next_attribute( ld, e,
ber ) ) {
v = ldap_get_values( ld, e, a );
for ( i = 0; v && v[i] != 0; i++ ) {
/*
printf( "%s%s: %s\n", id, a,
v[i] );
*/
}
ldap_value_free( v );
ldap_memfree( a );
}
if ( ber != NULL ) {
ber_free( ber, 0 );
}
}
ldap_msgfree( res );
/* printf( "%s\n", id ); */
}
if ( rc == -1 || ldap_result2error( ld, res, 0 ) !=
LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_search" );
} else {
printf( "%sDone with one round\n", id );
}
if ( rc == -1 ) {
rc = ldap_get_lderrno( ld, NULL, NULL );
if ( CONNECTION_ERROR( rc ) && simplebind( ld,
"bind-search_thread", 5 ) != LDAP_SUCCESS ) {
return;
}
}
}
}
static void
modify_thread( void *arg1 )
{
LDAPMessage *res;
LDAPMessage *e;
int i, modentry, entries, msgid, rc;
LDAPMod mod;
LDAPMod *mods[2];
char *vals[2];
char *dn;
char *id = arg1;
ldapmsgwrapper *list, *lmwp, *lastlmwp;
printf( "modify_thread\n" );
tsd_setup();
if ( (msgid = ldap_search( ld, BASE, LDAP_SCOPE_SUBTREE,
"(objectclass=*)", NULL, 0 )) == -1 ) {
ldap_perror( ld, "ldap_search_s" );
exit( 1 );
}
entries = 0;
list = lastlmwp = NULL;
while ( (rc = ldap_result( ld, msgid, 0, NULL, &res ))
== LDAP_RES_SEARCH_ENTRY ) {
entries++;
if (( lmwp = (ldapmsgwrapper *)
malloc( sizeof( ldapmsgwrapper ))) == NULL ) {
perror( "modify_thread: malloc" );
exit( 1 );
}
lmwp->lmw_messagep = res;
lmwp->lmw_next = NULL;
if ( lastlmwp == NULL ) {
list = lastlmwp = lmwp;
} else {
lastlmwp->lmw_next = lmwp;
}
lastlmwp = lmwp;
}
if ( rc == -1 || ldap_result2error( ld, res, 0 ) != LDAP_SUCCESS ) {
ldap_perror( ld, "modify_thread: ldap_search" );
exit( 1 );
} else {
entries++;
printf( "%sModify got %d entries\n", id, entries );
}
mods[0] = &mod;
mods[1] = NULL;
vals[0] = "bar";
vals[1] = NULL;
for ( ;; ) {
modentry = rand() % entries;
for ( i = 0, lmwp = list; lmwp != NULL && i < modentry;
i++, lmwp = lmwp->lmw_next ) {
/* NULL */
}
if ( lmwp == NULL ) {
fprintf( stderr,
"%sModify could not find entry %d of %d\n",
id, modentry, entries );
continue;
}
e = lmwp->lmw_messagep;
printf( "%sPicked entry %d of %d\n", id, i, entries );
dn = ldap_get_dn( ld, e );
mod.mod_op = LDAP_MOD_REPLACE;
mod.mod_type = "description";
mod.mod_values = vals;
printf( "%sModifying (%s)\n", id, dn );
if (( rc = ldap_modify_s( ld, dn, mods )) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_modify_s" );
if ( CONNECTION_ERROR( rc ) && simplebind( ld,
"bind-modify_thread", 5 ) != LDAP_SUCCESS ) {
return;
}
}
free( dn );
}
}
static void
add_thread( void *arg1 )
{
LDAPMod mod[5];
LDAPMod *mods[6];
char dn[BUFSIZ], name[40];
char *cnvals[2], *snvals[2], *ocvals[2];
int i, rc;
char *id = arg1;
printf( "add_thread\n" );
tsd_setup();
for ( i = 0; i < 5; i++ ) {
mods[i] = &mod[i];
}
mods[5] = NULL;
mod[0].mod_op = 0;
mod[0].mod_type = "cn";
mod[0].mod_values = cnvals;
cnvals[1] = NULL;
mod[1].mod_op = 0;
mod[1].mod_type = "sn";
mod[1].mod_values = snvals;
snvals[1] = NULL;
mod[2].mod_op = 0;
mod[2].mod_type = "objectclass";
mod[2].mod_values = ocvals;
ocvals[0] = "person";
ocvals[1] = NULL;
mods[3] = NULL;
for ( ;; ) {
sprintf( name, "%d", rand() );
sprintf( dn, "cn=%s, " BASE, name );
cnvals[0] = name;
snvals[0] = name;
printf( "%sAdding entry (%s)\n", id, dn );
if (( rc = ldap_add_s( ld, dn, mods )) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_add_s" );
if ( CONNECTION_ERROR( rc ) && simplebind( ld,
"bind-add_thread", 5 ) != LDAP_SUCCESS ) {
return;
}
}
}
}
static void
delete_thread( void *arg1 )
{
LDAPMessage *res;
char dn[BUFSIZ], name[40];
int entries, msgid, rc;
char *id = arg1;
printf( "delete_thread\n" );
tsd_setup();
if ( (msgid = ldap_search( ld, BASE, LDAP_SCOPE_SUBTREE,
"(objectclass=*)", NULL, 0 )) == -1 ) {
ldap_perror( ld, "delete_thread: ldap_search_s" );
exit( 1 );
}
entries = 0;
while ( (rc = ldap_result( ld, msgid, 0, NULL, &res ))
== LDAP_RES_SEARCH_ENTRY ) {
entries++;
ldap_msgfree( res );
}
entries++;
if ( rc == -1 || ldap_result2error( ld, res, 1 ) != LDAP_SUCCESS ) {
ldap_perror( ld, "delete_thread: ldap_search" );
} else {
printf( "%sDelete got %d entries\n", id, entries );
}
for ( ;; ) {
sprintf( name, "%d", rand() );
sprintf( dn, "cn=%s, " BASE, name );
printf( "%sDeleting entry (%s)\n", id, dn );
if (( rc = ldap_delete_s( ld, dn )) != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_delete_s" );
if ( CONNECTION_ERROR( rc ) && simplebind( ld,
"bind-delete_thread", 5 ) != LDAP_SUCCESS ) {
return;
}
}
}
}
struct ldap_error {
int le_errno;
char *le_matched;
char *le_errmsg;
};
static void
tsd_setup()
{
void *tsd;
tsd = (void *) PR_GetThreadPrivate( tsdindex );
if ( tsd != NULL ) {
fprintf( stderr, "tsd non-null!\n" );
exit( 1 );
}
tsd = (void *) calloc( 1, sizeof(struct ldap_error) );
if ( PR_SetThreadPrivate( tsdindex, tsd ) != 0 ) {
perror( "PR_SetThreadPrivate" );
exit( 1 );
}
}
static void
set_ld_error( int err, char *matched, char *errmsg, void *dummy )
{
struct ldap_error *le;
le = (void *) PR_GetThreadPrivate( tsdindex );
le->le_errno = err;
if ( le->le_matched != NULL ) {
ldap_memfree( le->le_matched );
}
le->le_matched = matched;
if ( le->le_errmsg != NULL ) {
ldap_memfree( le->le_errmsg );
}
le->le_errmsg = errmsg;
}
static int
get_ld_error( char **matched, char **errmsg, void *dummy )
{
struct ldap_error *le;
le = PR_GetThreadPrivate( tsdindex );
if ( matched != NULL ) {
*matched = le->le_matched;
}
if ( errmsg != NULL ) {
*errmsg = le->le_errmsg;
}
return( le->le_errno );
}
static void
set_errno( int oserrno )
{
/* XXXmcs: should this be PR_SetError( oserrno, 0 )? */
PR_SetError( PR_UNKNOWN_ERROR, oserrno );
}
static int
get_errno( void )
{
/* XXXmcs: should this be PR_GetError()? */
return( PR_GetOSError());
}
static void *
my_mutex_alloc( void )
{
return( (void *)PR_NewLock());
}
static void
my_mutex_free( void *mutex )
{
PR_DestroyLock( (PRLock *)mutex );
}
static int
my_mutex_lock( void *mutex )
{
PR_Lock( (PRLock *)mutex );
return( 0 );
}
static int
my_mutex_unlock( void *mutex )
{
if ( PR_Unlock( (PRLock *)mutex ) == PR_FAILURE ) {
return( -1 );
}
return( 0 );
}
static LDAPHostEnt *
my_gethostbyname( const char *name, LDAPHostEnt *result,
char *buffer, int buflen, int *statusp, void *extradata )
{
PRHostEnt prhent;
if ( PR_GetHostByName( name, buffer, buflen,
&prhent ) != PR_SUCCESS ) {
return( NULL );
}
return( copyPRHostEnt2LDAPHostEnt( result, &prhent ));
}
static LDAPHostEnt *
my_gethostbyaddr( const char *addr, int length, int type, LDAPHostEnt *result,
char *buffer, int buflen, int *statusp, void *extradata )
{
PRHostEnt prhent;
if ( PR_GetHostByAddr( (PRNetAddr *)addr, buffer, buflen,
&prhent ) != PR_SUCCESS ) {
return( NULL );
}
return( copyPRHostEnt2LDAPHostEnt( result, &prhent ));
}
static LDAPHostEnt *
copyPRHostEnt2LDAPHostEnt( LDAPHostEnt *ldhp, PRHostEnt *prhp )
{
ldhp->ldaphe_name = prhp->h_name;
ldhp->ldaphe_aliases = prhp->h_aliases;
ldhp->ldaphe_addrtype = prhp->h_addrtype;
ldhp->ldaphe_length = prhp->h_length;
ldhp->ldaphe_addr_list = prhp->h_addr_list;
return( ldhp );
}

View File

@@ -0,0 +1,386 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* Copyright (c) 1995 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* open.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
/* OK, this stuff broke the Macintosh Dogbert build. Please fix it.
** The files you included do not exist for client builds on macintosh.
** XXXmcs: noted.
*/
#if defined(XP_MAC) && defined(MOZILLA_CLIENT)
#define VI_PRODUCTVERSION 3 /* fixme */
#else
#include "sdkver.h"
#endif
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK ((unsigned long) 0x7f000001)
#endif
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif
#ifdef LDAP_DEBUG
int ldap_debug;
#endif
extern int SSL_IsDomestic(void);
/*
* global defaults for callbacks are stored here. callers of the API set
* these by passing a NULL "ld" to ldap_set_option(). Everything in
* nsldapi_ld_defaults can be overridden on a per-ld basis as well (the
* memory allocation functions are global to all ld's).
*/
struct ldap nsldapi_ld_defaults;
struct ldap_memalloc_fns nsldapi_memalloc_fns = { 0, 0, 0, 0 };
int nsldapi_initialized = 0;
void
nsldapi_initialize_defaults( void )
{
if ( nsldapi_initialized ) {
return;
}
nsldapi_initialized = 1;
memset( &nsldapi_memalloc_fns, 0, sizeof( nsldapi_memalloc_fns ));
memset( &nsldapi_ld_defaults, 0, sizeof( nsldapi_ld_defaults ));
nsldapi_ld_defaults.ld_options = LDAP_BITOPT_REFERRALS;
nsldapi_ld_defaults.ld_version = LDAP_VERSION;
nsldapi_ld_defaults.ld_lberoptions = LBER_OPT_USE_DER;
nsldapi_ld_defaults.ld_refhoplimit = LDAP_DEFAULT_REFHOPLIMIT;
#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
nsldapi_ld_defaults.ld_lberoptions |= LBER_OPT_TRANSLATE_STRINGS;
#if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET
ldap_set_string_translators( &nsldapi_ld_defaults, ldap_8859_to_t61,
ldap_t61_to_8859 );
#endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */
#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */
}
/*
* ldap_version - report version levels for important properties
*
* Example:
* LDAPVersion ver;
* ldap_version( &ver );
* if ( (ver.sdk_version < 100) || (ver.SSL_version < 300) )
* fprintf( stderr, "LDAP SDK level insufficient\n" );
*
* or:
* if ( ldap_version(NULL) < 100 )
* fprintf( stderr, "LDAP SDK level insufficient\n" );
*
*/
int
LDAP_CALL
ldap_version( LDAPVersion *ver )
{
if ( NULL != ver )
{
memset( ver, 0, sizeof(*ver) );
ver->sdk_version = (int)(VI_PRODUCTVERSION * 100);
ver->protocol_version = LDAP_VERSION_MAX * 100;
ver->SSL_version = SSL_VERSION * 100;
#if defined(LINK_SSL)
ver->security_level = SSL_IsDomestic() ? 128 : 40;
#else
ver->security_level = LDAP_SECURITY_NONE;
#endif
}
return (int)(VI_PRODUCTVERSION * 100);
}
/*
* ldap_open - initialize and connect to an ldap server. A magic cookie to
* be used for future communication is returned on success, NULL on failure.
* "host" may be a space-separated list of hosts or IP addresses
*
* Example:
* LDAP *ld;
* ld = ldap_open( hostname, port );
*/
LDAP *
LDAP_CALL
ldap_open( const char *host, int port )
{
LDAP *ld;
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_open\n", 0, 0, 0 );
if (( ld = ldap_init( host, port )) == NULL ) {
return( NULL );
}
LDAP_MUTEX_LOCK( ld, LDAP_CONN_LOCK );
if ( nsldapi_open_ldap_defconn( ld ) < 0 ) {
LDAP_MUTEX_UNLOCK( ld, LDAP_CONN_LOCK );
ldap_ld_free( ld, 0 );
return( NULL );
}
LDAP_MUTEX_UNLOCK( ld, LDAP_CONN_LOCK );
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_open successful, ld_host is %s\n",
( ld->ld_host == NULL ) ? "(null)" : ld->ld_host, 0, 0 );
return( ld );
}
/*
* ldap_init - initialize the LDAP library. A magic cookie to be used for
* future communication is returned on success, NULL on failure.
* "defhost" may be a space-separated list of hosts or IP addresses
*
* Example:
* LDAP *ld;
* ld = ldap_init( default_hostname, default_port );
*/
LDAP *
LDAP_CALL
ldap_init( const char *defhost, int defport )
{
LDAP *ld;
int i;
if ( !nsldapi_initialized ) {
nsldapi_initialize_defaults();
}
if ( defport < 0 || defport > LDAP_PORT_MAX ) {
LDAPDebug( LDAP_DEBUG_ANY,
"ldap_init: port %d is invalid (port numbers must range from 1 to %d)\n",
defport, LDAP_PORT_MAX, 0 );
#if !defined( macintosh ) && !defined( DOS )
errno = EINVAL;
#endif
return( NULL );
}
LDAPDebug( LDAP_DEBUG_TRACE, "ldap_init\n", 0, 0, 0 );
if ( (ld = (LDAP*)NSLDAPI_MALLOC( sizeof(struct ldap) )) == NULL ) {
return( NULL );
}
/* copy defaults */
SAFEMEMCPY( ld, &nsldapi_ld_defaults, sizeof( struct ldap ));
if (( ld->ld_selectinfo = nsldapi_new_select_info()) == NULL ||
( ld->ld_sbp = ber_sockbuf_alloc()) == NULL ||
( defhost != NULL &&
( ld->ld_defhost = nsldapi_strdup( defhost )) == NULL ) ||
((ld->ld_mutex = (void **) NSLDAPI_CALLOC( LDAP_MAX_LOCK, sizeof(void *))) == NULL )) {
if ( ld->ld_sbp != NULL ) {
ber_sockbuf_free( ld->ld_sbp );
}
if ( ld->ld_selectinfo != NULL ) {
nsldapi_free_select_info( ld->ld_selectinfo );
}
if( ld->ld_mutex != NULL )
NSLDAPI_FREE( ld->ld_mutex );
NSLDAPI_FREE( (char*)ld );
return( NULL );
}
for( i=0; i<LDAP_MAX_LOCK; i++ )
ld->ld_mutex[i] = LDAP_MUTEX_ALLOC( ld );
ld->ld_defport = ( defport == 0 ) ? LDAP_PORT : defport;
return( ld );
}
int
nsldapi_open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport,
char **krbinstancep, int async, int secure )
{
int rc = 0, port;
char *p, *q, *r;
char *curhost, hostname[ 2*MAXHOSTNAMELEN ];
LDAPDebug( LDAP_DEBUG_TRACE, "nsldapi_open_ldap_connection\n", 0, 0,
0 );
defport = htons( (unsigned short)defport );
if ( host != NULL && *host != '\0' ) {
for ( p = host; p != NULL && *p != '\0'; p = q ) {
if (( q = strchr( p, ' ' )) != NULL ) {
strncpy( hostname, p, q - p );
hostname[ q - p ] = '\0';
curhost = hostname;
while ( *q == ' ' ) {
++q;
}
} else {
curhost = p; /* avoid copy if possible */
q = NULL;
}
if (( r = strchr( curhost, ':' )) != NULL ) {
if ( curhost != hostname ) {
strcpy( hostname, curhost ); /* now copy */
r = hostname + ( r - curhost );
curhost = hostname;
}
*r++ = '\0';
port = htons( (short)atoi( r ));
} else {
port = defport;
}
if (( rc = nsldapi_connect_to_host( ld, sb, curhost, 0L,
port, async, secure )) != -1 ) {
break;
}
}
} else {
rc = nsldapi_connect_to_host( ld, sb, NULL, htonl( INADDR_LOOPBACK ),
defport, async, secure );
}
if ( rc == -1 ) {
return( rc );
}
if ( krbinstancep != NULL ) {
#ifdef KERBEROS
if (( *krbinstancep = nsldapi_host_connected_to( sb )) != NULL &&
( p = strchr( *krbinstancep, '.' )) != NULL ) {
*p = '\0';
}
#else /* KERBEROS */
krbinstancep = NULL;
#endif /* KERBEROS */
}
return( 0 );
}
/* returns 0 if connection opened and -1 if an error occurs */
int
nsldapi_open_ldap_defconn( LDAP *ld )
{
LDAPServer *srv;
if (( srv = (LDAPServer *)NSLDAPI_CALLOC( 1, sizeof( LDAPServer ))) ==
NULL || ( ld->ld_defhost != NULL && ( srv->lsrv_host =
nsldapi_strdup( ld->ld_defhost )) == NULL )) {
LDAP_SET_LDERRNO( ld, LDAP_NO_MEMORY, NULL, NULL );
return( -1 );
}
srv->lsrv_port = ld->ld_defport;
#ifdef LDAP_SSLIO_HOOKS
if (( ld->ld_options & LDAP_BITOPT_SSL ) != 0 ) {
srv->lsrv_options |= LDAP_SRV_OPT_SECURE;
}
#endif
if (( ld->ld_defconn = nsldapi_new_connection( ld, &srv, 1, 1, 0 ))
== NULL ) {
if ( ld->ld_defhost != NULL ) {
NSLDAPI_FREE( srv->lsrv_host );
}
NSLDAPI_FREE( (char *)srv );
return( -1 );
}
++ld->ld_defconn->lconn_refcnt; /* so it never gets closed/freed */
return( 0 );
}
/*
* memory allocation functions. we include these in open.c since every
* LDAP application is likely to pull the rest of the code in this file
* in anyways.
*/
void *
nsldapi_malloc( size_t size )
{
return( nsldapi_memalloc_fns.ldapmem_malloc == NULL ?
malloc( size ) :
nsldapi_memalloc_fns.ldapmem_malloc( size ));
}
void *
nsldapi_calloc( size_t nelem, size_t elsize )
{
return( nsldapi_memalloc_fns.ldapmem_calloc == NULL ?
calloc( nelem, elsize ) :
nsldapi_memalloc_fns.ldapmem_calloc( nelem, elsize ));
}
void *
nsldapi_realloc( void *ptr, size_t size )
{
return( nsldapi_memalloc_fns.ldapmem_realloc == NULL ?
realloc( ptr, size ) :
nsldapi_memalloc_fns.ldapmem_realloc( ptr, size ));
}
void
nsldapi_free( void *ptr )
{
if ( nsldapi_memalloc_fns.ldapmem_free == NULL ) {
free( ptr );
} else {
nsldapi_memalloc_fns.ldapmem_free( ptr );
}
}
char *
nsldapi_strdup( const char *s )
{
char *p;
if ( (p = (char *)NSLDAPI_MALLOC( strlen( s ) + 1 )) == NULL )
return( NULL );
strcpy( p, s );
return( p );
}

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