#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>

int
main ()
{
	int fd = open ("background.png", O_RDONLY);
	unsigned char *buf;
	size_t size;
	
	if (fd == -1) {
		perror ("File not found: background.png");
		exit (1);
	}
		
	buf = alloca (1024*8);
	printf ("unsigned char image [] = {\n");
	while ((size = read (fd, buf, 1024*8)) > 0) {
		int j;
		
		for (j = 0; j < size; j++){
			printf ("%d, ", (unsigned int) buf [j]);
			if ((j % 10) == 0)
				printf ("\n");
		}
	}
	printf ("};\n");
	return 0;
}

