mirror of
https://github.com/wfjm/w11.git
synced 2026-05-03 06:39:50 +00:00
- migrate to rlink protocol version 4
- Goals for rlink v4
- 16 bit addresses (instead of 8 bit)
- more robust encoding, support for error recovery at transport level
- add features to reduce round trips
- improved attention handling
- new 'list abort' command
- For further details see README_Rlink_V4.txt
- use own C++ based tcl shell tclshcpp instead of tclsh
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// $Id: Rtcl.cpp 488 2013-02-16 18:49:47Z mueller $
|
||||
// $Id: Rtcl.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.0.5 use nullptr
|
||||
// 2013-01-06 473 1.0.4 add NewListIntObj(const uint(8|16)_t, ...)
|
||||
// 2011-03-13 369 1.0.2 add NewListIntObj(vector<uint8_t>)
|
||||
// 2011-03-05 366 1.0.1 add AppendResultNewLines()
|
||||
@@ -22,7 +23,7 @@
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: Rtcl.cpp 488 2013-02-16 18:49:47Z mueller $
|
||||
\version $Id: Rtcl.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of Rtcl.
|
||||
*/
|
||||
|
||||
@@ -54,7 +55,7 @@ Tcl_Obj* Rtcl::NewLinesObj(const std::string& str)
|
||||
|
||||
Tcl_Obj* Rtcl::NewListIntObj(const uint8_t* data, size_t size)
|
||||
{
|
||||
if (size == 0) return Tcl_NewListObj(0, NULL);
|
||||
if (size == 0) return Tcl_NewListObj(0, nullptr);
|
||||
|
||||
vector<Tcl_Obj*> vobj;
|
||||
vobj.reserve(size);
|
||||
@@ -70,7 +71,7 @@ Tcl_Obj* Rtcl::NewListIntObj(const uint8_t* data, size_t size)
|
||||
|
||||
Tcl_Obj* Rtcl::NewListIntObj(const uint16_t* data, size_t size)
|
||||
{
|
||||
if (size == 0) return Tcl_NewListObj(0, NULL);
|
||||
if (size == 0) return Tcl_NewListObj(0, nullptr);
|
||||
|
||||
vector<Tcl_Obj*> vobj;
|
||||
vobj.reserve(size);
|
||||
@@ -111,7 +112,7 @@ bool Rtcl::SetVar(Tcl_Interp* interp, const std::string& varname, Tcl_Obj* pobj)
|
||||
pos_pend == string::npos || pos_pend != varname.length()-1 ||
|
||||
pos_pend-pos_pbeg <= 1) {
|
||||
Tcl_AppendResult(interp, "illformed array name '", varname.c_str(),
|
||||
"'", NULL);
|
||||
"'", nullptr);
|
||||
return false;
|
||||
}
|
||||
string arrname(varname.substr(0,pos_pbeg));
|
||||
@@ -120,7 +121,7 @@ bool Rtcl::SetVar(Tcl_Interp* interp, const std::string& varname, Tcl_Obj* pobj)
|
||||
pret = Tcl_SetVar2Ex(interp, arrname.c_str(), elename.c_str(), pobj,
|
||||
TCL_LEAVE_ERR_MSG);
|
||||
} else {
|
||||
pret = Tcl_SetVar2Ex(interp, varname.c_str(), NULL, pobj,
|
||||
pret = Tcl_SetVar2Ex(interp, varname.c_str(), nullptr, pobj,
|
||||
TCL_LEAVE_ERR_MSG);
|
||||
}
|
||||
|
||||
@@ -149,7 +150,7 @@ void Rtcl::AppendResultNewLines(Tcl_Interp* interp)
|
||||
// that allows to append output from multiple AppendResultLines properly
|
||||
const char* res = Tcl_GetStringResult(interp);
|
||||
if (res && res[0]) {
|
||||
Tcl_AppendResult(interp, "\n", NULL);
|
||||
Tcl_AppendResult(interp, "\n", nullptr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: RtclArgs.cpp 521 2013-05-20 22:16:45Z mueller $
|
||||
// $Id: RtclArgs.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.0.8 use nullptr
|
||||
// 2013-05-19 521 1.0.7 add NextSubOpt() method, pass optset's as const
|
||||
// 2013-02-12 487 1.0.6 add CurrentArg() method
|
||||
// 2013-02-03 481 1.0.5 use Rexception
|
||||
@@ -27,7 +28,7 @@
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: RtclArgs.cpp 521 2013-05-20 22:16:45Z mueller $
|
||||
\version $Id: RtclArgs.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of RtclArgs.
|
||||
*/
|
||||
|
||||
@@ -454,7 +455,7 @@ bool RtclArgs::AllDone()
|
||||
if (fArgErr || fOptErr) return false;
|
||||
if (fNDone < fObjc) {
|
||||
AppendResult("-E: superfluous arguments, first one '",
|
||||
Tcl_GetString(fObjv[fNDone]), "'", NULL);
|
||||
Tcl_GetString(fObjv[fNDone]), "'", nullptr);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -475,7 +476,7 @@ const char* RtclArgs::PeekArgString(int rind) const
|
||||
|
||||
void RtclArgs::AppendResult(const char* str, ...)
|
||||
{
|
||||
Tcl_AppendResult(fpInterp, str, NULL);
|
||||
Tcl_AppendResult(fpInterp, str, nullptr);
|
||||
va_list ap;
|
||||
va_start (ap, str);
|
||||
Tcl_AppendResultVA(fpInterp, ap);
|
||||
@@ -491,9 +492,9 @@ void RtclArgs::AppendResultLines(const std::string& str)
|
||||
Rtcl::AppendResultNewLines(fpInterp);
|
||||
|
||||
if (str.length()>0 && str[str.length()-1]=='\n') {
|
||||
Tcl_AppendResult(fpInterp, str.substr(0,str.length()-1).c_str(), NULL);
|
||||
Tcl_AppendResult(fpInterp, str.substr(0,str.length()-1).c_str(), nullptr);
|
||||
} else {
|
||||
Tcl_AppendResult(fpInterp, str.c_str(), NULL);
|
||||
Tcl_AppendResult(fpInterp, str.c_str(), nullptr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -512,7 +513,7 @@ bool RtclArgs::NextArg(const char* name, Tcl_Obj*& pobj)
|
||||
|
||||
if (fNDone == fObjc) {
|
||||
if (!isopt) {
|
||||
AppendResult("-E: required argument '", name, "' missing", NULL);
|
||||
AppendResult("-E: required argument '", name, "' missing", nullptr);
|
||||
fArgErr = true;
|
||||
return false;
|
||||
}
|
||||
@@ -578,7 +579,7 @@ bool RtclArgs::ConfigReadCheck()
|
||||
if (fNConfigRead != 0) {
|
||||
SetResult(Tcl_NewObj());
|
||||
AppendResult("-E: only one config read allowed per command, '",
|
||||
PeekArgString(-1), "' is second", NULL);
|
||||
PeekArgString(-1), "' is second", nullptr);
|
||||
return false;
|
||||
}
|
||||
fNConfigRead += 1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: RtclClassBase.cpp 488 2013-02-16 18:49:47Z mueller $
|
||||
// $Id: RtclClassBase.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.0.4 use nullptr
|
||||
// 2013-02-10 485 1.0.3 add static const defs
|
||||
// 2013-01-13 474 1.0.2 TclClassCmd(): check for existing Rtclproxy names
|
||||
// 2011-03-05 366 1.0.1 use AppendResultNewLines() in exception catcher
|
||||
@@ -22,7 +23,7 @@
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: RtclClassBase.cpp 488 2013-02-16 18:49:47Z mueller $
|
||||
\version $Id: RtclClassBase.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of RtclClassBase.
|
||||
*/
|
||||
|
||||
@@ -103,7 +104,7 @@ int RtclClassBase::TclClassCmd(Tcl_Interp* interp, int objc,
|
||||
if (pprox) {
|
||||
Tcl_AppendResult(interp, "-E: command name '", name,
|
||||
"' exists already as RtclProxy of type '",
|
||||
pprox->Type().c_str(), "'", NULL);
|
||||
pprox->Type().c_str(), "'", nullptr);
|
||||
return kERR;
|
||||
|
||||
}
|
||||
@@ -119,7 +120,7 @@ int RtclClassBase::ClassCmdList(Tcl_Interp* interp)
|
||||
{
|
||||
std::vector<RtclProxyBase*> list;
|
||||
RtclContext::Find(interp).ListProxy(list, Type());
|
||||
RtclOPtr rlist(Tcl_NewListObj(0, NULL));
|
||||
RtclOPtr rlist(Tcl_NewListObj(0, nullptr));
|
||||
|
||||
for (size_t i=0; i<list.size(); i++) {
|
||||
const char* cmdname = Tcl_GetCommandName(interp, list[i]->Token());
|
||||
@@ -139,26 +140,26 @@ int RtclClassBase::ClassCmdDelete(Tcl_Interp* interp, const char* name)
|
||||
{
|
||||
Tcl_CmdInfo cinfo;
|
||||
if (Tcl_GetCommandInfo(interp, name, &cinfo) == 0) {
|
||||
Tcl_AppendResult(interp, "-E: unknown command name '", name, "'", NULL);
|
||||
Tcl_AppendResult(interp, "-E: unknown command name '", name, "'", nullptr);
|
||||
return kERR;
|
||||
}
|
||||
|
||||
RtclContext& cntx = RtclContext::Find(interp);
|
||||
if (!cntx.CheckProxy((RtclProxyBase*) cinfo.objClientData)) {
|
||||
Tcl_AppendResult(interp, "-E: command '", name, "' is not a RtclProxy",
|
||||
NULL);
|
||||
nullptr);
|
||||
return kERR;
|
||||
}
|
||||
if (!cntx.CheckProxy((RtclProxyBase*) cinfo.objClientData, Type())) {
|
||||
Tcl_AppendResult(interp, "-E: command '", name,
|
||||
"' is not a RtclProxy of type '",
|
||||
Type().c_str(), "'", NULL);
|
||||
Type().c_str(), "'", nullptr);
|
||||
return kERR;
|
||||
}
|
||||
|
||||
int irc = Tcl_DeleteCommand(interp, name);
|
||||
if (irc != kOK) Tcl_AppendResult(interp, "-E: failed to delete '", name,
|
||||
"'", NULL);
|
||||
"'", nullptr);
|
||||
return irc;
|
||||
}
|
||||
|
||||
@@ -170,7 +171,7 @@ int RtclClassBase::ThunkTclClassCmd(ClientData cdata, Tcl_Interp* interp,
|
||||
{
|
||||
if (!cdata) {
|
||||
Tcl_AppendResult(interp, "-E: BUG! ThunkTclClassCmd called with cdata == 0",
|
||||
NULL);
|
||||
nullptr);
|
||||
return kERR;
|
||||
}
|
||||
|
||||
@@ -179,7 +180,7 @@ int RtclClassBase::ThunkTclClassCmd(ClientData cdata, Tcl_Interp* interp,
|
||||
} catch (exception& e) {
|
||||
Rtcl::AppendResultNewLines(interp);
|
||||
Tcl_AppendResult(interp, "-E: exception caught in ThunkTclClassCmd: '",
|
||||
e.what(), "'", NULL);
|
||||
e.what(), "'", nullptr);
|
||||
}
|
||||
return kERR;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: RtclCmdBase.cpp 516 2013-05-05 21:24:52Z mueller $
|
||||
// $Id: RtclCmdBase.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.0.3 use nullptr
|
||||
// 2013-02-10 485 1.0.2 add static const defs
|
||||
// 2013-02-05 483 1.0.1 remove 'unknown specified, full match only' logic
|
||||
// 2013-02-02 480 1.0 Initial version (refactored out from ProxyBase)
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: RtclCmdBase.cpp 516 2013-05-05 21:24:52Z mueller $
|
||||
\version $Id: RtclCmdBase.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of RtclCmdBase.
|
||||
*/
|
||||
|
||||
@@ -94,11 +95,11 @@ int RtclCmdBase::DispatchCmd(RtclArgs& args)
|
||||
}
|
||||
|
||||
Tcl_AppendResult(interp, "-E: bad option '", name.c_str(),
|
||||
"': must be ", NULL);
|
||||
"': must be ", nullptr);
|
||||
const char* delim = "";
|
||||
for (mmap_cit_t it1=fMapMeth.begin(); it1!=fMapMeth.end(); it1++) {
|
||||
if (it1->first.c_str()[0] != '$') {
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), NULL);
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), nullptr);
|
||||
delim = ",";
|
||||
}
|
||||
}
|
||||
@@ -111,11 +112,11 @@ int RtclCmdBase::DispatchCmd(RtclArgs& args)
|
||||
it1++;
|
||||
if (it1!=fMapMeth.end() && name==it1->first.substr(0,name.length())) {
|
||||
Tcl_AppendResult(interp, "-E: ambiguous option '",
|
||||
name.c_str(), "': must be ", NULL);
|
||||
name.c_str(), "': must be ", nullptr);
|
||||
const char* delim = "";
|
||||
for (it1=it_match; it1!=fMapMeth.end() &&
|
||||
name==it1->first.substr(0,name.length()); it1++) {
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), NULL);
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), nullptr);
|
||||
delim = ",";
|
||||
}
|
||||
return kERR;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: RtclGetList.cpp 516 2013-05-05 21:24:52Z mueller $
|
||||
// $Id: RtclGetList.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,12 +13,13 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.0.1 use nullptr
|
||||
// 2013-02-12 487 1.0 Initial version
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: RtclGetList.cpp 516 2013-05-05 21:24:52Z mueller $
|
||||
\version $Id: RtclGetList.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of class RtclGetList.
|
||||
*/
|
||||
|
||||
@@ -83,10 +84,10 @@ int RtclGetList::M_get(RtclArgs& args)
|
||||
// complain if not found
|
||||
if (it == fMap.end() || pname != it->first.substr(0,pname.length())) {
|
||||
Tcl_AppendResult(interp, "-E: unknown property '", pname.c_str(),
|
||||
"': must be ", NULL);
|
||||
"': must be ", nullptr);
|
||||
const char* delim = "";
|
||||
for (map_cit_t it1=fMap.begin(); it1!=fMap.end(); it1++) {
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), NULL);
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), nullptr);
|
||||
delim = ",";
|
||||
}
|
||||
return TCL_ERROR;
|
||||
@@ -97,11 +98,11 @@ int RtclGetList::M_get(RtclArgs& args)
|
||||
it1++;
|
||||
if (it1!=fMap.end() && pname==it1->first.substr(0,pname.length())) {
|
||||
Tcl_AppendResult(interp, "-E: ambiguous property name '", pname.c_str(),
|
||||
"': must be ", NULL);
|
||||
"': must be ", nullptr);
|
||||
const char* delim = "";
|
||||
for (it1=it; it1!=fMap.end() &&
|
||||
pname==it1->first.substr(0,pname.length()); it1++) {
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), NULL);
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), nullptr);
|
||||
delim = ",";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: RtclNameSet.cpp 521 2013-05-20 22:16:45Z mueller $
|
||||
// $Id: RtclNameSet.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.1.1 use nullptr
|
||||
// 2013-05-19 521 1.1 add CheckMatch()
|
||||
// 2013-02-03 481 1.0.1 use Rexception
|
||||
// 2011-02-20 363 1.0 Initial version
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: RtclNameSet.cpp 521 2013-05-20 22:16:45Z mueller $
|
||||
\version $Id: RtclNameSet.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of RtclNameSet.
|
||||
*/
|
||||
|
||||
@@ -103,10 +104,10 @@ int RtclNameSet::CheckMatch(Tcl_Interp* interp, std::string& rval,
|
||||
if (it==fSet.end() || tval!=it->substr(0,tval.length())) {
|
||||
if (misserr) {
|
||||
Tcl_AppendResult(interp, "-E: bad option '", tval.c_str(),
|
||||
"': must be ", NULL);
|
||||
"': must be ", nullptr);
|
||||
const char* delim = "";
|
||||
for (nset_cit_t it1=fSet.begin(); it1!=fSet.end(); it1++) {
|
||||
Tcl_AppendResult(interp, delim, it1->c_str(), NULL);
|
||||
Tcl_AppendResult(interp, delim, it1->c_str(), nullptr);
|
||||
delim = ",";
|
||||
}
|
||||
}
|
||||
@@ -119,11 +120,11 @@ int RtclNameSet::CheckMatch(Tcl_Interp* interp, std::string& rval,
|
||||
it1++;
|
||||
if (it1!=fSet.end() && tval==it1->substr(0,tval.length())) {
|
||||
Tcl_AppendResult(interp, "-E: ambiguous option '", tval.c_str(),
|
||||
"': must be ", NULL);
|
||||
"': must be ", nullptr);
|
||||
const char* delim = "";
|
||||
for (it1=it; it1!=fSet.end() &&
|
||||
tval==it1->substr(0,tval.length()); it1++) {
|
||||
Tcl_AppendResult(interp, delim, it1->c_str(), NULL);
|
||||
Tcl_AppendResult(interp, delim, it1->c_str(), nullptr);
|
||||
delim = ",";
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: RtclProxyBase.cpp 488 2013-02-16 18:49:47Z mueller $
|
||||
// $Id: RtclProxyBase.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.4.3 use nullptr
|
||||
// 2013-02-09 485 1.4.2 add CommandName()
|
||||
// 2013-02-05 483 1.4.1 ClassCmdConfig: use RtclArgs
|
||||
// 2013-02-02 480 1.4 factor out RtclCmdBase base class
|
||||
@@ -26,7 +27,7 @@
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: RtclProxyBase.cpp 488 2013-02-16 18:49:47Z mueller $
|
||||
\version $Id: RtclProxyBase.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of RtclProxyBase.
|
||||
*/
|
||||
|
||||
@@ -125,7 +126,7 @@ int RtclProxyBase::ThunkTclObjectCmd(ClientData cdata, Tcl_Interp* interp,
|
||||
{
|
||||
if (!cdata) {
|
||||
Tcl_AppendResult(interp, "-E: BUG! ThunkTclObjectCmd called with cdata==0",
|
||||
NULL);
|
||||
nullptr);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -133,7 +134,7 @@ int RtclProxyBase::ThunkTclObjectCmd(ClientData cdata, Tcl_Interp* interp,
|
||||
return ((RtclProxyBase*) cdata)->TclObjectCmd(interp, objc, objv);
|
||||
} catch (exception& e) {
|
||||
Rtcl::AppendResultNewLines(interp);
|
||||
Tcl_AppendResult(interp, "-E: exception caught '", e.what(), "'", NULL);
|
||||
Tcl_AppendResult(interp, "-E: exception caught '", e.what(), "'", nullptr);
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: RtclSetList.cpp 516 2013-05-05 21:24:52Z mueller $
|
||||
// $Id: RtclSetList.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,12 +13,13 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.0.1 use nullptr
|
||||
// 2013-02-12 487 1.0 Initial version
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: RtclSetList.cpp 516 2013-05-05 21:24:52Z mueller $
|
||||
\version $Id: RtclSetList.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of class RtclSetList.
|
||||
*/
|
||||
|
||||
@@ -83,10 +84,10 @@ int RtclSetList::M_set(RtclArgs& args)
|
||||
// complain if not found
|
||||
if (it == fMap.end() || pname != it->first.substr(0,pname.length())) {
|
||||
Tcl_AppendResult(interp, "-E: unknown property '", pname.c_str(),
|
||||
"': must be ", NULL);
|
||||
"': must be ", nullptr);
|
||||
const char* delim = "";
|
||||
for (map_cit_t it1=fMap.begin(); it1!=fMap.end(); it1++) {
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), NULL);
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), nullptr);
|
||||
delim = ",";
|
||||
}
|
||||
return TCL_ERROR;
|
||||
@@ -97,11 +98,11 @@ int RtclSetList::M_set(RtclArgs& args)
|
||||
it1++;
|
||||
if (it1!=fMap.end() && pname==it1->first.substr(0,pname.length())) {
|
||||
Tcl_AppendResult(interp, "-E: ambiguous property name '", pname.c_str(),
|
||||
"': must be ", NULL);
|
||||
"': must be ", nullptr);
|
||||
const char* delim = "";
|
||||
for (it1=it; it1!=fMap.end() &&
|
||||
pname==it1->first.substr(0,pname.length()); it1++) {
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), NULL);
|
||||
Tcl_AppendResult(interp, delim, it1->first.c_str(), nullptr);
|
||||
delim = ",";
|
||||
}
|
||||
|
||||
@@ -115,9 +116,9 @@ int RtclSetList::M_set(RtclArgs& args)
|
||||
try {
|
||||
(it->second)->operator()(args);
|
||||
} catch (Rexception& e) {
|
||||
Tcl_AppendResult(args.Interp(), ", ", e.ErrMsg().Text().c_str(), NULL);
|
||||
Tcl_AppendResult(args.Interp(), ", ", e.ErrMsg().Text().c_str(), nullptr);
|
||||
} catch (exception& e) {
|
||||
Tcl_AppendResult(args.Interp(), " -E: ", e.what(), NULL);
|
||||
Tcl_AppendResult(args.Interp(), " -E: ", e.what(), nullptr);
|
||||
}
|
||||
|
||||
return TCL_OK;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: RtclStats.cpp 495 2013-03-06 17:13:48Z mueller $
|
||||
// $Id: RtclStats.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
//
|
||||
// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -13,6 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2014-08-22 584 1.0.2 use nullptr
|
||||
// 2013-03-06 495 1.0.1 Rename Exec->Collect
|
||||
// 2011-02-26 364 1.0 Initial version
|
||||
// 2011-02-20 363 0.1 First draft
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
/*!
|
||||
\file
|
||||
\version $Id: RtclStats.cpp 495 2013-03-06 17:13:48Z mueller $
|
||||
\version $Id: RtclStats.cpp 584 2014-08-22 19:38:12Z mueller $
|
||||
\brief Implemenation of RtclStats.
|
||||
*/
|
||||
|
||||
@@ -111,13 +112,13 @@ bool RtclStats::Collect(RtclArgs& args, const Context& cntx,
|
||||
for (size_t i=0; i<stats.Size(); i++) {
|
||||
const string& name(stats.Name(i));
|
||||
RtclOPtr ptup(Tcl_NewListObj(0,0));
|
||||
Tcl_ListObjAppendElement(NULL, ptup,
|
||||
Tcl_ListObjAppendElement(nullptr, ptup,
|
||||
Tcl_NewDoubleObj(stats.Value(i)));
|
||||
Tcl_ListObjAppendElement(NULL, ptup,
|
||||
Tcl_ListObjAppendElement(nullptr, ptup,
|
||||
Tcl_NewStringObj(name.data(), name.length()));
|
||||
if (cntx.opt == "-lall") {
|
||||
const string& text(stats.Text(i));
|
||||
Tcl_ListObjAppendElement(NULL, ptup,
|
||||
Tcl_ListObjAppendElement(nullptr, ptup,
|
||||
Tcl_NewStringObj(text.data(), text.length()));
|
||||
}
|
||||
if (Tcl_ListObjAppendElement(interp, plist, ptup) != TCL_OK) return false;
|
||||
@@ -145,7 +146,7 @@ bool RtclStats::Collect(RtclArgs& args, const Context& cntx,
|
||||
|
||||
} else {
|
||||
args.AppendResult("-E: BUG! RtclStats::Collect: bad option '",
|
||||
cntx.opt.c_str(), "'", NULL);
|
||||
cntx.opt.c_str(), "'", nullptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user