tclish_show_result.c 634 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * tclish_show_result.c
  3. *
  4. * Display the last result for the specified interpreter.
  5. */
  6. #ifdef HAVE_CONFIG_H
  7. #include "config.h"
  8. #endif /* HAVE_CONFIG_H */
  9. #ifdef HAVE_LIBTCL
  10. #include <assert.h>
  11. #include <tcl.h>
  12. #include "tcl_private.h"
  13. /*--------------------------------------------------------- */
  14. void tclish_show_result(Tcl_Interp * interp)
  15. {
  16. Tcl_Obj *obj = Tcl_GetObjResult(interp);
  17. int length;
  18. if (NULL != obj) {
  19. char *string = Tcl_GetStringFromObj(obj, &length);
  20. if (NULL != string) {
  21. printf("%s", string);
  22. }
  23. }
  24. }
  25. /*--------------------------------------------------------- */
  26. #endif /* HAVE_LIBTCL */