Single-file public-domain/open source C libraries with minimal dependencies
1–10 of 51 posts
Re: Single-file public-domain/open source C libraries with minimal dependencies
#2I don't understand this. Can someone explain it to me?
Re: Single-file public-domain/open source C libraries with minimal dependencies
#3* sqlite3 amalgamation: https://www.sqlite.org/download.html
* duktape javascript interpreter: http://duktape.org
Re: Single-file public-domain/open source C libraries with minimal dependencies
#4Why isn't SQLite's amalgamated build on this list? Come on. I don't understand this. Can someone explain it to me?
Re: Single-file public-domain/open source C libraries with minimal dependencies
#5It's an "expect"-like library written in C (and more sane than the Tcl original). It's 3 files, because it has a header file and a manual page.
It's just 390 lines of code because it's implemented using some PCRE trickery.
Re: Single-file public-domain/open source C libraries with minimal dependencies
#6I've never seen a C or C++ codebase that does this. Maybe you can rely on link-time deduplication, but it will still cause duplicate compilation, and thus increased compile times. I haven't thought it about it lately, but I thought the common wisdom was not to depend on the linker to dedupe or strip unused symbols. Actually it should cause link-time errors, not just duplicated cause.
The justification is also somewhat ridiculous: Why single-file headers?
Windows doesn't have standard directories where libraries live. That makes deploying libraries in Windows a lot more painful than open source developers on Unix-derivates generally realize. (It also makes library dependencies a lot worse in Windows.)
Really? Why not just lay out your source normally, and then munge it with a simple script into something Windows can handle (similar to sqlite)? Because writing trivial scripts on Windows is also a pain?
[1] https://github.com/nothings/stb
[2] https://github.com/nothings/stb/blob/master/stb_c_lexer.h
Re: Single-file public-domain/open source C libraries with minimal dependencies
#7And, separately, a small-single-file-but-correct XML parser: https://dev.yorhel.nl/yxml
Re: Single-file public-domain/open source C libraries with minimal dependencies
#8What about: * sqlite3 amalgamation: https://www.sqlite.org/download.html * duktape javascript interpreter: http://duktape.org
This is mentioned in the FAQ.
Re: Single-file public-domain/open source C libraries with minimal dependencies
#9Uh, this stb library [1] seems to follow a horrible pattern: not only combining your code into a single .c file (which is fine, like the sqlite amalgamation), but putting the code into a single .h file. [2] I've never seen a C or C++ codebase that does this. Maybe you can rely on link-time deduplication, but it will still cause duplicate compilation, and thus increased compile times. I haven't thought it about it lat…
Re: Single-file public-domain/open source C libraries with minimal dependencies
#10Kazlib contains a few single-file (actually one .c file and one .h file) open source C libraries. For example, there's a dictionary data structure based on red-black trees, dict.c/dict.h, which I've found to be useful and reliable. There's also a linked list library, a hash table library, etc., but I haven't used these.
Home page: http://www.kylheku.com/~kaz/kazlib.html
Source code: http://git.savannah.gnu.org/cgit/kazlib.git/tree/
The latest version uses the BSD License.