summaryrefslogtreecommitdiffstats
path: root/tksao/frame/callback.C
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 18:59:29 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 18:59:29 (GMT)
commitd4d595fa7fb12903db9227d33d48b2b00120dbd1 (patch)
tree7d18365de0d6d1b29399b6a17c7eb01c2eb3ed49 /tksao/frame/callback.C
parent949f96e29bfe0bd8710d775ce220e597064e2589 (diff)
downloadblt-d4d595fa7fb12903db9227d33d48b2b00120dbd1.zip
blt-d4d595fa7fb12903db9227d33d48b2b00120dbd1.tar.gz
blt-d4d595fa7fb12903db9227d33d48b2b00120dbd1.tar.bz2
Initial commit
Diffstat (limited to 'tksao/frame/callback.C')
-rw-r--r--tksao/frame/callback.C59
1 files changed, 59 insertions, 0 deletions
diff --git a/tksao/frame/callback.C b/tksao/frame/callback.C
new file mode 100644
index 0000000..3ec3d1f
--- /dev/null
+++ b/tksao/frame/callback.C
@@ -0,0 +1,59 @@
+// Copyright (C) 1999-2016
+// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+// For conditions of distribution and use, see copyright notice in "copyright"
+
+#include <string.h>
+
+#include "callback.h"
+
+CallBack::CallBack(const CallBack& a)
+{
+ interp_ = a.interp_;
+
+ type_ = a.type_;
+ strcpy(proc_, a.proc_);
+ strcpy(arg_, a.arg_);
+
+ previous_ = NULL;
+ next_ = NULL;
+}
+
+CallBack& CallBack::operator=(const CallBack& a)
+{
+ interp_ = a.interp_;
+
+ type_ = a.type_;
+ strcpy(proc_, a.proc_);
+ strcpy(arg_, a.arg_);
+
+ previous_ = NULL;
+ next_ = NULL;
+
+ return *this;
+}
+
+CallBack::CallBack(Tcl_Interp* interp, Type type,
+ const char* proc, const char* arg)
+{
+ interp_ = interp;
+
+ type_ = type;
+
+ if (proc)
+ strncpy(proc_, proc, 32);
+ else
+ proc_[0] = '\0';
+
+ if (arg)
+ strncpy(arg_, arg, 64);
+ else
+ arg_[0] = '\0';
+
+ previous_ = NULL;
+ next_ = NULL;
+}
+
+int CallBack::eval(const char* arg2)
+{
+ return Tcl_VarEval(interp_, proc_, " ", arg_, " ", arg2, NULL);
+}