Re: Other option rather than .rsrc in Xcode...
Re: Other option rather than .rsrc in Xcode...
- Subject: Re: Other option rather than .rsrc in Xcode...
- From: Steve Checkoway <email@hidden>
- Date: Wed, 17 Dec 2008 19:52:37 -0800
On Wed, Dec 17, 2008 at 03:20:09PM -0800, Dave Carrigan wrote:
> Put your javascript into a file write a script that creates a .h file
> with syntactically-correct C, and #include that .h file. Add a build
> rule that will run the script on your input files and create .h files.
>
> The script is pretty simple. Off the top of my head, written in
> mail.app:
>
> #! /usr/bin/perl -n
>
> BEGIN {
> print "char const* myscript = ";
> }
>
> while (<>) {
> chomp;
> s/\\/\\\\/g;
> s/\"/\\\"/g;
> print '"', $_, '"', "\n";
> }
>
> END {
> print ";\n";
> }
Unless I'm mistaken, you've removed all newlines from the input. It
seems like that final line in the while loop should be
print qq/"$_\\n"\n/;
--
Steve Checkoway
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden