Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitcloud.c: Pack and parse UBJSON #58

Open
gnostication opened this issue Aug 15, 2014 · 3 comments
Open

Bitcloud.c: Pack and parse UBJSON #58

gnostication opened this issue Aug 15, 2014 · 3 comments

Comments

@gnostication
Copy link
Contributor

complete and test the functions to pack UBJSON messages and parse them back into data.

command line interface test may look like:

bitcloud -ubjson FileName_to_pack new_file

this would open and read FileName as pure data, pack it into a UBJSON message, and output two files.

First file to output (e.g., "FileName.ubjson") would be a raw UBJSON output to prove that the function packs properly (hex editor required for analysis and validation). Second file would take the output from the UBJSON message packing function and output a New_File as the result to validate that unpacking works. (diff to compare)

@JaviLib JaviLib self-assigned this Sep 25, 2014
@JaviLib
Copy link
Contributor

JaviLib commented Sep 25, 2014

I'm actually doing these in the serialization routines bc_serialize_row and bc_deserialize_row, taking in count that data is going to be stored in an array of cells (bc_cell and bc_row, this last one is just a pointer). Once I have the routines working, it should be trivial to serialize rows, but I'm not sure why would you like to deserialize an entire file.

This issue should be very much related to the event loop, as the event loop may analize the ubjson data coming from the sockets. We should debate the way to do this. Again, it is not the same to deserialize rows than to deserialize "instructions", althought the principles are the same.

The magic of ubjson is that it is very easy to parse and do not require external frunctions (everything is done in a switch). Remember that C do have a problem with types, you must use unions if you want to respond in the same routine with different data types, so creating a generic deserialization function is not really trivial and easy tu use. We can debate this.

@JaviLib
Copy link
Contributor

JaviLib commented Sep 25, 2014

I have done some updates to the ubjson specification in the bitcloud.h, after the conversation on IRC.

@ucefkh
Copy link
Contributor

ucefkh commented Sep 25, 2014

okay cool
will take a look on it :)

@gnostication gnostication changed the title Pack and parse UBJSON Bitcloud.c: Pack and parse UBJSON Oct 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants