diff options
Diffstat (limited to 'Alc/vector.h')
-rw-r--r-- | Alc/vector.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Alc/vector.h b/Alc/vector.h index 85230378..c1fc925d 100644 --- a/Alc/vector.h +++ b/Alc/vector.h @@ -73,6 +73,13 @@ ALboolean vector_insert(char *ptr, size_t base_size, size_t obj_size, void *ins_ _f(_iter); \ } while(0) +#define VECTOR_FOR_EACH_PARAMS(_t, _x, _f, ...) do { \ + _t *_iter = VECTOR_ITER_BEGIN((_x)); \ + _t *_end = VECTOR_ITER_END((_x)); \ + for(;_iter != _end;++_iter) \ + _f(__VA_ARGS__, _iter); \ +} while(0) + #define VECTOR_FIND_IF(_i, _t, _x, _f) do { \ _t *_iter = VECTOR_ITER_BEGIN((_x)); \ _t *_end = VECTOR_ITER_END((_x)); \ @@ -84,4 +91,15 @@ ALboolean vector_insert(char *ptr, size_t base_size, size_t obj_size, void *ins_ (_i) = _iter; \ } while(0) +#define VECTOR_FIND_IF_PARMS(_i, _t, _x, _f, ...) do { \ + _t *_iter = VECTOR_ITER_BEGIN((_x)); \ + _t *_end = VECTOR_ITER_END((_x)); \ + for(;_iter != _end;++_iter) \ + { \ + if(_f(__VA_ARGS__, _iter)) \ + break; \ + } \ + (_i) = _iter; \ +} while(0) + #endif /* AL_VECTOR_H */ |