diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-05-02 11:01:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-05-02 11:49:22 +0300 |
commit | 915e9eeff12eb0f0e0fc01927fecc876a0cdfdbe (patch) | |
tree | fec10c10aadeaaf1300fe00aa84171e9d9325b8c /source/blender/blenlib/BLI_array_utils.h | |
parent | c1ca667d4a9f42cda9dd7486f9826db07baacd2a (diff) |
BLI_array_utils: helper for stepping over contiguous ranges
Diffstat (limited to 'source/blender/blenlib/BLI_array_utils.h')
-rw-r--r-- | source/blender/blenlib/BLI_array_utils.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_array_utils.h b/source/blender/blenlib/BLI_array_utils.h index c5359d56f9c..5ef8421c003 100644 --- a/source/blender/blenlib/BLI_array_utils.h +++ b/source/blender/blenlib/BLI_array_utils.h @@ -64,4 +64,16 @@ void _bli_array_binary_or( CHECK_TYPE_PAIR_INLINE(*(arr), *(arr_b)), \ _bli_array_binary_or(arr, arr_a, arr_b, arr_len, sizeof(*(arr)))) +bool _bli_array_iter_span( + const void *arr, + unsigned int arr_len, size_t arr_stride, + bool use_wrap, bool use_delimit_bounds, + bool (*test_fn)(const void *arr_item, void *user_data), void *user_data, + unsigned int span_step[2], unsigned int *r_span_len); +#define BLI_array_iter_span(arr, arr_len, use_wrap, use_delimit_bounds, test_fn, user_data, \ + span_step, r_span_len) \ + _bli_array_iter_span( \ + arr, arr_len, sizeof(*(arr)), use_wrap, use_delimit_bounds, test_fn, user_data, \ + span_step, r_span_len) + #endif /* __BLI_ARRAY_UTILS_H__ */ |