NSPR accepts contributions in the form of bugfixes, new features, libraries, platform ports, documentation, test cases and other items from many sources. We (the NSPR module owners) sometimes disappoint our contributors when we must reject their contributions. We reject contributions for a variety of reasons. Some of these reasons are not obvious to an outside observer. NSPR wishes to document some guidelines for those who would contribute to NSPR. These guidelines should help the contributor in crafting his contribution, increasing its likelihood for acceptance.
C Language API. The NSPR API is a C Language API. Please do not contribute Java, C++ or other language wrappers.
Coding Style. NSPR does not have a documented coding style guide. Look at the extant code. Make yours look like that. Some guidelines concerning naming conventions can be found in NSPR Naming Conventions in the NSPR Reference. See also: XXX
Ownership of your contribution. When you contribute something to NSPR, you must have intellectual property rights to that contribution. This means that you cannot give us something you snatched from somewhere else;. it must be your own invention, free and clear of encumberment of anyone or anything else; pay close attention to the rights of your "Day-Job" employer. If you snatched it from somewhere else, tell us where; show us where the right to incorporate it into NSPR exists.
License under MPL or GPL. When you contribute material to NSPR, you agree to allow your contribution to be licensed under the MPL or GPL.
Bugzilla to track bugs. Document the bug or use an existing report. Be verbose in describing what you are doing and why.
Include your changes as diffs in an attachment to the BugZilla report.
Use a coding style consistent with the source file you are changing.
NSPR is mostly complete. New APIs are driven mostly by the OS vendors as they add new features. Should you decide that there's something that NSPR does not cover that should be covered, let's talk. Your proposed API should encapsulate a relatively low level capability as would be found in a system call or libc.
Your new feature must be implemented on all platforms supported by NSPR. When you consider a new API for NSPR ask yourself if your proposed feature can implement it across all platforms supported by NSPR. If several platforms cannot be made to implement your API, then it is not a good candidate for inclusion in NSPR.
Before you begin what may be a substantial effort in making a candidate feature for NSPR, talk to us. We may tell you that you have a good idea; we may say that it really is not a good candidate for inclusion in NSPR; we may give you suggestions on what would make it more generalized, hence a good candidate for inclusion in NSPR.
Use Bugzilla to track your work. Be verbose.
NSPR wants you to document your work. If we accept it, we are going to have to answer questions about it and/or maintain it. These are some guidelines for new APIs that you may add to NSPR.
Header File Descriptions. Provide header file descriptions that
fully document your public typedefs, enums, macros and functions.
See: prshm.h as an example of how your header file(s) should be documented.
Source File Descriptions. Provide descriptive documentation in your source (*.c) files. Alas, we have no source files documented as we think they should be.
The following are some general guidelines to use when implementing new features:
- Don't export global variables.
- Your code must be thread safe.
- You must provide test cases that test all APIs you are adding. See: Test Cases.
For purposes of this paper, a "new library" is defined as a libary under
the mozilla/nsprpub/lib directory tree and built as a separate
library. These libraries exist, for the most part, as "legacy" code from
NSPR 1.0. [Note that the current NSPR module owners do not now nor never
have been involved with NSPR 1.0.]. Such is life. That said: There are
some libraries that implement functions intended for use with applications
using NSPR, such as ...nsprpub/lib/libc/plgetopt.*.
- generally useful
- platform abstractions
- you agree to sustain, bug fix
- May rely on the NSPR API
- May NOT rely on any other library API
- platform specific headers in pr/include/md/_platformname.[h!cfg]
- platform specific code in pr/src/md/platform/*.c
- make rules in config/_platform.mk
New Features. Use the style of other NSPR documentation. We will see that your documentation is transcribed into the appropriate word processor and the derived HTML shows up on mozilla.org.
Give consideration to providing a test case when fixing a bug if an existing test case did not catch a bug it should have caught.
The new test cases should be implemented in the style of other NSPR test cases.
Test cases should prove that the added API items work as advertized.
Test cases should serve as an example of how to use the API items.
Test cases should provoke failure of every API item and report its failure.
A: Check the Bugzilla report covering your contribution.
Last Update: $Id: contributors.html,v 1.2 2006/02/11 02:59:27 reed%reedloden.com Exp $