Michael Link <[EMAIL PROTECTED]> writes:
> Kind of a general road map I have planned is:
> 1. Deal with the BUGS
> 2. Research on exporting non-standard hooks
> 3. Research on exporting filter definitions...
> 4. Add list of variables that can be read/written via r/r_set in
> documentation
>
> checkout via
>
> cvs -d:pserver:[EMAIL PROTECTED]:/home/cvspublic checkout tcl-modtcl
Looks good!
A couple of things I have noticed, after a (quick) look at the code:
mmap
How portable is it? Does it work on Windows? I don't know, as I
don't use Windows myself, but there are a fair amount of people who
seem to be interested in Apache+Tcl+Windows.
blocks like
{
....
}
I'm not sure this is ok with all compilers. A friend says the best
way to do that, portably and efficiently, is
do {
.......
} while (0);
I see
if ((fd = open(r->filename, O_RDONLY, 0)) == -1) {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0,
r->server, "open(%s, ...): %s", r->filename, strerror(errno));
return HTTP_NOT_FOUND;
}
mptr = mmap((caddr_t) 0, r->finfo.size, PROT_READ, MAP_SHARED,
fd, 0);
bptr = (char*) malloc(r->finfo.size + flen + 21);
memcpy(bptr, "namespace eval ", 15); pos += 15;
memcpy(bptr + pos, r->filename, flen); pos += flen;
memcpy(bptr + pos, " {\n", 3); pos +=
3;
memcpy(bptr + pos, mptr, r->finfo.size); pos +=
r->finfo.size;
memcpy(bptr + pos, "\n}\0", 3);
munmap((char*) mptr, r->finfo.size);
close(fd);
in several places. Is it worth making a function out of it?
Tcl_CreateObjCommand(interp, "r", cmd_r, NULL, NULL);
'request_rec' might be more descriptive. Is there a problem with
putting all these commands in a namespace of their own, like
'Apache::' (to borrow something from the perl folks)?
Thanks for all the work! Soon I'll try 'porting' dtcl to it to see how
it runs, and how fast it runs.
BTW, you don't have access to tcl.apache.org yet, do you? Let me know
when you are ready to post some stuff to the web, and I can set you up
with that, too.
--
David N. Welton
Personal: http://www.efn.org/~davidw/
Free Software: http://people.debian.org/~davidw/
Apache Tcl: http://tcl.apache.org