typedef struct stk_
stk_
	stk_
	s = malloc(sizeof(struct stk_
	if (!s) return 0;						\
	s->buf = malloc(sizeof(type) * init_size);			\
	if (!s->buf) { free(s); return 0; }				\
	s->len = 0, s->alloc = init_size;				\
	return s; }							\
int stk_
	type *tmp;							\
	if (s->len >= s->alloc) {					\
		tmp = realloc(s->buf, s->alloc*2*sizeof(type));		\
		if (!tmp) return -1; s->buf = tmp;			\
		s->alloc *= 2; }					\
	s->buf[s->len++] = item;					\
	return s->len; }						\
type stk_
	type tmp;							\
	if (!s->len) abort();						\
	tmp = s->buf[--s->len];						\
	if (s->len * 2 <= s->alloc && s->alloc >= 8) {			\
		s->alloc /= 2;						\
		s->buf = realloc(s->buf, s->alloc * sizeof(type));}	\
	return tmp; }							\
void stk_
	free(s->buf); free(s); }




DECL_STACK_TYPE(int, int)

int main(void)
{
	int i;
	stk_int stk = stk_int_create(0);

	printf();
	for (i = 'a'; i <= 'z'; i++) {
		printf(, i);
		stk_int_push(stk, i);
	}

	printf(, stk_size(stk));
	printf(, stk_empty(stk) ?  : );

	printf();
	while (stk_size(stk))
		printf(, stk_int_pop(stk));
	printf(, stk_size(stk));
	printf(, stk_empty(stk) ?  : );

	
	stk_int_delete(stk);
	return 0;
}