-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,716 additions
and
759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#CWPack - Example | ||
|
||
The example contains a program that takes a json file and then converts it to a messagePack file, then converts the latter back to json. | ||
|
||
In the script runExample.sh the 2 json files are also diffed. | ||
|
||
The files `item.(h,c)` contains a memory tree representation of json data and the conversion routines: | ||
|
||
- Item Tree To Json File | ||
- Item Tree To MessagePack File | ||
- Json File To Item Tree | ||
- MessagePack File To Item Tree | ||
|
||
The conversion routines are just examples and not of production quality. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
clang -ansi -I ../src/ -o json2cwpack2json *.c ../src/*.c | ||
clang -ansi -I ../src/ -I ../goodies/basic-contexts/ *.c ../src/*.c ../goodies/basic-contexts/*.c -o json2cwpack2json | ||
./json2cwpack2json test1.json | ||
diff -a test1.json test1.json.msgpack.json | ||
rm -f *.o test1.json.msgpack.json json2cwpack2json | ||
rm -f *.o json2cwpack2json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#CWPack - Goodies - Basic Contexts | ||
|
||
|
||
Basic contexts contains 3 contexts: | ||
|
||
- **Dynamic Memory Pack Context** is used when you want to pack to a malloc´d memory buffer. At buffer overflow the context handler tries to reallocate the buffer to a larger size. | ||
|
||
- **File Pack Context** is used when you pack to a file. At buffer overflow the context handler writes the buffer out and then reuses it. If an item is larger than the buffer, the handler tries to reallocate the buffer so the item would fit. | ||
|
||
- **File Unpack Context** is used when you unpack from a file. As with File Pack Context, the handler asserts that an items will always fit in the buffer. |
Oops, something went wrong.