Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 27, 2008, 4:54:31 PM (16 years ago)
Author:
landauf
Message:

tcl can now initialize itself by loading the *.tcl files from media/tcl

Location:
code/branches/console/src/cpptcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/cpptcl/CppTcl.cc

    r1151 r1194  
    859859}
    860860
     861interpreter::interpreter(string const &libpath)
     862{
     863     interp_ =  Tcl_CreateInterp();
     864     owner_ = true;
     865
     866     try
     867     {
     868        this->eval("set tcl_library " + libpath);
     869        Tcl_Init(this->interp_);
     870     } catch (...) {}
     871}
     872
    861873interpreter::interpreter(Tcl_Interp *interp, bool owner)
    862874{
  • code/branches/console/src/cpptcl/CppTcl.h

    r1151 r1194  
    7070public:
    7171     result(Tcl_Interp *interp);
    72      
     72
    7373     operator bool() const;
    7474     operator double() const;
     
    171171               throw tcl_error("Too few arguments.");
    172172          }
    173          
     173
    174174          std::string methodName(Tcl_GetString(objv[1]));
    175175
     
    468468public:
    469469     interpreter();
     470     interpreter(std::string const &libpath);
    470471     interpreter(Tcl_Interp *, bool owner = true);
    471472     ~interpreter();
    472      
     473
    473474     void make_safe();
    474      
     475
    475476     Tcl_Interp * get() const { return interp_; }
    476477
    477      // free function definitions     
    478      
     478     // free function definitions
     479
    479480     template <typename R>
    480481     void def(std::string const &name, R (*f)(),
     
    633634     }
    634635
    635      // free script evaluation     
     636     // free script evaluation
    636637     details::result eval(std::string const &script);
    637638     details::result eval(std::istream &s);
     
    837838          throw tcl_error(interp_);
    838839     }
    839  
     840
    840841     return details::result(interp_);
    841842}
Note: See TracChangeset for help on using the changeset viewer.