tclish_show_result.c 631 B

123456789101112131415161718192021222324252627282930
  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 "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 */