summaryrefslogtreecommitdiffstats
path: root/qjson.h
Commit message (Collapse)AuthorAgeFilesLines
* qjson.h: include compiler.h for GCC_FMT_ATTRAlon Levy2012-03-091-0/+1
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Merge remote branch 'qmp/for-anthony' into stagingAnthony Liguori2010-10-051-0/+1
|\
| * Add support for JSON pretty printingDaniel P. Berrange2010-10-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The monitor does not pretty-print JSON output, so that everything will be on a single line reply. When JSON docs get large this is quite unpleasant to read. For the future command line capabilities query ability, huge JSON docs will be available. This needs the ability to pretty-print. This introduces a new API qobject_to_json_pretty() that does a minimal indentation of list and dict members. As an example, this makes {"QMP": {"version": {"micro": 50, "minor": 12, "package": "", "major": 0}, "capabilities": []}} Output as { "QMP": { "version": { "micro": 50, "minor": 12, "package": "", "major": 0 }, "capabilities": [ ] } } NB: this is not turned on for the QMP monitor. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | Use GCC_FMT_ATTR (format checking)Stefan Weil2010-10-031-2/+2
| | | | | | | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil2010-10-031-2/+1
|/ | | | | | | | | | | | | | | | | Since version 4.4.x, gcc supports additional format attributes. __attribute__ ((format (gnu_printf, 1, 2))) should be used instead of __attribute__ ((format (printf, 1, 2)) because QEMU always uses standard format strings (even with mingw32). The patch replaces format attribute printf / __printf__ by macro GCC_FMT_ATTR which uses gnu_printf if supported. It also removes an #ifdef __GNUC__ (not needed any longer). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* QJSON: Introduce qobject_from_jsonv()Luiz Capitulino2009-12-031-0/+2
| | | | | | | | | It accepts a va_list and will be used by QError. Also simplifies the code a little, as the other qobject_from_() functions can use it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Provide marshalling mechanism for jsonAnthony Liguori2009-11-171-0/+3
| | | | | | | This introduces qobject_to_json which will convert a QObject to a JSON string representation. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add a QObject JSON wrapperAnthony Liguori2009-11-171-0/+23
This provides a QObject interface for creating QObjects from a JSON expression. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud