186d7f5d3SJohn Marino#!/bin/sh 286d7f5d3SJohn Marino# Make statetexts.h from vinumstate.h 386d7f5d3SJohn Marino# $FreeBSD: src/sys/dev/vinum/makestatetext,v 1.6 2000/02/29 06:07:01 grog Exp $ 486d7f5d3SJohn Marino# $DragonFly: src/sys/dev/raid/vinum/makestatetext,v 1.2 2003/06/17 04:28:33 dillon Exp $ 586d7f5d3SJohn Marino# $Id: makestatetext,v 1.7 1999/12/29 07:24:54 grog Exp grog $ 686d7f5d3SJohn Marinoinfile=vinumstate.h 786d7f5d3SJohn Marinoofile=statetexts.h 886d7f5d3SJohn Marinoecho >$ofile "/* Created by $0 on" `date`. "Do not edit */" 986d7f5d3SJohn Marinoecho >>$ofile 1086d7f5d3SJohn Marinocat >> $ofile <<FOO 1186d7f5d3SJohn Marino/*- 1286d7f5d3SJohn Marino * Copyright (c) 1997, 1998 1386d7f5d3SJohn Marino * Nan Yang Computer Services Limited. All rights reserved. 1486d7f5d3SJohn Marino * 1586d7f5d3SJohn Marino * This software is distributed under the so-called \`\`Berkeley 1686d7f5d3SJohn Marino * License'': 1786d7f5d3SJohn Marino * 1886d7f5d3SJohn Marino * Redistribution and use in source and binary forms, with or without 1986d7f5d3SJohn Marino * modification, are permitted provided that the following conditions 2086d7f5d3SJohn Marino * are met: 2186d7f5d3SJohn Marino * 1. Redistributions of source code must retain the above copyright 2286d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer. 2386d7f5d3SJohn Marino * 2. Redistributions in binary form must reproduce the above copyright 2486d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer in the 2586d7f5d3SJohn Marino * documentation and/or other materials provided with the distribution. 2686d7f5d3SJohn Marino * 3. All advertising materials mentioning features or use of this software 2786d7f5d3SJohn Marino * must display the following acknowledgement: 2886d7f5d3SJohn Marino * This product includes software developed by Nan Yang Computer 2986d7f5d3SJohn Marino * Services Limited. 3086d7f5d3SJohn Marino * 4. Neither the name of the Company nor the names of its contributors 3186d7f5d3SJohn Marino * may be used to endorse or promote products derived from this software 3286d7f5d3SJohn Marino * without specific prior written permission. 3386d7f5d3SJohn Marino * 3486d7f5d3SJohn Marino * This software is provided \`\`as is'', and any express or implied 3586d7f5d3SJohn Marino * warranties, including, but not limited to, the implied warranties of 3686d7f5d3SJohn Marino * merchantability and fitness for a particular purpose are disclaimed. 3786d7f5d3SJohn Marino * In no event shall the company or contributors be liable for any 3886d7f5d3SJohn Marino * direct, indirect, incidental, special, exemplary, or consequential 3986d7f5d3SJohn Marino * damages (including, but not limited to, procurement of substitute 4086d7f5d3SJohn Marino * goods or services; loss of use, data, or profits; or business 4186d7f5d3SJohn Marino * interruption) however caused and on any theory of liability, whether 4286d7f5d3SJohn Marino * in contract, strict liability, or tort (including negligence or 4386d7f5d3SJohn Marino * otherwise) arising in any way out of the use of this software, even if 4486d7f5d3SJohn Marino * advised of the possibility of such damage. 4586d7f5d3SJohn Marino */ 4686d7f5d3SJohn Marino 4786d7f5d3SJohn MarinoFOO 4886d7f5d3SJohn Marino 4986d7f5d3SJohn Marinoecho >>$ofile "/* Drive state texts */" 5086d7f5d3SJohn Marinoecho >>$ofile "char *drivestatetext [] = 5186d7f5d3SJohn Marino { " 5286d7f5d3SJohn Marinoegrep -e 'drive_[A-z0-9]*,' <$infile | grep -v = | sed 's: *drive_\([^,]*\).*: \"\1\",:' >>$ofile 5386d7f5d3SJohn Marinocat <<FOO >> $ofile 5486d7f5d3SJohn Marino }; 5586d7f5d3SJohn Marino 5686d7f5d3SJohn Marino/* Subdisk state texts */ 5786d7f5d3SJohn Marinochar *sdstatetext [] = 5886d7f5d3SJohn Marino { 5986d7f5d3SJohn MarinoFOO 6086d7f5d3SJohn Marinoegrep -e 'sd_[A-z0-9]*,' $infile | grep -v = | sed 's: *sd_\([^,]*\).*: \"\1\",:' >>$ofile 6186d7f5d3SJohn Marinocat <<FOO >> $ofile 6286d7f5d3SJohn Marino }; 6386d7f5d3SJohn Marino 6486d7f5d3SJohn Marino/* Plex state texts */ 6586d7f5d3SJohn Marinochar *plexstatetext [] = 6686d7f5d3SJohn Marino { 6786d7f5d3SJohn MarinoFOO 6886d7f5d3SJohn Marinoegrep -e 'plex_[A-z0-9]*,' $infile | grep -v = | sed 's: *plex_\([^,]*\).*: \"\1\",:' >>$ofile 6986d7f5d3SJohn Marinocat <<FOO >> $ofile 7086d7f5d3SJohn Marino }; 7186d7f5d3SJohn Marino 7286d7f5d3SJohn Marino/* Volume state texts */ 7386d7f5d3SJohn Marinochar *volstatetext [] = 7486d7f5d3SJohn Marino { 7586d7f5d3SJohn MarinoFOO 7686d7f5d3SJohn Marinoegrep -e 'volume_[A-z0-9]*,' $infile | grep -v = | sed 's: *volume_\([^,]*\).*: \"\1\",:' >>$ofile 7786d7f5d3SJohn Marinocat <<FOO >> $ofile 7886d7f5d3SJohn Marino }; 7986d7f5d3SJohn MarinoFOO 80