| 2109 | |
| 2110 | |
| 2111 | int |
| 2112 | TclAddRecorder(ClientData clientData, Tcl_Interp *interp, int argc, |
| 2113 | TCL_Char **argv, Domain &theDomain) |
| 2114 | { |
| 2115 | Recorder *theRecorder =0; |
| 2116 | |
| 2117 | TclCreateRecorder(clientData, interp, argc, argv, theDomain, &theRecorder); |
| 2118 | |
| 2119 | if (theRecorder == 0) { |
| 2120 | |
| 2121 | char buffer[] = "-1"; |
| 2122 | Tcl_SetResult(interp, buffer, TCL_VOLATILE); |
| 2123 | //sprintf(interp->result,"-1"); |
| 2124 | return TCL_ERROR; |
| 2125 | } |
| 2126 | |
| 2127 | if ((theDomain.addRecorder(*theRecorder)) < 0) { |
| 2128 | opserr << "WARNING could not add to domain - recorder " << argv[1]<< endln; |
| 2129 | delete theRecorder; |
| 2130 | char buffer[] = "-1"; |
| 2131 | Tcl_SetResult(interp, buffer, TCL_VOLATILE); |
| 2132 | // sprintf(interp->result,"-1"); |
| 2133 | return TCL_ERROR; |
| 2134 | } |
| 2135 | |
| 2136 | int recorderTag = theRecorder->getTag(); |
| 2137 | char buffer[30]; |
| 2138 | sprintf(buffer,"%d",recorderTag); |
| 2139 | Tcl_SetResult(interp, buffer, TCL_VOLATILE); |
| 2140 | // sprintf(interp->result,"%d",recorderTag); |
| 2141 | |
| 2142 | return TCL_OK; |
| 2143 | } |
| 2144 | |
| 2145 | |
| 2146 | int |
no test coverage detected