Skip to content

Commit

Permalink
Restructure the skipping functions and clarify their comments
Browse files Browse the repository at this point in the history
  • Loading branch information
camgunz committed Sep 8, 2020
1 parent 2ea40d8 commit 1596748
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions cmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,23 @@ bool cmp_skip_object(cmp_ctx_t *ctx, cmp_object_t *obj);
* Otherwise:
* - (Don't touch `obj`)
* - Return `true`
*
* WARNING: This can cause your application to spend an unbounded amount of
* time reading nested data structures. Unless you completely trust
* the data source, you should use `cmp_skip_object`.
*/
bool cmp_skip_object_flat(cmp_ctx_t *ctx, cmp_object_t *obj);

/*
* This is similar to `cmp_skip_object`, except it will continually skip
* nested data structures.
*
* WARNING: This can cause your application to spend an unbounded amount of
* time reading nested data structures. Unless you completely trust
* the data source, you should use `cmp_skip_object`.
*/
bool cmp_skip_object_no_limit(cmp_ctx_t *ctx);

/*
* WARNING: THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE
*
Expand Down Expand Up @@ -375,17 +389,6 @@ bool cmp_skip_object_limit(cmp_ctx_t *ctx, cmp_object_t *obj, uint32_t limit)
#pragma deprecated(cmp_skip_object_limit)
#endif

/*
* This is similar to `cmp_skip_object`, except it will continually skip
* nested data structures.
*
* WARNING: This can cause your application to spend an unbounded amount of
* time reading nested data structures. Unless you completely trust
* the data source, you should strongly consider `cmp_skip_object` or
* `cmp_skip_object_limit`.
*/
bool cmp_skip_object_no_limit(cmp_ctx_t *ctx);

/*
* ============================================================================
* === Specific API
Expand Down

0 comments on commit 1596748

Please sign in to comment.