Commit graph

222 commits

Author SHA1 Message Date
Baruch Even
2bdc5c476a Implement capn_write_fd 2014-08-07 17:56:51 +03:00
Baruch Even
440c662c66 Implement packed memory write
This uses the capn_deflate function.

The current use may get smaller packing than the maximum possible due to
the inability to peak around segments as it packs each segment on its
own. This saves time compared to copying everything into one place and
saves effort by not requiring to change the interface of capn_deflate to
support multiple different buffers.

It should be possible to make the capn_deflate state machine better to
handle the multiple buffers case too.
2014-08-06 22:29:51 +03:00
Baruch Even
a83769f44d Fix use of wrong offset in buffer
The header of packing is a single byte and nothing was written to the
first byte anyway.
2014-08-06 22:28:24 +03:00
Baruch Even
24ec009d67 Use constants where possible
The hdr variable gets the same constants as value but it is easier to
understand that the constants are used than the hdr which needs to be
traced to the value it received.
2014-08-06 22:28:24 +03:00
Baruch Even
a46581a35e Move initialization closer to use
Should make it a bit more readable, the variable is used before that
case as well but doesn't require the zero initialization in that case.
2014-08-06 22:28:24 +03:00
Baruch Even
0071546cd2 Add comments 2014-08-06 22:28:24 +03:00
Baruch Even
49483a6bbd Forego updating sz in capn_write_mem
It is not used and we already validated the total buffer size
beforehand.
2014-08-06 22:28:24 +03:00
Baruch Even
d785521932 Recompile capnpc schemas for capnpc 0.4 2014-08-03 23:22:28 +03:00
Baruch Even
8a33a1864a Add a README.md file 2014-08-03 23:07:34 +03:00
Baruch Even
54ca88f6ac Simpler makefile
No real need to build a gtest archive, gtest-all.cc includes all the
files so a single .o is fine.
2014-08-03 22:28:41 +03:00
Baruch Even
20bd625dc2 Fix build
Renamed gtest/include to gtest/gtest since that's what the include files
expected.

Adjusted the Makefile to work through it all.
2014-08-03 22:18:08 +03:00
Johan De Claville Christiansen
4cc7785d53 Added eclipse output files to git ignore 2014-03-25 19:13:56 +01:00
Johan De Claville Christiansen
d84a635fb0 Fixed compilation by removing 32-bit padding 2014-03-25 19:12:58 +01:00
Johan De Claville Christiansen
bf5eb7f92c Added gtest 1.6.0, since the included version lacked the headers 2014-03-25 18:55:18 +01:00
Johan De Claville Christiansen
1eb82b0f4a Added install target 2014-03-25 18:00:41 +01:00
Johan De Claville Christiansen
1d79a28091 Fixed: missing terminating ' character 2014-03-25 17:50:39 +01:00
Steven Dee
cb26aeac8d Add padding to preserve alignment on 32-bit systems 2014-02-26 02:03:17 +00:00
Steven Dee
823a820e87 Initialize x and y unconditionally
Fixes a compiler warning.
2014-02-26 01:24:50 +00:00
Steve Dee
89f1ac3953 Merge remote-tracking branch 'urbit/master'
Conflicts:
	capn-malloc.c
2014-02-24 10:19:39 -08:00
James McKaskill
36348a2375 Merge pull request #2 from urbit/capn-write
Add TODO and fail on packed writes
2014-02-21 16:59:31 -05:00
Steve Dee
45b95c38d0 Add TODO and fail on packed writes 2014-02-21 13:23:57 -08:00
James McKaskill
9019ca2326 Merge pull request #1 from urbit/capn-write
Implement serialization to buffers
2014-02-20 20:38:20 -05:00
Steve Dee
ca03b34318 Implement serialization to buffers 2014-02-20 17:13:57 -08:00
Steve Dee
68340f87c1 Implement serialization to buffers 2014-02-20 17:12:59 -08:00
Steve Dee
322aa16624 Ignore capn.a 2014-02-05 15:25:18 -08:00
Steve Dee
f0dc17cede Static capnpc-c 2014-02-05 15:05:26 -08:00
Steve Dee
859ab61a07 Add capn.a target 2014-02-05 14:02:35 -08:00
James McKaskill
2c48f47b3d clean up of write_ptr 2013-12-10 20:34:04 -05:00
James McKaskill
df3e668f79 Integrate gtest in rather than use gtest-config 2013-12-10 20:33:33 -05:00
James McKaskill
ff44e4df26 remove CAPN_COMPOSITE_LIST and add capn_len 2013-09-16 16:53:33 -04:00
James McKaskill
59f827e93d change ptrsz to ptrs to free up space in capn_ptr 2013-09-13 10:02:03 -04:00
James McKaskill
7397df1216 misc minor cleanup 2013-09-12 23:57:29 -04:00
James McKaskill
7b0bfece26 add version checks 2013-09-12 23:28:36 -04:00
James McKaskill
fc63a080a0 Add special case for capn_setp when handed a far pointer 2013-09-12 23:20:58 -04:00
James McKaskill
081c783bbf don't autoresolve pointers 2013-09-12 17:26:51 -04:00
James McKaskill
e6c57a665e Remove interface code 2013-09-12 16:44:20 -04:00
James McKaskill
f4f0ccabf8 Add MIT license 2013-09-12 15:17:22 -04:00
James McKaskill
bba43e67ea Add test schema 2013-09-12 14:55:42 -04:00
James McKaskill
9682fb2611 list out constants in declaration order 2013-09-12 14:48:11 -04:00
James McKaskill
448021e7e1 use create_local 2013-09-12 14:42:30 -04:00
James McKaskill
ca1d07f657 Round trip the schema through the compiler 2013-09-12 14:37:15 -04:00
James McKaskill
82e55f6515 declare enums first 2013-09-12 14:26:22 -04:00
James McKaskill
cada8df6c2 Decode field slot when we get around to declaring it rather than early as the names aren't resolved yet 2013-09-12 14:23:40 -04:00
James McKaskill
316f470c3b Handle reserved words 2013-09-12 14:14:21 -04:00
James McKaskill
225399e091 Header cleanup 2013-09-12 13:51:32 -04:00
James McKaskill
9f75d0c7a6 Update compiler to support groups/unions 2013-09-12 13:49:19 -04:00
James McKaskill
7731509861 add read/write methods for interfaces 2013-05-12 23:10:54 -04:00
James McKaskill
21e7c29a96 add interface to base lib and improve handling of empty lists 2013-05-12 22:58:48 -04:00
James McKaskill
93f695f77c add constants 2013-05-12 17:21:56 -04:00
James McKaskill
2eb6628ae4 add support for default values 2013-05-12 00:59:47 -04:00