| | @@ -314,10 +314,41 @@ |
| 314 | 314 | } |
| 315 | 315 | Th_SetResultInt(interp, rc); |
| 316 | 316 | return TH_OK; |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | + |
| 320 | +/* |
| 321 | +** TH command: tclReady |
| 322 | +** |
| 323 | +** Return true if the fossil binary has the Tcl integration feature |
| 324 | +** enabled and it is currently available for use by TH1 scripts. |
| 325 | +** |
| 326 | +*/ |
| 327 | +static int tclReadyCmd( |
| 328 | + Th_Interp *interp, |
| 329 | + void *p, |
| 330 | + int argc, |
| 331 | + const char **argv, |
| 332 | + int *argl |
| 333 | +){ |
| 334 | + int rc = 0; |
| 335 | + if( argc!=1 ){ |
| 336 | + return Th_WrongNumArgs(interp, "tclReady"); |
| 337 | + } |
| 338 | +#if defined(FOSSIL_ENABLE_TCL) |
| 339 | + if( g.tcl.interp ){ |
| 340 | + rc = 1; |
| 341 | + } |
| 342 | +#endif |
| 343 | + if( g.thTrace ){ |
| 344 | + Th_Trace("[tclReady] => %d<br />\n", rc); |
| 345 | + } |
| 346 | + Th_SetResultInt(interp, rc); |
| 347 | + return TH_OK; |
| 348 | +} |
| 349 | + |
| 319 | 350 | |
| 320 | 351 | /* |
| 321 | 352 | ** TH command: anycap STRING |
| 322 | 353 | ** |
| 323 | 354 | ** Return true if the user has any one of the capabilities listed in STRING. |
| | @@ -734,10 +765,11 @@ |
| 734 | 765 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 735 | 766 | {"query", queryCmd, 0}, |
| 736 | 767 | {"randhex", randhexCmd, 0}, |
| 737 | 768 | {"regexp", regexpCmd, 0}, |
| 738 | 769 | {"repository", repositoryCmd, 0}, |
| 770 | + {"tclReady", tclReadyCmd, 0}, |
| 739 | 771 | {"stime", stimeCmd, 0}, |
| 740 | 772 | {"utime", utimeCmd, 0}, |
| 741 | 773 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 742 | 774 | {0, 0, 0} |
| 743 | 775 | }; |
| 744 | 776 | |