[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What is the preferred way to embed multi-line string in C source?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 19 Dec 2008 17:37:22 -0200
> Good thought. Maybe an array of such strings, each limited to 4K?
I guess this was David's suggestion. But you do not need to worry about
the 4K limit, unless you have really long lines:
char *prog[] = {
"function foo ()",
" return x",
"end"
};
As I said, with a proper lua_Reader, you can feed each line one by one
to lua_load, without concatenating them. (If you want, the lua_Reader
may also inser the newlines between lines.)
-- Roberto