Hi.
I'm working on the integration of the sozi player (
http://sozi.baierouge.fr/wiki/en:welcome) in dia (
http://live.gnome.org/Dia).
The sozi player consist in appending java scripts and a style sheet in a svg doc. The set of java scripts are minified and raw copied in the svg.
For the dia integration i put the raw minified java scripts in a const string.
My problem is that i would like to split the long string on multiple lines. For example
Code:
char* sozi_script = "A_long_javascript_code_of_more_than_2000_chars";
would become
Code:
char* sozi_script =
"A_long_javascript_"
"code_of_more_than_"
"2000_chars";
I've tried the "--line-break" option of the minifier (yuicompressor), the
pr , the
fold and the
fmt command line. But in either case i will need to add the quote at the end and the beginning of the lines (so use sed or awk).
So i wonder if i could fill and format with sed only. I also would like to cut the text every 40 char for example in order to have every lines of the same length.
If someone has an idea, i would be pleased to learn it.
Thank you.
Paul.