mkscrfil.c revision 3077
13077Sache/*
23077Sache * Copyright (C) 1994 by Andrew A. Chernov, Moscow, Russia.
33077Sache * All rights reserved.
43077Sache *
53077Sache * Redistribution and use in source and binary forms, with or without
63077Sache * modification, are permitted provided that the following conditions
73077Sache * are met:
83077Sache * 1. Redistributions of source code must retain the above copyright
93077Sache *    notice, this list of conditions and the following disclaimer.
103077Sache * 2. Redistributions in binary form must reproduce the above copyright
113077Sache *    notice, this list of conditions and the following disclaimer in the
123077Sache *    documentation and/or other materials provided with the distribution.
133077Sache *
143077Sache * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
153077Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
163077Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
173077Sache * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
183077Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
193077Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
203077Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
213077Sache * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
223077Sache * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
233077Sache * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
243077Sache * SUCH DAMAGE.
253077Sache */
263077Sache
273077Sache#include <sys/ioctl.h>
283077Sache#include <machine/console.h>
293077Sache#include <stdio.h>
303077Sache
313077Sache#include FIL
323077Sache
333077Sacheint main(int argc, char **argv)
343077Sache{
353077Sache	FILE *fd;
363077Sache
373077Sache	if (argc == 2) {
383077Sache		if ((fd = fopen(argv[1], "w")) == NULL) {
393077Sache			perror(argv[1]);
403077Sache			return 1;
413077Sache		}
423077Sache		fwrite(&scrmap, sizeof(scrmap_t), 1, fd);
433077Sache		fclose(fd);
443077Sache		return 0;
453077Sache	}
463077Sache	else {
473077Sache		fprintf(stderr, "usage: %s <mapfile>\n", argv[0]);
483077Sache		return 1;
493077Sache	}
503077Sache}
51