Compare commits

..

425 Commits

Author SHA1 Message Date
dougt%meer.net
7d42b6119d Creating branch tag and allowing WINCE code to live there.
git-svn-id: svn://10.0.0.236/branches/NSPR_PRE_4_2_WINCE_BRANCH@172527 18797224-902f-48f8-a5cc-f745e15eee43
2005-04-20 23:26:16 +00:00
(no author)
4b7b4a7f78 This commit was manufactured by cvs2svn to create branch
'NSPR_PRE_4_2_WINCE_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPR_PRE_4_2_WINCE_BRANCH@172101 18797224-902f-48f8-a5cc-f745e15eee43
2005-04-13 22:57:56 +00:00
wtchang%redhat.com
9598517613 Bugzilla bug 290122: pass full pathnames of source files to the compiler
on AIX so its debugger can automatically find the source files. r=Julien
Pierre of Sun and Philip Warren of IBM. a=caillon for mozilla1.8b2 and
aviary1.1a.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@172100 18797224-902f-48f8-a5cc-f745e15eee43
2005-04-13 22:57:55 +00:00
wtchang%redhat.com
8d4047bfe1 Bugzilla Bug 287197: undo the damage of rev. 3.2. Comments must begin
with "//", not "/".
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@171006 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-22 21:37:32 +00:00
wtchang%redhat.com
dc51e6c491 Bugzilla Bug 238563: added a comment that Nelson suggested in code review.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170808 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-16 23:24:18 +00:00
wtchang%redhat.com
f4a92bad5f Bugzilla Bugs 255633, 285934: '-' must be the first or last character in
a scanlist, otherwise some implementations may interpret it to mean a
range of characters.  Thanks to Frank Wein <bugzilla@mcsmurf.de> for the
bug report and suggesting the fix.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170669 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-15 00:55:22 +00:00
wtchang%redhat.com
d800044372 Bugzilla Bug 238563: carried the fixes from the trunk (revisions 3.15 and
3.16) to the NSPRPUB_PRE_4_2_CLIENT_BRANCH.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170668 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-15 00:53:05 +00:00
wtchang%redhat.com
f9b35d860e Bugzilla Bug 252195: use Microsoft IPv6 Technology Preview for Windows
2000 (wship6.dll), if available. r=darin.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170495 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-10 01:53:04 +00:00
wtchang%redhat.com
28f167f339 Bugzilla Bug 164163: removed unused function PR_FindLibrary.
Modified Files: nspr_symvec.opt prlink.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170490 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-10 01:41:28 +00:00
wtchang%redhat.com
2b9599b471 Bugzilla Bug 285286: PR_ReadDir reported the wrong error code when the
end of directory was reached.  We need to set errno to 0 before calling
readdir and mapping error 0 to PR_NO_MORE_FILES_ERROR.  The patch is
contributed by Mathieu Poumeyrol <poumeyrol@idm.fr>. r-wtc,bryner.
Modified Files: beos_errors.c bfile.c unix.c unix_errors.c ptio.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170475 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-09 22:52:00 +00:00
wtchang%redhat.com
64581e9219 Bugzilla Bug 255633: allow hyphen (-) and underscore (_) in log module
names.  The patch is contributed by Ed Catmur <ed@catmur.co.uk>. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170473 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-09 22:35:56 +00:00
wtchang%redhat.com
5d22ecfab7 Bugzilla Bug 100776: make a copy of the sockaddr structure and pass the
copy to connect because connect modifies the sockaddr structure.  The
patch is contributed by Julien Pierre of Sun.  r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170467 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-09 21:47:58 +00:00
wtchang%redhat.com
4dd2b82c8d Regenerated using the official autoconf 2.13 (as opposed to the autoconf
2.13 in Red Hat Enterprise Linux 3).
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170465 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-09 21:39:11 +00:00
wtchang%redhat.com
2638306570 Bugzilla bug 256508: make --with-pthreads the default on OpenBSD. The
fix was tested by Jim Rees <rees@umich.edu>.
Modified Files: configure.in configure
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170463 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-09 21:24:03 +00:00
wtchang%redhat.com
52ec787f58 Bugzilla Bug 195222: removed obsolete NSPR makefiles.
Removed Files: makefile.win gmakefile.win
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170426 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-09 03:23:39 +00:00
wtchang%redhat.com
6fb8bfc4dc Bugzilla Bug 281250: internal functions should not be defined with
PR_IMPLEMENT.  Thanks to timeless@bemail.org for the bug report.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170423 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-09 01:57:45 +00:00
wtchang%redhat.com
cb268175f3 Bugzilla Bug 279817: removed the NODL_TABLE code. It was added for Win16.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170422 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-09 01:51:12 +00:00
wtchang%redhat.com
87fb3d19c5 Bugzilla Bug 285020: wrap the member access in parenthesis because recv
may be defined as a macro on some platforms.  The patch is contributed by
Chris Aillon of Red Hat.  r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170401 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 22:47:54 +00:00
wtchang%redhat.com
b3dcbc86cb Bugzilla bug 274450: a default thread stack size of 64K is too small for
Mozilla on Linux.  Use the default pthread stack size instead, and do that
on all platforms (not just Linux).  r=bzbarsky.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170397 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 22:07:46 +00:00
wtchang%redhat.com
de929316bc Dummy whitespace change to force the Mozilla tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170357 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 03:05:31 +00:00
wtchang%redhat.com
96cf9ebfa7 Removed blank lines in *.def files.
Modified Files: plds.def plc.def nspr.def my.def
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170355 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 03:04:45 +00:00
wtchang%redhat.com
0b0d60867d Bug 236613: change to MPL/LGPL/GPL tri-license.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170352 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 02:38:53 +00:00
wtchang%redhat.com
5af8720546 238319: Sun packages changes.
Add Mozilla copyrights to makefiles.
(Carried Christoph Ravel's changes to the NSPRPUB_PRE_4_2_CLIENT_BRANCH.)


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170348 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 02:17:45 +00:00
wtchang%redhat.com
450f4eb868 Bugzilla Bug 279071: removed a duplication definition of the
MAX_POLLING_INTERVAL macro. The bug is reported by Justin Wood
<116057@bacon.qcc.mass.edu>.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170344 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 02:01:06 +00:00
wtchang%redhat.com
280e52104f Bugzilla Bug 280872: prmem.h doesn't need to include <stddef.h> directly
because it is already included via prtypes.h.  The patch is contributed
by Hans-Andreas Engel <Hans-A.Engel@unibas.ch>. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170341 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 01:31:36 +00:00
wtchang%redhat.com
280e88dd3b Bugzilla Bug 274450: use pthread_attr_setstacksize on Linux.
Modified Files: ptthread.c foreign.c provider.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170340 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-08 01:28:13 +00:00
wtchang%redhat.com
e55e612995 Bugzilla Bug 283710: disable executable stack on ia64. The patch is
contributed by Christopher A. Aillon of Red Hat.  r=wtc.  Also fixed
the comments.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@170008 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-28 21:19:01 +00:00
wtchang%redhat.com
aa15a4010d Bugzilla Bug 260899: removed dead code.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@169715 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-24 03:23:48 +00:00
wtchang%redhat.com
46f0f77be8 Dummy whitespace change to force the Mozilla Tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@169713 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-24 03:04:09 +00:00
wtchang%redhat.com
a9e7c54424 Bugzilla Bug 260899: do not use the spinlock based implementation of
PR_StackPush and PR_StackPop for Solaris x86.  The patch is contributed by
Julien Pierre of Sun.  r=wtc.
Modified Files: _solaris.h os_SunOS_x86.s
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@169712 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-24 03:03:11 +00:00
wtchang%redhat.com
6f4a36a826 Bugzilla Bug 283210: Use the B_DO_NOT_RESCHEDULE flag to avoid unnecessary
context switches when a lock is released.  The patch is contributed by
tqh <thesuckiestemail@yahoo.se>.  r=sergei_d,wtc.
Modified Files: btcvar.c btlocks.c btsem.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@169655 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-23 17:49:14 +00:00
mkaply%us.ibm.com
31f2adeaa1 #271883
r=mkaply, sr=wtc
remove FILE_HIDDEN from OS/2 NSPR


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@169401 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-18 17:55:51 +00:00
wtchang%redhat.com
790fd9e655 Bugzilla Bug 281763: fixed a leak of the first arena on the freelist when
the second arena is taken.  The patch is contributed by Nelson Bolyard of
Sun Microsystems.  r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@169121 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-11 20:21:37 +00:00
wtchang%redhat.com
eeaeef1d1d Bugzilla Bug 280984: we found that the L_IGNOREUNLOAD flag is not yet
supported on 64-bit AIX, so we have to work around that.  The patch is
contributed by Philip K. Warren (IBM) <pkwarren@gmail.com>. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@169024 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-09 00:28:33 +00:00
wtchang%redhat.com
58b08ff3bc Bugzilla Bug 280984: need to pass the L_IGNOREUNLOAD flag to loadquery so
that shared libraries that have been dlclose'd but with nonzero ref count
will be listed.  Also use function address test, which is more reliable
than file name test.  The patch is contributed by Philip K. Warren (IBM)
<pkwarren@gmail.com>. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@168830 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-05 02:00:33 +00:00
gerv%gerv.net
a0c0e3b9b5 Bug 236613: change to MPL/LGPL/GPL tri-license.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@168632 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-01 15:28:15 +00:00
gerv%gerv.net
12308a61e9 Bug 236613: change to MPL/LGPL/GPL tri-license.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@168626 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-01 14:46:21 +00:00
wtchang%redhat.com
b51727786d Bugzilla Bug 279874: use %p instead of %X to print a pointer. The patch is
contributed by Tim Ruehsen <tim.ruehsen@gmx.de>. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@168582 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-31 21:47:27 +00:00
wtchang%redhat.com
b62627b654 Bugzilla Bug 277514: added an environment variable NSPR_OS2_NO_HIRES_TIMER
that a user can set to disable the use of high-resolution timer
DosTmrQueryTime().  The patch is contributed by Michael Kaply
<mkaply@us.ibm.com>. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@168326 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-25 22:26:04 +00:00
wtchang%redhat.com
f70da63013 Bugzilla Bug 279723: PR_ReadDir needs to map the error code before
returning with a failure.  The patch is contributed by Mathieu Poumeyrol
<poumeyrol@idm.fr>. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@168316 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-25 19:59:34 +00:00
wtchang%redhat.com
ce33c3cee0 Bugzilla Bug 279541: Fixed errors in code that was apparently copied
and pasted.  ipv6_to_v4_tcpMethods should be ipv6_to_v4_udpMethods.
The patch is contributed by Justin Wood <116057@bacon.qcc.mass.edu>.
r=wtc,darin.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@168315 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-25 19:54:26 +00:00
wtchang%redhat.com
9b41324933 Dummy whitespace change to force the Mozilla tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@167922 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-17 22:31:37 +00:00
wtchang%redhat.com
b7a4c1e9ee Bugzilla bug 276330: add a new configuration macro _PR_HAVE_O_APPEND,
which should be defined on platforms (e.g., Unix and BeOS) that have
O_APPEND or its equivalent.  The patch is contributed by tqh
<thesuckiestemail@yahoo.se>. r=wtc,sergei_d.
Modified files: _beos.h _unixos.h primpl.h prfile.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@167921 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-17 22:13:36 +00:00
wtchang%redhat.com
84000c3241 Dummy change to force the Mozilla tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@167574 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-12 02:49:39 +00:00
wtchang%redhat.com
783456542f Bugzilla Bug 277704: define the LL_MAXINT, LL_MININT, ... macros as
constants rather than functions on platforms that have a 64-bit integer
type. The patch is contributed by Christian Biesinger <cbiesinger@gmx.at>.
r=wtc.
\ Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@167570 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-12 02:46:40 +00:00
wtchang%redhat.com
1c919b6de9 Bugzilla Bug 276587: use stat to implement _MD_access because access is
broken.  The patch is contributed by tqh <thesuckiestemail@yahoo.se>. r=wtc
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@167567 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-12 01:47:32 +00:00
wtchang%redhat.com
a1cc83c2e5 Bugzilla bug 276170: fixed unused variable addrp on some platforms.
Fixed the bug that addr rather than addrp was used.  r=timeless,darin.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@167262 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-04 21:29:17 +00:00
wtchang%redhat.com
4abc3226e3 Bugzilla Bug 274751: fixed the regression that the *.res files were not
removed by the various clean or clobber makefile targets.  r=cls.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@167261 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-04 21:27:36 +00:00
dbaron%dbaron.org
0524ac2ce2 Fix bustage by working around shells that don't allow ! after &&. b=275674, 273336
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@166976 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-23 02:23:24 +00:00
bryner%brianryner.com
8c8e94bed2 Fix undesired tinderbox rebuilds due to system header wrapper timestamps changing. Bug 273336, r=dbaron.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@166778 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-16 05:13:45 +00:00
bryner%brianryner.com
3330771ecd Add support for using gcc's visibility pragma to treat all function and method declarations as "hidden" unless declared otherwise. Create wrappers for system headers that cause them to be treated as default-visibility declarations. This gives a substantial code size and performance win on compilers that support it, and should show up on the gruff tinderbox. Bug 273336, r=darin sr=dbaron.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@166738 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-15 05:52:44 +00:00
wchang0222%aol.com
68d9f13bd7 Bugzilla bug 151709: declare the temporary variables as PRInt32.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@166358 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-06 23:39:01 +00:00
wchang0222%aol.com
30ac35cbb4 Bugzilla bug 151709: implemented atomic operations in assembly on Alpha
Linux.  The patch is contributed by falk@debian.org. r=darin,wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@166334 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-06 20:04:13 +00:00
wchang0222%aol.com
bd14334466 238319: Sun packaging changes.
Hook-up SUNWprd package. Remove SUNWprx package.
Porting from NSPR_4_5_BRANCH.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@166331 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-06 19:43:40 +00:00
(no author)
367050786c This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@165885 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-29 16:26:04 +00:00
wchang0222%aol.com
600beeb451 Checked in the fixes for Bugzilla bugs 106386, 266981, and 266327 on the
NSPRPUB_PRE_4_2_CLIENT_BRANCH.
Modified Files: plresolv.h plstr.h prgc.h prolock.h prtypes.h _darwin.h
_freebsd.cfg, _freebsd.h _pth.h bfile.c ptio.c ptsynch.c


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@165664 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-23 21:22:35 +00:00
mkaply%us.ibm.com
18cd422419 #247962
r=pedemonte, sr=wtc, a=mkaply
Patch from mkaply - remove DLL_InitTerm from NSPR - PM switch should happen in app, not NSPR


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@165586 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-22 20:07:48 +00:00
wchang0222%aol.com
1c09891603 Bugzilla bug 249782: make NSPR compile with Microsoft Visual Studio 2005.
The -DEBUGTYPE flag is no longer supported. Since -DEBUGTYPE:CV is the
default, we simply delete it. The patch is contributed by Stephen Walker
<sdwalker@myrealbox.com>. r=wtc.
Modified Files:
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
	pr/src/cplus/tests/Makefile.in pr/src/misc/Makefile.in


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@165103 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-08 02:50:18 +00:00
wchang0222%aol.com
ba8020c759 Bugzilla bug 249782: make NSPR compile with Microsoft Visual Studio 2005.
The -DEBUGTYPE flag is no longer supported. Since -DEBUGTYPE:CV is the
default, we simply delete it.  We added support for VC 5.0 (MSC_VER=1100)
back.  The patch is contributed by Stephen Walker <sdwalker@myrealbox.com>.
r=wtc.
Modified Files:
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
	configure configure.in config/rules.mk
	lib/msgc/tests/Makefile.in
	lib/prstreams/tests/testprstrm/Makefile.in
	lib/tests/Makefile.in lib/tests/windows/makefile
	tools/Makefile.in


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@165102 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-08 02:47:01 +00:00
wchang0222%aol.com
0c5d2edd9f Bugzilla bug 265219: go to errorExit on DosStartSession failure. r=mkaply.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@165044 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-05 23:19:29 +00:00
wchang0222%aol.com
9d96f91dd1 Bugzilla bug 265219: added support for redirecting stdin/stdout of a child
process. The patch is contributed by Davide Bresolin <davide@teamos2.it>.
r=mkaply,wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@164945 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-04 21:54:53 +00:00
wchang0222%aol.com
ed6b0f4a4a Bugzilla bug 265501: merged 32 and 64 bit versions of prcpucfg.h on
Solaris.  The patch is contributed by Christophe Ravel of Sun. r=wtc.
Modified Files: configure configure.in
Added Files: _solaris.cfg
Removed Files: _solaris32.cfg _solaris64.cfg
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@164461 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-26 21:36:03 +00:00
(no author)
2ea5faacab This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@164454 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-26 21:24:35 +00:00
wchang0222%aol.com
85f79177da Bugzilla bug 265709: fixed compiler warnings on LP64 platforms about
casting between a pointer and an integer of different size. r=jpierre.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@164450 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-26 20:52:35 +00:00
wchang0222%aol.com
b6e9d63ff0 Bugzilla bug 264324: we need to test for __s390x__ before __s390__ because
the s390x platform also defines __s390__.  The patch is contributed by
Wolfgang Rosenauer <mozilla@rosenauer.org>.  r=wtc.
Modified Files: _linux.cfg _linux.h
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@163987 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-18 22:46:30 +00:00
wchang0222%aol.com
8d90655879 Regenerated using official autoconf 2.13, with manual change to eliminate
\015.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@163280 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-06 01:37:03 +00:00
wchang0222%aol.com
c1ee3579aa Bugzilla bug 259001: ported NSPR to Solaris on AMD64 architecture. The
patch is contributed by Julien Pierre <julien.pierre.bugs@sun.com>. r=wtc.
Modified Files: configure configure.in _solaris.h _solaris64.cfg
Added Files: os_SunOS_x86_64.s


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@163277 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-06 01:10:54 +00:00
(no author)
02eb497441 This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@163275 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-06 00:52:58 +00:00
wchang0222%aol.com
97014d2855 Bugzilla bug 256217: implement PR_GetLibraryFilePathname for FreeBSD, which
can use the same implementation as Solaris and Linux.  The patch is
contributed by Dale Jordan. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@161667 18797224-902f-48f8-a5cc-f745e15eee43
2004-09-02 18:32:34 +00:00
darin%meer.net
9b63e4f62a landing NSPR portion of patch for bug 239358 "DNS: Reverse lookups are degrading performance"
patch by lorenzo@colitti.com, r=wtc, sr=darin


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@161514 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-30 23:31:36 +00:00
bryner%brianryner.com
2fb15eacc0 Add support for generating PDB-format debug symbols with MSVC, by setting MOZ_DEBUG_SYMBOLS=1 in the environment. This is to be used in place of MOZ_PROFILE. Bug 244231, r=wtc, dmose.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@161362 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-26 23:03:01 +00:00
cls%seawood.org
75a4500f69 Update comments and use enhanced cygwin-wrapper script for nspr & ldap.
Thanks to Brian Bober <netdragon@gmail.com> for the patch.
Bug #245918 r=cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@160949 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-18 23:18:56 +00:00
wchang0222%aol.com
1445ff1915 Bugzilla bug 244095: link libplds4.so and libplc4.so with -R $ORIGIN on
Solaris.  The patch is contributed by Julien Pierre.  r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
	lib/ds/Makefile.in lib/libc/src/Makefile.in


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@157001 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-27 02:42:06 +00:00
wchang0222%aol.com
2baf8b0309 Bugzilla bug 235381: use the -features=tmplife flag for Sun compilers to
enable Standard C++ lifetime of temporary objects. The patch is contributed
by Andreas Lange <anlan@ida.liu.se>. r=wtc. sr=darin.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@156735 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 21:26:18 +00:00
seawood%netscape.com
17d881996b Use the proper flags when building with --enable-debug --enable-optimize.
Thanks to Wan-Teh Chang <wchang0222@aol.com> for the patch.
Bug #243079 r=cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@156655 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-20 20:15:18 +00:00
wchang0222%aol.com
0e72e39b14 Bugzilla bug 244010: support NetBSD/sparc64. Accept more variants of the
arm architecture.  The patch is contributed by Martin Husemann
<martin@NetBSD.ORG>.  r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@156585 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-19 15:37:10 +00:00
wchang0222%aol.com
8755bc43ed Regenerated using a better version of autoconf 2.13.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@156055 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-07 00:42:08 +00:00
wchang0222%aol.com
93692c6373 Bugzilla bug 242741: MSVC .NET 2003 does not support the /PDB:NONE linker
option, so we need to generate PDB files and ship them with our binary
distributions when compiling with MSVC version > 6.0.  r=cls.
Modified Files: configure configure.in autoconf.mk.in rules.mk
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@156029 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-06 13:58:57 +00:00
wchang0222%aol.com
25fb4f36a9 Bugzilla bug 242741: use $(RES) (the .res file) only when building a
shared library.  Do not include $(RES) in a static library.  Removed the
unused makefile rule for $(RES) on OS/2. r=cls.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@156018 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-06 00:57:40 +00:00
wchang0222%aol.com
991f1c7b91 Bugzilla bug 209499: more improvements to PL_str functions. The patch for
strdup.c is contributed by Bernard Alleysson <balleysson@bigfoot.com>.
The patch for strcat.c and strstr.c is contributed by Dan Witte
<dwitte@stanford.edu>.  r=wtc.
Modified Files: strcat.c strcpy.c strdup.c strstr.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155808 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-02 00:39:58 +00:00
wchang0222%aol.com
770e5f4452 Dummy whitespace change to force the Mozilla trunk Tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155666 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-29 00:46:52 +00:00
wchang0222%aol.com
de4607c5a1 The return type of PR_GetMonitorEntryCount should be PRIntn.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155665 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-29 00:41:08 +00:00
wchang0222%aol.com
a8471ab81b Bugzilla bug 123403: LL_INIT should use PR_UINT32 because the hi and lo
fields of the PRInt64 structure are PRUint32.  The patch is contributed by
timeless@bemail.org.  r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155664 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-29 00:40:05 +00:00
wchang0222%aol.com
a752a280ac Dummy whitespace change to force Mozilla trunk tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155614 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-28 00:39:36 +00:00
wchang0222%aol.com
4e57aa9ee3 Bug 236613: change to MPL/LGPL/GPL tri-license.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155613 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-28 00:34:19 +00:00
seawood%netscape.com
80ff86d09a Allow nspr to accept multiple --{enable,disable}-{debug,optimize} args.
Bug #54828 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155550 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-26 22:42:53 +00:00
wchang0222%aol.com
c709b049ab Bugzilla bug 209499: backed out the change to strncpy in the previous
checkin because I noticed a subtle difference between PL_strncpy and
strncpy (the code marked with JLRU).
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155455 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-24 17:55:27 +00:00
wchang0222%aol.com
fa8ac41d32 Bugzilla bug 209499: converted some PL_str* implementations to use ANSI C
equivalents.  The patch is contributed by Dan Witte <dwitte@stanford.edu>.
r=wtc.
Modified Files: strcat.c strchr.c strcmp.c strcpy.c strdup.c strlen.c
                strpbrk.c strstr.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155453 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-24 17:26:55 +00:00
wchang0222%aol.com
2eeb9a2b1c Bugzilla bug 236228: fixed the remaining problems with logFile == WinDebug
by moving the WinDebug handling code into the _PUT_LOG macro.  The patch is
contributed by timeless@bemail.org.  r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155428 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-24 03:36:25 +00:00
wchang0222%aol.com
f06b35a860 Bugzilla bug 162786: fixed a bug where PR_snprintf returns wrong string
length (one too small), in the case where the buffer overflows.  The patch
is contributed by Jonathan Tash (tash@kontiki.com). r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155356 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-22 21:29:35 +00:00
mkaply%us.ibm.com
83173d9248 #239663
r=mkaply, sr=blizzard (platform specific)
OS/2 only - bring back VACPP support for NSPR and DBM mainly so VACPP can still be used with NSS


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155127 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-19 16:28:00 +00:00
wchang0222%aol.com
3b0625437c Bugzilla bug 108305: upgraded to the Mon Apr 12 00:44:22 MDT 2004 version
of dtoa.c.  r=darin.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@155003 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-17 00:31:38 +00:00
wchang0222%aol.com
ffa2145a07 It is not necessary to define _THREAD_SAFE when using pthreads on OpenBSD.
(See Bugzilla bug 236599 comment 41).
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154736 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-13 00:02:31 +00:00
wchang0222%aol.com
ca294d7a49 Bugzilla bug 238842: avoid the copying of va_list (the VARARGS_ASSIGN
macro) because it is not portable. r=jgmyers. sr=darin.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154735 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-12 23:59:24 +00:00
wchang0222%aol.com
25bbd78c1a Set NSPR version to 4.6 Beta.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154734 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-12 23:58:10 +00:00
wchang0222%aol.com
4f15410222 Bugzilla bug 238563: fixed errors reported by an IBM internal tool.
r=darin. Thanks to Philip K. Warren for running the automated tool on NSPR.
Modified Files: prcountr.c prdtoa.c prtrace.c prtpd.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154733 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-12 23:53:42 +00:00
wchang0222%aol.com
a73ee555ee Bugzilla bug 232958: checked in a new condition variable implementation
contributed by Fredrik Holmqvist <thesuckiestemail@yahoo.se>.
Modified Files: primpl.h btcvar.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154728 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-12 23:41:15 +00:00
seawood%netscape.com
b4d4b67604 Add support for cross-compiling to i386-mingw32.
Bug #222013
r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154717 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-12 22:25:52 +00:00
mkaply%us.ibm.com
5933aa5b75 #126928
r=mkaply, a=mkaply
OS/2 only - code from knut st. osmundsen - implement PR_SetFDInheritable on OS/2


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154429 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-01 16:54:23 +00:00
mkaply%us.ibm.com
fab03fb8c4 #231934
r=mkaply, sr=blizzard (platform specific), a=mkaply
OS/2 only - code from ganesh - generate map files on OS/2


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154388 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-30 19:38:53 +00:00
mkaply%us.ibm.com
63996a3855 #237183
r=wtc, a=mkaply
OS/2 only - add support for exception handler to NSPR so we can catch floating point exceptions


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154270 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-25 20:27:01 +00:00
wchang0222%aol.com
8e3c2dac57 Bugzilla bug 238578: memory allocated with PR_MALLOC() should not be freed
with free().  r=mkaply.  a=mkaply for Mozilla 1.7 final.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154238 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-25 02:17:55 +00:00
wchang0222%aol.com
6d326b5978 Bugzilla bug 237870: we figured out how to link the MinGW build against
wsock32.dll (Winsock 1) instead of ws2_32.dll (Winsock 2).  r=cls.
a=dbaron for mozilla 1.7 final.
Modified Files:
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
	pr/src/Makefile.in pr/src/io/prmapopt.c pr/tests/Makefile.in


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@154168 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-23 00:40:17 +00:00
darin%meer.net
77dc0da384 fixes bug 209814 "PR_dtoa blows up when executed on an ARM platform" patch by wtc r=darin a=brendan
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153903 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-12 07:30:50 +00:00
seawood%netscape.com
fb273e7698 Update openbsd support for openbsd >= 3.4
Thanks to Peter Strömberg <wilfried@spamcop.net> for pulling these patches out of openbsd's ports tree.
Bug #236599 r=cls sr=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153833 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-10 07:51:37 +00:00
darin%meer.net
f7c4efb1d3 landing patch for bug 236879 "PR_LocalTimeParameters should also check for values that are too small for 32-bit time_t." patch by wtc, r=darin
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153784 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-09 23:39:15 +00:00
darin%meer.net
93da5e092f landing patch for bug 231849 "[BEOS] Network optimizations from UNIX" patch by thesuckiestemail@yahoo.se r=wtc,darin
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153783 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-09 23:36:39 +00:00
seawood%netscape.com
17812d576e Update openbsd support for openbsd >= 3.4
Thanks to Peter Strömberg <wilfried@spamcop.net> for pulling these patches out of openbsd's ports tree.
Bug #236599 r=cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153782 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-09 23:36:25 +00:00
wchang0222%aol.com
83a3162e53 Bugzilla bug 232742: added Linux/amd64 support. The patch came from Gentoo
Linux's portage and was sent by Henrik Lynggaard Hansen
<admin@mozillatranslator.org>.  r=wtc.
Modified Files: configure configure.in prprf.c _linux.cfg linux.h
Added Files: os_Linux_x86_64.s
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153723 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-09 03:18:20 +00:00
(no author)
fe7992e9ed This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153722 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-09 03:10:33 +00:00
wchang0222%aol.com
4915093a67 Bugzilla bug 200162: pass 0 as the third and fourth arguments to sem_open
to work around a bug in sem_open on HP-UX 11.23 or earlier.  The patch is
contributed by Grace Lu of HP.  r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153716 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-09 01:43:11 +00:00
wchang0222%aol.com
63672d6234 Bugzilla bug 186547: fixed compiler warnings. r=darin.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@153554 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-05 01:48:16 +00:00
wchang0222%aol.com
868371d7f8 Bugzilla bug 224161: fixed a regression that was introduced in the fix
for this bug.  There was a missing '$' and the incorrect use of () around
variable names.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@152458 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-07 06:30:28 +00:00
wchang0222%aol.com
db3e5d4a22 Bugzilla bug 231195: fixed the crash in PR_LogCleanup if NSPR_LOG_FILE is
set to WinDebug.  Thanks to timeless@bemail.org for the patch. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@152372 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-05 15:56:22 +00:00
wchang0222%aol.com
93d3d4933d Bugzilla bug 232120: added support for NetBSD's pthread library. The
patch is contributed by Shin'ichiro TAYA <taya@netbsd.org>. r=wtc.
Modified Files: configure configure.in ptio.c
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@152263 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-04 01:31:33 +00:00
wchang0222%aol.com
310a50d006 Bugzilla bug 231504: made --disable-strip work. r=bryner.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@152048 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-29 22:38:48 +00:00
wchang0222%aol.com
aace878723 Bugzilla bug 224161: added support for Mac OS X Panther SDK. We assume
that NEXT_ROOT is set in the environment.  The patch is contributed by
Mike Pinkerton <pinkerton@aol.net>. r=wtc.
Modified Files: configure configure.in pr/src/linking/Makefile.in
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@151971 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-28 21:06:56 +00:00
wchang0222%aol.com
f3508d4a42 Bugzilla bug 232226: use the -bnortllib linker flag when building AIX
shared libraries so that they do not include a reference to the run time
linker library - only the main program needs to have a reference to the
run-time linker library.  The patch is contributed by Philip K. Warren
<pkw@us.ibm.com>. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@151921 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-27 23:06:34 +00:00
wchang0222%aol.com
8655cb3df5 Bugzilla bug 231786: extended PR_GetAddrInfoByName to support PR_AF_INET.
The patch is contributed by John G. Myers <jgmyers@speakeasy.net>. r=wtc
and darin.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@151717 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-22 22:22:37 +00:00
wchang0222%aol.com
cf40a788d8 Bugzilla bug 230837: define the _MD_INIT_CONTEXT macro correctly -- it
needs to set *status to PR_TRUE.  The patch is contributed by
timeless@bemail.org.  r=wtc.
Modified Files: _os2.h _solaris.h _win95.h
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@151596 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-20 21:19:38 +00:00
wchang0222%aol.com
dbbbf3b91a Bugzilla bug 228899: pass the RTLD_MEMBER flag to dlopen on AIX so that we
can load a shared library that is a member of an archive. The patch was
contributed by Michael Lew <mlew@us.ibm.com>. r=wtc.
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@151593 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-20 19:46:21 +00:00
wchang0222%aol.com
74d5d58a56 Bugzilla bug 222037: we need to adjust the address family field of
PRNetAddr on return from getpeername.  The patch is contributed by
Fredrik Holmqvist <thesuckiestemail@yahoo.se>.  r=wtc,darin.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@151011 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-08 02:32:04 +00:00
wchang0222%aol.com
d96ace1761 Checked in Neutrino (NTO) changes received from Adrian Mardare
<amardare@qnx.com>.  r=wtc.
Modified Files: _nto.h pr/tests/Makefile.in
 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@150912 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-06 02:00:05 +00:00
wchang0222%aol.com
89607cc893 Synched up the NSPRPUB_PRE_4_2_CLIENT_BRANCH with the tip.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@150659 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-23 05:18:10 +00:00
wchang0222%aol.com
6b10a12705 Bugzilla bug 228621: regenerated this file with the correct version of
autoconf.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@150353 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-16 05:33:16 +00:00
wchang0222%aol.com
c6250b3de4 Bugzilla bug 226470: use a C compiler rather than a C++ compiler to compile
C code.  Removed -qarch=com, which is the default for the compiler now.
This patch is contributed by Philip K. Warren <pkw@us.ibm.com>. a=mkaply
for Mozilla 1.6.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@150328 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-15 19:58:56 +00:00
darin%meer.net
8a36f4be54 fixes bug 222031 "OSX getaddrinfo returns concatenated results from /etc/hosts and DNS, which breaks /etc/hosts based ad blocking" r=wtc a=dbaron
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@149792 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-27 01:30:44 +00:00
darin%meer.net
c7506c1f9c fixes bug 216021 "chekesp error if i link against a msvcrt that is built with strict calling rules" patch=wtc r=darin
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@149490 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-18 09:49:40 +00:00
darin%meer.net
1f893f82e2 fixes bug 226022 "overflow error in PR_Poll means timeout < 1 second returns too quickly" patch=brofield@jellycan.com r=wtc,darin
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@149487 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-18 06:18:56 +00:00
wchang0222%aol.com
f5bd95c682 Bugzilla bug 219913: define _PR_HAVE_THREADSAFE_GETHOST for OS/2 so that
we can issue concurrent gethostbyname calls.  Moved the definition of
_PR_GLOBAL_THREADS_ONLY, BSD_SELECT, and TCPV40HDRS from configure.in to
_os2.h.
Modified Files: configure configure.in _os2.h
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@149387 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-16 01:09:06 +00:00
wchang0222%aol.com
15eb2b8902 Brought the NSPRPUB_PRE_4_2_CLIENT_BRANCH in sync with the tip.
Modified Files: os_Linux_x86.s solaris.c prtime.c pr/tests/Makefile.in
  runtests.ksh runtests.sh
Added File: pr/tests/formattm.c


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@149386 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-16 00:52:16 +00:00
wchang0222%aol.com
92368c63ad Bugzilla bug 224707: added Linux HPPA support. The patch came from the
Debian Mozilla package (maintainer is Takuo KITAME <kitame@debian.org>).
Modified Files: _linux.cfg _linux.h
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@149382 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-16 00:02:34 +00:00
wchang0222%aol.com
045fdb079f Bugzilla bug 207803: added 64-bit UltraSPARC FreeBSD support to NSPR. The
patch was contributed by Joe Marcus Clarke <marcus@freebsd.org>, Thomas
Moestl <tmm@FreeBSD.org>, and Kris Kennaway <kris@freebsd.org>.  r=wtc.
Modified Files: configure configure.in _freebsd.cfg _freebsd.h
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@149379 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-15 23:36:13 +00:00
wchang0222%aol.com
8bbaf003ae Bugzilla bug 225260: link NSPR dynamic shared libraries with the
-headerpad_max_install_names option. sr=fraser.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@149227 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-13 02:09:43 +00:00
darin%meer.net
e8bafa7770 fixes bug 223811 "getaddrinfo returns 3 addrinfo structs for each IP address
[was: very long timeout for retrying IPv6 to IPv4 addresses]" r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@148643 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-31 05:09:29 +00:00
(no author)
3791842d0e This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@148336 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-24 01:34:29 +00:00
wchang0222%aol.com
32586d6b9c Bugzilla bug 179828: released plarena.h and plarena.c under the
MPL/GPL/LGPL tri-license. r=gerv,wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@148116 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-19 00:12:56 +00:00
wchang0222%aol.com
4f5134446e Bugzilla bug 221385: we need to set tm_zone and tm_gmtoff on FreeBSD, too.
The patch is contributed by Tai-hwa Liang <fk9cs702@sneakemail.com>. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@147916 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-13 19:42:08 +00:00
wchang0222%aol.com
d3ee1a7338 Bugzilla bug 221124: declare variables with const. Thanks to
timeless@bemail.org for the patch.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@147779 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-09 01:35:19 +00:00
darin%meer.net
26bc65991e fixes bug 220020 "PR_EnumerateAddrInfo should not special case port 0" r=wtc
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@147172 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-23 17:47:44 +00:00
wtc%netscape.com
afe26a0c33 Removed all obsolete <OS>.mk files, which have been replaced by the
configure script.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@147016 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-18 02:18:08 +00:00
wtc%netscape.com
981ad7250f Bugzilla bug 208973: removed obsolete Mac classic CFM build files.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@147014 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-18 02:03:57 +00:00
wtc%netscape.com
1a0fc5aec1 Bugzilla bug 219487: fixed build failure on OpenVMS. struct addrinfo is
defined in <netdb.h>.  We use AI_CANONNAME, a macro to be used with struct
addrinfo, to detect that.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@147008 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-18 00:45:28 +00:00
wtc%netscape.com
fdf180c1ad Bugzilla bug 219061: fixed build failure on OSF1. struct addrinfo is
defined in <netdb.h> on recent Tru64 Unix releases.  We use AI_CANONNAME,
a macro to be used with struct addrinfo, to detect that.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@147001 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-17 20:25:20 +00:00
wtc%netscape.com
8e831ed2bb Bugzilla bug 218967: do not initialize unsigned chars with character
constants '\ddd' where ddd is an octal number larger than 127 (decimal).
Such character constants have negative integer values if 'char' is signed.
Thanks to timeless@bemail.org for the bug report and a suggested fix.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146997 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-17 19:10:19 +00:00
wtc%netscape.com
b093557f03 Bugzilla bug 124958: the pthread priority range is 0-31 on OpenBSD.
The patch is contributed by Mats Palmgren <mats.palmgren@bredband.net>.
r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146963 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-16 20:44:04 +00:00
wtc%netscape.com
027ccbe011 Bugzilla bug 215581: checked in the rest of the GCC 3.2.2 for OS/2 changes
from Javier Pedemonte <pedemont@us.ibm.com>.
Modified Files: prio.h prtypes.h os2misc.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146961 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-16 20:30:38 +00:00
wtc%netscape.com
1cc3cc054d White space change to force the Mozilla tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146944 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-16 02:02:39 +00:00
wtc%netscape.com
adec8f2404 Bugzilla bug 215581: build with GCC 3.2.2 for OS/2. The patch is
contributed by Javier Pedemonte <pedemont@us.ibm.com>. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146943 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-16 02:01:24 +00:00
(no author)
d1378c4215 This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146942 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-16 01:58:04 +00:00
wtc%netscape.com
d7dd147b4a Bugzilla bug 124958: Checked in OpenBSD changes from Mats Palmgren
<mats.palmgren@bredband.net>.  Added support for 64-bit SPARC v9, ELF
objects, etc.
Modified Files: _openbsd.cfg prlink.c prnetdb.c prtime.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146937 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-16 00:11:51 +00:00
seawood%netscape.com
af00a0a644 When calling windres, use a temp file to work around resouce issues.
Bug #213281 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146889 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-15 03:46:47 +00:00
wtc%netscape.com
222f1f0dbb White space change to force the Mozilla tinderboxes to rebuild.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146832 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-13 15:01:41 +00:00
wtc%netscape.com
a2fc2deb74 fix mingw/vc7 bustage
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146831 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-13 15:00:35 +00:00
wtc%netscape.com
1000681e01 Brought the NSPRPUB_PRE_4_2_CLIENT_BRANCH in synch with the tip.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146829 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-13 14:57:06 +00:00
wtc%netscape.com
bee5f69221 Bugzilla bug 219104: handle sockaddr structures that have a sa_len field.
That field should not be copied to PRNetAddr's.  The patch is contributed
by David Baron <dbaron@mozilla.org>. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146827 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-13 13:37:46 +00:00
darin%meer.net
5a7bf8167a fix mingw/vc7 bustage
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146806 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-12 06:22:45 +00:00
wtc%netscape.com
0e52a7e128 A white space change to force the Mozilla tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146794 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-11 18:49:47 +00:00
wtc%netscape.com
ee0d7e4ebb Use the current PR_GetAddrInfoByName prototype.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146791 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-11 18:28:33 +00:00
wtc%netscape.com
05950f1341 Define _PR_INET6 on Solaris 8 or higher because they have IPv6.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146790 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-11 18:17:41 +00:00
wtc%netscape.com
bfabe8de67 Set NSPR version to 4.5 Beta.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146787 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-11 17:51:37 +00:00
wtc%netscape.com
0f4dd23df0 Bugzilla bug 158240: fixed a crash on startup if NSPR_LOG_FILE is set on
BeOS.  The patch is contributed by arougthopher@lizardland.net (Paul).
r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146786 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-11 17:46:22 +00:00
darin%meer.net
c6d06c774e patch for bug 211501 "NSPR should provide getaddrinfo" r=wtc
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146780 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-11 17:25:05 +00:00
wtc%netscape.com
9fec46d2cd Bugzilla bug 217501: specify the standard AIX libpath (/usr/lib:/lib) when
building NSPR libraries, otherwise the path passed to the -L linker flag
is added to the head the libpath.  The patch is contributed by Philip K.
Warren <pkw@us.ibm.com>. r=wtc. a=asa for checkin to Mozilla 1.5.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@146453 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-30 00:18:18 +00:00
seawood%netscape.com
40237764dc Avoid pulling in libdl on OSX.
Thanks to Josh Soref <timeless@bemail.org> for the patch.
Bug #212708 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@144928 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-17 23:13:39 +00:00
wtc%netscape.com
75f7e3bfad Bug 212566: _pr_ipv6_v6only_on_by_default needs to be defined for DARWIN
under all cases, not just when _PR_INET6_PROBE is defined, because
_PR_INET6_PROBE is only defined when Mac OS X deployment target is 10.1.
Bug 211512: defined IPV6_V6ONLY if it's not defined so that we can build on
Mac OS X 10.1, where this macro is not defined.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@144855 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-14 21:59:47 +00:00
wtc%netscape.com
019261e16d Bug 126937: implement PR_GetSysfdTableMax and PR_SetSysfdTableSize for
OS/2.  The patch is contributed by Michael Kaply <mkaply@us.ibm.com>.
r=pedemont.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@144627 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-09 04:53:36 +00:00
wtc%netscape.com
dfe8b15f81 Bug 211512: worked around Mac OS X Panther Beta's bug that the IPV6_V6ONLY
socket option is turned on by default.  r=bryner.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@144619 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-09 03:37:46 +00:00
seawood%netscape.com
ffc1bab3b9 Use standard __declspec keyword instead of _declspec.
Bug #202826 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@144149 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-25 14:49:44 +00:00
wtc%netscape.com
2b68314308 Bug 207614: fixed the way prcpucfg.h is created on OpenVMS so that its
modified time doesn't get updated whenever we do "gmake export".
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@143406 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-06 21:30:55 +00:00
wtc%netscape.com
082af0c094 Bug 207421: use /Op to disable some floating-point optimizations of MSVC
6.0 Processor Pack because they make the floating-point calculations in
prdtoa.c produce incorrect results.  r=cls.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@143378 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-06 03:09:17 +00:00
wtc%netscape.com
d11519dcbc Bug 206815: fixed a benign UMR in the PR_Poll implementations based on
poll().  We should initialize the events field of the pollfd structure
when we set the fd field to -1 even though the events field is ignored
if the fd field is negative.
Modified Files: ptio.c uxpoll.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@142872 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-23 22:42:21 +00:00
wtc%netscape.com
60455a4e55 Bug 204092: build NSPR on Solaris with -xO4 optimization. a=dbaron for
mozilla 1.4 final.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@142617 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-19 19:05:48 +00:00
wtc%netscape.com
69f0d3eaa8 Bug 205582: map EHOSTUNREACH to PR_HOST_UNREACHABLE_ERROR on Unix. r=darin.
a=asa (on behalf of drivers) for checkin to mozilla 1.4.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@142450 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-14 21:44:13 +00:00
wtc%netscape.com
d516d9cf76 Bug 200335: need to cast pthread_t (which could be a pointer) to an
unsigned type (PRUptrdiff).  The patch is contributed by Nelson Bolyard.
(This code path is not used by Mozilla.)
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@142449 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-14 21:43:04 +00:00
wtc%netscape.com
0227aec339 Set NSPR version to 4.4 Beta.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@142448 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-14 21:42:04 +00:00
wtc%netscape.com
dbf8087d0a Explain how the GOLDEN_RATIO constant was calculated. (Added a comment.)
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@142447 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-14 21:41:24 +00:00
wtc%netscape.com
08bd123549 Use NSPR_4_3_RTM instead of NSPR_4_3_RELEASE. I decided to follow NSS's
cvs tag naming convention.  (This file is not used by the Mozilla client.)
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@142446 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-14 21:39:35 +00:00
wtc%netscape.com
9ef1f352e5 Bug 203317: getipnodebyxxx routines are not thread-safe on OpenVMS, so we
need to lock around them.  The patch is contributed by Colin Blake
<colin@theblakes.com>.  r=wtc. a=dbaron for mozilla 1.4b.
Modified Files: configure configure.in prnetdb.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@141955 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-30 00:36:39 +00:00
seawood%netscape.com
10c00e4718 Change mksnt* checks to mks*
Bug #202598 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@141430 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-19 01:30:11 +00:00
seawood%netscape.com
620270ca62 Fix x86 checks so that they work for xeon processors
Bug #199343 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@141402 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-18 19:10:26 +00:00
wtc%netscape.com
6d5f7408b2 Bug 104529: on OS/2, when writing to the command-line console, we must
write \r\n to go to a new line. So we need to translate \n to \r\n. The
patch is contributed by Julien Pierre.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@141385 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-18 14:00:56 +00:00
seawood%netscape.com
1cc5b0a657 Sync config.guess & config.sub with official GNU copies.
Bug #199343


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@141371 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-18 10:20:22 +00:00
mkaply%us.ibm.com
6dc81e054c #201555
r=seawood
OS/2 only - don't put debug info in files when linking


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@141230 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-16 03:04:28 +00:00
wtc%netscape.com
78195ea2b8 Bug 105271: compile source files with absolute pathnames so that the
debuggers can find them automatically.  Currently enabled on Windows and
OS/2 only.  The patch is contributed by Julien Pierre.  r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@141218 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-16 01:16:42 +00:00
wtc%netscape.com
40d4f067a8 Added an empty comment line to cause the mapfile to get rebuilt. This is
to help us debug an OS2VACPP tinderbox problem.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140981 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-10 18:17:12 +00:00
wtc%netscape.com
79d797ca58 Bug 126932: make runtests.{sh,ksh} work on OS/2. Include the header for
getcwd in thrpool_server.c.
Modified Files: runtests.ksh runtests.sh thrpool_server.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140940 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-09 22:29:02 +00:00
wtc%netscape.com
10c097faf1 Bug 190538: checked in again the change that was backed out.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140934 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-09 21:49:39 +00:00
wtc%netscape.com
235237b4b0 Bugzilla 190538: backed out the previous checkin because it broke the OS/2
VACPP tinderbox for Mozilla.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140897 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-09 02:47:59 +00:00
wtc%netscape.com
0e6ccc7865 Bug 200561: cite the bug number in the comment.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140895 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-09 02:19:09 +00:00
wtc%netscape.com
4164dc6a54 Bug 200561: do not include <string.h> in optimized builds for AIX so that
memcpy continued to be exported.  This is to be "bug compatible" with old
libnspr4.so binaries that exported memcpy by accident because we did not
include <string.h> in optimized builds.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140894 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-09 02:14:27 +00:00
wtc%netscape.com
bb84221bd4 Forced Mozilla trunk's tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140893 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-09 01:47:46 +00:00
wtc%netscape.com
f0e54aa68a Bug 190538: use the cross-platform syntax of the *.def files (copied from
NSS) so that they can be used on platforms other than Solaris, and use the
*.def files on OS/2.
Modified Files: rules.mk lib/ds/Makefile.in plds.def
lib/libc/src/Makefile.in plc.def pr/src/Makefile.in nspr.def
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140892 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-09 01:45:55 +00:00
wtc%netscape.com
f6323e7739 Bug 198634: we need to implement PR_DetachThread on the platforms that
don't have a way to detach the foreign threads automatically when they
terminate (e.g., OS/2).  The patch is contributed by Michael Kaply
<mkaply@us.ibm.com>.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140890 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-09 01:34:44 +00:00
wtc%netscape.com
cc3f3e3255 Removed the OS/2 compiler flag /Gx+, which is a C++ only flag.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140736 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-05 01:44:54 +00:00
seawood%netscape.com
b14684f905 Add PR_GetPathSeparator function.
Bug #171883 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140674 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-04 04:49:02 +00:00
seawood%netscape.com
cc1269f52f Third time's a charge.
Thanks to danm@netscape.com for the patch.
Bug #158920


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140607 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-02 23:22:41 +00:00
seawood%netscape.com
0782d90451 'mount -p' can return multiple mount points. Use the first one.
Bug #158920 r=sspitzer


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140595 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-02 20:48:13 +00:00
seawood%netscape.com
096dcdef3f Use 'mount -' to get cygdrive mountpoint rather than assuming /cygdrive.
Bug #158920 r=bryner


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140566 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-02 06:23:01 +00:00
seawood%netscape.com
3f82d3744f Turn off optimizations for prprf.c on OS/2 to avoid PR_snprintf problem.
Thanks to Michael Kaply <mkaply@us.ibm.com> for the patch.
Bug #199901 r=wtc a=asa


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140476 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-01 04:06:17 +00:00
wtc%netscape.com
bf2f181728 Bug 188246: support OS/2.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140321 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-26 01:46:52 +00:00
wtc%netscape.com
9366bffc3c Bug 188246: support building NSPR with gcc 3.x on OS/2. also fixed the
tests.  The patch is contributed by Javier Pedemonte <pedemont@us.ibm.com>.
Modified Files: configure configure.in rules.mk lib/ds/Makefile.in
lib/libc/src/Makefile.in _os2.h pr/src/Makefile.in prlink.c
pr/src/md/os2/Makefile.in pr/src/md/os2/objs.mk os2cv.c os2misc.c
os2poll.c os2sock.c os2thred.c pr/tests/Makefile.in attach.c runtests.sh
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
Added Files: os2emx.s


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140318 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-26 01:36:20 +00:00
wtc%netscape.com
906d727edb Cause Mozilla trunk Tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140079 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-22 19:27:59 +00:00
wtc%netscape.com
1d634dce4c Bug 196004: support building with gcc on Solaris better, whether gcc uses
the GNU ld or Solaris ld. Do not pass -B/usr/ccs/bin/ to gcc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
Modified files: configure configure.in autoconf.mk.in
	lib/ds/Makefile.in lib/libc/src/Makefile.in pr/src/Makefile.in


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140065 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-22 15:28:58 +00:00
wtc%netscape.com
8122c1051b Bug 198634: fixes to OS/2 threading code. The patch is contributed by
Javier Pedemonte <pedemont@us.ibm.com>. r=mkaply. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
Modified files: _os2.h primpl.h os2thred.c


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140061 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-22 14:55:26 +00:00
wtc%netscape.com
e893d35bcf Do not use cygwin-wrapper if we are using MKS Korn Shell. We determine
whether we are using MKS Korn shell by searching for semicolons (;) in the
PATH.  Actually cygwin-wrapper works under MKS Korn shell, but it suddenly
stopped working on our Windows NT build machine recently, and I can't
figure out why.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@140006 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-22 01:10:13 +00:00
wtc%netscape.com
041be16a63 Bug 195411: added the LL_MaxUint function and the LL_MAXUINT macro.
Modified Files: prlong.h nspr.def nspr_symvec.opt openvms.c prlong.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138830 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-04 02:10:13 +00:00
wtc%netscape.com
9af1b56c99 Bug 192797: improved the implementation of PR_Poll for Win32. Increase
FD_SETSIZE from the default 64 to 1024.  Make PR_Poll fail with
PR_INVALID_ARGUMENT_ERROR if we try to add more than FD_SETSIZE fd's to a
fd_set.  Do not pass an empty fd_set to select, and do not call select if
all three fd_sets are empty.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138682 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-28 03:45:27 +00:00
wtc%netscape.com
29fc2c4ab0 Bug 164841: use high performance timers (again) on OS/2.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138675 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-28 02:44:25 +00:00
wtc%netscape.com
cd38ae7657 Added a comment.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138670 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-28 02:23:15 +00:00
wtc%netscape.com
6f0aa11d91 Renamed MOD_REVISION_VERSION to MOD_PATCH_VERSION.
Modified Files: configure configure.in autoconf.mk.in nspr-config.in
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138669 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-28 01:52:53 +00:00
wtc%netscape.com
65752586a8 Removed obsolete PR_CLIENT_BUILD and PR_CLIENT_BUILD_UNIX make variables.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138595 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-27 04:11:09 +00:00
wtc%netscape.com
c79b2f00b5 Removed unused file module.df.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138594 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-27 03:30:51 +00:00
wtc%netscape.com
5c4c7fcea4 Bug 191948: a better implementation of PR_GetLibraryFilePathname for 32-bit
HP-UX.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138592 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-27 03:23:00 +00:00
wtc%netscape.com
107927eed1 Bug 191703: if struct tm has the nonstandard tm_zone and tm_gmtoff fields,
set them to the appropriate values.  Calling mktime is not really correct
(it assumes the local time zone) and does not work on NetBSD.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138562 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-27 00:01:02 +00:00
wtc%netscape.com
12fbcdc731 Bug 191270: added the ability to load a dynamic shared library (.dylib) on
Mac OS X. passed the XXX_RETURN_ON_ERROR flags to several Mac OS X
linker functions.  Correctly handle the return value of NSUnLinkModule.
Pass NSADDIMAGE_OPTION_WITH_SEARCHING to NSAddImage.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138561 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-26 23:57:47 +00:00
wtc%netscape.com
1b14acdf07 Sync up the NSPRPUB_PRE_4_2_CLIENT_BRANCH with the trunk.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138558 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-26 23:53:44 +00:00
wtc%netscape.com
e488c9e989 Backed out the previous checkin. Just noticed that the Mozilla trunk is
closed right now.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138543 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-26 15:21:16 +00:00
wtc%netscape.com
18122b96e4 Sync up the NSPRPUB_PRE_4_2_CLIENT_BRANCH with the trunk.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138540 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-26 15:10:16 +00:00
wtc%netscape.com
10c9729981 Added to NSPRPUB_PRE_4_2_CLIENT_BRANCH.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138518 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-26 06:17:32 +00:00
wtc%netscape.com
fe37f9da99 Bug 193380: added IPv6 support on HP-UX 11i or later. Cleaned up the
detection of HP-UX B.11.* in configure.in.
Modified Files: configure.in configure _hpux.h
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138516 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-26 06:09:20 +00:00
seawood%netscape.com
4714f9ce6d Only force the use of absolute symlinks on Darwin when building Mozilla.
Bug #193164 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138487 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-26 00:48:56 +00:00
wtc%netscape.com
5c09a21158 Bug 192015: implemented the PR_GetLibraryFilePathname function for OpenVMS.
The patch is contributed by Colin Blakes <colin@theblakes.com>.
NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138455 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-25 15:47:29 +00:00
wtc%netscape.com
bfd8ebf042 Bug 191823: implement the PR_GetLibraryFilePathname function for OS/2. The
patch is contributed by Julien Pierre <jpierre@netscape.com>.
NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138453 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-25 15:41:01 +00:00
wtc%netscape.com
b976bf1590 Bug 193007: export PR_CreateThread and PR_SetError and new NSPR 4.3
symbols.  Added stubs so that PR_CreateThread ended up in its old position.
The patch is contributed by Colin Blakes <colin@theblakes.com>.
Modified Files: nspr_symvec.opt md/unix/openvms.c
NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138449 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-25 15:21:14 +00:00
wtc%netscape.com
b7006c1c72 Bug 186745: Use the BSD getifaddrs() function to query the presence of
IPv4 and IPv6 network interfaces on NetBSD.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138447 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-25 15:08:45 +00:00
wtc%netscape.com
d58a5a025a Bug 194298: inherit from the shell instead of the parent. The patch is
contributed by Michael Kaply <mkaply@us.ibm.com>.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138389 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-24 22:48:22 +00:00
seawood%netscape.com
ed03fa0b40 Default to using absolute symlinks when building on Darwin.
Bug #193164 r=ccarlen


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138296 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-23 15:54:21 +00:00
wtc%netscape.com
a252d5100e Backed out the previous checkin. Mozilla Tinderbox is failing a test. I
just wanted to rule out the previous checkin as a possible cause.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138257 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-23 02:38:14 +00:00
wtc%netscape.com
3c53b48888 Bug 191270: added the ability to load a dynamic shared library (.dylib) on
Mac OS X.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138247 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-23 00:30:35 +00:00
wtc%netscape.com
634c38511a Bug 186745: on FreeBSD, use the getifaddrs function to query the presence
of IPv4 and IPv6 network interfaces.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138239 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-22 22:50:13 +00:00
wtc%netscape.com
a831031ce8 Bug 192589: added a comment explaining what the bug fix does.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138231 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-22 20:30:57 +00:00
wtc%netscape.com
832b5c951b Bug 192589: keep querying the presence of IPv4 and IPv6 interfaces until
at least one is up.  This allows us to detect the local machine going from
offline to online.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138227 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-22 20:09:40 +00:00
wtc%netscape.com
296789b515 Cause Mozilla trunk Tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138190 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-22 15:09:28 +00:00
wtc%netscape.com
bbc917ac2c Bug 193969: implemented atomic routines for Darwin PPC in assembly.
Changed old name "Rhapsody" to new name "Darwin".
Modified files: configure configure.in _darwin.h darwin.c
Added file: os_Darwin_ppc.s
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138189 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-22 15:08:29 +00:00
(no author)
062ca8ed3b This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@138188 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-22 15:00:14 +00:00
wtc%netscape.com
62cf5416ed Removed the temporary fix in the previous checkin.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136708 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-21 02:02:21 +00:00
wtc%netscape.com
b35deed636 Temporary fix for Mozilla trunk tinderbox build bustage on Linux. Will
remove this temporary fix after I figure out how to cause
pr/src/linking/Makefile to be regenerated.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136700 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-20 21:26:01 +00:00
wtc%netscape.com
a6d5401310 Bug 188439: fixed a bug in the PR_Poll implementation for
_PR_POLL_WITH_SELECT.  We could still call FD_SET if the osfd was larger
than FD_SETSIZE.  Fixed the bug that _PR_POLL_WITH_SELECT was defined after
the system header files had been included.  Need to define it on the
compile command line.  Define _USE_BIG_FDS on HP-UX.  Because that macro
increases the size of fd_set to about 7500 bytes and PR_Poll allocates 3
fd_sets on the stack, also increased the minimum thread stack size to 128KB
on HP-UX.
Modified Files: configure configure.in _hpux.h _osf1.h ptio.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136697 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-20 20:50:00 +00:00
wtc%netscape.com
8f30a69328 Forced the Mozilla trunk tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136695 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-20 20:14:09 +00:00
wtc%netscape.com
c5778af528 Bug 185687: added PR_CallOnceWithArg, a version of PR_CallOnce that allows
the callers to pass an argument to the call-once function.
Modified files: prinit.h nspr.def prinit.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136694 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-20 20:13:09 +00:00
wtc%netscape.com
31556c8c66 Bug 189332: Implemented the new function PR_GetLibraryFilePathname for
AIX, HP-UX, Linux, Mac OS X, OSF1, Solaris, and Windows.  Added the new
error code PR_LIBRARY_NOT_LOADED_ERROR for the error condition that the
library specified by "name" and "addr" is not loaded.  Added a new test,
libfilename.c.  Extended the PR_GetLibraryName function to not prepend any
directory if the first argument "dir" is NULL.  The OSF1 implementation was
contributed by Steve Streeter <Stephen.Streeter@hp.com>.
Modified files: prerr.h prlink.h nspr.def pr/src/linking/Makefile.in
prlink.c compile-et.pl prerr.c prerr.et prerr.properties
pr/tests/Makefile.in runtests.ksh runtests.sh
Added file: pr/tests/libfilename.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136693 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-20 20:10:39 +00:00
wtc%netscape.com
f1caca8f28 Bug 80082: need to install libnspr_flt4.so in dist/bin too, for the Mozilla
client.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136683 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-20 16:32:06 +00:00
wtc%netscape.com
b68777bb04 Forced the Mozilla trunk tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136677 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-20 16:02:42 +00:00
wtc%netscape.com
b7222a640f Bug 134113: make NSPR build on Win32 using MinGW gcc. The patch is
contributed by Chris Seawood <seawood@cls.org> and Dan Mosedale
<dmose@mozilla.org>. r=wtc.
Modified files: configure configure.in config/Makefile.in autoconf.mk.in
now.c rules.mk lib/ds/Makefile.in lib/libc/src/Makefile.in
lib/msgc/src/Makefile.in prtypes.h _winnt.h pr/src/Makefile.in prmapopt.c
pr/src/md/windows/Makefile.in ntio.c ntmisc.c pr/tests/Makefile.in
runtests.ksh pr/tests/dll/Makefile.in
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136676 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-20 16:01:40 +00:00
(no author)
83b20196fd This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136466 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-17 01:03:48 +00:00
wtc%netscape.com
0e5e179ac0 Forced the Mozilla trunk tinderbox to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136463 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-17 00:47:58 +00:00
wtc%netscape.com
aa0d3878b0 Bug 168228: added IPv6 support for Darwin (Mac OS X). Added two new
feature macros _PR_HAVE_INET_NTOP and _PR_GHBA_DISALLOW_V4MAPPED to
handle the differences of Darwin's IPv6 sockets implementation and
other platforms' implementations.
Modified files: _aix.h _bsdi.h _darwin.h _freebsd.h _irix.h _linux.h
_netbsd.h _openvms.h _osf1.h _solaris.h prnetdb.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136452 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-16 23:09:16 +00:00
wtc%netscape.com
ff918e3023 MACOS_DEPLOYMENT_TARGET only needs to be defined if we are building on
Mac OS X.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136353 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-15 01:45:37 +00:00
wtc%netscape.com
eff44aeb09 Bug 185034: updated the OpenVMS symbol vector tables for NSPR 4.3.
The patch is contributed by Colin Blake <colin@theblakes.com>.
Modified Files: nspr_symvec.opt plds_symvec.opt plc_symvec.opt
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136346 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-14 23:59:31 +00:00
wtc%netscape.com
2b3edd51c5 Bug 186599: 1. added support for relative paths to PR_LoadLibrary on
Mac OS X. 2. Reordered the Mac code in pr_LoadLibraryByPathName to try
loading various kinds of shared libraries in the order of most likely
success.  The patch is contributed by Conrad Carlen <ccarlen@netscape.com>.
r=wtc. sr=sfraser.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136341 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-14 23:27:27 +00:00
wtc%netscape.com
e802099f75 Bug 188396: don't use ftime because its 32-bit timestamp will overflow
around year 2038.  Use GetSystemTimeAsFileTime instead.  The patch is
contributed by timeless@bemail.org.
Modified files: config/now.c _win95.h _winnt.h ntio.c ntmisc.c w95io.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136306 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-14 13:24:12 +00:00
wtc%netscape.com
b4911cc67f Bug 188976: avoid calculating the difference of two unsigned integer if
the difference is really a negative number.  Thanks to Rick Swift for the
patch.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136283 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-14 02:08:09 +00:00
wtc%netscape.com
5476ffbf2e 1. Use $(CC) (the compiler) to build shared libraries on Solaris. Added
the -z defs linker flag back.
Modified files: configure configure.in lib/ds/Makefile.in
lib/libc/src/Makefile.in pr/src/Makefile.in
2. Let pr/src/md/unix/Makefile.in be responsible for removing the
pr/src/cpu directory because it creates that directory.  Note that the
'clean' target does not remove the directory because it doesn't remove
the .so's either.
Modified files: pr/src/Makefile.in, pr/src/md/unix/Makefile.in
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@136042 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-09 01:16:01 +00:00
wtc%netscape.com
420220bbfc Forced Mozilla trunk tinderbox to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135973 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-08 03:34:09 +00:00
wtc%netscape.com
4d70379b09 The PTDebug type doesn't need to be defined in optimized builds.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135972 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-08 03:31:24 +00:00
wtc%netscape.com
e51927c7f5 A temporary fix for the Solaris gcc build. Removed the -z defs linker flag
because gcc-compiled objects reference symbols not defined in -lc.  The
correct fix is to use gcc to build the shared libraries, as we do on Linux.
Modified Files: configure.in configure
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135939 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-07 20:27:07 +00:00
seawood%netscape.com
c1a35027d0 Use quotes instead of angle brackets to fix classic mac bustage.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135937 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-07 19:18:08 +00:00
wtc%netscape.com
b4677c70b5 Forced the Mozilla trunk Tinderboxes to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135935 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-07 15:33:51 +00:00
wtc%netscape.com
b759dc460d Brought the NSPRPUB_PRE_4_2_CLIENT_BRANCH in synch with the NSPR trunk.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135934 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-07 15:30:26 +00:00
(no author)
384a921bde This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135928 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-07 04:52:26 +00:00
wtc%netscape.com
cb99c9a0ac Bug 183907: increase the default and minimum thread stack size to 128K on
AIX because bos.rte.libc 4.3.3.88 includes a fix for a security bug that
greatly increases the amount of stack space used when calling functions
like gethostbyname.  Thanks to Philip K. Warren <pkw@us.ibm.com> for the
fix.  Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135903 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-06 22:16:19 +00:00
wtc%netscape.com
a44c1e9128 Bug 176881: we should also look at the high 32 bits of the performance
counter frequency.  Ignoring the high part of the frequency will cause
our interval timer code to malfunction if the high part is not zero.
Also took the opportunity to simplify the arithmetics.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135171 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-12 14:55:55 +00:00
wtc%netscape.com
aa4dc0f434 Bug 180293: moved the OpenVMS build from the POSIX subsystem to native VMS
(GNV).  The patch is contributed by Colin Blakes <colin@theblakes.com>.
Modified Files: configure configure.in rules.mk pr/include/md/Makefile
        openvms.c
Added Files: plds_symvec.opt plc_symvec.opt nspr_symvec.opt
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135158 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-12 01:47:51 +00:00
(no author)
fbb4e7e5b8 This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135157 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-12 01:41:32 +00:00
wtc%netscape.com
1aec53be0d Bug 180293: ported nsinstall.c to native VMS (GNV) environment. The patch
is contributed by Colin Blakes <colin@theblakes.com>. r=brendan.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135152 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-12 00:29:08 +00:00
wtc%netscape.com
f137052ff5 Bug 175423: fixed the problems pointed out by gcc's -pedantic-errors flag.
Modified files: prwin16.h unix.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135149 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-12 00:19:57 +00:00
seawood%netscape.com
5d97bbe8b3 Add $(LDFLAGS) to the local nsinstall link command.
Bug #88283 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135147 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-12 00:13:46 +00:00
seawood%netscape.com
ad99147281 Fix CFData memory leak.
Bug #131306 r=beard


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@135110 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-11 05:05:42 +00:00
wtc%netscape.com
4e48c1131c Bug 162358: added NSPR file I/O functions that take UTF16 pathnames. The
patch is contributed by Roy Yokoyama <yokoyama@netscape.com>.
Modified Files: config/config.mk prio.h prtypes.h _win95.h primpl.h
                prdir.c prfile.c w95io.c ptio.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@134522 18797224-902f-48f8-a5cc-f745e15eee43
2002-11-27 03:08:35 +00:00
seawood%netscape.com
659b8e4810 Fix egrep syntax.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@134364 18797224-902f-48f8-a5cc-f745e15eee43
2002-11-23 09:43:37 +00:00
seawood%netscape.com
ff10d201e1 Properly detect OS_ARCH when building on Win32 ME.
Bug #180822 r=dmose,wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@134360 18797224-902f-48f8-a5cc-f745e15eee43
2002-11-23 05:57:40 +00:00
seawood%netscape.com
5ceeac481a Remove $(CONFIG) from real_install target. It was a typo anyway.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@133467 18797224-902f-48f8-a5cc-f745e15eee43
2002-11-09 09:23:31 +00:00
seawood%netscape.com
3167cff0e0 Add CFM, CFBundle and mach-o library loading support to OSX NSPR. Support is only available if the carbon toolkit is detected at build time.
Original patch by Patrick Beard <beard@netscape.com> with modifications by Wan-Teh Chang <wtc@netscape.com>.
Bug #131306 r=cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@133051 18797224-902f-48f8-a5cc-f745e15eee43
2002-11-06 00:54:56 +00:00
wtc%netscape.com
3e1cfd4175 Bug 176543: handle the case of invoking a program wit no arguments. The
command line should be an empty string in that case.  Initialize newEnvp.
The patch is contributed by Michael Kaply <mkaply@us.ibm.com>.
a=roc+moz for NSPRPUB_PRE_4_2_CLIENT_BRANCH.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@132761 18797224-902f-48f8-a5cc-f745e15eee43
2002-10-31 05:02:05 +00:00
wtc%netscape.com
d91128ff88 Bug 168831: fixed the bug that PR_Poll was ignoring out_flags reported by
the poll methods of I/O layers on the Mac.  This patch was written by
jgmyers and reviewed by sfraser and wtc. a=dbaron for
NSPRPUB_PRE_4_2_CLIENT_BRANCH checkin.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@132524 18797224-902f-48f8-a5cc-f745e15eee43
2002-10-25 12:41:00 +00:00
wtc%netscape.com
b2644e4cae Bug 165602: checked in Brian Ryner's changes to allow Mac OS X 10.2 builds
to run on 10.1.  r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
Modified files: configure configure.in pr/src/misc/prdtoa.c


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@130522 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-26 12:46:29 +00:00
wtc%netscape.com
13b3cd07c5 Bug 168993: PR_Poll should clear out_flags for null fd's. r=jgmyers.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
Modified files: bfile.c os2poll.c uxpoll.c w32poll.c ptio.c


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@130352 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-24 14:21:06 +00:00
wtc%netscape.com
8d382c566d Bug 169569: always use the Solaris ld (/usr/ccs/bin/ld) to link NSPR
shared libraries.  r=cls.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@129982 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-19 00:14:30 +00:00
wtc%netscape.com
29f81d6eb2 Bug 72100: added macros for the maximum and minimum values of PRInt8,
PRUint8, PRInt16, PRUint16, PRInt32, and PRUint32. r=jkeiser.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@129901 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-18 14:20:01 +00:00
wtc%netscape.com
9dcbad4848 Bug 167375: configuration changes needed for building on BSD/OS 5.0.
This patch is contributed by lidl@pix.net.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
Modified files: configure.in configure _bsdi.h


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@129349 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-12 14:53:38 +00:00
wtc%netscape.com
51d87ad4ea Bug 166716: do not assert in the unimplemented memory-mapped file
functions.  It is sufficient for them to fail with the not implemented
error.
Modified Files: bmmap.c macio.c os2misc.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@128931 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-06 01:42:09 +00:00
wtc%netscape.com
68fcb7b043 Dummy change to force the Mozilla tinderbox to rebuild.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@128344 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 14:44:18 +00:00
wtc%netscape.com
bec171cbcd Sync'ed up with the tip.
Modified files: repackage.sh plarena.c prio.h prthread.h _solaris.h
_solaris32.cfg _solaris64.cfg _winnt.h primpl.h prmem.c uxshm.c ntthread.c
prinit.c prnetdb.c prtpool.c ptthread.c prucpu.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@128343 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 14:42:54 +00:00
wtc%netscape.com
d9d45c3ab8 1. Checked in the fix for bug 157241 to enable debugging with gcc/gdb on
Linux with compiler optimizations on.
2. Cleaned up the fix for bug 137059. Replaced MOZ_DEBUG_ENABLE_DEFS by
DEFINES.
3. Backed out portions of the fix for bug 161461 that broke the build under
MKS toolkit.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@127922 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-23 03:13:49 +00:00
seawood%netscape.com
8101327e39 Fix build problem caused by having spaces in the username.
Bug #137059 r=dmose r=mcs


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@126987 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-10 09:02:49 +00:00
seawood%netscape.com
aaada61daa Add compiler test for +Olit=all support for hpux cc.
Bug #146426 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@126929 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-10 01:06:52 +00:00
wtc%netscape.com
8d05252a15 Merged the fix for bug 158396 from the tip (rev. 3.27 and rev. 3.28) to
NSPRPUB_PRE_4_2_CLIENT_BRANCH.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@126860 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-09 01:46:31 +00:00
seawood%netscape.com
6e948e2fd2 Misc build cleanup v1:
Cleanup win32 configure output. Remove EMACS
Bug #161461 r=bryner


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@126802 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-08 21:35:45 +00:00
seawood%netscape.com
6f966da13d Remove explicitly linking against -lc on linux as it could break backwards binary compatibility. Linking using gcc/g++ should automatically link against libc.
Thanks to Franz.Sirl-kernel@lauterbach.com for the patch.
Bug #72766 r=wtc,cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@126659 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-07 11:34:44 +00:00
seawood%netscape.com
7da07a105c Remove explicitly linking against -lc on linux as it could break backwards binary compatibility. Linking using gcc/g++ should automatically link against libc.
Thanks to Franz.Sirl-kernel@lauterbach.com for the patch.
Bug #72766 r=wtc,cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@126658 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-07 11:11:39 +00:00
wtc%netscape.com
e962ef5ac7 Bug 149195: added IPv6 support for IRIX. The patch is contributed by
nickb@adacel.com.au (Nick Blievers).
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@126562 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-07 00:18:01 +00:00
sfraser%netscape.com
462511e1a2 Fix bug 158927 -- controls not drawing correctly in QuickTime plugin. The problem was that the thread scheduling Timer Task would call WakeUpProcess() every time when we are blocked and not servicing NSPR threads (for example when tracking plugin controls). A side effect of this is to prevent Mac OS X from flushing the window back buffers, hence the drawing issues. Fix is to only call WakeUpProcess() if we've been through the scheduler since the last time. r=sdaglye, wtc. a=asa.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125920 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-27 00:56:25 +00:00
wtc%netscape.com
1552e34dcb Dummy white space change to cause Tinderbox to rebuild.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125678 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 05:07:16 +00:00
wtc%netscape.com
fb703b99e4 Bug 153525: backed out the previous checkin because sfraser checked in a
better fix (in ptthread.c).
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125677 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 05:04:58 +00:00
sfraser%netscape.com
5e5c30547e Tidy up the whitespace from the last checkin. Ooops.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125674 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 04:06:42 +00:00
sfraser%netscape.com
98b0e85fc5 Fixing the MachO (DARWIN) build, which broke when wtc checked in a patch in bug 153525. r=bryner.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125673 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 04:06:07 +00:00
wtc%netscape.com
ba6f5bd230 Dummy white space change to cause Tinderbox to rebuild.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125670 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 03:47:54 +00:00
wtc%netscape.com
de533a4e7a Bug 153525: fixed build breakage caused by the previous checkin.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125668 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 03:45:36 +00:00
wtc%netscape.com
0d6b62cf32 Dummy white space change to force the Tinderbox to rebuild.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125656 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 00:03:32 +00:00
wtc%netscape.com
5cc0d15670 Bug 153525: fixed build problems under gcc2 on Mac OS X. r=bryner.
Modified files: _pth.h darwin.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125654 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 00:00:39 +00:00
wtc%netscape.com
9aa705fc68 Bug 141614: restored Matthew Zahorik's net_server nonblocking connect
logic, which accidentally got deleted when the BONE changes were checked
in. This patch was contributed by Arougthopher
<arougthopher@lizardland.net>. r=wtc. a=scc.
Modified Files: bfile.c bmisc.c bnet.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125451 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-18 06:38:56 +00:00
seawood%netscape.com
3cd0d7d092 Remove DARWIN define from osx builds as it cripples the feature set provided by OSX headers.
Bug #154232 r=wtc sr=scc a=scc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125440 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-18 04:09:30 +00:00
wtc%netscape.com
55a14aa84e Merged the fix for bug 157347 from the tip (rev. 3.15) to
NSPRPUB_PRE_4_2_CLIENT_BRANCH. r=wtc. a=asa.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@125354 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-17 01:47:10 +00:00
sfraser%netscape.com
1b4d41ebff Fix for bug 139802; slow certificate authentication on Mac OS X. This was caused by the application spending lots of time in WaitNextEvent, called from its main event loop (which is a good thing, in terms of CPU usage). The problem is that NSPR threads then don't get enough time. This patch give the process scheduler a kick in the pants when NSPR is going to switch to another of its threads. r=wtc, r=sdagley
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@124920 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-10 01:14:23 +00:00
wtc%netscape.com
0ec0c5689c Merged the fix for bug 119098 from the trunk (rev. 1.38).
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@124783 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-09 00:11:38 +00:00
wtc%netscape.com
44888d293d Set NSPR version to 4.2.1.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@124336 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-29 00:34:36 +00:00
wtc%netscape.com
5b89afc11e Merged the fix for bug 150157 from the tip (rev. 3.13).
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123871 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-22 14:42:30 +00:00
seawood%netscape.com
fac3f266cb Explicitly use sh when calling the cygwin-wrapper script as some developers are reporting that their shell can't call the script directly.
Fallout from bug #141834


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123527 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-18 21:36:45 +00:00
seawood%netscape.com
f46f21240c Fixing win32 gmake builds lack of debugging information problem by working around a combination MSVC & cygwin make deficiencies:
* We must use the full path to the source file when calling MSVC so that debugging information shows up in the object files.
* Because of cygwin's use of /cygdrive when using full paths, we must use a cygwin-wrapper script in some cases to allow native win32 programs to use a fully qualified cygwin path.
* We have to call configure using the full path so that $(srcdir) contains the
full path in the Makefiles. The rules have been changed for win32 so that it
always use $(srcdir)/$*.{c,cpp} as the sourcefile name even when the file is in
the cwd.  This works around both the /cygdrive issue and the msvc's path info
optimization.
* We still use the wrapper when calling rc.exe & nsinstall.  nsinstall
frequently takes multiple args and is called all over the tree so changing each
calling site is going to be expensive.	(I'll have to check  the logs again but
I think the rc wrapping can go.)
* nspr & ldap still use the wrappers for all native win32 progs.  Neither nspr
nor ldap uses the acoutput-fast.pl script to speed up the substitution of
@srcdir@ into their Makefiles so, makefile substitution will break if we use
dos-paths.
* In the handful of directories where we copy srcfiles from another directory
in lieu of using VPATHs, we have to now copy those files to $(srcdir) so that
the default rules can find them.
Bug #141834 r=leaf,wtc,dmose,mcs


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123447 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-17 18:13:35 +00:00
seawood%netscape.com
934fd83b5a Fixing win32 gmake builds lack of debugging information problem by working around a combination MSVC & cygwin make deficiencies:
* We must use the full path to the source file when calling MSVC so that debugging information shows up in the object files.
* Because of cygwin's use of /cygdrive when using full paths, we must use a cygwin-wrapper script in some cases to allow native win32 programs to use a fully qualified cygwin path.
* We have to call configure using the full path so that $(srcdir) contains the
full path in the Makefiles. The rules have been changed for win32 so that it
always use $(srcdir)/$*.{c,cpp} as the sourcefile name even when the file is in
the cwd.  This works around both the /cygdrive issue and the msvc's path info
optimization.
* We still use the wrapper when calling rc.exe & nsinstall.  nsinstall
frequently takes multiple args and is called all over the tree so changing each
calling site is going to be expensive.	(I'll have to check  the logs again but
I think the rc wrapping can go.)
* nspr & ldap still use the wrappers for all native win32 progs.  Neither nspr
nor ldap uses the acoutput-fast.pl script to speed up the substitution of
@srcdir@ into their Makefiles so, makefile substitution will break if we use
dos-paths.
* In the handful of directories where we copy srcfiles from another directory
in lieu of using VPATHs, we have to now copy those files to $(srcdir) so that
the default rules can find them.
Bug #141834 r=leaf,wtc,dmose,mcs


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123440 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-17 17:09:57 +00:00
seawood%netscape.com
30fcb986ac Fixing win32 gmake builds lack of debugging information problem by working around a combination MSVC & cygwin make deficiencies:
* We must use the full path to the source file when calling MSVC so that debugging information shows up in the object files.
* Because of cygwin's use of /cygdrive when using full paths, we must use a cygwin-wrapper script in some cases to allow native win32 programs to use a fully qualified cygwin path.
* We have to call configure using the full path so that $(srcdir) contains the
full path in the Makefiles. The rules have been changed for win32 so that it
always use $(srcdir)/$*.{c,cpp} as the sourcefile name even when the file is in
the cwd.  This works around both the /cygdrive issue and the msvc's path info
optimization.
* We still use the wrapper when calling rc.exe & nsinstall.  nsinstall
frequently takes multiple args and is called all over the tree so changing each
calling site is going to be expensive.	(I'll have to check  the logs again but
I think the rc wrapping can go.)
* nspr & ldap still use the wrappers for all native win32 progs.  Neither nspr
nor ldap uses the acoutput-fast.pl script to speed up the substitution of
@srcdir@ into their Makefiles so, makefile substitution will break if we use
dos-paths.
* In the handful of directories where we copy srcfiles from another directory
in lieu of using VPATHs, we have to now copy those files to $(srcdir) so that
the default rules can find them.
Bug #141834 r=leaf,wtc,dmose,mcs


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123439 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-17 17:07:17 +00:00
wtc%netscape.com
242040f50f The previous checkin didn't work. Backed it out.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123304 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-14 05:36:42 +00:00
wtc%netscape.com
5b3fa140c2 Bug 151711: gcc on OSF1 needs to use the -mieee flag.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123303 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-14 05:32:42 +00:00
wtc%netscape.com
ae92dd97e1 Bug 151722: addr is in shared memory and is modified by another process, so
it needs to be declared volatile.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123301 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-14 05:27:15 +00:00
wtc%netscape.com
8807f72717 Bug 125819: fixed problems compiling using gcc on OSF1. The patch is
contributed by Chris Seawood <seawood@netscape.com>.
Modified Files: configure configure.in unix.c uxrng.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123292 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-14 03:22:14 +00:00
wtc%netscape.com
1ec85ef2b7 Cause Tinderbox to rebuild.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123269 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 22:37:02 +00:00
wtc%netscape.com
0f4e0256e7 Use +DD64 instead of +DA2.0W. +DD64 works for both PA-RISC and IA-64.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123268 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 22:36:20 +00:00
wtc%netscape.com
1a17e61a8c Bugzilla bug 142345: fixed mistakes in _MD_OpenSharedMemory and
_MD_CloseSharedMemory.  Thanks to Vladimir Golitsin
<vgolitsin@mindspring.com> for the bug report and bug fix.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123267 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 22:34:35 +00:00
wtc%netscape.com
a9314e8206 Bugzilla bug 135008: fixed the bug that PL_Base64Decode may step before
the buffer if the source string length is 0.  Thanks to Roger Chickering
<rogc@netscape.com> for the bug fix.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123266 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 22:33:39 +00:00
wtc%netscape.com
22484e0f16 Synch up with the tip.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123265 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 22:32:41 +00:00
wtc%netscape.com
441e5f0afc Updated the vercheck.c test for NSPR 4.2.1.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123264 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 22:32:03 +00:00
wtc%netscape.com
e2cf2a89cc Set NSPR version to 4.2.1 Beta.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123263 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 22:31:23 +00:00
wtc%netscape.com
3389286c4f Bug 136458: removed the old -O workaround and use -m68020-60. The patch is
contributed by Richard Zidlicky <rz@linux-m68k.org>.  r=wtc.
Modified Files: configure.in configure Linux.mk
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123254 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 22:02:27 +00:00
wtc%netscape.com
646252ef8d Bug 144886: On platforms with gethostbyname2, add the infrastructure for
PR_GetIPNodeByName to implement PR_AI_ADDRCONFIG correctly.  Right now
only AIX implements the function to determine if the system has any IPv4
or IPv6 source address configured.  On other platforms PR_GetIPNodeByName
still behaves as if the system had both IPv4 and IPv6 source addresses
configured.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123239 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 20:50:23 +00:00
wtc%netscape.com
c8ee1542b5 Bug 97475: the new 'af' field needs to be moved to the end of the
PRFilePrivate structure because the OJI code in Sun Java 2 1.3-1
distribution is reading the 'md.osfd' field of this private structure.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123232 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 20:28:31 +00:00
wtc%netscape.com
00d985f770 Bug 97475: some platforms, such as OpenVMS, require us to pass the exact
socket address length to socket functions like accept.  Just fixed enough
of this problem for OJI to work with Mozilla on OpenVMS.
Modified Files: _openvms.h primpl.h ptio.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123226 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 17:59:21 +00:00
seawood%netscape.com
76c6977ab1 Fix real_install rules so that headers are still installed correctly if includedir is overridden on the commandline.
Bug #149483 r=blizzard


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123212 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-13 09:01:48 +00:00
wtc%netscape.com
45721b22e9 Bugzilla bug 142677: made --disable-ipv6 work on AIX. Removed the obsolete
file _aix32in6.cfg.
Modified files: configure.in configure _aix32.cfg
Removed file: _aix32in6.cfg
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123114 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-12 00:09:09 +00:00
wtc%netscape.com
80b3c89ef6 Bug 134099: Worked around two BeOS bugs. 1. connect does not implicitly
bind the socket. 2. accept does not return the peer's address.
Modified files: _beos.h prsocket.c bnet.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@123053 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-11 20:08:10 +00:00
wtc%netscape.com
b8b9faae56 Bug 92516: _MD_gethostname returns the host's IP address on Mac so the
code that converts the fully qualified hostname to the unqualified hostname
is invalid for Mac.  Thanks to Roger D <rogerd@netscape.com> for the fix.
Modified Files: _macos.h prsystem.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@122420 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-31 14:37:50 +00:00
seawood%netscape.com
0895b70225 Fix typo that was causing pthreads to be selected by default on OpenBSD even though we default to NSPR threads on that platform.
Bug #145560 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@122256 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-29 08:01:42 +00:00
wtc%netscape.com
d5fae215bd Bugzilla bug 137736: Use "return 0" instead of exit(0) in the main()
functions of the configure test programs.  Miscellaneous changes to fix
compiler warnings about the configure test programs.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@120705 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-03 17:41:26 +00:00
seawood%netscape.com
31c07f0a38 Restoring unlabelled 'MozillaHack's. Fixing Netscape uname bustage.
Bug #140869


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@120686 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-03 10:02:09 +00:00
seawood%netscape.com
d12ded7de7 Sync config.guess & config.sub with official GNU copies.
Bug #140869 r=bryner


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@120684 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-03 08:29:00 +00:00
wtc%netscape.com
2a79837d2e Bugzilla bug 141820: don't quote parameters when calling DosStart.
The patch is contributed by Michael Kaply <mkaply@us.ibm.com>.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@120576 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-02 21:14:57 +00:00
wtc%netscape.com
3e481ed8a9 Force tinderbox to rebuild.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@120089 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-27 05:05:15 +00:00
wtc%netscape.com
be5eb4d1b0 Backed out the fix for bug 121975. It doesn't work on Windows 95.
Modified Files: configure configure.in WIN32.mk _win95.h w95dllmain.c
w95thred.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@120087 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-27 05:04:41 +00:00
seawood%netscape.com
da4d3cd5d7 Remove high performance timers from OS/2 and revert to default millisecond timer.
Thanks to Michael Kaply <mkaply@us.ibm.com> for the patch.
Bug #136958 r=cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@119613 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-23 14:11:31 +00:00
wtc%netscape.com
ff7ace4326 Bugzilla bug 135448: removed a level of code to make semaphores faster.
This patch is contributed by Michael Kaply <mkaply@us.ibm.com>.
Modified files: _os2 os2cv.c os2vacpp.asm
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@118796 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 21:50:00 +00:00
wtc%netscape.com
a3d19ae713 Bug 135450: OS/2 only - don't set priority if it is the default.
The patch is contributed by Michael Kaply <mkaply@us.ibm.com>. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@118795 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 21:48:31 +00:00
wtc%netscape.com
1485ed52e2 Deleted a printf statement in the Neutrino builds. Bug 135692.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@118794 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 21:47:29 +00:00
wtc%netscape.com
c2474c50d9 Merged the fixes for bug 136251 and bug 135119 on the
NSPRPUB_PRE_4_2_CLIENT_BRANCH.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@118793 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 21:46:14 +00:00
wtc%netscape.com
1de1f137f6 Force a rebuild of Tinderbox.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@117799 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-31 17:24:26 +00:00
wtc%netscape.com
48912d8064 Force a rebuild of Tinderbox.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@117798 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-31 17:18:43 +00:00
wtc%netscape.com
a1e3bba76d Bugzilla bug 133659: Merged the latest NSPR fixes from the tip into the
NSPRPUB_PRE_4_2_CLIENT_BRANCH.  a=asa (on behalf of drivers) for checkin
to the mozilla 1.0 trunk.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@117797 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-31 17:17:49 +00:00
sfraser%netscape.com
68ad5f8df6 Bug 133412: need to #include <Files.h> before <OpenTransport.h> for the buggy Universal Headers 3.4.1. Also change the GetDiskFragment param from the file name to the fragment name, for better debugging and Talkback. Changes to allow for upgrading to CodeWarrior Pro 7.2 tools. r=wtc, sr=scc, a=asa
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@117588 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-27 04:08:30 +00:00
wtc%netscape.com
4c6ef885bb Force a recompile of NSPR in the SeaMonkey tinderboxes.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@116594 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-14 23:25:20 +00:00
wtc%netscape.com
d5ec276d46 Bugzilla bug 129902: sync up the NSPR_PRE_4_2_CLIENT_BRANCH with the NSPR
tip.  a=dbaron on behalf of drivers@mozilla.org.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@116593 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-14 23:21:20 +00:00
seawood%netscape.com
50fdf0e9f4 Temporarily force NSPR to use -j1 to work around -j bug in pr/src/Makefile.in.
Bug #123423 r=cls a=asa


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@116586 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-14 22:51:40 +00:00
wtc%netscape.com
8e59675eb9 Bugzilla bug 129633: changed default select for OS/2 to BSD_SELECT.
The patch is contributed by Michael Kaply <mkaply@us.ibm.com>.
r=wtc. a=brendan on behalf of drivers for mozilla 1.0.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@116312 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-11 00:41:04 +00:00
sfraser%netscape.com
52a2279fbd Fix for bug 129364. Eliminate a window of time in which notifiers could fire when we hadn't set up the polling thread on the poll descriptors, which could cause lost notifications and FTP stalls. Also revert to PR_FAST_INTSON() from PR_INTSON(), which seems to fix a permanent stall issue on Mac OS X. r=wtc, a=asa
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@116254 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-09 03:00:07 +00:00
sfraser%netscape.com
99794f3753 Workaround fix for a stall on launch on dual CPU OS X machines, that is caused by a race condition entering the critical section. Bug 99561. r=wtc, a=dbaron
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@115777 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-05 00:54:27 +00:00
seawood%netscape.com
20342a469f Add -lrt/-lposix4 to OS_LIBS on Solaris so that Purify doesn't complain about the missing library when instrumenting libnspr.
Bug #124493 r=bryner a=asa


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@115369 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-26 10:19:08 +00:00
seawood%netscape.com
40bf0afe64 Create shared libraries using $(CC) for FreeBSD.
Use -pthread as a linker flag instead of a compile flag on FreeBSD.
Thanks to Jeremy Lea <reg@shale.csir.co.za> for the patch.
bug #125857 r=wtc/cls a=asa


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@115366 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-26 09:44:34 +00:00
seawood%netscape.com
bb73fa05f2 For nonblocking connections, wait for socket io if errno == EINTR, not EINPROGRESS.
Thanks to Paul Ashford <arougthopher@lizardland.net> for the patch.
Bug #70217 r=cls a=shaver


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@115211 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-22 06:43:31 +00:00
sfraser%netscape.com
f4b5dcde31 Fix for bug 121951 -- make PR_Poll on Mac work with layered file descriptors. r=wtc, r=gordon
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@114857 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-19 01:35:48 +00:00
sfraser%netscape.com
778860b285 Fix for bug 121952 -- make PR_ConnectContinue work on Mac, re-enabling non-blocking connects. r=wtc
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@114854 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-19 01:10:06 +00:00
wtc%netscape.com
a299f2d06d Bugzilla bug 124981: Enable IPv6 support for FreeBSD.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@114674 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-16 07:16:16 +00:00
seawood%netscape.com
da30c46fc1 Add "fast RAM semaphore" support.
Thanks to Mike Kaply <mkaply@us.ibm.com> for the patch.
Bug #125123 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@114648 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-16 02:25:51 +00:00
seawood%netscape.com
399c2a3f45 Fix problem of "invisible" helper apps on OS/2.
Thanks to Mike Kaply <mkaply@us.ibm.com> for the patch.
Bug #125183 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@114645 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-16 02:17:58 +00:00
seawood%netscape.com
19c2e24e10 Add workaround for missing addrlen in PRNetAddr & BONE failing getsockopt.
Thanks to Paul Ashford <arougthopher@lizardland.net> for the patch.
Bug #122364 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@114172 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-10 21:37:07 +00:00
seawood%netscape.com
a54ea5e595 Add support for inheritable fds on BeOS.
Bug #96331 r=arougthopher@lizardland.net


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@114168 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-10 20:55:14 +00:00
seawood%netscape.com
e383647c36 Implement MD process functions for BeOS.
Bug #96331 r=arougthopher@lizardland.net


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@114167 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-10 20:52:29 +00:00
wtc%netscape.com
837aeae085 Bugzilla bug 117479: add the PR_ABS macro to NSPRPUB_PRE_4_2_CLIENT_BRANCH.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@113868 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-07 03:15:11 +00:00
seawood%netscape.com
83c4a47dfc Remove check against fd->secret->md.connectionReturnValue as it always returns 0. Fixing page not loading due to nonblocking connection problem.
Bug #121327 r=arougthopher@lizardland.net


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@113306 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-31 07:43:22 +00:00
sfraser%netscape.com
4c8204b07c Fix blocker bug 121326 (any SSL transaction causes Mac to freeze) by checking in temporary patch from bug 106188; this reverts Mac to using blocking connects. r=wtc.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@113058 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-28 23:14:42 +00:00
wtc%netscape.com
c061e61274 Bugzilla bug 119834: checked the fix into NSPRPUB_PRE_4_2_CLIENT_BRANCH.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@112982 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-27 03:55:21 +00:00
sfraser%netscape.com
14ae559e96 Removing obsolete .toc file (supplanted by XML projects)
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@112771 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-24 23:48:31 +00:00
sfraser%netscape.com
94730cea7a Fixing bug 119329 -- make NSPR use tree-wide prefix files on Mac, so that we get the same traceback table and other compiler settings as the other projects. r=pinkerton, r/a=wtc
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@112768 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-24 23:40:48 +00:00
sdagley%netscape.com
4385a6e2e6 Fix #99561. Use MPSemaphore calls rather than WaitNextEvent to pause CPU under Mac OS X - fixes thread deadlock and improves performance. r=wtc,sr=sfraser,a=dbaron
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@112532 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-22 22:11:48 +00:00
wtc%netscape.com
b1099528c0 Bugzilla bug 100776: Merged the fix onto the NSPRPUB_PRE_4_2_CLIENT_BRANCH.
Modified files: configure configure.in _os2.h _os2_errors.h prsocket.c
os2_errors.c os2poll.c os2sock.c


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@112529 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-22 21:57:42 +00:00
wtc%netscape.com
27b3baf4bb Checked in the fix for bug 118631 on the NSPRPUB_PRE_4_2_CLIENT_BRANCH.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111993 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-12 01:06:32 +00:00
wtc%netscape.com
d827d854f6 Bugzilla bug 119406: checked in the fix on the
NSPRPUB_PRE_4_2_CLIENT_BRANCH.


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111936 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-11 05:37:49 +00:00
seawood%netscape.com
3277a5aed9 Landing BeOS BONE support.
Thanks to Matthew Zahorik <maz@albany.net> & Paul Ashford <arougthopher@lizardland.net> for the patch.
Bug #71697 r=wtc/cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111802 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-10 09:50:36 +00:00
wtc%netscape.com
b9a8b1efbc Bugzilla bug 112987: correctly detect the FreeBSD versions in which poll()
was added to libc and libc_r.  Thanks to Jeremy Lea for pointing me to the
FreeBSD Porter's Handbook.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111392 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-05 01:43:00 +00:00
wtc%netscape.com
03d86176f2 Define IS_64 for FreeBSD/alpha.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111284 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-03 02:38:25 +00:00
wtc%netscape.com
44dc5f47ec Make building for Darwin/x86 work. The patch is from Matt Watson.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111283 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-03 02:34:05 +00:00
seawood%netscape.com
bb131c9b07 Recent versions of freebsd have a threadsafe poll.
Use sched_get_priority_* to get actual priority min & max rather than hardcoding defaults.
Patches from freebsd ports system.
Bug #112987 r=rjesup@wgate.com


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111206 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-01 00:44:07 +00:00
(no author)
97b86da472 This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111099 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-27 02:32:35 +00:00
wtc%netscape.com
867fda21a7 Bugzilla bug 48308: checked in part of the patch to bring NSPR up to
OpenUNIX8 build with pthreads.  The patch is contributed by
Hiram Clawson <hiramc@caldera.com>.
Modified files: _pth.h ptio.c ptthread.c pr/tests/Makefile.in
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@111094 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-26 23:24:29 +00:00
wtc%netscape.com
f55b28bc7d Bugzilla bug 115149: clean up threads properly on non-emx platforms.
Increased the default thread stack size to 64K.  The patch is contributed
by aaronr@us.ibm.com and Michael Kaply <mkaply@us.ibm.com>.
Modified files: _os2.h os2cv.c os2io.c os2thred.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@110861 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-20 05:27:08 +00:00
wtc%netscape.com
2b22ed66f2 Bugzilla bug 97485: added the zone allocator (implemented by Nelson
Bolyard).
Modified files: primpl.h prmem.c prinit.c ptthread.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@110855 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-20 04:15:24 +00:00
sfraser%netscape.com
95d34682eb Landing NSPR changes for the Mac Pro 7 landing
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@110184 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-10 22:27:32 +00:00
sfraser%netscape.com
e6f8fff6af New XML project file for Pro 7 landing
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@110168 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-10 20:04:24 +00:00
sfraser%netscape.com
3dbcff2efe Fix bug 106999 -- implement Mac atomic operations using Open Transport routines for speed. r=wtc.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@110046 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 23:59:35 +00:00
wtc%netscape.com
074777cf38 Bugzilla bug 113740: do not use the 32-bit SPARC assembly implementation of
PRStack because it may cause starvation of the lock owner, leaving the
other threads spinning trying to acquire the lock.
Modified files: configure configure.in
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@109959 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 02:19:55 +00:00
(no author)
837d01b43f This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@109956 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 02:10:11 +00:00
seawood%netscape.com
dab08fd377 Do not build NSPR optimized if MOZ_TRACE_MALLOC is set.
Thanks to Garrett Blythe <blythe@netscape.com> for the patch.
Bug #112953 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@109801 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-06 03:39:05 +00:00
seawood%netscape.com
48ec9b869c Remove --disable-gcc-pipe option.
Bug #81031


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@109494 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-02 21:56:19 +00:00
seawood%netscape.com
1c3b473b22 Revert to using standard config.sub & config.guess entries for OS/2.
Thanks to pedemont@us.ibm.com (Javier Pedemonte) for the patch.
Bug #112244 r=cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@109466 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-01 18:54:41 +00:00
seawood%netscape.com
c91e56fc7c Add check for -pipe feature for gcc variants rather than hardcoding it for some platforms.
Bug #81031 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@108146 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 05:03:52 +00:00
seawood%netscape.com
4005e8642d Use -no-cpp-precomp instead of -traditional-cpp for darwin.
Bug #106617


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@108010 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 03:59:59 +00:00
seawood%netscape.com
af66a34eb1 Tell BSD strip to just strip local & debug symbols rather than all symbols.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@107226 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-03 05:57:04 +00:00
seawood%netscape.com
f35b850294 Move darwin section to proper platform location
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@107201 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-03 03:51:32 +00:00
seawood%netscape.com
af468edb3e Add comment explaining why we use -traditional-cpp for Darwin.
Bug #106617


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@107197 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-03 03:20:46 +00:00
sfraser%netscape.com
b53e6bb4be Adding strtok.c per bug 106372
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@106889 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 00:14:33 +00:00
wtc%netscape.com
fdd27d83c2 Added lib/tests/Makefile to the list of makefiles to be generated by
configure.
Modified files: configure configure.in
Bugzilla bug 106372: added new function PL_strtok_r.  The function was
implemented by Roland Mainz <Roland.Mainz@informatik.med.uni-giessen.de>.
Modified files: lib/libc/include/plstr.h lib/libc/src/Makefile.in
    lib/tests/string.c
Added file: lib/libc/src/strtok.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@106882 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 00:03:48 +00:00
(no author)
43b465bf6e This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@106873 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-31 23:49:53 +00:00
wtc%netscape.com
3f2acb6f93 Bugzilla bug 106771: support building on HP-UX 11.11. The patch is from
Jim Dunn <jdunn@netscape.com>.
Modified files: configure configure.in
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@106395 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-26 21:08:02 +00:00
seawood%netscape.com
11101f5c41 Add -traditional-cpp & -install_name for Mac OSX builds.
Bug #106617


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@106384 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-26 20:22:53 +00:00
seawood%netscape.com
5ade228aba Convert all rhapsody (pre-beta-macosx) references to darwin.
Bug #106617 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@106330 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-26 04:55:58 +00:00
seawood%netscape.com
a82ef34a24 Drop rhapsody for darwin.
Bug #106617


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@106286 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-25 21:30:56 +00:00
wtc%netscape.com
6fe4a9ff56 Merged the fixes for bugs 104286, 104269, and 77188 on the
NSPRPUB_PRE_4_2_CLIENT_BRANCH.
Modified Files:
	configure configure.in build/autoconf/config.guess
	config/autoconf.mk.in


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@105663 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-18 04:37:32 +00:00
wtc%netscape.com
f30774fa80 Bugzilla bug 92085: checked in a Neutrino patch from
briane@qnx.com (Brian Edmond).  r=wtc.
Modified files: _nto.h protypes.h
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@105662 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-18 04:25:51 +00:00
wtc%netscape.com
5154c4e124 Bugzilla bug 71179: Neutrino needs the RTLD_GROUP flag to load Netscape
plugins.  The fix is contributed by timeless@bemail.org.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@105660 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-18 04:23:04 +00:00
wtc%netscape.com
b30cce9e5c Bugzilla bug 77197: use spawn in Neutrino because fork & exec does not
work in multithreaded programs in Neutrino.  The patch is contributed
by dinglis@qnx.com (Dave Inglis), reviewed and modified by wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@105659 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-18 04:20:34 +00:00
wtc%netscape.com
1370352739 Bugzilla bug 105154: fixed a timing problem in OS/2's implementation of
condition variables.  Thanks to Aaron Read <aaronr@us.ibm.com> for the
patch.  r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@105564 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 23:52:53 +00:00
seawood%netscape.com
73304bc538 Install *.cfg files used for cross-compiling
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@105364 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-13 06:02:48 +00:00
seawood%netscape.com
1d10bc32f4 Add support for mips*el
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@105363 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-13 06:00:00 +00:00
sfraser%netscape.com
fa57e9bb4a Fix for 100353 -- handle polling for read and write on different threads, and properly deal with sending to a socket that has flow control restrictions. Fixes a problem saving to IMAP server sent messages with attachments. r=gordon, wtc.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@104854 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-08 22:41:28 +00:00
seawood%netscape.com
b9fde4ee45 Updating config.guess & config.sub with 2001-10-07 changes from the GNU master c
opy at :pserver:anoncvs@subversions.gnu.org:/cvs /config .


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@104777 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-07 23:08:14 +00:00
seawood%netscape.com
07962ac747 Solaris 7 has deprecated the use of libposix4 in favor of librt. Check the OS_RE
LEASE and use the appropriate library.
Bug #96986 r=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@104449 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-02 22:21:53 +00:00
sfraser%netscape.com
02f181250e More fixing for 71718. MPEnter/LeaveCriticalRegion don't work under Mac OS 10.0.x, so we need to use some hand-rolled critical sections that are just an MPSemaphore and a counter (which is all that MP critical sections are under the hood, I bet). Added a new file, mdcriticalregions.c, to the project. r=wtc/sdagley
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@103792 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 02:34:20 +00:00
cls%seawood.org
67dc250790 Remove commented out references to mozilla xp_*.h files.
Thanks to Brian Ryner <bryner@netscape.com> for the patch.
Bug #38061 r=cls


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@103532 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 01:42:48 +00:00
sfraser%netscape.com
00479da414 Fix for bug 71718. Make Mac NSPR work on dual CPU Mac OS X macines by using MP critical regions to fix threading synchronization problems. r=gordon, wtc.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@103266 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 03:42:34 +00:00
sfraser%netscape.com
80d937bbfa Fix for bug 97866. Fixes async file I/O to ensure that we always call WaitOnThisThread if we're doing an async call (which does not wait if the notifier has already fired). Also don't bother checking return values from PBRead/WriteAsync, since they never fail, but do check the return value of the PBReadSync call. Fixes synchronization problems on Mac OS X. r=gordon, a=wtc.
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@103237 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 00:08:36 +00:00
sdagley%netscape.com
078b061369 Fix #99556. Account for change in Mac epoch time as of MSL 6. r=wtc/sfraser
git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@103038 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:42:12 +00:00
wtc%netscape.com
d0dff4dc20 Bugzilla bug 97456: fixed build error on BSD/OS 4.3 (beta3). The patch
is contributed by lidl@pix.net.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@102019 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-30 05:30:39 +00:00
cls%seawood.org
92c80d99a5 Escape ^ when calling grep as some shells interpret ^ instead of passing it to grep.
Thanks to dave@arsdigita.com (Drazen Kacar) for the patch.
Bug #96997 r=cls sr=wtc


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@101881 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-28 07:51:34 +00:00
wtc%netscape.com
51d3b633c3 Bugzilla bug 84035: improved comments.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@101511 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 15:26:17 +00:00
wtc%netscape.com
5c9558feb0 Force Tinderbox to recompile.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@101507 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 14:31:55 +00:00
wtc%netscape.com
496c343716 Bugzilla bug 84035: backed out the changes to the PRMonitor functions
because some of the Mozilla client code depends on the property that
PR_EnterMonitor and PR_ExitMonitor do not call malloc, calloc, and free.
Modified Files: _pth.h, primpl.h, ptsynch.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@101506 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 14:30:48 +00:00
cls%seawood.org
c89c27007d Bugzilla bug 95744: handle the case that ENOTEMPTY and EEXIST have the
same value. (They do on AIX 4.3.)


git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@101306 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 13:56:22 +00:00
(no author)
27617bcd00 This commit was manufactured by cvs2svn to create branch
'NSPRPUB_PRE_4_2_CLIENT_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSPRPUB_PRE_4_2_CLIENT_BRANCH@101103 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-15 14:30:45 +00:00
964 changed files with 226230 additions and 106012 deletions

151
mozilla/nsprpub/Makefile.in Normal file
View File

@@ -0,0 +1,151 @@
#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MOD_DEPTH = .
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
MAKE := $(patsubst -j%,,$(MAKE)) -j1
DIRS = config pr lib
ifdef MOZILLA_CLIENT
# Make nsinstall use absolute symlinks by default for Mozilla OSX builds
# http://bugzilla.mozilla.org/show_bug.cgi?id=193164
ifeq ($(OS_ARCH),Darwin)
ifndef NSDISTMODE
NSDISTMODE=absolute_symlink
export NSDISTMODE
endif
endif
endif
DIST_GARBAGE = config.cache config.log config.status
all:: config.status export
include $(topsrcdir)/config/rules.mk
config.status:: configure
ifeq ($(OS_ARCH),WINNT)
sh $(srcdir)/configure --no-create --no-recursion
else
./config.status --recheck && ./config.status
endif
#
# The -ll option of zip converts CR LF to LF.
#
ifeq ($(OS_ARCH),WINNT)
ZIP_ASCII_OPT = -ll
endif
# Delete config/autoconf.mk last because it is included by every makefile.
distclean::
@echo "cd pr/tests; $(MAKE) $@"
@$(MAKE) -C pr/tests $@
rm -f config/autoconf.mk
release::
echo $(BUILD_NUMBER) > $(RELEASE_DIR)/$(BUILD_NUMBER)/version.df
@if test -f imports.df; then \
echo "cp -f imports.df $(RELEASE_DIR)/$(BUILD_NUMBER)/imports.df"; \
cp -f imports.df $(RELEASE_DIR)/$(BUILD_NUMBER)/imports.df; \
else \
echo "echo > $(RELEASE_DIR)/$(BUILD_NUMBER)/imports.df"; \
echo > $(RELEASE_DIR)/$(BUILD_NUMBER)/imports.df; \
fi
cd $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME); \
rm -rf META-INF; mkdir META-INF; cd META-INF; \
echo "Manifest-Version: 1.0" > MANIFEST.MF; \
echo "" >> MANIFEST.MF; \
cd ..; rm -f mdbinary.jar; zip -r mdbinary.jar META-INF bin lib; \
rm -rf META-INF; \
cd include; \
rm -rf META-INF; mkdir META-INF; cd META-INF; \
echo "Manifest-Version: 1.0" > MANIFEST.MF; \
echo "" >> MANIFEST.MF; \
cd ..; rm -f mdheader.jar; zip $(ZIP_ASCII_OPT) -r mdheader.jar *; \
rm -rf META-INF
ifeq ($(OS_ARCH),WINNT)
@if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); then \
rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)"; \
$(topsrcdir)/config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER); \
fi
@if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); then \
rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)"; \
$(topsrcdir)/config/prmkdir.bat $(MDIST_DOS)\\$(MOD_NAME)\\$(BUILD_NUMBER)\\$(RELEASE_OBJDIR_NAME); \
fi
else
@if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); then \
rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)"; \
$(NSINSTALL) -D $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
chmod 775 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
fi
@if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); then \
rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)"; \
$(NSINSTALL) -D $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
chmod 775 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
fi
endif
cd $(RELEASE_DIR)/$(BUILD_NUMBER); \
cp -f version.df imports.df $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \
chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/version.df; \
chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/imports.df; \
cd $(OBJDIR_NAME); \
cp -f mdbinary.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdbinary.jar; \
cd include; \
cp -f mdheader.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdheader.jar
package:
@echo "cd pkg; $(MAKE) publish"
$(MAKE) -C pkg publish
depend:
@echo "NSPR20 has no dependencies. Skipped."

View File

@@ -0,0 +1,75 @@
#!/bin/perl
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# -----------------------------------------------------------------
#
# explode.pl -- Unpack .jar files into bin, lib, include directories
#
# syntax: perl explode.pl
#
# Description:
# explode.pl unpacks the .jar files created by the NSPR build
# procedure.
#
# Suggested use: After copying the platform directories to
# /s/b/c/nspr20/<release>. CD to /s/b/c/nspr20/<release> and
# run explode.pl. This will unpack the jar files into bin, lib,
# include directories.
#
# -----------------------------------------------------------------
@dirs = `ls -d *.OBJ*`;
foreach $dir (@dirs) {
chop($dir);
if (-l $dir) {
print "Skipping symbolic link $dir\n";
next;
}
print "Unzipping $dir/mdbinary.jar\n";
system ("unzip", "-o", "$dir/mdbinary.jar",
"-d", "$dir");
system ("rm", "-rf", "$dir/META-INF");
mkdir "$dir/include", 0755;
print "Unzipping $dir/mdheader.jar\n";
system ("unzip", "-o", "-aa",
"$dir/mdheader.jar",
"-d", "$dir/include");
system ("rm", "-rf", "$dir/include/META-INF");
}
# --- end explode.pl ----------------------------------------------

View File

@@ -0,0 +1,79 @@
#!/bin/sh
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# -----------------------------------------------------------------
# makeTargetDirs.sh -- Create target directories for building NSPR
#
# syntax: makeTargetDirs.sh
#
# Description:
# makeTargetDirs.sh creates a set of directories intended for use
# with NSPR's autoconf based build system.
#
# The enumerated directories are the same as those built for NSPR
# 4.1.1. Adjust as needed.
#
# -----------------------------------------------------------------
mkdir AIX4.3_64_DBG.OBJ
mkdir AIX4.3_64_OPT.OBJ
mkdir AIX4.3_DBG.OBJ
mkdir AIX4.3_OPT.OBJ
mkdir HP-UXB.11.00_64_DBG.OBJ
mkdir HP-UXB.11.00_64_OPT.OBJ
mkdir HP-UXB.11.00_DBG.OBJ
mkdir HP-UXB.11.00_OPT.OBJ
mkdir IRIX6.5_n32_PTH_DBG.OBJ
mkdir IRIX6.5_n32_PTH_OPT.OBJ
mkdir Linux2.2_x86_glibc_PTH_DBG.OBJ
mkdir Linux2.2_x86_glibc_PTH_OPT.OBJ
mkdir Linux2.4_x86_glibc_PTH_DBG.OBJ
mkdir Linux2.4_x86_glibc_PTH_OPT.OBJ
mkdir OSF1V4.0D_DBG.OBJ
mkdir OSF1V4.0D_OPT.OBJ
mkdir SunOS5.6_DBG.OBJ
mkdir SunOS5.6_OPT.OBJ
mkdir SunOS5.7_64_DBG.OBJ
mkdir SunOS5.7_64_OPT.OBJ
mkdir WIN954.0_DBG.OBJ
mkdir WIN954.0_DBG.OBJD
mkdir WIN954.0_OPT.OBJ
mkdir WINNT4.0_DBG.OBJ
mkdir WINNT4.0_DBG.OBJD
mkdir WINNT4.0_OPT.OBJ
# --- end makeTargetDirs.sh ---------------------------------------

View File

@@ -0,0 +1,215 @@
#! /bin/sh
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# ------------------------------------------------------------------
# repackage.sh -- Repackage NSPR from /s/b/c to mozilla.org format
#
# syntax: repackage.sh
#
# Description:
# repackage.sh creates NSPR binary distributions for mozilla.org from
# the internal binary distributions in /share/builds/components/nspr20.
# There are reasons why we can't just push the internal binary distributions
# to mozilla.org. External developers prefer to use the common archive
# file format for their platforms, rather than the jar files we use internally.
#
# On Unix, we create a tar.gz file. On Windows, we create a zip file.
# For example: NSPR 4.1.1, these would be nspr-4.1.1.tar.gz and nspr-4.1.1.zip.
#
# When unpacked, nspr-4.1.1.tar.gz or nspr-4.1.1.zip should expand to a
# nspr-4.1.1 directory that contains three subdirectories: include, lib,
# and bin. The header files, with the correct line endings for the
# platform, are in nspr-4.1.1/include. The libraries are in nspr-4.1.1/lib.
# The executable programs are in nspr-4.1.1/bin.
#
# Note! Files written with Gnu tar are not readable by some non-Gnu
# versions. Sun, in particular.
#
#
#
#
# ------------------------------------------------------------------
FROMTOP=/share/builds/components/nspr20/v4.5
TOTOP=./v4.5
NSPRDIR=nspr-4.5
SOURCETAG=NSPR_4_5_RTM
#
# enumerate Unix object directories on /s/b/c
UNIX_OBJDIRS="
AIX4.3_64_DBG.OBJ
AIX4.3_64_OPT.OBJ
AIX4.3_DBG.OBJ
AIX4.3_OPT.OBJ
HP-UXB.11.00_64_DBG.OBJ
HP-UXB.11.00_64_OPT.OBJ
HP-UXB.11.00_DBG.OBJ
HP-UXB.11.00_OPT.OBJ
IRIX6.5_n32_PTH_DBG.OBJ
IRIX6.5_n32_PTH_OPT.OBJ
Linux2.2_x86_glibc_PTH_DBG.OBJ
Linux2.2_x86_glibc_PTH_OPT.OBJ
Linux2.4_x86_glibc_PTH_DBG.OBJ
Linux2.4_x86_glibc_PTH_OPT.OBJ
OSF1V5.0_DBG.OBJ
OSF1V5.0_OPT.OBJ
SunOS5.6_DBG.OBJ
SunOS5.6_OPT.OBJ
SunOS5.8_64_DBG.OBJ
SunOS5.8_64_OPT.OBJ
SunOS5.8_DBG.OBJ
SunOS5.8_OPT.OBJ
"
#
# enumerate Windows object directories on /s/b/c
WIN_OBJDIRS="
WIN954.0_DBG.OBJ
WIN954.0_DBG.OBJD
WIN954.0_OPT.OBJ
WINNT4.0_DBG.OBJ
WINNT4.0_DBG.OBJD
WINNT4.0_OPT.OBJ
"
#
# Create the destination directory.
#
echo "removing directory $TOTOP"
rm -rf $TOTOP
echo "creating directory $TOTOP"
mkdir -p $TOTOP
#
# Generate the tar.gz files for Unix platforms.
#
for OBJDIR in $UNIX_OBJDIRS; do
echo "removing directory $NSPRDIR"
rm -rf $NSPRDIR
echo "creating directory $NSPRDIR"
mkdir $NSPRDIR
echo "creating directory $NSPRDIR/include"
mkdir $NSPRDIR/include
echo "copying $FROMTOP/$OBJDIR/include"
cp -r $FROMTOP/$OBJDIR/include $NSPRDIR
echo "copying $FROMTOP/$OBJDIR/lib"
cp -r $FROMTOP/$OBJDIR/lib $NSPRDIR
echo "copying $FROMTOP/$OBJDIR/bin"
cp -r $FROMTOP/$OBJDIR/bin $NSPRDIR
echo "creating directory $TOTOP/$OBJDIR"
mkdir $TOTOP/$OBJDIR
echo "creating $TOTOP/$OBJDIR/$NSPRDIR.tar"
tar cvf $TOTOP/$OBJDIR/$NSPRDIR.tar $NSPRDIR
echo "gzipping $TOTOP/$OBJDIR/$NSPRDIR.tar"
gzip $TOTOP/$OBJDIR/$NSPRDIR.tar
done
#
# Generate the zip files for Windows platforms.
#
for OBJDIR in $WIN_OBJDIRS; do
echo "removing directory $NSPRDIR"
rm -rf $NSPRDIR
echo "creating directory $NSPRDIR"
mkdir $NSPRDIR
echo "creating directory $NSPRDIR/include"
mkdir $NSPRDIR/include
echo "creating directory $NSPRDIR/include/private"
mkdir $NSPRDIR/include/private
echo "creating directory $NSPRDIR/include/obsolete"
mkdir $NSPRDIR/include/obsolete
# copy headers and adjust unix line-end to Windows line-end
# Note: Watch out for the "sed" command line.
# when editing the command, take care to preserve the "^M" as the literal
# cntl-M character! in vi, use "cntl-v cntl-m" to enter it!
#
headers=`ls $FROMTOP/$OBJDIR/include/*.h`
for header in $headers; do
sed -e 's/$/
/g' $header > $NSPRDIR/include/`basename $header`
done
headers=`ls $FROMTOP/$OBJDIR/include/obsolete/*.h`
for header in $headers; do
sed -e 's/$/
/g' $header > $NSPRDIR/include/obsolete/`basename $header`
done
headers=`ls $FROMTOP/$OBJDIR/include/private/*.h`
for header in $headers; do
sed -e 's/$/
/g' $header > $NSPRDIR/include/private/`basename $header`
done
echo "copying $FROMTOP/$OBJDIR/lib"
cp -r $FROMTOP/$OBJDIR/lib $NSPRDIR
echo "copying $FROMTOP/$OBJDIR/bin"
cp -r $FROMTOP/$OBJDIR/bin $NSPRDIR
echo "creating directory $TOTOP/$OBJDIR"
mkdir $TOTOP/$OBJDIR
echo "creating $TOTOP/$OBJDIR/$NSPRDIR.zip"
zip -r $TOTOP/$OBJDIR/$NSPRDIR.zip $NSPRDIR
done
#
# package the source from CVS
#
echo "Packaging source"
echo "removing directory $NSPRDIR"
rm -rf $NSPRDIR
echo "creating directory $NSPRDIR"
mkdir $NSPRDIR
myWD=`pwd`
cd $NSPRDIR
echo "Pulling source from CVS with tag $SOURCETAG"
cvs co -r $SOURCETAG mozilla/nsprpub
cd $myWD
mkdir $TOTOP/src
echo "Creating source tar file: $TOTOP/src/$NSPRDIR.tar"
tar cvf $TOTOP/src/$NSPRDIR.tar $NSPRDIR
echo "gzip $TOTOP/src/$NSPRDIR.tar"
gzip $TOTOP/src/$NSPRDIR.tar
#
# Remove the working directory.
#

View File

@@ -0,0 +1,75 @@
#!/bin/sh
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# -----------------------------------------------------------------
# symlinks.sh -- create links from NSPR builds
#
# syntax: symlinks.sh
#
# Description:
# symlinks.sh creates some symbolic links for NSPR build targets
# that are not actually build, but for which there are NSPR
# binaries suitable for running on the intended target. ... got
# that?
#
# Suggested use: After copying NSPR binaries to
# /s/b/c/nspr20/<platform> run symlinks.sh to create the links
# for all supported platforms.
#
# The symlinks in this script correspond to the NSPR 4.1.1
# release. Adjust as necessary.
#
# -----------------------------------------------------------------
ln -s SunOS5.6_DBG.OBJ SunOS5.7_DBG.OBJ
ln -s SunOS5.6_OPT.OBJ SunOS5.7_OPT.OBJ
ln -s SunOS5.6_DBG.OBJ SunOS5.8_DBG.OBJ
ln -s SunOS5.6_OPT.OBJ SunOS5.8_OPT.OBJ
ln -s SunOS5.7_64_DBG.OBJ SunOS5.8_64_DBG.OBJ
ln -s SunOS5.7_64_OPT.OBJ SunOS5.8_64_OPT.OBJ
ln -s OSF1V4.0D_DBG.OBJ OSF1V5.0_DBG.OBJ
ln -s OSF1V4.0D_OPT.OBJ OSF1V5.0_OPT.OBJ
ln -s WINNT4.0_DBG.OBJ WINNT5.0_DBG.OBJ
ln -s WINNT4.0_DBG.OBJD WINNT5.0_DBG.OBJD
ln -s WINNT4.0_OPT.OBJ WINNT5.0_OPT.OBJ
# --- end symlinks.sh ---------------------------------------------

1404
mozilla/nsprpub/build/autoconf/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1505
mozilla/nsprpub/build/autoconf/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,119 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5; it is not part of GNU.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
instcmd="$mvprog"
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
fi
# Make a temp file name in the proper directory.
dstdir=`dirname $dst`
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp
# and set any options; do chmod last to preserve setuid bits
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
# Now rename the file to the real destination.
$doit $rmcmd $dst
$doit $mvcmd $dsttmp $dst
exit 0

View File

@@ -0,0 +1,75 @@
#!/bin/sh
#
# Stupid wrapper to avoid win32 dospath/cygdrive issues
# Try not to spawn programs from within this file. If the stuff in here looks royally
# confusing, see bug: http://bugzilla.mozilla.org/show_bug.cgi?id=206643
# and look at the older versions of this file that are easier to read, but
# do basically the same thing
#
prog=$1
shift
if test -z "$prog"; then
exit 0
fi
# If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p
mountpoint=$CYGDRIVE_MOUNT
if test -z "$mountpoint"; then
mountpoint=`mount -p`
if test -z "$mountpoint"; then
print "Cannot determine cygwin mount points. Exiting"
exit 1
fi
fi
# Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p`
mountpoint=${mountpoint#*/}
mountpoint=/${mountpoint%%[!A-Za-z0-9_]*}
mountpoint=${mountpoint%/}
args=""
up=""
if test "${prog}" = "-up"; then
up=1
prog=${1}
shift
fi
process=1
# Convert the mountpoint in parameters to Win32 filenames
# For instance: /cygdrive/c/foo -> c:/foo
for i in "${@}"
do
if test "${i}" = "-wrap"; then
process=1
else
if test "${i}" = "-nowrap"; then
process=
else
if test -n "${process}"; then
if test -n "${up}"; then
pathname=${i#-I[a-zA-Z]:/}
if ! test "${pathname}" = "${i}"; then
no_i=${i#-I}
driveletter=${no_i%%:*}
i=-I${mountpoint}/${driveletter}/${pathname}
fi
else
eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
if ! test "${leader}" = "${i}"; then
eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
driveletter=${no_mountpoint%%/*}
i=${leader}${driveletter}:/${pathname}
fi
fi
fi
args="${args} ${i}"
fi
fi
done
exec $prog $args

View File

@@ -0,0 +1,166 @@
#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MOD_DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
# Indicate that this directory builds build tools.
INTERNAL_TOOLS = 1
# For sanity's sake, we compile nsinstall without the wrapped system
# headers, so that we can use it to set up the wrapped system headers.
VISIBILITY_FLAGS =
# autoconf.mk must be deleted last (from the top-level directory)
# because it is included by every makefile.
DIST_GARBAGE = nsprincl.mk nsprincl.sh nspr-config
RELEASE_BINS = nspr-config
include $(topsrcdir)/config/config.mk
ifneq ($(OS_TARGET),WINCE)
CSRCS = now.c
# This version hasn't been ported for us; the one in mozilla/config has
ifneq ($(OS_ARCH),OS2)
CSRCS += nsinstall.c
PLSRCS = nfspwd.pl
endif
endif
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
PROG_SUFFIX = .exe
else
PROG_SUFFIX =
endif
# Temporary workaround to disable the generation of
# library build time because now.c uses the 'long long'
# data type that's not available on some platforms.
ifeq (,$(filter-out NEC NEXTSTEP QNX SCOOS UNIXWARE,$(OS_ARCH)))
DEFINES += -DOMIT_LIB_BUILD_TIME
endif
ifeq ($(OS_ARCH), IRIX)
ifeq ($(basename $(OS_RELEASE)),6)
ifndef NS_USE_GCC
ifeq ($(USE_N32),1)
XLDOPTS += -n32 -Wl,-woff,85
else
ifeq ($(USE_64),1)
XLDOPTS += -64
else
XLDOPTS += -32
endif
endif
endif
endif
endif
ifeq ($(OS_ARCH), HP-UX)
ifeq ($(USE_64),1)
XLDOPTS += +DD64
endif
endif
ifeq ($(MOZ_OS2_TOOLS),EMX)
XCFLAGS = $(OS_CFLAGS)
ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
XLDOPTS = -Zlinker /PM:VIO
endif
endif
ifeq ($(MOZ_OS2_TOOLS),PGCC)
XCFLAGS = $(OS_CFLAGS)
XLDOPTS = -Zlinker /PM:VIO
endif
include $(topsrcdir)/config/rules.mk
ifneq ($(OS_TARGET),WINCE)
PROGS = $(OBJDIR)/now$(PROG_SUFFIX)
ifeq (,$(CROSS_COMPILE)$(filter-out OS2 WINNT,$(OS_ARCH)))
TARGETS = $(PROGS)
else
PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
TARGETS = $(PROGS) $(PLSRCS:.pl=)
endif
endif
OUTOPTION = -o # end of the line
ifeq (,$(filter-out WINNT WIN95 WINCE,$(OS_TARGET)))
ifndef NS_USE_GCC
OUTOPTION = /Fe
endif
endif
# Redefine MAKE_OBJDIR for just this directory
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi
endef
export:: $(TARGETS)
rm -f $(dist_bindir)/nspr-config
ifdef WRAP_SYSTEM_INCLUDES
export::
if test ! -d system_wrappers; then mkdir system_wrappers; fi
$(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers < $(srcdir)/system-headers
$(INSTALL) system_wrappers $(dist_includedir)
endif
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LD) $(EXEFLAGS) $<
else
$(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@
endif
real_install:: nspr.m4
$(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal
$(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(datadir)/aclocal

View File

@@ -0,0 +1,116 @@
# -*- Mode: Makefile -*-
INCLUDED_AUTOCONF_MK = 1
USE_AUTOCONF = 1
@SHELL_OVERRIDE@
MOZILLA_CLIENT = @MOZILLA_CLIENT@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
datadir = @datadir@
dist_prefix = @dist_prefix@
dist_bindir = @dist_bindir@
dist_includedir = @dist_includedir@
dist_libdir = @dist_libdir@
DIST = $(dist_prefix)
RELEASE_OBJDIR_NAME = @RELEASE_OBJDIR_NAME@
OBJDIR_NAME = @OBJDIR_NAME@
OBJDIR = @OBJDIR@
OBJ_SUFFIX = @OBJ_SUFFIX@
LIB_SUFFIX = @LIB_SUFFIX@
DLL_SUFFIX = @DLL_SUFFIX@
ASM_SUFFIX = @ASM_SUFFIX@
MOD_NAME = @NSPR_MODNAME@
MOD_MAJOR_VERSION = @MOD_MAJOR_VERSION@
MOD_MINOR_VERSION = @MOD_MINOR_VERSION@
MOD_PATCH_VERSION = @MOD_PATCH_VERSION@
LIBNSPR = @LIBNSPR@
LIBPLC = @LIBPLC@
CROSS_COMPILE = @CROSS_COMPILE@
BUILD_OPT = @MOZ_OPTIMIZE@
USE_CPLUS = @USE_CPLUS@
USE_IPV6 = @USE_IPV6@
USE_N32 = @USE_N32@
USE_64 = @USE_64@
GC_LEAK_DETECTOR = @GC_LEAK_DETECTOR@
ENABLE_STRIP = @ENABLE_STRIP@
USE_PTHREADS = @USE_PTHREADS@
USE_BTHREADS = @USE_BTHREADS@
PTHREADS_USER = @USE_USER_PTHREADS@
CLASSIC_NSPR = @USE_NSPR_THREADS@
AS = @AS@
ASFLAGS = @ASFLAGS@
CC = @CC@
CCC = @CXX@
NS_USE_GCC = @GNU_CC@
GCC_USE_GNU_LD = @GCC_USE_GNU_LD@
MSC_VER = @MSC_VER@
AR = @AR@
AR_FLAGS = @AR_FLAGS@
LD = @LD@
RANLIB = @RANLIB@
PERL = @PERL@
RC = @RC@
RCFLAGS = @RCFLAGS@
STRIP = @STRIP@
NSINSTALL = @NSINSTALL@
FILTER = @FILTER@
IMPLIB = @IMPLIB@
CYGWIN_WRAPPER = @CYGWIN_WRAPPER@
OS_CPPFLAGS = @CPPFLAGS@
OS_CFLAGS = $(OS_CPPFLAGS) @CFLAGS@ $(DSO_CFLAGS)
OS_CXXFLAGS = $(OS_CPPFLAGS) @CXXFLAGS@ $(DSO_CFLAGS)
OS_LIBS = @OS_LIBS@
OS_LDFLAGS = @LDFLAGS@
OS_DLLFLAGS = @OS_DLLFLAGS@
DLLFLAGS = @DLLFLAGS@
EXEFLAGS = @EXEFLAGS@
OPTIMIZER = @OPTIMIZER@
MKSHLIB = @MKSHLIB@
DSO_CFLAGS = @DSO_CFLAGS@
DSO_LDOPTS = @DSO_LDOPTS@
RESOLVE_LINK_SYMBOLS = @RESOLVE_LINK_SYMBOLS@
HOST_CC = @HOST_CC@
HOST_CFLAGS = @HOST_CFLAGS@
DEFINES = @DEFINES@ @DEFS@
MDCPUCFG_H = @MDCPUCFG_H@
PR_MD_CSRCS = @PR_MD_CSRCS@
PR_MD_ASFILES = @PR_MD_ASFILES@
PR_MD_ARCH_DIR = @PR_MD_ARCH_DIR@
CPU_ARCH = @CPU_ARCH@
OS_TARGET = @OS_TARGET@
OS_ARCH = @OS_ARCH@
OS_RELEASE = @OS_RELEASE@
OS_TEST = @OS_TEST@
NOSUCHFILE = @NOSUCHFILE@
AIX_LINK_OPTS = @AIX_LINK_OPTS@
MOZ_OBJFORMAT = @MOZ_OBJFORMAT@
ULTRASPARC_LIBRARY = @ULTRASPARC_LIBRARY@
OBJECT_MODE = @OBJECT_MODE@
ifdef OBJECT_MODE
export OBJECT_MODE
endif
VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@

View File

@@ -0,0 +1,164 @@
#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# Configuration information for building in the NSPR source module
# Define an include-at-most-once-flag
NSPR_CONFIG_MK = 1
#
# The variable definitions in this file are inputs to NSPR's
# build system. This file, if present, is included at the
# beginning of config.mk.
#
# For example:
#
# BUILD_OPT=1
# USE_PTHREADS=1
# NS_USE_GCC=
#
ifndef topsrcdir
topsrcdir=$(MOD_DEPTH)
endif
ifndef srcdir
srcdir=.
endif
NFSPWD = $(MOD_DEPTH)/config/nfspwd
CFLAGS = $(VISIBILITY_FLAGS) $(CC_ONLY_FLAGS) $(OPTIMIZER)\
$(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
CCCFLAGS = $(VISIBILITY_FLAGS) $(CCC_ONLY_FLAGS) $(OPTIMIZER)\
$(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
# For purify
NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
NOMD_CCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
$(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
LDFLAGS = $(OS_LDFLAGS)
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
endef
LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
ifeq ($(OS_ARCH),Darwin)
PWD := $(shell pwd)
endif
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
INSTALL = $(NSINSTALL)
else
ifeq ($(NSDISTMODE),copy)
# copy files, but preserve source mtime
INSTALL = $(NSINSTALL) -t
else
ifeq ($(NSDISTMODE),absolute_symlink)
# install using absolute symbolic links
ifeq ($(OS_ARCH),Darwin)
INSTALL = $(NSINSTALL) -L $(PWD)
else
INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
endif
else
# install using relative symbolic links
INSTALL = $(NSINSTALL) -R
endif
endif
endif # (WINNT || OS2) && !CROSS_COMPILE
DEPENDENCIES = $(OBJDIR)/.md
ifdef BUILD_DEBUG_GC
DEFINES += -DDEBUG_GC
endif
GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*)
DIST_GARBAGE += Makefile
####################################################################
#
# The NSPR-specific configuration
#
####################################################################
DEFINES += -DFORCE_PR_LOG
ifeq ($(_PR_NO_CLOCK_TIMER),1)
DEFINES += -D_PR_NO_CLOCK_TIMER
endif
ifeq ($(USE_PTHREADS), 1)
DEFINES += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
endif
ifeq ($(PTHREADS_USER), 1)
DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
endif
ifeq ($(USE_IPV6),1)
DEFINES += -D_PR_INET6
endif
ifeq ($(MOZ_UNICODE),1)
DEFINES += -DMOZ_UNICODE
endif
####################################################################
#
# Configuration for the release process
#
####################################################################
MDIST = /m/dist
ifeq ($(OS_ARCH),WINNT)
MDIST = //helium/dist
MDIST_DOS = $(subst /,\\,$(MDIST))
endif
# RELEASE_DIR is ns/dist/<module name>
RELEASE_DIR = $(MOD_DEPTH)/dist/release/$(MOD_NAME)
RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include
RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin
RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib

View File

@@ -0,0 +1,2 @@
/* Begin all files as hidden visibility */
#pragma GCC visibility push(hidden)

View File

@@ -0,0 +1,158 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* libc_r.h -- macros, defines, etc. to make using reentrant libc calls */
/* a bit easier. This was initially done for AIX pthreads, */
/* but should be usable for anyone... */
/* Most of these use locally defined space instead of static library space. */
/* Because of this, we use the _INIT_R to declare/allocate space (stack), */
/* and the plain routines to actually do it..._WARNING_: avoid allocating */
/* memory wherever possible. Memory allocation is fairly expensive, at */
/* least on AIX...use arrays instead (which allocate from the stack.) */
/* I know the names are a bit strange, but I wanted to be fairly certain */
/* that we didn't have any namespace corruption...in general, the inits are */
/* R_<name>_INIT_R(), and the actual calls are R_<name>_R(). */
#ifndef _LIBC_R_H
#define _LIBC_R_H
/************/
/* strtok */
/************/
#define R_STRTOK_INIT_R() \
char *r_strtok_r=NULL
#define R_STRTOK_R(return,source,delim) \
return=strtok_r(source,delim,&r_strtok_r)
#define R_STRTOK_NORET_R(source,delim) \
strtok_r(source,delim,&r_strtok_r)
/**************/
/* strerror */
/**************/
#define R_MAX_STRERROR_LEN_R 8192 /* Straight from limits.h */
#define R_STRERROR_INIT_R() \
char r_strerror_r[R_MAX_STRERROR_LEN_R]
#define R_STRERROR_R(val) \
strerror_r(val,r_strerror_r,R_MAX_STRERROR_LEN_R)
/*****************/
/* time things */
/*****************/
#define R_ASCTIME_INIT_R() \
char r_asctime_r[26]
#define R_ASCTIME_R(val) \
asctime_r(val,r_asctime_r)
#define R_CTIME_INIT_R() \
char r_ctime_r[26]
#define R_CTIME_R(val) \
ctime_r(val,r_ctime_r)
#define R_GMTIME_INIT_R() \
struct tm r_gmtime_r
#define R_GMTIME_R(time) \
gmtime_r(time,&r_gmtime_r)
#define R_LOCALTIME_INIT_R() \
struct tm r_localtime_r
#define R_LOCALTIME_R(val) \
localtime_r(val,&r_localtime_r)
/***********/
/* crypt */
/***********/
#include <crypt.h>
#define R_CRYPT_INIT_R() \
CRYPTD r_cryptd_r; \
bzero(&r_cryptd_r,sizeof(CRYPTD))
#define R_CRYPT_R(pass,salt) \
crypt_r(pass,salt,&r_cryptd_r)
/**************/
/* pw stuff */
/**************/
#define R_MAX_PW_LEN_R 1024
/* The following must be after the last declaration, but */
/* before the first bit of code... */
#define R_GETPWNAM_INIT_R(pw_ptr) \
struct passwd r_getpwnam_pw_r; \
char r_getpwnam_line_r[R_MAX_PW_LEN_R]; \
pw_ptr = &r_getpwnam_pw_r
#define R_GETPWNAM_R(name) \
getpwnam_r(name,&r_getpwnam_pw_r,r_getpwnam_line_r,R_MAX_PW_LEN_R)
/*******************/
/* gethost stuff */
/*******************/
#define R_GETHOSTBYADDR_INIT_R() \
struct hostent r_gethostbyaddr_r; \
struct hostent_data r_gethostbyaddr_data_r
#define R_GETHOSTBYADDR_R(addr,len,type,xptr_ent) \
bzero(&r_gethostbyaddr_r,sizeof(struct hostent)); \
bzero(&r_gethostbyaddr_data_r,sizeof(struct hostent_data)); \
xptr_ent = &r_gethostbyaddr_r; \
if (gethostbyaddr_r(addr,len,type, \
&r_gethostbyaddr_r,&r_gethostbyaddr_data_r) == -1) { \
xptr_ent = NULL; \
}
#define R_GETHOSTBYNAME_INIT_R() \
struct hostent r_gethostbyname_r; \
struct hostent_data r_gethostbyname_data_r
#define R_GETHOSTBYNAME_R(name,xptr_ent) \
bzero(&r_gethostbyname_r,sizeof(struct hostent)); \
bzero(&r_gethostbyname_data_r,sizeof(struct hostent_data)); \
xptr_ent = &r_gethostbyname_r; \
if (gethostbyname_r(name, \
&r_gethostbyname_r,&r_gethostbyname_data_r) == -1) { \
xptr_ent = NULL; \
}
#endif /* _LIBC_R_H */

View File

@@ -0,0 +1,59 @@
#!/usr/bin/perl
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# IBM Corporation.
# Portions created by the Initial Developer are Copyright (C) 2004
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Brian Ryner <bryner@brianryner.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
$output_dir = shift;
while (<STDIN>) {
chomp;
if (-e "$output_dir/$_") {
next;
}
if (/(.*)\/[^\/*]/) {
mkdir "$output_dir/$1";
}
open OUT, ">$output_dir/$_";
print OUT "#pragma GCC system_header\n"; # suppress include_next warning
print OUT "#pragma GCC visibility push(default)\n";
print OUT "#include_next \<$_\>\n";
print OUT "#pragma GCC visibility pop\n";
close OUT;
}

View File

@@ -0,0 +1,50 @@
#! perl
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
require "fastcwd.pl";
$_ = &fastcwd;
if (m@^/[uh]/@o || s@^/tmp_mnt/@/@o) {
print("$_\n");
} elsif ((($user, $rest) = m@^/usr/people/(\w+)/(.*)@o)
&& readlink("/u/$user") eq "/usr/people/$user") {
print("/u/$user/$rest\n");
} else {
chop($host = `hostname`);
print("/h/$host$_\n");
}

View File

@@ -0,0 +1,142 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdio.h>
#include <stdlib.h>
#if defined(VMS)
#include <sys/timeb.h>
#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
#include <sys/time.h>
#elif defined(WIN32)
#include <windows.h>
#elif defined(XP_OS2_VACPP)
#include <sys/timeb.h>
#else
#error "Architecture not supported"
#endif
int main(int argc, char **argv)
{
#if defined(OMIT_LIB_BUILD_TIME)
/*
* Some platforms don't have any 64-bit integer type
* such as 'long long'. Because we can't use NSPR's
* PR_snprintf in this program, it is difficult to
* print a static initializer for PRInt64 (a struct).
* So we print nothing. The makefiles that build the
* shared libraries will detect the empty output string
* of this program and omit the library build time
* in PRVersionDescription.
*/
#elif defined(VMS)
long long now;
struct timeb b;
ftime(&b);
now = b.time;
now *= 1000000;
now += (1000 * b.millitm);
fprintf(stdout, "%Ld", now);
#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
long long now;
struct timeval tv;
#ifdef HAVE_SVID_GETTOD
gettimeofday(&tv);
#else
gettimeofday(&tv, NULL);
#endif
now = ((1000000LL) * tv.tv_sec) + (long long)tv.tv_usec;
#if defined(OSF1)
fprintf(stdout, "%ld", now);
#elif defined(BEOS) && defined(__POWERPC__)
fprintf(stdout, "%Ld", now); /* Metroworks on BeOS PPC */
#else
fprintf(stdout, "%lld", now);
#endif
#elif defined(WIN32)
__int64 now;
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
CopyMemory(&now, &ft, sizeof(now));
/*
* 116444736000000000 is the number of 100-nanosecond intervals
* between Jan. 1, 1601 and Jan. 1, 1970.
*/
#ifdef __GNUC__
now = (now - 116444736000000000LL) / 10LL;
fprintf(stdout, "%lld", now);
#else
now = (now - 116444736000000000i64) / 10i64;
fprintf(stdout, "%I64d", now);
#endif
#elif defined(XP_OS2_VACPP)
/* no long long or i64 so we use a string */
#include <string.h>
char buf[24];
char tbuf[7];
time_t now;
long mtime;
int i;
struct timeb b;
ftime(&b);
now = b.time;
_ltoa(now, buf, 10);
mtime = b.millitm * 1000;
if (mtime == 0){
++now;
strcat(buf, "000000");
} else {
_ltoa(mtime, tbuf, 10);
for (i = strlen(tbuf); i < 6; ++i)
strcat(buf, "0");
strcat(buf, tbuf);
}
fprintf(stdout, "%s", buf);
#else
#error "Architecture not supported"
#endif
return 0;
} /* main */
/* now.c */

View File

@@ -0,0 +1,602 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
** Netscape portable install command.
**
** Brendan Eich, 7/20/95
*/
#include <stdio.h> /* OSF/1 requires this before grp.h, so put it first */
#include <assert.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <utime.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <stdarg.h>
#ifdef USE_REENTRANT_LIBC
#include "libc_r.h"
#endif /* USE_REENTRANT_LIBC */
#include "pathsub.h"
#define HAVE_FCHMOD
#if defined(BEOS)
#undef HAVE_FCHMOD
#endif
/*
* Does getcwd() take NULL as the first argument and malloc
* the result buffer?
*/
#if !defined(DARWIN) && !defined(NEXTSTEP) && !defined(VMS)
#define GETCWD_CAN_MALLOC
#endif
#ifdef NEXTSTEP
#include <bsd/libc.h>
/*
** balazs.pataki@sztaki.hu: The getcwd is broken in NEXTSTEP (returns 0),
** when called on a mounted fs. Did anyone notice this? Here's an ugly
** workaround ...
*/
#define getcwd(b,s) my_getcwd(b,s)
static char *
my_getcwd (char *buf, size_t size)
{
FILE *pwd = popen("pwd", "r");
char *result = fgets(buf, size, pwd);
if (result) {
buf[strlen(buf)-1] = '\0';
}
pclose (pwd);
return buf;
}
#endif /* NEXTSTEP */
#ifdef LINUX
#include <getopt.h>
#endif
#if defined(SCO) || defined(UNIXWARE) || defined(SNI) || defined(NCR) || defined(NEC) || defined(NEXTSTEP)
#if !defined(S_ISLNK) && defined(S_IFLNK)
#define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK)
#endif
#endif
#if defined(SNI)
extern int fchmod(int fildes, mode_t mode);
#endif
#ifdef QNX
#define d_ino d_stat.st_ino
#endif
static void
usage(void)
{
fprintf(stderr,
"usage: %s [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]\n"
" %*s [-DdltR] file [file ...] directory\n",
program, (int)strlen(program), "");
exit(2);
}
static int
mkdirs(char *path, mode_t mode)
{
char *cp;
struct stat sb;
int res;
while (*path == '/' && path[1] == '/')
path++;
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
*cp = '\0';
if (cp && cp != path) {
*cp = '\0';
if ((stat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
mkdirs(path, mode) < 0) {
return -1;
}
*cp = '/';
}
res = mkdir(path, mode);
if ((res != 0) && (errno == EEXIST))
return 0;
else
return res;
}
static uid_t
touid(char *owner)
{
struct passwd *pw;
uid_t uid;
char *cp;
pw = getpwnam(owner);
if (pw)
return pw->pw_uid;
uid = strtol(owner, &cp, 0);
if (uid == 0 && cp == owner)
fail("cannot find uid for %s", owner);
return uid;
}
static gid_t
togid(char *group)
{
struct group *gr;
gid_t gid;
char *cp;
gr = getgrnam(group);
if (gr)
return gr->gr_gid;
gid = strtol(group, &cp, 0);
if (gid == 0 && cp == group)
fail("cannot find gid for %s", group);
return gid;
}
int
main(int argc, char **argv)
{
int onlydir, dodir, dolink, dorelsymlink, dotimes, opt, len, lplen, tdlen, bnlen, exists, fromfd, tofd, cc, wc;
mode_t mode = 0755;
char *linkprefix, *owner, *group, *cp, *cwd, *todir, *toname, *name, *base, *linkname, *bp, buf[BUFSIZ];
uid_t uid;
gid_t gid;
struct stat sb, tosb;
struct utimbuf utb;
program = argv[0];
cwd = linkname = linkprefix = owner = group = 0;
onlydir = dodir = dolink = dorelsymlink = dotimes = lplen = 0;
while ((opt = getopt(argc, argv, "C:DdlL:Rm:o:g:t")) != EOF) {
switch (opt) {
case 'C':
cwd = optarg;
break;
case 'D':
onlydir = 1;
break;
case 'd':
dodir = 1;
break;
case 'l':
dolink = 1;
break;
case 'L':
linkprefix = optarg;
lplen = strlen(linkprefix);
dolink = 1;
break;
case 'R':
dolink = dorelsymlink = 1;
break;
case 'm':
mode = strtoul(optarg, &cp, 8);
if (mode == 0 && cp == optarg)
usage();
break;
case 'o':
owner = optarg;
break;
case 'g':
group = optarg;
break;
case 't':
dotimes = 1;
break;
default:
usage();
}
}
argc -= optind;
argv += optind;
if (argc < 2 - onlydir)
usage();
todir = argv[argc-1];
if ((stat(todir, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
mkdirs(todir, 0777) < 0) {
fail("cannot make directory %s", todir);
}
if (onlydir)
return 0;
if (!cwd) {
#ifdef GETCWD_CAN_MALLOC
cwd = getcwd(0, PATH_MAX);
#else
cwd = malloc(PATH_MAX + 1);
cwd = getcwd(cwd, PATH_MAX);
#endif
}
xchdir(todir);
#ifdef GETCWD_CAN_MALLOC
todir = getcwd(0, PATH_MAX);
#else
todir = malloc(PATH_MAX + 1);
todir = getcwd(todir, PATH_MAX);
#endif
tdlen = strlen(todir);
xchdir(cwd);
tdlen = strlen(todir);
uid = owner ? touid(owner) : -1;
gid = group ? togid(group) : -1;
while (--argc > 0) {
name = *argv++;
len = strlen(name);
base = xbasename(name);
bnlen = strlen(base);
toname = (char*)xmalloc(tdlen + 1 + bnlen + 1);
sprintf(toname, "%s/%s", todir, base);
exists = (lstat(toname, &tosb) == 0);
if (dodir) {
/* -d means create a directory, always */
if (exists && !S_ISDIR(tosb.st_mode)) {
(void) unlink(toname);
exists = 0;
}
if (!exists && mkdir(toname, mode) < 0)
fail("cannot make directory %s", toname);
if ((owner || group) && chown(toname, uid, gid) < 0)
fail("cannot change owner of %s", toname);
} else if (dolink) {
if (*name == '/') {
/* source is absolute pathname, link to it directly */
linkname = 0;
} else {
if (linkprefix) {
/* -L implies -l and prefixes names with a $cwd arg. */
len += lplen + 1;
linkname = (char*)xmalloc(len + 1);
sprintf(linkname, "%s/%s", linkprefix, name);
} else if (dorelsymlink) {
/* Symlink the relative path from todir to source name. */
linkname = (char*)xmalloc(PATH_MAX);
if (*todir == '/') {
/* todir is absolute: skip over common prefix. */
lplen = relatepaths(todir, cwd, linkname);
strcpy(linkname + lplen, name);
} else {
/* todir is named by a relative path: reverse it. */
reversepath(todir, name, len, linkname);
xchdir(cwd);
}
len = strlen(linkname);
}
name = linkname;
}
/* Check for a pre-existing symlink with identical content. */
if (exists &&
(!S_ISLNK(tosb.st_mode) ||
readlink(toname, buf, sizeof buf) != len ||
strncmp(buf, name, len) != 0)) {
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
exists = 0;
}
if (!exists && symlink(name, toname) < 0)
fail("cannot make symbolic link %s", toname);
#ifdef HAVE_LCHOWN
if ((owner || group) && lchown(toname, uid, gid) < 0)
fail("cannot change owner of %s", toname);
#endif
if (linkname) {
free(linkname);
linkname = 0;
}
} else {
/* Copy from name to toname, which might be the same file. */
fromfd = open(name, O_RDONLY);
if (fromfd < 0 || fstat(fromfd, &sb) < 0)
fail("cannot access %s", name);
if (exists && (!S_ISREG(tosb.st_mode) || access(toname, W_OK) < 0))
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
tofd = open(toname, O_CREAT | O_WRONLY, 0666);
if (tofd < 0)
fail("cannot create %s", toname);
bp = buf;
while ((cc = read(fromfd, bp, sizeof buf)) > 0) {
while ((wc = write(tofd, bp, cc)) > 0) {
if ((cc -= wc) == 0)
break;
bp += wc;
}
if (wc < 0)
fail("cannot write to %s", toname);
}
if (cc < 0)
fail("cannot read from %s", name);
if (ftruncate(tofd, sb.st_size) < 0)
fail("cannot truncate %s", toname);
/*
** On OpenVMS we can't chmod() until the file is closed, and we
** have to utime() last since fchown/chmod alter the timestamps.
*/
#ifndef VMS
if (dotimes) {
utb.actime = sb.st_atime;
utb.modtime = sb.st_mtime;
if (utime(toname, &utb) < 0)
fail("cannot set times of %s", toname);
}
#ifdef HAVE_FCHMOD
if (fchmod(tofd, mode) < 0)
#else
if (chmod(toname, mode) < 0)
#endif
fail("cannot change mode of %s", toname);
#endif
if ((owner || group) && fchown(tofd, uid, gid) < 0)
fail("cannot change owner of %s", toname);
/* Must check for delayed (NFS) write errors on close. */
if (close(tofd) < 0)
fail("cannot write to %s", toname);
close(fromfd);
#ifdef VMS
if (chmod(toname, mode) < 0)
fail("cannot change mode of %s", toname);
if (dotimes) {
utb.actime = sb.st_atime;
utb.modtime = sb.st_mtime;
if (utime(toname, &utb) < 0)
fail("cannot set times of %s", toname);
}
#endif
}
free(toname);
}
free(cwd);
free(todir);
return 0;
}
/*
** Pathname subroutines.
**
** Brendan Eich, 8/29/95
*/
char *program;
void
fail(char *format, ...)
{
int error;
va_list ap;
#ifdef USE_REENTRANT_LIBC
R_STRERROR_INIT_R();
#endif
error = errno;
fprintf(stderr, "%s: ", program);
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
if (error)
#ifdef USE_REENTRANT_LIBC
R_STRERROR_R(errno);
fprintf(stderr, ": %s", r_strerror_r);
#else
fprintf(stderr, ": %s", strerror(errno));
#endif
putc('\n', stderr);
exit(1);
}
char *
getcomponent(char *path, char *name)
{
if (*path == '\0')
return 0;
if (*path == '/') {
*name++ = '/';
} else {
do {
*name++ = *path++;
} while (*path != '/' && *path != '\0');
}
*name = '\0';
while (*path == '/')
path++;
return path;
}
#ifdef UNIXWARE_READDIR_BUFFER_TOO_SMALL
/* Sigh. The static buffer in Unixware's readdir is too small. */
struct dirent * readdir(DIR *d)
{
static struct dirent *buf = NULL;
#define MAX_PATH_LEN 1024
if(buf == NULL)
buf = (struct dirent *) malloc(sizeof(struct dirent) + MAX_PATH_LEN)
;
return(readdir_r(d, buf));
}
#endif
char *
ino2name(ino_t ino, char *dir)
{
DIR *dp;
struct dirent *ep;
char *name;
dp = opendir("..");
if (!dp)
fail("cannot read parent directory");
for (;;) {
if (!(ep = readdir(dp)))
fail("cannot find current directory");
if (ep->d_ino == ino)
break;
}
name = xstrdup(ep->d_name);
closedir(dp);
return name;
}
void *
xmalloc(size_t size)
{
void *p = malloc(size);
if (!p)
fail("cannot allocate %u bytes", size);
return p;
}
char *
xstrdup(char *s)
{
return strcpy((char*)xmalloc(strlen(s) + 1), s);
}
char *
xbasename(char *path)
{
char *cp;
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
*cp = '\0';
if (!cp) return path;
return cp + 1;
}
void
xchdir(char *dir)
{
if (chdir(dir) < 0)
fail("cannot change directory to %s", dir);
}
int
relatepaths(char *from, char *to, char *outpath)
{
char *cp, *cp2;
int len;
char buf[NAME_MAX];
assert(*from == '/' && *to == '/');
for (cp = to, cp2 = from; *cp == *cp2; cp++, cp2++)
if (*cp == '\0')
break;
while (cp[-1] != '/')
cp--, cp2--;
if (cp - 1 == to) {
/* closest common ancestor is /, so use full pathname */
len = strlen(strcpy(outpath, to));
if (outpath[len] != '/') {
outpath[len++] = '/';
outpath[len] = '\0';
}
} else {
len = 0;
while ((cp2 = getcomponent(cp2, buf)) != 0) {
strcpy(outpath + len, "../");
len += 3;
}
while ((cp = getcomponent(cp, buf)) != 0) {
sprintf(outpath + len, "%s/", buf);
len += strlen(outpath + len);
}
}
return len;
}
void
reversepath(char *inpath, char *name, int len, char *outpath)
{
char *cp, *cp2;
char buf[NAME_MAX];
struct stat sb;
cp = strcpy(outpath + PATH_MAX - (len + 1), name);
cp2 = inpath;
while ((cp2 = getcomponent(cp2, buf)) != 0) {
if (strcmp(buf, ".") == 0)
continue;
if (strcmp(buf, "..") == 0) {
if (stat(".", &sb) < 0)
fail("cannot stat current directory");
name = ino2name(sb.st_ino, "..");
len = strlen(name);
cp -= len + 1;
strcpy(cp, name);
cp[len] = '/';
free(name);
xchdir("..");
} else {
cp -= 3;
strncpy(cp, "../", 3);
xchdir(buf);
}
}
strcpy(outpath, cp);
}

View File

@@ -0,0 +1,116 @@
#!/bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
major_version=@MOD_MAJOR_VERSION@
minor_version=@MOD_MINOR_VERSION@
patch_version=@MOD_PATCH_VERSION@
usage()
{
cat <<EOF
Usage: nspr-config [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
[--version]
[--libs]
[--cflags]
Libraries:
nspr
plc
plds
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&2
fi
lib_nspr=yes
lib_plc=yes
lib_plds=yes
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--version)
echo ${major_version}.${minor_version}.${patch_version}
;;
--cflags)
echo_cflags=yes
;;
--libs)
echo_libs=yes
;;
nspr)
lib_nspr=yes
;;
plc)
lib_plc=yes
;;
plds)
lib_plds=yes
;;
*)
usage 1 1>&2
;;
esac
shift
done
if test "$echo_prefix" = "yes"; then
echo $prefix
fi
if test "$echo_exec_prefix" = "yes"; then
echo $exec_prefix
fi
if test "$echo_cflags" = "yes"; then
echo -I${prefix}/include/nspr
fi
if test "$echo_libs" = "yes"; then
libdirs=-L${exec_prefix}/lib
if test -n "$lib_plds"; then
libdirs="$libdirs -lplds${major_version}"
fi
if test -n "$lib_plc"; then
libdirs="$libdirs -lplc${major_version}"
fi
if test -n "$lib_nspr"; then
libdirs="$libdirs -lnspr${major_version}"
fi
os_ldflags="@LDFLAGS@"
for i in $os_ldflags ; do
if echo $i | grep \^-L >/dev/null; then
libdirs="$libdirs $i"
fi
done
echo $libdirs @OS_LIBS@
fi

View File

@@ -0,0 +1,67 @@
# -*- tab-width: 4; -*-
# Configure paths for NSPR
# Public domain - Chris Seawood <cls@seawood.org> 2001-04-05
# Based upon gtk.m4 (also PD) by Owen Taylor
dnl AM_PATH_NSPR([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for NSPR, and define NSPR_CFLAGS and NSPR_LIBS
AC_DEFUN(AM_PATH_NSPR,
[dnl
AC_ARG_WITH(nspr-prefix,
[ --with-nspr-prefix=PFX Prefix where NSPR is installed],
nspr_config_prefix="$withval",
nspr_config_prefix="")
AC_ARG_WITH(nspr-exec-prefix,
[ --with-nspr-exec-prefix=PFX
Exec prefix where NSPR is installed],
nspr_config_exec_prefix="$withval",
nspr_config_exec_prefix="")
if test -n "$nspr_config_exec_prefix"; then
nspr_config_args="$nspr_config_args --exec-prefix=$nspr_config_exec_prefix"
if test -z "$NSPR_CONFIG"; then
NSPR_CONFIG=$nspr_config_exec_prefix/bin/nspr-config
fi
fi
if test -n "$nspr_config_prefix"; then
nspr_config_args="$nspr_config_args --prefix=$nspr_config_prefix"
if test -z "$NSPR_CONFIG"; then
NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config
fi
fi
unset ac_cv_path_NSPR_CONFIG
AC_PATH_PROG(NSPR_CONFIG, nspr-config, no)
min_nspr_version=ifelse([$1], ,4.0.0,$1)
AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version (skipping))
no_nspr=""
if test "$NSPR_CONFIG" = "no"; then
no_nspr="yes"
else
NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags`
NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs`
dnl Skip version check for now
nspr_config_major_version=`$NSPR_CONFIG $nspr_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
nspr_config_minor_version=`$NSPR_CONFIG $nspr_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
nspr_config_micro_version=`$NSPR_CONFIG $nspr_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
fi
if test -z "$no_nspr"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
fi
AC_SUBST(NSPR_CFLAGS)
AC_SUBST(NSPR_LIBS)
])

View File

@@ -0,0 +1,5 @@
# Include in Makefiles to define NSPR variables
NSPR_VERSION = @NSPR_VERSION@
NSPR_LIB = -lnspr@NSPR_VERSION@
NSPR_EXTRA_LIBS = @EXTRA_LIBS@

View File

@@ -0,0 +1,5 @@
# Include in shell scripts to define NSPR variables
NSPR_VERSION=@NSPR_VERSION@
NSPR_LIB=-lnspr$NSPR_VERSION
NSPR_EXTRA_LIBS="@EXTRA_LIBS@"

View File

@@ -0,0 +1,78 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef pathsub_h___
#define pathsub_h___
/*
** Pathname subroutines.
**
** Brendan Eich, 8/29/95
*/
#include <limits.h>
#include <sys/types.h>
#if SUNOS4
#include "../pr/include/md/sunos4.h"
#endif
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
/*
* Just prevent stupidity
*/
#undef NAME_MAX
#define NAME_MAX 256
extern char *program;
extern void fail(char *format, ...);
extern char *getcomponent(char *path, char *name);
extern char *ino2name(ino_t ino, char *dir);
extern void *xmalloc(size_t size);
extern char *xstrdup(char *s);
extern char *xbasename(char *path);
extern void xchdir(char *dir);
/* Relate absolute pathnames from and to returning the result in outpath. */
extern int relatepaths(char *from, char *to, char *outpath);
/* XXX changes current working directory -- caveat emptor */
extern void reversepath(char *inpath, char *name, int len, char *outpath);
#endif /* pathsub_h___ */

View File

@@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* A dummy header file that is a dependency for all the object files.
* Used to force a full recompilation of NSPR in Mozilla's Tinderbox
* depend builds. See comments in rules.mk.
*/
#error "Do not include this header file."

View File

@@ -0,0 +1,38 @@
REM
REM ***** BEGIN LICENSE BLOCK *****
REM Version: MPL 1.1/GPL 2.0/LGPL 2.1
REM
REM The contents of this file are subject to the Mozilla Public License Version
REM 1.1 (the "License"); you may not use this file except in compliance with
REM the License. You may obtain a copy of the License at
REM http://www.mozilla.org/MPL/
REM
REM Software distributed under the License is distributed on an "AS IS" basis,
REM WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
REM for the specific language governing rights and limitations under the
REM License.
REM
REM The Original Code is the Netscape Portable Runtime (NSPR).
REM
REM The Initial Developer of the Original Code is
REM Netscape Communications Corporation.
REM Portions created by the Initial Developer are Copyright (C) 1998-2000
REM the Initial Developer. All Rights Reserved.
REM
REM Contributor(s):
REM
REM Alternatively, the contents of this file may be used under the terms of
REM either the GNU General Public License Version 2 or later (the "GPL"), or
REM the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
REM in which case the provisions of the GPL or the LGPL are applicable instead
REM of those above. If you wish to allow use of your version of this file only
REM under the terms of either the GPL or the LGPL, and not to allow others to
REM use your version of this file under the terms of the MPL, indicate your
REM decision by deleting the provisions above and replace them with the notice
REM and other provisions required by the GPL or the LGPL. If you do not delete
REM the provisions above, a recipient may use your version of this file under
REM the terms of any one of the MPL, the GPL or the LGPL.
REM
REM ***** END LICENSE BLOCK *****
mkdir %1

View File

@@ -0,0 +1,526 @@
#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
################################################################################
# We have a 4 pass build process:
#
# Pass 1. export - Create generated headers and stubs. Publish public headers to
# dist/<arch>/include.
#
# Pass 2. libs - Create libraries. Publish libraries to dist/<arch>/lib.
#
# Pass 3. all - Create programs.
#
# Pass 4. install - Publish programs to dist/<arch>/bin.
#
# Parameters to this makefile (set these before including):
#
# a)
# TARGETS -- the target to create
# (defaults to $LIBRARY $PROGRAM)
# b)
# DIRS -- subdirectories for make to recurse on
# (the 'all' rule builds $TARGETS $DIRS)
# c)
# CSRCS -- .c files to compile
# (used to define $OBJS)
# d)
# PROGRAM -- the target program name to create from $OBJS
# ($OBJDIR automatically prepended to it)
# e)
# LIBRARY -- the target library name to create from $OBJS
# ($OBJDIR automatically prepended to it)
#
################################################################################
ifndef topsrcdir
topsrcdir=$(MOD_DEPTH)
endif
ifndef srcdir
srcdir=.
endif
ifndef NSPR_CONFIG_MK
include $(topsrcdir)/config/config.mk
endif
ifdef USE_AUTOCONF
ifdef CROSS_COMPILE
ifdef INTERNAL_TOOLS
CC=$(HOST_CC)
CCC=$(HOST_CXX)
CFLAGS=$(HOST_CFLAGS)
CXXFLAGS=$(HOST_CXXFLAGS)
endif
endif
endif
#
# This makefile contains rules for building the following kinds of
# libraries:
# - LIBRARY: a static (archival) library
# - SHARED_LIBRARY: a shared (dynamic link) library
# - IMPORT_LIBRARY: an import library, used only on Windows and OS/2
#
# The names of these libraries can be generated by simply specifying
# LIBRARY_NAME and LIBRARY_VERSION.
#
ifdef LIBRARY_NAME
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
#
# Win95, Win16, and OS/2 require library names conforming to the 8.3 rule.
# other platforms do not.
#
ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET)))
LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
else
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
endif
else
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a
else
ifdef MKSHLIB
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
endif
endif
endif
ifeq ($(OS_TARGET),WINCE)
LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
endif
endif # LIBRARY_NAME
ifndef TARGETS
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
ifndef BUILD_OPT
ifdef MSC_VER
ifneq (,$(filter-out 1100 1200,$(MSC_VER)))
TARGETS += $(SHARED_LIB_PDB)
endif
endif
endif
else
TARGETS = $(LIBRARY) $(SHARED_LIBRARY)
endif
ifeq ($(OS_TARGET),WINCE)
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
endif
endif
#
# OBJS is the list of object files. It can be constructed by
# specifying CSRCS (list of C source files) and ASFILES (list
# of assembly language source files).
#
ifndef OBJS
OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
$(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)))
endif
ifeq ($(MOZ_OS2_TOOLS),VACPP)
EXTRA_LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_LIBS))
endif
ALL_TRASH = $(TARGETS) $(OBJS) $(RES) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
$(NOSUCHFILE) \
so_locations
ifeq ($(OS_ARCH),OpenVMS)
ALL_TRASH += $(wildcard *.c*_defines)
ifdef SHARED_LIBRARY
VMS_SYMVEC_FILE = $(SHARED_LIBRARY:.$(DLL_SUFFIX)=_symvec.opt)
VMS_SYMVEC_FILE_MODULE = $(srcdir)/$(LIBRARY_NAME)_symvec.opt
ALL_TRASH += $(VMS_SYMVEC_FILE)
endif
endif
ifndef RELEASE_LIBS_DEST
RELEASE_LIBS_DEST = $(RELEASE_LIB_DIR)
endif
ifdef DIRS
LOOP_OVER_DIRS = \
@for d in $(DIRS); do \
if test -d $$d; then \
set -e; \
echo "cd $$d; $(MAKE) $@"; \
$(MAKE) -C $$d $@; \
set +e; \
else \
echo "Skipping non-directory $$d..."; \
fi; \
done
endif
################################################################################
all:: export
export::
+$(LOOP_OVER_DIRS)
libs:: export
install:: export
clean::
rm -rf $(OBJS) $(RES) so_locations $(NOSUCHFILE) $(GARBAGE)
+$(LOOP_OVER_DIRS)
clobber::
rm -rf $(OBJS) $(RES) $(TARGETS) $(filter-out . ..,$(OBJDIR)) $(GARBAGE) so_locations $(NOSUCHFILE)
+$(LOOP_OVER_DIRS)
realclean clobber_all::
rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH)
+$(LOOP_OVER_DIRS)
distclean::
rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE)
+$(LOOP_OVER_DIRS)
real_install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS)
ifdef RELEASE_BINS
$(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir)
endif
ifdef RELEASE_HEADERS
$(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir)
endif
ifdef RELEASE_LIBS
$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
endif
+$(LOOP_OVER_DIRS)
release:: export
ifdef RELEASE_BINS
@echo "Copying executable programs and scripts to release directory"
@if test -z "$(BUILD_NUMBER)"; then \
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_BIN_DIR); then \
rm -rf $(RELEASE_BIN_DIR); \
$(NSINSTALL) -D $(RELEASE_BIN_DIR);\
else \
true; \
fi
cp $(RELEASE_BINS) $(RELEASE_BIN_DIR)
endif
ifdef RELEASE_LIBS
@echo "Copying libraries to release directory"
@if test -z "$(BUILD_NUMBER)"; then \
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_LIBS_DEST); then \
rm -rf $(RELEASE_LIBS_DEST); \
$(NSINSTALL) -D $(RELEASE_LIBS_DEST);\
else \
true; \
fi
cp $(RELEASE_LIBS) $(RELEASE_LIBS_DEST)
endif
ifdef RELEASE_HEADERS
@echo "Copying header files to release directory"
@if test -z "$(BUILD_NUMBER)"; then \
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_HEADERS_DEST); then \
rm -rf $(RELEASE_HEADERS_DEST); \
$(NSINSTALL) -D $(RELEASE_HEADERS_DEST);\
else \
true; \
fi
cp $(RELEASE_HEADERS) $(RELEASE_HEADERS_DEST)
endif
+$(LOOP_OVER_DIRS)
alltags:
rm -f TAGS tags
find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a
find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a
$(NFSPWD):
cd $(@D); $(MAKE) $(@F)
$(PROGRAM): $(OBJS)
@$(MAKE_OBJDIR)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CC) $(OBJS) -Fe$@ $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
else
$(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS)
endif
endif
ifdef ENABLE_STRIP
$(STRIP) $@
endif
$(LIBRARY): $(OBJS)
@$(MAKE_OBJDIR)
rm -f $@
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(AR) $(subst /,\\,$(OBJS)) $(AR_FLAGS)
else
$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
endif
$(RANLIB) $@
ifeq ($(OS_TARGET), OS2)
$(IMPORT_LIBRARY): $(MAPFILE)
rm -f $@
$(IMPLIB) $@ $(MAPFILE)
endif
$(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE)
@$(MAKE_OBJDIR)
rm -f $@
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
nm -B -C -g $(OBJS) \
| awk '/ [T,D] / {print $$3}' \
| sed -e 's/^\.//' \
| sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
$(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \
-bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
else # AIX 4.1
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE)
else # !os2 vacpp
ifeq ($(OS_TARGET), OpenVMS)
@if test ! -f $(VMS_SYMVEC_FILE); then \
if test -f $(VMS_SYMVEC_FILE_MODULE); then \
echo Creating component options file $(VMS_SYMVEC_FILE); \
cp $(VMS_SYMVEC_FILE_MODULE) $(VMS_SYMVEC_FILE); \
fi; \
fi
endif # OpenVMS
$(MKSHLIB) $(OBJS) $(RES) $(EXTRA_LIBS)
endif # OS2 vacpp
endif # WINNT
endif # AIX 4.1
ifdef ENABLE_STRIP
$(STRIP) $@
endif
ifeq ($(OS_ARCH),WINNT)
$(RES): $(RESNAME)
@$(MAKE_OBJDIR)
# The resource compiler does not understand the -U option.
ifdef NS_USE_GCC
$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
else
$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
endif # GCC
@echo $(RES) finished
endif
$(MAPFILE): $(LIBRARY_NAME).def
@$(MAKE_OBJDIR)
ifeq ($(OS_ARCH),SunOS)
grep -v ';-' $< | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
endif
ifeq ($(OS_ARCH),OS2)
echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@
echo PROTMODE >> $@
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
ifeq ($(MOZ_OS2_TOOLS),VACPP)
grep -v ';+' $< | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' >> $@
else
grep -v ';+' $< | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \
awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
$(ADD_TO_DEF_FILE)
endif
endif
#
# Translate source filenames to absolute paths. This is required for
# debuggers under Windows and OS/2 to find source files automatically.
#
ifeq (,$(filter-out AIX OS2,$(OS_ARCH)))
NEED_ABSOLUTE_PATH = 1
endif
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
NEED_ABSOLUTE_PATH = 1
endif
ifdef NEED_ABSOLUTE_PATH
PWD := $(shell pwd)
abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
@$(MAKE_OBJDIR)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CCC) -o $@ -c $(CCCFLAGS) $(call abspath,$<)
else
$(CCC) -o $@ -c $(CCCFLAGS) $<
endif
endif
endif
WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
$(OBJDIR)/%.$(OBJ_SUFFIX): %.c
@$(MAKE_OBJDIR)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
else
$(CC) -o $@ -c $(CFLAGS) $<
endif
endif
endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.s
@$(MAKE_OBJDIR)
$(AS) -o $@ $(ASFLAGS) -c $<
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(OBJDIR)/%.$(OBJ_SUFFIX): %.asm
@$(MAKE_OBJDIR)
$(AS) -Fdo:./$(OBJDIR) $(ASFLAGS) $<
endif
%.i: %.c
$(CC) -C -E $(CFLAGS) $< > $*.i
%: %.pl
rm -f $@; cp $< $@; chmod +x $@
#
# HACK ALERT
#
# The only purpose of this rule is to pass Mozilla's Tinderbox depend
# builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's
# Tinderbox builds NSPR continuously as part of the Mozilla client.
# Because NSPR's make depend is not implemented, whenever we change
# an NSPR header file, the depend build does not recompile the NSPR
# files that depend on the header.
#
# This rule makes all the objects depend on a dummy header file.
# Touch this dummy header file to force the depend build to recompile
# everything.
#
# This rule should be removed when make depend is implemented.
#
DUMMY_DEPEND_H = $(topsrcdir)/config/prdepend.h
$(filter $(OBJDIR)/%.$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%.$(OBJ_SUFFIX): $(DUMMY_DEPEND_H)
# END OF HACK
################################################################################
# Special gmake rules.
################################################################################
#
# Re-define the list of default suffixes, so gmake won't have to churn through
# hundreds of built-in suffix rules for stuff we don't need.
#
.SUFFIXES:
.SUFFIXES: .a .$(OBJ_SUFFIX) .c .cpp .s .h .i .pl
#
# Fake targets. Always run these rules, even if a file/directory with that
# name already exists.
#
.PHONY: all alltags clean export install libs realclean release
#
# List the target pattern of an implicit rule as a dependency of the
# special target .PRECIOUS to preserve intermediate files made by
# implicit rules whose target patterns match that file's name.
# (See GNU Make documentation, Edition 0.51, May 1996, Sec. 10.4,
# p. 107.)
#
.PRECIOUS: $(OBJDIR)/%.$(OBJ_SUFFIX)

View File

@@ -0,0 +1,168 @@
Aliases.h
arpa/inet.h
assert.h
bsd/libc.h
bsd/syscall.h
bstring.h
builtin.h
c_asm.h
CFBundle.h
CFData.h
CFDictionary.h
CFString.h
CFURL.h
CodeFragments.h
commdlg.h
crt_externs.h
crypt.h
ctype.h
descrip.h
Devices.h
direct.h
dirent.h
dlfcn.h
dl.h
DriverServices.h
dvidef.h
errno.h
Errors.h
Events.h
fcntl.h
fibdef.h
files.h
Files.h
float.h
Folders.h
Gestalt.h
getopt.h
grp.h
ia64/sys/inline.h
ifaddrs.h
image.h
ints.h
iodef.h
io.h
iostream.h
kernel/OS.h
lib$routines.h
limits.h
loader.h
locale.h
LowMem.h
MacErrors.h
machine/builtins.h
machine/clock.h
machine/endian.h
machine/inline.h
mach-o/dyld.h
MacTypes.h
Math64.h
math.h
mbstring.h
memory.h
MixedMode.h
model.h
mswsock.h
Multiprocessing.h
mutex.h
netdb.h
net/if.h
netinet/in.h
netinet/in_systm.h
netinet/tcp.h
OpenTptInternet.h
OpenTransport.h
os2.h
OS.h
osreldate.h
OSUtils.h
poll.h
PPCToolbox.h
Processes.h
process.h
pthread.h
pwd.h
QDOffscreen.h
Resources.h
rld_interface.h
rpc/types.h
semaphore.h
setjmp.h
share.h
signal.h
ssdef.h
starlet.h
stat.h
stdarg.h
stddef.h
stdio.h
stdlib.h
string.h
stropts.h
stsdef.h
support/SupportDefs.h
support/TLS.h
synch.h
sys/atomic_op.h
syscall.h
sys/file.h
sys/filio.h
sys/immu.h
sys/ioctl.h
sys/ipc.h
sys/ldr.h
sys/locking.h
sys/lwp.h
sys/mman.h
sys/mpctl.h
sys/param.h
sys/pda.h
sys/poll.h
sys/prctl.h
sys/priv.h
sys/procfs.h
sys/pstat.h
sys/regset.h
sys/resource.h
sys/sched.h
sys/select.h
sys/sem.h
sys/sendfile.h
sys/shm.h
sys/socket.h
sys/stack.h
sys/stat.h
sys/statvfs.h
sys/syscall.h
sys/sysctl.h
sys/sysmp.h
sys/syssgi.h
sys/systeminfo.h
sys/timeb.h
sys/time.h
sys/times.h
sys/types.h
sys/ucontext.h
sys/uio.h
sys/utsname.h
sys/wait.h
task.h
TextUtils.h
thread.h
time.h
Timer.h
types.h
Types.h
ucontext.h
ucx$inetdef.h
ulocks.h
unistd.h
unix.h
unixlib.h
utime.h
wchar.h
winbase.h
win/compobj.h
windef.h
windows.h
winsock.h

6150
mozilla/nsprpub/configure vendored Executable file

File diff suppressed because it is too large Load Diff

2646
mozilla/nsprpub/configure.in Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,104 @@
#!gmake
# -*- Mode: Makefile -*-
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
ifndef MOZ_SRC_FLIPPED
$(error MOZ_SRC_FLIPPED is not set)
endif
ifndef MOZ_TOP
MOZ_TOP=mozilla
endif
MOZ_DIST_FLIPPED = $(MOZ_SRC_FLIPPED)/mozilla/dist
ifeq ($(OS_TARGET),WINCE)
ifdef MOZ_DEBUG
MOZ_OBJDIR = $(OSVERSION)$(TARGETCPU)_D.OBJ
else
MOZ_OBJDIR = $(OSVERSION)$(TARGETCPU)_O.OBJ
endif
else
ifdef MOZ_DEBUG
MOZ_OBJDIR = WIN32_D.OBJ
else
MOZ_OBJDIR = WIN32_O.OBJ
endif
endif
NSPR_CONFIGURE := ../configure \
--with-mozilla \
--with-dist-prefix=$(MOZ_DIST_FLIPPED) \
--with-dist-bindir=$(MOZ_DIST_FLIPPED)/$(MOZ_OBJDIR)/bin \
--with-dist-libdir=$(MOZ_DIST_FLIPPED)/$(MOZ_OBJDIR)/lib
ifeq (,$(MOZ_DEBUG)$(MOZ_TRACE_MALLOC))
NSPR_CONFIGURE := $(NSPR_CONFIGURE) --enable-optimize --disable-debug
endif
define MAKE_OBJDIR
if test ! -d $(@D) ; then rm -rf $(@D) ; nsinstall -D $(@D) ; fi
endef
all:: build_all
# Argh. nmake keeps the cwd from cmd to cmd and gmake does not
# Furthermore, shmsdos doesn't support '&&' so there's a chance the
# 'cd' could fail and configure would be run in the wrong dir
#
$(MOZ_OBJDIR)/config.status: configure configure.in
@$(MAKE_OBJDIR)
cd $(MOZ_OBJDIR)/ ; \
sh $(NSPR_CONFIGURE)
build_all: $(MOZ_OBJDIR)/config.status check_old
gmake -C $(MOZ_OBJDIR)
clobber_all: $(MOZ_OBJDIR)/config.status check_old
gmake -C $(MOZ_OBJDIR) clobber_all
distclean: check_old
rm -rf WIN32_D.OBJ WIN32_O.OBJ WINCE_D.OBJ WINCE_O.OBJ
check_old:
@if test -f Makefile; then gmake distclean; fi

View File

@@ -0,0 +1,56 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
export NSPR20=1
include $(topsrcdir)/config/config.mk
DIRS = ds libc
include $(topsrcdir)/config/rules.mk
export:: $(TARGETS)

View File

@@ -0,0 +1,7 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
plarenas.h
plarena.h
plhash.h

View File

@@ -0,0 +1,205 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include
CSRCS = \
plarena.c \
plhash.c \
plvrsion.c \
$(NULL)
HEADERS = \
plarenas.h \
plarena.h \
plhash.h \
$(NULL)
HEADERS := $(addprefix $(srcdir)/, $(HEADERS))
ifeq ($(OS_ARCH), WINNT)
ifdef NS_USE_GCC
DLLBASE=-Wl,--image-base -Wl,0x30000000
else
DLLBASE=/BASE:0x30000000
endif # GCC
RES=$(OBJDIR)/plds.res
RESNAME=plds.rc
ifneq ($(OS_TARGET), WINCE)
OS_LIBS = user32.lib
endif
endif # WINNT
ifeq ($(OS_ARCH), AIX)
ifeq ($(CLASSIC_NSPR),1)
OS_LIBS = -lc
else
OS_LIBS = -lc_r
endif
endif
ifeq ($(OS_ARCH),IRIX)
OS_LIBS = -lc
endif
ifeq ($(OS_ARCH),SunOS)
OS_LIBS = -lc
MAPFILE = $(OBJDIR)/pldsmap.sun
GARBAGE += $(MAPFILE)
ifdef NS_USE_GCC
ifdef GCC_USE_GNU_LD
MKSHLIB += -Wl,--version-script,$(MAPFILE)
else
MKSHLIB += -Wl,-M,$(MAPFILE)
endif
else
MKSHLIB += -M $(MAPFILE)
endif
# The -R '$ORIGIN' linker option instructs this library to search for its
# dependencies in the same directory where it resides.
MKSHLIB += -R '$$ORIGIN'
endif
ifeq ($(OS_ARCH),OS2)
MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def
GARBAGE += $(MAPFILE)
MKSHLIB += $(MAPFILE)
endif
EXTRA_LIBS = $(LIBNSPR)
# On NCR and SCOOS, we can't link with extra libraries when
# we build a shared library. If we do so, the linker doesn't
# complain, but we would run into weird problems at run-time.
# Therefore on these platforms, we link just the .o files.
ifeq ($(OS_ARCH),NCR)
EXTRA_LIBS =
endif
ifeq ($(OS_ARCH),SCOOS)
EXTRA_LIBS =
endif
ifdef RESOLVE_LINK_SYMBOLS
EXTRA_LIBS += $(OS_LIBS)
endif
LIBRARY_NAME = plds
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
RELEASE_HEADERS = $(HEADERS)
RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
RELEASE_LIBS = $(TARGETS)
include $(topsrcdir)/config/rules.mk
#
# Version information generation (begin)
#
ECHO = echo
TINC = $(OBJDIR)/_pl_bld.h
PROD = $(notdir $(SHARED_LIBRARY))
NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
SH_DATE = $(shell date "+%Y-%m-%d %T")
SH_NOW = $(shell $(NOW))
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
SUF = i64
else
SUF = LL
endif
GARBAGE += $(TINC)
$(TINC):
@$(MAKE_OBJDIR)
@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
@if test ! -z "$(SH_NOW)"; then \
$(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
else \
true; \
fi
@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
endif
endif
#
# Version information generation (end)
#
#
# The Client build wants the shared libraries in $(dist_bindir),
# so we also install them there.
#
export:: $(TARGETS)
$(INSTALL) -m 444 $(HEADERS) $(dist_includedir)
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
ifdef SHARED_LIBRARY
ifeq ($(OS_ARCH),HP-UX)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
else
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
endif
endif
ifeq ($(MOZ_BITS),16)
$(INSTALL) -m 444 $(HEADERS) $(MOZ_INCL)
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/bin
endif

View File

@@ -0,0 +1,432 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK *****
*/
/*
* Lifetime-based fast allocation, inspired by much prior art, including
* "Fast Allocation and Deallocation of Memory Based on Object Lifetimes"
* David R. Hanson, Software -- Practice and Experience, Vol. 20(1).
*/
#include <stdlib.h>
#include <string.h>
#include "plarena.h"
#include "prmem.h"
#include "prbit.h"
#include "prlog.h"
#include "prlock.h"
#include "prinit.h"
static PLArena *arena_freelist;
#ifdef PL_ARENAMETER
static PLArenaStats *arena_stats_list;
#define COUNT(pool,what) (pool)->stats.what++
#else
#define COUNT(pool,what) /* nothing */
#endif
#define PL_ARENA_DEFAULT_ALIGN sizeof(double)
static PRLock *arenaLock;
static PRCallOnceType once;
/*
** InitializeArenas() -- Initialize arena operations.
**
** InitializeArenas() is called exactly once and only once from
** LockArena(). This function creates the arena protection
** lock: arenaLock.
**
** Note: If the arenaLock cannot be created, InitializeArenas()
** fails quietly, returning only PR_FAILURE. This percolates up
** to the application using the Arena API. He gets no arena
** from PL_ArenaAllocate(). It's up to him to fail gracefully
** or recover.
**
*/
static PRStatus InitializeArenas( void )
{
PR_ASSERT( arenaLock == NULL );
arenaLock = PR_NewLock();
if ( arenaLock == NULL )
return PR_FAILURE;
else
return PR_SUCCESS;
} /* end ArenaInitialize() */
static PRStatus LockArena( void )
{
PRStatus rc = PR_CallOnce( &once, InitializeArenas );
if ( PR_FAILURE != rc )
PR_Lock( arenaLock );
return(rc);
} /* end LockArena() */
static void UnlockArena( void )
{
PR_Unlock( arenaLock );
return;
} /* end UnlockArena() */
PR_IMPLEMENT(void) PL_InitArenaPool(
PLArenaPool *pool, const char *name, PRUint32 size, PRUint32 align)
{
#if defined(XP_MAC)
#pragma unused (name)
#endif
if (align == 0)
align = PL_ARENA_DEFAULT_ALIGN;
pool->mask = PR_BITMASK(PR_CeilingLog2(align));
pool->first.next = NULL;
pool->first.base = pool->first.avail = pool->first.limit =
(PRUword)PL_ARENA_ALIGN(pool, &pool->first + 1);
pool->current = &pool->first;
pool->arenasize = size;
#ifdef PL_ARENAMETER
memset(&pool->stats, 0, sizeof pool->stats);
pool->stats.name = strdup(name);
pool->stats.next = arena_stats_list;
arena_stats_list = &pool->stats;
#endif
}
/*
** PL_ArenaAllocate() -- allocate space from an arena pool
**
** Description: PL_ArenaAllocate() allocates space from an arena
** pool.
**
** First, try to satisfy the request from arenas starting at
** pool->current.
**
** If there is not enough space in the arena pool->current, try
** to claim an arena, on a first fit basis, from the global
** freelist (arena_freelist).
**
** If no arena in arena_freelist is suitable, then try to
** allocate a new arena from the heap.
**
** Returns: pointer to allocated space or NULL
**
** Notes: The original implementation had some difficult to
** solve bugs; the code was difficult to read. Sometimes it's
** just easier to rewrite it. I did that. larryh.
**
** See also: bugzilla: 45343.
**
*/
PR_IMPLEMENT(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb)
{
PLArena *a;
char *rp; /* returned pointer */
PR_ASSERT((nb & pool->mask) == 0);
nb = (PRUword)PL_ARENA_ALIGN(pool, nb); /* force alignment */
/* attempt to allocate from arenas at pool->current */
{
a = pool->current;
do {
if ( a->avail +nb <= a->limit ) {
pool->current = a;
rp = (char *)a->avail;
a->avail += nb;
return rp;
}
} while( NULL != (a = a->next) );
}
/* attempt to allocate from arena_freelist */
{
PLArena *p; /* previous pointer, for unlinking from freelist */
/* lock the arena_freelist. Make access to the freelist MT-Safe */
if ( PR_FAILURE == LockArena())
return(0);
for ( a = arena_freelist, p = NULL; a != NULL ; p = a, a = a->next ) {
if ( a->base +nb <= a->limit ) {
if ( p == NULL )
arena_freelist = a->next;
else
p->next = a->next;
UnlockArena();
a->avail = a->base;
rp = (char *)a->avail;
a->avail += nb;
/* the newly allocated arena is linked after pool->current
* and becomes pool->current */
a->next = pool->current->next;
pool->current->next = a;
pool->current = a;
if ( NULL == pool->first.next )
pool->first.next = a;
return(rp);
}
}
UnlockArena();
}
/* attempt to allocate from the heap */
{
PRUint32 sz = PR_MAX(pool->arenasize, nb);
sz += sizeof *a + pool->mask; /* header and alignment slop */
a = (PLArena*)PR_MALLOC(sz);
if ( NULL != a ) {
a->limit = (PRUword)a + sz;
a->base = a->avail = (PRUword)PL_ARENA_ALIGN(pool, a + 1);
rp = (char *)a->avail;
a->avail += nb;
/* the newly allocated arena is linked after pool->current
* and becomes pool->current */
a->next = pool->current->next;
pool->current->next = a;
pool->current = a;
if ( NULL == pool->first.next )
pool->first.next = a;
PL_COUNT_ARENA(pool,++);
COUNT(pool, nmallocs);
return(rp);
}
}
/* we got to here, and there's no memory to allocate */
return(NULL);
} /* --- end PL_ArenaAllocate() --- */
PR_IMPLEMENT(void *) PL_ArenaGrow(
PLArenaPool *pool, void *p, PRUint32 size, PRUint32 incr)
{
void *newp;
PL_ARENA_ALLOCATE(newp, pool, size + incr);
if (newp)
memcpy(newp, p, size);
return newp;
}
/*
* Free tail arenas linked after head, which may not be the true list head.
* Reset pool->current to point to head in case it pointed at a tail arena.
*/
static void FreeArenaList(PLArenaPool *pool, PLArena *head, PRBool reallyFree)
{
PLArena **ap, *a;
ap = &head->next;
a = *ap;
if (!a)
return;
#ifdef DEBUG
do {
PR_ASSERT(a->base <= a->avail && a->avail <= a->limit);
a->avail = a->base;
PL_CLEAR_UNUSED(a);
} while ((a = a->next) != 0);
a = *ap;
#endif
if (reallyFree) {
do {
*ap = a->next;
PL_CLEAR_ARENA(a);
PL_COUNT_ARENA(pool,--);
PR_DELETE(a);
} while ((a = *ap) != 0);
} else {
/* Insert the whole arena chain at the front of the freelist. */
do {
ap = &(*ap)->next;
} while (*ap);
LockArena();
*ap = arena_freelist;
arena_freelist = a;
head->next = 0;
UnlockArena();
}
pool->current = head;
}
PR_IMPLEMENT(void) PL_ArenaRelease(PLArenaPool *pool, char *mark)
{
PLArena *a;
for (a = pool->first.next; a; a = a->next) {
if (PR_UPTRDIFF(mark, a->base) < PR_UPTRDIFF(a->avail, a->base)) {
a->avail = (PRUword)PL_ARENA_ALIGN(pool, mark);
FreeArenaList(pool, a, PR_FALSE);
return;
}
}
}
PR_IMPLEMENT(void) PL_FreeArenaPool(PLArenaPool *pool)
{
FreeArenaList(pool, &pool->first, PR_FALSE);
COUNT(pool, ndeallocs);
}
PR_IMPLEMENT(void) PL_FinishArenaPool(PLArenaPool *pool)
{
FreeArenaList(pool, &pool->first, PR_TRUE);
#ifdef PL_ARENAMETER
{
PLArenaStats *stats, **statsp;
if (pool->stats.name)
PR_DELETE(pool->stats.name);
for (statsp = &arena_stats_list; (stats = *statsp) != 0;
statsp = &stats->next) {
if (stats == &pool->stats) {
*statsp = stats->next;
return;
}
}
}
#endif
}
PR_IMPLEMENT(void) PL_CompactArenaPool(PLArenaPool *ap)
{
#if XP_MAC
#pragma unused (ap)
#if 0
PRArena *curr = &(ap->first);
while (curr) {
reallocSmaller(curr, curr->avail - (uprword_t)curr);
curr->limit = curr->avail;
curr = curr->next;
}
#endif
#endif
}
PR_IMPLEMENT(void) PL_ArenaFinish(void)
{
PLArena *a, *next;
for (a = arena_freelist; a; a = next) {
next = a->next;
PR_DELETE(a);
}
arena_freelist = NULL;
if (arenaLock) {
PR_DestroyLock(arenaLock);
arenaLock = NULL;
}
}
#ifdef PL_ARENAMETER
PR_IMPLEMENT(void) PL_ArenaCountAllocation(PLArenaPool *pool, PRUint32 nb)
{
pool->stats.nallocs++;
pool->stats.nbytes += nb;
if (nb > pool->stats.maxalloc)
pool->stats.maxalloc = nb;
pool->stats.variance += nb * nb;
}
PR_IMPLEMENT(void) PL_ArenaCountInplaceGrowth(
PLArenaPool *pool, PRUint32 size, PRUint32 incr)
{
pool->stats.ninplace++;
}
PR_IMPLEMENT(void) PL_ArenaCountGrowth(
PLArenaPool *pool, PRUint32 size, PRUint32 incr)
{
pool->stats.ngrows++;
pool->stats.nbytes += incr;
pool->stats.variance -= size * size;
size += incr;
if (size > pool->stats.maxalloc)
pool->stats.maxalloc = size;
pool->stats.variance += size * size;
}
PR_IMPLEMENT(void) PL_ArenaCountRelease(PLArenaPool *pool, char *mark)
{
pool->stats.nreleases++;
}
PR_IMPLEMENT(void) PL_ArenaCountRetract(PLArenaPool *pool, char *mark)
{
pool->stats.nfastrels++;
}
#include <math.h>
#include <stdio.h>
PR_IMPLEMENT(void) PL_DumpArenaStats(FILE *fp)
{
PLArenaStats *stats;
double mean, variance;
for (stats = arena_stats_list; stats; stats = stats->next) {
if (stats->nallocs != 0) {
mean = (double)stats->nbytes / stats->nallocs;
variance = fabs(stats->variance / stats->nallocs - mean * mean);
} else {
mean = variance = 0;
}
fprintf(fp, "\n%s allocation statistics:\n", stats->name);
fprintf(fp, " number of arenas: %u\n", stats->narenas);
fprintf(fp, " number of allocations: %u\n", stats->nallocs);
fprintf(fp, " number of free arena reclaims: %u\n", stats->nreclaims);
fprintf(fp, " number of malloc calls: %u\n", stats->nmallocs);
fprintf(fp, " number of deallocations: %u\n", stats->ndeallocs);
fprintf(fp, " number of allocation growths: %u\n", stats->ngrows);
fprintf(fp, " number of in-place growths: %u\n", stats->ninplace);
fprintf(fp, "number of released allocations: %u\n", stats->nreleases);
fprintf(fp, " number of fast releases: %u\n", stats->nfastrels);
fprintf(fp, " total bytes allocated: %u\n", stats->nbytes);
fprintf(fp, " mean allocation size: %g\n", mean);
fprintf(fp, " standard deviation: %g\n", sqrt(variance));
fprintf(fp, " maximum allocation size: %u\n", stats->maxalloc);
}
}
#endif /* PL_ARENAMETER */

View File

@@ -0,0 +1,213 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK *****
*/
#ifndef plarena_h___
#define plarena_h___
/*
* Lifetime-based fast allocation, inspired by much prior art, including
* "Fast Allocation and Deallocation of Memory Based on Object Lifetimes"
* David R. Hanson, Software -- Practice and Experience, Vol. 20(1).
*
* Also supports LIFO allocation (PL_ARENA_MARK/PL_ARENA_RELEASE).
*/
#include "prtypes.h"
#include "plarenas.h"
PR_BEGIN_EXTERN_C
typedef struct PLArena PLArena;
struct PLArena {
PLArena *next; /* next arena for this lifetime */
PRUword base; /* aligned base address, follows this header */
PRUword limit; /* one beyond last byte in arena */
PRUword avail; /* points to next available byte */
};
#ifdef PL_ARENAMETER
typedef struct PLArenaStats PLArenaStats;
struct PLArenaStats {
PLArenaStats *next; /* next in arenaStats list */
char *name; /* name for debugging */
PRUint32 narenas; /* number of arenas in pool */
PRUint32 nallocs; /* number of PL_ARENA_ALLOCATE() calls */
PRUint32 nreclaims; /* number of reclaims from freeArenas */
PRUint32 nmallocs; /* number of malloc() calls */
PRUint32 ndeallocs; /* number of lifetime deallocations */
PRUint32 ngrows; /* number of PL_ARENA_GROW() calls */
PRUint32 ninplace; /* number of in-place growths */
PRUint32 nreleases; /* number of PL_ARENA_RELEASE() calls */
PRUint32 nfastrels; /* number of "fast path" releases */
PRUint32 nbytes; /* total bytes allocated */
PRUint32 maxalloc; /* maximum allocation size in bytes */
PRFloat64 variance; /* size variance accumulator */
};
#endif
struct PLArenaPool {
PLArena first; /* first arena in pool list */
PLArena *current; /* arena from which to allocate space */
PRUint32 arenasize; /* net exact size of a new arena */
PRUword mask; /* alignment mask (power-of-2 - 1) */
#ifdef PL_ARENAMETER
PLArenaStats stats;
#endif
};
/*
* If the including .c file uses only one power-of-2 alignment, it may define
* PL_ARENA_CONST_ALIGN_MASK to the alignment mask and save a few instructions
* per ALLOCATE and GROW.
*/
#ifdef PL_ARENA_CONST_ALIGN_MASK
#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + PL_ARENA_CONST_ALIGN_MASK) \
& ~PL_ARENA_CONST_ALIGN_MASK)
#define PL_INIT_ARENA_POOL(pool, name, size) \
PL_InitArenaPool(pool, name, size, PL_ARENA_CONST_ALIGN_MASK + 1)
#else
#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
#endif
#define PL_ARENA_ALLOCATE(p, pool, nb) \
PR_BEGIN_MACRO \
PLArena *_a = (pool)->current; \
PRUint32 _nb = PL_ARENA_ALIGN(pool, nb); \
PRUword _p = _a->avail; \
PRUword _q = _p + _nb; \
if (_q > _a->limit) \
_p = (PRUword)PL_ArenaAllocate(pool, _nb); \
else \
_a->avail = _q; \
p = (void *)_p; \
PL_ArenaCountAllocation(pool, nb); \
PR_END_MACRO
#define PL_ARENA_GROW(p, pool, size, incr) \
PR_BEGIN_MACRO \
PLArena *_a = (pool)->current; \
PRUint32 _incr = PL_ARENA_ALIGN(pool, incr); \
PRUword _p = _a->avail; \
PRUword _q = _p + _incr; \
if (_p == (PRUword)(p) + PL_ARENA_ALIGN(pool, size) && \
_q <= _a->limit) { \
_a->avail = _q; \
PL_ArenaCountInplaceGrowth(pool, size, incr); \
} else { \
p = PL_ArenaGrow(pool, p, size, incr); \
} \
PL_ArenaCountGrowth(pool, size, incr); \
PR_END_MACRO
#define PL_ARENA_MARK(pool) ((void *) (pool)->current->avail)
#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q))
#ifdef DEBUG
#define PL_FREE_PATTERN 0xDA
#define PL_CLEAR_UNUSED(a) (PR_ASSERT((a)->avail <= (a)->limit), \
memset((void*)(a)->avail, PL_FREE_PATTERN, \
(a)->limit - (a)->avail))
#define PL_CLEAR_ARENA(a) memset((void*)(a), PL_FREE_PATTERN, \
(a)->limit - (PRUword)(a))
#else
#define PL_CLEAR_UNUSED(a)
#define PL_CLEAR_ARENA(a)
#endif
#define PL_ARENA_RELEASE(pool, mark) \
PR_BEGIN_MACRO \
char *_m = (char *)(mark); \
PLArena *_a = (pool)->current; \
if (PR_UPTRDIFF(_m, _a->base) <= PR_UPTRDIFF(_a->avail, _a->base)) { \
_a->avail = (PRUword)PL_ARENA_ALIGN(pool, _m); \
PL_CLEAR_UNUSED(_a); \
PL_ArenaCountRetract(pool, _m); \
} else { \
PL_ArenaRelease(pool, _m); \
} \
PL_ArenaCountRelease(pool, _m); \
PR_END_MACRO
#ifdef PL_ARENAMETER
#define PL_COUNT_ARENA(pool,op) ((pool)->stats.narenas op)
#else
#define PL_COUNT_ARENA(pool,op)
#endif
#define PL_ARENA_DESTROY(pool, a, pnext) \
PR_BEGIN_MACRO \
PL_COUNT_ARENA(pool,--); \
if ((pool)->current == (a)) (pool)->current = &(pool)->first; \
*(pnext) = (a)->next; \
PL_CLEAR_ARENA(a); \
free(a); \
(a) = 0; \
PR_END_MACRO
#ifdef PL_ARENAMETER
#include <stdio.h>
PR_EXTERN(void) PL_ArenaCountAllocation(PLArenaPool *pool, PRUint32 nb);
PR_EXTERN(void) PL_ArenaCountInplaceGrowth(
PLArenaPool *pool, PRUint32 size, PRUint32 incr);
PR_EXTERN(void) PL_ArenaCountGrowth(
PLArenaPool *pool, PRUint32 size, PRUint32 incr);
PR_EXTERN(void) PL_ArenaCountRelease(PLArenaPool *pool, char *mark);
PR_EXTERN(void) PL_ArenaCountRetract(PLArenaPool *pool, char *mark);
PR_EXTERN(void) PL_DumpArenaStats(FILE *fp);
#else /* !PL_ARENAMETER */
#define PL_ArenaCountAllocation(ap, nb) /* nothing */
#define PL_ArenaCountInplaceGrowth(ap, size, incr) /* nothing */
#define PL_ArenaCountGrowth(ap, size, incr) /* nothing */
#define PL_ArenaCountRelease(ap, mark) /* nothing */
#define PL_ArenaCountRetract(ap, mark) /* nothing */
#endif /* !PL_ARENAMETER */
PR_END_EXTERN_C
#endif /* plarena_h___ */

View File

@@ -0,0 +1,115 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#if defined(PLARENAS_H)
#else /* defined(PLARENAS_H) */
#define PLARENAS_H
PR_BEGIN_EXTERN_C
typedef struct PLArenaPool PLArenaPool;
/*
** Allocate an arena pool as specified by the parameters.
**
** This is equivelant to allocating the space yourself and then
** calling PL_InitArenaPool().
**
** This function may fail (and return a NULL) for a variety of
** reasons. The reason for a particular failure can be discovered
** by calling PR_GetError().
*/
#if 0 /* Not implemented */
PR_EXTERN(PLArenaPool*) PL_AllocArenaPool(
const char *name, PRUint32 size, PRUint32 align);
#endif
/*
** Destroy an arena pool previously allocated by PL_AllocArenaPool().
**
** This function may fail if the arena is not empty and the caller
** wishes to check for empty upon descruction.
*/
#if 0 /* Not implemented */
PR_EXTERN(PRStatus) PL_DestroyArenaPool(PLArenaPool *pool, PRBool checkEmpty);
#endif
/*
** Initialize an arena pool with the given name for debugging and metering,
** with a minimum size per arena of size bytes.
**/
PR_EXTERN(void) PL_InitArenaPool(
PLArenaPool *pool, const char *name, PRUint32 size, PRUint32 align);
/*
** Finish using arenas, freeing all memory associated with them.
**/
PR_EXTERN(void) PL_ArenaFinish(void);
/*
** Free the arenas in pool. The user may continue to allocate from pool
** after calling this function. There is no need to call PL_InitArenaPool()
** again unless PL_FinishArenaPool(pool) has been called.
**/
PR_EXTERN(void) PL_FreeArenaPool(PLArenaPool *pool);
/*
** Free the arenas in pool and finish using it altogether.
**/
PR_EXTERN(void) PL_FinishArenaPool(PLArenaPool *pool);
/*
** Compact all of the arenas in a pool so that no space is wasted.
**/
PR_EXTERN(void) PL_CompactArenaPool(PLArenaPool *pool);
/*
** Friend functions used by the PL_ARENA_*() macros.
**/
PR_EXTERN(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb);
PR_EXTERN(void *) PL_ArenaGrow(
PLArenaPool *pool, void *p, PRUint32 size, PRUint32 incr);
PR_EXTERN(void) PL_ArenaRelease(PLArenaPool *pool, char *mark);
PR_END_EXTERN_C
#endif /* defined(PLARENAS_H) */
/* plarenas */

View File

@@ -0,0 +1,83 @@
;+#
;+# ***** BEGIN LICENSE BLOCK *****
;+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
;+#
;+# The contents of this file are subject to the Mozilla Public License Version
;+# 1.1 (the "License"); you may not use this file except in compliance with
;+# the License. You may obtain a copy of the License at
;+# http://www.mozilla.org/MPL/
;+#
;+# Software distributed under the License is distributed on an "AS IS" basis,
;+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
;+# for the specific language governing rights and limitations under the
;+# License.
;+#
;+# The Original Code is the Netscape Portable Runtime (NSPR).
;+#
;+# The Initial Developer of the Original Code is
;+# Netscape Communications Corporation.
;+# Portions created by the Initial Developer are Copyright (C) 2002-2003
;+# the Initial Developer. All Rights Reserved.
;+#
;+# Contributor(s):
;+#
;+# Alternatively, the contents of this file may be used under the terms of
;+# either the GNU General Public License Version 2 or later (the "GPL"), or
;+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
;+# in which case the provisions of the GPL or the LGPL are applicable instead
;+# of those above. If you wish to allow use of your version of this file only
;+# under the terms of either the GPL or the LGPL, and not to allow others to
;+# use your version of this file under the terms of the MPL, indicate your
;+# decision by deleting the provisions above and replace them with the notice
;+# and other provisions required by the GPL or the LGPL. If you do not delete
;+# the provisions above, a recipient may use your version of this file under
;+# the terms of any one of the MPL, the GPL or the LGPL.
;+#
;+# ***** END LICENSE BLOCK *****
;+#
;+# OK, this file is meant to support SUN, LINUX, AIX, OS/2 and WINDOWS
;+# 1. For all unix platforms, the string ";-" means "remove this line"
;+# 2. For all unix platforms, the string " DATA " will be removed from any
;+# line on which it occurs.
;+# 3. Lines containing ";+" will have ";+" removed on SUN and LINUX.
;+# On AIX, lines containing ";+" will be removed.
;+# 4. For all unix platforms, the string ";;" will thave the ";;" removed.
;+# 5. For all unix platforms, after the above processing has taken place,
;+# all characters after the first ";" on the line will be removed.
;+# And for AIX, the first ";" will also be removed.
;+# This file is passed directly to windows. Since ';' is a comment, all UNIX
;+# directives are hidden behind ";", ";+", and ";-"
;+NSPR_4.0 {
;+ global:
LIBRARY plds4 ;-
EXPORTS ;-
PL_ArenaAllocate;
PL_ArenaFinish;
PL_ArenaGrow;
PL_ArenaRelease;
PL_CompactArenaPool;
PL_CompareStrings;
PL_CompareValues;
PL_FinishArenaPool;
PL_FreeArenaPool;
PL_HashString;
PL_HashTableAdd;
PL_HashTableDestroy;
PL_HashTableDump;
PL_HashTableEnumerateEntries;
PL_HashTableLookup;
PL_HashTableRawAdd;
PL_HashTableRawLookup;
PL_HashTableRawRemove;
PL_HashTableRemove;
PL_InitArenaPool;
PL_NewHashTable;
libVersionPoint;
;+ local: *;
;+};
;+
;+NSPR_4.1 {
;+ global:
PL_HashTableLookupConst;
PL_HashTableRawLookupConst;
;+} NSPR_4.0;

View File

@@ -0,0 +1,102 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prinit.h"
#include <winver.h>
#define MY_LIBNAME "plds"
#define MY_FILEDESCRIPTION "PLDS Library"
#define STRINGIZE(x) #x
#define STRINGIZE2(x) STRINGIZE(x)
#define PR_VMAJOR_STR STRINGIZE2(PR_VMAJOR)
#ifdef _DEBUG
#define MY_DEBUG_STR " (debug)"
#define MY_FILEFLAGS_1 VS_FF_DEBUG
#else
#define MY_DEBUG_STR ""
#define MY_FILEFLAGS_1 0x0L
#endif
#if PR_BETA
#define MY_FILEFLAGS_2 MY_FILEFLAGS_1|VS_FF_PRERELEASE
#else
#define MY_FILEFLAGS_2 MY_FILEFLAGS_1
#endif
#ifdef WINNT
#define MY_FILEOS VOS_NT_WINDOWS32
#define MY_INTERNAL_NAME "lib" MY_LIBNAME PR_VMAJOR_STR
#else
#define MY_FILEOS VOS__WINDOWS32
#define MY_INTERNAL_NAME MY_LIBNAME PR_VMAJOR_STR
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Version-information resource
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION PR_VMAJOR,PR_VMINOR,PR_VPATCH,0
PRODUCTVERSION PR_VMAJOR,PR_VMINOR,PR_VPATCH,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS MY_FILEFLAGS_2
FILEOS MY_FILEOS
FILETYPE VFT_DLL
FILESUBTYPE 0x0L // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0" // Lang=US English, CharSet=Unicode
BEGIN
VALUE "CompanyName", "Netscape Communications Corporation\0"
VALUE "FileDescription", MY_FILEDESCRIPTION MY_DEBUG_STR "\0"
VALUE "FileVersion", PR_VERSION "\0"
VALUE "InternalName", MY_INTERNAL_NAME "\0"
VALUE "LegalCopyright", "Copyright \251 1996-2000 Netscape Communications Corporation\0"
VALUE "OriginalFilename", MY_INTERNAL_NAME ".dll\0"
VALUE "ProductName", "Netscape Portable Runtime\0"
VALUE "ProductVersion", PR_VERSION "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,37 @@
! Fixed section of symbol vector for LIBPLDS4
!
GSMATCH=LEQUAL,2,2
case_sensitive=YES
!
! --------------------------------------------------------------------------
! Ident 2,2 introduced for Mozilla 1.3
! Previously this was empty. Now we include everything that's specified in
! plds.def.
! --------------------------------------------------------------------------
!
! NSPR 4.0
SYMBOL_VECTOR=(PL_ArenaAllocate=PROCEDURE)
SYMBOL_VECTOR=(PL_ArenaFinish=PROCEDURE)
SYMBOL_VECTOR=(PL_ArenaGrow=PROCEDURE)
SYMBOL_VECTOR=(PL_ArenaRelease=PROCEDURE)
SYMBOL_VECTOR=(PL_CompactArenaPool=PROCEDURE)
SYMBOL_VECTOR=(PL_CompareStrings=PROCEDURE)
SYMBOL_VECTOR=(PL_CompareValues=PROCEDURE)
SYMBOL_VECTOR=(PL_FinishArenaPool=PROCEDURE)
SYMBOL_VECTOR=(PL_FreeArenaPool=PROCEDURE)
SYMBOL_VECTOR=(PL_HashString=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableAdd=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableDestroy=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableDump=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableEnumerateEntries=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableLookup=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableRawAdd=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableRawLookup=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableRawRemove=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableRemove=PROCEDURE)
SYMBOL_VECTOR=(PL_InitArenaPool=PROCEDURE)
SYMBOL_VECTOR=(PL_NewHashTable=PROCEDURE)
SYMBOL_VECTOR=(libVersionPoint=PROCEDURE)
! NSPR 4.1
SYMBOL_VECTOR=(PL_HashTableLookupConst=PROCEDURE)
SYMBOL_VECTOR=(PL_HashTableRawLookupConst=PROCEDURE)

View File

@@ -0,0 +1,541 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* PL hash table package.
*/
#include "plhash.h"
#include "prbit.h"
#include "prlog.h"
#include "prmem.h"
#include "prtypes.h"
#include <stdlib.h>
#include <string.h>
/* Compute the number of buckets in ht */
#define NBUCKETS(ht) (1 << (PL_HASH_BITS - (ht)->shift))
/* The smallest table has 16 buckets */
#define MINBUCKETSLOG2 4
#define MINBUCKETS (1 << MINBUCKETSLOG2)
/* Compute the maximum entries given n buckets that we will tolerate, ~90% */
#define OVERLOADED(n) ((n) - ((n) >> 3))
/* Compute the number of entries below which we shrink the table by half */
#define UNDERLOADED(n) (((n) > MINBUCKETS) ? ((n) >> 2) : 0)
/*
** Stubs for default hash allocator ops.
*/
static void * PR_CALLBACK
DefaultAllocTable(void *pool, PRSize size)
{
#if defined(XP_MAC)
#pragma unused (pool)
#endif
return PR_MALLOC(size);
}
static void PR_CALLBACK
DefaultFreeTable(void *pool, void *item)
{
#if defined(XP_MAC)
#pragma unused (pool)
#endif
PR_Free(item);
}
static PLHashEntry * PR_CALLBACK
DefaultAllocEntry(void *pool, const void *key)
{
#if defined(XP_MAC)
#pragma unused (pool,key)
#endif
return PR_NEW(PLHashEntry);
}
static void PR_CALLBACK
DefaultFreeEntry(void *pool, PLHashEntry *he, PRUintn flag)
{
#if defined(XP_MAC)
#pragma unused (pool)
#endif
if (flag == HT_FREE_ENTRY)
PR_Free(he);
}
static PLHashAllocOps defaultHashAllocOps = {
DefaultAllocTable, DefaultFreeTable,
DefaultAllocEntry, DefaultFreeEntry
};
PR_IMPLEMENT(PLHashTable *)
PL_NewHashTable(PRUint32 n, PLHashFunction keyHash,
PLHashComparator keyCompare, PLHashComparator valueCompare,
const PLHashAllocOps *allocOps, void *allocPriv)
{
PLHashTable *ht;
PRSize nb;
if (n <= MINBUCKETS) {
n = MINBUCKETSLOG2;
} else {
n = PR_CeilingLog2(n);
if ((PRInt32)n < 0)
return 0;
}
if (!allocOps) allocOps = &defaultHashAllocOps;
ht = (PLHashTable*)((*allocOps->allocTable)(allocPriv, sizeof *ht));
if (!ht)
return 0;
memset(ht, 0, sizeof *ht);
ht->shift = PL_HASH_BITS - n;
n = 1 << n;
#if defined(WIN16)
if (n > 16000) {
(*allocOps->freeTable)(allocPriv, ht);
return 0;
}
#endif /* WIN16 */
nb = n * sizeof(PLHashEntry *);
ht->buckets = (PLHashEntry**)((*allocOps->allocTable)(allocPriv, nb));
if (!ht->buckets) {
(*allocOps->freeTable)(allocPriv, ht);
return 0;
}
memset(ht->buckets, 0, nb);
ht->keyHash = keyHash;
ht->keyCompare = keyCompare;
ht->valueCompare = valueCompare;
ht->allocOps = allocOps;
ht->allocPriv = allocPriv;
return ht;
}
PR_IMPLEMENT(void)
PL_HashTableDestroy(PLHashTable *ht)
{
PRUint32 i, n;
PLHashEntry *he, *next;
const PLHashAllocOps *allocOps = ht->allocOps;
void *allocPriv = ht->allocPriv;
n = NBUCKETS(ht);
for (i = 0; i < n; i++) {
for (he = ht->buckets[i]; he; he = next) {
next = he->next;
(*allocOps->freeEntry)(allocPriv, he, HT_FREE_ENTRY);
}
}
#ifdef DEBUG
memset(ht->buckets, 0xDB, n * sizeof ht->buckets[0]);
#endif
(*allocOps->freeTable)(allocPriv, ht->buckets);
#ifdef DEBUG
memset(ht, 0xDB, sizeof *ht);
#endif
(*allocOps->freeTable)(allocPriv, ht);
}
/*
** Multiplicative hash, from Knuth 6.4.
*/
#define GOLDEN_RATIO 0x9E3779B9U /* 2/(1+sqrt(5))*(2^32) */
PR_IMPLEMENT(PLHashEntry **)
PL_HashTableRawLookup(PLHashTable *ht, PLHashNumber keyHash, const void *key)
{
PLHashEntry *he, **hep, **hep0;
PLHashNumber h;
#ifdef HASHMETER
ht->nlookups++;
#endif
h = keyHash * GOLDEN_RATIO;
h >>= ht->shift;
hep = hep0 = &ht->buckets[h];
while ((he = *hep) != 0) {
if (he->keyHash == keyHash && (*ht->keyCompare)(key, he->key)) {
/* Move to front of chain if not already there */
if (hep != hep0) {
*hep = he->next;
he->next = *hep0;
*hep0 = he;
}
return hep0;
}
hep = &he->next;
#ifdef HASHMETER
ht->nsteps++;
#endif
}
return hep;
}
/*
** Same as PL_HashTableRawLookup but doesn't reorder the hash entries.
*/
PR_IMPLEMENT(PLHashEntry **)
PL_HashTableRawLookupConst(PLHashTable *ht, PLHashNumber keyHash,
const void *key)
{
PLHashEntry *he, **hep;
PLHashNumber h;
#ifdef HASHMETER
ht->nlookups++;
#endif
h = keyHash * GOLDEN_RATIO;
h >>= ht->shift;
hep = &ht->buckets[h];
while ((he = *hep) != 0) {
if (he->keyHash == keyHash && (*ht->keyCompare)(key, he->key)) {
break;
}
hep = &he->next;
#ifdef HASHMETER
ht->nsteps++;
#endif
}
return hep;
}
PR_IMPLEMENT(PLHashEntry *)
PL_HashTableRawAdd(PLHashTable *ht, PLHashEntry **hep,
PLHashNumber keyHash, const void *key, void *value)
{
PRUint32 i, n;
PLHashEntry *he, *next, **oldbuckets;
PRSize nb;
/* Grow the table if it is overloaded */
n = NBUCKETS(ht);
if (ht->nentries >= OVERLOADED(n)) {
oldbuckets = ht->buckets;
#if defined(WIN16)
if (2 * n > 16000)
return 0;
#endif /* WIN16 */
nb = 2 * n * sizeof(PLHashEntry *);
ht->buckets = (PLHashEntry**)
((*ht->allocOps->allocTable)(ht->allocPriv, nb));
if (!ht->buckets) {
ht->buckets = oldbuckets;
return 0;
}
memset(ht->buckets, 0, nb);
#ifdef HASHMETER
ht->ngrows++;
#endif
ht->shift--;
for (i = 0; i < n; i++) {
for (he = oldbuckets[i]; he; he = next) {
next = he->next;
hep = PL_HashTableRawLookup(ht, he->keyHash, he->key);
PR_ASSERT(*hep == 0);
he->next = 0;
*hep = he;
}
}
#ifdef DEBUG
memset(oldbuckets, 0xDB, n * sizeof oldbuckets[0]);
#endif
(*ht->allocOps->freeTable)(ht->allocPriv, oldbuckets);
hep = PL_HashTableRawLookup(ht, keyHash, key);
}
/* Make a new key value entry */
he = (*ht->allocOps->allocEntry)(ht->allocPriv, key);
if (!he)
return 0;
he->keyHash = keyHash;
he->key = key;
he->value = value;
he->next = *hep;
*hep = he;
ht->nentries++;
return he;
}
PR_IMPLEMENT(PLHashEntry *)
PL_HashTableAdd(PLHashTable *ht, const void *key, void *value)
{
PLHashNumber keyHash;
PLHashEntry *he, **hep;
keyHash = (*ht->keyHash)(key);
hep = PL_HashTableRawLookup(ht, keyHash, key);
if ((he = *hep) != 0) {
/* Hit; see if values match */
if ((*ht->valueCompare)(he->value, value)) {
/* key,value pair is already present in table */
return he;
}
if (he->value)
(*ht->allocOps->freeEntry)(ht->allocPriv, he, HT_FREE_VALUE);
he->value = value;
return he;
}
return PL_HashTableRawAdd(ht, hep, keyHash, key, value);
}
PR_IMPLEMENT(void)
PL_HashTableRawRemove(PLHashTable *ht, PLHashEntry **hep, PLHashEntry *he)
{
PRUint32 i, n;
PLHashEntry *next, **oldbuckets;
PRSize nb;
*hep = he->next;
(*ht->allocOps->freeEntry)(ht->allocPriv, he, HT_FREE_ENTRY);
/* Shrink table if it's underloaded */
n = NBUCKETS(ht);
if (--ht->nentries < UNDERLOADED(n)) {
oldbuckets = ht->buckets;
nb = n * sizeof(PLHashEntry*) / 2;
ht->buckets = (PLHashEntry**)(
(*ht->allocOps->allocTable)(ht->allocPriv, nb));
if (!ht->buckets) {
ht->buckets = oldbuckets;
return;
}
memset(ht->buckets, 0, nb);
#ifdef HASHMETER
ht->nshrinks++;
#endif
ht->shift++;
for (i = 0; i < n; i++) {
for (he = oldbuckets[i]; he; he = next) {
next = he->next;
hep = PL_HashTableRawLookup(ht, he->keyHash, he->key);
PR_ASSERT(*hep == 0);
he->next = 0;
*hep = he;
}
}
#ifdef DEBUG
memset(oldbuckets, 0xDB, n * sizeof oldbuckets[0]);
#endif
(*ht->allocOps->freeTable)(ht->allocPriv, oldbuckets);
}
}
PR_IMPLEMENT(PRBool)
PL_HashTableRemove(PLHashTable *ht, const void *key)
{
PLHashNumber keyHash;
PLHashEntry *he, **hep;
keyHash = (*ht->keyHash)(key);
hep = PL_HashTableRawLookup(ht, keyHash, key);
if ((he = *hep) == 0)
return PR_FALSE;
/* Hit; remove element */
PL_HashTableRawRemove(ht, hep, he);
return PR_TRUE;
}
PR_IMPLEMENT(void *)
PL_HashTableLookup(PLHashTable *ht, const void *key)
{
PLHashNumber keyHash;
PLHashEntry *he, **hep;
keyHash = (*ht->keyHash)(key);
hep = PL_HashTableRawLookup(ht, keyHash, key);
if ((he = *hep) != 0) {
return he->value;
}
return 0;
}
/*
** Same as PL_HashTableLookup but doesn't reorder the hash entries.
*/
PR_IMPLEMENT(void *)
PL_HashTableLookupConst(PLHashTable *ht, const void *key)
{
PLHashNumber keyHash;
PLHashEntry *he, **hep;
keyHash = (*ht->keyHash)(key);
hep = PL_HashTableRawLookupConst(ht, keyHash, key);
if ((he = *hep) != 0) {
return he->value;
}
return 0;
}
/*
** Iterate over the entries in the hash table calling func for each
** entry found. Stop if "f" says to (return value & PR_ENUMERATE_STOP).
** Return a count of the number of elements scanned.
*/
PR_IMPLEMENT(int)
PL_HashTableEnumerateEntries(PLHashTable *ht, PLHashEnumerator f, void *arg)
{
PLHashEntry *he, **hep;
PRUint32 i, nbuckets;
int rv, n = 0;
PLHashEntry *todo = 0;
nbuckets = NBUCKETS(ht);
for (i = 0; i < nbuckets; i++) {
hep = &ht->buckets[i];
while ((he = *hep) != 0) {
rv = (*f)(he, n, arg);
n++;
if (rv & (HT_ENUMERATE_REMOVE | HT_ENUMERATE_UNHASH)) {
*hep = he->next;
if (rv & HT_ENUMERATE_REMOVE) {
he->next = todo;
todo = he;
}
} else {
hep = &he->next;
}
if (rv & HT_ENUMERATE_STOP) {
goto out;
}
}
}
out:
hep = &todo;
while ((he = *hep) != 0) {
PL_HashTableRawRemove(ht, hep, he);
}
return n;
}
#ifdef HASHMETER
#include <math.h>
#include <stdio.h>
PR_IMPLEMENT(void)
PL_HashTableDumpMeter(PLHashTable *ht, PLHashEnumerator dump, FILE *fp)
{
double mean, variance;
PRUint32 nchains, nbuckets;
PRUint32 i, n, maxChain, maxChainLen;
PLHashEntry *he;
variance = 0;
nchains = 0;
maxChainLen = 0;
nbuckets = NBUCKETS(ht);
for (i = 0; i < nbuckets; i++) {
he = ht->buckets[i];
if (!he)
continue;
nchains++;
for (n = 0; he; he = he->next)
n++;
variance += n * n;
if (n > maxChainLen) {
maxChainLen = n;
maxChain = i;
}
}
mean = (double)ht->nentries / nchains;
variance = fabs(variance / nchains - mean * mean);
fprintf(fp, "\nHash table statistics:\n");
fprintf(fp, " number of lookups: %u\n", ht->nlookups);
fprintf(fp, " number of entries: %u\n", ht->nentries);
fprintf(fp, " number of grows: %u\n", ht->ngrows);
fprintf(fp, " number of shrinks: %u\n", ht->nshrinks);
fprintf(fp, " mean steps per hash: %g\n", (double)ht->nsteps
/ ht->nlookups);
fprintf(fp, "mean hash chain length: %g\n", mean);
fprintf(fp, " standard deviation: %g\n", sqrt(variance));
fprintf(fp, " max hash chain length: %u\n", maxChainLen);
fprintf(fp, " max hash chain: [%u]\n", maxChain);
for (he = ht->buckets[maxChain], i = 0; he; he = he->next, i++)
if ((*dump)(he, i, fp) != HT_ENUMERATE_NEXT)
break;
}
#endif /* HASHMETER */
PR_IMPLEMENT(int)
PL_HashTableDump(PLHashTable *ht, PLHashEnumerator dump, FILE *fp)
{
int count;
count = PL_HashTableEnumerateEntries(ht, dump, fp);
#ifdef HASHMETER
PL_HashTableDumpMeter(ht, dump, fp);
#endif
return count;
}
PR_IMPLEMENT(PLHashNumber)
PL_HashString(const void *key)
{
PLHashNumber h;
const PRUint8 *s;
h = 0;
for (s = (const PRUint8*)key; *s; s++)
h = (h >> 28) ^ (h << 4) ^ *s;
return h;
}
PR_IMPLEMENT(int)
PL_CompareStrings(const void *v1, const void *v2)
{
return strcmp((const char*)v1, (const char*)v2) == 0;
}
PR_IMPLEMENT(int)
PL_CompareValues(const void *v1, const void *v2)
{
return v1 == v2;
}

View File

@@ -0,0 +1,165 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef plhash_h___
#define plhash_h___
/*
* API to portable hash table code.
*/
#include <stdio.h>
#include "prtypes.h"
PR_BEGIN_EXTERN_C
typedef struct PLHashEntry PLHashEntry;
typedef struct PLHashTable PLHashTable;
typedef PRUint32 PLHashNumber;
#define PL_HASH_BITS 32 /* Number of bits in PLHashNumber */
typedef PLHashNumber (PR_CALLBACK *PLHashFunction)(const void *key);
typedef PRIntn (PR_CALLBACK *PLHashComparator)(const void *v1, const void *v2);
#if defined(XP_OS2_VACPP) && defined(VACPP_FLIP) /* for nsSpaceManager.cpp */
PR_END_EXTERN_C /* and nsHTMLDocument.cpp */
#endif
typedef PRIntn (PR_CALLBACK *PLHashEnumerator)(PLHashEntry *he, PRIntn i, void *arg);
#if defined(XP_OS2_VACPP) && defined(VACPP_FLIP)
PR_BEGIN_EXTERN_C
#endif
/* Flag bits in PLHashEnumerator's return value */
#define HT_ENUMERATE_NEXT 0 /* continue enumerating entries */
#define HT_ENUMERATE_STOP 1 /* stop enumerating entries */
#define HT_ENUMERATE_REMOVE 2 /* remove and free the current entry */
#define HT_ENUMERATE_UNHASH 4 /* just unhash the current entry */
typedef struct PLHashAllocOps {
void * (PR_CALLBACK *allocTable)(void *pool, PRSize size);
void (PR_CALLBACK *freeTable)(void *pool, void *item);
PLHashEntry * (PR_CALLBACK *allocEntry)(void *pool, const void *key);
void (PR_CALLBACK *freeEntry)(void *pool, PLHashEntry *he, PRUintn flag);
} PLHashAllocOps;
#define HT_FREE_VALUE 0 /* just free the entry's value */
#define HT_FREE_ENTRY 1 /* free value and entire entry */
struct PLHashEntry {
PLHashEntry *next; /* hash chain linkage */
PLHashNumber keyHash; /* key hash function result */
const void *key; /* ptr to opaque key */
void *value; /* ptr to opaque value */
};
struct PLHashTable {
PLHashEntry **buckets; /* vector of hash buckets */
PRUint32 nentries; /* number of entries in table */
PRUint32 shift; /* multiplicative hash shift */
PLHashFunction keyHash; /* key hash function */
PLHashComparator keyCompare; /* key comparison function */
PLHashComparator valueCompare; /* value comparison function */
const PLHashAllocOps *allocOps; /* allocation operations */
void *allocPriv; /* allocation private data */
#ifdef HASHMETER
PRUint32 nlookups; /* total number of lookups */
PRUint32 nsteps; /* number of hash chains traversed */
PRUint32 ngrows; /* number of table expansions */
PRUint32 nshrinks; /* number of table contractions */
#endif
};
/*
* Create a new hash table.
* If allocOps is null, use default allocator ops built on top of malloc().
*/
PR_EXTERN(PLHashTable *)
PL_NewHashTable(PRUint32 numBuckets, PLHashFunction keyHash,
PLHashComparator keyCompare, PLHashComparator valueCompare,
const PLHashAllocOps *allocOps, void *allocPriv);
PR_EXTERN(void)
PL_HashTableDestroy(PLHashTable *ht);
/* Higher level access methods */
PR_EXTERN(PLHashEntry *)
PL_HashTableAdd(PLHashTable *ht, const void *key, void *value);
PR_EXTERN(PRBool)
PL_HashTableRemove(PLHashTable *ht, const void *key);
PR_EXTERN(void *)
PL_HashTableLookup(PLHashTable *ht, const void *key);
PR_EXTERN(void *)
PL_HashTableLookupConst(PLHashTable *ht, const void *key);
PR_EXTERN(PRIntn)
PL_HashTableEnumerateEntries(PLHashTable *ht, PLHashEnumerator f, void *arg);
/* General-purpose C string hash function. */
PR_EXTERN(PLHashNumber)
PL_HashString(const void *key);
/* Compare strings using strcmp(), return true if equal. */
PR_EXTERN(PRIntn)
PL_CompareStrings(const void *v1, const void *v2);
/* Stub function just returns v1 == v2 */
PR_EXTERN(PRIntn)
PL_CompareValues(const void *v1, const void *v2);
/* Low level access methods */
PR_EXTERN(PLHashEntry **)
PL_HashTableRawLookup(PLHashTable *ht, PLHashNumber keyHash, const void *key);
PR_EXTERN(PLHashEntry **)
PL_HashTableRawLookupConst(PLHashTable *ht, PLHashNumber keyHash,
const void *key);
PR_EXTERN(PLHashEntry *)
PL_HashTableRawAdd(PLHashTable *ht, PLHashEntry **hep, PLHashNumber keyHash,
const void *key, void *value);
PR_EXTERN(void)
PL_HashTableRawRemove(PLHashTable *ht, PLHashEntry **hep, PLHashEntry *he);
/* This can be trivially implemented using PL_HashTableEnumerateEntries. */
PR_EXTERN(PRIntn)
PL_HashTableDump(PLHashTable *ht, PLHashEnumerator dump, FILE *fp);
PR_END_EXTERN_C
#endif /* plhash_h___ */

View File

@@ -0,0 +1,125 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prinit.h"
#include "prvrsion.h"
/************************************************************************/
/**************************IDENTITY AND VERSIONING***********************/
/************************************************************************/
#include "_pl_bld.h"
#if !defined(_BUILD_TIME)
#ifdef HAVE_LONG_LONG
#define _BUILD_TIME 0
#else
#define _BUILD_TIME {0, 0}
#endif
#endif
#if !defined(_BUILD_STRING)
#define _BUILD_STRING ""
#endif
#if !defined(_PRODUCTION)
#define _PRODUCTION ""
#endif
#if defined(DEBUG)
#define _DEBUG_STRING " (debug)"
#else
#define _DEBUG_STRING ""
#endif
/*
* A trick to expand the PR_VMAJOR macro before concatenation.
*/
#define CONCAT(x, y) x ## y
#define CONCAT2(x, y) CONCAT(x, y)
#define VERSION_DESC_NAME CONCAT2(prVersionDescription_libplds, PR_VMAJOR)
PRVersionDescription VERSION_DESC_NAME =
{
/* version */ 2, /* this is the only one supported */
/* buildTime */ _BUILD_TIME, /* usecs since midnight 1/1/1970 GMT */
/* buildTimeString */ _BUILD_STRING, /* ditto, but human readable */
/* vMajor */ PR_VMAJOR, /* NSPR's version number */
/* vMinor */ PR_VMINOR, /* and minor version */
/* vPatch */ PR_VPATCH, /* and patch */
/* beta */ PR_BETA, /* beta build boolean */
#if defined(DEBUG)
/* debug */ PR_TRUE, /* a debug build */
#else
/* debug */ PR_FALSE, /* an optomized build */
#endif
/* special */ PR_FALSE, /* they're all special, but ... */
/* filename */ _PRODUCTION, /* the produced library name */
/* description */ "Portable runtime", /* what we are */
/* security */ "N/A", /* not applicable here */
/* copywrite */ "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved",
/* comment */ "http://www.mozilla.org/MPL/",
/* specialString */ ""
};
#ifdef XP_UNIX
/*
* Version information for the 'ident' and 'what commands
*
* NOTE: the first component of the concatenated rcsid string
* must not end in a '$' to prevent rcs keyword substitution.
*/
static char rcsid[] = "$Header: NSPR " PR_VERSION _DEBUG_STRING
" " _BUILD_STRING " $";
static char sccsid[] = "@(#)NSPR " PR_VERSION _DEBUG_STRING
" " _BUILD_STRING;
#endif /* XP_UNIX */
PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
{
#ifdef XP_UNIX
/*
* Add dummy references to rcsid and sccsid to prevent them
* from being optimized away as unused variables.
*/
const char *dummy;
dummy = rcsid;
dummy = sccsid;
#endif
return &VERSION_DESC_NAME;
} /* versionEntryPointType */
/* plvrsion.c */

View File

@@ -0,0 +1,56 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
export NSPR20=1
include $(topsrcdir)/config/config.mk
DIRS = include src
include $(topsrcdir)/config/rules.mk
export:: $(TARGETS)

View File

@@ -0,0 +1,20 @@
NSPR 2.0 libc functions
-----------------------
Last edited: AOF 04 March 1997
This directory contains various libc-types of functions. All functions in
this directory are platform independent, thread friendly (both safe and
efficient). They are contributed from various sources, though the contri-
butions are monitored by the NSPR group (mailto:freier).
All API items exported by these functions will contain the same three
character prefix, "PL_" (Portable Library). Internal function names
that are not exported (static) are of little concern, though some caution
must be used on those elements that are 'extern' but not really intended
to be part of the API. Those should all have a prefix of "_PL_" (is that
legal?).
The responsibility for contributions in this area are distributed among
all interested parties.

View File

@@ -0,0 +1,9 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
plbase64.h
plerror.h
plgetopt.h
plresolv.h
plstr.h

View File

@@ -0,0 +1,61 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
HEADERS = $(wildcard $(srcdir)/*.h)
RELEASE_HEADERS = $(HEADERS)
RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
include $(topsrcdir)/config/rules.mk
export:: $(HEADERS)
$(INSTALL) -m 444 $(HEADERS) $(dist_includedir)
ifeq ($(MOZ_BITS),16)
$(INSTALL) -m 444 $(HEADERS) $(MOZ_INCL)
endif

View File

@@ -0,0 +1,7 @@
NSPR 2.0 libc functions
-----------------------
Last edited: AOF 04 March 1997
This directory contains the API for various libc-types of functions.

View File

@@ -0,0 +1,98 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _plbase64_h
#define _plbase64_h
#include "prtypes.h"
PR_BEGIN_EXTERN_C
/*
* PL_Base64Encode
*
* This routine encodes the data pointed to by the "src" parameter using the
* base64 algorithm, and returns a pointer to the result. If the "srclen"
* parameter is not zero, it specifies the length of the source data. If it
* is zero, the source data is assumed to be null-terminated, and PL_strlen
* is used to determine the source length. If the "dest" parameter is not
* null, it is assumed to point to a buffer of sufficient size (which may be
* calculated: ((srclen + 2)/3)*4) into which the encoded data is placed
* (without any termination). If the "dest" parameter is null, a buffer is
* allocated from the heap to hold the encoded data, and the result *will*
* be terminated with an extra null character. It is the caller's
* responsibility to free the result when it is allocated. A null is returned
* if the allocation fails.
*/
PR_EXTERN(char *)
PL_Base64Encode
(
const char *src,
PRUint32 srclen,
char *dest
);
/*
* PL_Base64Decode
*
* This routine decodes the data pointed to by the "src" parameter using
* the base64 algorithm, and returns a pointer to the result. The source
* may either include or exclude any trailing '=' characters. If the
* "srclen" parameter is not zero, it specifies the length of the source
* data. If it is zero, PL_strlen will be used to determine the source
* length. If the "dest" parameter is not null, it is assumed to point to
* a buffer of sufficient size (which may be calculated: (srclen * 3)/4
* when srclen includes the '=' characters) into which the decoded data
* is placed (without any termination). If the "dest" parameter is null,
* a buffer is allocated from the heap to hold the decoded data, and the
* result *will* be terminated with an extra null character. It is the
* caller's responsibility to free the result when it is allocated. A null
* is retuned if the allocation fails, or if the source is not well-coded.
*/
PR_EXTERN(char *)
PL_Base64Decode
(
const char *src,
PRUint32 srclen,
char *dest
);
PR_END_EXTERN_C
#endif /* _plbase64_h */

View File

@@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
** File: plerror.h
** Description: Simple routine to print translate the calling thread's
** error numbers and print them.
*/
#if defined(PLERROR_H)
#else
#define PLERROR_H
#include "prio.h"
#include "prtypes.h"
PR_BEGIN_EXTERN_C
/*
** Print the messages to "syserr" prepending 'msg' if not NULL.
*/
PR_EXTERN(void) PL_PrintError(const char *msg);
/*
** Print the messages to specified output file prepending 'msg' if not NULL.
*/
PR_EXTERN(void) PL_FPrintError(PRFileDesc *output, const char *msg);
PR_END_EXTERN_C
#endif /* defined(PLERROR_H) */
/* plerror.h */

View File

@@ -0,0 +1,81 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
** File: plgetopt.h
** Description: utilities to parse argc/argv
*/
#if defined(PLGETOPT_H_)
#else
#define PLGETOPT_H_
#include "prtypes.h"
PR_BEGIN_EXTERN_C
typedef struct PLOptionInternal PLOptionInternal;
typedef enum
{
PL_OPT_OK, /* all's well with the option */
PL_OPT_EOL, /* end of options list */
PL_OPT_BAD /* invalid option (and value) */
} PLOptStatus;
typedef struct PLOptState
{
char option; /* the name of the option */
const char *value; /* the value of that option | NULL */
PLOptionInternal *internal; /* private processing state */
} PLOptState;
PR_EXTERN(PLOptState*) PL_CreateOptState(
PRIntn argc, char **argv, const char *options);
PR_EXTERN(void) PL_DestroyOptState(PLOptState *opt);
PR_EXTERN(PLOptStatus) PL_GetNextOpt(PLOptState *opt);
PR_END_EXTERN_C
#endif /* defined(PLGETOPT_H_) */
/* plgetopt.h */

View File

@@ -0,0 +1,108 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* plresolv.h - asynchronous name resolution using DNS
*/
#ifndef _PLRESOLV_H_
#define _PLRESOLV_H_
/*
** THIS IS WORK IN PROGRESS. DO NOT ATTEMPT TO USE ANY PORTION OF THIS
** API UNTIL THIS MESSAGE NO LONGER EXISTS. IF YOU DO, THEN YOU SURRENDER
** THE RIGHT TO COMPLAIN ABOUT ANY CONTENT.
*/
#if defined(XP_UNIX)
#include <prtypes.h>
#include <prnetdb.h>
NSPR_BEGIN_EXTERN_C
#define PL_RESOLVE_MAXHOSTENTBUF 1024
#define PL_RESOLVE_DEFAULT_TIMEOUT 0
/* Error return codes */
#define PL_RESOLVE_OK 0
#define PL_RESOLVE_EWINIT 1 /* Failed to initialize window */
#define PL_RESOLVE_EMAKE 2 /* Failed to create request */
#define PL_RESOLVE_ELAUNCH 3 /* Error launching Async request */
#define PL_RESOLVE_ETIMEDOUT 4 /* Request timed-out */
#define PL_RESOLVE_EINVAL 5 /* Invalid argument */
#define PL_RESOLVE_EOVERFLOW 6 /* Buffer Overflow */
#define PL_RESOLVE_EUNKNOWN 7 /* berserk error */
/* ----------- Function Prototypes ----------------*/
PR_EXTERN(PRStatus) PL_ResolveName(
const char *name, unsigned char *buf,
PRIntn bufsize, PRIntervalTime timeout,
PRHostEnt *hostentry, PRIntervalTime *ttl);
PR_EXTERN(PRStatus) PL_ResolveAddr(
const PRNetAddr *address, unsigned char *buf,
PRIntn bufsize, PRIntervalTime timeout,
PRHostEnt *hostentry, PRIntervalTime *ttl);
typedef struct PLResolveStats {
int re_errors;
int re_nu_look;
int re_na_look;
int re_replies;
int re_requests;
int re_resends;
int re_sent;
int re_timeouts;
} PLResolveStats;
typedef struct PLResoveInfo {
PRBool enabled;
PRUint32 numNameLookups;
PRUint32 numAddrLookups;
PRUint32 numLookupsInProgress;
PLResolveStats stats;
} PLResoveInfo;
PR_EXTERN(void) PL_ResolveInfo(PLResoveInfo *info);
NSPR_END_EXTERN_C
#endif /* defined(XP_UNIX) */
#endif /* _PLRESOLV_H_ */

View File

@@ -0,0 +1,470 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Roland Mainz <roland mainz@informatik.med.uni-giessen.de>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _plstr_h
#define _plstr_h
/*
* plstr.h
*
* This header file exports the API to the NSPR portable library or string-
* handling functions.
*
* This API was not designed as an "optimal" or "ideal" string library; it
* was based on the good ol' unix string.3 functions, and was written to
*
* 1) replace the libc functions, for cross-platform consistency,
* 2) complete the API on platforms lacking common functions (e.g.,
* strcase*), and
* 3) to implement some obvious "closure" functions that I've seen
* people hacking around in our code.
*
* Point number three largely means that most functions have an "strn"
* limited-length version, and all comparison routines have a non-case-
* sensitive version available.
*/
#include "prtypes.h"
PR_BEGIN_EXTERN_C
/*
* PL_strlen
*
* Returns the length of the provided string, not including the trailing '\0'.
*/
PR_EXTERN(PRUint32)
PL_strlen(const char *str);
/*
* PL_strnlen
*
* Returns the length of the provided string, not including the trailing '\0',
* up to the indicated maximum. The string will not be examined beyond the
* maximum; if no terminating '\0' is found, the maximum will be returned.
*/
PR_EXTERN(PRUint32)
PL_strnlen(const char *str, PRUint32 max);
/*
* PL_strcpy
*
* Copies the source string, up to and including the trailing '\0', into the
* destination buffer. It does not (can not) verify that the destination
* buffer is large enough. It returns the "dest" argument.
*/
PR_EXTERN(char *)
PL_strcpy(char *dest, const char *src);
/*
* PL_strncpy
*
* Copies the source string into the destination buffer, up to and including
* the trailing '\0' or up to and including the max'th character, whichever
* comes first. It does not (can not) verify that the destination buffer is
* large enough. If the source string is longer than the maximum length,
* the result will *not* be null-terminated (JLRU).
*/
PR_EXTERN(char *)
PL_strncpy(char *dest, const char *src, PRUint32 max);
/*
* PL_strncpyz
*
* Copies the source string into the destination buffer, up to and including
* the trailing '\0' or up but not including the max'th character, whichever
* comes first. It does not (can not) verify that the destination buffer is
* large enough. The destination string is always terminated with a '\0',
* unlike the traditional libc implementation. It returns the "dest" argument.
*
* NOTE: If you call this with a source "abcdefg" and a max of 5, the
* destination will end up with "abcd\0" (i.e., it's strlen length will be 4)!
*
* This means you can do this:
*
* char buffer[ SOME_SIZE ];
* PL_strncpyz(buffer, src, sizeof(buffer));
*
* and the result will be properly terminated.
*/
PR_EXTERN(char *)
PL_strncpyz(char *dest, const char *src, PRUint32 max);
/*
* PL_strdup
*
* Returns a pointer to a malloc'd extent of memory containing a duplicate
* of the argument string. The size of the allocated extent is one greater
* than the length of the argument string, because of the terminator. A
* null argument, like a zero-length argument, will result in a pointer to
* a one-byte extent containing the null value. This routine returns null
* upon malloc failure.
*/
PR_EXTERN(char *)
PL_strdup(const char *s);
/*
* PL_strfree
*
* Free memory allocated by PL_strdup
*/
PR_EXTERN(void)
PL_strfree(char *s);
/*
* PL_strndup
*
* Returns a pointer to a malloc'd extent of memory containing a duplicate
* of the argument string, up to the maximum specified. If the argument
* string has a length greater than the value of the specified maximum, the
* return value will be a pointer to an extent of memory of length one
* greater than the maximum specified. A null string, a zero-length string,
* or a zero maximum will all result in a pointer to a one-byte extent
* containing the null value. This routine returns null upon malloc failure.
*/
PR_EXTERN(char *)
PL_strndup(const char *s, PRUint32 max);
/*
* PL_strcat
*
* Appends a copy of the string pointed to by the second argument to the
* end of the string pointed to by the first. The destination buffer is
* not (can not be) checked for sufficient size. A null destination
* argument returns null; otherwise, the first argument is returned.
*/
PR_EXTERN(char *)
PL_strcat(char *dst, const char *src);
/*
* PL_strncat
*
* Appends a copy of the string pointed to by the second argument, up to
* the maximum size specified, to the end of the string pointed to by the
* first. The destination buffer is not (can not be) checked for sufficient
* size. A null destination argument returns null; otherwise, the first
* argument is returned. If the maximum size limits the copy, then the
* result will *not* be null-terminated (JLRU). A null destination
* returns null; otherwise, the destination argument is returned.
*/
PR_EXTERN(char *)
PL_strncat(char *dst, const char *src, PRUint32 max);
/*
* PL_strcatn
*
* Appends a copy of the string pointed to by the third argument, to the
* end of the string pointed to by the first. The second argument specifies
* the maximum size of the destination buffer, including the null termination.
* If the existing string in dst is longer than the max, no action is taken.
* The resulting string will be null-terminated. A null destination returns
* null; otherwise, the destination argument is returned.
*/
PR_EXTERN(char *)
PL_strcatn(char *dst, PRUint32 max, const char *src);
/*
* PL_strcmp
*
* Returns an integer, the sign of which -- positive, zero, or negative --
* reflects the lexical sorting order of the two strings indicated. The
* result is positive if the first string comes after the second. The
* NSPR implementation is not i18n.
*/
PR_EXTERN(PRIntn)
PL_strcmp(const char *a, const char *b);
/*
* PL_strncmp
*
* Returns an integer, the sign of which -- positive, zero, or negative --
* reflects the lexical sorting order of the two strings indicated, up to
* the maximum specified. The result is positive if the first string comes
* after the second. The NSPR implementation is not i18n. If the maximum
* is zero, only the existance or non-existance (pointer is null) of the
* strings is compared.
*/
PR_EXTERN(PRIntn)
PL_strncmp(const char *a, const char *b, PRUint32 max);
/*
* PL_strcasecmp
*
* Returns an integer, the sign of which -- positive, zero or negative --
* reflects the case-insensitive lexical sorting order of the two strings
* indicated. The result is positive if the first string comes after the
* second. The NSPR implementation is not i18n.
*/
PR_EXTERN(PRIntn)
PL_strcasecmp(const char *a, const char *b);
/*
* PL_strncasecmp
*
* Returns an integer, the sign of which -- positive, zero or negative --
* reflects the case-insensitive lexical sorting order of the first n characters
* of the two strings indicated. The result is positive if the first string comes
* after the second. The NSPR implementation is not i18n.
*/
PR_EXTERN(PRIntn)
PL_strncasecmp(const char *a, const char *b, PRUint32 max);
/*
* PL_strchr
*
* Returns a pointer to the first instance of the specified character in the
* provided string. It returns null if the character is not found, or if the
* provided string is null. The character may be the null character.
*/
PR_EXTERN(char *)
PL_strchr(const char *s, char c);
/*
* PL_strrchr
*
* Returns a pointer to the last instance of the specified character in the
* provided string. It returns null if the character is not found, or if the
* provided string is null. The character may be the null character.
*/
PR_EXTERN(char *)
PL_strrchr(const char *s, char c);
/*
* PL_strnchr
*
* Returns a pointer to the first instance of the specified character within the
* first n characters of the provided string. It returns null if the character
* is not found, or if the provided string is null. The character may be the
* null character.
*/
PR_EXTERN(char *)
PL_strnchr(const char *s, char c, PRUint32 n);
/*
* PL_strnrchr
*
* Returns a pointer to the last instance of the specified character within the
* first n characters of the provided string. It returns null if the character is
* not found, or if the provided string is null. The character may be the null
* character.
*/
PR_EXTERN(char *)
PL_strnrchr(const char *s, char c, PRUint32 n);
/*
* NOTE: Looking for strcasechr, strcaserchr, strncasechr, or strncaserchr?
* Use strpbrk, strprbrk, strnpbrk or strnprbrk.
*/
/*
* PL_strpbrk
*
* Returns a pointer to the first instance in the first string of any character
* (not including the terminating null character) of the second string. It returns
* null if either string is null.
*/
PR_EXTERN(char *)
PL_strpbrk(const char *s, const char *list);
/*
* PL_strprbrk
*
* Returns a pointer to the last instance in the first string of any character
* (not including the terminating null character) of the second string. It returns
* null if either string is null.
*/
PR_EXTERN(char *)
PL_strprbrk(const char *s, const char *list);
/*
* PL_strnpbrk
*
* Returns a pointer to the first instance (within the first n characters) of any
* character (not including the terminating null character) of the second string.
* It returns null if either string is null.
*/
PR_EXTERN(char *)
PL_strnpbrk(const char *s, const char *list, PRUint32 n);
/*
* PL_strnprbrk
*
* Returns a pointer to the last instance (within the first n characters) of any
* character (not including the terminating null character) of the second string.
* It returns null if either string is null.
*/
PR_EXTERN(char *)
PL_strnprbrk(const char *s, const char *list, PRUint32 n);
/*
* PL_strstr
*
* Returns a pointer to the first instance of the little string within the
* big one. It returns null if either string is null.
*/
PR_EXTERN(char *)
PL_strstr(const char *big, const char *little);
/*
* PL_strrstr
*
* Returns a pointer to the last instance of the little string within the big one.
* It returns null if either string is null.
*/
PR_EXTERN(char *)
PL_strrstr(const char *big, const char *little);
/*
* PL_strnstr
*
* Returns a pointer to the first instance of the little string within the first
* n characters of the big one. It returns null if either string is null. It
* returns null if the length of the little string is greater than n.
*/
PR_EXTERN(char *)
PL_strnstr(const char *big, const char *little, PRUint32 n);
/*
* PL_strnrstr
*
* Returns a pointer to the last instance of the little string within the first
* n characters of the big one. It returns null if either string is null. It
* returns null if the length of the little string is greater than n.
*/
PR_EXTERN(char *)
PL_strnrstr(const char *big, const char *little, PRUint32 max);
/*
* PL_strcasestr
*
* Returns a pointer to the first instance of the little string within the big one,
* ignoring case. It returns null if either string is null.
*/
PR_EXTERN(char *)
PL_strcasestr(const char *big, const char *little);
/*
* PL_strcaserstr
*
* Returns a pointer to the last instance of the little string within the big one,
* ignoring case. It returns null if either string is null.
*/
PR_EXTERN(char *)
PL_strcaserstr(const char *big, const char *little);
/*
* PL_strncasestr
*
* Returns a pointer to the first instance of the little string within the first
* n characters of the big one, ignoring case. It returns null if either string is
* null. It returns null if the length of the little string is greater than n.
*/
PR_EXTERN(char *)
PL_strncasestr(const char *big, const char *little, PRUint32 max);
/*
* PL_strncaserstr
*
* Returns a pointer to the last instance of the little string within the first
* n characters of the big one, ignoring case. It returns null if either string is
* null. It returns null if the length of the little string is greater than n.
*/
PR_EXTERN(char *)
PL_strncaserstr(const char *big, const char *little, PRUint32 max);
/*
* PL_strtok_r
*
* Splits the string s1 into tokens, separated by one or more characters
* from the separator string s2. The argument lasts points to a
* user-supplied char * pointer in which PL_strtok_r stores information
* for it to continue scanning the same string.
*
* In the first call to PL_strtok_r, s1 points to a string and the value
* of *lasts is ignored. PL_strtok_r returns a pointer to the first
* token, writes '\0' into the character following the first token, and
* updates *lasts.
*
* In subsequent calls, s1 is null and lasts must stay unchanged from the
* previous call. The separator string s2 may be different from call to
* call. PL_strtok_r returns a pointer to the next token in s1. When no
* token remains in s1, PL_strtok_r returns null.
*/
PR_EXTERN(char *)
PL_strtok_r(char *s1, const char *s2, char **lasts);
/*
* Things not (yet?) included: strspn/strcspn, strsep.
* memchr, memcmp, memcpy, memccpy, index, rindex, bcmp, bcopy, bzero.
* Any and all i18n/l10n stuff.
*/
PR_END_EXTERN_C
#endif /* _plstr_h */

View File

@@ -0,0 +1,202 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
INCLUDES = -I$(dist_includedir)
CSRCS =\
plvrsion.c \
strlen.c \
strcpy.c \
strdup.c \
strcat.c \
strcmp.c \
strccmp.c \
strchr.c \
strpbrk.c \
strstr.c \
strcstr.c \
strtok.c \
base64.c \
plerror.c \
plgetopt.c \
$(NULL)
LIBRARY_NAME = plc
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
RELEASE_LIBS = $(TARGETS)
ifeq ($(OS_ARCH),WINNT)
ifdef NS_USE_GCC
DLLBASE=-Wl,--image-base -Wl,0x30000000
else
DLLBASE=/BASE:0x30000000
endif
RES=$(OBJDIR)/plc.res
RESNAME=plc.rc
endif # WINNT
ifeq ($(OS_ARCH), AIX)
ifeq ($(CLASSIC_NSPR),1)
OS_LIBS = -lc
else
OS_LIBS = -lc_r
endif
endif
ifeq ($(OS_ARCH),IRIX)
OS_LIBS = -lc
endif
ifeq ($(OS_ARCH),SunOS)
OS_LIBS = -lc
MAPFILE = $(OBJDIR)/plcmap.sun
GARBAGE += $(MAPFILE)
ifdef NS_USE_GCC
ifdef GCC_USE_GNU_LD
MKSHLIB += -Wl,--version-script,$(MAPFILE)
else
MKSHLIB += -Wl,-M,$(MAPFILE)
endif
else
MKSHLIB += -M $(MAPFILE)
endif
# The -R '$ORIGIN' linker option instructs this library to search for its
# dependencies in the same directory where it resides.
MKSHLIB += -R '$$ORIGIN'
endif
ifeq ($(OS_ARCH),OS2)
MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def
GARBAGE += $(MAPFILE)
MKSHLIB += $(MAPFILE)
endif
EXTRA_LIBS = $(LIBNSPR)
# On NCR and SCOOS, we can't link with extra libraries when
# we build a shared library. If we do so, the linker doesn't
# complain, but we would run into weird problems at run-time.
# Therefore on these platforms, we link just the .o files.
ifeq ($(OS_ARCH),NCR)
EXTRA_LIBS =
endif
ifeq ($(OS_ARCH),SCOOS)
EXTRA_LIBS =
endif
ifdef RESOLVE_LINK_SYMBOLS
EXTRA_LIBS += $(OS_LIBS)
endif
include $(topsrcdir)/config/rules.mk
#
# Version information generation (begin)
#
ECHO = echo
TINC = $(OBJDIR)/_pl_bld.h
PROD = $(notdir $(SHARED_LIBRARY))
NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
SH_DATE = $(shell date "+%Y-%m-%d %T")
SH_NOW = $(shell $(NOW))
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
SUF = i64
else
SUF = LL
endif
GARBAGE += $(TINC)
$(TINC):
@$(MAKE_OBJDIR)
@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
@if test ! -z "$(SH_NOW)"; then \
$(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
else \
true; \
fi
@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
endif
endif
#
# Version information generation (end)
#
#
# The Client build wants the shared libraries in $(dist_bindir),
# so we also install them there.
#
export:: $(TARGETS)
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
ifdef SHARED_LIBRARY
ifeq ($(OS_ARCH),HP-UX)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
else
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
endif
endif
ifeq ($(MOZ_BITS),16)
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/bin
endif

View File

@@ -0,0 +1,20 @@
NSPR 2.0 libc functions
-----------------------
Last edited: AOF 04 March 1997
This directory contains various libc-types of functions. All functions in
this directory are platform independent, thread friendly (both safe and
efficient). They are contributed from various sources, though the contri-
butions are monitored by the NSPR group (mailto:freier).
All API items exported by these functions will contain the same three
character prefix, "PL_" (Portable Library). Internal function names
that are not exported (static) are of little concern, though some caution
must be used on those elements that are 'extern' but not really intended
to be part of the API. Those should all have a prefix of "_PL_" (is that
legal?).
The responsibility for contributions in this area are distributed among
all interested parties.

View File

@@ -0,0 +1,428 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plbase64.h"
#include "prlog.h" /* For PR_NOT_REACHED */
#include "prmem.h" /* for malloc / PR_MALLOC */
#include "plstr.h" /* for PL_strlen */
static unsigned char *base = (unsigned char *)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static void
encode3to4
(
const unsigned char *src,
unsigned char *dest
)
{
PRUint32 b32 = (PRUint32)0;
PRIntn i, j = 18;
for( i = 0; i < 3; i++ )
{
b32 <<= 8;
b32 |= (PRUint32)src[i];
}
for( i = 0; i < 4; i++ )
{
dest[i] = base[ (PRUint32)((b32>>j) & 0x3F) ];
j -= 6;
}
return;
}
static void
encode2to4
(
const unsigned char *src,
unsigned char *dest
)
{
dest[0] = base[ (PRUint32)((src[0]>>2) & 0x3F) ];
dest[1] = base[ (PRUint32)(((src[0] & 0x03) << 4) | ((src[1] >> 4) & 0x0F)) ];
dest[2] = base[ (PRUint32)((src[1] & 0x0F) << 2) ];
dest[3] = (unsigned char)'=';
return;
}
static void
encode1to4
(
const unsigned char *src,
unsigned char *dest
)
{
dest[0] = base[ (PRUint32)((src[0]>>2) & 0x3F) ];
dest[1] = base[ (PRUint32)((src[0] & 0x03) << 4) ];
dest[2] = (unsigned char)'=';
dest[3] = (unsigned char)'=';
return;
}
static void
encode
(
const unsigned char *src,
PRUint32 srclen,
unsigned char *dest
)
{
while( srclen >= 3 )
{
encode3to4(src, dest);
src += 3;
dest += 4;
srclen -= 3;
}
switch( srclen )
{
case 2:
encode2to4(src, dest);
break;
case 1:
encode1to4(src, dest);
break;
case 0:
break;
default:
PR_NOT_REACHED("coding error");
}
return;
}
/*
* PL_Base64Encode
*
* If the destination argument is NULL, a return buffer is
* allocated, and the data therein will be null-terminated.
* If the destination argument is not NULL, it is assumed to
* be of sufficient size, and the contents will not be null-
* terminated by this routine.
*
* Returns null if the allocation fails.
*/
PR_IMPLEMENT(char *)
PL_Base64Encode
(
const char *src,
PRUint32 srclen,
char *dest
)
{
if( 0 == srclen )
{
srclen = PL_strlen(src);
}
if( (char *)0 == dest )
{
PRUint32 destlen = ((srclen + 2)/3) * 4;
dest = (char *)PR_MALLOC(destlen + 1);
if( (char *)0 == dest )
{
return (char *)0;
}
dest[ destlen ] = (char)0; /* null terminate */
}
encode((const unsigned char *)src, srclen, (unsigned char *)dest);
return dest;
}
static PRInt32
codetovalue
(
unsigned char c
)
{
if( (c >= (unsigned char)'A') && (c <= (unsigned char)'Z') )
{
return (PRInt32)(c - (unsigned char)'A');
}
else if( (c >= (unsigned char)'a') && (c <= (unsigned char)'z') )
{
return ((PRInt32)(c - (unsigned char)'a') +26);
}
else if( (c >= (unsigned char)'0') && (c <= (unsigned char)'9') )
{
return ((PRInt32)(c - (unsigned char)'0') +52);
}
else if( (unsigned char)'+' == c )
{
return (PRInt32)62;
}
else if( (unsigned char)'/' == c )
{
return (PRInt32)63;
}
else
{
return -1;
}
}
static PRStatus
decode4to3
(
const unsigned char *src,
unsigned char *dest
)
{
PRUint32 b32 = (PRUint32)0;
PRInt32 bits;
PRIntn i;
for( i = 0; i < 4; i++ )
{
bits = codetovalue(src[i]);
if( bits < 0 )
{
return PR_FAILURE;
}
b32 <<= 6;
b32 |= bits;
}
dest[0] = (unsigned char)((b32 >> 16) & 0xFF);
dest[1] = (unsigned char)((b32 >> 8) & 0xFF);
dest[2] = (unsigned char)((b32 ) & 0xFF);
return PR_SUCCESS;
}
static PRStatus
decode3to2
(
const unsigned char *src,
unsigned char *dest
)
{
PRUint32 b32 = (PRUint32)0;
PRInt32 bits;
PRUint32 ubits;
bits = codetovalue(src[0]);
if( bits < 0 )
{
return PR_FAILURE;
}
b32 = (PRUint32)bits;
b32 <<= 6;
bits = codetovalue(src[1]);
if( bits < 0 )
{
return PR_FAILURE;
}
b32 |= (PRUint32)bits;
b32 <<= 4;
bits = codetovalue(src[2]);
if( bits < 0 )
{
return PR_FAILURE;
}
ubits = (PRUint32)bits;
b32 |= (ubits >> 2);
dest[0] = (unsigned char)((b32 >> 8) & 0xFF);
dest[1] = (unsigned char)((b32 ) & 0xFF);
return PR_SUCCESS;
}
static PRStatus
decode2to1
(
const unsigned char *src,
unsigned char *dest
)
{
PRUint32 b32;
PRUint32 ubits;
PRInt32 bits;
bits = codetovalue(src[0]);
if( bits < 0 )
{
return PR_FAILURE;
}
ubits = (PRUint32)bits;
b32 = (ubits << 2);
bits = codetovalue(src[1]);
if( bits < 0 )
{
return PR_FAILURE;
}
ubits = (PRUint32)bits;
b32 |= (ubits >> 4);
dest[0] = (unsigned char)b32;
return PR_SUCCESS;
}
static PRStatus
decode
(
const unsigned char *src,
PRUint32 srclen,
unsigned char *dest
)
{
PRStatus rv;
while( srclen >= 4 )
{
rv = decode4to3(src, dest);
if( PR_SUCCESS != rv )
{
return PR_FAILURE;
}
src += 4;
dest += 3;
srclen -= 4;
}
switch( srclen )
{
case 3:
rv = decode3to2(src, dest);
break;
case 2:
rv = decode2to1(src, dest);
break;
case 1:
rv = PR_FAILURE;
break;
case 0:
rv = PR_SUCCESS;
break;
default:
PR_NOT_REACHED("coding error");
}
return rv;
}
/*
* PL_Base64Decode
*
* If the destination argument is NULL, a return buffer is
* allocated and the data therein will be null-terminated.
* If the destination argument is not null, it is assumed
* to be of sufficient size, and the data will not be null-
* terminated by this routine.
*
* Returns null if the allocation fails, or if the source string is
* not well-formed.
*/
PR_IMPLEMENT(char *)
PL_Base64Decode
(
const char *src,
PRUint32 srclen,
char *dest
)
{
PRStatus status;
PRBool allocated = PR_FALSE;
if( (char *)0 == src )
{
return (char *)0;
}
if( 0 == srclen )
{
srclen = PL_strlen(src);
}
if( srclen && (0 == (srclen & 3)) )
{
if( (char)'=' == src[ srclen-1 ] )
{
if( (char)'=' == src[ srclen-2 ] )
{
srclen -= 2;
}
else
{
srclen -= 1;
}
}
}
if( (char *)0 == dest )
{
PRUint32 destlen = ((srclen * 3) / 4);
dest = (char *)PR_MALLOC(destlen + 1);
if( (char *)0 == dest )
{
return (char *)0;
}
dest[ destlen ] = (char)0; /* null terminate */
allocated = PR_TRUE;
}
status = decode((const unsigned char *)src, srclen, (unsigned char *)dest);
if( PR_SUCCESS != status )
{
if( PR_TRUE == allocated )
{
PR_DELETE(dest);
}
return (char *)0;
}
return dest;
}

View File

@@ -0,0 +1,99 @@
;+#
;+# ***** BEGIN LICENSE BLOCK *****
;+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
;+#
;+# The contents of this file are subject to the Mozilla Public License Version
;+# 1.1 (the "License"); you may not use this file except in compliance with
;+# the License. You may obtain a copy of the License at
;+# http://www.mozilla.org/MPL/
;+#
;+# Software distributed under the License is distributed on an "AS IS" basis,
;+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
;+# for the specific language governing rights and limitations under the
;+# License.
;+#
;+# The Original Code is the Netscape Portable Runtime (NSPR).
;+#
;+# The Initial Developer of the Original Code is
;+# Netscape Communications Corporation.
;+# Portions created by the Initial Developer are Copyright (C) 2002-2003
;+# the Initial Developer. All Rights Reserved.
;+#
;+# Contributor(s):
;+#
;+# Alternatively, the contents of this file may be used under the terms of
;+# either the GNU General Public License Version 2 or later (the "GPL"), or
;+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
;+# in which case the provisions of the GPL or the LGPL are applicable instead
;+# of those above. If you wish to allow use of your version of this file only
;+# under the terms of either the GPL or the LGPL, and not to allow others to
;+# use your version of this file under the terms of the MPL, indicate your
;+# decision by deleting the provisions above and replace them with the notice
;+# and other provisions required by the GPL or the LGPL. If you do not delete
;+# the provisions above, a recipient may use your version of this file under
;+# the terms of any one of the MPL, the GPL or the LGPL.
;+#
;+# ***** END LICENSE BLOCK *****
;+#
;+# OK, this file is meant to support SUN, LINUX, AIX, OS/2 and WINDOWS
;+# 1. For all unix platforms, the string ";-" means "remove this line"
;+# 2. For all unix platforms, the string " DATA " will be removed from any
;+# line on which it occurs.
;+# 3. Lines containing ";+" will have ";+" removed on SUN and LINUX.
;+# On AIX, lines containing ";+" will be removed.
;+# 4. For all unix platforms, the string ";;" will thave the ";;" removed.
;+# 5. For all unix platforms, after the above processing has taken place,
;+# all characters after the first ";" on the line will be removed.
;+# And for AIX, the first ";" will also be removed.
;+# This file is passed directly to windows. Since ';' is a comment, all UNIX
;+# directives are hidden behind ";", ";+", and ";-"
;+NSPR_4.0 {
;+ global:
LIBRARY plc4 ;-
EXPORTS ;-
PL_Base64Decode;
PL_Base64Encode;
PL_CreateOptState;
PL_DestroyOptState;
PL_FPrintError;
PL_GetNextOpt;
PL_PrintError;
PL_strcasecmp;
PL_strcaserstr;
PL_strcasestr;
PL_strcat;
PL_strcatn;
PL_strchr;
PL_strcmp;
PL_strcpy;
PL_strdup;
PL_strfree;
PL_strlen;
PL_strncasecmp;
PL_strncaserstr;
PL_strncasestr;
PL_strncat;
PL_strnchr;
PL_strncmp;
PL_strncpy;
PL_strncpyz;
PL_strndup;
PL_strnlen;
PL_strnpbrk;
PL_strnprbrk;
PL_strnrchr;
PL_strnrstr;
PL_strnstr;
PL_strpbrk;
PL_strprbrk;
PL_strrchr;
PL_strrstr;
PL_strstr;
libVersionPoint;
;+ local: *;
;+};
;+
;+NSPR_4.2 {
;+ global:
PL_strtok_r;
;+} NSPR_4.0;

View File

@@ -0,0 +1,103 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prinit.h"
#include <winver.h>
#define MY_LIBNAME "plc"
#define MY_FILEDESCRIPTION "PLC Library"
#define STRINGIZE(x) #x
#define STRINGIZE2(x) STRINGIZE(x)
#define PR_VMAJOR_STR STRINGIZE2(PR_VMAJOR)
#ifdef _DEBUG
#define MY_DEBUG_STR " (debug)"
#define MY_FILEFLAGS_1 VS_FF_DEBUG
#else
#define MY_DEBUG_STR ""
#define MY_FILEFLAGS_1 0x0L
#endif
#if PR_BETA
#define MY_FILEFLAGS_2 MY_FILEFLAGS_1|VS_FF_PRERELEASE
#else
#define MY_FILEFLAGS_2 MY_FILEFLAGS_1
#endif
#ifdef WINNT
#define MY_FILEOS VOS_NT_WINDOWS32
#define MY_INTERNAL_NAME "lib" MY_LIBNAME PR_VMAJOR_STR
#else
#define MY_FILEOS VOS__WINDOWS32
#define MY_INTERNAL_NAME MY_LIBNAME PR_VMAJOR_STR
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Version-information resource
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION PR_VMAJOR,PR_VMINOR,PR_VPATCH,0
PRODUCTVERSION PR_VMAJOR,PR_VMINOR,PR_VPATCH,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS MY_FILEFLAGS_2
FILEOS MY_FILEOS
FILETYPE VFT_DLL
FILESUBTYPE 0x0L // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0" // Lang=US English, CharSet=Unicode
BEGIN
VALUE "CompanyName", "Netscape Communications Corporation\0"
VALUE "FileDescription", MY_FILEDESCRIPTION MY_DEBUG_STR "\0"
VALUE "FileVersion", PR_VERSION "\0"
VALUE "InternalName", MY_INTERNAL_NAME "\0"
VALUE "LegalCopyright", "Copyright \251 1996-2000 Netscape Communications Corporation\0"
VALUE "OriginalFilename", MY_INTERNAL_NAME ".dll\0"
VALUE "ProductName", "Netscape Portable Runtime\0"
VALUE "ProductVersion", PR_VERSION "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,53 @@
! Fixed section of symbol vector for LIBPLC4
!
GSMATCH=LEQUAL,2,2
case_sensitive=YES
!
! --------------------------------------------------------------------------
! Ident 2,2 introduced for Mozilla 1.3
! Previously this was empty. Now we include everything that's specified in
! plc.def.
! --------------------------------------------------------------------------
!
! NSPR 4.0
SYMBOL_VECTOR=(PL_Base64Decode=PROCEDURE)
SYMBOL_VECTOR=(PL_Base64Encode=PROCEDURE)
SYMBOL_VECTOR=(PL_CreateOptState=PROCEDURE)
SYMBOL_VECTOR=(PL_DestroyOptState=PROCEDURE)
SYMBOL_VECTOR=(PL_FPrintError=PROCEDURE)
SYMBOL_VECTOR=(PL_GetNextOpt=PROCEDURE)
SYMBOL_VECTOR=(PL_PrintError=PROCEDURE)
SYMBOL_VECTOR=(PL_strcasecmp=PROCEDURE)
SYMBOL_VECTOR=(PL_strcaserstr=PROCEDURE)
SYMBOL_VECTOR=(PL_strcasestr=PROCEDURE)
SYMBOL_VECTOR=(PL_strcat=PROCEDURE)
SYMBOL_VECTOR=(PL_strcatn=PROCEDURE)
SYMBOL_VECTOR=(PL_strchr=PROCEDURE)
SYMBOL_VECTOR=(PL_strcmp=PROCEDURE)
SYMBOL_VECTOR=(PL_strcpy=PROCEDURE)
SYMBOL_VECTOR=(PL_strdup=PROCEDURE)
SYMBOL_VECTOR=(PL_strfree=PROCEDURE)
SYMBOL_VECTOR=(PL_strlen=PROCEDURE)
SYMBOL_VECTOR=(PL_strncasecmp=PROCEDURE)
SYMBOL_VECTOR=(PL_strncaserstr=PROCEDURE)
SYMBOL_VECTOR=(PL_strncasestr=PROCEDURE)
SYMBOL_VECTOR=(PL_strncat=PROCEDURE)
SYMBOL_VECTOR=(PL_strnchr=PROCEDURE)
SYMBOL_VECTOR=(PL_strncmp=PROCEDURE)
SYMBOL_VECTOR=(PL_strncpy=PROCEDURE)
SYMBOL_VECTOR=(PL_strncpyz=PROCEDURE)
SYMBOL_VECTOR=(PL_strndup=PROCEDURE)
SYMBOL_VECTOR=(PL_strnlen=PROCEDURE)
SYMBOL_VECTOR=(PL_strnpbrk=PROCEDURE)
SYMBOL_VECTOR=(PL_strnprbrk=PROCEDURE)
SYMBOL_VECTOR=(PL_strnrchr=PROCEDURE)
SYMBOL_VECTOR=(PL_strnrstr=PROCEDURE)
SYMBOL_VECTOR=(PL_strnstr=PROCEDURE)
SYMBOL_VECTOR=(PL_strpbrk=PROCEDURE)
SYMBOL_VECTOR=(PL_strprbrk=PROCEDURE)
SYMBOL_VECTOR=(PL_strrchr=PROCEDURE)
SYMBOL_VECTOR=(PL_strrstr=PROCEDURE)
SYMBOL_VECTOR=(PL_strstr=PROCEDURE)
SYMBOL_VECTOR=(libVersionPoint=PROCEDURE)
! NSPR 4.2
SYMBOL_VECTOR=(PL_strtok_r=PROCEDURE)

View File

@@ -0,0 +1,168 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
** File:plerror.c
** Description: Simple routine to print translate the calling thread's
** error numbers and print them to "syserr".
*/
#include "plerror.h"
#include "prprf.h"
#include "prerror.h"
PR_IMPLEMENT(void) PL_FPrintError(PRFileDesc *fd, const char *msg)
{
static const char *tags[] =
{
"PR_OUT_OF_MEMORY_ERROR",
"PR_BAD_DESCRIPTOR_ERROR",
"PR_WOULD_BLOCK_ERROR",
"PR_ACCESS_FAULT_ERROR",
"PR_INVALID_METHOD_ERROR",
"PR_ILLEGAL_ACCESS_ERROR",
"PR_UNKNOWN_ERROR",
"PR_PENDING_INTERRUPT_ERROR",
"PR_NOT_IMPLEMENTED_ERROR",
"PR_IO_ERROR",
"PR_IO_TIMEOUT_ERROR",
"PR_IO_PENDING_ERROR",
"PR_DIRECTORY_OPEN_ERROR",
"PR_INVALID_ARGUMENT_ERROR",
"PR_ADDRESS_NOT_AVAILABLE_ERROR",
"PR_ADDRESS_NOT_SUPPORTED_ERROR",
"PR_IS_CONNECTED_ERROR",
"PR_BAD_ADDRESS_ERROR",
"PR_ADDRESS_IN_USE_ERROR",
"PR_CONNECT_REFUSED_ERROR",
"PR_NETWORK_UNREACHABLE_ERROR",
"PR_CONNECT_TIMEOUT_ERROR",
"PR_NOT_CONNECTED_ERROR",
"PR_LOAD_LIBRARY_ERROR",
"PR_UNLOAD_LIBRARY_ERROR",
"PR_FIND_SYMBOL_ERROR",
"PR_INSUFFICIENT_RESOURCES_ERROR",
"PR_DIRECTORY_LOOKUP_ERROR",
"PR_TPD_RANGE_ERROR",
"PR_PROC_DESC_TABLE_FULL_ERROR",
"PR_SYS_DESC_TABLE_FULL_ERROR",
"PR_NOT_SOCKET_ERROR",
"PR_NOT_TCP_SOCKET_ERROR",
"PR_SOCKET_ADDRESS_IS_BOUND_ERROR",
"PR_NO_ACCESS_RIGHTS_ERROR",
"PR_OPERATION_NOT_SUPPORTED_ERROR",
"PR_PROTOCOL_NOT_SUPPORTED_ERROR",
"PR_REMOTE_FILE_ERROR",
"PR_BUFFER_OVERFLOW_ERROR",
"PR_CONNECT_RESET_ERROR",
"PR_RANGE_ERROR",
"PR_DEADLOCK_ERROR",
"PR_FILE_IS_LOCKED_ERROR",
"PR_FILE_TOO_BIG_ERROR",
"PR_NO_DEVICE_SPACE_ERROR",
"PR_PIPE_ERROR",
"PR_NO_SEEK_DEVICE_ERROR",
"PR_IS_DIRECTORY_ERROR",
"PR_LOOP_ERROR",
"PR_NAME_TOO_LONG_ERROR",
"PR_FILE_NOT_FOUND_ERROR",
"PR_NOT_DIRECTORY_ERROR",
"PR_READ_ONLY_FILESYSTEM_ERROR",
"PR_DIRECTORY_NOT_EMPTY_ERROR",
"PR_FILESYSTEM_MOUNTED_ERROR",
"PR_NOT_SAME_DEVICE_ERROR",
"PR_DIRECTORY_CORRUPTED_ERROR",
"PR_FILE_EXISTS_ERROR",
"PR_MAX_DIRECTORY_ENTRIES_ERROR",
"PR_INVALID_DEVICE_STATE_ERROR",
"PR_DEVICE_IS_LOCKED_ERROR",
"PR_NO_MORE_FILES_ERROR",
"PR_END_OF_FILE_ERROR",
"PR_FILE_SEEK_ERROR",
"PR_FILE_IS_BUSY_ERROR",
"<unused error code>",
"PR_IN_PROGRESS_ERROR",
"PR_ALREADY_INITIATED_ERROR",
"PR_GROUP_EMPTY_ERROR",
"PR_INVALID_STATE_ERROR",
"PR_NETWORK_DOWN_ERROR",
"PR_SOCKET_SHUTDOWN_ERROR",
"PR_CONNECT_ABORTED_ERROR",
"PR_HOST_UNREACHABLE_ERROR",
"PR_MAX_ERROR"
};
PRErrorCode error = PR_GetError();
PRInt32 oserror = PR_GetOSError();
PRIntn thoseIKnowAbout = sizeof(tags) / sizeof(char*);
PRIntn lastError = PR_NSPR_ERROR_BASE + thoseIKnowAbout;
if (NULL != msg) PR_fprintf(fd, "%s: ", msg);
if ((error < PR_NSPR_ERROR_BASE) || (error > lastError))
PR_fprintf(
fd, " (%d)OUT OF RANGE, oserror = %d\n", error, oserror);
else
PR_fprintf(
fd, "%s(%d), oserror = %d\n",
tags[error - PR_NSPR_ERROR_BASE], error, oserror);
} /* PL_FPrintError */
PR_IMPLEMENT(void) PL_PrintError(const char *msg)
{
static PRFileDesc *fd = NULL;
if (NULL == fd) fd = PR_GetSpecialFD(PR_StandardError);
PL_FPrintError(fd, msg);
} /* PL_PrintError */
#if defined(WIN16)
/*
** libmain() is a required function for win16
**
*/
int CALLBACK LibMain( HINSTANCE hInst, WORD wDataSeg,
WORD cbHeapSize, LPSTR lpszCmdLine )
{
return TRUE;
}
#endif /* WIN16 */
/* plerror.c */

View File

@@ -0,0 +1,184 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
** File: plgetopt.c
** Description: utilities to parse argc/argv
*/
#include "prmem.h"
#include "prlog.h"
#include "prerror.h"
#include "plstr.h"
#include "plgetopt.h"
#include <string.h>
static char static_Nul = 0;
struct PLOptionInternal
{
const char *options; /* client options list specification */
PRIntn argc; /* original number of arguments */
char **argv; /* vector of pointers to arguments */
PRIntn xargc; /* which one we're processing now */
const char *xargv; /* where within *argv[xargc] */
PRBool minus; /* do we already have the '-'? */
};
/*
** Create the state in which to parse the tokens.
**
** argc the sum of the number of options and their values
** argv the options and their values
** options vector of single character options w/ | w/o ':
*/
PR_IMPLEMENT(PLOptState*) PL_CreateOptState(
PRIntn argc, char **argv, const char *options)
{
PLOptState *opt = NULL;
if (NULL == options)
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
else
{
opt = PR_NEWZAP(PLOptState);
if (NULL == opt)
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
else
{
PLOptionInternal *internal = PR_NEW(PLOptionInternal);
if (NULL == internal)
{
PR_DELETE(opt);
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
}
else
{
opt->option = 0;
opt->value = NULL;
opt->internal = internal;
internal->argc = argc;
internal->argv = argv;
internal->xargc = 0;
internal->xargv = &static_Nul;
internal->minus = PR_FALSE;
internal->options = options;
}
}
}
return opt;
} /* PL_CreateOptState */
/*
** Destroy object created by CreateOptState()
*/
PR_IMPLEMENT(void) PL_DestroyOptState(PLOptState *opt)
{
PR_DELETE(opt->internal);
PR_DELETE(opt);
} /* PL_DestroyOptState */
PR_IMPLEMENT(PLOptStatus) PL_GetNextOpt(PLOptState *opt)
{
PLOptionInternal *internal = opt->internal;
PRIntn cop, eoo = PL_strlen(internal->options);
/*
** If the current xarg points to nul, advance to the next
** element of the argv vector. If the vector index is equal
** to argc, we're out of arguments, so return an EOL.
** Note whether the first character of the new argument is
** a '-' and skip by it if it is.
*/
while (0 == *internal->xargv)
{
internal->xargc += 1;
if (internal->xargc >= internal->argc)
{
opt->option = 0;
opt->value = NULL;
return PL_OPT_EOL;
}
internal->xargv = internal->argv[internal->xargc];
internal->minus = ('-' == *internal->xargv ? PR_TRUE : PR_FALSE); /* not it */
if (internal->minus) internal->xargv += 1; /* and consume */
}
/*
** If we already have a '-' in hand, xargv points to the next
** option. See if we can find a match in the list of possible
** options supplied.
*/
if (internal->minus)
{
for (cop = 0; cop < eoo; ++cop)
{
if (internal->options[cop] == *internal->xargv)
{
opt->option = *internal->xargv;
internal->xargv += 1;
/*
** if options indicates that there's an associated
** value, this argv is finished and the next is the
** option's value.
*/
if (':' == internal->options[cop + 1])
{
if (0 != *internal->xargv) return PL_OPT_BAD;
opt->value = internal->argv[++(internal->xargc)];
internal->xargv = &static_Nul;
internal->minus = PR_FALSE;
}
else opt->value = NULL;
return PL_OPT_OK;
}
}
internal->xargv += 1; /* consume that option */
return PL_OPT_BAD;
}
/*
** No '-', so it must be a standalone value. The option is nul.
*/
opt->value = internal->argv[internal->xargc];
internal->xargv = &static_Nul;
opt->option = 0;
return PL_OPT_OK;
} /* PL_GetNextOpt */
/* plgetopt.c */

View File

@@ -0,0 +1,125 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prinit.h"
#include "prvrsion.h"
/************************************************************************/
/**************************IDENTITY AND VERSIONING***********************/
/************************************************************************/
#include "_pl_bld.h"
#if !defined(_BUILD_TIME)
#ifdef HAVE_LONG_LONG
#define _BUILD_TIME 0
#else
#define _BUILD_TIME {0, 0}
#endif
#endif
#if !defined(_BUILD_STRING)
#define _BUILD_STRING ""
#endif
#if !defined(_PRODUCTION)
#define _PRODUCTION ""
#endif
#if defined(DEBUG)
#define _DEBUG_STRING " (debug)"
#else
#define _DEBUG_STRING ""
#endif
/*
* A trick to expand the PR_VMAJOR macro before concatenation.
*/
#define CONCAT(x, y) x ## y
#define CONCAT2(x, y) CONCAT(x, y)
#define VERSION_DESC_NAME CONCAT2(prVersionDescription_libplc, PR_VMAJOR)
PRVersionDescription VERSION_DESC_NAME =
{
/* version */ 2, /* this is the only one supported */
/* buildTime */ _BUILD_TIME, /* usecs since midnight 1/1/1970 GMT */
/* buildTimeString */ _BUILD_STRING, /* ditto, but human readable */
/* vMajor */ PR_VMAJOR, /* NSPR's version number */
/* vMinor */ PR_VMINOR, /* and minor version */
/* vPatch */ PR_VPATCH, /* and patch */
/* beta */ PR_BETA, /* beta build boolean */
#if defined(DEBUG)
/* debug */ PR_TRUE, /* a debug build */
#else
/* debug */ PR_FALSE, /* an optomized build */
#endif
/* special */ PR_FALSE, /* they're all special, but ... */
/* filename */ _PRODUCTION, /* the produced library name */
/* description */ "Portable runtime", /* what we are */
/* security */ "N/A", /* not applicable here */
/* copywrite */ "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved",
/* comment */ "http://www.mozilla.org/MPL/",
/* specialString */ ""
};
#ifdef XP_UNIX
/*
* Version information for the 'ident' and 'what commands
*
* NOTE: the first component of the concatenated rcsid string
* must not end in a '$' to prevent rcs keyword substitution.
*/
static char rcsid[] = "$Header: NSPR " PR_VERSION _DEBUG_STRING
" " _BUILD_STRING " $";
static char sccsid[] = "@(#)NSPR " PR_VERSION _DEBUG_STRING
" " _BUILD_STRING;
#endif /* XP_UNIX */
PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
{
#ifdef XP_UNIX
/*
* Add dummy references to rcsid and sccsid to prevent them
* from being optimized away as unused variables.
*/
const char *dummy;
dummy = rcsid;
dummy = sccsid;
#endif
return &VERSION_DESC_NAME;
} /* versionEntryPointType */
/* plvrsion.c */

View File

@@ -0,0 +1,81 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
#include <string.h>
PR_IMPLEMENT(char *)
PL_strcat(char *dest, const char *src)
{
if( ((char *)0 == dest) || ((const char *)0 == src) )
return dest;
return strcat(dest, src);
}
PR_IMPLEMENT(char *)
PL_strncat(char *dest, const char *src, PRUint32 max)
{
char *rv;
if( ((char *)0 == dest) || ((const char *)0 == src) || (0 == max) )
return dest;
for( rv = dest; *dest; dest++ )
;
(void)PL_strncpy(dest, src, max);
return rv;
}
PR_IMPLEMENT(char *)
PL_strcatn(char *dest, PRUint32 max, const char *src)
{
char *rv;
PRUint32 dl;
if( ((char *)0 == dest) || ((const char *)0 == src) )
return dest;
for( rv = dest, dl = 0; *dest; dest++, dl++ )
;
if( max <= dl ) return rv;
(void)PL_strncpyz(dest, src, max-dl);
return rv;
}

View File

@@ -0,0 +1,115 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
static const unsigned char uc[] =
{
'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
'\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
' ', '!', '"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '{', '|', '}', '~', '\177',
0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377
};
PR_IMPLEMENT(PRIntn)
PL_strcasecmp(const char *a, const char *b)
{
const unsigned char *ua = (const unsigned char *)a;
const unsigned char *ub = (const unsigned char *)b;
if( ((const char *)0 == a) || (const char *)0 == b )
return (PRIntn)(a-b);
while( (uc[*ua] == uc[*ub]) && ('\0' != *a) )
{
a++;
ua++;
ub++;
}
return (PRIntn)(uc[*ua] - uc[*ub]);
}
PR_IMPLEMENT(PRIntn)
PL_strncasecmp(const char *a, const char *b, PRUint32 max)
{
const unsigned char *ua = (const unsigned char *)a;
const unsigned char *ub = (const unsigned char *)b;
if( ((const char *)0 == a) || (const char *)0 == b )
return (PRIntn)(a-b);
while( max && (uc[*ua] == uc[*ub]) && ('\0' != *a) )
{
a++;
ua++;
ub++;
max--;
}
if( 0 == max ) return (PRIntn)0;
return (PRIntn)(uc[*ua] - uc[*ub]);
}

View File

@@ -0,0 +1,88 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
#include <string.h>
PR_IMPLEMENT(char *)
PL_strchr(const char *s, char c)
{
if( (const char *)0 == s ) return (char *)0;
return strchr(s, c);
}
PR_IMPLEMENT(char *)
PL_strrchr(const char *s, char c)
{
if( (const char *)0 == s ) return (char *)0;
return strrchr(s, c);
}
PR_IMPLEMENT(char *)
PL_strnchr(const char *s, char c, PRUint32 n)
{
if( (const char *)0 == s ) return (char *)0;
for( ; n && *s; s++, n-- )
if( *s == c )
return (char *)s;
if( ((char)0 == c) && (n > 0) && ((char)0 == *s) ) return (char *)s;
return (char *)0;
}
PR_IMPLEMENT(char *)
PL_strnrchr(const char *s, char c, PRUint32 n)
{
const char *p;
if( (const char *)0 == s ) return (char *)0;
for( p = s; n && *p; p++, n-- )
;
if( ((char)0 == c) && (n > 0) && ((char)0 == *p) ) return (char *)p;
for( p--; p >= s; p-- )
if( *p == c )
return (char *)p;
return (char *)0;
}

View File

@@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
#include <string.h>
PR_IMPLEMENT(PRIntn)
PL_strcmp(const char *a, const char *b)
{
if( ((const char *)0 == a) || (const char *)0 == b )
return (PRIntn)(a-b);
return (PRIntn)strcmp(a, b);
}
PR_IMPLEMENT(PRIntn)
PL_strncmp(const char *a, const char *b, PRUint32 max)
{
if( ((const char *)0 == a) || (const char *)0 == b )
return (PRIntn)(a-b);
return (PRIntn)strncmp(a, b, (size_t)max);
}

View File

@@ -0,0 +1,84 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
#include <string.h>
PR_IMPLEMENT(char *)
PL_strcpy(char *dest, const char *src)
{
if( ((char *)0 == dest) || ((const char *)0 == src) ) return (char *)0;
return strcpy(dest, src);
}
PR_IMPLEMENT(char *)
PL_strncpy(char *dest, const char *src, PRUint32 max)
{
char *rv;
if( (char *)0 == dest ) return (char *)0;
if( (const char *)0 == src ) return (char *)0;
for( rv = dest; max && ((*dest = *src) != 0); dest++, src++, max-- )
;
#ifdef JLRU
/* XXX I (wtc) think the -- and ++ operators should be postfix. */
while( --max )
*++dest = '\0';
#endif /* JLRU */
return rv;
}
PR_IMPLEMENT(char *)
PL_strncpyz(char *dest, const char *src, PRUint32 max)
{
char *rv;
if( (char *)0 == dest ) return (char *)0;
if( (const char *)0 == src ) return (char *)0;
if( 0 == max ) return (char *)0;
for( rv = dest, max--; max && ((*dest = *src) != 0); dest++, src++, max-- )
;
*dest = '\0';
return rv;
}

View File

@@ -0,0 +1,123 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
PR_IMPLEMENT(char *)
PL_strcasestr(const char *big, const char *little)
{
PRUint32 ll;
if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
ll = PL_strlen(little);
for( ; *big; big++ )
/* obvious improvement available here */
if( 0 == PL_strncasecmp(big, little, ll) )
return (char *)big;
return (char *)0;
}
PR_IMPLEMENT(char *)
PL_strcaserstr(const char *big, const char *little)
{
const char *p;
PRUint32 ll;
if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
ll = PL_strlen(little);
p = &big[ PL_strlen(big) - ll ];
if( p < big ) return (char *)0;
for( ; p >= big; p-- )
/* obvious improvement available here */
if( 0 == PL_strncasecmp(p, little, ll) )
return (char *)p;
return (char *)0;
}
PR_IMPLEMENT(char *)
PL_strncasestr(const char *big, const char *little, PRUint32 max)
{
PRUint32 ll;
if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
ll = PL_strlen(little);
if( ll > max ) return (char *)0;
max -= ll;
max++;
for( ; max && *big; big++, max-- )
/* obvious improvement available here */
if( 0 == PL_strncasecmp(big, little, ll) )
return (char *)big;
return (char *)0;
}
PR_IMPLEMENT(char *)
PL_strncaserstr(const char *big, const char *little, PRUint32 max)
{
const char *p;
PRUint32 ll;
if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
ll = PL_strlen(little);
for( p = big; max && *p; p++, max-- )
;
p -= ll;
if( p < big ) return (char *)0;
for( ; p >= big; p-- )
/* obvious improvement available here */
if( 0 == PL_strncasecmp(p, little, ll) )
return (char *)p;
return (char *)0;
}

View File

@@ -0,0 +1,85 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
#include "prmem.h"
#include <string.h>
PR_IMPLEMENT(char *)
PL_strdup(const char *s)
{
char *rv;
size_t n;
if( (const char *)0 == s )
s = "";
n = strlen(s) + 1;
rv = (char *)malloc(n);
if( (char *)0 == rv ) return rv;
(void)memcpy(rv, s, n);
return rv;
}
PR_IMPLEMENT(void)
PL_strfree(char *s)
{
free(s);
}
PR_IMPLEMENT(char *)
PL_strndup(const char *s, PRUint32 max)
{
char *rv;
size_t l;
if( (const char *)0 == s )
s = "";
l = PL_strnlen(s, max);
rv = (char *)malloc(l+1);
if( (char *)0 == rv ) return rv;
(void)memcpy(rv, s, l);
rv[l] = '\0';
return rv;
}

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
#include "prtypes.h"
#include "prlog.h"
#include <string.h>
PR_IMPLEMENT(PRUint32)
PL_strlen(const char *str)
{
size_t l;
if( (const char *)0 == str ) return 0;
l = strlen(str);
/* error checking in case we have a 64-bit platform -- make sure
* we don't have ultra long strings that overflow an int32
*/
if( sizeof(PRUint32) < sizeof(size_t) )
PR_ASSERT(l < 2147483647);
return (PRUint32)l;
}
PR_IMPLEMENT(PRUint32)
PL_strnlen(const char *str, PRUint32 max)
{
register const char *s;
if( (const char *)0 == str ) return 0;
for( s = str; max && *s; s++, max-- )
;
return (PRUint32)(s - str);
}

View File

@@ -0,0 +1,100 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
#include <string.h>
PR_IMPLEMENT(char *)
PL_strpbrk(const char *s, const char *list)
{
if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
return strpbrk(s, list);
}
PR_IMPLEMENT(char *)
PL_strprbrk(const char *s, const char *list)
{
const char *p;
const char *r;
if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
for( r = s; *r; r++ )
;
for( r--; r >= s; r-- )
for( p = list; *p; p++ )
if( *r == *p )
return (char *)r;
return (char *)0;
}
PR_IMPLEMENT(char *)
PL_strnpbrk(const char *s, const char *list, PRUint32 max)
{
const char *p;
if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
for( ; max && *s; s++, max-- )
for( p = list; *p; p++ )
if( *s == *p )
return (char *)s;
return (char *)0;
}
PR_IMPLEMENT(char *)
PL_strnprbrk(const char *s, const char *list, PRUint32 max)
{
const char *p;
const char *r;
if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
for( r = s; max && *r; r++, max-- )
;
for( r--; r >= s; r-- )
for( p = list; *p; p++ )
if( *r == *p )
return (char *)r;
return (char *)0;
}

View File

@@ -0,0 +1,117 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
#include <string.h>
PR_IMPLEMENT(char *)
PL_strstr(const char *big, const char *little)
{
if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
return strstr(big, little);
}
PR_IMPLEMENT(char *)
PL_strrstr(const char *big, const char *little)
{
const char *p;
size_t ll;
size_t bl;
if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
ll = strlen(little);
bl = strlen(big);
if( bl < ll ) return (char *)0;
p = &big[ bl - ll ];
for( ; p >= big; p-- )
if( *little == *p )
if( 0 == strncmp(p, little, ll) )
return (char *)p;
return (char *)0;
}
PR_IMPLEMENT(char *)
PL_strnstr(const char *big, const char *little, PRUint32 max)
{
size_t ll;
if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
ll = strlen(little);
if( ll > (size_t)max ) return (char *)0;
max -= (PRUint32)ll;
max++;
for( ; max && *big; big++, max-- )
if( *little == *big )
if( 0 == strncmp(big, little, ll) )
return (char *)big;
return (char *)0;
}
PR_IMPLEMENT(char *)
PL_strnrstr(const char *big, const char *little, PRUint32 max)
{
const char *p;
size_t ll;
if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
ll = strlen(little);
for( p = big; max && *p; p++, max-- )
;
p -= ll;
if( p < big ) return (char *)0;
for( ; p >= big; p-- )
if( *little == *p )
if( 0 == strncmp(p, little, ll) )
return (char *)p;
return (char *)0;
}

View File

@@ -0,0 +1,89 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Roland Mainz <roland mainz@informatik.med.uni-giessen.de>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plstr.h"
PR_IMPLEMENT(char *)
PL_strtok_r(char *s1, const char *s2, char **lasts)
{
const char *sepp;
int c, sc;
char *tok;
if( s1 == NULL )
{
if( *lasts == NULL )
return NULL;
s1 = *lasts;
}
for( ; (c = *s1) != 0; s1++ )
{
for( sepp = s2 ; (sc = *sepp) != 0 ; sepp++ )
{
if( c == sc )
break;
}
if( sc == 0 )
break;
}
if( c == 0 )
{
*lasts = NULL;
return NULL;
}
tok = s1++;
for( ; (c = *s1) != 0; s1++ )
{
for( sepp = s2; (sc = *sepp) != 0; sepp++ )
{
if( c == sc )
{
*s1++ = '\0';
*lasts = s1;
return tok;
}
}
}
*lasts = NULL;
return tok;
}

View File

@@ -0,0 +1,52 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MOD_DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
DIRS = include src tests
include $(topsrcdir)/config/rules.mk
export:: $(TARGETS)

View File

@@ -0,0 +1,5 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
prgc.h

View File

@@ -0,0 +1,61 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
EXPORT_HEADERS = prgc.h
HEADERS = $(EXPORT_HEADERS) gcint.h
RELEASE_HEADERS = $(EXPORT_HEADERS)
RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
include $(topsrcdir)/config/rules.mk
export:: $(EXPORT_HEADERS)
$(INSTALL) -m 444 $(EXPORT_HEADERS) $(dist_includedir)
ifeq ($(MOZ_BITS),16)
$(INSTALL) -m 444 $(EXPORT_HEADERS) $(MOZ_INCL)
endif

View File

@@ -0,0 +1,129 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef gcint_h___
#define gcint_h___
#include "prmon.h"
#include "prgc.h"
extern PRLogModuleInfo *_pr_msgc_lm;
extern GCInfo _pr_gcData;
#if defined(_WIN32) && !defined(DEBUG)
#undef INLINE_LOCK
#endif
#ifdef INLINE_LOCK
#define LOCK_GC() EnterCriticalSection(&_pr_gcData.lock->mutexHandle)
#define UNLOCK_GC() LeaveCriticalSection(&_pr_gcData.lock->mutexHandle)
#else
#define LOCK_GC() PR_EnterMonitor(_pr_gcData.lock)
#define UNLOCK_GC() PR_ExitMonitor (_pr_gcData.lock)
#define GC_IS_LOCKED() (PR_GetMonitorEntryCount(_pr_gcData.lock)!=0)
#endif
#ifdef DEBUG
#define _GCTRACE(x, y) if (_pr_gcData.flags & x) GCTrace y
#else
#define _GCTRACE(x, y)
#endif
extern GCBeginGCHook *_pr_beginGCHook;
extern void *_pr_beginGCHookArg;
extern GCBeginGCHook *_pr_endGCHook;
extern void *_pr_endGCHookArg;
extern GCBeginFinalizeHook *_pr_beginFinalizeHook;
extern void *_pr_beginFinalizeHookArg;
extern GCBeginFinalizeHook *_pr_endFinalizeHook;
extern void *_pr_endFinalizeHookArg;
extern int _pr_do_a_dump;
extern FILE *_pr_dump_file;
extern PRLogModuleInfo *_pr_gc_lm;
/*
** Root finders. Root finders are used by the GC to find pointers into
** the GC heap that are not contained in the GC heap.
*/
typedef struct RootFinderStr RootFinder;
struct RootFinderStr {
RootFinder *next;
GCRootFinder *func;
char *name;
void *arg;
};
extern RootFinder *_pr_rootFinders;
typedef struct CollectorTypeStr {
GCType gctype;
PRUint32 flags;
} CollectorType;
#define GC_MAX_TYPES 256
extern CollectorType *_pr_collectorTypes;
#define _GC_TYPE_BUSY 0x1
#define _GC_TYPE_FINAL 0x2
#define _GC_TYPE_WEAK 0x4
/* Slot in _pr_gcTypes used for free memory */
#define FREE_MEMORY_TYPEIX 255
extern void _PR_InitGC(PRWord flags);
extern void _MD_InitGC(void);
extern void PR_CALLBACK _PR_ScanFinalQueue(void *notused);
/*
** Grow the GC Heap.
*/
extern void *_MD_GrowGCHeap(PRUint32 *sizep);
/*
** Extend the GC Heap.
*/
extern PRBool _MD_ExtendGCHeap(char *base, PRInt32 oldSize, PRInt32 newSize);
/*
** Free a GC segment.
*/
extern void _MD_FreeGCSegment(void *base, PRInt32 len);
#endif /* gcint_h___ */

View File

@@ -0,0 +1,419 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef prgc_h___
#define prgc_h___
/*
** API to NSPR gc memory system.
*/
#include "prtypes.h"
#include "prmon.h"
#include "prthread.h"
#include <stdio.h>
#if defined(WIN16)
#define GCPTR __far
#else
#define GCPTR
#endif
PR_BEGIN_EXTERN_C
/*
** Initialize the garbage collector.
** "flags" is the trace flags (see below).
** "initialHeapSize" is the initial size of the heap and may be zero
** if the default is desired.
** "segmentSize" is the size of each segment of memory added to the
** heap when the heap is grown.
*/
PR_EXTERN(void) PR_InitGC(
PRWord flags, PRInt32 initialHeapSize, PRInt32 segmentSize, PRThreadScope scope);
/*
** Shuts down gc and frees up all memory associated with it.
*/
PR_EXTERN(void) PR_ShutdownGC(PRBool finalizeOnExit);
/*
** This walk function will be called for every gc object in the
** heap as it is walked. If it returns non-zero, the walk is terminated.
*/
typedef PRInt32 (*PRWalkFun)(void GCPTR* obj, void* data);
/*
** GC Type record. This defines all of the GC operations used on a
** particular object type. These structures are passed to
** PR_RegisterType.
*/
typedef struct GCType {
/*
** Scan an object that is in the GC heap and call GCInfo.livePointer
** on all of the pointers in it. If this slot is null then the object
** won't be scanned (i.e. it has no embedded pointers).
*/
void (PR_CALLBACK *scan)(void GCPTR *obj);
/*
** Finalize an object that has no references. This is called by the
** GC after it has determined where the object debris is but before
** it has moved the debris to the logical "free list". The object is
** marked alive for this call and removed from the list of objects
** that need finalization (finalization only happens once for an
** object). If this slot is null then the object doesn't need
** finalization.
*/
void (PR_CALLBACK *finalize)(void GCPTR *obj);
/*
** Dump out an object during a PR_DumpGCHeap(). This is used as a
** debugging tool.
*/
void (PR_CALLBACK *dump)(FILE *out, void GCPTR *obj, PRBool detailed, PRIntn indentLevel);
/*
** Add object to summary table.
*/
void (PR_CALLBACK *summarize)(void GCPTR *obj, PRUint32 bytes);
/*
** Free hook called by GC when the object is being freed.
*/
void (PR_CALLBACK *free)(void *obj);
/* Weak pointer support: If the object has a weak pointer (Note:
at most one), this function is used to get the weak link's
offset from the start of the body of a gc object */
PRUint32 (PR_CALLBACK *getWeakLinkOffset)(void *obj);
/* Descriptive character for dumping this GCType */
char kindChar;
/*
** Walker routine. This routine should apply fun(obj->ptr, data)
** for every gc pointer within the object.
*/
PRInt32 (PR_CALLBACK *walk)(void GCPTR *obj, PRWalkFun fun, void* data);
} GCType;
/*
** This data structure must be added as the hash table passed to
** the summarize method of GCType.
*/
typedef struct PRSummaryEntry {
void* clazz;
PRInt32 instancesCount;
PRInt32 totalSize;
} PRSummaryEntry;
/*
** This function pointer must be registered by users of nspr
** to produce the finally summary after all object in the
** heap have been visited.
*/
typedef void (PR_CALLBACK *PRSummaryPrinter)(FILE *out, void* closure);
PR_EXTERN(void) PR_CALLBACK PR_RegisterSummaryPrinter(PRSummaryPrinter fun, void* closure);
typedef void PR_CALLBACK GCRootFinder(void *arg);
typedef void PR_CALLBACK GCBeginFinalizeHook(void *arg);
typedef void PR_CALLBACK GCEndFinalizeHook(void *arg);
typedef void PR_CALLBACK GCBeginGCHook(void *arg);
typedef void PR_CALLBACK GCEndGCHook(void *arg);
typedef enum { PR_GCBEGIN, PR_GCEND } GCLockHookArg;
typedef void PR_CALLBACK GCLockHookFunc(GCLockHookArg arg1, void *arg2);
typedef struct GCLockHook GCLockHook;
struct GCLockHook {
GCLockHookFunc* func;
void* arg;
GCLockHook* next;
GCLockHook* prev;
};
/*
** Hooks which are called at the beginning and end of the GC process.
** The begin hooks are called before the root finding step. The hooks are
** called with threading disabled, so it is now allowed to re-enter the
** kernel. The end hooks are called after the gc has finished but before
** the finalizer has run.
*/
PR_EXTERN(void) PR_CALLBACK PR_SetBeginGCHook(GCBeginGCHook *hook, void *arg);
PR_EXTERN(void) PR_CALLBACK PR_GetBeginGCHook(GCBeginGCHook **hook, void **arg);
PR_EXTERN(void) PR_CALLBACK PR_SetEndGCHook(GCBeginGCHook *hook, void *arg);
PR_EXTERN(void) PR_CALLBACK PR_GetEndGCHook(GCEndGCHook **hook, void **arg);
/*
** Called before SuspendAll is called by dogc, so that GC thread can hold
** all the locks before hand to avoid any deadlocks
*/
/*
PR_EXTERN(void) PR_SetGCLockHook(GCLockHook *hook, void *arg);
PR_EXTERN(void) PR_GetGCLockHook(GCLockHook **hook, void **arg);
*/
PR_EXTERN(int) PR_RegisterGCLockHook(GCLockHookFunc *hook, void *arg);
/*
** Hooks which are called at the beginning and end of the GC finalization
** process. After the GC has identified all of the dead objects in the
** heap, it looks for objects that need finalization. Before it calls the
** first finalization proc (see the GCType structure above) it calls the
** begin hook. When it has finalized the last object it calls the end
** hook.
*/
PR_EXTERN(void) PR_SetBeginFinalizeHook(GCBeginFinalizeHook *hook, void *arg);
PR_EXTERN(void) PR_GetBeginFinalizeHook(GCBeginFinalizeHook **hook, void **arg);
PR_EXTERN(void) PR_SetEndFinalizeHook(GCBeginFinalizeHook *hook, void *arg);
PR_EXTERN(void) PR_GetEndFinalizeHook(GCEndFinalizeHook **hook, void **arg);
/*
** Register a GC type. Return's the index into the GC internal type
** table. The returned value is passed to PR_AllocMemory. After the call,
** the "type" memory belongs to the GC (the caller must not free it or
** change it).
*/
PR_EXTERN(PRInt32) PR_RegisterType(GCType *type);
/*
** Register a root finder with the collector. The collector will call
** these functions to identify all of the roots before collection
** proceeds. "arg" is passed to the function when it is called.
*/
PR_EXTERN(PRStatus) PR_RegisterRootFinder(GCRootFinder func, char *name, void *arg);
/*
** Allocate some GC'able memory. The object must be at least bytes in
** size. The type index function for the object is specified. "flags"
** specifies some control flags. If PR_ALLOC_CLEAN is set then the memory
** is zero'd before being returned. If PR_ALLOC_DOUBLE is set then the
** allocated memory is double aligned.
**
** Any memory cell that you store a pointer to something allocated by
** this call must be findable by the GC. Use the PR_RegisterRootFinder to
** register new places where the GC will look for pointers into the heap.
** The GC already knows how to scan any NSPR threads or monitors.
*/
PR_EXTERN(PRWord GCPTR *)PR_AllocMemory(
PRWord bytes, PRInt32 typeIndex, PRWord flags);
PR_EXTERN(PRWord GCPTR *)PR_AllocSimpleMemory(
PRWord bytes, PRInt32 typeIndex);
/*
** This function can be used to cause PR_AllocMemory to always return
** NULL. This may be useful in low memory situations when we're trying to
** shutdown applets.
*/
PR_EXTERN(void) PR_EnableAllocation(PRBool yesOrNo);
/* flags bits */
#define PR_ALLOC_CLEAN 0x1
#define PR_ALLOC_DOUBLE 0x2
#define PR_ALLOC_ZERO_HANDLE 0x4 /* XXX yes, it's a hack */
/*
** Force a garbage collection right now. Return when it completes.
*/
PR_EXTERN(void) PR_GC(void);
/*
** Force a finalization right now. Return when finalization has
** completed. Finalization completes when there are no more objects
** pending finalization. This does not mean there are no objects in the
** gc heap that will need finalization should a collection be done after
** this call.
*/
PR_EXTERN(void) PR_ForceFinalize(void);
/*
** Dump the GC heap out to the given file. This will stop the system dead
** in its tracks while it is occuring.
*/
PR_EXTERN(void) PR_DumpGCHeap(FILE *out, PRBool detailed);
/*
** Wrapper for PR_DumpGCHeap
*/
PR_EXTERN(void) PR_DumpMemory(PRBool detailed);
/*
** Dump summary of objects allocated.
*/
PR_EXTERN(void) PR_DumpMemorySummary(void);
/*
** Dump the application heaps.
*/
PR_EXTERN(void) PR_DumpApplicationHeaps(void);
/*
** Helper function used by dump routines to do the indentation in a
** consistent fashion.
*/
PR_EXTERN(void) PR_DumpIndent(FILE *out, PRIntn indent);
/*
** The GCInfo structure contains all of the GC state...
**
** busyMemory:
** The amount of GC heap memory that is busy at this instant. Busy
** doesn't mean alive, it just means that it has been
** allocated. Immediately after a collection busy means how much is
** alive.
**
** freeMemory:
** The amount of GC heap memory that is as yet unallocated.
**
** allocMemory:
** The sum of free and busy memory in the GC heap.
**
** maxMemory:
** The maximum size that the GC heap is allowed to grow.
**
** lowSeg:
** The lowest segment currently used in the GC heap.
**
** highSeg:
** The highest segment currently used in the GC heap.
** The lowSeg and highSeg members are used for a "quick test" of whether
** a pointer falls within the GC heap. [ see GC_IN_HEAP(...) ]
**
** lock:
** Monitor used for synchronization within the GC.
**
** finalizer:
** Thread in which the GC finalizer is running.
**
** liveBlock:
** Object scanning functions call through this function pointer to
** register a potential block of pointers with the collector. (This is
** currently not at all different than processRoot.)
**
** livePointer:
** Object scanning functions call through this function pointer to
** register a single pointer with the collector.
**
** processRootBlock:
** When a root finder identifies a root it should call through this
** function pointer so that the GC can process the root. The call takes
** a base address and count which the gc will examine for valid heap
** pointers.
**
** processRootPointer:
** When a root finder identifies a root it should call through this
** function pointer so that the GC can process the root. The call takes
** a single pointer value.
*/
typedef struct GCInfoStr {
PRWord flags; /* trace flags (see below) */
PRWord busyMemory; /* memory in use right now */
PRWord freeMemory; /* memory free right now */
PRWord allocMemory; /* sum of busy & free memory */
PRWord maxMemory; /* max memory we are allowed to allocate */
PRWord *lowSeg; /* lowest segment in the GC heap */
PRWord *highSeg; /* highest segment in the GC heap */
PRMonitor *lock;
PRThread *finalizer;
void (PR_CALLBACK *liveBlock)(void **base, PRInt32 count);
void (PR_CALLBACK *livePointer)(void *ptr);
void (PR_CALLBACK *processRootBlock)(void **base, PRInt32 count);
void (PR_CALLBACK *processRootPointer)(void *ptr);
FILE* dumpOutput;
#ifdef GCTIMINGHOOK
void (*gcTimingHook)(int32 gcTime);
#endif
} GCInfo;
PR_EXTERN(GCInfo *) PR_GetGCInfo(void);
PR_EXTERN(PRBool) PR_GC_In_Heap(void GCPTR *object);
/*
** Simple bounds check to see if a pointer is anywhere near the GC heap.
** Used to avoid calls to PR_ProcessRoot and GCInfo.livePointer by object
** scanning code.
*/
#if !defined(XP_PC) || defined(_WIN32)
#define GC_IN_HEAP(_info, _p) (((PRWord*)(_p) >= (_info)->lowSeg) && \
((PRWord*)(_p) < (_info)->highSeg))
#else
/*
** The simple bounds check, above, doesn't work in Win16, because we don't
** maintain: lowSeg == MIN(all segments) and highSeg == MAX(all segments).
** So we have to do a little better.
*/
#define GC_IN_HEAP(_info, _p) PR_GC_In_Heap(_p)
#endif
PR_EXTERN(PRWord) PR_GetObjectHeader(void *ptr);
PR_EXTERN(PRWord) PR_SetObjectHeader(void *ptr, PRWord newUserBits);
/************************************************************************/
/* Trace flags (passed to PR_InitGC or in environment GCLOG) */
#define GC_TRACE 0x0001
#define GC_ROOTS 0x0002
#define GC_LIVE 0x0004
#define GC_ALLOC 0x0008
#define GC_MARK 0x0010
#define GC_SWEEP 0x0020
#define GC_DEBUG 0x0040
#define GC_FINAL 0x0080
#if defined(DEBUG_kipp) || defined(DEBUG_warren)
#define GC_CHECK 0x0100
#endif
#ifdef DEBUG
#define GCTRACE(x, y) if (PR_GetGCInfo()->flags & x) GCTrace y
PR_EXTERN(void) GCTrace(char *fmt, ...);
#else
#define GCTRACE(x, y)
#endif
PR_END_EXTERN_C
#endif /* prgc_h___ */

View File

@@ -0,0 +1,103 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
INCLUDES = -I$(dist_includedir) -I../include
CSRCS = prgcapi.c prmsgc.c
ifeq ($(OS_ARCH),WINNT)
CSRCS += win32gc.c
else
ifeq ($(OS_ARCH),OS2)
CSRCS += os2gc.c
else
CSRCS += unixgc.c
endif
endif
NSPR_VERSION = $(MOD_MAJOR_VERSION)
EXTRA_LIBS = $(LIBNSPR)
ifdef RESOLVE_LINK_SYMBOLS
EXTRA_LIBS += $(OS_LIBS)
endif
ifeq ($(OS_ARCH), WINNT)
ifdef NS_USE_GCC
DLLBASE=-Wl,--image-base -Wl,0x30000000
else
DLLBASE=/BASE:0x30000000
endif # GCC
#RES=$(OBJDIR)/ds.res
#RESNAME=$(MOD_DEPTH)/pr/src/nspr.rc
#OS_LIBS = user32.lib
endif # WINNT
LIBRARY_NAME = msgc
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
RELEASE_LIBS = $(TARGETS)
include $(topsrcdir)/config/rules.mk
#
# The Client build wants the shared libraries in $(dist_bindir),
# so we also install them there.
#
export:: $(TARGETS)
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
ifdef SHARED_LIBRARY
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
endif
ifeq ($(MOZ_BITS),16)
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib
$(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/bin
endif

View File

@@ -0,0 +1,75 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "primpl.h"
#include "MacMemAllocator.h"
void _MD_InitGC() {}
void *_MD_GrowGCHeap(size_t *sizep)
{
void *heapPtr = NULL;
size_t heapSize = *sizep;
// In previous versions of this code we tried to allocate GC heaps from the application
// heap. In the 4.0 application, we try to keep our app heap allications to a minimum
// and instead go through our own memory allocation routines.
heapPtr = malloc(heapSize);
if (heapPtr == NULL) {
FreeMemoryStats stats;
memtotal(heapSize, &stats); // How much can we allcoate?
if (stats.maxBlockSize < heapSize)
heapSize = stats.maxBlockSize;
heapPtr = malloc(heapSize);
if (heapPtr == NULL) // Now we're hurting
heapSize = 0;
}
*sizep = heapSize;
return heapPtr;
}
void _MD_FreeGCSegment(void *base, int32 /* len */)
{
free(base);
}

View File

@@ -0,0 +1,83 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* GC related routines
*
*/
#include "prlog.h"
#include <stdlib.h>
/* Leave a bit of room for any malloc header bytes... */
#define MAX_SEGMENT_SIZE (65536L - 4096L)
/************************************************************************/
/*
** Machine dependent GC Heap management routines:
** _MD_GrowGCHeap
*/
/************************************************************************/
void _MD_InitGC() {}
void *_MD_GrowGCHeap(PRUint32 *sizep)
{
void *addr;
if ( *sizep > MAX_SEGMENT_SIZE )
{
*sizep = MAX_SEGMENT_SIZE;
}
addr = malloc((size_t)*sizep);
return addr;
}
PRBool _MD_ExtendGCHeap(char *base, PRInt32 oldSize, PRInt32 newSize) {
/* Not sure about this. Todd? */
return PR_FALSE;
}
void _MD_FreeGCSegment(void *base, PRInt32 len)
{
if (base)
{
free(base);
}
}

View File

@@ -0,0 +1,351 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include "prenv.h"
#include "prmem.h"
#include "prmon.h"
#include "prlog.h"
#include "prthread.h"
#if defined(XP_MAC)
#include "pprthred.h"
#else
#include "private/pprthred.h"
#endif
#include "gcint.h"
/*
** Generic GC implementation independent code for the NSPR GC
*/
RootFinder *_pr_rootFinders;
CollectorType *_pr_collectorTypes;
/* GC State information */
GCInfo _pr_gcData;
GCBeginGCHook *_pr_beginGCHook;
void *_pr_beginGCHookArg;
GCBeginGCHook *_pr_endGCHook;
void *_pr_endGCHookArg;
GCBeginFinalizeHook *_pr_beginFinalizeHook;
void *_pr_beginFinalizeHookArg;
GCBeginFinalizeHook *_pr_endFinalizeHook;
void *_pr_endFinalizeHookArg;
FILE *_pr_dump_file;
int _pr_do_a_dump;
GCLockHook *_pr_GCLockHook;
extern PRLogModuleInfo *_pr_msgc_lm;
/************************************************************************/
static PRStatus PR_CALLBACK
pr_ScanOneThread(PRThread* t, void** addr, PRUword count, void* closure)
{
#if defined(XP_MAC)
#pragma unused (t, closure)
#endif
_pr_gcData.processRootBlock(addr, count);
return PR_SUCCESS;
}
/*
** Scan all of the threads C stack's and registers, looking for "root"
** pointers into the GC heap. These are the objects that the GC cannot
** move and are considered "live" by the GC. Caller has stopped all of
** the threads from running.
*/
static void PR_CALLBACK ScanThreads(void *arg)
{
PR_ScanStackPointers(pr_ScanOneThread, arg);
}
/************************************************************************/
PR_IMPLEMENT(GCInfo *) PR_GetGCInfo(void)
{
return &_pr_gcData;
}
PR_IMPLEMENT(PRInt32) PR_RegisterType(GCType *t)
{
CollectorType *ct, *ect;
int rv = -1;
LOCK_GC();
ct = &_pr_collectorTypes[0];
ect = &_pr_collectorTypes[FREE_MEMORY_TYPEIX];
for (; ct < ect; ct++) {
if (ct->flags == 0) {
ct->gctype = *t;
ct->flags = _GC_TYPE_BUSY;
if (0 != ct->gctype.finalize) {
ct->flags |= _GC_TYPE_FINAL;
}
if (0 != ct->gctype.getWeakLinkOffset) {
ct->flags |= _GC_TYPE_WEAK;
}
rv = ct - &_pr_collectorTypes[0];
break;
}
}
UNLOCK_GC();
return rv;
}
PR_IMPLEMENT(PRStatus) PR_RegisterRootFinder(
GCRootFinder f, char *name, void *arg)
{
RootFinder *rf = PR_NEWZAP(RootFinder);
if (rf) {
rf->func = f;
rf->name = name;
rf->arg = arg;
LOCK_GC();
rf->next = _pr_rootFinders;
_pr_rootFinders = rf;
UNLOCK_GC();
return PR_SUCCESS;
}
return PR_FAILURE;
}
PR_IMPLEMENT(int) PR_RegisterGCLockHook(GCLockHookFunc* f, void *arg)
{
GCLockHook *rf = 0;
rf = (GCLockHook*) calloc(1, sizeof(GCLockHook));
if (rf) {
rf->func = f;
rf->arg = arg;
LOCK_GC();
/* first dummy node */
if (! _pr_GCLockHook) {
_pr_GCLockHook = (GCLockHook*) calloc(1, sizeof(GCLockHook));
_pr_GCLockHook->next = _pr_GCLockHook;
_pr_GCLockHook->prev = _pr_GCLockHook;
}
rf->next = _pr_GCLockHook;
rf->prev = _pr_GCLockHook->prev;
_pr_GCLockHook->prev->next = rf;
_pr_GCLockHook->prev = rf;
UNLOCK_GC();
return 0;
}
return -1;
}
/*
PR_IMPLEMENT(void) PR_SetGCLockHook(GCLockHook *hook, void *arg)
{
LOCK_GC();
_pr_GCLockHook = hook;
_pr_GCLockHookArg2 = arg;
UNLOCK_GC();
}
PR_IMPLEMENT(void) PR_GetGCLockHook(GCLockHook **hook, void **arg)
{
LOCK_GC();
*hook = _pr_GCLockHook;
*arg = _pr_GCLockHookArg2;
UNLOCK_GC();
}
*/
PR_IMPLEMENT(void) PR_SetBeginGCHook(GCBeginGCHook *hook, void *arg)
{
LOCK_GC();
_pr_beginGCHook = hook;
_pr_beginGCHookArg = arg;
UNLOCK_GC();
}
PR_IMPLEMENT(void) PR_GetBeginGCHook(GCBeginGCHook **hook, void **arg)
{
LOCK_GC();
*hook = _pr_beginGCHook;
*arg = _pr_beginGCHookArg;
UNLOCK_GC();
}
PR_IMPLEMENT(void) PR_SetEndGCHook(GCEndGCHook *hook, void *arg)
{
LOCK_GC();
_pr_endGCHook = hook;
_pr_endGCHookArg = arg;
UNLOCK_GC();
}
PR_IMPLEMENT(void) PR_GetEndGCHook(GCEndGCHook **hook, void **arg)
{
LOCK_GC();
*hook = _pr_endGCHook;
*arg = _pr_endGCHookArg;
UNLOCK_GC();
}
PR_IMPLEMENT(void) PR_SetBeginFinalizeHook(GCBeginFinalizeHook *hook, void *arg)
{
LOCK_GC();
_pr_beginFinalizeHook = hook;
_pr_beginFinalizeHookArg = arg;
UNLOCK_GC();
}
PR_IMPLEMENT(void) PR_GetBeginFinalizeHook(GCBeginFinalizeHook **hook,
void **arg)
{
LOCK_GC();
*hook = _pr_beginFinalizeHook;
*arg = _pr_beginFinalizeHookArg;
UNLOCK_GC();
}
PR_IMPLEMENT(void) PR_SetEndFinalizeHook(GCEndFinalizeHook *hook, void *arg)
{
LOCK_GC();
_pr_endFinalizeHook = hook;
_pr_endFinalizeHookArg = arg;
UNLOCK_GC();
}
PR_IMPLEMENT(void) PR_GetEndFinalizeHook(GCEndFinalizeHook **hook, void **arg)
{
LOCK_GC();
*hook = _pr_endFinalizeHook;
*arg = _pr_endFinalizeHookArg;
UNLOCK_GC();
}
#ifdef DEBUG
#include "prprf.h"
#if defined(WIN16)
static FILE *tracefile = 0;
#endif
PR_IMPLEMENT(void) GCTrace(char *fmt, ...)
{
va_list ap;
char buf[400];
va_start(ap, fmt);
PR_vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
#if defined(WIN16)
if ( tracefile == 0 )
{
tracefile = fopen( "xxxGCtr", "w" );
}
fprintf(tracefile, "%s\n", buf );
fflush(tracefile);
#else
PR_LOG(_pr_msgc_lm, PR_LOG_ALWAYS, ("%s", buf));
#endif
}
#endif
void _PR_InitGC(PRWord flags)
{
static char firstTime = 1;
if (!firstTime) return;
firstTime = 0;
_MD_InitGC();
if (flags == 0) {
char *ev = PR_GetEnv("GCLOG");
if (ev && ev[0]) {
flags = atoi(ev);
}
}
_pr_gcData.flags = flags;
_pr_gcData.lock = PR_NewMonitor();
_pr_collectorTypes = (CollectorType*) PR_CALLOC(256 * sizeof(CollectorType));
PR_RegisterRootFinder(ScanThreads, "scan threads", 0);
PR_RegisterRootFinder(_PR_ScanFinalQueue, "scan final queue", 0);
}
extern void pr_FinalizeOnExit(void);
#ifdef DEBUG
#ifdef GC_STATS
PR_PUBLIC_API(void) PR_PrintGCAllocStats(void);
#endif
#endif
PR_IMPLEMENT(void)
PR_ShutdownGC(PRBool finalizeOnExit)
{
/* first finalize all the objects in the heap */
if (finalizeOnExit) {
pr_FinalizeOnExit();
}
#ifdef DEBUG
#ifdef GC_STATS
PR_PrintGCAllocStats();
#endif /* GC_STATS */
#endif /* DEBUG */
/* then the chance for any future allocations */
/* finally delete the gc heap */
/* write me */
}
/******************************************************************************/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prlock.h"
#include "prlog.h"
#include "prmem.h"
#include "gcint.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#define _PR_GC_VMBASE 0x40000000
#if defined(SOLARIS)
#define _MD_MMAP_FLAGS MAP_SHARED
#elif defined(RELIANTUNIX)
#define _MD_MMAP_FLAGS MAP_PRIVATE|MAP_FIXED
#else
#define _MD_MMAP_FLAGS MAP_PRIVATE
#endif
static PRInt32 zero_fd = -1;
static PRLock *zero_fd_lock = NULL;
void _MD_InitGC(void)
{
#ifdef DEBUG
/*
* Disable using mmap(2) if NSPR_NO_MMAP is set
*/
if (getenv("NSPR_NO_MMAP")) {
zero_fd = -2;
return;
}
#endif
zero_fd = open("/dev/zero",O_RDWR , 0);
zero_fd_lock = PR_NewLock();
}
/* This static variable is used by _MD_GrowGCHeap and _MD_ExtendGCHeap */
static void *lastaddr = (void*) _PR_GC_VMBASE;
void *_MD_GrowGCHeap(PRUint32 *sizep)
{
void *addr;
PRUint32 size;
size = *sizep;
PR_Lock(zero_fd_lock);
if (zero_fd < 0) {
goto mmap_loses;
}
/* Extend the mapping */
addr = mmap(lastaddr, size, PROT_READ|PROT_WRITE|PROT_EXEC,
_MD_MMAP_FLAGS,
zero_fd, 0);
if (addr == (void*)-1) {
zero_fd = -1;
goto mmap_loses;
}
lastaddr = ((char*)addr + size);
#ifdef DEBUG
PR_LOG(_pr_msgc_lm, PR_LOG_WARNING,
("GC: heap extends from %08x to %08x\n",
_PR_GC_VMBASE,
_PR_GC_VMBASE + (char*)lastaddr - (char*)_PR_GC_VMBASE));
#endif
PR_Unlock(zero_fd_lock);
return addr;
mmap_loses:
PR_Unlock(zero_fd_lock);
return PR_MALLOC(size);
}
/* XXX - This is disabled. MAP_FIXED just does not work. */
#if 0
PRBool _MD_ExtendGCHeap(char *base, PRInt32 oldSize, PRInt32 newSize) {
PRBool rv = PR_FALSE;
void* addr;
PRInt32 allocSize = newSize - oldSize;
PR_Lock(zero_fd_lock);
addr = mmap(base + oldSize, allocSize, PROT_READ|PROT_WRITE|PROT_EXEC,
_MD_MMAP_FLAGS | MAP_FIXED, zero_fd, 0);
if (addr == (void*)-1) {
goto loser;
}
if (addr != (void*) (base + oldSize)) {
munmap(base + oldSize, allocSize);
goto loser;
}
lastaddr = ((char*)base + newSize);
PR_LOG(_pr_msgc_lm, PR_LOG_ALWAYS,
("GC: heap now extends from %p to %p",
base, base + newSize));
rv = PR_TRUE;
loser:
PR_Unlock(zero_fd_lock);
return rv;
}
#else
PRBool _MD_ExtendGCHeap(char *base, PRInt32 oldSize, PRInt32 newSize) {
return PR_FALSE;
}
#endif
void _MD_FreeGCSegment(void *base, PRInt32 len)
{
if (zero_fd < 0) {
PR_DELETE(base);
} else {
(void) munmap(base, len);
}
}

View File

@@ -0,0 +1,77 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#if defined(WIN16)
#include <windows.h>
#endif
#include "prtypes.h"
#include <stdlib.h>
#define MAX_SEGMENT_SIZE (65536l - 4096l)
/************************************************************************/
/*
** Machine dependent GC Heap management routines:
** _MD_GrowGCHeap
*/
/************************************************************************/
void _MD_InitGC(void) {}
extern void *
_MD_GrowGCHeap(PRUint32 *sizep)
{
void *addr;
if( *sizep > MAX_SEGMENT_SIZE ) {
*sizep = MAX_SEGMENT_SIZE;
}
addr = malloc((size_t)*sizep);
return addr;
}
HINSTANCE _pr_hInstance;
int CALLBACK LibMain( HINSTANCE hInst, WORD wDataSeg,
WORD cbHeapSize, LPSTR lpszCmdLine )
{
_pr_hInstance = hInst;
return TRUE;
}

View File

@@ -0,0 +1,129 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* GC related routines
*
*/
#include <windows.h>
#include "prlog.h"
extern PRLogModuleInfo* _pr_msgc_lm;
#define GC_VMBASE 0x40000000
#define GC_VMLIMIT 0x00FFFFFF
/************************************************************************/
/*
** Machine dependent GC Heap management routines:
** _MD_GrowGCHeap
*/
/************************************************************************/
void *baseaddr = (void*) GC_VMBASE;
void *lastaddr = (void*) GC_VMBASE;
void _MD_InitGC() {}
void *_MD_GrowGCHeap(PRUint32 *sizep)
{
void *addr;
size_t size;
/* Reserve a block of memory for the GC */
if( lastaddr == baseaddr ) {
addr = VirtualAlloc( (void *)GC_VMBASE, GC_VMLIMIT, MEM_RESERVE, PAGE_READWRITE );
/*
** If the GC_VMBASE address is already mapped, then let the OS choose a
** base address that is available...
*/
if (addr == NULL) {
addr = VirtualAlloc( NULL, GC_VMLIMIT, MEM_RESERVE, PAGE_READWRITE );
baseaddr = lastaddr = addr;
if (addr == NULL) {
PR_LOG(_pr_msgc_lm, PR_LOG_ALWAYS, ("GC: unable to allocate heap: LastError=%ld",
GetLastError()));
return 0;
}
}
}
size = *sizep;
/* Extend the mapping */
addr = VirtualAlloc( lastaddr, size, MEM_COMMIT, PAGE_READWRITE );
if (addr == NULL) {
return 0;
}
lastaddr = ((char*)addr + size);
PR_LOG(_pr_msgc_lm, PR_LOG_ALWAYS,
("GC: heap extends from %08x to %08x",
baseaddr, (long)baseaddr + (char*)lastaddr - (char*)baseaddr));
return addr;
}
PRBool _MD_ExtendGCHeap(char *base, PRInt32 oldSize, PRInt32 newSize) {
void* addr;
addr = VirtualAlloc( base + oldSize, newSize - oldSize,
MEM_COMMIT, PAGE_READWRITE );
if (NULL == addr) {
PR_LOG(_pr_msgc_lm, PR_LOG_ALWAYS, ("GC: unable to extend heap: LastError=%ld",
GetLastError()));
return PR_FALSE;
}
if (base + oldSize != (char*)addr) {
PR_LOG(_pr_msgc_lm, PR_LOG_ALWAYS, ("GC: segment extension returned %x instead of %x",
addr, base + oldSize));
VirtualFree(addr, newSize - oldSize, MEM_DECOMMIT);
return PR_FALSE;
}
lastaddr = base + newSize;
PR_LOG(_pr_msgc_lm, PR_LOG_ALWAYS,
("GC: heap now extends from %p to %p",
base, base + newSize));
return PR_TRUE;
}
void _MD_FreeGCSegment(void *base, PRInt32 len)
{
(void)VirtualFree(base, 0, MEM_RELEASE);
}

View File

@@ -0,0 +1,315 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
ifeq ($(OS_TARGET), WIN16)
OS_CFLAGS = $(OS_EXE_CFLAGS)
W16STDIO = $(MOD_DEPTH)/pr/src/md/windows/$(OBJDIR)/w16stdio.$(OBJ_SUFFIX)
endif
ifeq ($(OS_TARGET), OS2)
OS_CFLAGS = $(OS_EXE_CFLAGS)
endif
CSRCS = gc1.c thrashgc.c
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
PROG_SUFFIX = .exe
else
PROG_SUFFIX =
endif
PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
TARGETS = $(PROGS) $(OBJS)
INCLUDES = -I$(dist_includedir)
# Setting the variables LDOPTS and LIBPR. We first initialize
# them to the default values, then adjust them for some platforms.
LDOPTS = -L$(dist_libdir)
NSPR_VERSION = $(MOD_MAJOR_VERSION)
GC_VERSION = $(MOD_MAJOR_VERSION)
LIBPR = -lnspr$(NSPR_VERSION)
LIBPLC = -lplc$(NSPR_VERSION)
LIBGC = -lmsgc$(GC_VERSION)
ifeq ($(OS_ARCH), WINNT)
ifeq ($(OS_TARGET), WIN16)
LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
LIBPLC = $(dist_libdir)/plc$(NSPR_VERSION).lib
LIBGC= $(dist_libdir)/msgc$(GC_VERSION).lib
else
LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).$(LIB_SUFFIX)
LIBPLC = $(dist_libdir)/libplc$(NSPR_VERSION).$(LIB_SUFFIX)
LIBGC= $(dist_libdir)/libmsgc$(GC_VERSION).$(LIB_SUFFIX)
endif
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
LIBPLC = $(dist_libdir)/plc$(NSPR_VERSION).lib
LIBGC= $(dist_libdir)/msgc$(GC_VERSION).lib
else
LDOPTS += -Zomf -Zlinker /PM:VIO
endif
endif
ifneq ($(OS_ARCH), WINNT)
PWD = $(shell pwd)
endif
ifeq ($(OS_ARCH), IRIX)
LDOPTS += -rpath $(PWD)/$(dist_libdir) -rdata_shared
# For 6.x machines, include this flag
ifeq ($(basename $(OS_RELEASE)),6)
ifeq ($(USE_N32),1)
LDOPTS += -n32
else
LDOPTS += -32
endif
endif
endif
ifeq ($(OS_ARCH), OSF1)
# I haven't figured out how to pass -rpath to cc on OSF1 V3.2, so
# we do static linking.
ifeq ($(OS_RELEASE), V3.2)
LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).a
LIBPLC = $(dist_libdir)/libplc$(NSPR_VERSION).a
LIBGC = $(dist_libdir)/libmsgc$(GC_VERSION).a
EXTRA_LIBS = -lc_r
else
LDOPTS += -rpath $(PWD)/$(dist_libdir)
endif
endif
ifeq ($(OS_ARCH), HP-UX)
LDOPTS += -z -Wl,+s,+b,$(PWD)/$(dist_libdir)
endif
# AIX
ifeq ($(OS_ARCH),AIX)
LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
LIBPR = -lnspr$(NSPR_VERSION)_shr
LIBPLC = -lplc$(NSPR_VERSION)_shr
LIBGC = -lmsgc$(GC_VERSION)_shr
else
LDOPTS += -brtl
EXTRA_LIBS = -ldl
endif
endif
# Solaris
ifeq ($(OS_ARCH), SunOS)
ifneq ($(OS_RELEASE), 4.1.3_U1)
ifdef NS_USE_GCC
LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
else
LDOPTS += -R $(PWD)/$(dist_libdir)
endif
endif
ifneq ($(LOCAL_THREADS_ONLY),1)
# SunOS 5.4 and 5.5 need to link with -lthread or -lpthread,
# even though we already linked with these system libraries
# when we built libnspr.so.
ifeq ($(OS_RELEASE), 5.4)
EXTRA_LIBS = -lthread
endif
ifeq ($(OS_RELEASE), 5.5)
ifdef USE_PTHREADS
EXTRA_LIBS = -lpthread
else
EXTRA_LIBS = -lthread
endif
endif
endif # LOCAL_THREADS_ONLY
endif # SunOS
ifeq ($(OS_ARCH),NEC)
EXTRA_LIBS = $(OS_LIBS)
# This hardcodes in the executable programs the directory to find
# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
# option for ld on other platforms.
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH), NCR)
# XXX: We see some strange problems when we link with libnspr.so.
# So for now we use static libraries on NCR. The shared library
# stuff below is commented out.
LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).a
LIBPLC = $(dist_libdir)/libplc$(NSPR_VERSION).a
LIBGC = $(dist_libdir)/libmsgc$(GC_VERSION).a
EXTRA_LIBS = -lsocket -lnsl -ldl
# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
# implicitly by $(CC)) again even though we already linked with these
# system libraries when we built libnspr.so.
#EXTRA_LIBS = -lsocket -lnsl
# This hardcodes in the executable programs the directory to find
# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
# option for ld on other platforms.
#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH), Linux)
ifeq ($(OS_RELEASE), 1.2)
EXTRA_LIBS = -ldl
endif
endif
ifeq ($(OS_ARCH), SCOOS)
# SCO Unix needs to link against -lsocket again even though we
# already linked with these system libraries when we built libnspr.so.
EXTRA_LIBS = -lsocket
# This hardcodes in the executable programs the directory to find
# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
# option for ld on other platforms.
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH),SINIX)
EXTRA_LIBS = -lsocket -lnsl -lresolv -ldl
# This hardcodes in the executable programs the directory to find
# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
# option for ld on other platforms.
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH), UNIXWARE)
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH),BSD_OS)
EXTRA_LIBS = -ldl
endif
ifeq ($(OS_ARCH),DGUX)
EXTRA_LIBS = -lsocket -lnsl -ldl
endif
#####################################################
#
# The rules
#
#####################################################
include $(topsrcdir)/config/rules.mk
AIX_PRE_4_2 = 0
ifeq ($(OS_ARCH),AIX)
ifneq ($(OS_RELEASE),4.2)
ifneq ($(USE_PTHREADS), 1)
#AIX_PRE_4_2 = 1
endif
endif
endif
ifeq ($(AIX_PRE_4_2),1)
# AIX releases prior to 4.2 need a special two-step linking hack
# in order to both override the system select() and be able to
# get at the original system select().
#
# We use a pattern rule in ns/nspr20/config/rules.mk to generate
# the .$(OBJ_SUFFIX) file from the .c source file, then do the
# two-step linking hack below.
$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
rm -f $@ $(AIX_TMP)
$(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(NSPR_VERSION).a
$(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
rm -f $(AIX_TMP)
else
# All platforms that are not AIX pre-4.2.
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
ifeq ($(OS_ARCH), WINNT)
ifeq ($(OS_TARGET),WIN16)
echo system windows >w16link
echo name $@ >>w16link
echo option map >>w16link
# echo option CASEEXACT >>w16link
echo option stack=16K >>w16link
echo debug $(DEBUGTYPE) all >>w16link
echo file >>w16link
echo $< , >>w16link
echo $(W16STDIO) >>w16link
echo library >>w16link
echo $(LIBPR), >>w16link
echo $(LIBPLC), >>w16link
echo $(LIBGC), >>w16link
echo winsock.lib >>w16link
wlink @w16link.
else
link $(LDOPTS) $< $(LIBGC) $(LIBPLC) $(LIBPR) wsock32.lib -out:$@
else
ifeq ($(OS_ARCH),OS2)
$(LINK) $(LDOPTS) $< $(LIBGC) $(LIBPLC) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
else
$(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBGC) $(LIBPLC) $(LIBPR) $(EXTRA_LIBS) -o $@
endif
endif
endif
export:: $(TARGETS)
export:: install
clean::
rm -f $(TARGETS)

View File

@@ -0,0 +1,257 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/***********************************************************************
** Includes
***********************************************************************/
/* Used to get the command line option */
#include "plgetopt.h"
#include "prgc.h"
#include "prinit.h"
#include "prmon.h"
#include "prinrval.h"
#ifndef XP_MAC
#include "private/pprthred.h"
#else
#include "pprthred.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#ifdef XP_MAC
#include "prlog.h"
#define printf PR_LogPrint
extern void SetupMacPrintfLog(char *logFile);
#endif
static PRMonitor *mon;
static PRInt32 threads, waiting, iterations;
static PRInt32 scanCount, finalizeCount, freeCount;
PRIntn failed_already=0;
PRIntn debug_mode;
typedef struct Array {
PRUintn size;
void *body[1];
} Array;
int arrayTypeIndex;
static void PR_CALLBACK ScanArray(void *a)
{
/* printf ("In ScanArray a = %X size = %d \n", a, a->size); */
scanCount++;
}
static void PR_CALLBACK FinalizeArray(void *a)
{
/* printf ("In FinalizeArray a = %X size = %d \n", a, a->size); */
finalizeCount++;
}
static void PR_CALLBACK FreeArray(void *a)
{
/* printf ("In FreeArray\n"); */
freeCount++;
}
static Array *NewArray(PRUintn size)
{
Array *a;
a = (Array *)PR_AllocMemory(sizeof(Array) + size*sizeof(void*) - 1*sizeof(void*),
arrayTypeIndex, PR_ALLOC_CLEAN);
/* printf ("In NewArray a = %X \n", a); */
if (a)
a->size = size;
return a;
}
GCType arrayType = {
ScanArray,
FinalizeArray,
0,
0,
FreeArray,
0
};
static void Initialize(void)
{
PR_InitGC(0, 0, 0, PR_GLOBAL_THREAD);
arrayTypeIndex = PR_RegisterType(&arrayType);
}
static void PR_CALLBACK AllocateLikeMad(void *arg)
{
Array *prev;
PRInt32 i;
PRInt32 count;
count = (PRInt32)arg;
prev = 0;
for (i = 0; i < count; i++) {
Array *leak = NewArray(i & 511);
if ((i & 1023) == 0) {
prev = 0; /* forget */
} else {
if (i & 1) {
prev = leak; /* remember */
}
}
}
PR_EnterMonitor(mon);
waiting++;
PR_Notify(mon);
PR_ExitMonitor(mon);
}
int main(int argc, char **argv)
{
PRIntervalTime start, stop, usec;
double d;
PRIntn i, totalIterations;
/* The command line argument: -d is used to determine if the test is being run
in debug mode. The regress tool requires only one line output:PASS or FAIL.
All of the printfs associated with this test has been handled with a if (debug_mode)
test.
Usage: test_name -d
*/
PLOptStatus os;
PLOptState *opt = PL_CreateOptState(argc, argv, "dt:c:");
threads = 10;
iterations = 100;
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
{
if (PL_OPT_BAD == os) {
fprintf(stderr, "Invalid command-line option\n");
exit(1);
}
switch (opt->option)
{
case 'd': /* debug mode */
debug_mode = 1;
break;
case 't': /* number of threads */
threads = atoi(opt->value);
break;
case 'c': /* iteration count */
iterations = atoi(opt->value);
break;
default:
break;
}
}
PL_DestroyOptState(opt);
fprintf(stderr, "t is %ld, i is %ld\n", (long) threads, (long) iterations);
/* main test */
PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 5);
PR_STDIO_INIT();
Initialize();
#ifdef XP_MAC
SetupMacPrintfLog("gc1.log");
debug_mode = 1;
#endif
/* Spin all of the allocator threads and then wait for them to exit */
start = PR_IntervalNow();
mon = PR_NewMonitor();
PR_EnterMonitor(mon);
waiting = 0;
for (i = 0; i < threads; i++) {
(void) PR_CreateThreadGCAble(PR_USER_THREAD,
AllocateLikeMad, (void*)iterations,
PR_PRIORITY_NORMAL,
PR_LOCAL_THREAD,
PR_UNJOINABLE_THREAD,
0);
}
while (waiting != threads) {
PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
}
PR_ExitMonitor(mon);
PR_GC();
PR_ForceFinalize();
totalIterations = iterations * threads;
/*
if (scanCount != totalIterations)
printf ("scanCount discrepancy scanCount = %d totalIterations = %d \n",
scanCount, totalIterations);
if (freeCount != totalIterations)
printf ("freeCount discrepancy freeCount = %d totalIterations = %d \n",
freeCount, totalIterations);
if ((finalizeCount != totalIterations) && (finalizeCount != (totalIterations-1)))
printf ("finalizeCount discrepancy finalizeCount = %d totalIterations = %d \n",
finalizeCount,totalIterations);
*/
stop = PR_IntervalNow();
usec = stop = stop - start;
d = (double)usec;
if (debug_mode) printf("%40s: %6.2f usec\n", "GC allocation", d / (iterations * threads));
else {
if (d == 0.0) failed_already = PR_TRUE;
}
PR_Cleanup();
if(failed_already)
{
printf("FAIL\n");
return 1;
}
else
{
printf("PASS\n");
return 0;
}
}

View File

@@ -0,0 +1,274 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/***********************************************************************
** Name: thrashgc
**
** Description: test garbace collection functions.
**
** Modification History:
** 19-May-97 AGarcia- Converted the test to accomodate the debug_mode flag.
** The debug mode will print all of the printfs associated with this test.
** The regress mode will be the default mode. Since the regress tool limits
** the output to a one line status:PASS or FAIL,all of the printf statements
** have been handled with an if (debug_mode) statement.
** 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to
** recognize the return code from tha main program.
***********************************************************************/
/***********************************************************************
** Includes
***********************************************************************/
#include "prthread.h"
#include "prgc.h"
#include "prprf.h"
#include "prinrval.h"
#include "prlock.h"
#include "prinit.h"
#include "prcvar.h"
#ifndef XP_MAC
#include "private/pprthred.h"
#else
#include "pprthred.h"
#endif
#include <stdio.h>
#include <memory.h>
#include <string.h>
#ifdef XP_MAC
#include "prlog.h"
#define printf PR_LogPrint
extern void SetupMacPrintfLog(char *logFile);
#endif
PRIntn failed_already=0;
PRIntn debug_mode;
static char* progname;
static PRInt32 loops = 1000;
static int tix1, tix2, tix3;
static GCInfo* gcInfo;
static PRLock* stderrLock;
typedef struct Type1 Type1;
typedef struct Type2 Type2;
struct Type1 {
Type2* atwo;
Type1* next;
};
struct Type2 {
void* buf;
};
static void PR_CALLBACK ScanType1(void *obj) {
gcInfo->livePointer(((Type1 *)obj)->atwo);
gcInfo->livePointer(((Type1 *)obj)->next);
}
static void PR_CALLBACK ScanType2(void *obj) {
gcInfo->livePointer(((Type2 *)obj)->buf);
}
static GCType type1 = {
ScanType1
};
static GCType type2 = {
ScanType2
/* (void (*)(void*)) ScanType2 */
};
static GCType type3 = {
0
};
Type1* NewType1(void) {
Type1* p = (Type1*) PR_AllocMemory(sizeof(Type1), tix1, PR_ALLOC_DOUBLE);
PR_ASSERT(p != NULL);
return p;
}
Type2* NewType2(void) {
Type2* p = (Type2*) PR_AllocMemory(sizeof(Type2), tix2, PR_ALLOC_DOUBLE);
PR_ASSERT(p != NULL);
return p;
}
void* NewBuffer(PRInt32 size) {
void* p = PR_AllocMemory(size, tix3, PR_ALLOC_DOUBLE);
PR_ASSERT(p != NULL);
return p;
}
/* Allocate alot of garbage */
static void PR_CALLBACK AllocStuff(void *unused) {
PRInt32 i;
void* danglingRefs[50];
PRIntervalTime start, end;
char msg[100];
start = PR_IntervalNow();
for (i = 0; i < loops; i++) {
void* p;
if (i & 1) {
Type1* t1 = NewType1();
t1->atwo = NewType2();
t1->next = NewType1();
t1->atwo->buf = NewBuffer(100);
p = t1;
} else {
Type2* t2 = NewType2();
t2->buf = NewBuffer(i & 16383);
p = t2;
}
if ((i % 10) == 0) {
memmove(&danglingRefs[0], &danglingRefs[1], 49*sizeof(void*));
danglingRefs[49] = p;
}
}
end = PR_IntervalNow();
if (debug_mode) PR_snprintf(msg, sizeof(msg), "Thread %p: %ld allocations took %ld ms",
PR_GetCurrentThread(), loops,
PR_IntervalToMilliseconds((PRIntervalTime) (end - start)));
PR_Lock(stderrLock);
#ifndef XP_MAC
fprintf(stderr, "%s\n", msg);
#else
if (debug_mode) printf("%s\n", msg);
#endif
PR_Unlock(stderrLock);
}
static void usage(char *progname) {
#ifndef XP_MAC
fprintf(stderr, "Usage: %s [-t threads] [-l loops]\n", progname);
#else
printf("Usage: %s [-t threads] [-l loops]\n", progname);
#endif
exit(-1);
}
static int realMain(int argc, char **argv, char *notused) {
int i;
int threads = 0;
#ifndef XP_MAC
progname = strrchr(argv[0], '/');
if (progname == 0) progname = argv[0];
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-t") == 0) {
if (i == argc - 1) {
usage(progname);
}
threads = atoi(argv[++i]);
if (threads < 0) threads = 0;
if (threads > 10000) threads = 10000;
continue;
}
if (strcmp(argv[i], "-l") == 0) {
if (i == argc - 1) {
usage(progname);
}
loops = atoi(argv[++i]);
continue;
}
usage(progname);
}
#else
threads = 50;
#endif
for (i = 0; i < threads; i++) {
PRThread* thread;
/* XXXXX */
thread = PR_CreateThreadGCAble(PR_USER_THREAD, /* thread type */
AllocStuff, /* start function */
NULL, /* arg */
PR_PRIORITY_NORMAL, /* priority */
PR_LOCAL_THREAD, /* thread scope */
PR_UNJOINABLE_THREAD, /* thread state */
0); /* stack size */
if (thread == 0) {
#ifndef XP_MAC
fprintf(stderr, "%s: no more threads (only %d were created)\n",
progname, i);
#else
printf("%s: no more threads (only %d were created)\n",
progname, i);
#endif
break;
}
}
AllocStuff(NULL);
return 0;
}
static int padMain(int argc, char **argv) {
char pad[512];
return realMain(argc, argv, pad);
}
int main(int argc, char **argv) {
int rv;
debug_mode = 1;
PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
PR_SetThreadGCAble();
#ifdef XP_MAC
SetupMacPrintfLog("thrashgc.log");
debug_mode = 1;
#endif
PR_InitGC(0, 0, 0, PR_GLOBAL_THREAD);
PR_STDIO_INIT();
stderrLock = PR_NewLock();
tix1 = PR_RegisterType(&type1);
tix2 = PR_RegisterType(&type2);
tix3 = PR_RegisterType(&type3);
gcInfo = PR_GetGCInfo();
rv = padMain(argc, argv);
printf("PASS\n");
PR_Cleanup();
return rv;
}

View File

@@ -0,0 +1,207 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
# Disable optimization of the nspr on SunOS4.1.3
ifeq ($(OS_ARCH),SunOS)
ifeq ($(OS_RELEASE),4.1.3_U1)
OPTIMIZER =
else
# The C++ compiler in Workshop 5.0 uses standard
# iostreams as default. -library=iostream will
# allow Workshop 5.0 to work with classic iostreams.
ifndef NS_USE_GCC
CCC_VERSION := $(shell $(CCC) -V 2>&1)
ifneq (,$(findstring 5.0,$(CCC_VERSION)))
CCC_ONLY_FLAGS += -library=iostream
endif
endif
endif
endif
ifeq ($(OS_ARCH), IRIX)
ifneq ($(OS_RELEASE),5.3)
CCC_ONLY_FLAGS += -exceptions
endif
endif
ifeq ($(OS_ARCH), BeOS)
CFLAGS += -frtti -fexceptions
endif
INCLUDES = -I$(dist_includedir)
HEADERS = $(wildcard $(srcdir)/*.h)
CSRCS = \
plvrsion.c \
$(NULL)
CXXSRCS = \
prstrms.cpp \
$(NULL)
OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX)) $(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
ifeq ($(OS_ARCH), WINNT)
DLLBASE=/BASE:0x30000000
RES=$(OBJDIR)/prstrms.res
RESNAME=prstrms.rc
OS_LIBS = user32.lib
else
ifeq ($(OS_ARCH),OS2)
ifneq ($(MOZ_OS2_TOOLS),VACPP)
OS_LIBS = -lstdcpp
endif
else
ifeq ($(OS_ARCH), AIX)
ifeq ($(OS_RELEASE), 4.1)
ifeq ($(CLASSIC_NSPR),1)
OS_LIBS += -lC -lc
else
OS_LIBS += -lC_r -lc_r
endif
else
# makeC++SharedLib(_r) is in either /usr/lpp/xlC/bin
# or /usr/ibmcxx/bin.
ifeq ($(CLASSIC_NSPR),1)
MKSHLIB = makeC++SharedLib -p 0
else
MKSHLIB = makeC++SharedLib_r -p 0
endif
OS_LIBS += -ldl
endif
endif
endif
endif
ifeq ($(OS_ARCH),BeOS)
OS_LIBS = -lstdc++.r4
endif
ifeq ($(OS_ARCH), UNIXWARE)
OS_LIBS += -lC
endif
EXTRA_LIBS = $(LIBNSPR)
# On NCR and SCOOS, we can't link with extra libraries when
# we build a shared library. If we do so, the linker doesn't
# complain, but we would run into weird problems at run-time.
# Therefore on these platforms, we link just the object files.
ifeq ($(OS_ARCH),NCR)
EXTRA_LIBS =
endif
ifeq ($(OS_ARCH),SCOOS)
EXTRA_LIBS =
endif
ifdef RESOLVE_LINK_SYMBOLS
EXTRA_LIBS += $(OS_LIBS)
endif
LIBRARY_NAME = prstrms
LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
RELEASE_HEADERS = $(HEADERS)
RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
RELEASE_LIBS = $(TARGETS)
include $(topsrcdir)/config/rules.mk
#
# Version information generation (begin)
#
ECHO = echo
TINC = $(OBJDIR)/_pl_bld.h
PROD = $(notdir $(SHARED_LIBRARY))
NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
SH_DATE = $(shell date "+%Y-%m-%d %T")
SH_NOW = $(shell $(NOW))
ifeq ($(OS_ARCH), WINNT)
SUF = i64
else
SUF = LL
endif
$(TINC):
@$(MAKE_OBJDIR)
@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
@if test ! -z "$(SH_NOW)"; then \
$(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
else \
true; \
fi
@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
ifeq ($(OS_ARCH), WINNT)
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
else
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
else
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
endif
endif
#
# Version information generation (end)
#
export:: $(TARGETS) $(HEADERS)
$(INSTALL) -m 444 $(HEADERS) $(dist_includedir)
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
ifeq ($(OS_ARCH),OS2)
$(INSTALL) -m 444 $(TARGETS) $(dist_bindir)
endif
ifeq ($(OS_ARCH),HP-UX)
ifdef SHARED_LIBRARY
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
endif
endif

View File

@@ -0,0 +1,125 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prinit.h"
#include "prvrsion.h"
/************************************************************************/
/**************************IDENTITY AND VERSIONING***********************/
/************************************************************************/
#include "_pl_bld.h"
#if !defined(_BUILD_TIME)
#ifdef HAVE_LONG_LONG
#define _BUILD_TIME 0
#else
#define _BUILD_TIME {0, 0}
#endif
#endif
#if !defined(_BUILD_STRING)
#define _BUILD_STRING ""
#endif
#if !defined(_PRODUCTION)
#define _PRODUCTION ""
#endif
#if defined(DEBUG)
#define _DEBUG_STRING " (debug)"
#else
#define _DEBUG_STRING ""
#endif
/*
* A trick to expand the PR_VMAJOR macro before concatenation.
*/
#define CONCAT(x, y) x ## y
#define CONCAT2(x, y) CONCAT(x, y)
#define VERSION_DESC_NAME CONCAT2(prVersionDescription_libprstrms, PR_VMAJOR)
PRVersionDescription VERSION_DESC_NAME =
{
/* version */ 2, /* this is the only one supported */
/* buildTime */ _BUILD_TIME, /* usecs since midnight 1/1/1970 GMT */
/* buildTimeString */ _BUILD_STRING, /* ditto, but human readable */
/* vMajor */ PR_VMAJOR, /* NSPR's version number */
/* vMinor */ PR_VMINOR, /* and minor version */
/* vPatch */ PR_VPATCH, /* and patch */
/* beta */ PR_BETA, /* beta build boolean */
#if defined(DEBUG)
/* debug */ PR_TRUE, /* a debug build */
#else
/* debug */ PR_FALSE, /* an optomized build */
#endif
/* special */ PR_FALSE, /* they're all special, but ... */
/* filename */ _PRODUCTION, /* the produced library name */
/* description */ "Portable runtime", /* what we are */
/* security */ "N/A", /* not applicable here */
/* copywrite */ "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved",
/* comment */ "http://www.mozilla.org/MPL/",
/* specialString */ ""
};
#ifdef XP_UNIX
/*
* Version information for the 'ident' and 'what commands
*
* NOTE: the first component of the concatenated rcsid string
* must not end in a '$' to prevent rcs keyword substitution.
*/
static char rcsid[] = "$Header: NSPR " PR_VERSION _DEBUG_STRING
" " _BUILD_STRING " $";
static char sccsid[] = "@(#)NSPR " PR_VERSION _DEBUG_STRING
" " _BUILD_STRING;
#endif /* XP_UNIX */
PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
{
#ifdef XP_UNIX
/*
* Add dummy references to rcsid and sccsid to prevent them
* from being optimized away as unused variables.
*/
const char *dummy;
dummy = rcsid;
dummy = sccsid;
#endif
return &VERSION_DESC_NAME;
} /* versionEntryPointType */
/* plvrsion.c */

View File

@@ -0,0 +1,550 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Robin J. Maxwell 11-22-96
*/
#include "prstrms.h"
#include <string.h> // memmove
//
// Definition of macros _PRSTR_BP, _PRSTR_DELBUF, and _PRSTR_DELBUF_C.
//
// _PRSTR_BP is the protected member of class ios that is returned
// by the public method rdbuf().
//
// _PRSTR_DELBUF is the method or data member of class ios, if available,
// with which we can ensure that the ios destructor does not delete
// the associated streambuf. If such a method or data member does not
// exist, define _PRSTR_DELBUF to be empty.
//
// _PRSTR_DELBUF_C is just _PRSTR_DELBUF qualified by a base class.
//
#if defined(__GNUC__)
#define _PRSTR_BP _strbuf
#define _PRSTR_DELBUF(x) /* as nothing */
#define _PRSTR_DELBUF_C(c, x) /* as nothing */
#elif defined(WIN32)
#define _PRSTR_BP bp
#define _PRSTR_DELBUF(x) delbuf(x)
#define _PRSTR_DELBUF_C(c, x) c::_PRSTR_DELBUF(x)
#elif defined(VMS)
#undef _PRSTR_BP
#define _PRSTR_DELBUF(x) /* as nothing */
#define _PRSTR_DELBUF_C(c, x) /* as nothing */
#elif defined(OSF1)
#define _PRSTR_BP m_psb
#define _PRSTR_DELBUF(x) /* as nothing */
#define _PRSTR_DELBUF_C(c, x) /* as nothing */
#elif defined(QNX)
#define PRFSTREAMS_BROKEN
#else
#define _PRSTR_BP bp
// Unix compilers don't believe in encapsulation
// At least on Solaris this is also ignored
#define _PRSTR_DELBUF(x) delbuf = x
#define _PRSTR_DELBUF_C(c, x) c::_PRSTR_DELBUF(x)
#endif
const PRIntn STRM_BUFSIZ = 8192;
#if !defined (PRFSTREAMS_BROKEN)
PRfilebuf::PRfilebuf():
_fd(0),
_opened(PR_FALSE),
_allocated(PR_FALSE)
{
}
PRfilebuf::PRfilebuf(PRFileDesc *fd):
streambuf(),
_fd(fd),
_opened(PR_FALSE),
_allocated(PR_FALSE)
{
}
PRfilebuf::PRfilebuf(PRFileDesc *fd, char * buffptr, int bufflen):
_fd(fd),
_opened(PR_FALSE),
_allocated(PR_FALSE)
{
PRfilebuf::setbuf(buffptr, bufflen);
}
PRfilebuf::~PRfilebuf()
{
if (_opened){
close();
}else
sync();
if (_allocated)
delete base();
}
PRfilebuf*
PRfilebuf::open(const char *name, int mode, int flags)
{
if (_fd != 0)
return 0; // error if already open
PRIntn PRmode = 0;
// translate mode argument
if (!(mode & ios::nocreate))
PRmode |= PR_CREATE_FILE;
//if (mode & ios::noreplace)
// PRmode |= O_EXCL;
if (mode & ios::app){
mode |= ios::out;
PRmode |= PR_APPEND;
}
if (mode & ios::trunc){
mode |= ios::out; // IMPLIED
PRmode |= PR_TRUNCATE;
}
if (mode & ios::out){
if (mode & ios::in)
PRmode |= PR_RDWR;
else
PRmode |= PR_WRONLY;
if (!(mode & (ios::in|ios::app|ios::ate|ios::noreplace))){
mode |= ios::trunc; // IMPLIED
PRmode |= PR_TRUNCATE;
}
}else if (mode & ios::in)
PRmode |= PR_RDONLY;
else
return 0; // error if not ios:in or ios::out
//
// The usual portable across unix crap...
// NT gets a hokey piece of junk layer that prevents
// access to the API.
#ifdef WIN32
_fd = PR_Open(name, PRmode, PRmode);
#else
_fd = PR_Open(name, PRmode, flags);
#endif
if (_fd == 0)
return 0;
_opened = PR_TRUE;
if ((!unbuffered()) && (!ebuf())){
char * sbuf = new char[STRM_BUFSIZ];
if (!sbuf)
unbuffered(1);
else{
_allocated = PR_TRUE;
streambuf::setb(sbuf,sbuf+STRM_BUFSIZ,0);
}
}
if (mode & ios::ate){
if (seekoff(0,ios::end,mode)==EOF){
close();
return 0;
}
}
return this;
}
PRfilebuf*
PRfilebuf::attach(PRFileDesc *fd)
{
_opened = PR_FALSE;
_fd = fd;
return this;
}
int
PRfilebuf::overflow(int c)
{
if (allocate()==EOF) // make sure there is a reserve area
return EOF;
if (PRfilebuf::sync()==EOF) // sync before new buffer created below
return EOF;
if (!unbuffered())
setp(base(),ebuf());
if (c!=EOF){
if ((!unbuffered()) && (pptr() < epptr())) // guard against recursion
sputc(c);
else{
if (PR_Write(_fd, &c, 1)!=1)
return(EOF);
}
}
return(1); // return something other than EOF if successful
}
int
PRfilebuf::underflow()
{
int count;
unsigned char tbuf;
if (in_avail())
return (int)(unsigned char) *gptr();
if (allocate()==EOF) // make sure there is a reserve area
return EOF;
if (PRfilebuf::sync()==EOF)
return EOF;
if (unbuffered())
{
if (PR_Read(_fd,(void *)&tbuf,1)<=0)
return EOF;
return (int)tbuf;
}
if ((count=PR_Read(_fd,(void *)base(),blen())) <= 0)
return EOF; // reached EOF
setg(base(),base(),base()+count);
return (int)(unsigned char) *gptr();
}
streambuf*
PRfilebuf::setbuf(char *buffptr, PRstreambuflen bufflen)
{
if (is_open() && (ebuf()))
return 0;
if ((!buffptr) || (bufflen <= 0))
unbuffered(1);
else
setb(buffptr, buffptr+bufflen, 0);
return this;
}
streampos
PRfilebuf::seekoff(streamoff offset, ios::seek_dir dir, int /* mode */)
{
if (PR_GetDescType(_fd) == PR_DESC_FILE){
PRSeekWhence fdir;
PRInt32 retpos;
switch (dir) {
case ios::beg :
fdir = PR_SEEK_SET;
break;
case ios::cur :
fdir = PR_SEEK_CUR;
break;
case ios::end :
fdir = PR_SEEK_END;
break;
default:
// error
return(EOF);
}
if (PRfilebuf::sync()==EOF)
return EOF;
if ((retpos=PR_Seek(_fd, offset, fdir))==-1L)
return (EOF);
return((streampos)retpos);
}else
return (EOF);
}
int
PRfilebuf::sync()
{
PRInt32 count;
if (_fd==0)
return(EOF);
if (!unbuffered()){
// Sync write area
if ((count=out_waiting())!=0){
PRInt32 nout;
if ((nout =PR_Write(_fd,
(void *) pbase(),
(unsigned int)count)) != count){
if (nout > 0) {
// should set _pptr -= nout
pbump(-(int)nout);
memmove(pbase(), pbase()+nout, (int)(count-nout));
}
return(EOF);
}
}
setp(0,0); // empty put area
if (PR_GetDescType(_fd) == PR_DESC_FILE){
// Sockets can't seek; don't need this
if ((count=in_avail()) > 0){
if (PR_Seek(_fd, -count, PR_SEEK_CUR)!=-1L)
{
return (EOF);
}
}
}
setg(0,0,0); // empty get area
}
return(0);
}
PRfilebuf *
PRfilebuf::close()
{
int retval;
if (_fd==0)
return 0;
retval = sync();
if ((PR_Close(_fd)==0) || (retval==EOF))
return 0;
_fd = 0;
return this;
}
PRifstream::PRifstream():
istream(new PRfilebuf)
{
_PRSTR_DELBUF(0);
}
PRifstream::PRifstream(PRFileDesc *fd):
istream(new PRfilebuf(fd))
{
_PRSTR_DELBUF(0);
}
PRifstream::PRifstream(PRFileDesc *fd, char *buff, int bufflen):
istream(new PRfilebuf(fd, buff, bufflen))
{
_PRSTR_DELBUF(0);
}
PRifstream::PRifstream(const char * name, int mode, int flags):
istream(new PRfilebuf)
{
_PRSTR_DELBUF(0);
if (!rdbuf()->open(name, (mode|ios::in), flags))
clear(rdstate() | ios::failbit);
}
PRifstream::~PRifstream()
{
sync();
delete rdbuf();
#ifdef _PRSTR_BP
_PRSTR_BP = 0;
#endif
}
streambuf *
PRifstream::setbuf(char * ptr, int len)
{
if ((is_open()) || (!(rdbuf()->setbuf(ptr, len)))){
clear(rdstate() | ios::failbit);
return 0;
}
return rdbuf();
}
void
PRifstream::attach(PRFileDesc *fd)
{
if (!(rdbuf()->attach(fd)))
clear(rdstate() | ios::failbit);
}
void
PRifstream::open(const char * name, int mode, int flags)
{
if (is_open() || !(rdbuf()->open(name, (mode|ios::in), flags)))
clear(rdstate() | ios::failbit);
}
void
PRifstream::close()
{
clear((rdbuf()->close()) ? 0 : (rdstate() | ios::failbit));
}
PRofstream::PRofstream():
ostream(new PRfilebuf)
{
_PRSTR_DELBUF(0);
}
PRofstream::PRofstream(PRFileDesc *fd):
ostream(new PRfilebuf(fd))
{
_PRSTR_DELBUF(0);
}
PRofstream::PRofstream(PRFileDesc *fd, char *buff, int bufflen):
ostream(new PRfilebuf(fd, buff, bufflen))
{
_PRSTR_DELBUF(0);
}
PRofstream::PRofstream(const char *name, int mode, int flags):
ostream(new PRfilebuf)
{
_PRSTR_DELBUF(0);
if (!rdbuf()->open(name, (mode|ios::out), flags))
clear(rdstate() | ios::failbit);
}
PRofstream::~PRofstream()
{
flush();
delete rdbuf();
#ifdef _PRSTR_BP
_PRSTR_BP = 0;
#endif
}
streambuf *
PRofstream::setbuf(char * ptr, int len)
{
if ((is_open()) || (!(rdbuf()->setbuf(ptr, len)))){
clear(rdstate() | ios::failbit);
return 0;
}
return rdbuf();
}
void
PRofstream::attach(PRFileDesc *fd)
{
if (!(rdbuf()->attach(fd)))
clear(rdstate() | ios::failbit);
}
void
PRofstream::open(const char * name, int mode, int flags)
{
if (is_open() || !(rdbuf()->open(name, (mode|ios::out), flags)))
clear(rdstate() | ios::failbit);
}
void
PRofstream::close()
{
clear((rdbuf()->close()) ? 0 : (rdstate() | ios::failbit));
}
PRfstream::PRfstream():
iostream(new PRfilebuf)
{
_PRSTR_DELBUF_C(istream, 0);
_PRSTR_DELBUF_C(ostream, 0);
}
PRfstream::PRfstream(PRFileDesc *fd):
iostream(new PRfilebuf(fd))
{
_PRSTR_DELBUF_C(istream, 0);
_PRSTR_DELBUF_C(ostream, 0);
}
PRfstream::PRfstream(PRFileDesc *fd, char *buff, int bufflen):
iostream(new PRfilebuf(fd, buff, bufflen))
{
_PRSTR_DELBUF_C(istream, 0);
_PRSTR_DELBUF_C(ostream, 0);
}
PRfstream::PRfstream(const char *name, int mode, int flags):
iostream(new PRfilebuf)
{
_PRSTR_DELBUF_C(istream, 0);
_PRSTR_DELBUF_C(ostream, 0);
if (!rdbuf()->open(name, (mode|(ios::in|ios::out)), flags))
clear(rdstate() | ios::failbit);
}
PRfstream::~PRfstream()
{
sync();
flush();
delete rdbuf();
#ifdef _PRSTR_BP
istream::_PRSTR_BP = 0;
ostream::_PRSTR_BP = 0;
#endif
}
streambuf *
PRfstream::setbuf(char * ptr, int len)
{
if ((is_open()) || (!(rdbuf()->setbuf(ptr, len)))){
clear(rdstate() | ios::failbit);
return 0;
}
return rdbuf();
}
void
PRfstream::attach(PRFileDesc *fd)
{
if (!(rdbuf()->attach(fd)))
clear(rdstate() | ios::failbit);
}
void
PRfstream::open(const char * name, int mode, int flags)
{
if (is_open() || !(rdbuf()->open(name, (mode|(ios::in|ios::out)), flags)))
clear(rdstate() | ios::failbit);
}
void
PRfstream::close()
{
clear((rdbuf()->close()) ? 0 : (rdstate() | ios::failbit));
}
#else
// fix it sometime
int fix_prfstreams () { return 0; }
#endif

View File

@@ -0,0 +1,153 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Robin J. Maxwell 11-22-96
*/
#ifndef _PRSTRMS_H
#define _PRSTRMS_H
#include "prtypes.h"
#include "prio.h"
#ifdef _MSC_VER
#pragma warning( disable : 4275)
#endif
#include <iostream.h>
#if defined(AIX) && defined(__64BIT__)
typedef long PRstreambuflen;
#else
typedef int PRstreambuflen;
#endif
#if defined (PRFSTREAMS_BROKEN)
// fix it sometime
#define PRfilebuf streambuf
#define PRifstream ifstream
#define PRofstream ofstream
#define PRfstream fstream
#else
class PR_IMPLEMENT(PRfilebuf): public streambuf
{
public:
PRfilebuf();
PRfilebuf(PRFileDesc *fd);
PRfilebuf(PRFileDesc *fd, char * buffptr, int bufflen);
~PRfilebuf();
virtual int overflow(int=EOF);
virtual int underflow();
virtual streambuf *setbuf(char *buff, PRstreambuflen bufflen);
virtual streampos seekoff(streamoff, ios::seek_dir, int);
virtual int sync();
PRfilebuf *open(const char *name, int mode, int flags);
PRfilebuf *attach(PRFileDesc *fd);
PRfilebuf *close();
int is_open() const {return (_fd != 0);}
PRFileDesc *fd(){return _fd;}
private:
PRFileDesc * _fd;
PRBool _opened;
PRBool _allocated;
};
class PR_IMPLEMENT(PRifstream): public istream {
public:
PRifstream();
PRifstream(const char *, int mode=ios::in, int flags = 0);
PRifstream(PRFileDesc *);
PRifstream(PRFileDesc *, char *, int);
~PRifstream();
streambuf * setbuf(char *, int);
PRfilebuf* rdbuf(){return (PRfilebuf*) ios::rdbuf(); }
void attach(PRFileDesc *fd);
PRFileDesc *fd() {return rdbuf()->fd();}
int is_open(){return rdbuf()->is_open();}
void open(const char *, int mode=ios::in, int flags= 0);
void close();
};
class PR_IMPLEMENT(PRofstream) : public ostream {
public:
PRofstream();
PRofstream(const char *, int mode=ios::out, int flags = 0);
PRofstream(PRFileDesc *);
PRofstream(PRFileDesc *, char *, int);
~PRofstream();
streambuf * setbuf(char *, int);
PRfilebuf* rdbuf() { return (PRfilebuf*) ios::rdbuf(); }
void attach(PRFileDesc *);
PRFileDesc *fd() {return rdbuf()->fd();}
int is_open(){return rdbuf()->is_open();}
void open(const char *, int =ios::out, int = 0);
void close();
};
class PR_IMPLEMENT(PRfstream) : public iostream {
public:
PRfstream();
PRfstream(const char *name, int mode, int flags= 0);
PRfstream(PRFileDesc *fd);
PRfstream(PRFileDesc *fd, char *buff, int bufflen);
~PRfstream();
streambuf * setbuf(char *, int);
PRfilebuf* rdbuf(){ return (PRfilebuf*) ostream::rdbuf(); }
void attach(PRFileDesc *);
PRFileDesc *fd() { return rdbuf()->fd(); }
int is_open() { return rdbuf()->is_open(); }
void open(const char *, int, int = 0);
void close();
};
#endif
#endif /* _PRSTRMS_H */

View File

@@ -0,0 +1,102 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prinit.h"
#include <winver.h>
#define MY_LIBNAME "prstrms"
#define MY_FILEDESCRIPTION "PRSTRMS Library"
#define STRINGIZE(x) #x
#define STRINGIZE2(x) STRINGIZE(x)
#define PR_VMAJOR_STR STRINGIZE2(PR_VMAJOR)
#ifdef _DEBUG
#define MY_DEBUG_STR " (debug)"
#define MY_FILEFLAGS_1 VS_FF_DEBUG
#else
#define MY_DEBUG_STR ""
#define MY_FILEFLAGS_1 0x0L
#endif
#if PR_BETA
#define MY_FILEFLAGS_2 MY_FILEFLAGS_1|VS_FF_PRERELEASE
#else
#define MY_FILEFLAGS_2 MY_FILEFLAGS_1
#endif
#ifdef WINNT
#define MY_FILEOS VOS_NT_WINDOWS32
#define MY_INTERNAL_NAME "lib" MY_LIBNAME PR_VMAJOR_STR
#else
#define MY_FILEOS VOS__WINDOWS32
#define MY_INTERNAL_NAME MY_LIBNAME PR_VMAJOR_STR
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Version-information resource
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION PR_VMAJOR,PR_VMINOR,PR_VPATCH,0
PRODUCTVERSION PR_VMAJOR,PR_VMINOR,PR_VPATCH,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS MY_FILEFLAGS_2
FILEOS MY_FILEOS
FILETYPE VFT_DLL
FILESUBTYPE 0x0L // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0" // Lang=US English, CharSet=Unicode
BEGIN
VALUE "CompanyName", "Netscape Communications Corporation\0"
VALUE "FileDescription", MY_FILEDESCRIPTION MY_DEBUG_STR "\0"
VALUE "FileVersion", PR_VERSION "\0"
VALUE "InternalName", MY_INTERNAL_NAME "\0"
VALUE "LegalCopyright", "Copyright \251 1996-2000 Netscape Communications Corporation\0"
VALUE "OriginalFilename", MY_INTERNAL_NAME ".dll\0"
VALUE "ProductName", "Netscape Portable Runtime\0"
VALUE "ProductVersion", PR_VERSION "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -0,0 +1,254 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
ifeq ($(OS_TARGET), WIN16)
OS_CFLAGS = $(OS_EXE_CFLAGS)
endif
CXXSRCS = \
testprstrm.cpp \
$(NULL)
OBJS = $(addprefix $(OBJDIR)/,$(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
PROG_SUFFIX = .exe
else
PROG_SUFFIX =
endif
PROGS = $(addprefix $(OBJDIR)/, $(CXXSRCS:.cpp=$(PROG_SUFFIX)))
TARGETS = $(PROGS) $(OBJS)
INCLUDES = -I$(dist_includedir)
# Setting the variables LDOPTS and LIBPR. We first initialize
# them to the default values, then adjust them for some platforms.
LDOPTS = -L$(dist_libdir)
LIBPR = -lnspr$(MOD_MAJOR_VERSION)
LIBPRSTRMS = -lprstrms$(MOD_MAJOR_VERSION)
ifeq ($(OS_ARCH), WINNT)
ifeq ($(OS_TARGET), WIN16)
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
LIBPRSTRMS = $(dist_libdir)/prstrms$(MOD_MAJOR_VERSION).lib
else
LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
ifeq ($(OS_TARGET), WIN95)
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
LIBPRSTRMS = $(dist_libdir)/prstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
else
LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
LIBPRSTRMS = $(dist_libdir)/libprstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
endif
endif
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO /S:32768
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
LIBPRSTRMS = $(dist_libdir)/prstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
else
LDOPTS += -Zomf -Zlinker /PM:VIO -lstdcpp
endif
endif
ifneq ($(OS_ARCH), WINNT)
PWD = $(shell pwd)
endif
ifeq ($(OS_ARCH), IRIX)
LDOPTS += -rpath $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH), OSF1)
LDOPTS += -rpath $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH), HP-UX)
LDOPTS += -Wl,+s,+b,$(PWD)/$(dist_libdir)
endif
# AIX
ifeq ($(OS_ARCH),AIX)
LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr
LIBPRSTRMS = -lprstrms$(MOD_MAJOR_VERSION)_shr
else
LDOPTS += -brtl
EXTRA_LIBS = -ldl
endif
endif
# Solaris
ifeq ($(OS_ARCH), SunOS)
ifneq ($(OS_RELEASE), 4.1.3_U1)
ifdef NS_USE_GCC
LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
else
LDOPTS += -R $(PWD)/$(dist_libdir)
# CC on SunOS 5.4 and 5.5.x need to link with -lthread or -lpthread
# (or use the -mt switch) even though we already linked with these
# system libraries when we built libnspr.so.
ifdef USE_PTHREADS
EXTRA_LIBS = -lpthread
else
EXTRA_LIBS = -lthread
endif # USE_PTHREADS
endif # NS_USE_GCC
endif # 4.1.3_U1
endif # SunOS
ifeq ($(OS_ARCH), NCR)
# XXX: We see some strange problems when we link with libnspr.so.
# So for now we use static libraries on NCR. The shared library
# stuff below is commented out.
LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
LIBPRSTRMS = $(dist_libdir)/libprstrms$(MOD_MAJOR_VERSION).a
EXTRA_LIBS = -lsocket -lnsl -ldl
# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
# implicitly by $(CC)) again even though we already linked with these
# system libraries when we built libnspr.so.
#EXTRA_LIBS = -lsocket -lnsl
# This hardcodes in the executable programs the directory to find
# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
# option for ld on other platforms.
#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH), SCOOS)
# SCO Unix needs to link against -lsocket again even though we
# already linked with these system libraries when we built libnspr.so.
EXTRA_LIBS = -lsocket
# This hardcodes in the executable programs the directory to find
# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
# option for ld on other platforms.
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH), UNIXWARE)
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
#####################################################
#
# The rules
#
#####################################################
include $(topsrcdir)/config/rules.mk
AIX_PRE_4_2 = 0
ifeq ($(OS_ARCH),AIX)
ifneq ($(OS_RELEASE),4.2)
ifneq ($(USE_PTHREADS), 1)
#AIX_PRE_4_2 = 1
endif
endif
endif
ifeq ($(AIX_PRE_4_2),1)
# AIX releases prior to 4.2 need a special two-step linking hack
# in order to both override the system select() and be able to
# get at the original system select().
#
# We use a pattern rule in ns/nspr20/config/rules.mk to generate
# the .$(OBJ_SUFFIX) file from the .c source file, then do the
# two-step linking hack below.
$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
rm -f $@ $(AIX_TMP)
$(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
$(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
rm -f $(AIX_TMP)
else
# All platforms that are not AIX pre-4.2.
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
ifeq ($(OS_ARCH), WINNT)
ifeq ($(OS_TARGET),WIN16)
echo system windows >w16link
echo option map >>w16link
echo option stack=10K >>w16link
echo option heapsize=32K >>w16link
echo debug $(DEBUGTYPE) all >>w16link
echo name $@ >>w16link
echo file >>w16link
echo $< >>w16link
echo library >>w16link
echo $(LIBPR), >>w16link
echo $(LIBPRSTRMS), >>w16link
echo winsock.lib >>w16link
wlink @w16link.
else
link $(LDOPTS) $< $(LIBPR) $(LIBPRSTRMS) wsock32.lib -out:$@
endif
else
ifeq ($(OS_ARCH),OS2)
$(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPR) $(LIBPRSTRMS) $(OS_LIBS) $(EXTRA_LIBS)
else
$(CCC) $(XCFLAGS) $< $(LDOPTS) $(LIBPR) $(LIBPRSTRMS) $(EXTRA_LIBS) -o $@
endif
endif
endif
export:: $(TARGETS)
clean::
rm -f $(TARGETS)
testlinker:
echo $(LINK)

View File

@@ -0,0 +1,204 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prinit.h"
#include "prstrms.h"
#include "prio.h"
#include <string.h>
#include <stdio.h>
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
#include <sys/types.h>
#include <sys/stat.h>
#endif
const unsigned int MaxCnt = 1;
void threadwork(void *mytag);
typedef struct threadarg {
void *mytag;
} threadarg;
void
#ifdef XP_OS2_VACPP
_Optlink
#endif
threadmain(void *mytag)
{
threadarg arg;
arg.mytag = mytag;
threadwork(&arg);
}
void
threadwork(void *_arg)
{
threadarg *arg = (threadarg *)_arg;
unsigned int i;
char fname1[256];
char fname2[256];
strcpy(fname1, (char *)arg->mytag);
strcpy(fname2, (char *)arg->mytag);
strcat(fname2, "2");
PR_Delete(fname1);
PR_Delete(fname2);
PRfilebuf *fb[MaxCnt];
PRifstream *ifs[MaxCnt];
PRofstream *ofs[MaxCnt];
int mode = 0;
#ifdef XP_UNIX
mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IRGRP|S_IWOTH|S_IROTH;
#endif
//
// Allocate a bunch
cout << "Testing unused filebufs ----------------" << endl;
for (i=0; i < MaxCnt; i++){
fb[i] = new PRfilebuf;
}
// Delete them
for (i=0; i < MaxCnt; i++){
delete fb[i];
}
cout << "Unused filebufs complete ---------------" << endl;
//
// Allocate a bunch
cout << "Testing unused ifstream -----------------" << endl;
for (i=0; i < MaxCnt; i++){
ifs[i] = new PRifstream;
}
//
// Delete them
for (i=0; i < MaxCnt; i++){
delete ifs[i];
}
cout << "Unused ifstream complete ----------------" << endl;
//
// Allocate a bunch
cout << "Testing unused ofstream -----------------" << endl;
for (i=0; i < MaxCnt; i++){
ofs[i] = new PRofstream;
}
for (i=0; i < MaxCnt; i++){
*(ofs[i]) << "A"; // Write a bit
delete ofs[i]; // Delete it.
}
cout << "Unused ofstream complete ----------------" << endl;
cout << "Testing use of ofstream 1 (extra filebuf allocated) ---------" << endl;
PRofstream *aos = new PRofstream(fname1, ios::out|ios::ate, mode);
for (i=0; i < MaxCnt; i++){
for (int j=0; j < 8192; j++)
*aos << "AaBbCcDdEeFfGg" << endl;
fb[i] = new PRfilebuf; // Allocate as we go to hack at the heap
}
//
// Delete the extra foo we allocated
for (i=0; i < MaxCnt; i++){
delete fb[i];
}
aos->flush(); // Explicit flush
delete aos;
cout << "Testing use of ofstream 1 complete (extra filebuf deleted) --" << endl;
cout << "Testing use of ofstream 2 (extra filebuf allocated) ---------" << endl;
PRofstream *aos2 = new PRofstream(fname2, ios::out, mode);
for (i=0; i < MaxCnt; i++){
*aos2 << "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";
}
// Force flushing in the dtor
delete aos2;
cout << "Testing use of ofstream 2 complete (extra filebuf deleted) --" << endl;
char line[1024];
cout << "Testing use of ifstream 1 (stack allocation) -------------" << endl;
PRifstream ais(fname1);
for (i=0; i < MaxCnt; i++){
ais >> line;
}
cout << "Testing use of ifstream 1 complete -----------------------" << endl;
cout << "Testing use of ifstream 2 ----------------------" << endl;
PRifstream *ais2 = new PRifstream(fname2);
char achar;
for (i=0; i < MaxCnt*10; i++){
*ais2 >> achar;
}
delete ais2;
cout << "Testing use of ifstream 2 complete -------------" << endl;
}
#define STACKSIZE 1024*1024
int
main(int argc, char **argv)
{
PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 256);
threadmain("TestFile");
PRThread *thr1 = PR_CreateThread(PR_SYSTEM_THREAD,
threadmain,
(void *)"TestFile1",
PR_PRIORITY_NORMAL,
PR_GLOBAL_THREAD,
PR_JOINABLE_THREAD,
STACKSIZE);
PRThread *thr2 = PR_CreateThread(PR_SYSTEM_THREAD,
threadmain,
(void *)"TestFile2",
PR_PRIORITY_NORMAL,
PR_GLOBAL_THREAD,
PR_JOINABLE_THREAD,
STACKSIZE);
PRThread *thr3 = PR_CreateThread(PR_SYSTEM_THREAD,
threadmain,
(void *)"TestFile3",
PR_PRIORITY_NORMAL,
PR_GLOBAL_THREAD,
PR_JOINABLE_THREAD,
STACKSIZE);
PR_JoinThread(thr1);
PR_JoinThread(thr2);
PR_JoinThread(thr3);
return 0;
}

View File

@@ -0,0 +1,259 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(MOD_DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
ifeq ($(OS_ARCH), WINNT)
# DIRS = windows
endif
ifeq ($(OS_TARGET), WIN16)
OS_CFLAGS = $(OS_EXE_CFLAGS)
endif
CSRCS = \
arena.c \
string.c \
base64t.c
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
CSRCS += arena.c
endif
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
PROG_SUFFIX = .exe
else
PROG_SUFFIX =
endif
PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
TARGETS = $(PROGS) $(OBJS)
INCLUDES = -I$(dist_includedir)
# Setting the variables LDOPTS and LIBPR. We first initialize
# them to the default values, then adjust them for some platforms.
LDOPTS = -L$(dist_libdir)
LIBPR = -lnspr$(MOD_MAJOR_VERSION)
LIBPLC = -lplc$(MOD_MAJOR_VERSION)
LIBPLDS = -lplds$(MOD_MAJOR_VERSION)
ifeq ($(OS_ARCH), WINNT)
ifeq ($(OS_TARGET), WIN16)
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
LIBPLC= $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).lib
else
LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
ifeq ($(OS_TARGET), WIN95)
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
LIBPLC= $(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
else
LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
LIBPLC= $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
LIBPLDS= $(dist_libdir)/libplds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
endif
endif
endif
ifeq ($(OS_ARCH),OS2)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO /S:32768
LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
LIBPLC = $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
else
LDOPTS += -Zomf -Zlinker /PM:VIO
endif
endif
ifneq ($(OS_ARCH), WINNT)
PWD = $(shell pwd)
endif
ifeq ($(OS_ARCH), IRIX)
LDOPTS += -rpath $(PWD)/$(dist_libdir)
endif
ifeq ($(OS_ARCH), Linux)
ifeq ($(OS_RELEASE), 1.2)
EXTRA_LIBS = -ldl
else
LDOPTS += -Xlinker -rpath $(PWD)/$(dist_libdir)
ifeq ($(USE_PTHREADS),1)
EXTRA_LIBS = -lpthread
endif
endif
endif
ifeq ($(OS_ARCH), OSF1)
LDOPTS += -rpath $(PWD)/$(dist_libdir) -lpthread
endif
ifeq ($(OS_ARCH), HP-UX)
LDOPTS += -Wl,+s,+b,$(PWD)/$(dist_libdir)
endif
# AIX
ifeq ($(OS_ARCH),AIX)
LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr
LIBPLC = -lplc$(MOD_MAJOR_VERSION)_shr
endif
# Solaris
ifeq ($(OS_ARCH), SunOS)
ifneq ($(OS_RELEASE), 4.1.3_U1)
ifdef NS_USE_GCC
LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
else
LDOPTS += -R $(PWD)/$(dist_libdir)
endif
endif
# SunOS 5.4 and 5.5 need to link with -lthread or -lpthread,
# even though we already linked with these system libraries
# when we built libnspr.so.
ifeq ($(OS_RELEASE), 5.4)
EXTRA_LIBS = -lthread
endif
ifeq ($(OS_RELEASE), 5.5)
ifdef USE_PTHREADS
EXTRA_LIBS = -lpthread
else
EXTRA_LIBS = -lthread
endif
endif
endif # SunOS
ifeq ($(OS_ARCH), NCR)
# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
# implicitly by $(CC)) again even though we already linked with these
# system libraries when we built libnspr.so.
EXTRA_LIBS = -lsocket -lnsl
# This hardcodes in the executable programs the directory to find
# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
# option for ld on other platforms.
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
endif
#####################################################
#
# The rules
#
#####################################################
include $(topsrcdir)/config/rules.mk
AIX_PRE_4_2 = 0
ifeq ($(OS_ARCH),AIX)
ifneq ($(OS_RELEASE),4.2)
ifneq ($(USE_PTHREADS), 1)
#AIX_PRE_4_2 = 1
endif
endif
endif
ifeq ($(AIX_PRE_4_2),1)
# AIX releases prior to 4.2 need a special two-step linking hack
# in order to both override the system select() and be able to
# get at the original system select().
#
# We use a pattern rule in ns/nspr20/config/rules.mk to generate
# the .$(OBJ_SUFFIX) file from the .c source file, then do the
# two-step linking hack below.
$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
rm -f $@ $(AIX_TMP)
$(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
$(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
rm -f $(AIX_TMP)
else
# All platforms that are not AIX pre-4.2.
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
ifeq ($(OS_ARCH), WINNT)
ifeq ($(OS_TARGET),WIN16)
echo system windows >w16link
echo option map >>w16link
echo option stack=10K >>w16link
echo option heapsize=32K >>w16link
echo debug $(DEBUGTYPE) all >>w16link
echo name $@ >>w16link
echo file >>w16link
echo $< >>w16link
echo library >>w16link
echo $(LIBPR), >>w16link
echo $(LIBPLC), >>w16link
echo winsock.lib >>w16link
wlink @w16link.
else
link $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) wsock32.lib -out:$@
endif
else
ifeq ($(OS_ARCH),OS2)
$(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
else
$(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
endif
endif
endif
export:: $(TARGETS)
clean::
rm -f $(TARGETS)

View File

@@ -0,0 +1,401 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
** File: arena.c
** Description: Testing arenas
**
*/
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include "nspr.h"
#include "plarena.h"
#include "plgetopt.h"
PRLogModuleInfo *tLM;
PRIntn threadCount = 0;
PRMonitor *tMon;
PRBool failed_already = PR_FALSE;
/* Arguments from the command line with default values */
PRIntn debug_mode = 0;
PRIntn poolMin = 4096;
PRIntn poolMax = (100 * 4096);
PRIntn arenaMin = 40;
PRIntn arenaMax = (100 * 40);
PRIntn stressIterations = 15;
PRIntn maxAlloc = (1024 * 1024);
PRIntn stressThreads = 4;
void DumpAll( void )
{
return;
}
/*
** Test Arena allocation.
*/
static void ArenaAllocate( void )
{
PLArenaPool ap;
void *ptr;
PRInt32 i;
PL_InitArenaPool( &ap, "AllocArena", 2048, sizeof(double));
PR_LOG( tLM, PR_LOG_DEBUG, ("AA, InitPool -- Pool: %p. first: %p, current: %p, size: %d",
&ap, ap.first, ap.current, ap.arenasize ));
for( i = 0; i < 150; i++ )
{
PL_ARENA_ALLOCATE( ptr, &ap, 512 );
PR_LOG( tLM, PR_LOG_DEBUG,("AA, after alloc -- Pool: %p. first: %p, current: %p, size: %d",
&ap, ap.first, ap.current, ap.arenasize ));
PR_LOG( tLM, PR_LOG_DEBUG,(
"AA -- Pool: %p. alloc: %p ", &ap, ptr ));
}
PL_FreeArenaPool( &ap );
for( i = 0; i < 221; i++ )
{
PL_ARENA_ALLOCATE( ptr, &ap, 512 );
PR_LOG( tLM, PR_LOG_DEBUG,("AA, after alloc -- Pool: %p. first: %p, current: %p, size: %d",
&ap, ap.first, ap.current, ap.arenasize ));
PR_LOG( tLM, PR_LOG_DEBUG,(
"AA -- Pool: %p. alloc: %p ", &ap, ptr ));
}
PL_FreeArenaPool( &ap );
return;
} /* end ArenaGrow() */
/*
** Test Arena grow.
*/
static void ArenaGrow( void )
{
PLArenaPool ap;
void *ptr;
PRInt32 i;
PL_InitArenaPool( &ap, "TheArena", 4096, sizeof(double));
PL_ARENA_ALLOCATE( ptr, &ap, 512 );
PR_LOG( tLM, PR_LOG_DEBUG, ("Before growth -- Pool: %p. alloc: %p ", &ap, ptr ));
for( i = 0; i < 10; i++ )
{
PL_ARENA_GROW( ptr, &ap, 512, 7000 );
PR_LOG( tLM, PR_LOG_DEBUG, ("After growth -- Pool: %p. alloc: %p ", &ap, ptr ));
}
return;
} /* end ArenaGrow() */
/*
** Test arena Mark and Release.
*/
static void MarkAndRelease( void )
{
PLArenaPool ap;
void *ptr = NULL;
void *mark0, *mark1;
PRIntn i;
PL_InitArenaPool( &ap, "TheArena", 4096, sizeof(double));
mark0 = PL_ARENA_MARK( &ap );
PR_LOG( tLM, PR_LOG_DEBUG,
("mark0. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p, m0: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr, mark0 ));
for( i = 0; i < 201; i++ )
{
PL_ARENA_ALLOCATE( ptr, &ap, 512 );
PR_LOG( tLM, PR_LOG_DEBUG,
("mr. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr ));
}
mark1 = PL_ARENA_MARK( &ap );
PR_LOG( tLM, PR_LOG_DEBUG,
("mark1. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p, m1: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr, mark1 ));
for( i = 0; i < 225; i++ )
{
PL_ARENA_ALLOCATE( ptr, &ap, 512 );
PR_LOG( tLM, PR_LOG_DEBUG,
("mr. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr ));
}
PL_ARENA_RELEASE( &ap, mark1 );
PR_LOG( tLM, PR_LOG_DEBUG,
("Release-1: %p -- Pool: %p. first: %p, current: %p, size: %d",
mark1, &ap, ap.first, ap.current, ap.arenasize ));
for( i = 0; i < 20; i++ )
{
PL_ARENA_ALLOCATE( ptr, &ap, 512 );
PR_LOG( tLM, PR_LOG_DEBUG,
("mr. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr ));
}
PL_ARENA_RELEASE( &ap, mark1 );
PR_LOG( tLM, PR_LOG_DEBUG,
("Release-1. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr ));
PL_ARENA_RELEASE( &ap, mark0 );
PR_LOG( tLM, PR_LOG_DEBUG,
("Release-0. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr ));
PL_FreeArenaPool( &ap );
PR_LOG( tLM, PR_LOG_DEBUG,
("Free. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr ));
PL_FinishArenaPool( &ap );
PR_LOG( tLM, PR_LOG_DEBUG,
("Finish. ap: %p, ap.f: %p, ap.c: %p, ap.siz: %d, alloc: %p",
&ap, ap.first.next, ap.current, ap.arenasize, ptr ));
return;
} /* end MarkAndRelease() */
/*
** RandSize() returns a random number in the range
** min..max, rounded to the next doubleword
**
*/
static PRIntn RandSize( PRIntn min, PRIntn max )
{
PRIntn sz = (rand() % (max -min)) + min + sizeof(double);
sz &= ~sizeof(double)-1;
return(sz);
}
/*
** StressThread()
** A bunch of these beat on individual arenas
** This tests the free_list protection.
**
*/
static void PR_CALLBACK StressThread( void *arg )
{
PLArenaPool ap;
PRIntn i;
PRIntn sz;
void *ptr;
PRThread *tp = PR_GetCurrentThread();
PR_LOG( tLM, PR_LOG_DEBUG, ("Stress Thread %p started\n", PR_GetCurrentThread()));
PL_InitArenaPool( &ap, "TheArena", RandSize( poolMin, poolMax), sizeof(double));
for ( i = 0; i < stressIterations; i++ )
{
PRIntn allocated = 0;
while ( allocated < maxAlloc )
{
sz = RandSize( arenaMin, arenaMax );
PL_ARENA_ALLOCATE( ptr, &ap, sz );
if ( ptr == NULL )
{
PR_LOG( tLM, PR_LOG_ERROR, ("ARENA_ALLOCATE() returned NULL\n\tAllocated: %d\n", allocated));
break;
}
allocated += sz;
}
PR_LOG( tLM, PR_LOG_DEBUG, ("Stress thread %p finished one iteration\n", tp));
PL_FreeArenaPool( &ap );
}
PR_LOG( tLM, PR_LOG_DEBUG, ("Stress thread %p finished all iteration\n", tp));
PL_FinishArenaPool( &ap );
PR_LOG( tLM, PR_LOG_DEBUG, ("Stress thread %p after FinishArenaPool()\n", tp));
/* That's all folks! let's quit */
PR_EnterMonitor(tMon);
threadCount--;
PR_Notify(tMon);
PR_ExitMonitor(tMon);
return;
}
/*
** Stress()
** Flog the hell out of arenas multi-threaded.
** Do NOT pass an individual arena to another thread.
**
*/
static void Stress( void )
{
PRThread *tt;
PRIntn i;
tMon = PR_NewMonitor();
for ( i = 0 ; i < stressThreads ; i++ )
{
PR_EnterMonitor(tMon);
tt = PR_CreateThread(PR_USER_THREAD,
StressThread,
NULL,
PR_PRIORITY_NORMAL,
PR_GLOBAL_THREAD,
PR_UNJOINABLE_THREAD,
0);
threadCount++;
PR_ExitMonitor(tMon);
}
/* Wait for all threads to exit */
PR_EnterMonitor(tMon);
while ( threadCount != 0 )
{
PR_Wait(tMon, PR_INTERVAL_NO_TIMEOUT);
}
PR_ExitMonitor(tMon);
PR_DestroyMonitor(tMon);
return;
} /* end Stress() */
/*
** EvaluateResults()
** uses failed_already to display results and set program
** exit code.
*/
static PRIntn EvaluateResults(void)
{
PRIntn rc = 0;
if ( failed_already == PR_TRUE )
{
PR_LOG( tLM, PR_LOG_DEBUG, ("FAIL\n"));
rc =1;
}
else
{
PR_LOG( tLM, PR_LOG_DEBUG, ("PASS\n"));
}
return(rc);
} /* EvaluateResults() */
void Help( void )
{
printf("arena [options]\n");
printf("where options are:\n");
printf("-p <n> minimum size of an arena pool. Default(%d)\n", poolMin);
printf("-P <n> maximum size of an arena pool. Default(%d)\n", poolMax);
printf("-a <n> minimum size of an arena allocation. Default(%d)\n", arenaMin);
printf("-A <n> maximum size of an arena allocation. Default(%d)\n", arenaMax);
printf("-i <n> number of iterations in a stress thread. Default(%d)\n", stressIterations);
printf("-s <n> maximum allocation for a single stress thread. Default(%d)\n", maxAlloc);
printf("-t <n> number of stress threads. Default(%d)\n", stressThreads );
printf("-d enable debug mode\n");
printf("\n");
exit(1);
}
PRIntn main(PRIntn argc, char *argv[])
{
PLOptStatus os;
PLOptState *opt = PL_CreateOptState(argc, argv, "dhp:P:a:A:i:s:t:");
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
{
if (PL_OPT_BAD == os) continue;
switch (opt->option)
{
case 'a': /* arena Min size */
arenaMin = atol( opt->value );
break;
case 'A': /* arena Max size */
arenaMax = atol( opt->value );
break;
case 'p': /* pool Min size */
poolMin = atol( opt->value );
break;
case 'P': /* pool Max size */
poolMax = atol( opt->value );
break;
case 'i': /* Iterations in stress tests */
stressIterations = atol( opt->value );
break;
case 's': /* storage to get per iteration */
maxAlloc = atol( opt->value );
break;
case 't': /* Number of stress threads to create */
stressThreads = atol( opt->value );
break;
case 'd': /* debug mode */
debug_mode = 1;
break;
case 'h': /* help */
default:
Help();
} /* end switch() */
} /* end while() */
PL_DestroyOptState(opt);
srand( (unsigned)time( NULL ) ); /* seed random number generator */
tLM = PR_NewLogModule("testcase");
#if 0
ArenaAllocate();
ArenaGrow();
#endif
MarkAndRelease();
Stress();
return(EvaluateResults());
} /* end main() */
/* arena.c */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,86 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#! gmake
MOD_DEPTH = ../../..
include $(MOD_DEPTH)/config/config.mk
INCLUDES = -I$(DIST)/include
CSRCS = winevent.c
ifeq ($(OS_ARCH), WINNT)
ifeq ($(OS_TARGET), WIN16)
LIBPR = $(DIST)/lib/nspr$(MOD_VERSION).lib
LIBPLC= $(DIST)/lib/plc$(MOD_VERSION).lib
LIBPLDS= $(DIST)/lib/plds$(MOD_VERSION).lib
else
LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
ifeq ($(OS_TARGET), WIN95)
LIBPR = $(DIST)/lib/nspr$(MOD_VERSION).$(LIB_SUFFIX)
LIBPLC= $(DIST)/lib/plc$(MOD_VERSION).$(LIB_SUFFIX)
LIBPLDS= $(DIST)/lib/plds$(MOD_VERSION).lib
else
LIBPR = $(DIST)/lib/libnspr$(MOD_VERSION).$(LIB_SUFFIX)
LIBPLC= $(DIST)/lib/libplc$(MOD_VERSION).$(LIB_SUFFIX)
LIBPLDS= $(DIST)/lib/libplds$(MOD_VERSION).lib
endif
endif
endif
TARGETS = $(OBJDIR)/winevent.exe
OS_CFLAGS = $(OS_EXE_CFLAGS)
LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
LDFLAGS += -DEBUG
LIBPR += $(LIBPLDS)
LIBPR += kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
include $(MOD_DEPTH)/config/rules.mk
$(OBJDIR)/winevent.exe: $(OBJS)
link $(LDOPTS) $< $(LIBPLC) $(LIBPR) wsock32.lib -out:$@
export:: $(TARGETS)
install:: export
clean::
rm -rf $(TARGETS)

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