head 1.2; access; symbols ISELECT_1_4_0:1.2 ISELECT_1_3_1:1.2 ISELECT_1_3_0:1.2 ISELECT_1_2_0:1.1.1.1 ISELECT_1_1_0:1.1.1.1 ISELECT_1_0_4:1.1.1.1 ISELECT_1_0_0:1.1.1.1 vendor:1.1.1; locks; strict; comment @# @; 1.2 date 2004.09.11.15.18.56; author rse; state Exp; branches; next 1.1; 1.1 date 97.09.16.14.59.11; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 97.09.16.14.59.11; author rse; state Exp; branches; next ; desc @@ 1.2 log @modernize source tree @ text @#!/usr/bin/env perl ## ## asc2c -- convert an ASCII file into a statically initialised ## C array of characters ## ## Copyright (c) Ralf S. Engelschall, All Rights Reserved. ## $filein = $ARGV[0]; $fileout = $ARGV[1]; $name = $ARGV[2]; $version = $ARGV[3]; if ($#ARGV ne 3) { printf(STDERR "Usage: $0 ascii-file c-file buffer-name version\n"); exit(1); } open(IN, "<$filein"); open(OUTC, ">$fileout.c"); print OUTC "/* $fileout.c -- automatically generated by asc2c */\n"; print OUTC "\n"; print OUTC "#include \n"; print OUTC "\n"; print OUTC "char *$name\[\] = {\\\n"; while () { s|\n$||; s|\\|\\\\|g; s|\"|\\\"|g; s|\@@V\@@|$version|g; printf(OUTC "\"%s\",\n", $_); } print OUTC "NULL };\n"; print OUTC "\n"; print OUTC "/*EOF*/\n"; $filename = "$fileout.h"; $filename =~ tr|a-z.|A-Z_|; close(IN); close(OUTC); ##EOF## @ 1.1 log @Initial revision @ text @d1 1 a1 1 #!/sw/bin/perl @ 1.1.1.1 log @Import iSelect 1.0.0 @ text @@