/*
 * convert a collection of xfree modelines into modeline initializers
 */
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <malloc.h>
#include "Monitor.h"

main()
{
    ModeLine m;
    int x = 0;
    char C[1024];

    while (gets(C)) {
	if (m.scan(C, stdin)) {
	    if (x == 0)
		printf("void"
		       "init_@()\n"
		       "{\n");
	    printf("   @[%d].is(%d, %d, %5.2f, \"%s\");\n",
			x, m.hsize, m.vsize, m.clock, m.modedata);
	    x++;
	}
    }
    if (x) {
	printf( "}\n"
		"---[cut here]---\n"
		"ModeLine @[%d];\n"
		"int NR_@ = sizeof @/sizeof @[0];\n", x);
    }
}
