Skip to content

Commit 1596748

Browse files
committed
Restructure the skipping functions and clarify their comments
1 parent 2ea40d8 commit 1596748

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

cmp.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,23 @@ bool cmp_skip_object(cmp_ctx_t *ctx, cmp_object_t *obj);
341341
* Otherwise:
342342
* - (Don't touch `obj`)
343343
* - Return `true`
344+
*
345+
* WARNING: This can cause your application to spend an unbounded amount of
346+
* time reading nested data structures. Unless you completely trust
347+
* the data source, you should use `cmp_skip_object`.
344348
*/
345349
bool cmp_skip_object_flat(cmp_ctx_t *ctx, cmp_object_t *obj);
346350

351+
/*
352+
* This is similar to `cmp_skip_object`, except it will continually skip
353+
* nested data structures.
354+
*
355+
* WARNING: This can cause your application to spend an unbounded amount of
356+
* time reading nested data structures. Unless you completely trust
357+
* the data source, you should use `cmp_skip_object`.
358+
*/
359+
bool cmp_skip_object_no_limit(cmp_ctx_t *ctx);
360+
347361
/*
348362
* WARNING: THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE
349363
*
@@ -375,17 +389,6 @@ bool cmp_skip_object_limit(cmp_ctx_t *ctx, cmp_object_t *obj, uint32_t limit)
375389
#pragma deprecated(cmp_skip_object_limit)
376390
#endif
377391

378-
/*
379-
* This is similar to `cmp_skip_object`, except it will continually skip
380-
* nested data structures.
381-
*
382-
* WARNING: This can cause your application to spend an unbounded amount of
383-
* time reading nested data structures. Unless you completely trust
384-
* the data source, you should strongly consider `cmp_skip_object` or
385-
* `cmp_skip_object_limit`.
386-
*/
387-
bool cmp_skip_object_no_limit(cmp_ctx_t *ctx);
388-
389392
/*
390393
* ============================================================================
391394
* === Specific API

0 commit comments

Comments
 (0)