On Feb 23, 2005, at 9:59 PM, Brett Schwarz wrote:

just a couple of suggestions, from a very quick first
look (it is hard too sifting through the TAB changes,
as Dossy said):

1) Tcl already has Tcl_GetBoolean...this could be used
instead of the boolean...I believe...no big deal
though

Good idea. It's actually already being used in a few places. I think it's a good idea to be as consistent as possible, using core Tcl APIs where it makes sense.

adpcmds.c:          if (Tcl_GetBooleanFromObj(interp, objv[2], &new) !=
TCL_OK) {
conn.c:         if (Tcl_GetBooleanFromObj(interp, objv[2], &flag) !=
TCL_OK) {
tclconf.c:              if (   Tcl_GetBoolean(interp,
argv[defaultIndex], &iValue)
tclsock.c:          result = Tcl_GetBooleanFromObj(interp, objPtr, &ok);


2) This might be a good time to start moving away from Tcl_AppendResult...just a thought. This is for AS in general. Note: there is also a Tcl_WrongNumArgs function that probably could be used in a few places too.

Same as above - Tcl_WrongNumArgs is much cleaner.


3) similar to 2), it might be a good time to start moving to Obj based commands.

I think this is a good idea as well, and a fair amount of work has already been done. I also personally think Tcl Obj commands are much nicer to work with.



--- Tom Jackson <[EMAIL PROTECTED]> wrote:

I have added a few new C API's for setting (just
adding, not replacing) config
params during startup.

The new API's are named after the current Get API's,
for instance:

Ns_ConfigGetValue
Ns_ConfigSetValue

Due to the amount of common code which would have
been repeated in the new
API's, I factored out this code into private
procedures.

I also compared the resulting code with the Tcl C
API standards contained in
<http://www.tcl.tk/doc/engManual.pdf>.

There were many deviations from this standard in the
original file, so I made
any changes that I noticed, the result is that the
file is mostly new.

If there are any style changes which need to be
made, please point them out on
this list, so I can make the changes.

I included a sample use of the new APIs in nslog.c.

The diff, and changed files are located at:
<http://rmadilo.com/m2/config-changes/>

If this is something that should be included in
future versions of AOLserver,
I need to know which cvs version to do a diff on,
and how. If there are
further suggestions, please note them on this list.

For one, it might be nice to have a ParamDelete
procedure to hide things like
password params after they have been read.  Note
that all config sections are
returned from every virtual server with the current
tcl api commands.

The new APIs are only useful for adding params for
values which are not in the
config file. The section Ns_Set is appended to only
if the section exists,
but in every case, the new APIs return the value
that is needed to set the
default.
I haven't investigated the case where a null
(missing) default is used later
to determine configuration (such as rollFmt), for
now these will remain
undocumented, but I think I can add a check for a
null value to get it to
work.
Untested is Int64.
I'm writing a C module to run tests over the APIs.

tom jackson


-- AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an
email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message.
You can leave the Subject: field of your email
blank.



=====
--brett


-- AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to
<[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to