1*9f4a9600Sandvar /* $NetBSD: array2bin.c,v 1.2 2022/05/24 06:28:01 andvar Exp $ */
2b68bfe3fSad
3b68bfe3fSad /*-
4b68bfe3fSad * Copyright (c) 2008 The NetBSD Foundation, Inc.
5b68bfe3fSad * All rights reserved.
6b68bfe3fSad *
7b68bfe3fSad * Redistribution and use in source and binary forms, with or without
8b68bfe3fSad * modification, are permitted provided that the following conditions
9b68bfe3fSad * are met:
10b68bfe3fSad * 1. Redistributions of source code must retain the above copyright
11b68bfe3fSad * notice, this list of conditions and the following disclaimer.
12b68bfe3fSad * 2. Redistributions in binary form must reproduce the above copyright
13b68bfe3fSad * notice, this list of conditions and the following disclaimer in the
14b68bfe3fSad * documentation and/or other materials provided with the distribution.
15b68bfe3fSad *
16b68bfe3fSad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17b68bfe3fSad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18b68bfe3fSad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19b68bfe3fSad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20b68bfe3fSad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21b68bfe3fSad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22b68bfe3fSad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23b68bfe3fSad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24b68bfe3fSad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25b68bfe3fSad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26b68bfe3fSad * POSSIBILITY OF SUCH DAMAGE.
27b68bfe3fSad */
28b68bfe3fSad
29b68bfe3fSad /*
30b68bfe3fSad * Takes an array from array.h named array[], and spits it out as a
31b68bfe3fSad * binary image. NO DECOMPRESSION IS DONE. This is for taking existing
32*9f4a9600Sandvar * images formatted as C arrays, for conversion to binary files.
33b68bfe3fSad */
34b68bfe3fSad
35b68bfe3fSad #include <sys/cdefs.h>
36b68bfe3fSad #ifndef lint
37*9f4a9600Sandvar __RCSID("$NetBSD: array2bin.c,v 1.2 2022/05/24 06:28:01 andvar Exp $");
38b68bfe3fSad #endif /* !lint */
39b68bfe3fSad
40b68bfe3fSad #include <sys/module.h>
41b68bfe3fSad #include <sys/stat.h>
42b68bfe3fSad
43b68bfe3fSad #include <stdio.h>
44b68bfe3fSad #include <stdlib.h>
45b68bfe3fSad #include <unistd.h>
46b68bfe3fSad #include <string.h>
47b68bfe3fSad #include <err.h>
48b68bfe3fSad #include <zlib.h>
49b68bfe3fSad
50b68bfe3fSad #include "array.h"
51b68bfe3fSad
52b68bfe3fSad int main(int, char **);
53b68bfe3fSad
54b68bfe3fSad int
main(int argc,char ** argv)55b68bfe3fSad main(int argc, char **argv)
56b68bfe3fSad {
57b68bfe3fSad
58b68bfe3fSad write(STDOUT_FILENO, array, sizeof(array));
59b68bfe3fSad
60b68bfe3fSad return 0;
61b68bfe3fSad }
62