zserge / jsmn

Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
MIT License
3.72k stars 783 forks source link

Feature Request: variant with separate jsmn.h and jsmn.c #228

Open rdpoor opened 2 years ago

rdpoor commented 2 years ago

As much as I admire the "single jsmn.h file does it all" approach, our workflow and testing methodologies require separate headers (.h) and executables (.c).

Consequently, I find myself periodically pulling down the latest jsmn,h and then teasing out the functions for a jsmn.c file. It's not particularly difficult, but it would be nice if that pair of files were readily available, perhaps in its own directory.

(If you're willing to entertain such an approach, I'm willing to create a pull request...)

someburner commented 2 years ago

I would just track your own version prior to 18e9fe42cbfe21d65076f5c77ae2be379ad1270f

BenBE commented 2 years ago

I'd very much appreciate having the header and implementation stuff separate.

While single-file libraries make somewhat sense with C++ (re template instantiation) they are just annoying with plain C as they cause additional work on the build system side.

wnoliveira commented 1 year ago

I don't know if there is an intention to change the philosophy of this library from a single header to a source and a header file. I've used in a project a version with minor increments and the change to a .c and .h.

@zserge if you find it interesting, I can make a pull-request. If not, for those who want this feature, you can use the repo https://github.com/programacao-eletronica/jsmn .

rdpoor commented 10 months ago

Hah! I didn't see @wnoliveira 's note until after I forked a two-file implementation as well. Mine differs in that it makes the fewest number of changes to zserge's original repository as possible: https://github.com/rdpoor/jsmn

@BenBE https://github.com/rdpoor/jsmn should be what you're asking for...