From: Zoran V. <zv...@ar...> - 2005-02-26 17:19:57
|
On Tuesday 22 February 2005 00:27, Stephen Deasey wrote: > Has anyone had a chance to look at the Ns_ParseObjv() patch I posted? > > http://sourceforge.net/tracker/index.php?func=detail&aid=1122940&group_id=130646&atid=719009 > > My main concern is that the general approach is about right. Does it > make sense? One thing I notice is that there's no facility to check > the presence of a switch that doesn't take an arg, a boolean switch. It makes sense. I have checked this in and took the liberty to reformat it a little to maintain the 80-char margin, fix tabs to spaces and a touch in function comment headers here/there. I hope you don't mind... I'm just an old nitpicker! > That is a simple Ns_ObjvProc plugin. Yup. This we should add as well. Oh, yes... I changed Ns_ObjvString to optionally return the length of the parsed string in *arg. This should not break anything, as I see it, or? int Ns_ObjvString(void *dest, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *arg) { if (objc > 0) { if (arg == NULL) { *((char **) dest) = Tcl_GetString(objv[0]); } else { *((char **) dest) = Tcl_GetStringFromObj(objv[0], (int*)arg); } return --objc; } return -1; } Cheers Zoran |