From: Michael N. \(mnorton\) <mn...@ci...> - 2006-02-28 21:05:53
|
Hi, From inside my C extension code, what is the correct way to access a list that is passed in as an argument?=20 My objective with this operation is to learn about writing C extensions. I know vector libraries exist and so forth.=20 Thanks, Mike Here is my code. static int mmatrix_Cmd( ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) { /* set the matrix pointer */ char *mptr; for (mptr =3D objv[1]; *mptr !=3D '\0'; mptr++) { printf("mmatrix_Cmd (%s)\n", mptr); } Tcl_SetObjResult(interp, Tcl_NewStringObj("mmatrix_Cmd done", -1)); return TCL_OK; }=20 Is the list passed in using objv? Here is what I am passing in from Tcl. load ~/script_dev/skunk_works/C_ext/vector =20 # Eq 3.3 Rx, Real-Time Rendering, Moller & Haines # note t - theta # # | cos t 0 sin t 0 | # Ry(t) =3D | 0 1 0 0 | # | -sin t 0 cos t 0 | # | 0 0 0 1 | # set Ry { \ {0 0 0 0} \ {0 1 0 0} \ {0 0 0 0} \ {0 0 0 1} \ } =20 puts $Ry =20 mmatrix $Ry |