Source

uchardet-enhanced / libcharsetdetect / nspr-emu / README.md

NSPR emulation library

Author: Max Bolingbroke (batterseapower@hotmail.com)

This library was created by pulling together the minimal pieces of NSPR required to get the Universal Character Set Detector (UCSD) to compile. It turns out that the UCSD uses only very minimal parts of NSPR, so we can get away with just a few header files and totally forget about linking to the library.

Precisely, we used these files from NSPR v4.8.6:

  • prtypes.h
  • prmem.h
  • obsolete/protypes.h

I then patched some prototypes in prmem.h to use C library functions directly. The protypes were replaced with #define directives that ensure that callers of PR_Malloc, PR_Calloc, PR_Realloc, PR_Free just use their C library counterparts directly.

To finish off, I needed to provide prcpucfg.h. Normally this is generated by the nspr build process, but to simplify things I used the version from Google's Chrome source tree that just uses the preprocessor to choose between several pre-generated versions.

I had to patch the Google-provided prcpucfg.h so that the #included paths pointed to the right directory.

Licensing

Chromium (and thus presumably their contribution) is licensed under the BSD license.

NSPR is licensed under the MPL/GPL/LGPL tri-license.

Thus, this emulation library is licensed under the LGPL (I think).

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.