Commit Graph

23 Commits

Author SHA1 Message Date
Marc-André Lureau
bc4f5db323 codegen: ifdef/endif function declaration too
Compile out part that we are not supporting.  In the future, we might
want to declare a fake type and an empty function to keep API
compatibility
2012-03-21 13:24:17 +01:00
Marc-André Lureau
b6afcd632e codegen: include headers locally 2012-03-21 13:24:17 +01:00
Marc-André Lureau
2d4e0d2000 codegen: struct marshallers are not current function helper
This solves the issue of struct_marshallers being included within the
current ifdef/endif body, although they are independant functions.
2012-03-21 13:24:16 +01:00
Christophe Fergeau
a7cc3c6a56 handle @ifdef on messages and channels 2012-03-20 15:31:30 +01:00
Alon Levy
01580185e9 demarshaller/marshaller fix gcc 4.6.0
python_modules/demarshal.py and marshal.py fixes for gcc 4.6.0
warning about set but unused variables. The fixes disable creating
of variables mem_size when they are not used (demarshall) and
declaring a src variable when the message doesn't use it (marshal).

You need to touch *.proto after applying this (should add a Makefile
dependency).
2012-03-20 15:25:50 +01:00
Alon Levy
a99c9149b6 mingw32 build: python_modules/marshal: use unsigned for for_loop index variable 2012-03-20 15:25:50 +01:00
Alon Levy
c5e79b4215 support python 2.5.4+ for marshaller/demarshallers
Patch adds a "from __future__" import that doesn't affect newer python's but
allows python 2.5.4 to run the code (tested under scratchbox, n900 build environment)
2012-03-20 15:25:49 +01:00
Alexander Larsson
bcf9b8acf2 codegen: Allow @to_ptr to make inline structs demarshal as pointers 2012-03-20 15:25:49 +01:00
Alexander Larsson
bdcfb2c83d codegen: Various cleanups
Remove all uses of @end in the marshaller, instead just using
the C struct array-at-end-of-struct. To make this work we also remove
all use of @end for switches (making them C unions).

We drop the zero member of the notify message so that we can avoid this
use of @end for a primitive in the marshaller (plus its useless to send
over the wire).

We change the offsets and stuff in the migration messages to real pointers.
2012-03-20 15:25:48 +01:00
Alexander Larsson
bfffc11787 codegen: Pass member to SubMarshallingSource rather than name
This way we can check attributes on the member.
2012-03-20 15:25:48 +01:00
Alexander Larsson
ad7e75325d marshaller: Make @nonnull a propagated attribute
This cleans up some stuff
2012-03-20 15:25:47 +01:00
Alexander Larsson
1d5c7d1d79 marshaller: Add generic way to handle propagating attributes
Also switches @ptr_array to use this
2012-03-20 15:25:47 +01:00
Gerd Hoffmann
c5d06102b7 Properly parse and marshall SpiceString 2012-03-20 15:25:46 +01:00
Alexander Larsson
930458ea50 Support @marshall to automatically marshall pointers 2012-03-20 15:25:46 +01:00
Alexander Larsson
e6eb19e752 Store SpicePath segment count rather than size
Internally and in the network protocol (for the new version) we
now store the actual number of segments rather than the size of the
full segments array in bytes. This change consists of multiple changes
to handle this:

* Make the qxl parser calculate num_segments
* Make the canvas stroke code handle the new SpicePath layout.
* Fix up is_equal_path in red_worker.c for the new layout
* replace multiple calls to spice_marshall_PathSegment with a single
  spice_marshall_Path call
* Make the byte_size() array size handling do the conversion from
  network size to number of elements when marshalling/demarshalling.
* Update the current spice protocol to send the segment count rather than
  the size
* Update the old spice protocol to use the new byte_size functionallity
  to calculate the size sent and the number of elements recieved
2012-03-20 15:25:46 +01:00
Alexander Larsson
a45758117b Fix build error due to member "SpiceMsgEmpty" same name as type 2012-03-20 15:25:45 +01:00
Alexander Larsson
13d9b32acc Make pointers 32bit in new protocol format 2012-03-20 15:25:45 +01:00
Alexander Larsson
9e8883a1f8 Add support for @virtual markup in spice protocol
This means the member is not sent on the network at all.
Instead its initialized to the attribute argument when demarshalled.

This is useful for backwards compatibility support.
2012-03-20 15:25:44 +01:00
Alexander Larsson
7022f4d248 Make internal generated marshaller functions static 2012-03-20 15:25:44 +01:00
Alexander Larsson
bcc5cc0d91 Support extra prefix in code generators
This is require when we add a new spice.proto for the old (major 1)
protocol description.
2012-03-20 15:25:44 +01:00
Alexander Larsson
0349d2249d Support creating marshallers that are called indirectly
This is needed if we want to switch marshallers depending on what
major version the remote side has.
2012-03-20 15:25:44 +01:00
Alexander Larsson
075087b180 Make generated marshallers build on win32 2012-03-20 15:25:44 +01:00
Alexander Larsson
e83ff054d7 Add support for generating message and structure marshallers 2012-03-20 15:25:43 +01:00