diff bootmatch/comp_main.c @ 9:bfcc8180cf3c

bootmatch compiler written
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 10 Jun 2023 02:55:29 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bootmatch/comp_main.c	Sat Jun 10 02:55:29 2023 +0000
@@ -0,0 +1,29 @@
+/*
+ * This C module is the main for our bootmatch compiler.
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "comp_defs.h"
+
+u_char boot_image[BOOT_BLOCK_SIZE];
+struct range range_list[MAX_RANGES];
+unsigned range_count;
+char *output_array_name;
+
+main(argc, argv)
+	char **argv;
+{
+	if (argc != 5) {
+		fprintf(stderr,
+		"usage: %s bin-file ranges-file array-name output-file\n",
+			argv[0]);
+		exit(1);
+	}
+	read_bin_file(argv[1]);
+	read_ranges_file(argv[2]);
+	output_array_name = argv[3];
+	emit_output_file(argv[4]);
+	exit(0);
+}