/*
* jsonb type recv function
*
- * the type is sent as text in binary mode, so this is almost the same
+ * The type is sent as text in binary mode, so this is almost the same
* as the input function, but it's prefixed with a version number so we
* can change the binary format sent in future if necessary. For now,
* only version 1 is supported.
* array and then its first (and only) member.
*/
(void) JsonbIteratorNext(&it, &v, true);
- (void) JsonbIteratorNext(&it, &v, true);
switch (v.type)
{
case jbvNull:
/*
* JsonbToCString
- * Converts jsonb value in C-string. If out argument is not null
- * then resulting C-string is placed in it. Return pointer to string.
+ * Converts jsonb value to a C-string.
+ *
+ * If the out argument is nonnull, the resulting C-string is stored inside the
+ * stringuffer. The resulting string is always returned.
+ *
* A typical case for passing the StringInfo in rather than NULL is where
* the caller wants access to the len attribute without having to call
* strlen, e.g. if they are converting it to a text* object.
/*-------------------------------------------------------------------------
*
- * jsonb_support.c
+ * jsonb_util.c
* Support functions for jsonb
*
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
* Find value in object (i.e. the "value" part of some key/value pair in an
* object), or find a matching element if we're looking through an array. Do
* so on the basis of equality of the object keys only, or alternatively
- * element values only, with a caller-supplied value "key". "flags" argument
- * allows caller to specify which container types are of interest.
+ * element values only, with a caller-supplied value "key". The "flags" argument
+ * allows the caller to specify which container types are of interest.
*
* This exported utility function exists to facilitate various cases concerned
* with "containment". If asked to look through an object, the caller had
* definition of containment.
*
* If the caller asks to look through a container type that is not of the type
- * pointer to by the superheader, immediately fall through and return NULL. If
+ * pointed to by the superheader, immediately fall through and return NULL. If
* we cannot find the value, return NULL. Otherwise, return palloc()'d copy of
* value.
*/
* early (by breaking upon having found something in a search, for example).
*
* Callers in such a scenario, that are particularly sensitive to leaking
- * memory in a long-lived context may walk the ancestral tree from the final
+ * memory in a long-lived context, may walk the ancestral tree from the final
* iterator we left them with to its oldest ancestor, pfree()ing as they go.
* They can depend on having any other memory previously allocated for
- * iterators but not in that line having already been freed here.
+ * iterators but not in that line having already been freed here FIXME: unclear
+ * sentence.
*
* Returns "Jsonb binary token" value. Iterator "state" reflects the current
* stage of the process in a less granular fashion, and is mostly used here to