summaryrefslogtreecommitdiffstats
path: root/python_modules
Commit message (Collapse)AuthorAgeFilesLines
* python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix ↵Alon Levy2012-06-141-1/+1
| | | | | | | | | | broken enums generation Fixes the resulting enums.h from the invocation of: ./spice_codegen.py --generate-enums spice.proto spice-protocol/spice/enums.h Right now any enum will contain None as the enum members, with this fix it will contain the real enum members, i.e. SPICE_FOO.
* demarshall: add missing parens in BE read_xxx functionsChristophe Fergeau2012-04-061-1/+1
| | | | The missing parens causes build to fail on big-endian machines
* build-sys: make it a seperately buildable spice-common libraryMarc-André Lureau2012-03-221-1/+12
| | | | | | | - autotoolize - fix headers inclusion - generate gitignores - workaround serverSMARTCARD support with dirty hack...
* codegen: ifdef/endif function declaration tooMarc-André Lureau2012-03-211-0/+2
| | | | | | 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
* codegen: include headers locallyMarc-André Lureau2012-03-211-2/+2
|
* codegen: struct marshallers are not current function helperMarc-André Lureau2012-03-211-2/+3
| | | | | This solves the issue of struct_marshallers being included within the current ifdef/endif body, although they are independant functions.
* spice_codegen: Always write a channels entry for an ifdef-ed channelHans de Goede2012-03-202-0/+11
| | | | | | | | | | | | | | | | | Before this patch, if a channel is defined conditionally in spice.proto (because it depends on external headers like the smartcard channel), spice_codegen would write an entry to the channels array in spice_get_*_channel_parser which would only take up a place in the array if the ifdef condition is true, thus moving up all other intializers one place when it is not true. This was causing issues (crashes) when building spice-gtk with the combination of usbredir support enabled and smartcard support disabled. This patch fixes this by adding #else { NULL, 0 }, to the generated code. Thanks to coolper chen <lixin.chen@saicocch.com> for reporting this! Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* handle @ifdef on messages and channelsChristophe Fergeau2012-03-202-7/+43
|
* allow attributes on channel elements in .proto filesChristophe Fergeau2012-03-202-2/+4
| | | | | | We want to be able to add an @ifdef annotation to optional messages For example, we want to compile in the smartcard messages only if libcacard is available
* add ifdef/endif methods to spice code generatorChristophe Fergeau2012-03-201-0/+12
| | | | | These methods will be needed to be able to make some fields optional in spice.proto
* fix copy & paste error in ptypes.pyChristophe Fergeau2012-03-201-3/+1
|
* demarshal: fixed-size array are missing __nelementsMarc-André Lureau2012-03-201-1/+1
| | | | | | A message with a fixed-size array, such as uint8 uuid[16] will generate an invalid code, missing the __nelements variable. Make sure that variable is defined.
* Remove trailing blank linesDaniel P. Berrange2012-03-202-2/+0
| | | | Remove any blank lines at the end of all source files
* codegen: Fix enums.h generationHans de Goede2012-03-201-1/+3
| | | | | | | | | | | | | With the new usbredir code we have the new concept of the abstract / generic spicevmc channel type (which just tunnels data from a qemu chardev), and we've the usbredir channel, which is the only current user of this. This was reflected in the protocols enum in spice-protocol.h by a manual edit done by me, my bad. This patch teaches spice.proto about the relation between the abstract spicevmc channel and the usbredir channel and modifies codegen to deal with this. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* add check for pyparsingChristophe Fergeau2012-03-201-3/+8
| | | | | | Check both in configure.ac (after checking if we need to rebuild the marshalling files) and in the python script using pyparsing (for people modifying .proto files in tarballs)
* python: remove c-ism trailing ;Marc-André Lureau2012-03-204-23/+23
|
* codegen: typedef the protocol enumsMarc-André Lureau2012-03-201-4/+12
| | | | | | | Commit 9d5ef9beeca722b2ceff7d15aaa3aaaaf07ecfbf in spice-protocol introduced a typedef manually in the generated enums.h header. This patch adds them automatically to all enums during enums.h generation.
* python_modules/codegen.py: fix indent error in an unused functionAlon Levy2012-03-201-1/+1
|
* demarshaller/marshaller fix gcc 4.6.0Alon Levy2012-03-202-9/+21
| | | | | | | | | | 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).
* codegen: avoid creating out if not used (fix gcc 4.6.0 warning)Alon Levy2012-03-201-3/+5
|
* mingw32 build: python_modules/marshal: use unsigned for for_loop index variableAlon Levy2012-03-201-1/+1
|
* spice codegen: fix copy-o, no such variable valueAlon Levy2012-03-201-1/+1
|
* support python 2.5.4+ for marshaller/demarshallersAlon Levy2012-03-203-0/+3
| | | | | 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)
* demarshaller: Fix palette marshallingAlexander Larsson2012-03-201-14/+32
| | | | | | | It turns out that using base + sizeof(struct) is not a good way to access an array at the end of a struct. For SpicePalette sizeof is 16, but offset of ents is 12. Using this calculation in the demarshaller breaks things badly, so now we use the actual array member.
* Fix uninitialized variable warningsAlexander Larsson2012-03-201-1/+1
|
* Don't send CursorHeader if cursor_flags is NONEAlexander Larsson2012-03-203-4/+7
|
* codegen: Allow @to_ptr to make inline structs demarshal as pointersAlexander Larsson2012-03-203-9/+37
|
* codegen: Various cleanupsAlexander Larsson2012-03-202-58/+44
| | | | | | | | | | | | 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.
* codegen: Pass member to SubMarshallingSource rather than nameAlexander Larsson2012-03-201-9/+10
| | | | This way we can check attributes on the member.
* codegen: Remove unused methos has_pointer()Alexander Larsson2012-03-201-27/+0
|
* Make distcheck workAlexander Larsson2012-03-201-1/+1
|
* Fix inclusion of common files, no need for common/ partAlexander Larsson2012-03-201-1/+1
|
* codegen: No SPICE_ADDRESS types left, drop @c_ptrAlexander Larsson2012-03-202-19/+12
|
* Properly parse QXLImage to the new-world SpiceImageGerd Hoffmann2012-03-203-10/+27
| | | | | SpiceImage now replaces RedImage and has all image types in it. All image data are now chunked (and as such not copied when demarshalling).
* codegen: support @chunk on non-pointer arraysAlexander Larsson2012-03-202-5/+29
| | | | This is similar to @as_ptr, but generates a single chunk of data.
* Add support for @chunkAlexander Larsson2012-03-201-2/+18
|
* marshaller: Make get_nw_offset() handle deep member referencesAlexander Larsson2012-03-201-7/+32
|
* Convert SpicePath.segments to a pointer arrayAlexander Larsson2012-03-201-23/+28
|
* Handle extra size for switch and array the right wayAlexander Larsson2012-03-201-23/+20
| | | | | | Even for is_extra_size() we should calculate the mem_size for arrays, its just that the parent type (in this case switch) should request mem_size if the type is_extra_size.
* marshaller: Add some docs describing the types of sizesAlexander Larsson2012-03-201-0/+29
|
* marshaller: Make @nonnull a propagated attributeAlexander Larsson2012-03-203-6/+3
| | | | This cleans up some stuff
* marshaller: Make @c_ptr a propagated attributeAlexander Larsson2012-03-202-17/+18
| | | | This simplifies some code
* marshaller: Add generic way to handle propagating attributesAlexander Larsson2012-03-203-11/+18
| | | | Also switches @ptr_array to use this
* Properly parse and marshall SpiceStringGerd Hoffmann2012-03-203-11/+61
|
* Fix 32bit failure in demarshallerAlexander Larsson2012-03-201-2/+2
| | | | Due to a typo we always read offsets as pointers, never as SPICE_ADDRESS.
* Simplify SpiceLineAttr by removing unsed stuffAlexander Larsson2012-03-202-5/+21
| | | | Also in new protocol don't send style data if not needed.
* Support @marshall to automatically marshall pointersAlexander Larsson2012-03-202-28/+40
|
* Store SpicePath segment count rather than sizeAlexander Larsson2012-03-203-12/+33
| | | | | | | | | | | | | | | | | | | 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
* demarshaller: Support @c_ptr attributes for pointersAlexander Larsson2012-03-201-7/+16
| | | | | | A @c_ptr pointer is stored in memory as a real pointer rather than a SPICE_ADDRESS. This is a temporary thing that will be removed again when all SPICE_ADDRESSes have been converted to real pointer.
* demarshaller: Don't parse @zero membersAlexander Larsson2012-03-201-1/+4
| | | | | | These just write zeros at the right place in the network protocol typically for old back-compat things. We don't want to read these back in.