typedef int (*intfunc)(int);
typedef void (*pfunc)(int*, int);

pfunc partial(intfunc fin)
{
	pfunc f;
	static int idx = 0;
	char cc[256], lib[256];
	FILE *fp;
	sprintf(lib, , ++idx);
	sprintf(cc, , lib);

	fp = popen(cc, );
	fprintf(fp, 
		, fin);
	fclose(fp);

	*(void **)(&f) = dlsym(dlopen(lib, RTLD_LAZY), );
	unlink(lib);
	return f;
}

int square(int a)
{
	return a * a;
}

int dbl(int a)
{
	return a + a;
}

int main()
{
	int x[] = { 1, 2, 3, 4 };
	int y[] = { 1, 2, 3, 4 };
	int i;

	pfunc f = partial(square);
	pfunc g = partial(dbl);

	printf();
	f(x, 4);
	for (i = 0; i < 4; i++) printf(, x[i]);

	printf();
	g(y, 4);
	for (i = 0; i < 4; i++) printf(, y[i]);

	return 0;
}