JSON files support library released for both DDE and GCC
Paolo Fabio Zaino (28) 1882 posts |
To everyone interested, https://github.com/RISC-OS-Community/LibCJSON For GCC, it builds automatically both static and shared libs. Comes with instructions to use on RISC OS and examples. Also, updated and fixed few issues reported by users with the LibEzINI (this library is useful if you wish to use !ConfX with your C and C++ code) here: https://github.com/RISC-OS-Community/LibEzINI Also EzINI builds fine with GCC and DDE (and can export libs and header to DDE Export too if one wish). I still recommend to use them via their !LibCJSON and !LibEzINI, but if one wish to integreate them with your own DDE Export libraries set, now you can do that too. LibEzINI too comes with instructions to use on RISC OS and examples. Given they both build with DDE, you can obviously use them also into your Modules. LibCJSON is particoularly useful with C and C++ code that wish to deal with RESTFul API (and so use 3rd party services on-line for data or processing). I also use it in my RISC OS Cluster (just as an example). If you still don’t know how to use git and GitHub with RISC OS, here is a set of videos to help you learning how to use git with RISC OS in all sauces :) https://www.youtube.com/playlist?list=PLEnraaJ9VQfWDl5T4D0P51pG89KRzj0n1 Enjoy! |
Chris Mahoney (1684) 2165 posts |
What does the “RISC OS port” of cJSON actually do? cJSON is written in ANSI C (C89) and should “just work” without any porting effort required. I’m using it myself in a couple of projects and all I do is add cjson.c and cjson.h and then start using it. Is there something different about your port? Does it do something extra that the plain C version doesn’t? I confess that I’m a bit sleepy at the moment but I’m just struggling to see what you’ve actually done with it. No offence intended :) |
Paolo Fabio Zaino (28) 1882 posts |
I am adding a wrapper for DDE C++ (that is C++, not just calling functions in C), also added the packaging and ease of use (there is one on PackMan that is only GCC, in the sense that it distributed as binary for GCC), also added the DLL build, which is not present in the PackMan one.
If you use only C and do not need any C++ stuff, then you should be fine with the way you’re using it already, not need for this one. If instead you want to have a C++ version (class and objects), then stay tuned it will get included in this repo, so it’s also “one repository catch them all”, all builds for GCC C, all builds for DDE C and all builds for C++ for both GCC and DDE (still need to finish the C++ , ’cause DDE C++ is being a bit painful as usual XD ) If I have time, I’ll add binding for Lua too, but no plan for it at the moment ‘cause I don’t have an immediate need for Lua. Plus a bunch of people asked me if I could share what I am using for my API clients on RO, and cJSON is one of the pieces obviously. Hope this helps |
Charles Ferguson (8243) 427 posts |
Similarly, I’m using it in one of my projects – https://github.com/gerph/robuild-client/tree/master/riscos/cJSON – where I pull it in as a submodule, and just pulled it in with some renaming. Paolo has packaged it so that it’s easier to use? It’s probably more handy to have a pre-built version of the library though, rather than including it in each project. David Gamble, the original author, is an ex-RISC OS user. ISTR he wrote !Undelete. |
Paolo Fabio Zaino (28) 1882 posts |
Nice!!! :)
True, also pre-built libs “boost” DDE (and GCC on RO) compilation perfs making the whole process less tedious when one needs to recompile their own apps multiple times. |
Jean-Michel BRUCK (3009) 362 posts |
Now all I have to do is find tutorials on JSON and test with DDE and C++…Thanks Libraries are the pillars of programming like the OS. |