• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Other option rather than .rsrc in Xcode...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Other option rather than .rsrc in Xcode... (From: Nima <email@hidden>)
 >Re: Other option rather than .rsrc in Xcode... (From: Chris Espinosa <email@hidden>)
 >Re: Other option rather than .rsrc in Xcode... (From: Nima <email@hidden>)
 >Re: Other option rather than .rsrc in Xcode... (From: Dave Carrigan <email@hidden>)

  • Prev by Date: Re: Age Old Question: How Do You Set __MyCompanyName__
  • Next by Date: RE: Age Old Question: How Do You Set __MyCompanyName__
  • Previous by thread: Re: Other option rather than .rsrc in Xcode...
  • Next by thread: Re: Other option rather than .rsrc in Xcode...
  • Index(es):
    • Date
    • Thread