head 1.2; access; symbols ePerl_2_2_14:1.1.1.1 RSE:1.1.1; locks; strict; comment @# @; 1.2 date 2000.07.03.09.05.26; author rse; state Exp; branches; next 1.1; 1.1 date 99.05.02.14.43.39; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.05.02.14.43.39; author rse; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @: eval 'exec perl -S $0 ${1+"$@@"}' if $running_under_some_shell; ## ## 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]; if ($#ARGV ne 2) { printf(STDERR "Usage: $0 ascii-file c-file buffer-name\n"); exit(1); } open(IN, "<$filein"); #open(OUTH, ">$fileout.h"); open(OUTC, ">$fileout.c"); print OUTC "/* $filein.c -- automatically generated by asc2c */\n"; print OUTC "\n"; print OUTC "char *$name = \\\n"; while () { #next if m|^[ \t]*$|; #next if m|^[ \t]*#.*$|; s|\n$||; s|\\|\\\\|g; s|\"|\\\"|g; s|^|\"|; s|$|\\n\"\\|; printf(OUTC "%s\n", $_); } print OUTC ";\n"; print OUTC "\n"; print OUTC "/*EOF*/\n"; $filename = "$fileout.h"; $filename =~ tr|a-z.|A-Z_|; #print OUTH "/* $fileout.h -- automatically generated by asc2c */\n"; #print OUTH "#ifndef __$filename\n"; #print OUTH "#define __$filename\n"; #print OUTH "\n"; #print OUTH "extern char *$name;\n"; #print OUTH "\n"; #print OUTH "#endif /* __$filename */\n"; close(IN); #close(OUTH); close(OUTC); ##EOF## @ 1.1 log @Initial revision @ text @d1 3 a3 1 #!/sw/bin/perl @ 1.1.1.1 log @Import of ePerl 2.2.14 @ text @@