return res;
}
+/*
+ * findUncompressedJsonbValueByValue() wrapper that sets up JsonbValue key.
+ */
+JsonbValue *
+findUncompressedJsonbValue(char *buffer, uint32 flags, uint32 *lowbound,
+ char *key, uint32 keylen)
+{
+ JsonbValue v;
+
+ if (key == NULL)
+ {
+ v.type = jbvNull;
+ }
+ else
+ {
+ v.type = jbvString;
+ v.string.val = key;
+ v.string.len = keylen;
+ }
+
+ return findUncompressedJsonbValueByValue(buffer, flags, lowbound, &v);
+}
+
/*
* Find string key in object or element by value in array (packed format)
*/
return NULL;
}
-/*
- * findUncompressedJsonbValueByValue() wrapper that sets up JsonbValue key.
- */
-JsonbValue *
-findUncompressedJsonbValue(char *buffer, uint32 flags, uint32 *lowbound,
- char *key, uint32 keylen)
-{
- JsonbValue v;
-
- if (key == NULL)
- {
- v.type = jbvNull;
- }
- else
- {
- v.type = jbvString;
- v.string.val = key;
- v.string.len = keylen;
- }
-
- return findUncompressedJsonbValueByValue(buffer, flags, lowbound, &v);
-}
-
/*
* Get i-th value of array or object. If i < 0, then it counts from the end of
* array/object. Note: returns pointer to statically allocated JsonbValue.
if (*it == NULL)
return 0;
-
/*
* Encode all possible states in the "type" integer. This is possible
* because enum members of JsonbIterator->state use different bit values
/*
* Transformation from tree to binary representation of jsonb
*/
-#define curLevelState state->lptr
-#define prevLevelState state->pptr
+#define curLevelState (state->lptr)
+#define prevLevelState (state->pptr)
static void
compressJsonbValue(CompressState * state, JsonbValue * value, uint32 flags,