From db8ca3645f95b292131d1a4c0f760f81a514cc3a Mon Sep 17 00:00:00 2001 From: Phillip Howell Date: Fri, 13 Sep 2013 16:35:39 -0500 Subject: [PATCH 1/2] Clarified json_load_callback_t return value docs --- doc/apiref.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/apiref.rst b/doc/apiref.rst index 9218cf8..3032d10 100644 --- a/doc/apiref.rst +++ b/doc/apiref.rst @@ -994,8 +994,9 @@ The following functions perform the actual JSON decoding. corresponding :func:`json_load_callback()` argument passed through. On error, the function should return ``(size_t)-1`` to abort the - decoding process. When there's no data left, it should return 0 to - report that the end of input has been reached. + decoding process. On success, it should return the number of bytes read; + a returned value of 0 indicates that no data was read and that the end of + file has been reached. .. versionadded:: 2.4 From bf2584703a486af36190ecd20c529dbf7b0f4310 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Mon, 16 Sep 2013 08:48:54 +0300 Subject: [PATCH 2/2] Mention success first in json_load_callback_t docs --- doc/apiref.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/apiref.rst b/doc/apiref.rst index 3032d10..25260e9 100644 --- a/doc/apiref.rst +++ b/doc/apiref.rst @@ -993,10 +993,10 @@ The following functions perform the actual JSON decoding. *buffer* points to a buffer of *buflen* bytes, and *data* is the corresponding :func:`json_load_callback()` argument passed through. - On error, the function should return ``(size_t)-1`` to abort the - decoding process. On success, it should return the number of bytes read; - a returned value of 0 indicates that no data was read and that the end of - file has been reached. + On success, the function should return the number of bytes read; a + returned value of 0 indicates that no data was read and that the + end of file has been reached. On error, the function should return + ``(size_t)-1`` to abort the decoding process. .. versionadded:: 2.4