X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fstruct%2Fpool.h;fp=bertos%2Fstruct%2Fpool.h;h=01c18d38a15a28bcdb8706d60e1d1d0c9acbe131;hb=e5174304054e26cd8f3cd1f9980871c20c07fc46;hp=0000000000000000000000000000000000000000;hpb=bad932366898b7153f2cba75c06cec2d86f35fe1;p=bertos.git diff --git a/bertos/struct/pool.h b/bertos/struct/pool.h new file mode 100644 index 00000000..01c18d38 --- /dev/null +++ b/bertos/struct/pool.h @@ -0,0 +1,74 @@ +/** + * \file + * + * + * \brief Pool macros. + * + * \version $Id: pool.h 1294 2008-05-20 13:43:57Z asterix $ + * \author Giovanni Bajo + */ + +#ifndef MWARE_POOL_H +#define MWARE_POOL_H + +#include +#include + +#define EXTERN_POOL(name) \ + extern List name + +#define DECLARE_POOL_WITH_STORAGE(name, type, num, storage) \ + static type name##_items[num]; \ + storage name; \ + INLINE void name##_init(void (*init_func)(type*)) \ + { \ + int i; \ + LIST_INIT(&name); \ + for (i=0;i