alloca.h revision 219820
1104349Sphk#ifndef _LIBIBVERBS_ALLOCA_H_ 2104349Sphk#define _LIBIBVERBS_ALLOCA_H_ 3104349Sphk#include <stdlib.h> 4104349Sphk#include <string.h> 5104349Sphk#include <stdlib.h> 6104349Sphk 7178848Scokane#define strdupa(_s) \ 8104349Sphk({ \ 9104349Sphk char *_d; \ 10104349Sphk int _len; \ 11104349Sphk \ 12104349Sphk _len = strlen(_s) + 1; \ 13104349Sphk _d = alloca(_len); \ 14104349Sphk if (_d) \ 15104349Sphk memcpy(_d, _s, _len); \ 16104349Sphk _d; \ 17104349Sphk}) 18104349Sphk#endif /* _LIBIBVERBS_ALLOCA_H_ */ 19104349Sphk