Changeset 3949 for branches/blt4/lang/tcl/src
- Timestamp:
- Sep 24, 2013, 11:57:53 AM (11 years ago)
- Location:
- branches/blt4/lang/tcl/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/lang/tcl/src/Makefile.in
r2936 r3949 39 39 -I$(srcdir)/../../../src/objects \ 40 40 -I$(includedir) 41 version = @PACKAGE_VERSION@ 42 DEFINES = -DPACKAGE_VERSION=\"$(version)\" 41 RAPPTURE_VERSION = @PACKAGE_VERSION@ 42 SVN_VERSION := $(shell svnversion $(srcdir)) 43 DEFINES = -DSVN_VERSION=\"$(SVN_VERSION)\" \ 44 -DRAPPTURE_VERSION=\"$(RAPPTURE_VERSION)\" 43 45 44 46 RANLIB = @RANLIB@ … … 79 81 # Not using RpLibraryTclInterface.o \ 80 82 81 name = Rappture$( version)83 name = Rappture$(RAPPTURE_VERSION) 82 84 libname = $(name) 83 85 lib = $(libname)$(SHLIB_SUFFIX) -
branches/blt4/lang/tcl/src/Rappture_Init.c
r2936 r3949 7 7 * ====================================================================== 8 8 * AUTHOR: Derrick Kearney, Purdue University 9 * Copyright (c) 2004-20 06 Purdue Research Foundation9 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 10 10 * 11 11 * See the file "license.terms" for information on usage and … … 26 26 extern Tcl_AppInitProc RpRusage_Init; 27 27 extern Tcl_AppInitProc RpSignal_Init; 28 extern Tcl_AppInitProc RpS plit_Init;28 extern Tcl_AppInitProc RpSlice_Init; 29 29 extern Tcl_AppInitProc RpSysinfo_Init; 30 30 extern Tcl_AppInitProc RpDaemon_Init; … … 50 50 return TCL_ERROR; 51 51 } 52 if (Tcl_PkgProvide(interp, "Rappture", PACKAGE_VERSION) != TCL_OK) {52 if (Tcl_PkgProvide(interp, "Rappture", RAPPTURE_VERSION) != TCL_OK) { 53 53 return TCL_ERROR; 54 54 } -
branches/blt4/lang/tcl/src/RpCurses.c
r2676 r3949 16 16 * ====================================================================== 17 17 * AUTHOR: Michael McLennan, Purdue University 18 * Copyright (c) 2004-201 1 Purdue Research Foundation18 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 19 19 * 20 20 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpDaemon.c
r1328 r3949 7 7 * ====================================================================== 8 8 * AUTHOR: Michael McLennan, Purdue University 9 * Copyright (c) 2004-20 07 Purdue Research Foundation9 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 10 10 * 11 11 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpEncodeTclInterface.cc
r2966 r3949 6 6 * ====================================================================== 7 7 * AUTHOR: Derrick Kearney, Purdue University 8 * Copyright (c) 2004-20 07 Purdue Research Foundation8 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 9 9 * 10 10 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpLibraryTclInterface.cc
r1388 r3949 8 8 * ====================================================================== 9 9 * AUTHOR: Derrick Kearney, Purdue University 10 * Copyright (c) 2004-20 06 Purdue Research Foundation10 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 11 11 * 12 12 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpRlimit.c
r1286 r3949 9 9 * ====================================================================== 10 10 * AUTHOR: Michael McLennan, Purdue University 11 * Copyright (c) 2004-20 06 Purdue Research Foundation11 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 12 12 * 13 13 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpRusage.c
r2210 r3949 9 9 * ====================================================================== 10 10 * AUTHOR: Michael McLennan, Purdue University 11 * Copyright (c) 2004-20 06 Purdue Research Foundation11 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 12 12 * 13 13 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpSignal.c
r1018 r3949 8 8 * ====================================================================== 9 9 * AUTHOR: Michael McLennan, Purdue University 10 * Copyright (c) 2004-20 06 Purdue Research Foundation10 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 11 11 * 12 12 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpSlice.c
r1578 r3949 17 17 * ====================================================================== 18 18 * AUTHOR: Michael McLennan, Purdue University 19 * Copyright (c) 2004-20 09 Purdue Research Foundation19 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 20 20 * 21 21 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpSysinfo.c
r1403 r3949 7 7 * ====================================================================== 8 8 * AUTHOR: Michael McLennan, Purdue University 9 * Copyright (c) 2004-20 06 Purdue Research Foundation9 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 10 10 * 11 11 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpUnitsTclInterface.cc
r1326 r3949 7 7 * ====================================================================== 8 8 * AUTHOR: Derrick Kearney, Purdue University 9 * Copyright (c) 2004-20 06 Purdue Research Foundation9 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 10 10 * 11 11 * See the file "license.terms" for information on usage and … … 38 38 */ 39 39 40 #include <algorithm> 41 #include <functional> 42 #include <cctype> 43 44 // Trim from start 45 static inline std::string <rim(std::string &s) 46 { 47 s.erase(s.begin(), 48 std::find_if(s.begin(), s.end(), 49 std::not1(std::ptr_fun<int, int>(std::isspace)))); 50 return s; 51 } 52 53 // Trim from end 54 static inline std::string &rtrim(std::string &s) 55 { 56 s.erase(std::find_if(s.rbegin(), s.rend(), 57 std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); 58 return s; 59 } 60 61 // Trim from both ends 62 static inline std::string &trim(std::string &s) 63 { 64 return ltrim(rtrim(s)); 65 } 66 40 67 extern "C" int 41 68 RpUnits_Init(Tcl_Interp *interp) … … 71 98 * provided in -context option. 72 99 */ 100 73 101 74 102 int … … 134 162 return TCL_ERROR; 135 163 } 136 } 137 else { 164 } else { 138 165 // if user does not specify wishes for this option, 139 166 // set fromUnitsName to an empty string. 140 167 fromUnitsName = ""; 141 168 } 142 } 143 else if ( option == "-to" ) { 169 } else if ( option == "-to" ) { 144 170 nextarg++; 145 171 if (argv[nextarg] != NULL) { … … 155 181 return TCL_ERROR; 156 182 } 157 } 158 else { 183 } else { 159 184 // if user does not specify wishes for this option, 160 185 // set toUnitsName to an empty string. 161 186 toUnitsName = ""; 162 187 } 163 } 164 else if ( option == "-units" ) { 188 } else if ( option == "-units" ) { 165 189 nextarg++; 166 190 if (argv[nextarg] != NULL) { … … 173 197 return TCL_ERROR; 174 198 } 175 } 176 else { 199 } else { 177 200 // if user does not specify wishes for this option, 178 201 // return error. … … 182 205 return TCL_ERROR; 183 206 } 184 } 185 else { 207 } else { 186 208 // unrecognized option 187 209 Tcl_AppendResult(interp, "bad option \"", argv[nextarg], … … 192 214 193 215 nextarg++; 194 } 195 else { 216 } else { 196 217 // unrecognized input 197 218 Tcl_AppendResult(interp, "bad option \"", argv[nextarg], "\": ", … … 208 229 // or if we should use those provided in -context option 209 230 210 double value; 211 value = strtod(inValue.c_str(),&endptr); 231 232 // Trim away white space from the value. 233 trim(inValue); 234 235 strtod(inValue.c_str(), &endptr); 212 236 if (endptr == inValue.c_str()) { 213 237 // there was no numeric value that could be pulled from inValue … … 224 248 inValue.c_str(), mesg.c_str(), (char*)NULL); 225 249 return TCL_ERROR; 226 } 227 else if ( ((unsigned)(endptr - inValue.c_str())) == inValue.length() ) { 250 } else if ( ((unsigned)(endptr - inValue.c_str())) == inValue.length() ) { 228 251 // add 1 because we are subtracting indicies 229 252 // there were no units at the end of the inValue string … … 233 256 if (!fromUnitsName.empty()) { 234 257 val = inValue + fromUnitsName; 235 } 236 else { 258 } else { 237 259 Tcl_AppendResult(interp, "value: \"", inValue.c_str(), 238 260 "\" has unrecognized units", (char*)NULL); 239 261 return TCL_ERROR; 240 262 } 241 } 242 else { 263 } else { 243 264 // there seemed to be units at the end of the inValue string 244 265 // we will ignore the -context flag and use the units in inValue … … 253 274 Tcl_AppendResult(interp, convertedVal.c_str(), (char*)NULL); 254 275 retVal = TCL_OK; 255 } 256 else { 276 } else { 257 277 // error while converting 258 278 Tcl_AppendResult(interp, -
branches/blt4/lang/tcl/src/RpUtilsTclInterface.cc
r1018 r3949 7 7 * ====================================================================== 8 8 * AUTHOR: Derrick Kearney, Purdue University 9 * Copyright (c) 2004-20 06 Purdue Research Foundation9 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 10 10 * 11 11 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpWinResource.c
r1018 r3949 12 12 * ====================================================================== 13 13 * AUTHOR: Nicholas J. Kisseberth, Purdue University 14 * Copyright (c) 200 6 Purdue Research Foundation14 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 15 15 * 16 16 * See the file "license.terms" for information on usage and -
branches/blt4/lang/tcl/src/RpWinResource.h
r1018 r3949 13 13 * ====================================================================== 14 14 * AUTHOR: Nicholas J. Kisseberth, Purdue University 15 * Copyright (c) 200 6 Purdue Research Foundation15 * Copyright (c) 2004-2012 HUBzero Foundation, LLC 16 16 * 17 17 * See the file "license.terms" for information on usage and
Note: See TracChangeset
for help on using the changeset viewer.