Activates exit code on crash in patch
[sgc2.git] / praat_module / praatscript2cprogram.pl
blob1a749e8a06d770c7ca6fed97115d39fa148817ad
1 #!/usr/bin/perl
3 # Convert an expanded praat script into a single string
4 # Output a stand alone Praat main program
6 # Use:
7 # perl praatscript2cprogram.pl script.praat > demoapplication.h
8 #
9 print <<'ENDOFHEADER';
10 /* C const char string with Praat script
11 * Generated automatically
12 * For license, see Praat script text
16 static wchar_t myDemoScript [] = L""
17 ENDOFHEADER
18 while(<>){
19 # Protect special characters
20 s/\\/\\\\/g;
21 s/[\n\r\l]/\\n/g;
22 s/\"/\\"/g;
23 print "\"$_\"\n";
25 print <<'ENDOFFOOTER';
28 ENDOFFOOTER