[Klone-users] C strict or not
Mickael Auger
mickael.auger at gmail.com
Tue Apr 22 05:28:32 EDT 2008
Hi,
Obviously KLone is written in C strict. So it is compatible with old
compilers.
However the C file generated by the KL1 file is not written in C strict. So
I must declare my variables and functions in <%! ...%> tag.
But these variables/functions become global variables/functions and I can
not use the same names into other KL1 pages.
Why ? This is not the expected behavior.
Here is an extract of one of my "accueil.kl1" page to C file :
====================================================
static void exec_page(request_t *rq, response_t *rs, session_t *ses)
{
request = rq;
response = rs;
session = ses;
in = request_io(request);
out = response_io(response);
u_unused_args(SCRIPT_NAME, request, response, session, in, out);
accueil_kl1 () ;
dbg_if(u_io_unzip_copy(out, klone_html_zblock_0,
sizeof(klone_html_zblock_0)));
#line 42 "/home/ug_ma/klone-2.0.2/webapp/www/accueil.kl1"
char *value;
char *login;
char* rq;
====================================================
I think that you process this for prevent conflicts with your variables
('rq', 'rs' and 'ses').
I would like to separate the global context (contains 'include' and
'define') from the local variables to my KL1 page.
For example, to resolve this problem, you could add a new tag (like <%d ...
%> with 'd' for declaration) and you could "protect" the variable names
('rq', 'rs' and 'ses') to renaming them '_rq', '_rs', and '_ses' for
'exec_page' function.
What do you think?
--
Mickaël AUGER
mickael.auger at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://koanlogic.com/pipermail/klone-users/attachments/20080422/4991b550/attachment.html
More information about the klone-users
mailing list