Пример #1
0
 public TclInterp()
 {
     unsafe {
         _interp = TclNative.Tcl_CreateInterp();
         if (_interp == null)
         {
             throw new OutOfMemoryException();
         }
     }
     _keepAlive = new Hashtable();
 }
Пример #2
0
        public TclCmdToken CreateCommand(string cmdName, TclCmdProc proc, TclCmdDeleteProc deleteProc)
        {
            TclCmdToken token;

            TclCmdProcWrapper       cmdWrapper    = new TclCmdProcWrapper(this, proc);
            TclCmdDeleteProcWrapper deleteWrapper = new TclCmdDeleteProcWrapper(this, deleteProc, cmdWrapper);

            unsafe {
                token._token = TclNative.Tcl_CreateCommand(_interp, cmdName, cmdWrapper.Callback,
                                                           IntPtr.Zero, deleteWrapper.Callback);
            }

            return(token);
        }
Пример #3
0
 public void TclInit()
 {
     unsafe {
         HandleError(TclNative.Tcl_Init(_interp));
     }
 }
Пример #4
0
 public string GetVar(string varName, int flags)
 {
     unsafe {
         return(Marshal.PtrToStringAnsi(TclNative.Tcl_GetVar(_interp, varName, flags)));
     }
 }
Пример #5
0
 public void Eval(string str)
 {
     unsafe {
         HandleError(TclNative.Tcl_Eval(_interp, str));
     }
 }