Compare commits

..

442 Commits

Author SHA1 Message Date
julien.pierre.bugs%sun.com
9deaa18dbb Unbreak build on AIX. Not sure why this builds on any other platform.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@203548 18797224-902f-48f8-a5cc-f745e15eee43
2006-07-24 20:51:33 +00:00
richard.freedman%sun.com
871470d6c7 Command modification necessary for Windows seems harmless for non-Windows, so
let's make it universal.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@201358 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-30 16:06:57 +00:00
richard.freedman%sun.com
4f3f9c5f91 This checkin creates a new file pkix_errorstrings.h containing the text
of all error messages. A macro definition in pkixt.h defines an error
number for each, and a different definition in pkix_error.c creates
the corresponding text strings. References to error strings throughout
libpkix have been replaced by the error numbers, with corresponding
changes to macros such as PKIX_CHECK and PKIX_ERROR.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@201303 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-29 22:21:34 +00:00
richard.freedman%sun.com
75d55643fa Remove an erroneous requirement for an argument to be non-NULL.
The user-supplied verify function does not require that the caller
provide an address for a verifyTree.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@201136 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-28 20:50:53 +00:00
richard.freedman%sun.com
f91401b3dc This file was accidentally omitted in previous checkin, to implement
non-blocking I/O in libpkix OCSP checking


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@201030 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-27 20:42:49 +00:00
richard.freedman%sun.com
59c46ed04a Implement nonblocking I/O for libpkix OCSP handler
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@201024 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-27 20:13:32 +00:00
richard.freedman%sun.com
bde9221988 pkix_DefaultRevChecker_Check calling sequence had to be modified, too, to
conform with the changes to revChecker_Check API


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@201000 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-27 15:11:19 +00:00
richard.freedman%sun.com
9e3af63767 Pass in user's procParams to ocspChecker for use in calling buildChain
to validate OCSP signer


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200965 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-26 22:25:40 +00:00
richard.freedman%sun.com
abe5bd6cf1 Remove some obsolete debugging code which, among other things, referenced
a subroutine which no longer exists (thereby clobbering the build).


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200681 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-23 15:26:09 +00:00
richard.freedman%sun.com
5d59d3442d Add a declaration pf PKIX_PL_Pk11CertStore_Create to the header file, so
that users are not required to include pkix_samples.h


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200604 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-22 18:04:35 +00:00
richard.freedman%sun.com
7c31c82596 Eliminate unreferenced "checkin" labels and add parentheses in a few
hash calculations, to reduce warning messages from some of the more
discriminating compilers.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200602 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-22 17:18:34 +00:00
richard.freedman%sun.com
c350994614 Fix a comment that referred to the wrong piece in describing a set of changes
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200589 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-22 15:42:42 +00:00
richard.freedman%sun.com
7f9582dfc3 Isolate the CERT_VerifyCert call in OCSP processing, and allow the user
to provide an alternate function (via PKIX_OcspChecker_SetVerifyFcn).


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200588 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-22 15:40:11 +00:00
richard.freedman%sun.com
6de4ed8539 Modify OCSP handling to isolate, and replace if a user-supplied alternative
is given, the legacy-code call to CERT_VerifyCert. Preserve Error information
to be available to the user.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200357 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-19 21:57:26 +00:00
richard.freedman%sun.com
e62957c7a0 Fix a leak by deallocating the receive buffer when the httpdefaultclient
is destroyed


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200355 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-19 21:50:45 +00:00
richard.freedman%sun.com
5c1f73d22c Add a descriptive narrative to the function header for
pkix_DefaultChecker_Create


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@200354 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-19 21:48:42 +00:00
richard.freedman%sun.com
4577ddf524 Add verifyNodes to test_buildchain. It calls for an additional argument
to PKIX_Build, so calling sequences in other test_buildchain variants
had to be modified as well (taking a NULL argument, for now).


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@199748 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-12 20:24:13 +00:00
richard.freedman%sun.com
760efc6195 Convert logging to use PKIX_ERRORNUM, PKIX_ERRORNAMES
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@199746 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-12 20:07:10 +00:00
richard.freedman%sun.com
6a976c334a Add tests for new type VerifyNode, used in logging
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198580 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-29 17:42:35 +00:00
richard.freedman%sun.com
d206948d8f ../../../../checkinmsg
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198489 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-26 21:37:08 +00:00
richard.freedman%sun.com
b0d332335d Provide logging functionality to PKIX_ValidateChain and its variants.
Define a new object type PKIX_VerifyNode, and build a tree of
VerifyNodes (optionally) during chain validation. Add this logging
capability to all existing pkix tests that use ValidateChain.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198487 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-26 20:43:09 +00:00
richard.freedman%sun.com
2e50cc10f5 checkinmsg
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198486 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-26 20:24:29 +00:00
richard.freedman%sun.com
f287e6e00b checkinmsg
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198481 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-26 19:51:51 +00:00
richard.freedman%sun.com
6ff4d5299e Reduce the opportunity for human error by defining type numbers automatically,
via a macro, the same way that error numbers are defined.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198476 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-26 18:53:20 +00:00
richard.freedman%sun.com
0f21607311 Eliminate redundant initialization of pkixTempErrorReceived in PKIX_STD_VARS
macro.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198268 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-23 16:51:30 +00:00
richard.freedman%sun.com
6e45f035e5 Eliminate function that returned address of PKIX_ERRORNAMES.
Instead declare it as DATA to make it work in WIN32.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198028 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-19 19:48:23 +00:00
richard.freedman%sun.com
41828a32a7 Declare PKIX_ERRORNAMES external in a manner that works on WIN32 also
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198026 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-19 19:41:20 +00:00
richard.freedman%sun.com
0cb41d14fa Replace function that exports array address with appropriate declarations
that do the same, even on Windows platforms.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198020 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-19 18:39:15 +00:00
richard.freedman%sun.com
7fbf7ac11f Keep PKIX_Error_GetErrorString in all versions, not just for WIN32. Other
versions complain of undefined symbol because of its presence in nss.def.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@198004 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-19 15:21:39 +00:00
richard.freedman%sun.com
6f2f019571 Provide WIN32 function to return the address of PKIX_ERRORNAMES array,
since we are unable to reference it directly from the test directory.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@197961 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-18 21:46:34 +00:00
richard.freedman%sun.com
042eecb19a Extra tab somehow got in after an end-of-line backslash. Removed it.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@197943 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-18 19:36:56 +00:00
richard.freedman%sun.com
eb0f612949 Use PKIXERRORNUM, rather thana String, to indicate module to be logged (in
Logger calls). Thus typos will be caught at compile time rather than during
execution.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@197937 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-18 19:10:14 +00:00
richard.freedman%sun.com
0120670b74 Add building of ocspchecker test
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@197936 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-18 19:07:20 +00:00
richard.freedman%sun.com
8df38480b1 Add new ocsp and httpcertstore tests to the scripts that compile
the tests.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@197934 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-18 18:53:20 +00:00
richard.freedman%sun.com
aa1925c4e4 Use a macro to replace separate lists of errors in pkixt.h, pkix_error.c, and
pkix_logger.c, to avoid the hazards of depending on synchronization by
human effort. This macro is invoked to define error numbers in pkixt.h,
and is redefined in pkix_error.c to initialize a corresponding array of
strings. Pkix_logger.c now uses the same array, rather than its own
slightly different one.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@197866 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-17 17:02:52 +00:00
richard.freedman%sun.com
2871474425 Eliminate declaration of unreferenced variable
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196535 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-15 17:11:08 +00:00
richard.freedman%sun.com
e54e544ff7 Define length of sec_PKCS7ContentInfoTemplate in forward declaration
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196425 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 22:36:03 +00:00
richard.freedman%sun.com
de616c4641 Restore global status to function pkix_RevCheckCert erroneously declared static
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196414 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 20:45:58 +00:00
richard.freedman%sun.com
bd1bc670c7 Add "static" to forward declaration of template so that later
initialization of template does not get compiler upset.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196405 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 19:41:09 +00:00
richard.freedman%sun.com
ffaa234883 Add extra braces around each of the two components of pkix_Alloc_Error_Data
to eliminate compiler warnings


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196404 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 19:37:51 +00:00
richard.freedman%sun.com
334cf8ed48 Eliminate unreferenced labels
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196403 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 19:32:30 +00:00
richard.freedman%sun.com
befc90def6 Eliminate declaration of unused variables or labels
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196402 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 19:26:54 +00:00
richard.freedman%sun.com
3204711503 Eliminate declaration of unused variables
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196401 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 19:24:01 +00:00
richard.freedman%sun.com
e9b3e2a42d Eliminate declarations of unused variables
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196400 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 19:20:36 +00:00
richard.freedman%sun.com
adb0b454a0 Eliminate declaration of unused variable
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196399 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-12 19:01:14 +00:00
richard.freedman%sun.com
0dd2f5138c Remove extraneous (and nonportable) absolute path designation from a
"copy cert" command. Add a test (if PDVAL is defined) for buildchai
using HTTP AIAs.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196343 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-11 21:04:26 +00:00
richard.freedman%sun.com
808d71ba8c Replace \n in output with outputting a blank line before or after the string
which had contained the \n. Echo doesn't handle \n right on all systems.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196330 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-11 19:28:14 +00:00
richard.freedman%sun.com
b8afad2191 Include decoding of signedData messages returned by Http servers.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196273 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-10 20:44:45 +00:00
richard.freedman%sun.com
92cc685d84 Comment out reference to CERT_DecodeCertPackage until library issue is resolved
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196227 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-09 15:35:51 +00:00
richard.freedman%sun.com
7d938d7e1d Reflect the change of name of PKIX_PL_LdapCertStore_AbandonRequest to
PKIX_PL_LdapDefaultClient_AbandonRequest


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196159 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-08 15:01:16 +00:00
richard.freedman%sun.com
60de4a3e75 Addition of httpcertstore (and http retrieval of AIA information)
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196052 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-05 21:38:45 +00:00
richard.freedman%sun.com
da1c3ae851 Add new certs for OCSP testing; they contain extensions that certutil is not
yet able to create.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@196050 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-05 21:25:08 +00:00
richard.freedman%sun.com
d3245f6815 Prepare for addition of tests whose execution depends on whether OCSP is
defined in the environment. Also change a few more \n's to new lines,
because not all shells handled them properly in Display lines


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@195302 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-24 21:56:50 +00:00
richard.freedman%sun.com
8f98179174 Add one additional argument to the NULLCHECK list in Socket_CreateByNameAndPort
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@195301 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-24 21:47:53 +00:00
richard.freedman%sun.com
88bf242fa0 Rename LDAPCertStore_DecodeCert, Crl functions to ASN1CertStore_Decode...
to reflect their use in any ASN1-using certStore, such as the HttpCertStore


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@195300 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-24 21:42:31 +00:00
richard.freedman%sun.com
4424125dd5 Catch and re-throw a certStore error, to make it easier to figure out error
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@195299 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-24 21:34:59 +00:00
richard.freedman%sun.com
2b6f0a9f1d Eliminate an extra semicolon at the end of a line
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@195296 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-24 21:20:39 +00:00
richard.freedman%sun.com
870a8d5b60 Separate platform paths from relative paths on command lines for libpkix tests,
to eliminate lines too long in html test output.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@194527 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-17 20:26:09 +00:00
richard.freedman%sun.com
62ef7dedef Eliminate unused command-line argument, both in obtaining the value in main
and invoking the program in runPLTests.sh


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@194518 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-17 18:14:23 +00:00
richard.freedman%sun.com
713381ac4f If directories are not created because NIST_FILES_DIR is not defined,
skip the attempt to copy crls into those directories.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@194414 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-14 16:30:13 +00:00
richard.freedman%sun.com
0d048ba364 Eliminate unused variables. Initialize an enum to first value of enumeration,
rather than to NULL. Change tabs to spaces.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@194223 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-12 16:24:38 +00:00
richard.freedman%sun.com
a70ca80191 Eliminate ${curdir} from command lines, to reduce the length
of html output. Let the commands use relative paths.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@194159 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-11 18:54:36 +00:00
richard.freedman%sun.com
fcc076afc7 Send http headers and request in the same buffer, rather than as
two separate writes.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@194051 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-10 22:01:04 +00:00
richard.freedman%sun.com
838035b20b There were *two* instances of sprintf needing to be replaced with
PR_snprintf, not just one.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193841 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-07 21:34:23 +00:00
richard.freedman%sun.com
16f10c4455 Replace sprintf call with safer PR_snprintf
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193816 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-07 16:04:29 +00:00
richard.freedman%sun.com
81f7f30ee5 Update logger callback function to use PR_snprintf (and give it a bigger
buffer) rather than sprintf, which overflowed for a long message.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193750 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-06 22:18:29 +00:00
richard.freedman%sun.com
37e35ee355 Run tests with and without socketTracing and logging
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193733 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-06 20:18:50 +00:00
richard.freedman%sun.com
fda21575ab Once again include all output in log
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193731 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-06 20:14:51 +00:00
richard.freedman%sun.com
3d3eb884e0 Reduce the number of logging calls, to keep output reasonable.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193730 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-06 20:13:34 +00:00
richard.freedman%sun.com
426487ad4b Don't return results until the complete exchange (include responseStatus)
is completed.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193729 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-06 20:12:24 +00:00
richard.freedman%sun.com
087c2def5f Debugging code referred to wrong string
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193534 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-04 18:49:11 +00:00
richard.freedman%sun.com
7787046641 Failure occurs if SOCKETTRACE and LOGGING are both off, but not if either
one is on. It clearly is a timing issue, probably dealing with the CONNECT.
Logging has been throttled way back. This may provide further clues.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193228 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-29 23:29:02 +00:00
richard.freedman%sun.com
f396bb7cfd Run more tests with logging and tracing, until reason for failures is found.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193217 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-29 22:05:45 +00:00
richard.freedman%sun.com
610a102760 Some shell variables were not enclosed in braces. This may have been the
cause of some incorrect calculations.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193216 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-29 22:04:34 +00:00
richard.freedman%sun.com
47e5524d0e Use a shortened form of output for the HTML lines. With tracing on, use
shortened output in output log as well, for non-error lines.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193215 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-29 22:03:17 +00:00
richard.freedman%sun.com
998bcb2629 Use an extra line to echo a blank line; echo does not interpret backslash-n
properly on all platforms. Some shell variables were not enclosed in braces.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193214 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-29 22:01:07 +00:00
richard.freedman%sun.com
1502db5a20 Use an extra line to echo a blank line; echo does not interpret backslash-n
properly on all platforms.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193213 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-29 21:59:37 +00:00
richard.freedman%sun.com
f888317086 Message ID length was double-counted, in advancing to end of bytes processed.
Count properly, to be able to handle remainder of buffer after first message. (Problem
occurred on x86 platforms, where endian issues confused message ID length.)


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193138 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-28 17:40:05 +00:00
richard.freedman%sun.com
f39949b4a0 Socket tracing should not be compiled into the OPT build, unless explicitly called for
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193137 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-28 17:36:30 +00:00
richard.freedman%sun.com
0195a11840 Fix calculations; output more detail information for pkix tests
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193085 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-27 23:46:52 +00:00
richard.freedman%sun.com
dc63276999 Add LdapDefaultClient to loggers
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@193060 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-27 19:39:26 +00:00
richard.freedman%sun.com
9d2bf66ca7 Elevate CertStore logging to trace level (from error level) to figure out what's going on
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192947 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-24 21:16:05 +00:00
richard.freedman%sun.com
b967209e2d Include detailed pkix test results in html output
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192934 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-24 19:44:20 +00:00
richard.freedman%sun.com
7146c6b52d Fix error in testing prior output for error value
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192884 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-23 23:44:20 +00:00
richard.freedman%sun.com
d7bdb660c9 Add subtest breakdown to html output
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192883 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-23 23:35:38 +00:00
richard.freedman%sun.com
f60574f691 Enable CertChainChecker logging, reduce Validate logging from trace level to error level
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192871 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-23 21:58:56 +00:00
richard.freedman%sun.com
0731e6fa64 Improve handling of disabling, enabling, during changes to lists. Make sure
enabling DEBUG-level errors also prints more serious errors.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192870 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-23 21:42:43 +00:00
richard.freedman%sun.com
2e5d52d34a In PKIX_CheckCert, catch and re-throw errors to make sure they get logged.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192787 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-22 17:29:35 +00:00
richard.freedman%sun.com
1e6e573ef5 Removed too much processing -- errors were going unrecognized. Error recognition
was restored.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192780 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-22 15:55:05 +00:00
richard.freedman%sun.com
a09965d583 Output more libpkix output to log file. Enable socket tracing for the tests
that have been failing.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192733 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-21 22:05:39 +00:00
richard.freedman%sun.com
55c5565bd2 Enable socket tracing (subject to environment variable SOCKETTRACE
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192724 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-21 20:50:14 +00:00
richard.freedman%sun.com
0bedc8b00c Make a subroutine to handle establishing a logger. Add more loggers.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192704 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-21 17:17:28 +00:00
richard.freedman%sun.com
0d7d12fbfb Add instrumentation for additional sources of error.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192637 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-20 17:25:54 +00:00
richard.freedman%sun.com
e09e794e04 Use logging to better instrument failure of tests
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192546 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-17 17:36:24 +00:00
richard.freedman%sun.com
4bac532eea Enable logging to diagnose failures in test_validatechain_NB
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192503 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-16 22:48:19 +00:00
richard.freedman%sun.com
fbbf7445b2 Add omitted states to Destroy function, to prevent errors during error
cleanup


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192446 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-15 21:09:57 +00:00
richard.freedman%sun.com
32bc137aec Fix bug 330354 - Return "no certs found" if unable to properly encode
a request


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192431 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-15 18:43:15 +00:00
richard.freedman%sun.com
4e5bdc39b2 Remove an unused argument from the calling sequence for
pkix_pl_LdapCertstore_ConvertCertResponses, and add documentation


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192430 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-15 18:39:01 +00:00
richard.freedman%sun.com
c449390971 Fix a misspelling and improve the language in a description of using
certStoreContext


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192428 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-15 18:29:20 +00:00
richard.freedman%sun.com
b93f9fd4a9 Add debugging information to better track mysterious error
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192419 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-15 16:39:36 +00:00
richard.freedman%sun.com
c934906f8c Initialize client->socket to NULL so that cleanup after an error does
not try to release an uninitialized pointer.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192370 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-14 23:00:21 +00:00
richard.freedman%sun.com
9f3d748290 Fix a couple of comments that went beyond eighty characters.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192368 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-14 22:58:36 +00:00
richard.freedman%sun.com
548848bc1a Add PKIX_OcspChecker_Create foir revocation checking
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192313 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-14 16:47:25 +00:00
richard.freedman%sun.com
0088d46894 Fixes to OCSP revocation checking
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192312 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-14 16:45:11 +00:00
richard.freedman%sun.com
c5a6f29769 Fixed a typo in a debug error message string
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192310 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-14 15:58:15 +00:00
richard.freedman%sun.com
33dbc5d9dd Use LdapCertStore_CreateByName to incorporate latest version of hostname handling
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192287 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-13 23:02:01 +00:00
richard.freedman%sun.com
775b6d720e export LDAP definition so test_validatechain_NB can find it
Use "-" for NIST 4.3.7, until LDAPCertStore can handle it without hanging


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192273 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-13 17:44:36 +00:00
richard.freedman%sun.com
8ff2ee5c59 Add definition of LDAP (hostname:portnum) for test_validate_NB
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192181 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-10 22:53:46 +00:00
richard.freedman%sun.com
e23c4c37d6 Test for environment variable LDAP. Complain if it is not set, or if we
are unable to connect to it. If we can connect, then proceed with test.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192068 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-09 17:30:18 +00:00
richard.freedman%sun.com
657949b2b4 Put socket tracing under control of a flag, settable by the debugger or
by an environment variable SOCKETTRACE (as well as the conditional
compilation) so that tracing can be turned on and off more easily during
debugging.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@192005 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-08 21:24:05 +00:00
richard.freedman%sun.com
762310a4a9 Remove do...while wrapper around macro definition. Also remove incorrect
comment and a redundant forward declaration.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191997 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-08 19:58:30 +00:00
richard.freedman%sun.com
a1b29dbc32 Eliminate some memory leaks when LdapResponses are freed
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191945 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-08 00:04:59 +00:00
richard.freedman%sun.com
7ccc132349 Add validatechain_NB test to top/runTests.sh
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191944 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-08 00:03:47 +00:00
richard.freedman%sun.com
95407107a9 Implement nonblocking chain validation
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191943 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-08 00:02:23 +00:00
richard.freedman%sun.com
c94f03849e Rename PKIX_CertStore_CrlContinueFunction for use in nonblocking chain
validation.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191942 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-08 00:01:12 +00:00
richard.freedman%sun.com
535be3cf8a Eliminate obsolete conditional code statements ("#if 1" and "#endif")
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191939 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-07 23:44:36 +00:00
richard.freedman%sun.com
e1eb696d03 Removed obsolete #if 0 code and a leftover #include <stdio.h>
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191902 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-07 18:22:44 +00:00
richard.freedman%sun.com
a894624019 cvs: ----------------------------------------------------------------------
pkix_pl_socket.c:
Return zero for bytesRead and bytesWritten on a WOULDBLOCK return
test_socket.c:
Test for completion with >0 bytes transferred, rather than >= 0
Use stack variables rather than globals for bytesRead, bytesWritten
Replace tabs with spaces


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191443 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-28 23:16:17 +00:00
alexei.volkov.bugs%sun.com
60f4bb61ac 53229: certutil should not use gets()
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191233 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-25 02:55:08 +00:00
julien.pierre.bugs%sun.com
0b9b5cc038 Fix for assertion in PR_ConnectContinue.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191009 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-23 06:34:33 +00:00
julien.pierre.bugs%sun.com
3cab4e8a2f Prevent infinite loop in error cases for test_socket on the client side.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@191005 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-23 05:30:30 +00:00
richard.freedman%sun.com
bb81109436 Fix a rule violation in the use of a macro: called after cleanup
when, if error, it goes to cleanup.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190713 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-21 18:20:12 +00:00
richard.freedman%sun.com
5163e15723 Fix a typo in a comment
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190712 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-21 18:18:45 +00:00
richard.freedman%sun.com
2441d44e79 Fix a memory leak: revCheckers was not being decref'ed.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190711 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-21 18:17:39 +00:00
richard.freedman%sun.com
ef1c4e3526 Eliminate the type BuildParams, which was a wrapper for ProcessingParams
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190613 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-20 22:51:25 +00:00
richard.freedman%sun.com
09c3aa018b Deleted an accidentally-retained referenced to pkix_certchain.h
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190598 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-20 19:04:18 +00:00
richard.freedman%sun.com
35c995526c Eliminate CertChain as a separate PKIX object type. It served only as a
wrapper for a PKIX_List.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190587 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-20 18:40:26 +00:00
richard.freedman%sun.com
087d5d9846 Eliminate CertChain as a separate PKIX object type. It served only as a
wrapper for a PKIX_List.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190585 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-20 18:27:57 +00:00
richard.freedman%sun.com
97261c4ce2 Add test_buildchain_partialchain to pkix/top tests
Add hintCerts (List of Certs) to PKIX_ProcessingParams
Add PKIX_ProcessingParams_[Get,Set]HintCerts to pkix_params.h and nss.def
Use hintCerts, if provided, in chain building


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190548 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-19 19:58:10 +00:00
richard.freedman%sun.com
af23e2cc3e Cosmetic: fix an indentation error
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190547 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-19 19:46:57 +00:00
richard.freedman%sun.com
b16209a3bc Remove the do...while framing around the macro definition of PKIX_TEST_RETURN
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@190303 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-16 21:41:37 +00:00
richard.freedman%sun.com
7ed146f21c Create new object PKIX_PL_HttpDefaultClient
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@189512 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-09 21:04:46 +00:00
richard.freedman%sun.com
d4d1ca5ad9 A fix a typo in an error string
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@189510 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-09 21:02:02 +00:00
richard.freedman%sun.com
893662c22b Add new CreateByHostAndPort function, for use of HttpDefaultClient
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@189499 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-09 19:57:32 +00:00
richard.freedman%sun.com
0a8ac494fe Use CERT_GetDefaultCertDB() for dbhandle and PR_Now() for time in call to
CERT_GetOCSPStatusForCertID


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@188851 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-03 15:42:33 +00:00
richard.freedman%sun.com
e50bc3670f Provide default DBHandle in verifying OCSP Response signature
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@188753 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-02 15:48:04 +00:00
julien.pierre.bugs%sun.com
f40090776d Remove unnecessary comment to fix broken builds on AIX and RHEL3
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@188722 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-02 00:39:52 +00:00
richard.freedman%sun.com
62d0360053 Accidental C++ style comment (//) changed to /* ... */
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@188669 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-01 16:47:05 +00:00
richard.freedman%sun.com
2700061b71 Fix coding errors in handling http response.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@188630 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-01 00:13:12 +00:00
richard.freedman%sun.com
fda21acf09 Eliminate duplicate declaration of SEC_RegisterDefaultHttpClient
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@188578 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-31 17:49:06 +00:00
richard.freedman%sun.com
0b79a9b5cb Make pkix_RevCheckCert public to allow testing of OCSP interface, with temporary
call from PKIX_PL_OcspCheckCert in pkix_pl_cert.c


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@188492 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-30 20:56:15 +00:00
richard.freedman%sun.com
eb30825857 Implement a revocation checker - pkix_ocspchecker.c and subordinate objects
ocsprequest and ocspresponse.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@188461 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-30 16:53:50 +00:00
richard.freedman%sun.com
1a0f7c1b54 Turn on buffer tracing for sockets, temporarily, to debug problem on LEIA.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@187951 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-21 02:48:33 +00:00
richard.freedman%sun.com
530eff5a32 Debug trace flag had accidentally been left ON for initial commit; it's now off
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@187709 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-17 15:37:13 +00:00
richard.freedman%sun.com
2db04d7153 Prepare for new HttpClient
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@187601 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-13 22:07:35 +00:00
richard.freedman%sun.com
d4c926a71e Fix spcaing mistakes
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@187600 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-13 22:05:57 +00:00
richard.freedman%sun.com
82f261838b Implementation of a simple default for Revocation Checking
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@187597 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-13 21:42:33 +00:00
richard.freedman%sun.com
6458cf3fbe Modify build process to use Revocation Checkers. Implement a
DefaultRevocationChecker based on the defaultCrl CertChainChecker. Begin
implementation of ocsp checker.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@187594 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-13 21:16:22 +00:00
richard.freedman%sun.com
530b19d8f5 Add a comment warning of a limitation to the general use of a function
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@187526 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-12 23:48:44 +00:00
richard.freedman%sun.com
8887f6b799 Fix misspellings in comments.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@187242 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-10 19:23:28 +00:00
richard.freedman%sun.com
f90243e8cf Eliminate useless "static" on structure definition.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186961 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-05 00:13:31 +00:00
richard.freedman%sun.com
e1d1254d55 Move pkix_pl_ldapt.h earlier, so that structures are defined before they
are referenced.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186960 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-05 00:09:54 +00:00
richard.freedman%sun.com
738885d131 Eliminate declaration of a few no longer used variables.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186959 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-05 00:03:11 +00:00
richard.freedman%sun.com
184e97ddce Add extra braces around template initialization of single-entry arrays,
to reduce warning messages on some platforms.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186958 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-04 23:46:55 +00:00
richard.freedman%sun.com
8692e7f463 Eliminate unused variables and obsolete code, to reduce warning messages
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186957 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-04 23:45:15 +00:00
richard.freedman%sun.com
5d0d1845c2 Add pkix_pl_aiamgr.h so that LdapCertStore can reference declarations of
PKIX_PL_LdapClient functions. They are virtual, so they are declared where used
in aiamgr.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186956 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-04 23:44:13 +00:00
richard.freedman%sun.com
c9749da881 Eliminate declaring a variable that's no longer used.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186955 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-04 23:34:35 +00:00
richard.freedman%sun.com
b9865a77f8 Moved LDAPClient functions to AIAMgr, moved AIAMgr to module (from pki)
to handle link order problems


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186835 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 21:45:32 +00:00
richard.freedman%sun.com
5562a260e0 Initial checkin for AIA Manager sources
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186831 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:22:00 +00:00
richard.freedman%sun.com
6b4ef7f0a2 Fix spacing errors
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186830 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:21:14 +00:00
richard.freedman%sun.com
3a931994b4 Fix wrong Cert cited in test argument lists for NIST-Test4.4.4
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186829 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:14:45 +00:00
richard.freedman%sun.com
d60155d6d9 Fix spacing errors.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186828 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:14:12 +00:00
richard.freedman%sun.com
2f5e4b96f9 Use NSSCALL macros more widely. Improve handling of locks under error conditions.
Integrate AIA handling.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186827 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:13:34 +00:00
richard.freedman%sun.com
d9dbac8a3f Improve handling of domain name argument for Socket_CreateByName.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186826 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:11:44 +00:00
richard.freedman%sun.com
4827577bae emove unused symbol definitions, add new function pkix_pl_LdapRequest_AttrStringToBit.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186825 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:10:30 +00:00
richard.freedman%sun.com
47ed287042 Handle Boolean instead of Error return from CRLSelector non-match.
Use new functions pkix_CertSelector_Select and pkix_CRLSelector_Select.
Implement new function pkix_pl_LdapCertStore_ConvertCertResponses for AIA integration.
Better handling of arenas for Cert and CRL creation.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186824 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:09:42 +00:00
richard.freedman%sun.com
79316c51cb AIA integration
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186823 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:06:46 +00:00
richard.freedman%sun.com
bcef4e4487 Document non-blocking I/O support, including new PKIX_CertStore_CertContinue and
PKIX_CertStore_CRLContinue functions.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186822 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:05:49 +00:00
richard.freedman%sun.com
e848ee4b63 Increase maximum size of output string for CERT2Ascii
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186821 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:04:37 +00:00
richard.freedman%sun.com
f1bd7dddd6 Use Boolean instead of Error to return selector non-match. This was changed for
Certs a long time ago, for performance reasons, but we never got around to it
for CRLs.  Add new functions pkix_CertSelector_Select and
pkix_CRLSelector_Select.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186820 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:04:08 +00:00
richard.freedman%sun.com
71c733f83a ng blocking I/O. Add conditional to make it easier to turn off
Default to using blocking I/O. Add conditional to make it easier to turn off
revocation checking.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186819 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-02 20:02:22 +00:00
richard.freedman%sun.com
06c5dfa30d Fixed a misspelling and clarified a comment.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186165 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-16 16:40:49 +00:00
richard.freedman%sun.com
09f5753ae3 Using UTCDayToAscii rather thanUTCTimeToAscii, print out just the date and, hopefully,
avoid the test failures caused by time zone


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186117 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-15 18:35:31 +00:00
richard.freedman%sun.com
6fa11ece9e Fix a series of typos in comments
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186001 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-13 18:19:41 +00:00
richard.freedman%sun.com
425e15dbbe Implement (and use, in test_buildchain) new LdapDefaultClient_CreateByName
function, in preparation for getting URI requests from AIA and SIA extensions.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@186000 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-13 18:17:40 +00:00
richard.freedman%sun.com
3148ee38ff Try hostname without qualifiers if GetHostByName fails on fully-qualified
name, in Socket_CreateByName


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185999 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-13 18:13:48 +00:00
richard.freedman%sun.com
a0e47c2051 Yet another attempt to get the TZ setting down to the lowest-level test.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185995 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-13 17:50:49 +00:00
richard.freedman%sun.com
f1782dcae6 Implemented and tested new function pkix_pl_Socket_CreateByName that takes a
domain name rather than an ip address; preparatory for supporting AIAs.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185969 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-12 20:47:05 +00:00
richard.freedman%sun.com
78367c6ce9 Supply "TZ=US/Eastern" at the lowest level before running tests.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185962 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-12 16:03:23 +00:00
richard.freedman%sun.com
462ae552f9 Remove shell commands that did not help with TZ problem. Supply
TZ on command line for runPLTests in PKI directory.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185933 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-11 21:54:33 +00:00
richard.freedman%sun.com
9536c18482 Echoing of TimeZone seems to be needed for debugging time discrepancies
in test output.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185806 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-08 16:50:15 +00:00
richard.freedman%sun.com
d39d08b925 Add missing crls to test directory
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185766 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-07 16:51:00 +00:00
richard.freedman%sun.com
632bd31170 Left a debugging line in (with a misspelling, no less!)
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185765 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-07 16:38:23 +00:00
richard.freedman%sun.com
890596a2ad Use platform-specific workspcaes when copying certs and crls for
libpkix tests.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185738 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-06 18:10:57 +00:00
richard.freedman%sun.com
3798f563d6 Clarify the language in the explanatory output.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185737 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-06 18:07:24 +00:00
richard.freedman%sun.com
bc8db62ad0 Release Object Lock when an error return is received from one of
the Populate store routines.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185736 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-06 18:05:19 +00:00
richard.freedman%sun.com
3b6285df0d New organization of LDAP processing, into LdapCertStore and LdapClient. This
is the default LdapClient.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185535 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-01 19:22:02 +00:00
richard.freedman%sun.com
cb84ec68b9 Define CertContinue, CRLContinue virtual functions for CertStore
Implement LDAPCertStore using an LDAPClient


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185469 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:20:04 +00:00
richard.freedman%sun.com
577b0fb666 Implement LDAPCertStore as using an LDAPClient
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185468 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:18:16 +00:00
richard.freedman%sun.com
029e8bce32 Implement return of NBIOContext to caller
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185467 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:16:22 +00:00
richard.freedman%sun.com
1535db462c Add CertContinue, CRLContinue functions to CertStore interface
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185466 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:15:52 +00:00
richard.freedman%sun.com
94524d0938 Implement wait based on NBIOContext
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185465 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:15:32 +00:00
richard.freedman%sun.com
530530241d Create either colCertStore or LDAPCertStore, as directed by cmd
Implement wait based on NBIOContext


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185464 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:15:10 +00:00
richard.freedman%sun.com
06e71b5cce Define CertContinue, CRLContinue virtual functions for CertStore
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185463 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:14:42 +00:00
richard.freedman%sun.com
73593504b5 Eliminate GetNBIOCallback arg from Checker_Create,
add NBIOContext arg to Checker_Check


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185462 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:14:23 +00:00
richard.freedman%sun.com
aa73b8a94a Eliminate GetNBIOCallback arg from Checker_Create,
add NBIOContext arg to Checker_Check


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185461 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:13:32 +00:00
richard.freedman%sun.com
1dc265ae04 Add nbioContext arg to calling sequence of getCert, getCRL
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185460 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:12:03 +00:00
richard.freedman%sun.com
1d642b98de Add nbioContext arg to calling sequence of PKIX_BuildChain
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185459 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-30 20:11:48 +00:00
hanfei.yu%sun.com
b0885229ae Provide function to get SIA/AIA location type.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@185076 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-21 19:56:47 +00:00
richard.freedman%sun.com
df645dc5d8 Fix erroneous type (was address, should be UInt32) in List_GetItem call
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184915 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-18 16:22:30 +00:00
julien.pierre.bugs%sun.com
63a7fde555 Don't call PKIX_Initialize in NSS_Init if previous operation failed. This was causing the Windows build to fail in shlibsign.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184812 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-17 05:15:03 +00:00
richard.freedman%sun.com
2be0ba1a80 Prepare for retrieval of nssContext by which caller can poll for
completion of WOULDBLOCK I/O.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184795 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-16 22:53:37 +00:00
richard.freedman%sun.com
c8309e77f5 Prepare checkers for GetNBIOContext calls (to allow user to poll if
waiting for non-blocking I/O)


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184793 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-16 22:26:29 +00:00
richard.freedman%sun.com
fce2c98e50 Fix erroneous parameter in final PKIX_Shutdown call
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184791 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-16 22:20:56 +00:00
richard.freedman%sun.com
7f39673d74 Removed unused code intended for userChecker tests
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184789 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-16 22:16:23 +00:00
richard.freedman%sun.com
2c034e9cbe Added "-arenas" capability to this overlooked test
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184788 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-16 22:13:28 +00:00
richard.freedman%sun.com
5bf41c6295 Fixed a misspelling noticed during casual perusal.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184785 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-16 22:03:26 +00:00
hanfei.yu%sun.com
b9e72ba84c Need to initialize state->anchorIndex to 0.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184762 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-16 15:34:02 +00:00
hanfei.yu%sun.com
25f92dd75e Buzilla 315642: Test pathname are changed to be not hard-coded. Taken directory
names from command line and concatenates with the hard-coded filename.
Also make the directory name absolute so reproducing tests is easier.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184643 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-15 16:42:33 +00:00
julien.pierre.bugs%sun.com
b497a48bb8 Remove unnecessary line from manifest.mn in libpkix test programs.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184637 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-15 04:25:28 +00:00
julien.pierre.bugs%sun.com
de55f55efd Remove extra spaces.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184633 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-15 04:00:06 +00:00
julien.pierre.bugs%sun.com
2ab73f7116 Properly fix build problem with static libraries on libpkix branch.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184631 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-15 03:53:54 +00:00
richard.freedman%sun.com
7ecea4d3c1 Add nss3 to libraries since nssinit now calls PKIX_Initialize.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184591 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-14 20:35:37 +00:00
richard.freedman%sun.com
c39fd786cb Change call to PKIX_Initialize; plContext arg must not be NULL!
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184590 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-14 20:15:38 +00:00
richard.freedman%sun.com
ec18adbd7c Modified PKIX_Initialize calling sequence to allow for nss initialization
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184587 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-14 19:45:24 +00:00
hanfei.yu%sun.com
f77886d58d Due to interesting SH scope phenomenon, need to move read redirect block outside
the function call. So variable value can be executed in the same shell.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184458 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-11 15:32:48 +00:00
hanfei.yu%sun.com
8b87929c86 Add quotes of SH test string.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184449 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-11 03:16:22 +00:00
hanfei.yu%sun.com
635d0b279b add quotes to SH test evaluation of string.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184448 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-11 03:15:20 +00:00
julien.pierre.bugs%sun.com
2bcca86f06 Fix AIX compilation.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184432 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 22:30:56 +00:00
richard.freedman%sun.com
02eb022df7 Return NULL for "state" after a successful build.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184414 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 19:18:03 +00:00
hanfei.yu%sun.com
0c87da2c3d Changes to avoid user changing libpkix gloabal variable PK11COnfigDir at user space.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184411 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 18:13:52 +00:00
richard.freedman%sun.com
2027cbab91 Fixed a misspelling in a comment: "RUNNING tests in samples_apps"
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184405 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 17:33:03 +00:00
richard.freedman%sun.com
7733a1fd1b Accommodate new buildchain interface which allows for non-blocking I/O.
Allow for command line specification of LDAP server.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184400 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 16:04:24 +00:00
richard.freedman%sun.com
b0ac599b3d Fix mistakes in resource limit handling, probably introduced by faulty
merging of changes during manual integration.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184398 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 15:50:55 +00:00
richard.freedman%sun.com
79d2829a60 Add server arg (dummy for now) in preparation for using LDAP server in tests
of buildchain_resourcelimits


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184397 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 15:49:01 +00:00
richard.freedman%sun.com
f9a68038b3 Fix a leak in releasing non-arena space; document the need for code to replace
the non-portable sleep call.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184396 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 15:46:58 +00:00
julien.pierre.bugs%sun.com
0a1743ff14 Make LDAPFilterTemplate non-static. Compilers disagree about forward declarations of static objects, so this was the only way to build on all platforms.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184387 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 02:44:29 +00:00
julien.pierre.bugs%sun.com
445ca7499a Fix typo.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184384 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-10 01:04:15 +00:00
hanfei.yu%sun.com
039a028dbc Took out un-needed conditional check.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184362 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-09 20:19:09 +00:00
julien.pierre.bugs%sun.com
32af6ddf6c Comment out sleep() call which broke windows build
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184338 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-09 04:57:42 +00:00
julien.pierre.bugs%sun.com
e8565d42a0 Turn off broken test temporarily.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184336 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-09 02:27:26 +00:00
julien.pierre.bugs%sun.com
6493d5af1a Fix Windows compilation. forward reference can't be static.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184333 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-09 02:01:26 +00:00
richard.freedman%sun.com
a5f3869ac5 New interfaces, mostly in support of non-blocking I/O, and updated ldapcertstore
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184323 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-08 22:54:18 +00:00
hanfei.yu%sun.com
b04d8ecfbf Convert test scripts from KSH to SH.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184303 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-08 18:02:11 +00:00
hanfei.yu%sun.com
4698d7255a Changes for using testutil share memory.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184300 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-08 17:40:36 +00:00
julien.pierre.bugs%sun.com
590cd7db96 Checkin forgotten file for PKIX branch to use dynamic test library.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184266 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-07 21:41:56 +00:00
julien.pierre.bugs%sun.com
b364726e47 Properly make all libpkix test use the pkixutil shared library on all platforms. A static library was used on Unix vs dynamic on Windows.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184178 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-05 06:40:04 +00:00
julien.pierre.bugs%sun.com
84c7987f71 Change PKIX_ALLOC_ERROR from a global variable to an accessor functions. Global variables do not work on Windows in shared libraries.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184177 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-05 05:05:45 +00:00
hanfei.yu%sun.com
e6381de6e2 Parsing work for Cert extended OIDs: AIA (Authority Information Access) and SIA (Subject Information Access).
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184150 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-04 17:53:28 +00:00
julien.pierre.bugs%sun.com
1bd91f41ee Add missing createDirCert and createDirCertChainPlus functions. Also sort functions alphabetically.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184119 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-04 00:06:43 +00:00
richard.freedman%sun.com
a5b73306e3 Clear our reference after explicit call to PKIX_PL_Object_Decref
(as opposed to PKIX_DECREF macro, which clears it automatically).


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@184098 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-03 16:36:13 +00:00
hanfei.yu%sun.com
94455cc6ac Changed hard-coded NIST files names from test .c, using command line option as filename prefix.
Took out linking/unlinking NIST data directory to tests directory, instead accessing those data files directly - to allow multiple test executions.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@183911 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-02 12:54:12 +00:00
richard.freedman%sun.com
a23a262824 Fix misspelled comment. Decref owners of objects before objects, so refcount
is one when object is decrefed.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@183351 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-01 18:40:33 +00:00
hanfei.yu%sun.com
a1e5555275 Put temporary test output file to directory under .../mozilla/test_results.
Reorganize scripts so duplicate codes are under .../libpkix/common/*.sh


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@183198 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-28 17:32:22 +00:00
julien.pierre.bugs%sun.com
03f1911dc3 Fix broken build.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@183170 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-28 03:27:50 +00:00
julien.pierre.bugs%sun.com
04a38b14da Fix test_socket test so it runs on Solaris x86 / AMD64
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@183167 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-28 02:46:17 +00:00
julien.pierre.bugs%sun.com
4bf0ef264d Fix typo
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@183156 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-28 00:22:15 +00:00
hanfei.yu%sun.com
63279ebc7b Hooked sample_app/runPerf.sh into libpkix.sh so all.sh can get perf tests.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@183120 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-27 13:40:44 +00:00
hanfei.yu%sun.com
4062bbfa37 Handle error case more sophisticatedly
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@182982 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-25 18:48:52 +00:00
hanfei.yu%sun.com
dd30d6c3a8 Added Performance executibles to tests. Those tests execute multi-thread scenarios.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@182971 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-25 17:38:28 +00:00
hanfei.yu%sun.com
32783727a9 Fix Bug: Critical Extension Oid List should be a copy of the cached. Since this list is going to be modified by the caller.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@182964 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-25 12:49:08 +00:00
richard.freedman%sun.com
4a7a893ed3 Fix a misspelling in a comment
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@182899 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-24 16:24:26 +00:00
hanfei.yu%sun.com
d32d656950 Logger work.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@182897 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-24 14:15:39 +00:00
hanfei.yu%sun.com
8db125275a Fixed memory leak in PKIX_BuildChain: trustedCert
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@181989 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-11 16:02:22 +00:00
hanfei.yu%sun.com
5136840128 Clean compliation warnings
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@181768 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-07 12:33:36 +00:00
hanfei.yu%sun.com
21a2fea121 Fixed memory leak caused by incorrect loop control
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@181766 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-07 12:18:53 +00:00
hanfei.yu%sun.com
6d3725f74c Work for performance tuning: sorting algorithms. Provided quick and bubble sorts and callback hook for comparison so the sorting creteria can be expanded easily and sorting can be used more genetically.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@181712 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-06 17:01:35 +00:00
hanfei.yu%sun.com
f9b5bc1a16 Fixed a couple memory leaks.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@181279 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-30 13:34:09 +00:00
hanfei.yu%sun.com
ff8fafb679 Work for ResourceLimits: maxTime, maxFanout and maxDepth for buildChain.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@181210 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-29 18:42:24 +00:00
richard.freedman%sun.com
88bdbe5a49 Initialize variable in AppendUnique to avoid crash in the case of both Lists empty
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@181074 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-27 21:16:54 +00:00
richard.freedman%sun.com
f1d8c753e9 Removed an erroneous comment. This routine does not return any non-fatal errors.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180915 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-24 20:50:02 +00:00
richard.freedman%sun.com
6d246bbeb5 Changed CertChainCache arguments in merging new version of pkix_build
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180893 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-23 20:57:28 +00:00
richard.freedman%sun.com
72ab670676 Changed recursive build to non-recursive to prepare for non-blocking I/O
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180892 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-23 20:56:22 +00:00
richard.freedman%sun.com
e8edb000a3 Moved _AppendUnique from pkix_policychecker.c to pkix_list.c, for reuse
by pkix_build


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180890 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-23 20:45:22 +00:00
richard.freedman%sun.com
5605d8bc5d If PR_Bind fails with INADDR_ANY, try it with the real hostname
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180799 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-22 15:05:09 +00:00
hanfei.yu%sun.com
0d28b1507c Fixed memory leak in CRL Entry Cache related codes.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180793 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-22 13:08:53 +00:00
hanfei.yu%sun.com
323b705728 Work for CertChain, Cert and CRLEntry cache.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180757 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-21 18:17:27 +00:00
richard.freedman%sun.com
861d736743 Add parsing of cross-certificate pairs
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180571 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-19 17:05:40 +00:00
richard.freedman%sun.com
bedbe9e368 Omitted definition of error variable in previous debug edit.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180443 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-16 22:18:34 +00:00
richard.freedman%sun.com
2a3f00a837 Enable error message detail for PR_Bind failure
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180420 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-16 19:05:09 +00:00
richard.freedman%sun.com
59f5c694a3 Reordered decrefs for easier debugging
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180417 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-16 18:55:57 +00:00
richard.freedman%sun.com
40de11cee5 Added decref for uchecker, which was not getting freed.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180415 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-16 18:48:55 +00:00
richard.freedman%sun.com
98c41944d5 Limit ConnectContinue retries and make an error message clearer.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180210 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-14 16:42:14 +00:00
richard.freedman%sun.com
6390a60137 Supply null strings instead of expected ascii, to avoid date comparisons
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180201 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-14 15:34:37 +00:00
richard.freedman%sun.com
cc545b591f Use ${HOSTADDR} for socket bind address.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180141 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-13 20:40:54 +00:00
hanfei.yu%sun.com
ccee31b779 Combine hard-coded ALLOC_ERROR header and data in one structure and don't use the object-1 to rewind the object pointer
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@180019 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-12 13:03:47 +00:00
hanfei.yu%sun.com
695bc3a980 PKIX_PL_Sprintf() is modified to pass NULL to PR_s*printf* calls when caller's fmt %s is NULL.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179791 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-07 13:14:55 +00:00
hanfei.yu%sun.com
df45d4fb69 Cross platform endient problems with hard-coded integer values to compare with char - change hard-coded integers to chars
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179720 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-06 20:25:49 +00:00
richard.freedman%sun.com
6a64af44d6 Set TZ=US/Eastern as expected by the string compares in libpkix tests
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179661 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-05 15:00:27 +00:00
hanfei.yu%sun.com
a30ff3c620 Put in temporary debugging message for nightly test run.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179550 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-02 17:58:29 +00:00
richard.freedman%sun.com
b1539d55d6 Use command-line hostname instead of localhost
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179545 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-02 17:21:28 +00:00
richard.freedman%sun.com
5cbfdec6e5 Set and echo TZ settings
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179543 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-02 17:11:33 +00:00
richard.freedman%sun.com
ec17224ae4 Set time zone to Eastern before beginning tests
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179495 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-01 19:56:54 +00:00
hanfei.yu%sun.com
bd417f7916 Patches for NSS bug 287052 and 287061.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179477 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-01 17:22:28 +00:00
richard.freedman%sun.com
53e2abff83 Replace == by = for string compare in scripts, for cross-platform compatibility
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179427 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-31 21:15:08 +00:00
richard.freedman%sun.com
871b3084ed More cross-platform compiler warnings addressed
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179337 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-30 20:32:36 +00:00
richard.freedman%sun.com
b895ebe0c7 Remove obsolete references to bindname and authentication. Commenting them out
(in the middle of a macro) gave some platforms indigestion.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179315 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-30 16:51:41 +00:00
richard.freedman%sun.com
fba445fa79 LdapCertStore update
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179243 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-29 21:44:53 +00:00
richard.freedman%sun.com
a870cab49a Remove erroneous NULLCHECK from CRLSelector_ToString_Helper and fix some
non-conforming or outdated function descriptions.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@179233 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-29 20:08:44 +00:00
hanfei.yu%sun.com
9c2fdd2634 Fixed memory leak on critical extension oid table
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178794 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-24 17:06:41 +00:00
hanfei.yu%sun.com
45c649a6b7 Fixed in pkix_FindMatchingCerts: only certs from last certStore are returned, should be all.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178683 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-23 13:26:27 +00:00
hanfei.yu%sun.com
8223e94047 Added entry for buildchain_uchecker
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178626 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-22 19:14:26 +00:00
hanfei.yu%sun.com
d45de9c318 Optimized user checkers work and its tests.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178599 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-22 14:08:10 +00:00
richard.freedman%sun.com
176f978a6d Restructured ldapCertStore
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178314 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-19 23:19:08 +00:00
richard.freedman%sun.com
a6398570e6 Revised structure of ldapCertStore for nonblocking I/O; made BIND conditional
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178313 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-19 23:17:39 +00:00
julien.pierre.bugs%sun.com
d8b918c605 Fix for 297849 - allow 32 bit builds on 64-bit Linux machines. Backport to NSS_LIBPKIX_BRANCH
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178210 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-18 23:13:36 +00:00
richard.freedman%sun.com
56ae06312d Added SetSocketOption_ReuseAddr to server socket
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178196 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-18 19:59:35 +00:00
hanfei.yu%sun.com
4e94cf2e71 Added test_buildchain_uchecker to test script.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178187 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-18 19:01:17 +00:00
hanfei.yu%sun.com
9ae8527e24 Add test for user defined checker (called by buildchain validation).
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178186 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-18 19:00:22 +00:00
hanfei.yu%sun.com
8d465dee33 Work for Critical extension check (no optimization) and user-defined checkers.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178185 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-18 18:58:55 +00:00
richard.freedman%sun.com
7e9101834b Restructured code to better support nonblocking I/O
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@178183 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-18 18:50:21 +00:00
richard.freedman%sun.com
7f2c982bc0 Use universal typoes for cross-platform compatibility
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177865 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-16 19:12:52 +00:00
richard.freedman%sun.com
0a3aeaa25d Eliminate declarations of unused variables
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177845 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-16 14:39:15 +00:00
richard.freedman%sun.com
848376d216 Turn off debugging trace code, and eliminate cross-platform warnings
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177843 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-16 14:38:27 +00:00
hanfei.yu%sun.com
934fde1acd Fixed WIN compilation warnings
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177829 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-16 11:29:55 +00:00
richard.freedman%sun.com
8993447ee1 Eliminate unused variables and add a cast to get rid of a Windows warning message
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177770 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-15 18:59:13 +00:00
hanfei.yu%sun.com
7785f0341f Fixed WIN compilation warnings
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177754 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-15 16:29:46 +00:00
hanfei.yu%sun.com
799abf4734 Rewrite PKIX_PL_Sprintf to avoid modifying args returned from va_start() which may not be cross-platform compatible
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177753 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-15 15:49:36 +00:00
richard.freedman%sun.com
94d52d2f8d Enhancements to LDAP Certstore: now handles multiple attributes properly
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177658 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-12 21:37:39 +00:00
hanfei.yu%sun.com
454c77439e Not to use va_copy() to avoid portability problem, instead, use va_end() and va_start() for reset.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177647 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-12 18:31:43 +00:00
julien.pierre.bugs%sun.com
35e8ce4b64 Fix broken build. Add extern const declaration for template so it can be used within libnss .
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177608 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 23:21:10 +00:00
richard.freedman%sun.com
7f5ab8fbab Renamed LDAPMessageTemplate to PKIX_PL_... and used access macros.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177557 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 17:35:02 +00:00
richard.freedman%sun.com
2be663ecd0 Modifications to eliminate cross-platform compile warnings
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177556 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 16:44:41 +00:00
richard.freedman%sun.com
51d03e5e4b Added command line arguments server:port for test_socket
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177553 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 15:01:46 +00:00
hanfei.yu%sun.com
9c7a822eb3 Fixed WIN compilation warnings.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177550 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 13:42:38 +00:00
hanfei.yu%sun.com
6b76bd81ee Fixed compilation warnings.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177549 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 11:56:28 +00:00
hanfei.yu%sun.com
f65ea650f0 Fixed plContext order appears in PKIX_PL_Sprintf().
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177548 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 11:47:38 +00:00
hanfei.yu%sun.com
877c7fd740 Fixed memory leak (arena).
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177547 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 11:32:32 +00:00
julien.pierre.bugs%sun.com
0df3eeb7e7 Fix build. Do not export private test function which is conditionally compiled.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177529 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-11 00:36:37 +00:00
richard.freedman%sun.com
1415a2dac0 Added command-line specification of host:port for test_socket, allow non-blocking
connect.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177515 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-10 21:20:13 +00:00
hanfei.yu%sun.com
ed5bca42b4 Fixed PKIX_PL_Free so when plContext is NULL, PR_Free will be invoked.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177500 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-10 14:29:13 +00:00
hanfei.yu%sun.com
646d483f29 Fixed: Only first test case is executed, should have all of them tested
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177493 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-10 12:38:40 +00:00
hanfei.yu%sun.com
8f2465c0d4 Fixed problems created by plContext is used as nssContext, which is not just for arena as before.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177492 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-10 12:36:11 +00:00
richard.freedman%sun.com
b29004185f Added include pkix_pl_common.h to testutil.h to get NssContext_Create prototype
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177429 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-09 15:28:54 +00:00
hanfei.yu%sun.com
99bf1dbcd8 Took out hard-coded dbx pathname.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177425 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-09 13:47:10 +00:00
hanfei.yu%sun.com
caa50f0c17 Need to specify the path .../dist/.../bin for xdb -checkmem option.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177423 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-09 12:57:48 +00:00
hanfei.yu%sun.com
8ae1efe38e Fixed compilation warnings
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177421 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-09 11:51:05 +00:00
hanfei.yu%sun.com
f8da4085a4 Fixed compiler warning
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177420 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-09 11:35:05 +00:00
richard.freedman%sun.com
59864ab0e7 Modified libpkix tests for wincx parameter
Provided wincx parameter to pk11 functions
Improved documentation and portability


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177362 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 20:12:46 +00:00
richard.freedman%sun.com
7ec5280f6a Modified libpkix tests for wincx parameter
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177360 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 20:09:22 +00:00
hanfei.yu%sun.com
bdb839a2b0 Fixed linux compilation warning.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177358 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 20:05:07 +00:00
hanfei.yu%sun.com
9d7112c4f1 Fixed linux compilation warnings.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177357 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 20:02:27 +00:00
hanfei.yu%sun.com
a5ad2944bb Fixed linux compilation warning.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177355 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 19:53:55 +00:00
hanfei.yu%sun.com
8b3d7bf8a0 Fixed linux compilation warnings.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177353 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 19:42:55 +00:00
hanfei.yu%sun.com
5d668b0458 Fixed linux compilation warning.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177352 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 19:34:54 +00:00
hanfei.yu%sun.com
ba294e6c4b Fixed linux compilation warning.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177350 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 19:22:01 +00:00
hanfei.yu%sun.com
e058d16eea Fixed linux compilation warnings.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177349 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 19:13:37 +00:00
hanfei.yu%sun.com
a91e6005d5 Fixed linux compilation warnings.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177347 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 19:07:39 +00:00
hanfei.yu%sun.com
09c6ad0082 Fixed linux compilation warnings.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177346 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 18:57:59 +00:00
hanfei.yu%sun.com
fdc92e13d8 Fixed linux compilation warning.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177345 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 18:46:06 +00:00
hanfei.yu%sun.com
5fc6c70b5c Clean linux compilation warnings.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177342 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 18:29:14 +00:00
hanfei.yu%sun.com
5d7f3101ad Added test_mutex3.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177339 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 18:28:09 +00:00
hanfei.yu%sun.com
bd8fc2a4bd Fixed linux compilation warning for unused variables.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177337 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 17:35:39 +00:00
hanfei.yu%sun.com
3c6ace81e9 Fix linux compiler warning for unused variable pkixTestTempResult.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177336 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 17:13:18 +00:00
hanfei.yu%sun.com
5ba637626f Fixes warnings from linux compilation.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177334 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 16:52:20 +00:00
hanfei.yu%sun.com
2f1d87fddb Fixed compiler errors for PKIX_NULLCHECK() on non-pointer parameters
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177325 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-08 14:04:36 +00:00
julien.pierre.bugs%sun.com
21b3feb1b0 Fix multiply defined symbols that broke OS/2 build.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177282 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-07 04:54:44 +00:00
julien.pierre.bugs%sun.com
d5346d477e Add pkixutil.def file. Required for OS/2 build .
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177281 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-07 04:53:23 +00:00
julien.pierre.bugs%sun.com
b45557a09e Remove unused variable
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177258 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 06:04:12 +00:00
julien.pierre.bugs%sun.com
f7feea1f01 Remove unused variables
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177257 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 06:03:06 +00:00
julien.pierre.bugs%sun.com
6d2a8c6711 Fix cast from NULL to int
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177256 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 06:00:17 +00:00
julien.pierre.bugs%sun.com
994156f494 Remove unused label
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177255 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:59:32 +00:00
julien.pierre.bugs%sun.com
4bd9cdd77c Remove unused variable
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177254 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:58:49 +00:00
julien.pierre.bugs%sun.com
66db9ba8c1 Remove unused variables, labels. Fix casts from NULL to int.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177253 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:56:53 +00:00
julien.pierre.bugs%sun.com
97049b181c Remove unused label and variable
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177252 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:55:03 +00:00
julien.pierre.bugs%sun.com
0941fee7f4 Remove unused variables
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177251 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:54:00 +00:00
julien.pierre.bugs%sun.com
f1216fd792 Fix for casts from NULL to int
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177250 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:53:06 +00:00
julien.pierre.bugs%sun.com
d1b8e7ce1a Remove unnecessary labels
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177249 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:25:32 +00:00
julien.pierre.bugs%sun.com
900753bfa1 Remove unneeded variables, labels.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177248 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:20:12 +00:00
julien.pierre.bugs%sun.com
1fabb0c34e Fix for compiler warnings.
Remove unused variables, labels.
Fix casts from NULL to int


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177247 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:16:18 +00:00
julien.pierre.bugs%sun.com
85d75c14cc Fix header includes.
Can't include secutil.h in lib
Need secerr.h and base64.h


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177246 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:07:53 +00:00
julien.pierre.bugs%sun.com
75b1f6c248 Remove unused label, variables.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177245 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 05:07:18 +00:00
julien.pierre.bugs%sun.com
e2a3ab5cba Remove unused variables, labels.
Fix casts from NULL to int or char


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177244 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:53:15 +00:00
julien.pierre.bugs%sun.com
2f5170e364 Remove unused labels
Fix casts from NULL to int


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177243 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:49:22 +00:00
julien.pierre.bugs%sun.com
85927d7d68 Remove unused labels
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177242 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:47:56 +00:00
julien.pierre.bugs%sun.com
5fc73ac83a Remove unused label.
Fix cast from NULL to int


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177241 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:46:24 +00:00
julien.pierre.bugs%sun.com
4912499279 Change assignment value from NULL to PKIX_FALSE
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177240 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:45:28 +00:00
julien.pierre.bugs%sun.com
37bea65f31 Remove unused variable, label. Fix casts of NULL to int
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177239 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:42:09 +00:00
julien.pierre.bugs%sun.com
e79a726ad5 Fix casts of NULL to int
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177238 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:38:57 +00:00
julien.pierre.bugs%sun.com
627db20ed9 Remove unused variables and unnecessary labels
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177237 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:37:33 +00:00
julien.pierre.bugs%sun.com
7c6116fb1e Remove unnecessary labels, variables.
Fix cast from NULL to int


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177236 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:33:52 +00:00
julien.pierre.bugs%sun.com
856035e4ee Remove unnecessary labels, variables.
Fix cast from NULL to int .


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177235 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:30:28 +00:00
julien.pierre.bugs%sun.com
0e90c9589b Remove unnecessary labels.
Fix cast from NULL to int


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177234 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:27:10 +00:00
julien.pierre.bugs%sun.com
f7cc88c7ee Remove unnecessary labels.
Fix cast from NULL to int .


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177233 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:26:07 +00:00
julien.pierre.bugs%sun.com
c977140266 Remove unnecessary variables, labels.
Fix cast from NULL to int .


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177232 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:25:20 +00:00
julien.pierre.bugs%sun.com
996e01f21d Fix compiler warnings.
Remove unnecessary variables, labels. Fix casts from NULL to int .


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177229 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:11:55 +00:00
julien.pierre.bugs%sun.com
24afb362a0 Fix compiler warnings
Remove unused variables and unnecessary labels
Fix casts of NULL to int


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177227 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 04:05:28 +00:00
julien.pierre.bugs%sun.com
61f4ec8289 Remove unused label
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177226 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:59:49 +00:00
julien.pierre.bugs%sun.com
ec6a7ac35c Remove unused labels
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177225 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:58:36 +00:00
julien.pierre.bugs%sun.com
557385d957 Fix compiler warnings.
Remove unused variables, labels, and fix casts of NULL to int


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177224 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:57:24 +00:00
julien.pierre.bugs%sun.com
2fbd387e95 Fix cast of NULL to int.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177223 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:52:39 +00:00
julien.pierre.bugs%sun.com
209bc91670 Fix compiler warnings.
Remove unused variables, labels. Fix improper casts of NULL to int.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177222 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:50:34 +00:00
julien.pierre.bugs%sun.com
4908096a54 Remove unnecessary labels.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177221 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:45:08 +00:00
julien.pierre.bugs%sun.com
70a1308202 Don't pass NULL as an integer.
Remove unused and unnecessary labels.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177220 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:43:24 +00:00
julien.pierre.bugs%sun.com
2ad06d16b1 Don't pass NULL as an integer.
Remove unused labels.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177219 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:41:10 +00:00
julien.pierre.bugs%sun.com
4de217bb0b Don't pass NULL as an integer. gcc wants 0 .
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177218 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:40:46 +00:00
julien.pierre.bugs%sun.com
893a7bd7c9 Remove unnecessary labels
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177217 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:33:50 +00:00
julien.pierre.bugs%sun.com
e82fcba336 Remove unused labels
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177216 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:30:46 +00:00
julien.pierre.bugs%sun.com
2699708c49 Remove unused variables
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177215 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:20:31 +00:00
julien.pierre.bugs%sun.com
1de10eeb87 Remove unused variable
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177214 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:18:27 +00:00
julien.pierre.bugs%sun.com
4fedb77698 Delete unused variables
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177212 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 03:15:16 +00:00
julien.pierre.bugs%sun.com
19b4b0495d Fix build on AIX.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177211 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 02:55:42 +00:00
julien.pierre.bugs%sun.com
42a5729e2b Fix AIX compilation.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177210 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 01:51:56 +00:00
julien.pierre.bugs%sun.com
3ef9ebc7b6 Set array size to fix Win32 builds.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177207 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 00:39:44 +00:00
julien.pierre.bugs%sun.com
d0f5e0f866 Remove unnecessary include to fix Windows build.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177206 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 00:38:53 +00:00
julien.pierre.bugs%sun.com
66e747bee4 Include all NSPR headers for the PL part of libpkix .
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177205 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 00:21:13 +00:00
julien.pierre.bugs%sun.com
869aec447a Use correct port for LDAP.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177204 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 00:15:44 +00:00
julien.pierre.bugs%sun.com
ff2ab79c63 Fix build on windows . Use PR_htonl / PR_htons macros.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177202 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-06 00:06:53 +00:00
julien.pierre.bugs%sun.com
9dbc3ffe34 Fix build for vararg code on non-Solaris platforms.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177194 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 23:16:16 +00:00
richard.freedman%sun.com
4420a8eb8a Added socket Makefile
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177192 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 22:31:48 +00:00
richard.freedman%sun.com
3801792481 Replace gettimeofday with PR_Now in debugging trace code.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177188 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 21:12:34 +00:00
richard.freedman%sun.com
42088c5244 Replace platform-dependent sleep with PR_Sleep
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177187 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 20:51:11 +00:00
richard.freedman%sun.com
9dbbbe44b0 Changed platform dependent socket structures to PR structures; isolated incompatibility,
for now, into test_socket


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177184 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 20:00:04 +00:00
richard.freedman%sun.com
d4402a0ee0 Added test code for pkix_pl_socket object
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177183 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 19:55:18 +00:00
hanfei.yu%sun.com
679cec5c80 Need to use "expr" in sh script for adding errors.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177180 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 18:30:45 +00:00
hanfei.yu%sun.com
8909a5b20d Provide an alternative solution so LOGFILE data won't be erased.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177170 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 16:58:00 +00:00
hanfei.yu%sun.com
9dc83de5bb Add messages for HTML.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177167 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-05 15:38:13 +00:00
julien.pierre.bugs%sun.com
a5dcf347cb Remove tests for STDC which are not needed. On NSS_LIBPKIX_BRANCH only.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177136 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-04 22:38:38 +00:00
julien.pierre.bugs%sun.com
16c94a9cf9 Fix build on Windows. Remove "32" from library name. On NSS_LIBPKIX_BRANCH only.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177121 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-04 21:14:22 +00:00
richard.freedman%sun.com
c73cc8b8b0 Added socket and ldapcertstore objects
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177119 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-04 21:07:44 +00:00
hanfei.yu%sun.com
fd1ee6dd5a For va_list type, use va_copy() instead of assignment to avoid 64-bit compiler error. It is also the right call to use since it saves that state.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177110 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-04 17:35:28 +00:00
hanfei.yu%sun.com
6c8e988a3c Fixed different platforms compilation errors: change #ifdef 0 to #if 0 and assign pkixTempErrorReceived value.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177101 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-04 16:04:47 +00:00
hanfei.yu%sun.com
9b1e03c8f8 Rename libpkixtestutil to libpkixutil and move dependency locally to libpkix directory.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177099 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-04 15:04:01 +00:00
julien.pierre.bugs%sun.com
b9da9c3484 Remove STDC tests to unbreak Windows build
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177092 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-04 03:18:08 +00:00
hanfei.yu%sun.com
b2f69aca32 Took out redirecting output so the action is shown.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177062 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-03 16:14:46 +00:00
hanfei.yu%sun.com
51ffb61a9f CVS doesn't create empty test directory, have to mannually created in script.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177061 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-03 15:43:51 +00:00
hanfei.yu%sun.com
ce7c958fdd Initial libpkix tests source, script and data files.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177058 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-03 14:33:00 +00:00
julien.pierre.bugs%sun.com
b16d8cf156 Fix for Win32 build.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177053 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-03 04:02:29 +00:00
julien.pierre.bugs%sun.com
59622c8293 Fix build on Win32
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177052 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-03 03:54:50 +00:00
julien.pierre.bugs%sun.com
ca82993e15 Fix build on AIX and Linux.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177051 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-03 02:46:25 +00:00
julien.pierre.bugs%sun.com
bff40c0ddd Remove tests for STDC which are not needed.
Fix the definition of PKIX_UInt32 and PKIX_Int32 which is 32-bits on all supported platforms.
Remove #pragma ident which causes warnings on most compilers and platforms.


git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177050 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-03 02:36:37 +00:00
richard.freedman%sun.com
8e06797ba3 Used real structures instead of approximations, to improve portability.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@177031 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-02 22:31:40 +00:00
richard.freedman%sun.com
7b57a52933 adding omitted top-level (libpkix) config.mk and manifest.mn
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176806 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-28 20:39:58 +00:00
richard.freedman%sun.com
fcd0208ce4 Added top-level (libpkix) Makefile
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176803 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-28 20:23:10 +00:00
richard.freedman%sun.com
d88c038caf Initial libpkix library code drop to NSS_LIBPKIX_BRANCH
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176802 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-28 20:00:34 +00:00
richard.freedman%sun.com
0cfeafc609 Removed comment line that was added in test of commit permissions.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176794 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-28 19:01:59 +00:00
richard.freedman%sun.com
56e87c115d added a line
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176792 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-28 18:57:24 +00:00
julien.pierre.bugs%sun.com
96c9ac136b *** empty log message ***
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176791 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-28 18:24:55 +00:00
julien.pierre.bugs%sun.com
6e74112910 Remove unused variable
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176475 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-22 22:30:47 +00:00
julien.pierre.bugs%sun.com
f8eda249f9 Fix for bug 299308 . Define ReleaseDPCache . On NSS_LIBPKIX_BRANCH only.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176470 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-22 22:06:22 +00:00
julien.pierre.bugs%sun.com
dba411c85c Fix for 287052 . rename CERT_FindCRLReasonExten to CERT_FindCRLEntryReasonExten . On NSS_LIBPKIX_BRANCH only .
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176468 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-22 21:55:59 +00:00
julien.pierre.bugs%sun.com
a025b3bd61 Export CERT_FindCRLNumberExten. Fix for 287061. On NSS_LIBPKIX_BRANCH only.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176467 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-22 21:51:25 +00:00
julien.pierre.bugs%sun.com
bfaa1c8dba Back out changes from bug 289558 . On NSS_LIBPKIX_BRANCH only .
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176402 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-21 19:04:24 +00:00
julien.pierre.bugs%sun.com
6445590ff1 Fix for 287052 . Add support for getting the CRL entry's reason code. On NSS_LIBPKIX_BRANCH only
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176149 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-15 19:32:46 +00:00
julien.pierre.bugs%sun.com
a1bcbfbe2f Fix for 300929 . Support advanced policy extensions. On NSS_LIBPKIX_BRANCH only
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176148 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-15 19:16:01 +00:00
julien.pierre.bugs%sun.com
ae205868f2 Fix for 299308 . Fix bug in new CRL cache function. On NSS_LIBPKIX_BRANCH only
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176147 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-15 19:04:45 +00:00
julien.pierre.bugs%sun.com
ce566a57b9 Fix for bug 287061 . CRL number should be a bignum. On NSS_LIBPKIX_BRANCH? only
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176146 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-15 17:39:59 +00:00
julien.pierre.bugs%sun.com
b6d79fbdff Fix for 287563. Split CERT_CheckNameSpace. On NSS_LIBPKIX_BRANCH only
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176145 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-15 17:17:18 +00:00
julien.pierre.bugs%sun.com
fa6d939db7 Fix for 289558 . Correct combine constraints list. Fix from Hanfei Yu . On NSS_LIBPKIX_BRANCH Only .
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176143 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-15 17:04:42 +00:00
julien.pierre.bugs%sun.com
0a6f21c26e Fix for 300928. Build changes for libpkix integration. On NSS_LIBPKIX_BRANCH only.
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@176142 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-15 16:53:08 +00:00
julien.pierre.bugs%sun.com
556a330f0c Fix for 299308. Add new CRL cache APIs for use by libpkix . On LIBPKIX branch only
git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@175832 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-08 07:13:34 +00:00
(no author)
a168dd5053 This commit was manufactured by cvs2svn to create branch
'NSS_LIBPKIX_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NSS_LIBPKIX_BRANCH@175128 18797224-902f-48f8-a5cc-f745e15eee43
2005-06-24 23:00:05 +00:00
2159 changed files with 727334 additions and 498 deletions

37
mozilla/dbm/Makefile.in Normal file
View File

@@ -0,0 +1,37 @@
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = dbm
DIRS = include src
ifdef ENABLE_TESTS
DIRS += tests
endif
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,55 @@
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = dbm
EXPORTS = \
nsres.h \
cdefs.h \
mcom_db.h \
ncompat.h \
winfile.h \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
PRIVATE_EXPORTS = \
hsearch.h \
page.h \
extern.h \
ndbm.h \
queue.h \
hash.h \
mpool.h \
search.h \
$(NULL)
PRIVATE_EXPORTS := $(addprefix $(srcdir)/, $(PRIVATE_EXPORTS))
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,60 @@
# The contents of this file are subject to the Netscape 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/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#//------------------------------------------------------------------------
#//
#// Makefile to build the cert library
#//
#//------------------------------------------------------------------------
!if "$(MOZ_BITS)" == "16"
!ifndef MOZ_DEBUG
OPTIMIZER=-Os -UDEBUG -DNDEBUG
!endif
!endif
#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH= ..\..
!ifndef MAKE_OBJ_TYPE
MAKE_OBJ_TYPE=EXE
!endif
#//------------------------------------------------------------------------
#//
#// install headers
#//
#//------------------------------------------------------------------------
EXPORTS=nsres.h cdefs.h mcom_db.h ncompat.h winfile.h
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>
CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT

165
mozilla/dbm/include/cdefs.h Normal file
View File

@@ -0,0 +1,165 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Berkeley Software Design, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)cdefs.h 8.7 (Berkeley) 1/21/94
*/
#ifndef _CDEFS_H_
#define _CDEFS_H_
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
/*
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
* The __CONCAT macro is a bit tricky -- make sure you don't put spaces
* in between its arguments. __CONCAT can also concatenate double-quoted
* strings produced by the __STRING macro, but this only works with ANSI C.
*/
#if defined(__STDC__) || defined(__cplusplus) || defined(_WINDOWS) || defined(XP_OS2)
#define __P(protos) protos /* full-blown ANSI C */
#define __CONCAT(x,y) x ## y
#define __STRING(x) #x
/* On HP-UX 11.00, <sys/stdsyms.h> defines __const. */
#ifndef __const
#define __const const /* define reserved names to standard */
#endif /* __const */
#define __signed signed
#define __volatile volatile
#ifndef _WINDOWS
#if defined(__cplusplus)
#define __inline inline /* convert to C++ keyword */
#else
#if !defined(__GNUC__) && !defined(__MWERKS__)
#define __inline /* delete GCC keyword */
#endif /* !__GNUC__ */
#endif /* !__cplusplus */
#endif /* !_WINDOWS */
#else /* !(__STDC__ || __cplusplus) */
#define __P(protos) () /* traditional C preprocessor */
#define __CONCAT(x,y) x/**/y
#define __STRING(x) "x"
#ifndef __GNUC__
#define __const /* delete pseudo-ANSI C keywords */
#define __inline
#define __signed
#define __volatile
/*
* In non-ANSI C environments, new programs will want ANSI-only C keywords
* deleted from the program and old programs will want them left alone.
* When using a compiler other than gcc, programs using the ANSI C keywords
* const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
* When using "gcc -traditional", we assume that this is the intent; if
* __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
*/
#ifndef NO_ANSI_KEYWORDS
#define const /* delete ANSI C keywords */
#define inline
#define signed
#define volatile
#endif
#endif /* !__GNUC__ */
#endif /* !(__STDC__ || __cplusplus) */
/*
* GCC1 and some versions of GCC2 declare dead (non-returning) and
* pure (no side effects) functions using "volatile" and "const";
* unfortunately, these then cause warnings under "-ansi -pedantic".
* GCC2 uses a new, peculiar __attribute__((attrs)) style. All of
* these work for GNU C++ (modulo a slight glitch in the C++ grammar
* in the distribution version of 2.5.5).
*/
#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5
#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#define __dead __volatile
#define __pure __const
#endif
#endif
/* Delete pseudo-keywords wherever they are not available or needed. */
#ifndef __dead
#define __dead
#define __pure
#endif
#endif /* !_CDEFS_H_ */

View File

@@ -0,0 +1,65 @@
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)extern.h 8.4 (Berkeley) 6/16/94
*/
BUFHEAD *__add_ovflpage (HTAB *, BUFHEAD *);
int __addel (HTAB *, BUFHEAD *, const DBT *, const DBT *);
int __big_delete (HTAB *, BUFHEAD *);
int __big_insert (HTAB *, BUFHEAD *, const DBT *, const DBT *);
int __big_keydata (HTAB *, BUFHEAD *, DBT *, DBT *, int);
int __big_return (HTAB *, BUFHEAD *, int, DBT *, int);
int __big_split (HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *,
uint32, uint32, SPLIT_RETURN *);
int __buf_free (HTAB *, int, int);
void __buf_init (HTAB *, int);
uint32 __call_hash (HTAB *, char *, size_t);
int __delpair (HTAB *, BUFHEAD *, int);
int __expand_table (HTAB *);
int __find_bigpair (HTAB *, BUFHEAD *, int, char *, int);
uint16 __find_last_page (HTAB *, BUFHEAD **);
void __free_ovflpage (HTAB *, BUFHEAD *);
BUFHEAD *__get_buf (HTAB *, uint32, BUFHEAD *, int);
int __get_page (HTAB *, char *, uint32, int, int, int);
int __ibitmap (HTAB *, int, int, int);
uint32 __log2 (uint32);
int __put_page (HTAB *, char *, uint32, int, int);
void __reclaim_buf (HTAB *, BUFHEAD *);
int __split_page (HTAB *, uint32, uint32);
/* Default hash routine. */
extern uint32 (*__default_hash) (const void *, size_t);
#ifdef HASH_STATISTICS
extern int hash_accesses, hash_collisions, hash_expansions, hash_overflows;
#endif

337
mozilla/dbm/include/hash.h Normal file
View File

@@ -0,0 +1,337 @@
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)hash.h 8.3 (Berkeley) 5/31/94
*/
/* Operations */
#include <stdio.h>
#include "mcom_db.h"
typedef enum {
HASH_GET, HASH_PUT, HASH_PUTNEW, HASH_DELETE, HASH_FIRST, HASH_NEXT
} ACTION;
/* Buffer Management structures */
typedef struct _bufhead BUFHEAD;
struct _bufhead {
BUFHEAD *prev; /* LRU links */
BUFHEAD *next; /* LRU links */
BUFHEAD *ovfl; /* Overflow page buffer header */
uint32 addr; /* Address of this page */
char *page; /* Actual page data */
char is_disk;
char flags;
#define BUF_MOD 0x0001
#define BUF_DISK 0x0002
#define BUF_BUCKET 0x0004
#define BUF_PIN 0x0008
};
#define IS_BUCKET(X) ((X) & BUF_BUCKET)
typedef BUFHEAD **SEGMENT;
typedef int DBFILE_PTR;
#define NO_FILE -1
#ifdef macintosh
#define DBFILE_OPEN(path, flag,mode) open((path), flag)
#define EXISTS(path)
#else
#define DBFILE_OPEN(path, flag,mode) open((path), (flag), (mode))
#endif
/* Hash Table Information */
typedef struct hashhdr { /* Disk resident portion */
int32 magic; /* Magic NO for hash tables */
int32 version; /* Version ID */
uint32 lorder; /* Byte Order */
int32 bsize; /* Bucket/Page Size */
int32 bshift; /* Bucket shift */
int32 dsize; /* Directory Size */
int32 ssize; /* Segment Size */
int32 sshift; /* Segment shift */
int32 ovfl_point; /* Where overflow pages are being
* allocated */
int32 last_freed; /* Last overflow page freed */
int32 max_bucket; /* ID of Maximum bucket in use */
int32 high_mask; /* Mask to modulo into entire table */
int32 low_mask; /* Mask to modulo into lower half of
* table */
int32 ffactor; /* Fill factor */
int32 nkeys; /* Number of keys in hash table */
int32 hdrpages; /* Size of table header */
uint32 h_charkey; /* value of hash(CHARKEY) */
#define NCACHED 32 /* number of bit maps and spare
* points */
int32 spares[NCACHED];/* spare pages for overflow */
uint16 bitmaps[NCACHED]; /* address of overflow page
* bitmaps */
} HASHHDR;
typedef struct htab { /* Memory resident data structure */
HASHHDR hdr; /* Header */
int nsegs; /* Number of allocated segments */
int exsegs; /* Number of extra allocated
* segments */
uint32 /* Hash function */
(*hash)(const void *, size_t);
int flags; /* Flag values */
DBFILE_PTR fp; /* File pointer */
char *filename;
char *tmp_buf; /* Temporary Buffer for BIG data */
char *tmp_key; /* Temporary Buffer for BIG keys */
BUFHEAD *cpage; /* Current page */
int cbucket; /* Current bucket */
int cndx; /* Index of next item on cpage */
int dbmerrno; /* Error Number -- for DBM
* compatability */
int new_file; /* Indicates if fd is backing store
* or no */
int save_file; /* Indicates whether we need to flush
* file at
* exit */
uint32 *mapp[NCACHED]; /* Pointers to page maps */
int nmaps; /* Initial number of bitmaps */
int nbufs; /* Number of buffers left to
* allocate */
BUFHEAD bufhead; /* Header of buffer lru list */
SEGMENT *dir; /* Hash Bucket directory */
off_t file_size; /* in bytes */
char is_temp; /* unlink file on close */
char updateEOF; /* force EOF update on flush */
} HTAB;
/*
* Constants
*/
#define DATABASE_CORRUPTED_ERROR -999 /* big ugly abort, delete database */
#define OLD_MAX_BSIZE 65536 /* 2^16 */
#define MAX_BSIZE 32l*1024l /* 2^15 */
#define MIN_BUFFERS 6
#define MINHDRSIZE 512
#define DEF_BUFSIZE 65536l /* 64 K */
#define DEF_BUCKET_SIZE 4096
#define DEF_BUCKET_SHIFT 12 /* log2(BUCKET) */
#define DEF_SEGSIZE 256
#define DEF_SEGSIZE_SHIFT 8 /* log2(SEGSIZE) */
#define DEF_DIRSIZE 256
#define DEF_FFACTOR 65536l
#define MIN_FFACTOR 4
#define SPLTMAX 8
#define CHARKEY "%$sniglet^&"
#define NUMKEY 1038583l
#define BYTE_SHIFT 3
#define INT_TO_BYTE 2
#define INT_BYTE_SHIFT 5
#define ALL_SET ((uint32)0xFFFFFFFF)
#define ALL_CLEAR 0
#define PTROF(X) ((ptrdiff_t)(X) == BUF_DISK ? 0 : (X))
#define ISDISK(X) ((X) ? ((ptrdiff_t)(X) == BUF_DISK ? BUF_DISK \
: (X)->is_disk) : 0)
#define BITS_PER_MAP 32
/* Given the address of the beginning of a big map, clear/set the nth bit */
#define CLRBIT(A, N) ((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))
#define SETBIT(A, N) ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
#define ISSET(A, N) ((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
/* Overflow management */
/*
* Overflow page numbers are allocated per split point. At each doubling of
* the table, we can allocate extra pages. So, an overflow page number has
* the top 5 bits indicate which split point and the lower 11 bits indicate
* which page at that split point is indicated (pages within split points are
* numberered starting with 1).
*/
#define SPLITSHIFT 11
#define SPLITMASK 0x7FF
#define SPLITNUM(N) (((uint32)(N)) >> SPLITSHIFT)
#define OPAGENUM(N) ((N) & SPLITMASK)
#define OADDR_OF(S,O) ((uint32)((uint32)(S) << SPLITSHIFT) + (O))
#define BUCKET_TO_PAGE(B) \
(B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__log2((uint32)((B)+1))-1] : 0)
#define OADDR_TO_PAGE(B) \
BUCKET_TO_PAGE ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B));
/*
* page.h contains a detailed description of the page format.
*
* Normally, keys and data are accessed from offset tables in the top of
* each page which point to the beginning of the key and data. There are
* four flag values which may be stored in these offset tables which indicate
* the following:
*
*
* OVFLPAGE Rather than a key data pair, this pair contains
* the address of an overflow page. The format of
* the pair is:
* OVERFLOW_PAGE_NUMBER OVFLPAGE
*
* PARTIAL_KEY This must be the first key/data pair on a page
* and implies that page contains only a partial key.
* That is, the key is too big to fit on a single page
* so it starts on this page and continues on the next.
* The format of the page is:
* KEY_OFF PARTIAL_KEY OVFL_PAGENO OVFLPAGE
*
* KEY_OFF -- offset of the beginning of the key
* PARTIAL_KEY -- 1
* OVFL_PAGENO - page number of the next overflow page
* OVFLPAGE -- 0
*
* FULL_KEY This must be the first key/data pair on the page. It
* is used in two cases.
*
* Case 1:
* There is a complete key on the page but no data
* (because it wouldn't fit). The next page contains
* the data.
*
* Page format it:
* KEY_OFF FULL_KEY OVFL_PAGENO OVFL_PAGE
*
* KEY_OFF -- offset of the beginning of the key
* FULL_KEY -- 2
* OVFL_PAGENO - page number of the next overflow page
* OVFLPAGE -- 0
*
* Case 2:
* This page contains no key, but part of a large
* data field, which is continued on the next page.
*
* Page format it:
* DATA_OFF FULL_KEY OVFL_PAGENO OVFL_PAGE
*
* KEY_OFF -- offset of the beginning of the data on
* this page
* FULL_KEY -- 2
* OVFL_PAGENO - page number of the next overflow page
* OVFLPAGE -- 0
*
* FULL_KEY_DATA
* This must be the first key/data pair on the page.
* There are two cases:
*
* Case 1:
* This page contains a key and the beginning of the
* data field, but the data field is continued on the
* next page.
*
* Page format is:
* KEY_OFF FULL_KEY_DATA OVFL_PAGENO DATA_OFF
*
* KEY_OFF -- offset of the beginning of the key
* FULL_KEY_DATA -- 3
* OVFL_PAGENO - page number of the next overflow page
* DATA_OFF -- offset of the beginning of the data
*
* Case 2:
* This page contains the last page of a big data pair.
* There is no key, only the tail end of the data
* on this page.
*
* Page format is:
* DATA_OFF FULL_KEY_DATA <OVFL_PAGENO> <OVFLPAGE>
*
* DATA_OFF -- offset of the beginning of the data on
* this page
* FULL_KEY_DATA -- 3
* OVFL_PAGENO - page number of the next overflow page
* OVFLPAGE -- 0
*
* OVFL_PAGENO and OVFLPAGE are optional (they are
* not present if there is no next page).
*/
#define OVFLPAGE 0
#define PARTIAL_KEY 1
#define FULL_KEY 2
#define FULL_KEY_DATA 3
#define REAL_KEY 4
/* Short hands for accessing structure */
#undef BSIZE
#define BSIZE hdr.bsize
#undef BSHIFT
#define BSHIFT hdr.bshift
#define DSIZE hdr.dsize
#define SGSIZE hdr.ssize
#define SSHIFT hdr.sshift
#define LORDER hdr.lorder
#define OVFL_POINT hdr.ovfl_point
#define LAST_FREED hdr.last_freed
#define MAX_BUCKET hdr.max_bucket
#define FFACTOR hdr.ffactor
#define HIGH_MASK hdr.high_mask
#define LOW_MASK hdr.low_mask
#define NKEYS hdr.nkeys
#define HDRPAGES hdr.hdrpages
#define SPARES hdr.spares
#define BITMAPS hdr.bitmaps
#define VERSION hdr.version
#define MAGIC hdr.magic
#define NEXT_FREE hdr.next_free
#define H_CHARKEY hdr.h_charkey
extern uint32 (*__default_hash) (const void *, size_t);
void __buf_init(HTAB *hashp, int32 nbytes);
int __big_delete(HTAB *hashp, BUFHEAD *bufp);
BUFHEAD * __get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage);
uint32 __call_hash(HTAB *hashp, char *k, size_t len);
#include "page.h"
extern int __big_split(HTAB *hashp, BUFHEAD *op,BUFHEAD *np,
BUFHEAD *big_keyp,uint32 addr,uint32 obucket, SPLIT_RETURN *ret);
void __free_ovflpage(HTAB *hashp, BUFHEAD *obufp);
BUFHEAD * __add_ovflpage(HTAB *hashp, BUFHEAD *bufp);
int __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val);
int __expand_table(HTAB *hashp);
uint32 __log2(uint32 num);
void __reclaim_buf(HTAB *hashp, BUFHEAD *bp);
int __get_page(HTAB *hashp, char * p, uint32 bucket, int is_bucket, int is_disk, int is_bitmap);
int __put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap);
int __ibitmap(HTAB *hashp, int pnum, int nbits, int ndx);
int __buf_free(HTAB *hashp, int do_free, int to_disk);
int __find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size);
uint16 __find_last_page(HTAB *hashp, BUFHEAD **bpp);
int __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT * val);
int __big_return(HTAB *hashp, BUFHEAD *bufp, int ndx, DBT *val, int set_current);
int __delpair(HTAB *hashp, BUFHEAD *bufp, int ndx);
int __big_keydata(HTAB *hashp, BUFHEAD *bufp, DBT *key, DBT *val, int set);
int __split_page(HTAB *hashp, uint32 obucket, uint32 nbucket);

View File

@@ -0,0 +1,51 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)search.h 8.1 (Berkeley) 6/4/93
*/
/* Backward compatibility to hsearch interface. */
typedef struct entry {
char *key;
char *data;
} ENTRY;
typedef enum {
FIND, ENTER
} ACTION;
int hcreate (unsigned int);
void hdestroy (void);
ENTRY *hsearch (ENTRY, ACTION);

View File

@@ -0,0 +1,463 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)db.h 8.7 (Berkeley) 6/16/94
*/
#ifndef _DB_H_
#define _DB_H_
#ifdef WINCE
#define off_t long
#endif
#ifndef macintosh
#include <sys/types.h>
#endif
#include "prtypes.h"
#include <limits.h>
#ifdef __DBINTERFACE_PRIVATE
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#else
#include "cdefs.h"
#endif
#ifdef HAVE_SYS_BYTEORDER_H
#include <sys/byteorder.h>
#endif
#if defined(__linux) || defined(__BEOS__)
#include <endian.h>
#ifndef BYTE_ORDER
#define BYTE_ORDER __BYTE_ORDER
#define BIG_ENDIAN __BIG_ENDIAN
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#endif
#endif /* __linux */
#ifdef __sgi
#define BYTE_ORDER BIG_ENDIAN
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
#endif
#ifdef __sun
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
#ifndef __SVR4
/* compat.h is only in 4.1.3 machines. - dp */
#include <compat.h>
#endif
/* XXX - dp
* Need to find a general way of defining endian-ness in SunOS 5.3
* SunOS 5.4 defines _BIG_ENDIAN and _LITTLE_ENDIAN
* SunOS 5.3 does nothing like this.
*/
#ifndef BYTE_ORDER
#if defined(_BIG_ENDIAN)
#define BYTE_ORDER BIG_ENDIAN
#elif defined(_LITTLE_ENDIAN)
#define BYTE_ORDER LITTLE_ENDIAN
#elif !defined(__SVR4)
/* 4.1.3 is always BIG_ENDIAN as it was released only on sparc platforms. */
#define BYTE_ORDER BIG_ENDIAN
#elif !defined(vax) && !defined(ntohl) && !defined(lint) && !defined(i386)
/* 5.3 big endian. Copied this above line from sys/byteorder.h */
/* Now we are in a 5.3 SunOS rather non 5.4 or above SunOS */
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#endif /* !BYTE_ORDER */
#endif /* __sun */
#if defined(__hpux) || defined(__hppa)
#define BYTE_ORDER BIG_ENDIAN
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
#endif
#if defined(AIXV3) || defined(AIX)
/* BYTE_ORDER, LITTLE_ENDIAN, BIG_ENDIAN are all defined here */
#include <sys/machine.h>
#endif
/* Digital Unix */
#ifdef __osf__
#include <machine/endian.h>
#endif
#ifdef __alpha
#ifndef WIN32
#else
/* Alpha NT */
#define BYTE_ORDER LITTLE_ENDIAN
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234
#endif
#endif
#ifdef NCR
#include <sys/endian.h>
#endif
#ifdef __QNX__
#ifdef __QNXNTO__
#include <sys/param.h>
#else
#define LITTLE_ENDIAN 1234
#define BIG_ENDIAN 4321
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#endif
#ifdef SNI
/* #include <sys/hetero.h> */
#define BYTE_ORDER BIG_ENDIAN
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234
#endif
#if defined(_WINDOWS) || defined(XP_OS2_VACPP)
#ifdef BYTE_ORDER
#undef BYTE_ORDER
#endif
#define BYTE_ORDER LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
#define BIG_ENDIAN 4321
#endif
#ifdef macintosh
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234
#define BYTE_ORDER BIG_ENDIAN
#endif
#endif /* __DBINTERFACE_PRIVATE */
#ifdef SCO
#define MAXPATHLEN 1024
#endif
#include <fcntl.h>
#if defined(_WINDOWS) || defined(XP_OS2)
#include <stdio.h>
#include <io.h>
#ifndef XP_OS2
#define MAXPATHLEN 1024
#endif
#ifdef XP_OS2_VACPP
#include <os2.h>
#define MAXPATHLEN CCHMAXPATH
#define EPERM EINVAL
#define ENOTDIR EBADPOS
#define S_ISDIR(s) ((s) & S_IFDIR)
#endif
#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
#ifndef STDERR_FILENO
#define STDIN_FILENO 0 /* ANSI C #defines */
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#endif
#ifndef O_ACCMODE /* POSIX 1003.1 access mode mask. */
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
#endif
#endif
#ifdef macintosh
#include <stdio.h>
#include "xp_mcom.h"
#define O_ACCMODE 3 /* Mask for file access modes */
#define EFTYPE 2000
PR_BEGIN_EXTERN_C
int mkstemp(const char *path);
PR_END_EXTERN_C
#endif /* MACINTOSH */
#if !defined(_WINDOWS) && !defined(macintosh)
#include <sys/stat.h>
#include <errno.h>
#endif
/* define EFTYPE since most don't */
#ifndef EFTYPE
#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
#endif
#define RET_ERROR -1 /* Return values. */
#define RET_SUCCESS 0
#define RET_SPECIAL 1
#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
#ifndef __sgi
typedef uint32 pgno_t;
#endif
#define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */
typedef uint16 indx_t;
#define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */
typedef uint32 recno_t;
/* Key/data structure -- a Data-Base Thang. */
typedef struct {
void *data; /* data */
size_t size; /* data length */
} DBT;
/* Routine flags. */
#define R_CURSOR 1 /* del, put, seq */
#define __R_UNUSED 2 /* UNUSED */
#define R_FIRST 3 /* seq */
#define R_IAFTER 4 /* put (RECNO) */
#define R_IBEFORE 5 /* put (RECNO) */
#define R_LAST 6 /* seq (BTREE, RECNO) */
#define R_NEXT 7 /* seq */
#define R_NOOVERWRITE 8 /* put */
#define R_PREV 9 /* seq (BTREE, RECNO) */
#define R_SETCURSOR 10 /* put (RECNO) */
#define R_RECNOSYNC 11 /* sync (RECNO) */
typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
typedef enum { LockOutDatabase, UnlockDatabase } DBLockFlagEnum;
/*
* !!!
* The following flags are included in the dbopen(3) call as part of the
* open(2) flags. In order to avoid conflicts with the open flags, start
* at the top of the 16 or 32-bit number space and work our way down. If
* the open flags were significantly expanded in the future, it could be
* a problem. Wish I'd left another flags word in the dbopen call.
*
* !!!
* None of this stuff is implemented yet. The only reason that it's here
* is so that the access methods can skip copying the key/data pair when
* the DB_LOCK flag isn't set.
*/
#if UINT_MAX > 65535
#define DB_LOCK 0x20000000 /* Do locking. */
#define DB_SHMEM 0x40000000 /* Use shared memory. */
#define DB_TXN 0x80000000 /* Do transactions. */
#else
#define DB_LOCK 0x2000 /* Do locking. */
#define DB_SHMEM 0x4000 /* Use shared memory. */
#define DB_TXN 0x8000 /* Do transactions. */
#endif
/* Access method description structure. */
typedef struct __db {
DBTYPE type; /* Underlying db type. */
int (*close) (struct __db *);
int (*del) (const struct __db *, const DBT *, uint);
int (*get) (const struct __db *, const DBT *, DBT *, uint);
int (*put) (const struct __db *, DBT *, const DBT *, uint);
int (*seq) (const struct __db *, DBT *, DBT *, uint);
int (*sync) (const struct __db *, uint);
void *internal; /* Access method private. */
int (*fd) (const struct __db *);
} DB;
#define BTREEMAGIC 0x053162
#define BTREEVERSION 3
/* Structure used to pass parameters to the btree routines. */
typedef struct {
#define R_DUP 0x01 /* duplicate keys */
uint32 flags;
uint cachesize; /* bytes to cache */
int maxkeypage; /* maximum keys per page */
int minkeypage; /* minimum keys per page */
uint psize; /* page size */
int (*compare) /* comparison function */
(const DBT *, const DBT *);
size_t (*prefix) /* prefix function */
(const DBT *, const DBT *);
int lorder; /* byte order */
} BTREEINFO;
#define HASHMAGIC 0x061561
#define HASHVERSION 2
/* Structure used to pass parameters to the hashing routines. */
typedef struct {
uint bsize; /* bucket size */
uint ffactor; /* fill factor */
uint nelem; /* number of elements */
uint cachesize; /* bytes to cache */
uint32 /* hash function */
(*hash) (const void *, size_t);
int lorder; /* byte order */
} HASHINFO;
/* Structure used to pass parameters to the record routines. */
typedef struct {
#define R_FIXEDLEN 0x01 /* fixed-length records */
#define R_NOKEY 0x02 /* key not required */
#define R_SNAPSHOT 0x04 /* snapshot the input */
uint32 flags;
uint cachesize; /* bytes to cache */
uint psize; /* page size */
int lorder; /* byte order */
size_t reclen; /* record length (fixed-length records) */
uint8 bval; /* delimiting byte (variable-length records */
char *bfname; /* btree file name */
} RECNOINFO;
#ifdef __DBINTERFACE_PRIVATE
/*
* Little endian <==> big endian 32-bit swap macros.
* M_32_SWAP swap a memory location
* P_32_SWAP swap a referenced memory location
* P_32_COPY swap from one location to another
*/
#define M_32_SWAP(a) { \
uint32 _tmp = a; \
((char *)&a)[0] = ((char *)&_tmp)[3]; \
((char *)&a)[1] = ((char *)&_tmp)[2]; \
((char *)&a)[2] = ((char *)&_tmp)[1]; \
((char *)&a)[3] = ((char *)&_tmp)[0]; \
}
#define P_32_SWAP(a) { \
uint32 _tmp = *(uint32 *)a; \
((char *)a)[0] = ((char *)&_tmp)[3]; \
((char *)a)[1] = ((char *)&_tmp)[2]; \
((char *)a)[2] = ((char *)&_tmp)[1]; \
((char *)a)[3] = ((char *)&_tmp)[0]; \
}
#define P_32_COPY(a, b) { \
((char *)&(b))[0] = ((char *)&(a))[3]; \
((char *)&(b))[1] = ((char *)&(a))[2]; \
((char *)&(b))[2] = ((char *)&(a))[1]; \
((char *)&(b))[3] = ((char *)&(a))[0]; \
}
/*
* Little endian <==> big endian 16-bit swap macros.
* M_16_SWAP swap a memory location
* P_16_SWAP swap a referenced memory location
* P_16_COPY swap from one location to another
*/
#define M_16_SWAP(a) { \
uint16 _tmp = a; \
((char *)&a)[0] = ((char *)&_tmp)[1]; \
((char *)&a)[1] = ((char *)&_tmp)[0]; \
}
#define P_16_SWAP(a) { \
uint16 _tmp = *(uint16 *)a; \
((char *)a)[0] = ((char *)&_tmp)[1]; \
((char *)a)[1] = ((char *)&_tmp)[0]; \
}
#define P_16_COPY(a, b) { \
((char *)&(b))[0] = ((char *)&(a))[1]; \
((char *)&(b))[1] = ((char *)&(a))[0]; \
}
#endif
PR_BEGIN_EXTERN_C
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
extern DB *
#else
PR_EXTERN(DB *)
#endif
dbopen (const char *, int, int, DBTYPE, const void *);
/* set or unset a global lock flag to disable the
* opening of any DBM file
*/
void dbSetOrClearDBLock(DBLockFlagEnum type);
#ifdef __DBINTERFACE_PRIVATE
DB *__bt_open (const char *, int, int, const BTREEINFO *, int);
DB *__hash_open (const char *, int, int, const HASHINFO *, int);
DB *__rec_open (const char *, int, int, const RECNOINFO *, int);
void __dbpanic (DB *dbp);
#endif
PR_END_EXTERN_C
#endif /* !_DB_H_ */

View File

@@ -0,0 +1,99 @@
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)mpool.h 8.2 (Berkeley) 7/14/94
*/
#include <sys/queue.h>
/*
* The memory pool scheme is a simple one. Each in-memory page is referenced
* by a bucket which is threaded in up to two of three ways. All active pages
* are threaded on a hash chain (hashed by page number) and an lru chain.
* Inactive pages are threaded on a free chain. Each reference to a memory
* pool is handed an opaque MPOOL cookie which stores all of this information.
*/
#define HASHSIZE 128
#define HASHKEY(pgno) ((pgno - 1) % HASHSIZE)
/* The BKT structures are the elements of the queues. */
typedef struct _bkt {
CIRCLEQ_ENTRY(_bkt) hq; /* hash queue */
CIRCLEQ_ENTRY(_bkt) q; /* lru queue */
void *page; /* page */
pgno_t pgno; /* page number */
#define MPOOL_DIRTY 0x01 /* page needs to be written */
#define MPOOL_PINNED 0x02 /* page is pinned into memory */
uint8 flags; /* flags */
} BKT;
typedef struct MPOOL {
CIRCLEQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */
/* hash queue array */
CIRCLEQ_HEAD(_hqh, _bkt) hqh[HASHSIZE];
pgno_t curcache; /* current number of cached pages */
pgno_t maxcache; /* max number of cached pages */
pgno_t npages; /* number of pages in the file */
uint32 pagesize; /* file page size */
int fd; /* file descriptor */
/* page in conversion routine */
void (*pgin) (void *, pgno_t, void *);
/* page out conversion routine */
void (*pgout) (void *, pgno_t, void *);
void *pgcookie; /* cookie for page in/out routines */
#ifdef STATISTICS
uint32 cachehit;
uint32 cachemiss;
uint32 pagealloc;
uint32 pageflush;
uint32 pageget;
uint32 pagenew;
uint32 pageput;
uint32 pageread;
uint32 pagewrite;
#endif
} MPOOL;
__BEGIN_DECLS
MPOOL *mpool_open (void *, int, pgno_t, pgno_t);
void mpool_filter (MPOOL *, void (*)(void *, pgno_t, void *),
void (*)(void *, pgno_t, void *), void *);
void *mpool_new (MPOOL *, pgno_t *);
void *mpool_get (MPOOL *, pgno_t, uint);
int mpool_put (MPOOL *, void *, uint);
int mpool_sync (MPOOL *);
int mpool_close (MPOOL *);
#ifdef STATISTICS
void mpool_stat (MPOOL *);
#endif
__END_DECLS

View File

@@ -0,0 +1,232 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)compat.h 8.13 (Berkeley) 2/21/94
*/
#ifndef _COMPAT_H_
#define _COMPAT_H_
#include <sys/types.h>
/*
* If your system doesn't typedef u_long, u_short, or u_char, change
* the 0 to a 1.
*/
#if 0
typedef unsigned char u_char; /* 4.[34]BSD names. */
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned short u_short;
#endif
/* If your system doesn't typedef size_t, change the 0 to a 1. */
#if 0
typedef unsigned int size_t; /* POSIX, 4.[34]BSD names. */
#endif
/* If your system doesn't typedef ssize_t, change the 0 to a 1. */
#if 0
typedef int ssize_t; /* POSIX names. */
#endif
/*
* If your system doesn't have the POSIX type for a signal mask,
* change the 0 to a 1.
*/
#if 0 /* POSIX 1003.1 signal mask type. */
typedef unsigned int sigset_t;
#endif
/*
* If your system's vsprintf returns a char *, not an int,
* change the 0 to a 1.
*/
#if defined (__sun) && !defined(__SVR4) /* SUNOS */
#define VSPRINTF_CHARSTAR
#endif
/*
* If you don't have POSIX 1003.1 signals, the signal code surrounding the
* temporary file creation is intended to block all of the possible signals
* long enough to create the file and unlink it. All of this stuff is
* intended to use old-style BSD calls to fake POSIX 1003.1 calls.
*/
#ifdef NO_POSIX_SIGNALS
#define sigemptyset(set) (*(set) = 0)
#define sigfillset(set) (*(set) = ~(sigset_t)0, 0)
#define sigaddset(set,signo) (*(set) |= sigmask(signo), 0)
#define sigdelset(set,signo) (*(set) &= ~sigmask(signo), 0)
#define sigismember(set,signo) ((*(set) & sigmask(signo)) != 0)
#define SIG_BLOCK 1
#define SIG_UNBLOCK 2
#define SIG_SETMASK 3
static int __sigtemp; /* For the use of sigprocmask */
/* Repeated test of oset != NULL is to avoid "*0". */
#define sigprocmask(how, set, oset) \
((__sigtemp = \
(((how) == SIG_BLOCK) ? \
sigblock(0) | *(set) : \
(((how) == SIG_UNBLOCK) ? \
sigblock(0) & ~(*(set)) : \
((how) == SIG_SETMASK ? \
*(set) : sigblock(0))))), \
((oset) ? (*(oset ? oset : set) = sigsetmask(__sigtemp)) : \
sigsetmask(__sigtemp)), 0)
#endif
/*
* If your system doesn't have an include file with the appropriate
* byte order set, make sure you specify the correct one.
*/
#ifndef BYTE_ORDER
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define BYTE_ORDER BIG_ENDIAN /* Set for your system. */
#endif
#if defined(SYSV) || defined(SYSTEM5) || defined(__sun)
#define index(a, b) strchr(a, b)
#define rindex(a, b) strrchr(a, b)
#define bzero(a, b) memset(a, 0, b)
#define bcmp(a, b, n) memcmp(a, b, n)
#define bcopy(a, b, n) memmove(b, a, n)
#endif
#if defined(BSD) || defined(BSD4_3)
#define strchr(a, b) index(a, b)
#define strrchr(a, b) rindex(a, b)
#define memcmp(a, b, n) bcmp(a, b, n)
#define memmove(a, b, n) bcopy(b, a, n)
#endif
/*
* 32-bit machine. The db routines are theoretically independent of
* the size of u_shorts and u_longs, but I don't know that anyone has
* ever actually tried it. At a minimum, change the following #define's
* if you are trying to compile on a different type of system.
*/
#ifndef USHRT_MAX
#define USHRT_MAX 0xFFFF
#define ULONG_MAX 0xFFFFFFFF
#endif
#ifndef O_ACCMODE /* POSIX 1003.1 access mode mask. */
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
#endif
#ifndef _POSIX2_RE_DUP_MAX /* POSIX 1003.2 RE limit. */
#define _POSIX2_RE_DUP_MAX 255
#endif
/*
* If you can't provide lock values in the open(2) call. Note, this
* allows races to happen.
*/
#ifndef O_EXLOCK /* 4.4BSD extension. */
#define O_EXLOCK 0
#endif
#ifndef O_SHLOCK /* 4.4BSD extension. */
#define O_SHLOCK 0
#endif
#ifndef EFTYPE
#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
#endif
#ifndef WCOREDUMP /* 4.4BSD extension */
#define WCOREDUMP(a) 0
#endif
#ifndef STDERR_FILENO
#define STDIN_FILENO 0 /* ANSI C #defines */
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#endif
#ifndef SEEK_END
#define SEEK_SET 0 /* POSIX 1003.1 seek values */
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#ifndef _POSIX_VDISABLE /* POSIX 1003.1 disabling char. */
#define _POSIX_VDISABLE 0 /* Some systems used 0. */
#endif
#ifndef TCSASOFT /* 4.4BSD extension. */
#define TCSASOFT 0
#endif
#ifndef _POSIX2_RE_DUP_MAX /* POSIX 1003.2 values. */
#define _POSIX2_RE_DUP_MAX 255
#endif
#ifndef NULL /* ANSI C #defines NULL everywhere. */
#define NULL 0
#endif
#ifndef MAX /* Usually found in <sys/param.h>. */
#define MAX(_a,_b) ((_a)<(_b)?(_b):(_a))
#endif
#ifndef MIN /* Usually found in <sys/param.h>. */
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
#endif
/* Default file permissions. */
#ifndef DEFFILEMODE /* 4.4BSD extension. */
#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
#endif
#ifndef __sun
#ifndef S_ISDIR /* POSIX 1003.1 file type tests. */
#define S_ISDIR(m) ((m & 0170000) == 0040000) /* directory */
#define S_ISCHR(m) ((m & 0170000) == 0020000) /* char special */
#define S_ISBLK(m) ((m & 0170000) == 0060000) /* block special */
#define S_ISREG(m) ((m & 0170000) == 0100000) /* regular file */
#define S_ISFIFO(m) ((m & 0170000) == 0010000) /* fifo */
#endif
#ifndef S_ISLNK /* BSD POSIX 1003.1 extensions */
#define S_ISLNK(m) ((m & 0170000) == 0120000) /* symbolic link */
#define S_ISSOCK(m) ((m & 0170000) == 0140000) /* socket */
#endif
#endif /* __sun */
/* The type of a va_list. */
#ifndef _BSD_VA_LIST_ /* 4.4BSD #define. */
#define _BSD_VA_LIST_ char *
#endif
#endif /* !_COMPAT_H_ */

View File

@@ -0,0 +1,77 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ndbm.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _NDBM_H_
#define _NDBM_H_
#include "mcom_db.h"
/* Map dbm interface onto db(3). */
#define DBM_RDONLY O_RDONLY
/* Flags to dbm_store(). */
#define DBM_INSERT 0
#define DBM_REPLACE 1
/*
* The db(3) support for ndbm(3) always appends this suffix to the
* file name to avoid overwriting the user's original database.
*/
#define DBM_SUFFIX ".db"
typedef struct {
char *dptr;
int dsize;
} datum;
typedef DB DBM;
#define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE
__BEGIN_DECLS
void dbm_close (DBM *);
int dbm_delete (DBM *, datum);
datum dbm_fetch (DBM *, datum);
datum dbm_firstkey (DBM *);
long dbm_forder (DBM *, datum);
datum dbm_nextkey (DBM *);
DBM *dbm_open (const char *, int, int);
int dbm_store (DBM *, datum, datum, int);
int dbm_dirfno (DBM *);
__END_DECLS
#endif /* !_NDBM_H_ */

View File

@@ -0,0 +1,41 @@
#ifndef NSRES_H
#define NSRES_H
#include "mcom_db.h"
__BEGIN_DECLS
/* C version */
#define NSRESHANDLE void *
typedef void (*NSRESTHREADFUNC)(void *);
typedef struct NSRESTHREADINFO
{
void *lock;
NSRESTHREADFUNC fn_lock;
NSRESTHREADFUNC fn_unlock;
} NSRESTHREADINFO;
#define MAXBUFNUM 10
#define MAXSTRINGLEN 300
#define NSRES_CREATE 1
#define NSRES_OPEN 2
NSRESHANDLE NSResCreateTable(const char *filename, NSRESTHREADINFO *threadinfo);
NSRESHANDLE NSResOpenTable(const char *filename, NSRESTHREADINFO *threadinfo);
void NSResCloseTable(NSRESHANDLE handle);
char *NSResLoadString(NSRESHANDLE handle, const char * library, int32 id,
unsigned int charsetid, char *retbuf);
int32 NSResGetSize(NSRESHANDLE handle, const char *library, int32 id);
int32 NSResLoadResource(NSRESHANDLE handle, const char *library, int32 id, char *retbuf);
int NSResAddString(NSRESHANDLE handle, const char *library, int32 id, const char *string, unsigned int charset);
__END_DECLS
#endif

View File

@@ -0,0 +1,96 @@
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)page.h 8.2 (Berkeley) 5/31/94
*/
/*
* Definitions for hashing page file format.
*/
/*
* routines dealing with a data page
*
* page format:
* +------------------------------+
* p | n | keyoff | datoff | keyoff |
* +------------+--------+--------+
* | datoff | free | ptr | --> |
* +--------+---------------------+
* | F R E E A R E A |
* +--------------+---------------+
* | <---- - - - | data |
* +--------+-----+----+----------+
* | key | data | key |
* +--------+----------+----------+
*
* Pointer to the free space is always: p[p[0] + 2]
* Amount of free space on the page is: p[p[0] + 1]
*/
/*
* How many bytes required for this pair?
* 2 shorts in the table at the top of the page + room for the
* key and room for the data
*
* We prohibit entering a pair on a page unless there is also room to append
* an overflow page. The reason for this it that you can get in a situation
* where a single key/data pair fits on a page, but you can't append an
* overflow page and later you'd have to split the key/data and handle like
* a big pair.
* You might as well do this up front.
*/
#ifndef PAGE_H
#define PAGE_H
#define PAIRSIZE(K,D) (2*sizeof(uint16) + (K)->size + (D)->size)
#define BIGOVERHEAD (4*sizeof(uint16))
#define KEYSIZE(K) (4*sizeof(uint16) + (K)->size);
#define OVFLSIZE (2*sizeof(uint16))
#define FREESPACE(P) ((P)[(P)[0]+1])
#define OFFSET(P) ((P)[(P)[0]+2])
#define PAIRFITS(P,K,D) \
(((P)[2] >= REAL_KEY) && \
(PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P)))
#define PAGE_META(N) (((N)+3) * sizeof(uint16))
typedef struct {
BUFHEAD *newp;
BUFHEAD *oldp;
BUFHEAD *nextp;
uint16 next_addr;
} SPLIT_RETURN;
#endif

245
mozilla/dbm/include/queue.h Normal file
View File

@@ -0,0 +1,245 @@
/*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)queue.h 8.3 (Berkeley) 12/13/93
*/
#ifndef _QUEUE_H_
#define _QUEUE_H_
/*
* This file defines three types of data structures: lists, tail queues,
* and circular queues.
*
* A list is headed by a single forward pointer (or an array of forward
* pointers for a hash table header). The elements are doubly linked
* so that an arbitrary element can be removed without a need to
* traverse the list. New elements can be added to the list after
* an existing element or at the head of the list. A list may only be
* traversed in the forward direction.
*
* A tail queue is headed by a pair of pointers, one to the head of the
* list and the other to the tail of the list. The elements are doubly
* linked so that an arbitrary element can be removed without a need to
* traverse the list. New elements can be added to the list after
* an existing element, at the head of the list, or at the end of the
* list. A tail queue may only be traversed in the forward direction.
*
* A circle queue is headed by a pair of pointers, one to the head of the
* list and the other to the tail of the list. The elements are doubly
* linked so that an arbitrary element can be removed without a need to
* traverse the list. New elements can be added to the list before or after
* an existing element, at the head of the list, or at the end of the list.
* A circle queue may be traversed in either direction, but has a more
* complex end of list detection.
*
* For details on the use of these macros, see the queue(3) manual page.
*/
/*
* List definitions.
*/
#define LIST_HEAD(name, type) \
struct name { \
struct type *lh_first; /* first element */ \
}
#define LIST_ENTRY(type) \
struct { \
struct type *le_next; /* next element */ \
struct type **le_prev; /* address of previous next element */ \
}
/*
* List functions.
*/
#define LIST_INIT(head) { \
(head)->lh_first = NULL; \
}
#define LIST_INSERT_AFTER(listelm, elm, field) { \
if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
(listelm)->field.le_next->field.le_prev = \
&(elm)->field.le_next; \
(listelm)->field.le_next = (elm); \
(elm)->field.le_prev = &(listelm)->field.le_next; \
}
#define LIST_INSERT_HEAD(head, elm, field) { \
if (((elm)->field.le_next = (head)->lh_first) != NULL) \
(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
(head)->lh_first = (elm); \
(elm)->field.le_prev = &(head)->lh_first; \
}
#define LIST_REMOVE(elm, field) { \
if ((elm)->field.le_next != NULL) \
(elm)->field.le_next->field.le_prev = \
(elm)->field.le_prev; \
*(elm)->field.le_prev = (elm)->field.le_next; \
}
/*
* Tail queue definitions.
*/
#define TAILQ_HEAD(name, type) \
struct name { \
struct type *tqh_first; /* first element */ \
struct type **tqh_last; /* addr of last next element */ \
}
#define TAILQ_ENTRY(type) \
struct { \
struct type *tqe_next; /* next element */ \
struct type **tqe_prev; /* address of previous next element */ \
}
/*
* Tail queue functions.
*/
#define TAILQ_INIT(head) { \
(head)->tqh_first = NULL; \
(head)->tqh_last = &(head)->tqh_first; \
}
#define TAILQ_INSERT_HEAD(head, elm, field) { \
if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
(elm)->field.tqe_next->field.tqe_prev = \
&(elm)->field.tqe_next; \
else \
(head)->tqh_last = &(elm)->field.tqe_next; \
(head)->tqh_first = (elm); \
(elm)->field.tqe_prev = &(head)->tqh_first; \
}
#define TAILQ_INSERT_TAIL(head, elm, field) { \
(elm)->field.tqe_next = NULL; \
(elm)->field.tqe_prev = (head)->tqh_last; \
*(head)->tqh_last = (elm); \
(head)->tqh_last = &(elm)->field.tqe_next; \
}
#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
(elm)->field.tqe_next->field.tqe_prev = \
&(elm)->field.tqe_next; \
else \
(head)->tqh_last = &(elm)->field.tqe_next; \
(listelm)->field.tqe_next = (elm); \
(elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
}
#define TAILQ_REMOVE(head, elm, field) { \
if (((elm)->field.tqe_next) != NULL) \
(elm)->field.tqe_next->field.tqe_prev = \
(elm)->field.tqe_prev; \
else \
(head)->tqh_last = (elm)->field.tqe_prev; \
*(elm)->field.tqe_prev = (elm)->field.tqe_next; \
}
/*
* Circular queue definitions.
*/
#define CIRCLEQ_HEAD(name, type) \
struct name { \
struct type *cqh_first; /* first element */ \
struct type *cqh_last; /* last element */ \
}
#define CIRCLEQ_ENTRY(type) \
struct { \
struct type *cqe_next; /* next element */ \
struct type *cqe_prev; /* previous element */ \
}
/*
* Circular queue functions.
*/
#define CIRCLEQ_INIT(head) { \
(head)->cqh_first = (void *)(head); \
(head)->cqh_last = (void *)(head); \
}
#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
(elm)->field.cqe_next = (listelm)->field.cqe_next; \
(elm)->field.cqe_prev = (listelm); \
if ((listelm)->field.cqe_next == (void *)(head)) \
(head)->cqh_last = (elm); \
else \
(listelm)->field.cqe_next->field.cqe_prev = (elm); \
(listelm)->field.cqe_next = (elm); \
}
#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
(elm)->field.cqe_next = (listelm); \
(elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
if ((listelm)->field.cqe_prev == (void *)(head)) \
(head)->cqh_first = (elm); \
else \
(listelm)->field.cqe_prev->field.cqe_next = (elm); \
(listelm)->field.cqe_prev = (elm); \
}
#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
(elm)->field.cqe_next = (head)->cqh_first; \
(elm)->field.cqe_prev = (void *)(head); \
if ((head)->cqh_last == (void *)(head)) \
(head)->cqh_last = (elm); \
else \
(head)->cqh_first->field.cqe_prev = (elm); \
(head)->cqh_first = (elm); \
}
#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
(elm)->field.cqe_next = (void *)(head); \
(elm)->field.cqe_prev = (head)->cqh_last; \
if ((head)->cqh_first == (void *)(head)) \
(head)->cqh_first = (elm); \
else \
(head)->cqh_last->field.cqe_next = (elm); \
(head)->cqh_last = (elm); \
}
#define CIRCLEQ_REMOVE(head, elm, field) { \
if ((elm)->field.cqe_next == (void *)(head)) \
(head)->cqh_last = (elm)->field.cqe_prev; \
else \
(elm)->field.cqe_next->field.cqe_prev = \
(elm)->field.cqe_prev; \
if ((elm)->field.cqe_prev == (void *)(head)) \
(head)->cqh_first = (elm)->field.cqe_next; \
else \
(elm)->field.cqe_prev->field.cqe_next = \
(elm)->field.cqe_next; \
}
#endif /* !_QUEUE_H_ */

View File

@@ -0,0 +1,51 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)search.h 8.1 (Berkeley) 6/4/93
*/
/* Backward compatibility to hsearch interface. */
typedef struct entry {
char *key;
char *data;
} ENTRY;
typedef enum {
FIND, ENTER
} ACTION;
int hcreate (unsigned int);
void hdestroy (void);
ENTRY *hsearch (ENTRY, ACTION);

View File

@@ -0,0 +1,26 @@
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
#ifndef __WATCOM_FIX_H__
#define __WATCOM_FIX_H__ 1
/*
* WATCOM's C compiler doesn't default to "__cdecl" conventions for external
* symbols and functions. Rather than adding an explicit __cdecl modifier to
* every external symbol and function declaration and definition, we use the
* following pragma to (attempt to) change WATCOM c's default to __cdecl.
* These pragmas were taken from pages 180-181, 266 & 269 of the
* Watcom C/C++ version 11 User's Guide, 3rd edition.
*/
#if defined(XP_WIN16) || defined(WIN16)
#pragma aux default "_*" \
parm caller [] \
value struct float struct routine [ax] \
modify [ax bx cx dx es]
#else
#pragma aux default "_*" \
parm caller [] \
value struct float struct routine [eax] \
modify [eax ecx edx]
#endif
#pragma aux default far
#endif /* once */
#endif /* WATCOM compiler */

View File

@@ -0,0 +1,112 @@
/* ---------------------------------------------------------------------------
Stuff to fake unix file I/O on windows boxes
------------------------------------------------------------------------*/
#ifndef WINFILE_H
#define WINFILE_H
#ifdef _WINDOWS
/* hacked out of <dirent.h> on an SGI */
#if defined(XP_WIN32) || defined(_WIN32)
/* 32-bit stuff here */
#include <windows.h>
#include <stdlib.h>
#ifdef __MINGW32__
#include <sys/types.h>
#include <sys/stat.h>
#else
#include <sys\types.h>
#include <sys\stat.h>
#endif
typedef struct DIR_Struct {
void * directoryPtr;
WIN32_FIND_DATA data;
} DIR;
#define _ST_FSTYPSZ 16
#if !defined(__BORLANDC__) && !defined(__GNUC__)
typedef unsigned long mode_t;
typedef long uid_t;
typedef long gid_t;
#ifdef WINCE
typedef long ino_t;
#else
typedef long off_t;
#endif
typedef unsigned long nlink_t;
#endif
typedef struct timestruc {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
} timestruc_t;
struct dirent { /* data from readdir() */
ino_t d_ino; /* inode number of entry */
off_t d_off; /* offset of disk direntory entry */
unsigned short d_reclen; /* length of this record */
char d_name[_MAX_FNAME]; /* name of file */
};
#if !defined(__BORLANDC__) && !defined (__GNUC__)
#define S_ISDIR(s) ((s) & _S_IFDIR)
#endif
#else /* _WIN32 */
/* 16-bit windows stuff */
#include <sys\types.h>
#include <sys\stat.h>
#include <dos.h>
/* Getting cocky to support multiple file systems */
typedef struct dirStruct_tag {
struct _find_t file_data;
char c_checkdrive;
} dirStruct;
typedef struct DIR_Struct {
void * directoryPtr;
dirStruct data;
} DIR;
#define _ST_FSTYPSZ 16
typedef unsigned long mode_t;
typedef long uid_t;
typedef long gid_t;
typedef long off_t;
typedef unsigned long nlink_t;
typedef struct timestruc {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
} timestruc_t;
struct dirent { /* data from readdir() */
ino_t d_ino; /* inode number of entry */
off_t d_off; /* offset of disk direntory entry */
unsigned short d_reclen; /* length of this record */
#ifdef XP_WIN32
char d_name[_MAX_FNAME]; /* name of file */
#else
char d_name[20]; /* name of file */
#endif
};
#define S_ISDIR(s) ((s) & _S_IFDIR)
#endif /* 16-bit windows */
#define CONST const
#endif /* _WINDOWS */
#endif /* WINFILE_H */

View File

@@ -0,0 +1,79 @@
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = mozdbm_s
LIB_IS_C_ONLY = 1
ifeq ($(OS_ARCH),WINNT)
LIBRARY_NAME = dbm$(MOZ_BITS)
endif
CSRCS = \
db.c \
h_bigkey.c \
h_func.c \
h_log2.c \
h_page.c \
hash.c \
hash_buf.c \
hsearch.c \
mktemp.c \
ndbm.c \
strerror.c \
nsres.c \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
CSRCS += memmove.c snprintf.c
else
ifeq (,$(filter -DHAVE_MEMMOVE=1,$(ACDEFINES)))
CSRCS += memmove.c
endif
ifeq (,$(filter -DHAVE_SNPRINTF=1,$(ACDEFINES)))
CSRCS += snprintf.c
endif
endif # WINNT
LOCAL_INCLUDES = -I$(srcdir)/../include
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
include $(topsrcdir)/config/rules.mk
DEFINES += -DMEMMOVE -D__DBINTERFACE_PRIVATE $(SECURITY_FLAG)
ifeq ($(OS_ARCH),WINCE)
DEFINES += -D__STDC__ -DDBM_REOPEN_ON_FLUSH
endif
ifeq ($(OS_ARCH),AIX)
OS_LIBS += -lc_r
endif

View File

@@ -0,0 +1,96 @@
# The contents of this file are subject to the Netscape 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/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#//------------------------------------------------------------------------
#//
#// Makefile to build the cert library
#//
#//------------------------------------------------------------------------
!if "$(MOZ_BITS)" == "16"
!ifndef MOZ_DEBUG
OPTIMIZER=-Os -UDEBUG -DNDEBUG
!endif
!endif
#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH= ..\..
!ifndef MAKE_OBJ_TYPE
MAKE_OBJ_TYPE=EXE
!endif
#//------------------------------------------------------------------------
#//
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
#//
#//------------------------------------------------------------------------
LIBNAME=dbm$(MOZ_BITS)
PDBFILE=$(LIBNAME).pdb
#//------------------------------------------------------------------------
#//
#// Define the files necessary to build the target (ie. OBJS)
#//
#//------------------------------------------------------------------------
OBJS= \
.\$(OBJDIR)\db.obj \
.\$(OBJDIR)\h_bigkey.obj \
.\$(OBJDIR)\h_func.obj \
.\$(OBJDIR)\h_log2.obj \
.\$(OBJDIR)\h_page.obj \
.\$(OBJDIR)\hash.obj \
.\$(OBJDIR)\hash_buf.obj \
.\$(OBJDIR)\hsearch.obj \
.\$(OBJDIR)\memmove.obj \
.\$(OBJDIR)\mktemp.obj \
.\$(OBJDIR)\ndbm.obj \
.\$(OBJDIR)\snprintf.obj \
.\$(OBJDIR)\strerror.obj \
.\$(OBJDIR)\nsres.obj \
$(NULL)
#//------------------------------------------------------------------------
#//
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
#// (these must be defined before the common makefiles are included)
#//
#//------------------------------------------------------------------------
LIBRARY = .\$(OBJDIR)\$(LIBNAME).lib
LINCS = -I..\include
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>
CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT -D__DBINTERFACE_PRIVATE
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib

144
mozilla/dbm/src/db.c Normal file
View File

@@ -0,0 +1,144 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
#ifndef __DBINTERFACE_PRIVATE
#define __DBINTERFACE_PRIVATE
#endif
#ifdef macintosh
#include <unix.h>
#else
#include <sys/types.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include "mcom_db.h"
/* a global flag that locks closed all databases */
int all_databases_locked_closed = 0;
/* set or unset a global lock flag to disable the
* opening of any DBM file
*/
void
dbSetOrClearDBLock(DBLockFlagEnum type)
{
if(type == LockOutDatabase)
all_databases_locked_closed = 1;
else
all_databases_locked_closed = 0;
}
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
DB *
#else
PR_IMPLEMENT(DB *)
#endif
dbopen(const char *fname, int flags,int mode, DBTYPE type, const void *openinfo)
{
/* lock out all file databases. Let in-memory databases through
*/
if(all_databases_locked_closed && fname)
{
errno = EINVAL;
return(NULL);
}
#define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN)
#if 0 /* most systems dont have EXLOCK and SHLOCK */
#define USE_OPEN_FLAGS \
(O_CREAT | O_EXCL | O_EXLOCK | O_NONBLOCK | O_RDONLY | \
O_RDWR | O_SHLOCK | O_TRUNC)
#else
#define USE_OPEN_FLAGS \
(O_CREAT | O_EXCL | O_RDONLY | \
O_RDWR | O_TRUNC)
#endif
if ((flags & ~(USE_OPEN_FLAGS | DB_FLAGS)) == 0)
switch (type) {
/* we don't need btree and recno right now */
#if 0
case DB_BTREE:
return (__bt_open(fname, flags & USE_OPEN_FLAGS,
mode, openinfo, flags & DB_FLAGS));
case DB_RECNO:
return (__rec_open(fname, flags & USE_OPEN_FLAGS,
mode, openinfo, flags & DB_FLAGS));
#endif
case DB_HASH:
return (__hash_open(fname, flags & USE_OPEN_FLAGS,
mode, (const HASHINFO *)openinfo, flags & DB_FLAGS));
default:
break;
}
errno = EINVAL;
return (NULL);
}
static int
__dberr()
{
return (RET_ERROR);
}
/*
* __DBPANIC -- Stop.
*
* Parameters:
* dbp: pointer to the DB structure.
*/
void
__dbpanic(DB *dbp)
{
/* The only thing that can succeed is a close. */
dbp->del = (int (*)(const struct __db *, const DBT *, uint))__dberr;
dbp->fd = (int (*)(const struct __db *))__dberr;
dbp->get = (int (*)(const struct __db *, const DBT *, DBT *, uint))__dberr;
dbp->put = (int (*)(const struct __db *, DBT *, const DBT *, uint))__dberr;
dbp->seq = (int (*)(const struct __db *, DBT *, DBT *, uint))__dberr;
dbp->sync = (int (*)(const struct __db *, uint))__dberr;
}

713
mozilla/dbm/src/h_bigkey.c Normal file
View File

@@ -0,0 +1,713 @@
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)hash_bigkey.c 8.3 (Berkeley) 5/31/94";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
/*
* PACKAGE: hash
* DESCRIPTION:
* Big key/data handling for the hashing package.
*
* ROUTINES:
* External
* __big_keydata
* __big_split
* __big_insert
* __big_return
* __big_delete
* __find_last_page
* Internal
* collect_key
* collect_data
*/
#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
#include <sys/param.h>
#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef DEBUG
#include <assert.h>
#endif
#include "mcom_db.h"
#include "hash.h"
#include "page.h"
/* #include "extern.h" */
static int collect_key __P((HTAB *, BUFHEAD *, int, DBT *, int));
static int collect_data __P((HTAB *, BUFHEAD *, int, int));
/*
* Big_insert
*
* You need to do an insert and the key/data pair is too big
*
* Returns:
* 0 ==> OK
*-1 ==> ERROR
*/
extern int
__big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val)
{
register uint16 *p;
uint key_size, n, val_size;
uint16 space, move_bytes, off;
char *cp, *key_data, *val_data;
cp = bufp->page; /* Character pointer of p. */
p = (uint16 *)cp;
key_data = (char *)key->data;
key_size = key->size;
val_data = (char *)val->data;
val_size = val->size;
/* First move the Key */
for (space = FREESPACE(p) - BIGOVERHEAD; key_size;
space = FREESPACE(p) - BIGOVERHEAD) {
move_bytes = PR_MIN(space, key_size);
off = OFFSET(p) - move_bytes;
memmove(cp + off, key_data, move_bytes);
key_size -= move_bytes;
key_data += move_bytes;
n = p[0];
p[++n] = off;
p[0] = ++n;
FREESPACE(p) = off - PAGE_META(n);
OFFSET(p) = off;
p[n] = PARTIAL_KEY;
bufp = __add_ovflpage(hashp, bufp);
if (!bufp)
return (-1);
n = p[0];
if (!key_size) {
if (FREESPACE(p)) {
move_bytes = PR_MIN(FREESPACE(p), val_size);
off = OFFSET(p) - move_bytes;
p[n] = off;
memmove(cp + off, val_data, move_bytes);
val_data += move_bytes;
val_size -= move_bytes;
p[n - 2] = FULL_KEY_DATA;
FREESPACE(p) = FREESPACE(p) - move_bytes;
OFFSET(p) = off;
} else
p[n - 2] = FULL_KEY;
}
p = (uint16 *)bufp->page;
cp = bufp->page;
bufp->flags |= BUF_MOD;
}
/* Now move the data */
for (space = FREESPACE(p) - BIGOVERHEAD; val_size;
space = FREESPACE(p) - BIGOVERHEAD) {
move_bytes = PR_MIN(space, val_size);
/*
* Here's the hack to make sure that if the data ends on the
* same page as the key ends, FREESPACE is at least one.
*/
if (space == val_size && val_size == val->size)
move_bytes--;
off = OFFSET(p) - move_bytes;
memmove(cp + off, val_data, move_bytes);
val_size -= move_bytes;
val_data += move_bytes;
n = p[0];
p[++n] = off;
p[0] = ++n;
FREESPACE(p) = off - PAGE_META(n);
OFFSET(p) = off;
if (val_size) {
p[n] = FULL_KEY;
bufp = __add_ovflpage(hashp, bufp);
if (!bufp)
return (-1);
cp = bufp->page;
p = (uint16 *)cp;
} else
p[n] = FULL_KEY_DATA;
bufp->flags |= BUF_MOD;
}
return (0);
}
/*
* Called when bufp's page contains a partial key (index should be 1)
*
* All pages in the big key/data pair except bufp are freed. We cannot
* free bufp because the page pointing to it is lost and we can't get rid
* of its pointer.
*
* Returns:
* 0 => OK
*-1 => ERROR
*/
extern int
__big_delete(HTAB *hashp, BUFHEAD *bufp)
{
register BUFHEAD *last_bfp, *rbufp;
uint16 *bp, pageno;
int key_done, n;
rbufp = bufp;
last_bfp = NULL;
bp = (uint16 *)bufp->page;
pageno = 0;
key_done = 0;
while (!key_done || (bp[2] != FULL_KEY_DATA)) {
if (bp[2] == FULL_KEY || bp[2] == FULL_KEY_DATA)
key_done = 1;
/*
* If there is freespace left on a FULL_KEY_DATA page, then
* the data is short and fits entirely on this page, and this
* is the last page.
*/
if (bp[2] == FULL_KEY_DATA && FREESPACE(bp))
break;
pageno = bp[bp[0] - 1];
rbufp->flags |= BUF_MOD;
rbufp = __get_buf(hashp, pageno, rbufp, 0);
if (last_bfp)
__free_ovflpage(hashp, last_bfp);
last_bfp = rbufp;
if (!rbufp)
return (-1); /* Error. */
bp = (uint16 *)rbufp->page;
}
/*
* If we get here then rbufp points to the last page of the big
* key/data pair. Bufp points to the first one -- it should now be
* empty pointing to the next page after this pair. Can't free it
* because we don't have the page pointing to it.
*/
/* This is information from the last page of the pair. */
n = bp[0];
pageno = bp[n - 1];
/* Now, bp is the first page of the pair. */
bp = (uint16 *)bufp->page;
if (n > 2) {
/* There is an overflow page. */
bp[1] = pageno;
bp[2] = OVFLPAGE;
bufp->ovfl = rbufp->ovfl;
} else
/* This is the last page. */
bufp->ovfl = NULL;
n -= 2;
bp[0] = n;
FREESPACE(bp) = hashp->BSIZE - PAGE_META(n);
OFFSET(bp) = hashp->BSIZE - 1;
bufp->flags |= BUF_MOD;
if (rbufp)
__free_ovflpage(hashp, rbufp);
if (last_bfp != rbufp)
__free_ovflpage(hashp, last_bfp);
hashp->NKEYS--;
return (0);
}
/*
* Returns:
* 0 = key not found
* -1 = get next overflow page
* -2 means key not found and this is big key/data
* -3 error
*/
extern int
__find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size)
{
register uint16 *bp;
register char *p;
int ksize;
uint16 bytes;
char *kkey;
bp = (uint16 *)bufp->page;
p = bufp->page;
ksize = size;
kkey = key;
for (bytes = hashp->BSIZE - bp[ndx];
bytes <= size && bp[ndx + 1] == PARTIAL_KEY;
bytes = hashp->BSIZE - bp[ndx]) {
if (memcmp(p + bp[ndx], kkey, bytes))
return (-2);
kkey += bytes;
ksize -= bytes;
bufp = __get_buf(hashp, bp[ndx + 2], bufp, 0);
if (!bufp)
return (-3);
p = bufp->page;
bp = (uint16 *)p;
ndx = 1;
}
if (bytes != ksize || memcmp(p + bp[ndx], kkey, bytes)) {
#ifdef HASH_STATISTICS
++hash_collisions;
#endif
return (-2);
} else
return (ndx);
}
/*
* Given the buffer pointer of the first overflow page of a big pair,
* find the end of the big pair
*
* This will set bpp to the buffer header of the last page of the big pair.
* It will return the pageno of the overflow page following the last page
* of the pair; 0 if there isn't any (i.e. big pair is the last key in the
* bucket)
*/
extern uint16
__find_last_page(HTAB *hashp, BUFHEAD **bpp)
{
BUFHEAD *bufp;
uint16 *bp, pageno;
uint n;
bufp = *bpp;
bp = (uint16 *)bufp->page;
for (;;) {
n = bp[0];
/*
* This is the last page if: the tag is FULL_KEY_DATA and
* either only 2 entries OVFLPAGE marker is explicit there
* is freespace on the page.
*/
if (bp[2] == FULL_KEY_DATA &&
((n == 2) || (bp[n] == OVFLPAGE) || (FREESPACE(bp))))
break;
/* LJM bound the size of n to reasonable limits
*/
if(n > hashp->BSIZE/sizeof(uint16))
return(0);
pageno = bp[n - 1];
bufp = __get_buf(hashp, pageno, bufp, 0);
if (!bufp)
return (0); /* Need to indicate an error! */
bp = (uint16 *)bufp->page;
}
*bpp = bufp;
if (bp[0] > 2)
return (bp[3]);
else
return (0);
}
/*
* Return the data for the key/data pair that begins on this page at this
* index (index should always be 1).
*/
extern int
__big_return(
HTAB *hashp,
BUFHEAD *bufp,
int ndx,
DBT *val,
int set_current)
{
BUFHEAD *save_p;
uint16 *bp, len, off, save_addr;
char *tp;
int save_flags;
bp = (uint16 *)bufp->page;
while (bp[ndx + 1] == PARTIAL_KEY) {
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!bufp)
return (-1);
bp = (uint16 *)bufp->page;
ndx = 1;
}
if (bp[ndx + 1] == FULL_KEY) {
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!bufp)
return (-1);
bp = (uint16 *)bufp->page;
save_p = bufp;
save_addr = save_p->addr;
off = bp[1];
len = 0;
} else
if (!FREESPACE(bp)) {
/*
* This is a hack. We can't distinguish between
* FULL_KEY_DATA that contains complete data or
* incomplete data, so we require that if the data
* is complete, there is at least 1 byte of free
* space left.
*/
off = bp[bp[0]];
len = bp[1] - off;
save_p = bufp;
save_addr = bufp->addr;
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!bufp)
return (-1);
bp = (uint16 *)bufp->page;
} else {
/* The data is all on one page. */
tp = (char *)bp;
off = bp[bp[0]];
val->data = (uint8 *)tp + off;
val->size = bp[1] - off;
if (set_current) {
if (bp[0] == 2) { /* No more buckets in
* chain */
hashp->cpage = NULL;
hashp->cbucket++;
hashp->cndx = 1;
} else {
hashp->cpage = __get_buf(hashp,
bp[bp[0] - 1], bufp, 0);
if (!hashp->cpage)
return (-1);
hashp->cndx = 1;
if (!((uint16 *)
hashp->cpage->page)[0]) {
hashp->cbucket++;
hashp->cpage = NULL;
}
}
}
return (0);
}
/* pin our saved buf so that we don't lose if
* we run out of buffers */
save_flags = save_p->flags;
save_p->flags |= BUF_PIN;
val->size = collect_data(hashp, bufp, (int)len, set_current);
save_p->flags = save_flags;
if (val->size == (size_t)-1)
return (-1);
if (save_p->addr != save_addr) {
/* We are pretty short on buffers. */
errno = EINVAL; /* OUT OF BUFFERS */
return (-1);
}
memmove(hashp->tmp_buf, (save_p->page) + off, len);
val->data = (uint8 *)hashp->tmp_buf;
return (0);
}
/*
* Count how big the total datasize is by looping through the pages. Then
* allocate a buffer and copy the data in the second loop. NOTE: Our caller
* may already have a bp which it is holding onto. The caller is
* responsible for copying that bp into our temp buffer. 'len' is how much
* space to reserve for that buffer.
*/
static int
collect_data(
HTAB *hashp,
BUFHEAD *bufp,
int len, int set)
{
register uint16 *bp;
BUFHEAD *save_bufp;
int save_flags;
int mylen, totlen;
/*
* save the input buf head because we need to walk the list twice.
* pin it to make sure it doesn't leave the buffer pool.
* This has the effect of growing the buffer pool if necessary.
*/
save_bufp = bufp;
save_flags = save_bufp->flags;
save_bufp->flags |= BUF_PIN;
/* read the length of the buffer */
for (totlen = len; bufp ; bufp = __get_buf(hashp, bp[bp[0]-1], bufp, 0)) {
bp = (uint16 *)bufp->page;
mylen = hashp->BSIZE - bp[1];
/* if mylen ever goes negative it means that the
* page is screwed up.
*/
if (mylen < 0) {
save_bufp->flags = save_flags;
return (-1);
}
totlen += mylen;
if (bp[2] == FULL_KEY_DATA) { /* End of Data */
break;
}
}
if (!bufp) {
save_bufp->flags = save_flags;
return (-1);
}
/* allocate a temp buf */
if (hashp->tmp_buf)
free(hashp->tmp_buf);
if ((hashp->tmp_buf = (char *)malloc((size_t)totlen)) == NULL) {
save_bufp->flags = save_flags;
return (-1);
}
/* copy the buffers back into temp buf */
for (bufp = save_bufp; bufp ;
bufp = __get_buf(hashp, bp[bp[0]-1], bufp, 0)) {
bp = (uint16 *)bufp->page;
mylen = hashp->BSIZE - bp[1];
memmove(&hashp->tmp_buf[len], (bufp->page) + bp[1], (size_t)mylen);
len += mylen;
if (bp[2] == FULL_KEY_DATA) {
break;
}
}
/* 'clear' the pin flags */
save_bufp->flags = save_flags;
/* update the database cursor */
if (set) {
hashp->cndx = 1;
if (bp[0] == 2) { /* No more buckets in chain */
hashp->cpage = NULL;
hashp->cbucket++;
} else {
hashp->cpage = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!hashp->cpage)
return (-1);
else if (!((uint16 *)hashp->cpage->page)[0]) {
hashp->cbucket++;
hashp->cpage = NULL;
}
}
}
return (totlen);
}
/*
* Fill in the key and data for this big pair.
*/
extern int
__big_keydata(
HTAB *hashp,
BUFHEAD *bufp,
DBT *key, DBT *val,
int set)
{
key->size = collect_key(hashp, bufp, 0, val, set);
if (key->size == (size_t)-1)
return (-1);
key->data = (uint8 *)hashp->tmp_key;
return (0);
}
/*
* Count how big the total key size is by recursing through the pages. Then
* collect the data, allocate a buffer and copy the key as you recurse up.
*/
static int
collect_key(
HTAB *hashp,
BUFHEAD *bufp,
int len,
DBT *val,
int set)
{
BUFHEAD *xbp;
char *p;
int mylen, totlen;
uint16 *bp, save_addr;
p = bufp->page;
bp = (uint16 *)p;
mylen = hashp->BSIZE - bp[1];
save_addr = bufp->addr;
totlen = len + mylen;
if (bp[2] == FULL_KEY || bp[2] == FULL_KEY_DATA) { /* End of Key. */
if (hashp->tmp_key != NULL)
free(hashp->tmp_key);
if ((hashp->tmp_key = (char *)malloc((size_t)totlen)) == NULL)
return (-1);
if (__big_return(hashp, bufp, 1, val, set))
return (-1);
} else {
xbp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
if (!xbp || ((totlen =
collect_key(hashp, xbp, totlen, val, set)) < 1))
return (-1);
}
if (bufp->addr != save_addr) {
errno = EINVAL; /* MIS -- OUT OF BUFFERS */
return (-1);
}
memmove(&hashp->tmp_key[len], (bufp->page) + bp[1], (size_t)mylen);
return (totlen);
}
/*
* Returns:
* 0 => OK
* -1 => error
*/
extern int
__big_split(
HTAB *hashp,
BUFHEAD *op, /* Pointer to where to put keys that go in old bucket */
BUFHEAD *np, /* Pointer to new bucket page */
/* Pointer to first page containing the big key/data */
BUFHEAD *big_keyp,
uint32 addr, /* Address of big_keyp */
uint32 obucket,/* Old Bucket */
SPLIT_RETURN *ret)
{
register BUFHEAD *tmpp;
register uint16 *tp;
BUFHEAD *bp;
DBT key, val;
uint32 change;
uint16 free_space, n, off;
bp = big_keyp;
/* Now figure out where the big key/data goes */
if (__big_keydata(hashp, big_keyp, &key, &val, 0))
return (-1);
change = (__call_hash(hashp,(char*) key.data, key.size) != obucket);
if ((ret->next_addr = __find_last_page(hashp, &big_keyp))) {
if (!(ret->nextp =
__get_buf(hashp, ret->next_addr, big_keyp, 0)))
return (-1);;
} else
ret->nextp = NULL;
/* Now make one of np/op point to the big key/data pair */
#ifdef DEBUG
assert(np->ovfl == NULL);
#endif
if (change)
tmpp = np;
else
tmpp = op;
tmpp->flags |= BUF_MOD;
#ifdef DEBUG1
(void)fprintf(stderr,
"BIG_SPLIT: %d->ovfl was %d is now %d\n", tmpp->addr,
(tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0));
#endif
tmpp->ovfl = bp; /* one of op/np point to big_keyp */
tp = (uint16 *)tmpp->page;
#if 0 /* this get's tripped on database corrupted error */
assert(FREESPACE(tp) >= OVFLSIZE);
#endif
if(FREESPACE(tp) < OVFLSIZE)
return(DATABASE_CORRUPTED_ERROR);
n = tp[0];
off = OFFSET(tp);
free_space = FREESPACE(tp);
tp[++n] = (uint16)addr;
tp[++n] = OVFLPAGE;
tp[0] = n;
OFFSET(tp) = off;
FREESPACE(tp) = free_space - OVFLSIZE;
/*
* Finally, set the new and old return values. BIG_KEYP contains a
* pointer to the last page of the big key_data pair. Make sure that
* big_keyp has no following page (2 elements) or create an empty
* following page.
*/
ret->newp = np;
ret->oldp = op;
tp = (uint16 *)big_keyp->page;
big_keyp->flags |= BUF_MOD;
if (tp[0] > 2) {
/*
* There may be either one or two offsets on this page. If
* there is one, then the overflow page is linked on normally
* and tp[4] is OVFLPAGE. If there are two, tp[4] contains
* the second offset and needs to get stuffed in after the
* next overflow page is added.
*/
n = tp[4];
free_space = FREESPACE(tp);
off = OFFSET(tp);
tp[0] -= 2;
FREESPACE(tp) = free_space + OVFLSIZE;
OFFSET(tp) = off;
tmpp = __add_ovflpage(hashp, big_keyp);
if (!tmpp)
return (-1);
tp[4] = n;
} else
tmpp = big_keyp;
if (change)
ret->newp = tmpp;
else
ret->oldp = tmpp;
return (0);
}

211
mozilla/dbm/src/h_func.c Normal file
View File

@@ -0,0 +1,211 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)hash_func.c 8.2 (Berkeley) 2/21/94";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
#ifndef macintosh
#include <sys/types.h>
#endif
#include "mcom_db.h"
#include "hash.h"
#include "page.h"
/* #include "extern.h" */
#if 0
static uint32 hash1 __P((const void *, size_t));
static uint32 hash2 __P((const void *, size_t));
static uint32 hash3 __P((const void *, size_t));
#endif
static uint32 hash4 __P((const void *, size_t));
/* Global default hash function */
uint32 (*__default_hash) __P((const void *, size_t)) = hash4;
/*
* HASH FUNCTIONS
*
* Assume that we've already split the bucket to which this key hashes,
* calculate that bucket, and check that in fact we did already split it.
*
* This came from ejb's hsearch.
*/
#define PRIME1 37
#define PRIME2 1048583
#if 0
static uint32
hash1(const void *keyarg, register size_t len)
{
register const uint8 *key;
register uint32 h;
/* Convert string to integer */
for (key = (const uint8 *)keyarg, h = 0; len--;)
h = h * PRIME1 ^ (*key++ - ' ');
h %= PRIME2;
return (h);
}
/*
* Phong's linear congruential hash
*/
#define dcharhash(h, c) ((h) = 0x63c63cd9*(h) + 0x9c39c33d + (c))
static uint32
hash2(const void *keyarg, size_t len)
{
register const uint8 *e, *key;
register uint32 h;
register uint8 c;
key = (const uint8 *)keyarg;
e = key + len;
for (h = 0; key != e;) {
c = *key++;
if (!c && key > e)
break;
dcharhash(h, c);
}
return (h);
}
/*
* This is INCREDIBLY ugly, but fast. We break the string up into 8 byte
* units. On the first time through the loop we get the "leftover bytes"
* (strlen % 8). On every other iteration, we perform 8 HASHC's so we handle
* all 8 bytes. Essentially, this saves us 7 cmp & branch instructions. If
* this routine is heavily used enough, it's worth the ugly coding.
*
* OZ's original sdbm hash
*/
static uint32
hash3(const void *keyarg, register size_t len)
{
register const uint8 *key;
register size_t loop;
register uint32 h;
#define HASHC h = *key++ + 65599 * h
h = 0;
key = (const uint8 *)keyarg;
if (len > 0) {
loop = (len + 8 - 1) >> 3;
switch (len & (8 - 1)) {
case 0:
do {
HASHC;
/* FALLTHROUGH */
case 7:
HASHC;
/* FALLTHROUGH */
case 6:
HASHC;
/* FALLTHROUGH */
case 5:
HASHC;
/* FALLTHROUGH */
case 4:
HASHC;
/* FALLTHROUGH */
case 3:
HASHC;
/* FALLTHROUGH */
case 2:
HASHC;
/* FALLTHROUGH */
case 1:
HASHC;
} while (--loop);
}
}
return (h);
}
#endif /* 0 */
/* Hash function from Chris Torek. */
static uint32
hash4(const void *keyarg, register size_t len)
{
register const uint8 *key;
register size_t loop;
register uint32 h;
#define HASH4a h = (h << 5) - h + *key++;
#define HASH4b h = (h << 5) + h + *key++;
#define HASH4 HASH4b
h = 0;
key = (const uint8 *)keyarg;
if (len > 0) {
loop = (len + 8 - 1) >> 3;
switch (len & (8 - 1)) {
case 0:
do {
HASH4;
/* FALLTHROUGH */
case 7:
HASH4;
/* FALLTHROUGH */
case 6:
HASH4;
/* FALLTHROUGH */
case 5:
HASH4;
/* FALLTHROUGH */
case 4:
HASH4;
/* FALLTHROUGH */
case 3:
HASH4;
/* FALLTHROUGH */
case 2:
HASH4;
/* FALLTHROUGH */
case 1:
HASH4;
} while (--loop);
}
}
return (h);
}

56
mozilla/dbm/src/h_log2.c Normal file
View File

@@ -0,0 +1,56 @@
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
#include <stdio.h>
#ifndef macintosh
#include <sys/types.h>
#endif
#include "mcom_db.h"
uint32 __log2(uint32 num)
{
register uint32 i, limit;
limit = 1;
for (i = 0; limit < num; limit = limit << 1, i++) {}
return (i);
}

1290
mozilla/dbm/src/h_page.c Normal file

File diff suppressed because it is too large Load Diff

1179
mozilla/dbm/src/hash.c Normal file

File diff suppressed because it is too large Load Diff

414
mozilla/dbm/src/hash_buf.c Normal file
View File

@@ -0,0 +1,414 @@
/*-
* Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
/*
* PACKAGE: hash
*
* DESCRIPTION:
* Contains buffer management
*
* ROUTINES:
* External
* __buf_init
* __get_buf
* __buf_free
* __reclaim_buf
* Internal
* newbuf
*/
#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
#include <sys/param.h>
#endif
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef DEBUG
#include <assert.h>
#endif
#include "mcom_db.h"
#include "hash.h"
#include "page.h"
/* #include "extern.h" */
static BUFHEAD *newbuf __P((HTAB *, uint32, BUFHEAD *));
/* Unlink B from its place in the lru */
#define BUF_REMOVE(B) { \
(B)->prev->next = (B)->next; \
(B)->next->prev = (B)->prev; \
}
/* Insert B after P */
#define BUF_INSERT(B, P) { \
(B)->next = (P)->next; \
(B)->prev = (P); \
(P)->next = (B); \
(B)->next->prev = (B); \
}
#define MRU hashp->bufhead.next
#define LRU hashp->bufhead.prev
#define MRU_INSERT(B) BUF_INSERT((B), &hashp->bufhead)
#define LRU_INSERT(B) BUF_INSERT((B), LRU)
/*
* We are looking for a buffer with address "addr". If prev_bp is NULL, then
* address is a bucket index. If prev_bp is not NULL, then it points to the
* page previous to an overflow page that we are trying to find.
*
* CAVEAT: The buffer header accessed via prev_bp's ovfl field may no longer
* be valid. Therefore, you must always verify that its address matches the
* address you are seeking.
*/
extern BUFHEAD *
__get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage)
/* If prev_bp set, indicates a new overflow page. */
{
register BUFHEAD *bp;
register uint32 is_disk_mask;
register int is_disk, segment_ndx = 0;
SEGMENT segp = 0;
is_disk = 0;
is_disk_mask = 0;
if (prev_bp) {
bp = prev_bp->ovfl;
if (!bp || (bp->addr != addr))
bp = NULL;
if (!newpage)
is_disk = BUF_DISK;
} else {
/* Grab buffer out of directory */
segment_ndx = addr & (hashp->SGSIZE - 1);
/* valid segment ensured by __call_hash() */
segp = hashp->dir[addr >> hashp->SSHIFT];
#ifdef DEBUG
assert(segp != NULL);
#endif
bp = PTROF(segp[segment_ndx]);
is_disk_mask = ISDISK(segp[segment_ndx]);
is_disk = is_disk_mask || !hashp->new_file;
}
if (!bp) {
bp = newbuf(hashp, addr, prev_bp);
if (!bp)
return(NULL);
if(__get_page(hashp, bp->page, addr, !prev_bp, is_disk, 0))
{
/* free bp and its page */
if(prev_bp)
{
/* if prev_bp is set then the new page that
* failed is hooked onto prev_bp as an overflow page.
* if we don't remove the pointer to the bad page
* we may try and access it later and we will die
* horribly because it will have already been
* free'd and overwritten with bogus data.
*/
prev_bp->ovfl = NULL;
}
BUF_REMOVE(bp);
free(bp->page);
free(bp);
return (NULL);
}
if (!prev_bp)
{
#if 0
/* 16 bit windows and mac can't handle the
* oring of the is disk flag.
*/
segp[segment_ndx] =
(BUFHEAD *)((ptrdiff_t)bp | is_disk_mask);
#else
/* set the is_disk thing inside the structure
*/
bp->is_disk = is_disk_mask;
segp[segment_ndx] = bp;
#endif
}
} else {
BUF_REMOVE(bp);
MRU_INSERT(bp);
}
return (bp);
}
/*
* We need a buffer for this page. Either allocate one, or evict a resident
* one (if we have as many buffers as we're allowed) and put this one in.
*
* If newbuf finds an error (returning NULL), it also sets errno.
*/
static BUFHEAD *
newbuf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp)
{
register BUFHEAD *bp; /* The buffer we're going to use */
register BUFHEAD *xbp; /* Temp pointer */
register BUFHEAD *next_xbp;
SEGMENT segp;
int segment_ndx;
uint16 oaddr, *shortp;
oaddr = 0;
bp = LRU;
/*
* If LRU buffer is pinned, the buffer pool is too small. We need to
* allocate more buffers.
*/
if (hashp->nbufs || (bp->flags & BUF_PIN)) {
/* Allocate a new one */
if ((bp = (BUFHEAD *)malloc(sizeof(BUFHEAD))) == NULL)
return (NULL);
/* this memset is supposedly unnecessary but lets add
* it anyways.
*/
memset(bp, 0xff, sizeof(BUFHEAD));
if ((bp->page = (char *)malloc((size_t)hashp->BSIZE)) == NULL) {
free(bp);
return (NULL);
}
/* this memset is supposedly unnecessary but lets add
* it anyways.
*/
memset(bp->page, 0xff, (size_t)hashp->BSIZE);
if (hashp->nbufs)
hashp->nbufs--;
} else {
/* Kick someone out */
BUF_REMOVE(bp);
/*
* If this is an overflow page with addr 0, it's already been
* flushed back in an overflow chain and initialized.
*/
if ((bp->addr != 0) || (bp->flags & BUF_BUCKET)) {
/*
* Set oaddr before __put_page so that you get it
* before bytes are swapped.
*/
shortp = (uint16 *)bp->page;
if (shortp[0])
{
if(shortp[0] > (hashp->BSIZE / sizeof(uint16)))
{
return(NULL);
}
oaddr = shortp[shortp[0] - 1];
}
if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
bp->addr, (int)IS_BUCKET(bp->flags), 0))
return (NULL);
/*
* Update the pointer to this page (i.e. invalidate it).
*
* If this is a new file (i.e. we created it at open
* time), make sure that we mark pages which have been
* written to disk so we retrieve them from disk later,
* rather than allocating new pages.
*/
if (IS_BUCKET(bp->flags)) {
segment_ndx = bp->addr & (hashp->SGSIZE - 1);
segp = hashp->dir[bp->addr >> hashp->SSHIFT];
#ifdef DEBUG
assert(segp != NULL);
#endif
if (hashp->new_file &&
((bp->flags & BUF_MOD) ||
ISDISK(segp[segment_ndx])))
segp[segment_ndx] = (BUFHEAD *)BUF_DISK;
else
segp[segment_ndx] = NULL;
}
/*
* Since overflow pages can only be access by means of
* their bucket, free overflow pages associated with
* this bucket.
*/
for (xbp = bp; xbp->ovfl;) {
next_xbp = xbp->ovfl;
xbp->ovfl = 0;
xbp = next_xbp;
/* leave pinned pages alone, we are still using
* them. */
if (xbp->flags & BUF_PIN) {
continue;
}
/* Check that ovfl pointer is up date. */
if (IS_BUCKET(xbp->flags) ||
(oaddr != xbp->addr))
break;
shortp = (uint16 *)xbp->page;
if (shortp[0])
{
/* LJM is the number of reported
* pages way too much?
*/
if(shortp[0] > hashp->BSIZE/sizeof(uint16))
return NULL;
/* set before __put_page */
oaddr = shortp[shortp[0] - 1];
}
if ((xbp->flags & BUF_MOD) && __put_page(hashp,
xbp->page, xbp->addr, 0, 0))
return (NULL);
xbp->addr = 0;
xbp->flags = 0;
BUF_REMOVE(xbp);
LRU_INSERT(xbp);
}
}
}
/* Now assign this buffer */
bp->addr = addr;
#ifdef DEBUG1
(void)fprintf(stderr, "NEWBUF1: %d->ovfl was %d is now %d\n",
bp->addr, (bp->ovfl ? bp->ovfl->addr : 0), 0);
#endif
bp->ovfl = NULL;
if (prev_bp) {
/*
* If prev_bp is set, this is an overflow page, hook it in to
* the buffer overflow links.
*/
#ifdef DEBUG1
(void)fprintf(stderr, "NEWBUF2: %d->ovfl was %d is now %d\n",
prev_bp->addr, (prev_bp->ovfl ? bp->ovfl->addr : 0),
(bp ? bp->addr : 0));
#endif
prev_bp->ovfl = bp;
bp->flags = 0;
} else
bp->flags = BUF_BUCKET;
MRU_INSERT(bp);
return (bp);
}
extern void __buf_init(HTAB *hashp, int32 nbytes)
{
BUFHEAD *bfp;
int npages;
bfp = &(hashp->bufhead);
npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT;
npages = PR_MAX(npages, MIN_BUFFERS);
hashp->nbufs = npages;
bfp->next = bfp;
bfp->prev = bfp;
/*
* This space is calloc'd so these are already null.
*
* bfp->ovfl = NULL;
* bfp->flags = 0;
* bfp->page = NULL;
* bfp->addr = 0;
*/
}
extern int
__buf_free(HTAB *hashp, int do_free, int to_disk)
{
BUFHEAD *bp;
int status = -1;
/* Need to make sure that buffer manager has been initialized */
if (!LRU)
return (0);
for (bp = LRU; bp != &hashp->bufhead;) {
/* Check that the buffer is valid */
if (bp->addr || IS_BUCKET(bp->flags)) {
if (to_disk && (bp->flags & BUF_MOD) &&
(status = __put_page(hashp, bp->page,
bp->addr, IS_BUCKET(bp->flags), 0))) {
if (do_free) {
if (bp->page)
free(bp->page);
BUF_REMOVE(bp);
free(bp);
}
return (status);
}
}
/* Check if we are freeing stuff */
if (do_free) {
if (bp->page)
free(bp->page);
BUF_REMOVE(bp);
free(bp);
bp = LRU;
} else
bp = bp->prev;
}
return (0);
}
extern void
__reclaim_buf(HTAB *hashp, BUFHEAD *bp)
{
bp->ovfl = 0;
bp->addr = 0;
bp->flags = 0;
BUF_REMOVE(bp);
LRU_INSERT(bp);
}

108
mozilla/dbm/src/hsearch.c Normal file
View File

@@ -0,0 +1,108 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)hsearch.c 8.4 (Berkeley) 7/21/94";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
#ifndef macintosh
#include <sys/types.h>
#endif
#include <fcntl.h>
#include <string.h>
#include "mcom_db.h"
#include "hsearch.h"
static DB *dbp = NULL;
static ENTRY retval;
extern int
hcreate(uint nel)
{
HASHINFO info;
info.nelem = nel;
info.bsize = 256;
info.ffactor = 8;
info.cachesize = 0;
info.hash = NULL;
info.lorder = 0;
dbp = (DB *)__hash_open(NULL, O_CREAT | O_RDWR, 0600, &info, 0);
return ((int)dbp);
}
extern ENTRY *
hsearch(ENTRY item, ACTION action)
{
DBT key, val;
int status;
if (!dbp)
return (NULL);
key.data = (uint8 *)item.key;
key.size = strlen(item.key) + 1;
if (action == ENTER) {
val.data = (uint8 *)item.data;
val.size = strlen(item.data) + 1;
status = (dbp->put)(dbp, &key, &val, R_NOOVERWRITE);
if (status)
return (NULL);
} else {
/* FIND */
status = (dbp->get)(dbp, &key, &val, 0);
if (status)
return (NULL);
else
item.data = (char *)val.data;
}
retval.key = item.key;
retval.data = item.data;
return (&retval);
}
extern void
hdestroy()
{
if (dbp) {
(void)(dbp->close)(dbp);
dbp = NULL;
}
}

150
mozilla/dbm/src/memmove.c Normal file
View File

@@ -0,0 +1,150 @@
#if defined(__sun) && !defined(__SVR4)
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#else
#include "cdefs.h"
#endif
#include <string.h>
/*
* sizeof(word) MUST BE A POWER OF TWO
* SO THAT wmask BELOW IS ALL ONES
*/
typedef int word; /* "word" used for optimal copy speed */
#define wsize sizeof(word)
#define wmask (wsize - 1)
/*
* Copy a block of memory, handling overlap.
* This is the routine that actually implements
* (the portable versions of) bcopy, memcpy, and memmove.
*/
#ifdef MEMCOPY
void *
memcpy(dst0, src0, length)
#else
#ifdef MEMMOVE
void *
memmove(dst0, src0, length)
#else
void
bcopy(src0, dst0, length)
#endif
#endif
void *dst0;
const void *src0;
register size_t length;
{
register char *dst = dst0;
register const char *src = src0;
register size_t t;
if (length == 0 || dst == src) /* nothing to do */
goto done;
/*
* Macros: loop-t-times; and loop-t-times, t>0
*/
#define TLOOP(s) if (t) TLOOP1(s)
#define TLOOP1(s) do { s; } while (--t)
if ((unsigned long)dst < (unsigned long)src) {
/*
* Copy forward.
*/
t = (int)src; /* only need low bits */
if ((t | (int)dst) & wmask) {
/*
* Try to align operands. This cannot be done
* unless the low bits match.
*/
if ((t ^ (int)dst) & wmask || length < wsize)
t = length;
else
t = wsize - (t & wmask);
length -= t;
TLOOP1(*dst++ = *src++);
}
/*
* Copy whole words, then mop up any trailing bytes.
*/
t = length / wsize;
TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize);
t = length & wmask;
TLOOP(*dst++ = *src++);
} else {
/*
* Copy backwards. Otherwise essentially the same.
* Alignment works as before, except that it takes
* (t&wmask) bytes to align, not wsize-(t&wmask).
*/
src += length;
dst += length;
t = (int)src;
if ((t | (int)dst) & wmask) {
if ((t ^ (int)dst) & wmask || length <= wsize)
t = length;
else
t &= wmask;
length -= t;
TLOOP1(*--dst = *--src);
}
t = length / wsize;
TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src);
t = length & wmask;
TLOOP(*--dst = *--src);
}
done:
#if defined(MEMCOPY) || defined(MEMMOVE)
return (dst0);
#else
return;
#endif
}
#endif /* no __sgi */
/* Some compilers don't like an empty source file. */
static int dummy = 0;

166
mozilla/dbm/src/mktemp.c Normal file
View File

@@ -0,0 +1,166 @@
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
#ifdef macintosh
#include <unix.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#endif
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
#include "mcom_db.h"
#if !defined(_WINDOWS) && !defined(XP_OS2_VACPP)
#include <unistd.h>
#endif
#ifdef XP_OS2_VACPP
#include <process.h>
#endif
#ifdef _WINDOWS
#include <process.h>
#include "winfile.h"
#endif
static int _gettemp(char *path, register int *doopen, int extraFlags);
int
mkstemp(char *path)
{
#ifdef XP_OS2
FILE *temp = tmpfile();
return (temp ? fileno(temp) : -1);
#else
int fd;
return (_gettemp(path, &fd, 0) ? fd : -1);
#endif
}
int
mkstempflags(char *path, int extraFlags)
{
int fd;
return (_gettemp(path, &fd, extraFlags) ? fd : -1);
}
char *
mktemp(char *path)
{
return(_gettemp(path, (int *)NULL, 0) ? path : (char *)NULL);
}
/* NB: This routine modifies its input string, and does not always restore it.
** returns 1 on success, 0 on failure.
*/
static int
_gettemp(char *path, register int *doopen, int extraFlags)
{
#if !defined(_WINDOWS) || defined(_WIN32)
extern int errno;
#endif
register char *start, *trv;
struct stat sbuf;
unsigned int pid;
pid = getpid();
for (trv = path; *trv; ++trv); /* extra X's get set to 0's */
while (*--trv == 'X') {
*trv = (pid % 10) + '0';
pid /= 10;
}
/*
* check the target directory; if you have six X's and it
* doesn't exist this runs for a *very* long time.
*/
for (start = trv + 1;; --trv) {
char saved;
if (trv <= path)
break;
saved = *trv;
if (saved == '/' || saved == '\\') {
int rv;
*trv = '\0';
rv = stat(path, &sbuf);
*trv = saved;
if (rv)
return(0);
if (!S_ISDIR(sbuf.st_mode)) {
errno = ENOTDIR;
return(0);
}
break;
}
}
for (;;) {
if (doopen) {
if ((*doopen =
open(path, O_CREAT|O_EXCL|O_RDWR|extraFlags, 0600)) >= 0)
return(1);
if (errno != EEXIST)
return(0);
}
else if (stat(path, &sbuf))
return(errno == ENOENT ? 1 : 0);
/* tricky little algorithm for backward compatibility */
for (trv = start;;) {
if (!*trv)
return(0);
if (*trv == 'z')
*trv++ = 'a';
else {
if (isdigit(*trv))
*trv = 'a';
else
++*trv;
break;
}
}
}
/*NOTREACHED*/
}

195
mozilla/dbm/src/ndbm.c Normal file
View File

@@ -0,0 +1,195 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Margo Seltzer.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)ndbm.c 8.4 (Berkeley) 7/21/94";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
/*
* This package provides a dbm compatible interface to the new hashing
* package described in db(3).
*/
#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(XP_OS2_VACPP)
#include <sys/param.h>
#endif
#if defined(__linux)
#include <linux/limits.h>
#endif
#include <stdio.h>
#include <string.h>
#include "ndbm.h"
#include "hash.h"
/*
* Returns:
* *DBM on success
* NULL on failure
*/
extern DBM *
dbm_open(const char *file, int flags, int mode)
{
HASHINFO info;
char path[MAXPATHLEN];
info.bsize = 4096;
info.ffactor = 40;
info.nelem = 1;
info.cachesize = 0;
info.hash = NULL;
info.lorder = 0;
(void)strcpy(path, file);
(void)strcat(path, DBM_SUFFIX);
return ((DBM *)__hash_open(path, flags, mode, &info, 0));
}
extern void
dbm_close(DBM *db)
{
(void)(db->close)(db);
}
/*
* Returns:
* DATUM on success
* NULL on failure
*/
extern datum
dbm_fetch(DBM *db, datum key)
{
datum retval;
int status;
status = (db->get)(db, (DBT *)&key, (DBT *)&retval, 0);
if (status) {
retval.dptr = NULL;
retval.dsize = 0;
}
return (retval);
}
/*
* Returns:
* DATUM on success
* NULL on failure
*/
extern datum
dbm_firstkey(DBM *db)
{
int status;
datum retdata, retkey;
status = (db->seq)(db, (DBT *)&retkey, (DBT *)&retdata, R_FIRST);
if (status)
retkey.dptr = NULL;
return (retkey);
}
/*
* Returns:
* DATUM on success
* NULL on failure
*/
extern datum
dbm_nextkey(DBM *db)
{
int status;
datum retdata, retkey;
status = (db->seq)(db, (DBT *)&retkey, (DBT *)&retdata, R_NEXT);
if (status)
retkey.dptr = NULL;
return (retkey);
}
/*
* Returns:
* 0 on success
* <0 failure
*/
extern int
dbm_delete(DBM *db, datum key)
{
int status;
status = (db->del)(db, (DBT *)&key, 0);
if (status)
return (-1);
else
return (0);
}
/*
* Returns:
* 0 on success
* <0 failure
* 1 if DBM_INSERT and entry exists
*/
extern int
dbm_store(DBM *db, datum key, datum content, int flags)
{
return ((db->put)(db, (DBT *)&key, (DBT *)&content,
(flags == DBM_INSERT) ? R_NOOVERWRITE : 0));
}
extern int
dbm_error(DBM *db)
{
HTAB *hp;
hp = (HTAB *)db->internal;
return (hp->dbmerrno);
}
extern int
dbm_clearerr(DBM *db)
{
HTAB *hp;
hp = (HTAB *)db->internal;
hp->dbmerrno = 0;
return (0);
}
extern int
dbm_dirfno(DBM *db)
{
return(((HTAB *)db->internal)->fp);
}

305
mozilla/dbm/src/nsres.c Normal file
View File

@@ -0,0 +1,305 @@
#include "watcomfx.h"
#include "nsres.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct RESDATABASE
{
DB *hdb;
NSRESTHREADINFO *threadinfo;
char * pbuf[MAXBUFNUM];
} ;
typedef struct RESDATABASE * RESHANDLE;
typedef struct STRINGDATA
{
char *str;
unsigned int charsetid;
} STRINGDATA;
typedef unsigned int CHARSETTYPE;
#define RES_LOCK if (hres->threadinfo) hres->threadinfo->fn_lock(hres->threadinfo->lock);
#define RES_UNLOCK if (hres->threadinfo) hres->threadinfo->fn_unlock(hres->threadinfo->lock);
int GenKeyData(const char *library, int32 id, DBT *key);
/*
Right now, the page size used for resource is same as for Navigator cache
database
*/
HASHINFO res_hash_info = {
32*1024,
0,
0,
0,
0, /* 64 * 1024U */
0};
int GenKeyData(const char *library, int32 id, DBT *key)
{
char idstr[10];
static char * strdata = NULL;
size_t len;
if (strdata)
free (strdata);
if (id == 0)
idstr[0] = '\0';
else
{
sprintf(idstr, "%d", id);
/* itoa(id, idstr, 10); */
}
if (library == NULL)
len = strlen(idstr) + 1;
else
len = strlen(library) + strlen(idstr) + 1;
strdata = (char *) malloc (len);
strcpy(strdata, library);
strcat(strdata, idstr);
key->size = len;
key->data = strdata;
return 1;
}
NSRESHANDLE NSResCreateTable(const char *filename, NSRESTHREADINFO *threadinfo)
{
RESHANDLE hres;
int flag;
flag = O_RDWR | O_CREAT;
hres = (RESHANDLE) calloc ( 1, sizeof(struct RESDATABASE) );
if (threadinfo && threadinfo->lock && threadinfo->fn_lock
&& threadinfo->fn_unlock)
{
hres->threadinfo = (NSRESTHREADINFO *) malloc( sizeof(NSRESTHREADINFO) );
hres->threadinfo->lock = threadinfo->lock;
hres->threadinfo->fn_lock = threadinfo->fn_lock;
hres->threadinfo->fn_unlock = threadinfo->fn_unlock;
}
RES_LOCK
hres->hdb = dbopen(filename, flag, 0644, DB_HASH, &res_hash_info);
RES_UNLOCK
if(!hres->hdb)
return NULL;
return (NSRESHANDLE) hres;
}
NSRESHANDLE NSResOpenTable(const char *filename, NSRESTHREADINFO *threadinfo)
{
RESHANDLE hres;
int flag;
flag = O_RDONLY; /* only open database for reading */
hres = (RESHANDLE) calloc ( 1, sizeof(struct RESDATABASE) );
if (threadinfo && threadinfo->lock && threadinfo->fn_lock
&& threadinfo->fn_unlock)
{
hres->threadinfo = (NSRESTHREADINFO *) malloc( sizeof(NSRESTHREADINFO) );
hres->threadinfo->lock = threadinfo->lock;
hres->threadinfo->fn_lock = threadinfo->fn_lock;
hres->threadinfo->fn_unlock = threadinfo->fn_unlock;
}
RES_LOCK
hres->hdb = dbopen(filename, flag, 0644, DB_HASH, &res_hash_info);
RES_UNLOCK
if(!hres->hdb)
return NULL;
return (NSRESHANDLE) hres;
}
void NSResCloseTable(NSRESHANDLE handle)
{
RESHANDLE hres;
int i;
if (handle == NULL)
return;
hres = (RESHANDLE) handle;
RES_LOCK
(*hres->hdb->sync)(hres->hdb, 0);
(*hres->hdb->close)(hres->hdb);
RES_UNLOCK
for (i = 0; i < MAXBUFNUM; i++)
{
if (hres->pbuf[i])
free (hres->pbuf[i]);
}
if (hres->threadinfo)
free (hres->threadinfo);
free (hres);
}
char *NSResLoadString(NSRESHANDLE handle, const char * library, int32 id,
unsigned int charsetid, char *retbuf)
{
int status;
RESHANDLE hres;
DBT key, data;
if (handle == NULL)
return NULL;
hres = (RESHANDLE) handle;
GenKeyData(library, id, &key);
RES_LOCK
status = (*hres->hdb->get)(hres->hdb, &key, &data, 0);
RES_UNLOCK
if (retbuf)
{
memcpy(retbuf, (char *)data.data + sizeof(CHARSETTYPE), data.size - sizeof(CHARSETTYPE));
return retbuf;
}
else
{
static int WhichString = 0;
static int bFirstTime = 1;
char *szLoadedString;
int i;
RES_LOCK
if (bFirstTime) {
for (i = 0; i < MAXBUFNUM; i++)
hres->pbuf[i] = (char *) malloc(MAXSTRINGLEN * sizeof(char));
bFirstTime = 0;
}
szLoadedString = hres->pbuf[WhichString];
WhichString++;
/* reset to 0, if WhichString reaches to the end */
if (WhichString == MAXBUFNUM)
WhichString = 0;
if (status == 0)
memcpy(szLoadedString, (char *) data.data + sizeof(CHARSETTYPE),
data.size - sizeof(CHARSETTYPE));
else
szLoadedString[0] = 0;
RES_UNLOCK
return szLoadedString;
}
}
int32 NSResGetSize(NSRESHANDLE handle, const char *library, int32 id)
{
int status;
RESHANDLE hres;
DBT key, data;
if (handle == NULL)
return 0;
hres = (RESHANDLE) handle;
GenKeyData(library, id, &key);
RES_LOCK
status = (*hres->hdb->get)(hres->hdb, &key, &data, 0);
RES_UNLOCK
return data.size - sizeof(CHARSETTYPE);
}
int32 NSResLoadResource(NSRESHANDLE handle, const char *library, int32 id, char *retbuf)
{
int status;
RESHANDLE hres;
DBT key, data;
if (handle == NULL)
return 0;
hres = (RESHANDLE) handle;
GenKeyData(library, id, &key);
RES_LOCK
status = (*hres->hdb->get)(hres->hdb, &key, &data, 0);
RES_UNLOCK
if (retbuf)
{
memcpy(retbuf, (char *)data.data + sizeof(CHARSETTYPE), data.size - sizeof(CHARSETTYPE));
return data.size;
}
else
return 0;
}
int NSResAddString(NSRESHANDLE handle, const char *library, int32 id,
const char *string, unsigned int charset)
{
int status;
RESHANDLE hres;
DBT key, data;
char * recdata;
if (handle == NULL)
return 0;
hres = (RESHANDLE) handle;
GenKeyData(library, id, &key);
data.size = sizeof(CHARSETTYPE) + (strlen(string) + 1) ;
recdata = (char *) malloc(data.size) ;
/* set charset to the first field of record data */
*((CHARSETTYPE *)recdata) = (CHARSETTYPE)charset;
/* set data field */
memcpy(recdata+sizeof(CHARSETTYPE), string, strlen(string) + 1);
data.data = recdata;
RES_LOCK
status = (*hres->hdb->put)(hres->hdb, &key, &data, 0);
if (recdata)
free(recdata);
RES_UNLOCK
return status;
}

View File

@@ -0,0 +1,75 @@
#ifndef HAVE_SNPRINTF
#include "watcomfx.h"
#include <sys/types.h>
#include <stddef.h>
#include <stdio.h>
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#else
#include "cdefs.h"
#endif
#include "prtypes.h"
#include <ncompat.h>
/* The OS/2 VAC compiler doesn't appear to define __STDC__ and won't let us define it either */
#if defined(__STDC__) || defined(XP_OS2_VACPP)
#include <stdarg.h>
#else
#include <varargs.h>
#endif
int
#if defined(__STDC__) || defined(XP_OS2_VACPP)
snprintf(char *str, size_t n, const char *fmt, ...)
#else
snprintf(str, n, fmt, va_alist)
char *str;
size_t n;
const char *fmt;
va_dcl
#endif
{
va_list ap;
#ifdef VSPRINTF_CHARSTAR
char *rp;
#else
int rval;
#endif
#if defined(__STDC__) || defined(XP_OS2_VACPP)
va_start(ap, fmt);
#else
va_start(ap);
#endif
#ifdef VSPRINTF_CHARSTAR
rp = vsprintf(str, fmt, ap);
va_end(ap);
return (strlen(rp));
#else
rval = vsprintf(str, fmt, ap);
va_end(ap);
return (rval);
#endif
}
int
vsnprintf(str, n, fmt, ap)
char *str;
size_t n;
const char *fmt;
va_list ap;
{
#ifdef VSPRINTF_CHARSTAR
return (strlen(vsprintf(str, fmt, ap)));
#else
return (vsprintf(str, fmt, ap));
#endif
}
#endif /* HAVE_SNPRINTF */
/* Some compilers don't like an empty source file. */
static int dummy = 0;

View File

@@ -0,0 +1,78 @@
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include "watcomfx.h"
#include <string.h>
#ifdef _DLL
#define sys_nerr (*_sys_nerr_dll)
#endif
#ifndef HAVE_STRERROR
#ifndef _AFXDLL
char *
strerror(num)
int num;
{
extern int sys_nerr;
extern char *sys_errlist[];
#define UPREFIX "Unknown error: "
static char ebuf[40] = UPREFIX; /* 64-bit number + slop */
register unsigned int errnum;
register char *p, *t;
char tmp[40];
errnum = num; /* convert to unsigned */
if (errnum < sys_nerr)
return(sys_errlist[errnum]);
/* Do this by hand, so we don't include stdio(3). */
t = tmp;
do {
*t++ = "0123456789"[errnum % 10];
} while (errnum /= 10);
for (p = ebuf + sizeof(UPREFIX) - 1;;) {
*p++ = *--t;
if (t <= tmp)
break;
}
return(ebuf);
}
#endif
#endif /* !HAVE_STRERROR */

View File

@@ -0,0 +1,46 @@
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = dbm
PACKAGE_FILE = dbmtest.pkg
PROGRAM = lots$(BIN_SUFFIX)
CSRCS = lots.c
ifeq ($(OS_ARCH),WINNT)
EXTRA_DSO_LIBS = dbm$(MOZ_BITS)
else
EXTRA_DSO_LIBS = mozdbm_s
endif
LIBS = $(EXTRA_DSO_LIBS)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,2 @@
[gecko-tests]
dist/bin/lots@BINS@

639
mozilla/dbm/tests/lots.c Normal file
View File

@@ -0,0 +1,639 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* use sequental numbers printed to strings
* to store lots and lots of entries in the
* database.
*
* Start with 100 entries, put them and then
* read them out. Then delete the first
* half and verify that all of the first half
* is gone and then verify that the second
* half is still there.
* Then add the first half back and verify
* again. Then delete the middle third
* and verify again.
* Then increase the size by 1000 and do
* the whole add delete thing again.
*
* The data for each object is the number string translated
* to hex and replicated a random number of times. The
* number of times that the data is replicated is the first
* int32 in the data.
*/
#include <stdio.h>
#include <stdlib.h>
#ifdef STDC_HEADERS
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif
#include <string.h>
#include <assert.h>
#include "mcom_db.h"
DB *database=0;
int MsgPriority=5;
#if defined(_WINDOWS) && !defined(WIN32)
#define int32 long
#define uint32 unsigned long
#else
#define int32 int
#define uint32 unsigned int
#endif
typedef enum {
USE_LARGE_KEY,
USE_SMALL_KEY
} key_type_enum;
#define TraceMe(priority, msg) \
do { \
if(priority <= MsgPriority) \
{ \
ReportStatus msg; \
} \
} while(0)
int
ReportStatus(char *string, ...)
{
va_list args;
#ifdef STDC_HEADERS
va_start(args, string);
#else
va_start(args);
#endif
vfprintf(stderr, string, args);
va_end(args);
fprintf (stderr, "\n");
return(0);
}
int
ReportError(char *string, ...)
{
va_list args;
#ifdef STDC_HEADERS
va_start(args, string);
#else
va_start(args);
#endif
fprintf (stderr, "\n ");
vfprintf(stderr, string, args);
fprintf (stderr, "\n");
va_end(args);
return(0);
}
DBT * MakeLargeKey(int32 num)
{
int32 low_bits;
static DBT rv;
static char *string_rv=0;
int rep_char;
size_t size;
if(string_rv)
free(string_rv);
/* generate a really large text key derived from
* an int32
*/
low_bits = (num % 10000) + 1;
/* get the repeat char from the low 26 */
rep_char = (char) ((low_bits % 26) + 'a');
/* malloc a string low_bits wide */
size = low_bits*sizeof(char);
string_rv = (char *)malloc(size);
memset(string_rv, rep_char, size);
rv.data = string_rv;
rv.size = size;
return(&rv);
}
DBT * MakeSmallKey(int32 num)
{
static DBT rv;
static char data_string[64];
rv.data = data_string;
sprintf(data_string, "%ld", (long)num);
rv.size = strlen(data_string);
return(&rv);
}
DBT * GenKey(int32 num, key_type_enum key_type)
{
DBT *key;
switch(key_type)
{
case USE_LARGE_KEY:
key = MakeLargeKey(num);
break;
case USE_SMALL_KEY:
key = MakeSmallKey(num);
break;
default:
abort();
break;
}
return(key);
}
int
SeqDatabase()
{
int status;
DBT key, data;
ReportStatus("SEQuencing through database...");
/* seq throught the whole database */
if(!(status = (*database->seq)(database, &key, &data, R_FIRST)))
{
while(!(status = (database->seq) (database, &key, &data, R_NEXT)));
; /* null body */
}
if(status < 0)
ReportError("Error seq'ing database");
return(status);
}
int
VerifyData(DBT *data, int32 num, key_type_enum key_type)
{
int32 count, compare_num;
size_t size;
int32 *int32_array;
/* The first int32 is count
* The other n entries should
* all equal num
*/
if(data->size < sizeof(int32))
{
ReportError("Data size corrupted");
return -1;
}
memcpy(&count, data->data, sizeof(int32));
size = sizeof(int32)*(count+1);
if(size != data->size)
{
ReportError("Data size corrupted");
return -1;
}
int32_array = (int32*)data->data;
for(;count > 0; count--)
{
memcpy(&compare_num, &int32_array[count], sizeof(int32));
if(compare_num != num)
{
ReportError("Data corrupted");
return -1;
}
}
return(0);
}
/* verify that a range of number strings exist
* or don't exist. And that the data is valid
*/
#define SHOULD_EXIST 1
#define SHOULD_NOT_EXIST 0
int
VerifyRange(int32 low, int32 high, int32 should_exist, key_type_enum key_type)
{
DBT *key, data;
int32 num;
int status;
TraceMe(1, ("Verifying: %ld to %ld, using %s keys",
low, high, key_type == USE_SMALL_KEY ? "SMALL" : "LARGE"));
for(num = low; num <= high; num++)
{
key = GenKey(num, key_type);
status = (*database->get)(database, key, &data, 0);
if(status == 0)
{
/* got the item */
if(!should_exist)
{
ReportError("Item exists but shouldn't: %ld", num);
}
else
{
/* else verify the data */
VerifyData(&data, num, key_type);
}
}
else if(status > 0)
{
/* item not found */
if(should_exist)
{
ReportError("Item not found but should be: %ld", num);
}
}
else
{
/* database error */
ReportError("Database error");
return(-1);
}
}
TraceMe(1, ("Correctly verified: %ld to %ld", low, high));
return(0);
}
DBT *
GenData(int32 num)
{
int32 n;
static DBT *data=0;
int32 *int32_array;
size_t size;
if(!data)
{
data = (DBT*)malloc(sizeof(DBT));
data->size = 0;
data->data = 0;
}
else if(data->data)
{
free(data->data);
}
n = rand();
n = n % 512; /* bound to a 2K size */
size = sizeof(int32)*(n+1);
int32_array = (int32 *) malloc(size);
memcpy(&int32_array[0], &n, sizeof(int32));
for(; n > 0; n--)
{
memcpy(&int32_array[n], &num, sizeof(int32));
}
data->data = (void*)int32_array;
data->size = size;
return(data);
}
#define ADD_RANGE 1
#define DELETE_RANGE 2
int
AddOrDelRange(int32 low, int32 high, int action, key_type_enum key_type)
{
DBT *key, *data;
#if 0 /* only do this if your really analy checking the puts */
DBT tmp_data;
#endif
int32 num;
int status;
if(action != ADD_RANGE && action != DELETE_RANGE)
assert(0);
if(action == ADD_RANGE)
{
TraceMe(1, ("Adding: %ld to %ld: %s keys", low, high,
key_type == USE_SMALL_KEY ? "SMALL" : "LARGE"));
}
else
{
TraceMe(1, ("Deleting: %ld to %ld: %s keys", low, high,
key_type == USE_SMALL_KEY ? "SMALL" : "LARGE"));
}
for(num = low; num <= high; num++)
{
key = GenKey(num, key_type);
if(action == ADD_RANGE)
{
data = GenData(num);
status = (*database->put)(database, key, data, 0);
}
else
{
status = (*database->del)(database, key, 0);
}
if(status < 0)
{
ReportError("Database error %s item: %ld",
action == ADD_RANGE ? "ADDING" : "DELETING",
num);
}
else if(status > 0)
{
ReportError("Could not %s item: %ld",
action == ADD_RANGE ? "ADD" : "DELETE",
num);
}
else if(action == ADD_RANGE)
{
#define SYNC_EVERY_TIME
#ifdef SYNC_EVERY_TIME
status = (*database->sync)(database, 0);
if(status != 0)
ReportError("Database error syncing after add");
#endif
#if 0 /* only do this if your really analy checking the puts */
/* make sure we can still get it
*/
status = (*database->get)(database, key, &tmp_data, 0);
if(status != 0)
{
ReportError("Database error checking item just added: %d",
num);
}
else
{
/* now verify that none of the ones we already
* put in have disappeared
*/
VerifyRange(low, num, SHOULD_EXIST, key_type);
}
#endif
}
}
if(action == ADD_RANGE)
{
TraceMe(1, ("Successfully added: %ld to %ld", low, high));
}
else
{
TraceMe(1, ("Successfully deleted: %ld to %ld", low, high));
}
return(0);
}
int
TestRange(int32 low, int32 range, key_type_enum key_type)
{
int status; int32 low_of_range1, high_of_range1; int32 low_of_range2, high_of_range2;
int32 low_of_range3, high_of_range3;
status = AddOrDelRange(low, low+range, ADD_RANGE, key_type);
status = VerifyRange(low, low+range, SHOULD_EXIST, key_type);
TraceMe(1, ("Finished with sub test 1"));
SeqDatabase();
low_of_range1 = low;
high_of_range1 = low+(range/2);
low_of_range2 = high_of_range1+1;
high_of_range2 = low+range;
status = AddOrDelRange(low_of_range1, high_of_range1, DELETE_RANGE, key_type);
status = VerifyRange(low_of_range1, high_of_range1, SHOULD_NOT_EXIST, key_type);
status = VerifyRange(low_of_range2, low_of_range2, SHOULD_EXIST, key_type);
TraceMe(1, ("Finished with sub test 2"));
SeqDatabase();
status = AddOrDelRange(low_of_range1, high_of_range1, ADD_RANGE, key_type);
/* the whole thing should exist now */
status = VerifyRange(low, low+range, SHOULD_EXIST, key_type);
TraceMe(1, ("Finished with sub test 3"));
SeqDatabase();
status = AddOrDelRange(low_of_range2, high_of_range2, DELETE_RANGE, key_type);
status = VerifyRange(low_of_range1, high_of_range1, SHOULD_EXIST, key_type);
status = VerifyRange(low_of_range2, high_of_range2, SHOULD_NOT_EXIST, key_type);
TraceMe(1, ("Finished with sub test 4"));
SeqDatabase();
status = AddOrDelRange(low_of_range2, high_of_range2, ADD_RANGE, key_type);
/* the whole thing should exist now */
status = VerifyRange(low, low+range, SHOULD_EXIST, key_type);
TraceMe(1, ("Finished with sub test 5"));
SeqDatabase();
low_of_range1 = low;
high_of_range1 = low+(range/3);
low_of_range2 = high_of_range1+1;
high_of_range2 = high_of_range1+(range/3);
low_of_range3 = high_of_range2+1;
high_of_range3 = low+range;
/* delete range 2 */
status = AddOrDelRange(low_of_range2, high_of_range2, DELETE_RANGE, key_type);
status = VerifyRange(low_of_range1, high_of_range1, SHOULD_EXIST, key_type);
status = VerifyRange(low_of_range2, low_of_range2, SHOULD_NOT_EXIST, key_type);
status = VerifyRange(low_of_range3, low_of_range2, SHOULD_EXIST, key_type);
TraceMe(1, ("Finished with sub test 6"));
SeqDatabase();
status = AddOrDelRange(low_of_range2, high_of_range2, ADD_RANGE, key_type);
/* the whole thing should exist now */
status = VerifyRange(low, low+range, SHOULD_EXIST, key_type);
TraceMe(1, ("Finished with sub test 7"));
return(0);
}
#define START_RANGE 109876
int
main(int argc, char **argv)
{
int32 i, j=0;
int quick_exit = 0;
int large_keys = 0;
HASHINFO hash_info = {
16*1024,
0,
0,
0,
0,
0};
if(argc > 1)
{
while(argc > 1)
{
if(!strcmp(argv[argc-1], "-quick"))
quick_exit = 1;
else if(!strcmp(argv[argc-1], "-large"))
{
large_keys = 1;
}
argc--;
}
}
database = dbopen("test.db", O_RDWR | O_CREAT, 0644, DB_HASH, &hash_info);
if(!database)
{
ReportError("Could not open database");
#ifdef unix
perror("");
#endif
exit(1);
}
if(quick_exit)
{
if(large_keys)
TestRange(START_RANGE, 200, USE_LARGE_KEY);
else
TestRange(START_RANGE, 200, USE_SMALL_KEY);
(*database->sync)(database, 0);
(*database->close)(database);
exit(0);
}
for(i=100; i < 10000000; i+=200)
{
if(1 || j)
{
TestRange(START_RANGE, i, USE_LARGE_KEY);
j = 0;
}
else
{
TestRange(START_RANGE, i, USE_SMALL_KEY);
j = 1;
}
if(1 == rand() % 3)
{
(*database->sync)(database, 0);
}
if(1 == rand() % 3)
{
/* close and reopen */
(*database->close)(database);
database = dbopen("test.db", O_RDWR | O_CREAT, 0644, DB_HASH, 0);
if(!database)
{
ReportError("Could not reopen database");
#ifdef unix
perror("");
#endif
exit(1);
}
}
else
{
/* reopen database without closeing the other */
database = dbopen("test.db", O_RDWR | O_CREAT, 0644, DB_HASH, 0);
if(!database)
{
ReportError("Could not reopen database "
"after not closing the other");
#ifdef unix
perror("");
#endif
exit(1);
}
}
}
return(0);
}

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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# Config stuff for AIX.
include $(CORE_DEPTH)/coreconf/UNIX.mk
#
# There are two implementation strategies available on AIX:
# pthreads, and pthreads-user. The default is pthreads.
# In both strategies, we need to use pthread_user.c, instead of
# aix.c. The fact that aix.c is never used is somewhat strange.
#
# So we need to do the following:
# - Default (PTHREADS_USER not defined in the environment or on
# the command line):
# Set PTHREADS_USER=1, USE_PTHREADS=1
# - PTHREADS_USER=1 set in the environment or on the command line:
# Do nothing.
#
ifeq ($(PTHREADS_USER),1)
USE_PTHREADS = # just to be safe
IMPL_STRATEGY = _PTH_USER
else
USE_PTHREADS = 1
PTHREADS_USER = 1
endif
DEFAULT_COMPILER = xlc_r
CC = xlc_r
CCC = xlC_r
CPU_ARCH = rs6000
RANLIB = ranlib
OS_CFLAGS = -DAIX -DSYSV
OS_LIBS += -blibpath:/usr/lib:/lib -lc -lm
DSO_LDOPTS = -brtl -bnortllib -bM:SRE -bnoentry
MKSHLIB = $(LD) $(DSO_LDOPTS) -blibpath:/usr/lib:/lib -lc -lm
AIX_WRAP = $(DIST)/lib/aixwrap.o
AIX_TMP = $(OBJDIR)/_aix_tmp.o
ifdef MAPFILE
DSO_LDOPTS += -bexport:$(MAPFILE)
else
DSO_LDOPTS += -bexpall
endif
PROCESS_MAP_FILE = grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' > $@
ifdef BUILD_OPT
OPTIMIZER += -qmaxmem=-1
endif
ifeq ($(USE_64), 1)
OS_CFLAGS += -DAIX_64BIT
OBJECT_MODE=64
export OBJECT_MODE
endif

View File

@@ -0,0 +1,91 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Kurt J. Lidl
#
# 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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = gcc
CC = gcc
CCC = g++
RANLIB = ranlib
ifeq ($(OS_TEST),i386)
OS_REL_CFLAGS = -D__i386__
CPU_ARCH = x86
else
ifeq ($(OS_TEST),ppc)
OS_REL_CFLAGS = -D__ppc__
CPU_ARCH = ppc
else
ifeq ($(OS_TEST),sparc)
OS_REL_CFLAGS = -D__sparc__
CPU_ARCH = sparc
else
# treat the ultrasparc like a regular sparc, at least for now!
ifeq ($(OS_TEST),sparc_v9)
OS_REL_CFLAGS = -D__sparc__
CPU_ARCH = sparc
endif
endif
endif
endif
DLL_SUFFIX = so
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -DBSD_OS -DBSDI -Dunix -DHAVE_STRERROR -DHAVE_BSD_FLOCK
ARCH = bsdos
DSO_CFLAGS = -fPIC -DPIC
DSO_LDOPTS = -shared
DSO_LDFLAGS =
DSO_LDOPTS += -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
ifdef LIBRUNPATH
DSO_LDOPTS += -Wl,-R$(LIBRUNPATH)
endif
MKSHLIB = $(CC) $(DSO_LDOPTS)
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
G++INCLUDES = -I/usr/include/g++
INCLUDES += -I/usr/X11R6/include

View File

@@ -0,0 +1,81 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# 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 $(CORE_DEPTH)/coreconf/UNIX.mk
XP_DEFINE := $(XP_DEFINE:-DXP_UNIX=-DXP_BEOS)
USE_PTHREADS =
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
endif
CC = gcc
CCC = g++
RANLIB = ranlib
DEFAULT_COMPILER = gcc
ifeq ($(OS_TEST),ppc)
OS_REL_CFLAGS = -Dppc
CPU_ARCH = ppc
else
OS_REL_CFLAGS = -Di386
CPU_ARCH = x86
endif
MKSHLIB = $(CC) -nostart -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -pipe
OS_LIBS = -lbe
DEFINES += -DBEOS
ifdef USE_PTHREADS
DEFINES += -D_REENTRANT
endif
ARCH = beos
DSO_CFLAGS = -fPIC
DSO_LDOPTS =
DSO_LDFLAGS =

View File

@@ -0,0 +1,114 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = cc
CC = cc
CCC = c++
RANLIB = ranlib
ifeq (86,$(findstring 86,$(OS_TEST)))
OS_REL_CFLAGS = -Di386
CPU_ARCH = i386
else
OS_REL_CFLAGS = -Dppc
CPU_ARCH = ppc
endif
ifneq (,$(NEXT_ROOT))
GCC_VERSION_FULL := $(shell $(CC) -v 2>&1 | grep "gcc version" | sed -e "s/^.*gcc version[ ]*//" | awk '{ print $$1 }')
GCC_VERSION_MAJOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$1 }')
GCC_VERSION_MINOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$2 }')
GCC_VERSION := $(GCC_VERSION_MAJOR).$(GCC_VERSION_MINOR)
DARWIN_SDK_CFLAGS := -nostdinc
ifeq (,$(filter-out 2 3,$(GCC_VERSION_MAJOR)))
# GCC <= 3
DARWIN_TARGET_ARCH_LIB := darwin
DARWIN_SDK_CFLAGS += -isystem $(NEXT_ROOT)/usr/include/gcc/darwin/$(GCC_VERSION)
else
# GCC >= 4
DARWIN_TARGET_MAJOR := $(shell echo $(NEXT_ROOT) | sed -e 's/^.*MacOSX10\.//' | awk -F. '{ print $$1 }')
ifeq (,$(DARWIN_TARGET_MAJOR))
DARWIN_TARGET_MAJOR := $(shell echo $(OS_RELEASE) | awk -F. '{ print $$1 }')
else
DARWIN_TARGET_MAJOR := $(shell expr $(DARWIN_TARGET_MAJOR) + 4)
endif
DARWIN_TARGET_ARCH_LIB := powerpc-apple-darwin$(DARWIN_TARGET_MAJOR)
DARWIN_SDK_CFLAGS += -isystem $(NEXT_ROOT)/usr/lib/gcc/$(DARWIN_TARGET_ARCH_LIB)/$(GCC_VERSION_FULL)/include
endif
DARWIN_SDK_CFLAGS += -isystem $(NEXT_ROOT)/usr/include -F$(NEXT_ROOT)/System/Library/Frameworks
DARWIN_SDK_LDFLAGS := -L$(NEXT_ROOT)/usr/lib/gcc/$(DARWIN_TARGET_ARCH_LIB) -L$(NEXT_ROOT)/usr/lib/gcc/$(DARWIN_TARGET_ARCH_LIB)/$(GCC_VERSION_FULL) -L$(NEXT_ROOT)/usr/lib
ifneq (,$(shell find $(NEXT_ROOT)/Library/Frameworks -maxdepth 0))
DARWIN_SDK_CFLAGS += -F$(NEXT_ROOT)/Library/Frameworks
endif
LDFLAGS += $(DARWIN_SDK_LDFLAGS)
endif
# "Commons" are tentative definitions in a global scope, like this:
# int x;
# The meaning of a common is ambiguous. It may be a true definition:
# int x = 0;
# or it may be a declaration of a symbol defined in another file:
# extern int x;
# Use the -fno-common option to force all commons to become true
# definitions so that the linker can catch multiply-defined symbols.
# Also, common symbols are not allowed with Darwin dynamic libraries.
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wmost -fpascal-strings -no-cpp-precomp -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK $(DARWIN_SDK_CFLAGS)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
ARCH = darwin
# May override this with -bundle to create a loadable module.
DSO_LDOPTS = -dynamiclib -compatibility_version 1 -current_version 1 -install_name @executable_path/$(notdir $@) -headerpad_max_install_names $(DARWIN_SDK_LDFLAGS)
MKSHLIB = $(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS)
DLL_SUFFIX = dylib
PROCESS_MAP_FILE = grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,_,' > $@
G++INCLUDES = -I/usr/include/g++

View File

@@ -0,0 +1,85 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = gcc
CC = gcc
CCC = g++
RANLIB = ranlib
ifeq ($(OS_TEST),alpha)
CPU_ARCH = alpha
else
CPU_ARCH = x86
endif
OS_CFLAGS = $(DSO_CFLAGS) -ansi -Wall -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
DSO_CFLAGS = -fPIC
DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@)
#
# The default implementation strategy for FreeBSD is pthreads.
#
ifndef CLASSIC_NSPR
USE_PTHREADS = 1
DEFINES += -D_THREAD_SAFE -D_REENTRANT
OS_LIBS += -pthread
DSO_LDOPTS += -pthread
endif
ARCH = freebsd
MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
ifeq ($(MOZ_OBJFORMAT),elf)
DLL_SUFFIX = so
else
DLL_SUFFIX = so.1.0
endif
MKSHLIB = $(CC) $(DSO_LDOPTS)
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
G++INCLUDES = -I/usr/include/g++
INCLUDES += -I/usr/X11R6/include

View File

@@ -0,0 +1,81 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
#
# Config stuff for HP-UX
#
include $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = cc
CPU_ARCH = hppa
DLL_SUFFIX = sl
CC = cc
CCC = CC
OS_CFLAGS += -Ae $(DSO_CFLAGS) -DHPUX -D$(CPU_ARCH) -D_HPUX_SOURCE -D_USE_BIG_FDS
ifeq ($(DEFAULT_IMPL_STRATEGY),_PTH)
USE_PTHREADS = 1
ifeq ($(CLASSIC_NSPR),1)
USE_PTHREADS =
IMPL_STRATEGY = _CLASSIC
endif
ifeq ($(PTHREADS_USER),1)
USE_PTHREADS =
IMPL_STRATEGY = _PTH_USER
endif
endif
ifdef PTHREADS_USER
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
endif
LDFLAGS = -z -Wl,+s
MKSHLIB = $(LD) $(DSO_LDOPTS)
ifdef MAPFILE
MKSHLIB += -c $(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,+e ,' > $@
DSO_LDOPTS = -b +h $(notdir $@)
DSO_LDFLAGS =
# +Z generates position independent code for use in shared libraries.
DSO_CFLAGS = +Z

View File

@@ -0,0 +1,49 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
#
# On HP-UX 9, the default (and only) implementation strategy is
# classic nspr.
#
ifeq ($(OS_RELEASE),A.09.03)
DEFAULT_IMPL_STRATEGY = _CLASSIC
endif
#
# Config stuff for HP-UXA.09.03
#
include $(CORE_DEPTH)/coreconf/HP-UXA.09.mk

View File

@@ -0,0 +1,48 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# On HP-UX 9, the default (and only) implementation strategy is
# classic nspr.
ifeq ($(OS_RELEASE),A.09.07)
DEFAULT_IMPL_STRATEGY = _CLASSIC
endif
#
# Config stuff for HP-UXA.09.07
#
include $(CORE_DEPTH)/coreconf/HP-UXA.09.mk

View File

@@ -0,0 +1,43 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
#
# Config stuff for HP-UXA.09
#
include $(CORE_DEPTH)/coreconf/HP-UX.mk
OS_CFLAGS += -DHPUX9

View File

@@ -0,0 +1,44 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
ifeq ($(OS_RELEASE),B.10.01)
DEFAULT_IMPL_STRATEGY = _CLASSIC
endif
#
# Config stuff for HP-UXB.10.01
#
include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk

View File

@@ -0,0 +1,54 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# On HP-UX 10.10 and 10.20, the default implementation strategy is
# pthreads (actually DCE threads). Classic nspr is also available.
ifeq ($(OS_RELEASE),B.10.10)
DEFAULT_IMPL_STRATEGY = _PTH
endif
#
# Config stuff for HP-UXB.10.10
#
include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk
OS_CFLAGS += -DHPUX10_10
ifeq ($(USE_PTHREADS),1)
OS_CFLAGS += -D_REENTRANT
endif

View File

@@ -0,0 +1,54 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# On HP-UX 10.10 and 10.20, the default implementation strategy is
# pthreads (actually DCE threads). Classic nspr is also available.
ifeq ($(OS_RELEASE),B.10.20)
DEFAULT_IMPL_STRATEGY = _PTH
endif
#
# Config stuff for HP-UXB.10.20
#
include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk
OS_CFLAGS += -DHPUX10_20
ifeq ($(USE_PTHREADS),1)
OS_CFLAGS += -D_REENTRANT
endif

View File

@@ -0,0 +1,60 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# On HP-UX 10.30 and 11.00, the default implementation strategy is
# pthreads. Classic nspr and pthreads-user are also available.
ifeq ($(OS_RELEASE),B.10.30)
DEFAULT_IMPL_STRATEGY = _PTH
endif
#
# Config stuff for HP-UXB.10.30.
#
include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk
OS_CFLAGS += -DHPUX10_30
#
# To use the true pthread (kernel thread) library on 10.30 and
# 11.00, we should define _POSIX_C_SOURCE to be 199506L.
# The _REENTRANT macro is deprecated.
#
ifdef USE_PTHREADS
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
endif

View File

@@ -0,0 +1,40 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/HP-UX.mk
OS_CFLAGS += -DHPUX10
OS_LIBS += -lpthread -lm

View File

@@ -0,0 +1,59 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# On HP-UX 10.30 and 11.00, the default implementation strategy is
# pthreads. Classic nspr and pthreads-user are also available.
ifeq ($(OS_RELEASE),B.11.00)
OS_CFLAGS += -DHPUX10
DEFAULT_IMPL_STRATEGY = _PTH
endif
#
# To use the true pthread (kernel thread) library on 10.30 and
# 11.00, we should define _POSIX_C_SOURCE to be 199506L.
# The _REENTRANT macro is deprecated.
#
ifdef USE_PTHREADS
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
endif
#
# Config stuff for HP-UXB.11.00.
#
include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk

View File

@@ -0,0 +1,59 @@
#
# ***** 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 security libraries.
#
# 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 *****
# On HP-UX 10.30 and 11.x, the default implementation strategy is
# pthreads. Classic nspr and pthreads-user are also available.
ifeq ($(OS_RELEASE),B.11.11)
OS_CFLAGS += -DHPUX10
DEFAULT_IMPL_STRATEGY = _PTH
endif
#
# To use the true pthread (kernel thread) library on 10.30 and
# 11.x, we should define _POSIX_C_SOURCE to be 199506L.
# The _REENTRANT macro is deprecated.
#
ifdef USE_PTHREADS
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
endif
#
# Config stuff for HP-UXB.11.11.
#
include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk

View File

@@ -0,0 +1,59 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# 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 *****
# On HP-UX 10.30 and 11.x, the default implementation strategy is
# pthreads. Classic nspr and pthreads-user are also available.
ifeq ($(OS_RELEASE),B.11.20)
OS_CFLAGS += -DHPUX10
DEFAULT_IMPL_STRATEGY = _PTH
endif
#
# To use the true pthread (kernel thread) library on 10.30 and
# 11.x, we should define _POSIX_C_SOURCE to be 199506L.
# The _REENTRANT macro is deprecated.
#
ifdef USE_PTHREADS
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
endif
#
# Config stuff for HP-UXB.11.x.
#
include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk

View File

@@ -0,0 +1,59 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# 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 *****
# On HP-UX 10.30 and 11.x, the default implementation strategy is
# pthreads. Classic nspr and pthreads-user are also available.
ifeq ($(OS_RELEASE),B.11.22)
OS_CFLAGS += -DHPUX10
DEFAULT_IMPL_STRATEGY = _PTH
endif
#
# To use the true pthread (kernel thread) library on 10.30 and
# 11.x, we should define _POSIX_C_SOURCE to be 199506L.
# The _REENTRANT macro is deprecated.
#
ifdef USE_PTHREADS
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
endif
#
# Config stuff for HP-UXB.11.x.
#
include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk

View File

@@ -0,0 +1,87 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/HP-UX.mk
ifdef USE_LONG_LONGS
USE_HYBRID = 1
endif
ifndef NS_USE_GCC
CCC = /opt/aCC/bin/aCC -ext
ifeq ($(USE_64), 1)
ifeq ($(OS_TEST), ia64)
OS_CFLAGS += -Aa +e +p +DD64
else
# Our HP-UX build machine has a strange problem. If
# a 64-bit PA-RISC executable calls getcwd() in a
# network-mounted directory, it fails with ENOENT.
# We don't know why. Since nsinstall calls getcwd(),
# this breaks our 64-bit HP-UX nightly builds. None
# of our other HP-UX machines have this problem.
#
# We worked around this problem by building nsinstall
# as a 32-bit PA-RISC executable for 64-bit PA-RISC
# builds. -- wtc 2003-06-03
ifdef INTERNAL_TOOLS
OS_CFLAGS += +DAportable +DS2.0
else
OS_CFLAGS += -Aa +e +DA2.0W +DS2.0 +DChpux
endif
endif
else
ifeq ($(OS_TEST), ia64)
OS_CFLAGS += -Aa +e +p +DD32
else
ifdef USE_HYBRID
OS_CFLAGS += -Aa +e +DA2.0 +DS2.0
else
OS_CFLAGS += +DAportable +DS2.0
endif
endif
endif
else
CCC = aCC
endif
OS_CFLAGS += -DHPUX11
OS_LIBS += -lpthread -lm -lrt
#ifeq ($(USE_64), 1)
#OS_LIBS += -ldl
#else
#OS_LIBS += -ldld
#endif
HPUX11 = 1

View File

@@ -0,0 +1,126 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
#
# The default implementation strategy for Irix is classic nspr.
#
ifeq ($(USE_PTHREADS),1)
ifeq ($(USE_N32),1)
IMPL_STRATEGY = _n32_PTH
else
IMPL_STRATEGY = _PTH
endif
endif
DEFAULT_COMPILER = cc
ifdef NS_USE_GCC
CC = gcc
AS = $(CC) -x assembler-with-cpp
ODD_CFLAGS = -Wall -Wno-format
ifdef BUILD_OPT
OPTIMIZER = -O6
endif
else
CC = cc
CCC = CC
ODD_CFLAGS = -fullwarn -xansi -woff 1209
ifdef BUILD_OPT
ifeq ($(USE_N32),1)
OPTIMIZER = -O -OPT:Olimit=4000
else
OPTIMIZER = -O -Olimit 4000
endif
endif
# For 6.x machines, include this flag
ifeq (6., $(findstring 6., $(OS_RELEASE)))
ifeq ($(USE_N32),1)
ODD_CFLAGS += -n32 -mips3 -exceptions
else
ODD_CFLAGS += -32 -multigot
endif
else
ODD_CFLAGS += -xgot
endif
ifeq ($(USE_N32),1)
OS_CFLAGS += -dollar
endif
endif
ODD_CFLAGS += -DSVR4 -DIRIX
CPU_ARCH = mips
RANLIB = /bin/true
# For purify
# NOTE: should always define _SGI_MP_SOURCE
NOMD_OS_CFLAGS += $(ODD_CFLAGS) -D_SGI_MP_SOURCE
OS_CFLAGS += $(NOMD_OS_CFLAGS)
ifdef USE_MDUPDATE
OS_CFLAGS += -MDupdate $(DEPENDENCIES)
endif
ifeq ($(USE_N32),1)
SHLIB_LD_OPTS += -n32 -mips3
endif
MKSHLIB += $(LD) $(SHLIB_LD_OPTS) -shared -soname $(@:$(OBJDIR)/%.so=%.so)
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
DSO_LDOPTS = -elf -shared -all
ifdef DSO_BACKEND
DSO_LDOPTS += -soname $(DSO_NAME)
endif
#
# Revision notes:
#
# In the IRIX compilers prior to version 7.2, -n32 implied -mips3.
# Beginning in the 7.2 compilers, -n32 implies -mips4 when the compiler
# is running on a system with a mips4 CPU (e.g. R8K, R10K).
# We want our code to explicitly be mips3 code, so we now explicitly
# set -mips3 whenever we set -n32.
#

View File

@@ -0,0 +1,37 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/IRIX5.mk

View File

@@ -0,0 +1,39 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/IRIX5.mk
OS_CFLAGS += -DIRIX5_3

View File

@@ -0,0 +1,42 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/IRIX.mk
ifndef NS_USE_GCC
ODD_CFLAGS += -xgot
endif

View File

@@ -0,0 +1,45 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# catch unresolved symbols
SHLIB_LD_OPTS += -no_unresolved
include $(CORE_DEPTH)/coreconf/IRIX6.mk
OS_CFLAGS += -DIRIX6_2

View File

@@ -0,0 +1,44 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# catch unresolved symbols
SHLIB_LD_OPTS += -no_unresolved
include $(CORE_DEPTH)/coreconf/IRIX6.mk
OS_CFLAGS += -DIRIX6_3

View File

@@ -0,0 +1,47 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# catch unresolved symbols
SHLIB_LD_OPTS += -no_unresolved
include $(CORE_DEPTH)/coreconf/IRIX6.mk
OS_CFLAGS += -DIRIX6_5
ifndef NS_USE_GCC
OS_CFLAGS += -mips3
endif

View File

@@ -0,0 +1,49 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/IRIX.mk
ifndef NS_USE_GCC
ifneq ($(USE_N32),1)
OS_CFLAGS += -32
endif
ODD_CFLAGS += -multigot
endif
ifeq ($(USE_PTHREADS),1)
OS_LIBS += -lpthread
endif

View File

@@ -0,0 +1,169 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
#
# The default implementation strategy for Linux is now pthreads
#
USE_PTHREADS = 1
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
endif
CC = gcc
CCC = g++
RANLIB = ranlib
DEFAULT_COMPILER = gcc
ifeq ($(OS_TEST),m68k)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = m68k
else
ifeq ($(OS_TEST),ppc)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = ppc
else
ifeq ($(OS_TEST),alpha)
OS_REL_CFLAGS = -D_ALPHA_ -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = alpha
else
ifeq ($(OS_TEST),ia64)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = ia64
else
ifeq ($(OS_TEST),x86_64)
ifeq ($(USE_64),1)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = x86_64
else
OS_REL_CFLAGS = -DLINUX1_2 -Di386 -D_XOPEN_SOURCE
CPU_ARCH = x86
ARCHFLAG = -m32
endif
else
ifeq ($(OS_TEST),sparc)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = sparc
else
ifeq ($(OS_TEST),sparc64)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = sparc
else
ifeq (,$(filter-out arm% sa110,$(OS_TEST)))
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = arm
else
ifeq ($(OS_TEST),parisc)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = hppa
else
ifeq ($(OS_TEST),parisc64)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = hppa
else
ifeq ($(OS_TEST),s390)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = s390
else
ifeq ($(OS_TEST),s390x)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = s390x
else
ifeq ($(OS_TEST),mips)
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
CPU_ARCH = mips
else
OS_REL_CFLAGS = -DLINUX1_2 -Di386 -D_XOPEN_SOURCE
CPU_ARCH = x86
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
LIBC_TAG = _glibc
ifeq ($(OS_RELEASE),2.0)
OS_REL_CFLAGS += -DLINUX2_0
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
ifdef MAPFILE
MKSHLIB += -Wl,--version-script,$(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
endif
ifeq ($(USE_PTHREADS),1)
OS_PTHREAD = -lpthread
endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -ansi -Wall -pipe -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR
OS_LIBS = $(OS_PTHREAD) -ldl -lc
ifdef USE_PTHREADS
DEFINES += -D_REENTRANT
endif
ARCH = linux
DSO_CFLAGS = -fPIC
DSO_LDOPTS = -shared $(ARCHFLAG)
DSO_LDFLAGS =
LDFLAGS += $(ARCHFLAG)
# INCLUDES += -I/usr/include -Y/usr/include/linux
G++INCLUDES = -I/usr/include/g++
#
# Always set CPU_TAG on Linux, OpenVMS, WINCE.
#
CPU_TAG = _$(CPU_ARCH)

View File

@@ -0,0 +1,51 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/Linux.mk
ifeq ($(OS_RELEASE),2.1)
OS_REL_CFLAGS += -DLINUX2_1
MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
ifdef MAPFILE
MKSHLIB += -Wl,--version-script,$(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
endif

View File

@@ -0,0 +1,51 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/Linux.mk
OS_REL_CFLAGS += -DLINUX2_1
MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
ifdef MAPFILE
MKSHLIB += -Wl,--version-script,$(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@

View File

@@ -0,0 +1,51 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/Linux.mk
OS_REL_CFLAGS += -DLINUX2_1
MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
ifdef MAPFILE
MKSHLIB += -Wl,--version-script,$(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@

View File

@@ -0,0 +1,51 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/Linux.mk
OS_REL_CFLAGS += -DLINUX2_1
MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
ifdef MAPFILE
MKSHLIB += -Wl,--version-script,$(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@

View File

@@ -0,0 +1,51 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/Linux.mk
OS_REL_CFLAGS += -DLINUX2_1
MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
ifdef MAPFILE
MKSHLIB += -Wl,--version-script,$(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';-' $(LIBRARY_NAME).def | \
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@

View File

@@ -0,0 +1,38 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/Linux.mk

View File

@@ -0,0 +1,38 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/Linux.mk

View File

@@ -0,0 +1,47 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
DEPTH = ..
CORE_DEPTH = ..
MODULE = coreconf
DIRS = nsinstall
include $(DEPTH)/coreconf/config.mk
include $(DEPTH)/coreconf/rules.mk
export:: libs

View File

@@ -0,0 +1,97 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = cc
###
NS_USE_NATIVE = 1
# NS_USE_GCC = 1
export PATH:=$(PATH):/opt/ncc/bin
###
RANLIB = true
GCC_FLAGS_EXTRA += -pipe
DEFINES += -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR
OS_CFLAGS += -Hnocopyr -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR -DPRFSTREAMS_BROKEN
ifdef NS_USE_NATIVE
CC = cc
CCC = ncc
CXX = ncc
# OS_LIBS += -L/opt/ncc/lib
else
# OS_LIBS +=
endif
#OS_LIBS += -lsocket -lnsl -ldl -lc
MKSHLIB += $(LD) $(DSO_LDOPTS)
#DSO_LDOPTS += -G -z defs
DSO_LDOPTS += -G
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
CPU_ARCH = x86
ARCH = ncr
NOSUCHFILE = /solaris-rm-f-sucks
# now take care of default GCC (rus@5/5/97)
ifdef NS_USE_GCC
# if gcc-settings are redefined already - don't touch it
#
ifeq (,$(findstring gcc, $(CC)))
CC = gcc
CCC = g++
CXX = g++
# always use -fPIC - some makefiles are still broken and don't distinguish
# situation when they build shared and static libraries
CFLAGS += -fPIC -Wall $(GCC_FLAGS_EXTRA)
# OS_LIBS += -L/usr/local/lib -lstdc++ -lg++ -lgcc
endif
endif
###

View File

@@ -0,0 +1,68 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = $(CORE_DEPTH)/build/hcc
CPU_ARCH = mips
ifdef NS_USE_GCC
CC = gcc
CCC = g++
else
CC = $(CORE_DEPTH)/build/hcc
OS_CFLAGS = -Xa -KGnum=0 -KOlimit=4000
CCC = g++
endif
MKSHLIB = $(LD) $(DSO_LDOPTS)
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
RANLIB = /bin/true
OS_CFLAGS += $(ODD_CFLAGS) -DSVR4 -D__SVR4 -DNEC -Dnec_ews -DHAVE_STRERROR
OS_LIBS = -lsocket -lnsl -ldl $(LDOPTIONS)
LDOPTIONS = -lc -L/usr/ucblib -lucb
NOSUCHFILE = /nec-rm-f-sucks
DSO_LDOPTS = -G

View File

@@ -0,0 +1,88 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = gcc
CC = gcc
CCC = g++
RANLIB = ranlib
CPU_ARCH := $(shell uname -p)
ifeq ($(CPU_ARCH),i386)
OS_REL_CFLAGS = -Di386
CPU_ARCH = x86
endif
ifndef OBJECT_FMT
OBJECT_FMT := $(shell if echo __ELF__ | $${CC:-cc} -E - | grep -q __ELF__ ; then echo a.out ; else echo ELF ; fi)
endif
ifeq ($(OBJECT_FMT),ELF)
DLL_SUFFIX = so
else
DLL_SUFFIX = so.1.0
endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DNETBSD -Dunix -DHAVE_STRERROR -DHAVE_BSD_FLOCK
OS_LIBS = -lcompat
ARCH = netbsd
DSO_CFLAGS = -fPIC -DPIC
DSO_LDOPTS = -shared
DSO_LDFLAGS =
ifeq ($(OBJECT_FMT),ELF)
DSO_LDOPTS += -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
endif
ifdef LIBRUNPATH
DSO_LDOPTS += -Wl,-R$(LIBRUNPATH)
endif
MKSHLIB = $(CC) $(DSO_LDOPTS)
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
G++INCLUDES = -I/usr/include/g++
INCLUDES += -I/usr/X11R6/include

View File

@@ -0,0 +1,281 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
MOZ_WIDGET_TOOLKIT = os2
# Specify toolset. Default to EMX.
ifeq ($(MOZ_OS2_TOOLS),VACPP)
XP_OS2_VACPP = 1
else
ifeq ($(MOZ_OS2_TOOLS),PGCC)
XP_OS2_EMX = 1
else
MOZ_OS2_TOOLS = EMX
XP_OS2_EMX = 1
endif
endif
# XP_PC is for Window and OS2 on Intel X86
# XP_OS2 is strictly for OS2 only
XP_DEFINE += -DXP_PC=1 -DXP_OS2=1
# Override prefix
LIB_PREFIX = $(NULL)
# Override suffix in suffix.mk
LIB_SUFFIX = lib
# the DLL_SUFFIX must be uppercase for FIPS mode to work. bugzilla 240784
DLL_SUFFIX = DLL
PROG_SUFFIX = .exe
ifdef XP_OS2_EMX
CCC = gcc
LINK = gcc
AR = emxomfar r $@
# Keep AR_FLAGS blank so that we do not have to change rules.mk
AR_FLAGS =
RANLIB = @echo OS2 RANLIB
BSDECHO = @echo OS2 BSDECHO
IMPLIB = emximp -o
FILTER = emxexp -o
# GCC for OS/2 currently predefines these, but we don't want them
DEFINES += -Uunix -U__unix -U__unix__
DEFINES += -DTCPV40HDRS
ifndef NO_SHARED_LIB
WRAP_MALLOC_LIB =
WRAP_MALLOC_CFLAGS =
DSO_CFLAGS =
DSO_PIC_CFLAGS =
MKSHLIB = $(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@
MKCSHLIB = $(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@
MKSHLIB_FORCE_ALL =
MKSHLIB_UNFORCE_ALL =
DSO_LDOPTS = -Zomf -Zdll -Zmap
SHLIB_LDSTARTFILE =
SHLIB_LDENDFILE =
ifdef MAPFILE
MKSHLIB += $(MAPFILE)
endif
PROCESS_MAP_FILE = \
echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@; \
echo PROTMODE >> $@; \
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@; \
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@; \
echo EXPORTS >> $@; \
grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \
awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
endif #NO_SHARED_LIB
OS_CFLAGS = -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Zomf -DDEBUG -DTRACING -g
# Where the libraries are
MOZ_COMPONENT_NSPR_LIBS=-L$(DIST)/lib $(NSPR_LIBS)
NSPR_LIBS = -lplds4 -lplc4 -lnspr4
NSPR_INCLUDE_DIR =
ifdef BUILD_OPT
OPTIMIZER = -O2 -s
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
DLLFLAGS = -DLL -OUT:$@ -MAP:$(@:.dll=.map)
EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
OBJDIR_TAG = _OPT
else
#OPTIMIZER = -O+ -Oi
DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn
DLLFLAGS = -DEBUG -DLL -OUT:$@ -MAP:$(@:.dll=.map)
EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
OBJDIR_TAG = _DBG
LDFLAGS = -DEBUG
endif # BUILD_OPT
else # XP_OS2_VACPP
# Override suffix in suffix.mk
OBJ_SUFFIX = .obj
ASM_SUFFIX = .asm
AS = alp.exe
ifdef BUILD_OPT
ASFLAGS = -Od
else
ASFLAGS = +Od
endif
CCC = icc -q -DXP_OS2 -DOS2=4 -N10
LINK = -ilink
AR = -ilib /NOL /NOI /O:$(subst /,\\,$@)
# Keep AR_FLAGS blank so that we do not have to change rules.mk
AR_FLAGS =
RANLIB = @echo OS2 RANLIB
BSDECHO = @echo OS2 BSDECHO
IMPLIB = implib /NOL /NOI
FILTER = cppfilt -b -p -q
ifndef NO_SHARED_LIB
WRAP_MALLOC_LIB =
WRAP_MALLOC_CFLAGS =
DSO_CFLAGS =
DSO_PIC_CFLAGS =
MKSHLIB = $(LD) $(DSO_LDOPTS)
MKCSHLIB = $(LD) $(DSO_LDOPTS)
MKSHLIB_FORCE_ALL =
MKSHLIB_UNFORCE_ALL =
DSO_LDOPTS =
# DLL_SUFFIX = .dll
SHLIB_LDSTARTFILE =
SHLIB_LDENDFILE =
ifdef MAPFILE
MKSHLIB += $(MAPFILE)
endif
PROCESS_MAP_FILE = \
echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@; \
echo PROTMODE >> $@; \
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@; \
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@; \
echo EXPORTS >> $@; \
grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' >> $@
endif #NO_SHARED_LIB
OS_CFLAGS = /Q /qlibansi /Gd /Gm /Su4 /Mp /Tl-
INCLUDES += -I$(CORE_DEPTH)/../dist/include
DEFINES += -DXP_OS2_VACPP -DTCPV40HDRS
# Where the libraries are
NSPR_LIBS = $(DIST)/lib/nspr4.lib $(DIST)/lib/plc4.lib $(DIST)/lib/plds4.lib
MOZ_COMPONENT_NSPR_LIBS=-L$(DIST)/lib $(NSPR_LIBS)
NSPR_INCLUDE_DIR =
DLLFLAGS = /DLL /O:$@ /INC:_dllentry /MAP:$(@:.dll=.map)
EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
LDFLAGS = /FREE /NOE /LINENUMBERS /nologo
ifdef BUILD_OPT
OPTIMIZER = /O+ /Gl+ /G5 /qarch=pentium
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
OBJDIR_TAG = _OPT
LDFLAGS += /NODEBUG /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA
else
OS_CFLAGS += /Ti+
DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn
DLLFLAGS += /DE
EXEFLAGS += /DE
OBJDIR_TAG = _DBG
LDFLAGS += /DE
endif # BUILD_OPT
endif # XP_OS2_VACPP
# OS/2 use nsinstall that is included in the toolkit.
# since we do not wish to support and maintain 3 version of nsinstall in mozilla, nspr and nss
ifdef BUILD_TREE
NSINSTALL_DIR = $(BUILD_TREE)/nss
else
NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
endif
# NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall
NSINSTALL = nsinstall # HCT4OS2
INSTALL = $(NSINSTALL)
MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk
####################################################################
#
# One can define the makefile variable NSDISTMODE to control
# how files are published to the 'dist' directory. If not
# defined, the default is "install using relative symbolic
# links". The two possible values are "copy", which copies files
# but preserves source mtime, and "absolute_symlink", which
# installs using absolute symbolic links. The "absolute_symlink"
# option requires NFSPWD.
# - THIS IS NOT PART OF THE NEW BINARY RELEASE PLAN for 9/30/97
# - WE'RE KEEPING IT ONLY FOR BACKWARDS COMPATIBILITY
####################################################################
ifeq ($(NSDISTMODE),copy)
# copy files, but preserve source mtime
INSTALL = $(NSINSTALL)
INSTALL += -t
else
ifeq ($(NSDISTMODE),absolute_symlink)
# install using absolute symbolic links
INSTALL = $(NSINSTALL)
INSTALL += -L `$(NFSPWD)`
else
# install using relative symbolic links
INSTALL = $(NSINSTALL)
INSTALL += -R
endif
endif
DEFINES += -DXP_OS2
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
endef
#
# override the definition of DLL_PREFIX in prefix.mk
#
ifndef DLL_PREFIX
DLL_PREFIX = $(NULL)
endif
#
# override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY
#
ifndef TARGETS
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM)
endif
ifdef LIBRARY_NAME
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)$(JDK_DEBUG_SUFFIX).lib
endif

View File

@@ -0,0 +1,74 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
#
# The Bourne shell (sh) on OSF1 doesn't handle "set -e" correctly,
# which we use to stop LOOP_OVER_DIRS submakes as soon as any
# submake fails. So we use the Korn shell instead.
#
SHELL = /usr/bin/ksh
include $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = cc
CC = cc
OS_CFLAGS += $(NON_LD_FLAGS) -std1
CCC = cxx
RANLIB = /bin/true
CPU_ARCH = alpha
ifdef BUILD_OPT
OPTIMIZER += -Olimit 4000
endif
NON_LD_FLAGS += -ieee_with_inexact
OS_CFLAGS += -DOSF1 -D_REENTRANT
ifeq ($(USE_PTHREADS),1)
OS_CFLAGS += -pthread
endif
# The command to build a shared library on OSF1.
MKSHLIB += ld -shared -expect_unresolved "*" -soname $(notdir $@)
ifdef MAPFILE
MKSHLIB += -hidden -input $(MAPFILE)
endif
PROCESS_MAP_FILE = grep -v ';+' $(LIBRARY_NAME).def | grep -v ';-' | \
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,-exported_symbol ,' > $@
DSO_LDOPTS += -shared

View File

@@ -0,0 +1,37 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/OSF1.mk

View File

@@ -0,0 +1,37 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/OSF1.mk

View File

@@ -0,0 +1,48 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# On OSF1 V3.2, classic nspr is the default (and only) implementation
# strategy.
#
# Config stuff for DEC OSF/1 V3.2
#
include $(CORE_DEPTH)/coreconf/OSF1.mk
ifeq ($(OS_RELEASE),V3.2)
OS_CFLAGS += -DOSF1V3
endif

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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# On OSF1 V4.0, pthreads is the default implementation strategy.
# Classic nspr is also available.
ifneq ($(OS_RELEASE),V3.2)
USE_PTHREADS = 1
ifeq ($(CLASSIC_NSPR), 1)
USE_PTHREADS =
IMPL_STRATEGY := _CLASSIC
endif
endif
#
# Config stuff for DEC OSF/1 V4.0
#
include $(CORE_DEPTH)/coreconf/OSF1.mk
ifeq ($(OS_RELEASE),V4.0)
OS_CFLAGS += -DOSF1V4
endif

View File

@@ -0,0 +1,37 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/OSF1V4.0.mk

View File

@@ -0,0 +1,41 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/OSF1V4.0.mk
DEFINES += -DOSF1V4D
OS_LIBS += -lpthread -lrt

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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
# On OSF1 V5.0, pthreads is the default implementation strategy.
# Classic nspr is also available.
ifneq ($(OS_RELEASE),V3.2)
USE_PTHREADS = 1
ifeq ($(CLASSIC_NSPR), 1)
USE_PTHREADS =
IMPL_STRATEGY := _CLASSIC
endif
endif
#
# Config stuff for DEC OSF/1 V5.0
#
include $(CORE_DEPTH)/coreconf/OSF1.mk

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 security libraries.
#
# 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 *****
# On OSF1 V5.0, pthreads is the default implementation strategy.
# Classic nspr is also available.
ifneq ($(OS_RELEASE),V3.2)
USE_PTHREADS = 1
ifeq ($(CLASSIC_NSPR), 1)
USE_PTHREADS =
IMPL_STRATEGY := _CLASSIC
endif
endif
#
# Config stuff for DEC OSF/1 V5.1
#
include $(CORE_DEPTH)/coreconf/OSF1.mk

View File

@@ -0,0 +1,71 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = gcc
CC = gcc
CCC = g++
RANLIB = ranlib
CPU_ARCH := $(shell uname -p)
ifeq ($(CPU_ARCH),i386)
OS_REL_CFLAGS = -Di386
CPU_ARCH = x86
endif
ifndef CLASSIC_NSPR
USE_PTHREADS = 1
DEFINES += -pthread
OS_LIBS += -pthread
DSO_LDOPTS += -pthread
endif
DLL_SUFFIX = so.1.0
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DOPENBSD
OS_LIBS =
ARCH = openbsd
DSO_CFLAGS = -fPIC -DPIC
DSO_LDOPTS = -shared -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
DSO_LDFLAGS =
MKSHLIB = $(CC) $(DSO_LDOPTS)

View File

@@ -0,0 +1,93 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = gcc
CC = gcc
OS_CFLAGS += -fPIC
CCC = g++
CCC += -DPRFSTREAMS_BROKEN -I/usr/gnu/lib/g++-include
# CCC = $(CORE_DEPTH)/build/hcpp
# CCC += +.cpp +w
RANLIB = /bin/true
#
# -DSCO_PM - Policy Manager AKA: SCO Licensing
# -DSCO - Changes to Netscape source (consistent with AIX, LINUX, etc..)
# -Dsco - Needed for /usr/include/X11/*
#
OS_CFLAGS += -DSCO_SV -DSYSV -D_SVID3 -DHAVE_STRERROR -DSW_THREADS -DSCO_PM -DSCO -Dsco
#OS_LIBS += -lpmapi -lsocket -lc
MKSHLIB = $(LD)
MKSHLIB += $(DSO_LDOPTS)
XINC = /usr/include/X11
MOTIFLIB += -lXm
INCLUDES += -I$(XINC)
CPU_ARCH = x86
GFX_ARCH = x
ARCH = sco
LOCALE_MAP = $(CORE_DEPTH)/cmd/xfe/intl/sco.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
LOC_LIB_DIR = /usr/lib/X11
NOSUCHFILE = /solaris-rm-f-sucks
BSDECHO = /bin/echo
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
#
# These defines are for building unix plugins
#
BUILD_UNIX_PLUGINS = 1
#DSO_LDOPTS += -b elf -G -z defs
DSO_LDOPTS += -G
DSO_LDFLAGS += -nostdlib -L/lib -L/usr/lib -lXm -lXt -lX11 -lgen
# Used for Java compiler
EXPORT_FLAGS += -W l,-Bexport

View File

@@ -0,0 +1,80 @@
#
# ***** 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
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# 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 *****
#
# Config stuff for Compaq OpenVMS
#
include $(CORE_DEPTH)/coreconf/UNIX.mk
CC = cc
CCC = cxx
RANLIB = /gnu/bin/true
CPU_ARCH := $(shell uname -Wh)
OS_CFLAGS = -DVMS
OS_CXXFLAGS = -DVMS
# Maybe this should go into rules.mk or something?
ifdef NSPR_INCLUDE_DIR
INCLUDES += -I$(NSPR_INCLUDE_DIR)
endif
#
# XCFLAGS are the only CFLAGS that are used during a link operation. Defining
# OPTIMIZER in XCFLAGS means that each compilation line gets OPTIMIZER
# included twice, but at least we get OPTIMIZER included in the link
# operations; and OpenVMS needs it!
#
XCFLAGS += $(OPTIMIZER)
DSO_LDOPTS = -shared -auto_symvec
MKSHLIB = $(CC) $(OPTIMIZER) $(LDFLAGS) $(DSO_LDOPTS)
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
#
# Always set CPU_TAG on Linux, OpenVMS, WINCE.
#
CPU_TAG = _$(CPU_ARCH)

View File

@@ -0,0 +1,42 @@
#
# ***** 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
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# 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 *****
#
# Config stuff for Compaq OpenVMS
#
include $(CORE_DEPTH)/coreconf/OpenVMS.mk

View File

@@ -0,0 +1,72 @@
#
# ***** 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 security libraries.
#
# 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 *****
include $(CORE_DEPTH)/coreconf/UNIX.mk
USE_PTHREADS = 1
ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
endif
CC = qcc
CCC = qcc
RANLIB = ranlib
DEFAULT_COMPILER = qcc
ifeq ($(OS_TEST),mips)
CPU_ARCH = mips
else
CPU_ARCH = x86
endif
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Vgcc_ntox86 -Wall -pipe -DNTO -DHAVE_STRERROR -D_QNX_SOURCE -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE=500
ifdef USE_PTHREADS
DEFINES += -D_REENTRANT
endif
ARCH = QNX
DSO_CFLAGS = -Wc,-fPIC
DSO_LDOPTS = -shared
DSO_LDFLAGS =

View File

@@ -0,0 +1,561 @@
OVERVIEW of "ns/coreconf":
This README file is an attempt to provide the reader with a simple
synopsis of the "ns/coreconf" build system which was originally
fundamentally designed and built to accomodate Netscape's binary
release model. Wherever possible, an attempt has been made to
comply with the NSPR 2.0 build system, including mimicing the
compiler/linker flags, and directory naming structure. The reader
should keep in mind that the system builds binary releases of
header files, class files, libraries, and executables on numerous
flavors of UNIX and Windows operating systems. Unfortunately,
no serious attempt has ever been made to incorporate an ability to
generate cross-platform binaries on an Apple MacIntosh platform.
Note that this file will not attempt to redefine or document the
architecture of this system. However, documents on this subject
are available at the following URL:
http://warp/hardcore/prj-ttools/specs/release/index.html
DEPENDENCIES of "ns/coreconf":
The "ns/coreconf" build system requires the specified versions of
the following platform-dependent tools:
UNIX Platforms:
--------------
gmake (version 3.74 or later)
perl 4.0 (NOTE: perl 5.003 or later recommended)
uname
Windows Platforms:
-----------------
gmake 3.74 (must use hacked Netscape version)
shmsdos.exe (contained in Netscape gmake.exe)
nsinstall.exe (contained in Netscape gmake.exe)
perl.exe (version 4.0 for everything except testing;
NOTE: MKS toolkit perl 5.002 is broken)
perl5.exe (for testing;
NOTE: perl 5.003 or later recommended;
MKS toolkit perl 5.002 is broken)
uname.exe (use nstools version)
ENHANCEMENTS to "ns/coreconf":
With the advent of Certificate Server 4.0 using the ns/coreconf
build system, several changes had to be made to enhance
ns/coreconf support for building Java/JNI classes/programs, as
well as libraries slated to be released as binaries. While the
following may not represent an exhaustive list of these changes,
it does attempt to be at least somewhat comprehensive:
(1) During the course of these enhancements, a total of
four files have been modified, and four new files have
been added.
The following files have been modified:
- command.mk: removed old definition of JAR
- config.mk: added include statement of new
"jdk.mk" file
- ruleset.mk: allowed the $(MKPROG) variable to be
overridden by supplying it with a
default value of $(CC); augmented
numerous definitions to enhance
ability of ns/coreconf to produce
a more robust set of libraries;
added some JNI definitions; PACKAGE
definition may be overridden by new
"jdk.mk" file
- rules.mk: separated the compile phase of a
program from the link phase of a
program such that a developer can
now strictly override program linkage
by simply supplying a $(MKPROG)
variable; augmented NETLIBDEPTH
to use CORE_DEPTH but retain backward
compatibility; added JNI section;
modified .PRECIOUS rule;
The following files have been added:
- README: this file; an ASCII-based text
document used to summarize the
ns/coreconf build system and
suitable (paginated) for printing
- jdk.mk: a file comprising most (if not all)
of the default Java related build
information; the definitions in this
file are only included if NS_USE_JDK
has been defined
- jniregen.pl: a perl script used to create a
dependency for when JNI files should
be regenerated (based upon any change
to the ".class" file from which the
".h" file was originally generated)
- outofdate.pl: a perl script used to create a
dependency for when ".class" files
should be regenerated (based upon
any change to the ".java" file
from which the ".class" file was
originally generated)
(2) As stated above, the ns/coreconf build system now separates
the link phase of a program from its compilation phase.
While ns/coreconf still works exactly as it used to because
the $(MKPROG) variable is assigned $(CC) by default, a developer
may now override this behavior by simply supplying their
own unique value for $(MKPROG) on every platform. This allows
a program compiled with $(CC) to link with external libraries
that may contain "C++" linkage. Before this change, a
programmer would need to reference their own local copy of
rules.mk (see the ns/sectools/cmd/pk12util program for
an example of how this used to be accomplished).
(3) Currently, the ns/coreconf build system differs from the
NSPR 2.0 build system which utilizes an "_s" to denote
static libraries from import libraries. In fact, the
ns/coreconf build system adds no prefixes or suffixes to
distinguish one version of static libraries from another.
Note that both the ns/coreconf build system as well as the
NSPR 2.0 build system do nothing to provide a method of
distinguishing 16-bit from 32-bit static libraries on the
same machine, either, since:
a) this might only provide difficulty during
development, since static libraries always
need to be embedded within a program
(note this is highly unlikely, since libraries
for different platforms are subdivided via
a well-known subdirectory structure, and
a developer may use multiple trees for
development),
b) this maintains backwards compatibility,
something very important since no legacy
programs will need to change their link phase, and
c) Netscape as a company has dropped any plans
of future development of 16-bit products.
(4) Since several members of the Hardcore Security group did
not favor NSPR 2.0's solution of adding an "_s" to static
libraries on Windows platforms as a method to distinguish
them from their import library cousins, a different solution
was proposed and has been recently implemented for ns/coreconf:
- a 16 has been added as a suffix to both dynamic and
import libraries built on 16-bit Windows platforms
- a 32 has been added as a suffix to both dynamic and
import libraries built on 32-bit Windows platforms
Since the HCL release process currently only contains a
single instance of building a dynamic library,
ns/security/lib/fortcrypt/fort12.dll, the impact of this
change should be relatively small. (Note: HCL was the
old name of NSS.)
It should be noted that although this would additionally
limit the 8.3 namespace on 16-bit platforms, it is highly
unlikely that any future development will be performed on
this platform.
(5) The $(LIBRARY_VERSION) tag has been added to all non-static
libraries created on UNIX operating systems to alleviate
any future confusion for binary releases which utilize this
tag. Again, it should be noted that this tag is only
utilized on non-static libraries, since more than one
version of the library may need to exist simultaneously
if multiple products are utilized.
Currently, only one HCL released library utilizes this tag:
ns/security/lib/fortcrypt/fort12.a
(e. g. - in this library, the tag has been set to '12')
Again, it should be noted that although this would
additionally limit the 8.3 namespace on 16-bit platforms,
it is highly unlikely that any future development will be
performed on this platform.
(6) The $(JDK_DEBUG_SUFFIX) extension has been added to all
library and program names to support debug versions of
Java programs (e. g. - java_g, javac_g, etc).
Once again, it should be noted that although this would
additionally limit the 8.3 namespace on 16-bit platforms,
it is highly unlikely that any future Java development
will be performed on this platform.
(7) Most (if not all) default definitions for java have been
encapsulated within their own file, jdk.mk, which is
always included by default in ns/coreconf/config.mk.
However, the definitions within this file are only ever
activated if NS_USE_JDK has been set to be 1.
(8) Two perl scripts (jniregen.pl and outofdate.pl) have been
added to the system to foster a more robust development
environment for composing Java and JNI programs
utilizing the ns/coreconf build system. Both of these
perl scripts are related to resolving dependencies which
can not be accomplished through normal makefile dependencies.
(9) This file, README, was created in an attempt to allow
developers who have familiarity with ns/coreconf a simple
roadmap for what has changed, as well as a top-level view of
what comprises ns/coreconf. This file was written in
ASCII (rather than HTML) primarily to promote simple
paginated printing.
OVERVIEW of "config.mk":
This file contains the configuration information necessary to
build each "Core Components" source module:
include file name Purpose
=================== =======================================
arch.mk source and release <architecture> tags
command.mk default command macros
(NOTE: may be overridden in $(OS_CONFIG).mk)
$(OS_CONFIG).mk <architecture>-specific macros
(dependent upon <architecture> tags)
tree.mk release <tree> tags
(dependent upon <architecture> tags)
module.mk source and release <component> tags
(NOTE: A component is also called a module
or a subsystem. This file is dependent upon
$(MODULE) being defined on the command
line, as an environment variable, or in
individual makefiles, or more
appropriately, manifest.mn)
version.mk release <version> tags
(dependent upon $(MODULE) being defined on
the command line, as an environment variable,
or in individual makefiles, or more
appropriately, manifest.mn)
location.mk macros to figure out binary code location
(dependent upon <platform> tags)
source.mk <component>-specific source path
(dependent upon <user_source_tree>,
<source_component>, <version>, and
<platform> tags)
headers.mk include switch for support header files
(dependent upon <tree>, <component>, <version>,
and <platform> tags)
prefix.mk compute program prefixes
suffix.mk compute program suffixes
(dependent upon <architecture> tags)
jdk.mk define JDK
(dependent upon <architecture>,
<source>, and <suffix> tags)
ruleset.mk Master "Core Components" rule set
(should always be the last file
included by config.mk)
OVERVIEW of "rules.mk":
The "rules.mk" file consists of four sections. The first section
contains the "master" build rules for all binary releases. While
this section can (and should) largely be thought of as "language"
independent, it does utilize the "perl" scripting language to
perform both the "import" and "release" of binary modules.
The rules which dwell in this section and their purpose:
CATEGORY/rule:: Purpose
=================== =======================================
GENERAL
-------
all:: "default" all-encompassing rule which
performs "export libs program install"
export:: recursively copy specified
cross-platform header files to the
$(SOURCE_XPHEADERS_DIR) directory;
recursively copy specified
machine-dependent header files to the
$(SOURCE_MDHEADERS_DIR) directory;
although all rules can be written to
repetively "chain" into other sections,
this rule is the most commonly used
rule to "chain" into other sections
such as Java providing a simple
mechanism which allows no need for
developers to memorize specialized
rules
libs:: recursively build
static (archival) $(LIBRARY), shared
(dynamic link) $(SHARED_LIBRARY),
and/or import $(IMPORT_LIBRARY)
libraries
program:: recursively build $(PROGRAM)
executable
install:: recursively copy all libraries to
$(SOURCE_LIB_DIR) directory;
recursively copy all executables to
$(SOURCE_BIN_DIR) directory
clean:: remove all files specified in the
$(ALL_TRASH) variable
clobber:: synonym for "clean::" rule
realclean:: remove all files specified by
$(wildcard *.OBJ), dist, and in
the $(ALL_TRASH) variable
clobber_all:: synonym for "realclean::" rule
private_export:: recursively copy specified
cross-platform header files to the
$(SOURCE_XPPRIVATE_DIR) directory
IMPORT
------
import:: uses perl script to retrieve specified
VERSION of the binary release from
$(RELEASE_TREE)
RELEASE
-------
release_clean:: remove all files from the
$(SOURCE_RELEASE_PREFIX) directory
release:: place specified VERSION of the
binary release in the appropriate
$(RELEASE_TREE) directory
release_export:: recursively copy specified
cross-platform header files to the
$(SOURCE_XPHEADERS_DIR)/include
directory
release_md:: recursively copy all libraries to
$(SOURCE_RELEASE_PREFIX)/
$(SOURCE_RELEASE_LIB_DIR) directory;
recursively copy all executables to
$(SOURCE_RELEASE_PREFIX)/
$(SOURCE_RELEASE_BIN_DIR) directory
release_jars:: use perl script to package appropriate
files in the $(XPCLASS_JAR),
$(XPHEADER_JAR), $(MDHEADER_JAR), and
$(MDBINARY_JAR) jar files
release_cpdistdir:: use perl script to copy the
$(XPCLASS_JAR), $(XPHEADER_JAR),
$(MDHEADER_JAR), and $(MDBINARY_JAR)
jar files to the specified VERSION
of the $(RELEASE_TREE) directory
TOOLS and AUTOMATION
--------------------
platform:: tool used to display the platform name
as composed within the "arch.mk" file
autobuild:: automation rule used by "Bonsai" and
"Tinderbox" to automatically generate
binary releases on various platforms
tests:: automation tool used to run the
"regress" and "reporter" tools
on various regression test suites
The second section of "rules.mk" primarily contains several
"language" dependent build rules for binary releases. These are
generally "computed" rules (created on the "fly"), and include
rules used by "C", "C++", assembly, the preprocessor, perl, and
the shell.
The rules which dwell in this section and their purpose:
CATEGORY/rule:: Purpose
=================== =============================
LIBRARIES
---------
$(LIBRARY): build the static library
specified by the $(LIBRARY)
variable
$(IMPORT_LIBRARY): build the import library
specified by the
$(IMPORT_LIBRARY) variable
$(SHARED_LIBRARY): build the shared
(dynamic link) library
specified by the
$(SHARED_LIBRARY) variable
PROGRAMS
--------
$(PROGRAM): build the binary executable
specified by the $(PROGRAM)
rule
$(OBJDIR)/
$(PROG_PREFIX)%.pure: build the "purified" binary
executable specified by this
rule
OBJECTS
-------
$(OBJDIR)/
$(PROG_PREFIX)%$(OBJ_SUFFIX): build the object file
associated with the
makefile rule dependency:
%.c = C file
%.cpp = C++ file
%.cc = C++ file
%.s = assembly file
%.S = assembly file
$(OBJDIR)/
$(PROG_PREFIX)%: (NOTE: deprecated rule)
build the object file
associated with the
makefile rule dependency:
%.cpp = C++ file
MISCELLANEOUS
-------------
$(DIRS):: specifies a helper method
used by $(LOOP_THROUGH_DIRS)
to recursively change
directories and invoke
$(MAKE)
%.i: build the preprocessor file
associated with the
makefile rule dependency:
%.c = C file
%.cpp = C++ file
%: process the specified file
using the method associated
with the makefile rule
dependency:
%.pl = perl script
%.sh = shell script
alltags: tool used to recursively
create a "ctags"-style
file for reference
The third section of "rules.mk' primarily contains several JAVA
"language" build rules for binary releases. These are also
generally "computed" rules (created on the "fly").
The rules which dwell in this section and their purpose:
CATEGORY/rule:: Purpose
=================== =============================
$(JAVA_DESTPATH):: create directory specified
as the Java destination path
for where classes are
deposited
$(JAVA_DESTPATH)/$(PACKAGE):: create directories specified
within the $(PACKAGE)
variable
$(JMCSRCDIR):: create directory specified
as the JMC destination path
$(JRI_HEADER_CFILES): used to generate/regenerate
JRI header files for "C"
$(JRI_STUB_CFILES): used to generate/regenerate
JRI stub files for "C"
$(JNI_HEADERS): used to generate/regenerate
JNI header files for "C"
The fourth section of "rules.mk" primarily contains miscellaneous
build rules for binary releases. Many of these rules are here to
create new subdirectories, manage dependencies, and/or override
standard gmake "Makefile" rules.
The rules which dwell in this section and their purpose:
CATEGORY/rule:: Purpose
=================== =============================
$(PUBLIC_EXPORT_DIR):: create directory used to
house public "C" header files
$(PRIVATE_EXPORT_DIR):: create directory used to
house private "C" header
files
$(SOURCE_XP_DIR)/
release/include:: create directory used to
house "C" header files
contained in a release
$(MKDEPENDENCIES):: for UNIX systems, create
a directory used to house
dependencies and utilize
the $(MKDEPEND) rule to
create them
$(MKDEPEND):: cd to the dependency
directory and create them
depend:: if $(OBJS) exist, perform the
$(MKDEPEND) rule followed by
the $(MKDEPENDENCIES) rule
dependclean:: remove all files contained
in the dependency repository
.DEFAULT: standard gmake rule
.SUFFIXES: standard gmake rule
.PRECIOUS: standard gmake rule
.PHONY: standard gmake rule

View File

@@ -0,0 +1,90 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = cc
ifdef NS_USE_GCC
## gcc-2.7.2 homebrewn
CC = gcc
CCC = g++
AS = $(CC)
ASFLAGS += -x assembler-with-cpp
LD = gld
ODD_CFLAGS = -pipe -Wall -Wno-format
ifdef BUILD_OPT
OPTIMIZER += -O6
endif
MKSHLIB = $(LD)
MKSHLIB += -G -h $(@:$(OBJDIR)/%.so=%.so)
DSO_LDOPTS += -G -Xlinker -Blargedynsym
else
## native compiler (CDS++ 1.0)
# CC = /usr/bin/cc
CC = cc
CCC = /usr/bin/CC
AS = /usr/bin/cc
ODD_CFLAGS =
ifdef BUILD_OPT
OPTIMIZER += -O -F Olimit,4000
endif
MKSHLIB = $(CC)
MKSHLIB += -G -h $(@:$(OBJDIR)/%.so=%.so)
DSO_LDOPTS += -G -W l,-Blargedynsym
endif
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
NOSUCHFILE = /sni-rm-f-sucks
ODD_CFLAGS += -DSVR4 -DSNI -DRELIANTUNIX
CPU_ARCH = mips
RANLIB = /bin/true
# For purify
NOMD_OS_CFLAGS += $(ODD_CFLAGS)
# we do not have -MDupdate ...
OS_CFLAGS += $(NOMD_OS_CFLAGS)
OS_LIBS += -lsocket -lnsl -lresolv -lgen -ldl -lc /usr/ucblib/libucb.a
ifdef DSO_BACKEND
DSO_LDOPTS += -h $(DSO_NAME)
endif

View File

@@ -0,0 +1,37 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/ReliantUNIX.mk

View File

@@ -0,0 +1,38 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/SCO_SV3.2.mk

View File

@@ -0,0 +1,93 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = cc
CC = cc
OS_CFLAGS += -b elf -KPIC
CCC = g++
CCC += -b elf -DPRFSTREAMS_BROKEN -I/usr/local/lib/g++-include
# CCC = $(CORE_DEPTH)/build/hcpp
# CCC += +.cpp +w
RANLIB = /bin/true
#
# -DSCO_PM - Policy Manager AKA: SCO Licensing
# -DSCO - Changes to Netscape source (consistent with AIX, LINUX, etc..)
# -Dsco - Needed for /usr/include/X11/*
#
OS_CFLAGS += -DSCO_SV -DSYSV -D_SVID3 -DHAVE_STRERROR -DSW_THREADS -DSCO_PM -DSCO -Dsco
#OS_LIBS += -lpmapi -lsocket -lc
MKSHLIB = $(LD)
MKSHLIB += $(DSO_LDOPTS)
XINC = /usr/include/X11
MOTIFLIB += -lXm
INCLUDES += -I$(XINC)
CPU_ARCH = x86
GFX_ARCH = x
ARCH = sco
LOCALE_MAP = $(CORE_DEPTH)/cmd/xfe/intl/sco.lm
EN_LOCALE = C
DE_LOCALE = de_DE.ISO8859-1
FR_LOCALE = fr_FR.ISO8859-1
JP_LOCALE = ja
SJIS_LOCALE = ja_JP.SJIS
KR_LOCALE = ko_KR.EUC
CN_LOCALE = zh
TW_LOCALE = zh
I2_LOCALE = i2
LOC_LIB_DIR = /usr/lib/X11
NOSUCHFILE = /solaris-rm-f-sucks
BSDECHO = /bin/echo
ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@
#
# These defines are for building unix plugins
#
BUILD_UNIX_PLUGINS = 1
#DSO_LDOPTS += -b elf -G -z defs
DSO_LDOPTS += -b elf -G
DSO_LDFLAGS += -nostdlib -L/lib -L/usr/lib -lXm -lXt -lX11 -lgen
# Used for Java compiler
EXPORT_FLAGS += -W l,-Bexport

View File

@@ -0,0 +1,60 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 $(CORE_DEPTH)/coreconf/UNIX.mk
DEFAULT_COMPILER = cc
INCLUDES += -I/usr/dt/include -I/usr/openwin/include -I/home/motif/usr/include
# SunOS 4 _requires_ that shared libs have a version number.
# XXX FIXME: Version number should use NSPR_VERSION_NUMBER?
DLL_SUFFIX = so.1.0
CC = gcc
RANLIB = ranlib
CPU_ARCH = sparc
# Purify doesn't like -MDupdate
NOMD_OS_CFLAGS += -Wall -Wno-format -DSUNOS4
OS_CFLAGS += $(DSO_CFLAGS) $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
MKSHLIB = $(LD)
MKSHLIB += $(DSO_LDOPTS)
NOSUCHFILE = /solaris-rm-f-sucks
DSO_LDOPTS =
# -fPIC generates position-independent code for use in a shared library.
DSO_CFLAGS += -fPIC

View File

@@ -0,0 +1,46 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
SOL_CFLAGS += -D_SVID_GETTOD
include $(CORE_DEPTH)/coreconf/SunOS5.mk
ifeq ($(OS_RELEASE),5.10)
OS_DEFINES += -DSOLARIS2_10
endif
OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc

View File

@@ -0,0 +1,53 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
SOL_CFLAGS = -D_SVID_GETTOD
include $(CORE_DEPTH)/coreconf/SunOS5.mk
ifeq ($(USE_64),1)
CPU_ARCH = x86_64
else
CPU_ARCH = x86
OS_DEFINES += -Di386
endif
ifeq ($(OS_RELEASE),5.10_i86pc)
OS_DEFINES += -DSOLARIS2_10
endif
OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc

View File

@@ -0,0 +1,40 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
SOL_CFLAGS =
include $(CORE_DEPTH)/coreconf/SunOS5.mk

View File

@@ -0,0 +1,40 @@
#
# ***** 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 security libraries.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1994-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 *****
SOL_CFLAGS =
include $(CORE_DEPTH)/coreconf/SunOS5.mk

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