/* ------------------------------------------------------------------- */
/* 6. C<<1 va_list based library functions, updated 2008-01-22 by xCh. */
/* ------------------------------------------------------------------- */
-#define _ECHO void _echo(char *s, ... ) { va_list ap; for(va_start(ap,s);s;s=va_arg(ap,char *)) fputs(s,stdout); va_end(ap); }
-#define print(...) _echo(__VA_ARGS__,"\n",NULL)
-#define echo(...) _echo(__VA_ARGS__,NULL)
+#define _ECHO void _cll1_print(int nl,char *s, ... ) { va_list ap; for(va_start(ap,s);s!=(void *)&_cll1_print;s=va_arg(ap,char *)) fputs(s?s:"",stdout); va_end(ap); if(nl) putchar('\n');}
+#define print(...) _cll1_print(1,__VA_ARGS__,(void *)&_cll1_print)
+#define echo(...) _cll1_print(0,__VA_ARGS__,(void *)&_cll1_print)
/* ------------------------------------------------------------------- */
/* 8. C<<1 CGI and FASTCGI handling, updated 2008-01-16 by xCh. */
/* ------------------------------------------------------------------- */
program
{
- echo("Hello ","world","! ");
- print("Hello ","world","!");
+ echo("Hello ","world",NULL,"! ");
+ print("Hello ",NULL,"world","!");
}
clear
cat print.py
echo "Running..."
-time ./print.py &> /dev/null
+time ./print.py > /dev/null
cat print.pl
echo "Running..."
-time ./print.pl &> /dev/null
+time ./print.pl > /dev/null
cat cll1-print.c
echo "Running..."
-time ./cll1-print &> /dev/null
+time ./cll1-print > /dev/null
cat printf.c
echo "Running..."
-time ./printf &> /dev/null
+time ./printf > /dev/null
cat puts.c
echo "Running..."
-time ./puts &> /dev/null
+time ./puts > /dev/null
cat fputs.c
echo "Running..."
-time ./fputs &> /dev/null
+time ./fputs > /dev/null