On 09/16/2015 05:06 AM, Markus Armbruster wrote:
> New methods c_name(), c_type(), c_null(), json_type(),
> alternate_qtype().
> 
> Signed-off-by: Markus Armbruster <arm...@redhat.com>
> ---
>  scripts/qapi.py | 94 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 87 insertions(+), 7 deletions(-)
> 

> @@ -790,6 +830,16 @@ class QAPISchemaEnumType(QAPISchemaType):
>      def check(self, schema):
>          assert len(set(self.values)) == len(self.values)
>  
> +    def c_type(self, is_param=False):
> +        return c_name(self.name)
> +
> +    def c_null(self):
> +        return c_enum_const(self.name, (self.values + ['MAX'])[0],
> +                            self.prefix)

Yep, that becomes important in later patches.

Reviewed-by: Eric Blake <ebl...@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to