aboutsummaryrefslogtreecommitdiff
path: root/qjson.h
AgeCommit message (Collapse)AuthorFilesLines
2012-03-09qjson.h: include compiler.h for GCC_FMT_ATTRAlon Levy1-0/+1
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-10-05Merge remote branch 'qmp/for-anthony' into stagingAnthony Liguori1-0/+1
2010-10-03Use GCC_FMT_ATTR (format checking)Stefan Weil1-2/+2
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil1-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>
2010-10-01Add support for JSON pretty printingDaniel P. Berrange1-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>
2009-12-03QJSON: Introduce qobject_from_jsonv()Luiz Capitulino1-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>
2009-11-17Provide marshalling mechanism for jsonAnthony Liguori1-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>
2009-11-17Add a QObject JSON wrapperAnthony Liguori1-0/+23
This provides a QObject interface for creating QObjects from a JSON expression. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>