#define CORO3_IMPLEMENTATION
#include "coro3.h"
#include "stdio.h"

void generate_ints(void* arg) {
	int const* max = arg;
	for (int i = 0; i < *max; i++)
		coro_return(&i);
}

int main(void) {
	int max = 10;
	void const* handle = coro_gen(generate_ints, &max);
	for (int const* val; val = coro_next(handle);) 
		printf("%d\n", *val);

	return 0;
}
