X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=tools%2Fmeshdump%2Fdynarr.h;fp=tools%2Fmeshdump%2Fdynarr.h;h=8690b5abf31fa8e0d307ec3657cf902229636469;hb=c2f434aec82cde13b201fdcb7871e3dadd6424ca;hp=0000000000000000000000000000000000000000;hpb=f376a88158f9f99d738a51e306d137de62124569;p=gba_blender diff --git a/tools/meshdump/dynarr.h b/tools/meshdump/dynarr.h new file mode 100644 index 0000000..8690b5a --- /dev/null +++ b/tools/meshdump/dynarr.h @@ -0,0 +1,80 @@ +/* dynarr - dynamic resizable C array data structure + * author: John Tsiombikas + * license: public domain + */ +#ifndef DYNARR_H_ +#define DYNARR_H_ + +/* usage example: + * ------------- + * int *arr = dynarr_alloc(0, sizeof *arr); + * + * int x = 10; + * arr = dynarr_push(arr, &x); + * x = 5; + * arr = dynarr_push(arr, &x); + * x = 42; + * arr = dynarr_push(arr, &x); + * + * for(i=0; i