1321936Shselasky#ifndef _LIBIBVERBS_ALLOCA_H_
2321936Shselasky#define	_LIBIBVERBS_ALLOCA_H_
3321936Shselasky#include <stdlib.h>
4321936Shselasky#include <string.h>
5321936Shselasky#include <stdlib.h>
6321936Shselasky
7321936Shselasky#define	strdupa(_s)						\
8321936Shselasky({								\
9321936Shselasky	char *_d;						\
10321936Shselasky	int _len;						\
11321936Shselasky								\
12321936Shselasky	_len = strlen(_s) + 1;					\
13321936Shselasky	_d = alloca(_len);					\
14321936Shselasky	if (_d)							\
15321936Shselasky		memcpy(_d, _s, _len);				\
16321936Shselasky	_d;							\
17321936Shselasky})
18321936Shselasky#endif	/* _LIBIBVERBS_ALLOCA_H_ */
19