ftp.nice.ch/pub/next/games/fun/cookie.s.tar.gz#/Cookie/_Cookie/CookieV1.0/cookie.filters/yow2cookie.c

This is yow2cookie.c in view mode; [Download] [Up]

#include <stdio.h>

/* format expected is leading comment followed by NULL ('\000'); then lots of cookies separated by NULLs; might as well strip out \n, 'cos they don't add anything */
void main(int argc, char * argv[])
{
	int c;
	char *title;
	
	if (argc < 2)
		title = "Yow!";
	else
		title = argv[1];
			
	c = getchar();
	while ((c != EOF) && (c != '\000')) {
		/* skip initial comment */
		c = getchar();
	}
	while (c != EOF) {
		c = getchar();
		printf("#%s%%", title);		/* cookie title */
		while ((c != EOF) && (c != '\000')) {
			/* write cookie */
			if (c != '\n') {	/* strip returns */
				putchar(c);
			}
			c = getchar();
		}
		putchar('\n');
	}
	
	printf("##\n");		/* end */
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.