flatcc | FlatBuffers Compiler and Library in C for C | JSON Processing library
kandi X-RAY | flatcc Summary
kandi X-RAY | flatcc Summary
This project builds flatcc, a compiler that generates FlatBuffers code for C given a FlatBuffer schema file. This introduction also creates a separate test project with the traditional monster example, here in a C version. For now assume a Unix like system although that is not a general requirement - see also [Building] #building). You will need git, cmake, bash, a C compiler, and either the ninja build system, or make. scripts/initbuild.sh is optional and chooses the build backend, which defaults to ninja. The setup script builds flatcc using CMake, then creates a test project directory with the monster example, and a build script which is just a small shell script. The headers and libraries are symbolically linked into the test project. You do not need CMake to build your own projects once flatcc is compiled. To create another test project named foobar, call scripts/setup.sh -s -x ../foobar. This will avoid rebuilding the flatcc project from scratch.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of flatcc
flatcc Key Features
flatcc Examples and Code Snippets
Community Discussions
Trending Discussions on flatcc
QUESTION
I'm experimenting with flatbuffers, in C, just getting a feel for it. I'm having a weird issue. Well, a couple more than likely.
I think I'm building the flatbuffers and adding all the correct components in the correct manner. However, when I try to read a vector of tables, _vec_len(T) is returning size 0, even though when I hexdump the buffer I can clearly see the said tables being added to/removed from the buffer.
I've used more methods of getting the vector of tables to be readable than I can count. Most have ended with type mismatch compile errors. None of the ones that have actually compiled have resulted in _vec_len(T) returning anything other than 0.
I've also tried using _vec_at(0), but this causes an assertion to fail stating that the given index is out of range.
At this point, I'm either: a) missing something really simple, b) building the flatbuffer completely wrong, or c) making assumptions about how flatbuffers are built that are just plain incorrect.
I have attached my schema and source code, as well as debugging output from the program.
(I realized after posting that the code blocks dont include line numbers.)
The line that seems to be failing is size_t hops_vec_len = TransitHop_vec_len(hopsTable);
in the C code, near the bottom. Either that, or the entire block starting at // test_root routing
near the top is wrong.
By my understanding, using _start(B) and _end(B), everything that gets added to said component of the schema should be added to the buffer and placed into the v-tables for access automatically.
So, I'm not sure where to go. Can anyone point to what I'm doing wrong/misunderstanding? Any help is greatly appreciated.
flatbuffers_test.fbs
...ANSWER
Answered 2021-Mar-17 at 21:47I received a response from the flatcc author.
See https://groups.google.com/g/flatbuffers/c/mjkyhbA6vS8 for the complete response.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install flatcc
To initialize and run the build (see required build tools below):. The bin and lib folders will be created with debug and release build products. The build depends on CMake. By default the Ninja build tool is also required, but alternatively make can be used.
Install CMake, MSVC, and git (tested with MSVC 14 2015).
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page