11.2Sandvar/* $NetBSD: array2bin.c,v 1.2 2022/05/24 06:28:01 andvar Exp $ */ 21.1Sad 31.1Sad/*- 41.1Sad * Copyright (c) 2008 The NetBSD Foundation, Inc. 51.1Sad * All rights reserved. 61.1Sad * 71.1Sad * Redistribution and use in source and binary forms, with or without 81.1Sad * modification, are permitted provided that the following conditions 91.1Sad * are met: 101.1Sad * 1. Redistributions of source code must retain the above copyright 111.1Sad * notice, this list of conditions and the following disclaimer. 121.1Sad * 2. Redistributions in binary form must reproduce the above copyright 131.1Sad * notice, this list of conditions and the following disclaimer in the 141.1Sad * documentation and/or other materials provided with the distribution. 151.1Sad * 161.1Sad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 171.1Sad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 181.1Sad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 191.1Sad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 201.1Sad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 211.1Sad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 221.1Sad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 231.1Sad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 241.1Sad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 251.1Sad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 261.1Sad * POSSIBILITY OF SUCH DAMAGE. 271.1Sad */ 281.1Sad 291.1Sad/* 301.1Sad * Takes an array from array.h named array[], and spits it out as a 311.1Sad * binary image. NO DECOMPRESSION IS DONE. This is for taking existing 321.2Sandvar * images formatted as C arrays, for conversion to binary files. 331.1Sad */ 341.1Sad 351.1Sad#include <sys/cdefs.h> 361.1Sad#ifndef lint 371.2Sandvar__RCSID("$NetBSD: array2bin.c,v 1.2 2022/05/24 06:28:01 andvar Exp $"); 381.1Sad#endif /* !lint */ 391.1Sad 401.1Sad#include <sys/module.h> 411.1Sad#include <sys/stat.h> 421.1Sad 431.1Sad#include <stdio.h> 441.1Sad#include <stdlib.h> 451.1Sad#include <unistd.h> 461.1Sad#include <string.h> 471.1Sad#include <err.h> 481.1Sad#include <zlib.h> 491.1Sad 501.1Sad#include "array.h" 511.1Sad 521.1Sadint main(int, char **); 531.1Sad 541.1Sadint 551.1Sadmain(int argc, char **argv) 561.1Sad{ 571.1Sad 581.1Sad write(STDOUT_FILENO, array, sizeof(array)); 591.1Sad 601.1Sad return 0; 611.1Sad} 62