#!/usr/bin/awk -f # # $NetBSD: mkoldconf.awk,v 1.7 1996/03/17 22:56:31 ragge Exp $ # /tms_cd/{ tmsplats[ntms]=$3; tmsaddr[ntms]=$6; ntms++; } /ts_cd/{ tsplats[nts]=$3; tsaddr[nts]=$6; nts++; } /ra_cd/{ raplats[nra]=$3; raaddr[nra]=$6; nra++; } { if(savenext==1){ l=sprintf("%d",$3) udanummer[l-1]=nuda-1 savenext=0; } } { if(tmssavenext==1){ l=sprintf("%d",$3) tmsnummer[l-1]=ntmscp-1 tmssavenext=0; } if(tssavenext==1){ l=sprintf("%d",$3) tsnummer[l-1]=nts-1 tssavenext=0; } } /tmscp_cd/{ tmscpplats[ntmscp]=$3; tmscpaddr[ntmscp]=$6; ntmscp++; tmssavenext=1; } /uda_cd/{ udaplats[nuda]=$3; udaddr[nuda]=$6; nuda++; savenext=1; } /};/{ k=0; m=0; } { if (k==1){ for(i=1;i\n" printf "#include \n" printf "#include \n" printf "#include \n" printf "#include \n" printf "int antal_ra=%d;\n",nra-1 printf "int antal_uda=%d;\n",nuda-1 printf "int antal_ts=%d;\n",nts-1 printf "int antal_tms=%d;\n",ntms-1 printf "int antal_tmscp=%d;\n",ntmscp-1 printf "extern struct uba_driver udadriver;\n" if(nts) printf "extern struct uba_driver tsdriver;\n" if(nts) printf "void tsintr();\n" if(ntms) printf "extern struct uba_driver tmscpdriver;\n" if(ntms) printf "void tmscpintr();\n" printf "void udaintr();\n" printf "int ra_cd=0, ra_ca=0, tms_cd=0, tms_ca=0;\n" printf "#define C (caddr_t)\n" printf "struct uba_ctlr ubminit[]={\n" for(i=1;i