On Oct 14, 2006, at 12:30 AM, David Balmain wrote:
Looks great to me.
Groovy. Suggestions before I add the requisite Apache licenses and
commit?
The only problem I had when playing around with
this months ago was the ISO C89 string length limit of 509:
t.c:33: warning: string length '1836' is greater than the length
'509' ISO C89 compilers are required to support
I guess it shouldn't be too hard to keep all strings under that limit.
If we need longer snips -- and it wouldn't surprise me if we do at
some point -- we can turn chaz_Core_capture_output into a varargs
function. We can also macrofy stuff that's common to each snip and
save a couple characters that way.
<before>
static char iso_func_code[] = METAQUOTE
#include <stdio.h>
int main() {
freopen("_charmonizer_target", "w", stdout);
printf("%s", __func__);
return 0;
}
METAQUOTE;
</before>
<after>
static char iso_func_code[] = METAQUOTE
#include "_ch.h"
int main() {
Redirect_Stdout;
printf("%s", __func__);
return 0;
}
METAQUOTE;
</after>
The "_ch.h" header file, we'd write out at the beginning of each
Charmonizer session -- probably cued by the invocation of a required
chaz_init() function defined in Charmonizer.c.
And maybe metaquote should collapse whitespace outside of string
literals. Dunno if that's worth it. We'll probably need the
varargs function eventually, which solves the problem. And string
manipulation from C is such a nightmare.
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/