hex2c.awk revision 1.3
11.3Smartin# $NetBSD: hex2c.awk,v 1.3 2008/04/30 13:10:59 martin Exp $ 21.2Sis# 31.2Sis# Copyright (c) 1999 The NetBSD Foundation, Inc. 41.2Sis# All rights reserved. 51.2Sis# 61.2Sis# This code is derived from software contributed to The NetBSD Foundation 71.2Sis# by Ignatios Souvatzis. 81.2Sis# 91.2Sis# Redistribution and use in source and binary forms, with or without 101.2Sis# modification, are permitted provided that the following conditions 111.2Sis# are met: 121.2Sis# 1. Redistributions of source code must retain the above copyright 131.2Sis# notice, this list of conditions and the following disclaimer. 141.2Sis# 2. Redistributions in binary form must reproduce the above copyright 151.2Sis# notice, this list of conditions and the following disclaimer in the 161.2Sis# documentation and/or other materials provided with the distribution. 171.2Sis# 181.2Sis# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 191.2Sis# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 201.2Sis# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 211.2Sis# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 221.2Sis# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 231.2Sis# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 241.2Sis# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 251.2Sis# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 261.2Sis# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 271.2Sis# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 281.2Sis# POSSIBILITY OF SUCH DAMAGE. 291.2Sis# 301.1SisBEGIN{print "/* Generated by a script --- do not edit */"} 311.1SisBEGIN{print "#include <sys/types.h>"} 321.1SisBEGIN{print "const u_int16_t kickstart[] = {"} 331.1SisBEGIN{size = 0} 341.1Sis{ printf("\t"); for(i=2;i<=NF;i++) {printf("0x%s, ",$i);size += 2};printf("\n");} 351.1SisEND{printf("\t0};\n");} 361.1SisEND{print "const size_t kicksize = ", size ";"} 37