mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-24 02:05:40 +00:00
dd77730d49
We would like to use a same QObject type to represent numbers, whether they are int, uint, or floats. Getters will allow some compatibility between the various types if the number fits other representations. Add a few more tests while at it. Backports commit 01b2ffcedd94ad7b42bc870e4c6936c87ad03429 from qemu
63 lines
2.1 KiB
C
63 lines
2.1 KiB
C
/*
|
|
* Input Visitor
|
|
*
|
|
* Copyright (C) 2017 Red Hat, Inc.
|
|
* Copyright IBM, Corp. 2011
|
|
*
|
|
* Authors:
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
|
*
|
|
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
|
|
* See the COPYING.LIB file in the top-level directory.
|
|
*
|
|
*/
|
|
|
|
#ifndef QMP_INPUT_VISITOR_H
|
|
#define QMP_INPUT_VISITOR_H
|
|
|
|
#include "qapi/visitor.h"
|
|
#include "qapi/qmp/qobject.h"
|
|
|
|
typedef struct QObjectInputVisitor QObjectInputVisitor;
|
|
|
|
/*
|
|
* Create a QObject input visitor for @obj
|
|
*
|
|
* A QObject input visitor visit builds a QAPI object from a QObject.
|
|
* This simultaneously walks the QAPI object being built and the
|
|
* QObject. The latter walk starts at @obj.
|
|
*
|
|
* visit_type_FOO() creates an instance of QAPI type FOO. The visited
|
|
* QObject must match FOO. QDict matches struct/union types, QList
|
|
* matches list types, QString matches type 'str' and enumeration
|
|
* types, QNum matches integer and float types, QBool matches type
|
|
* 'bool'. Type 'any' is matched by QObject. A QAPI alternate type
|
|
* is matched when one of its member types is.
|
|
*
|
|
* visit_start_struct() ... visit_end_struct() visits a QDict and
|
|
* creates a QAPI struct/union. Visits in between visit the
|
|
* dictionary members. visit_optional() is true when the QDict has
|
|
* this member. visit_check_struct() fails if unvisited members
|
|
* remain.
|
|
*
|
|
* visit_start_list() ... visit_end_list() visits a QList and creates
|
|
* a QAPI list. Visits in between visit list members, one after the
|
|
* other. visit_next_list() returns NULL when all QList members have
|
|
* been visited. visit_check_list() fails if unvisited members
|
|
* remain.
|
|
*
|
|
* visit_start_alternate() ... visit_end_alternate() visits a QObject
|
|
* and creates a QAPI alternate. The visit in between visits the same
|
|
* QObject and initializes the alternate member that is in use.
|
|
*
|
|
* Error messages refer to parts of @obj in JavaScript/Python syntax.
|
|
* For example, 'a.b[2]' refers to the second member of the QList
|
|
* member 'b' of the QDict member 'a' of QDict @obj.
|
|
*
|
|
* The caller is responsible for freeing the visitor with
|
|
* visit_free().
|
|
*/
|
|
Visitor *qobject_input_visitor_new(QObject *obj);
|
|
|
|
#endif
|