Changeset 2936 for branches/blt4/lang
- Timestamp:
- Apr 3, 2012, 3:51:13 PM (13 years ago)
- Location:
- branches/blt4/lang
- Files:
-
- 3 added
- 3 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/lang/R/Rappture/NAMESPACE
r2737 r2936 12 12 rp_lib_result, 13 13 rp_units_convert_double, 14 rp_units_convert_string ) 14 rp_units_convert_string, 15 rp_utils_progress ) 15 16 -
branches/blt4/lang/R/Rappture/R/Rappture.R
r2737 r2936 49 49 } 50 50 51 rp_utils_progress <- function(percent,message) { 52 .Call("RPRUtilsProgress",percent,message) 53 } 54 51 55 .onLoad <- function(lib,pkg) { 52 56 } -
branches/blt4/lang/R/Rappture/configure
r2737 r2936 240 240 else 241 241 $as_echo "$0: Please tell bug-autoconf@gnu.org and 242 $0: rappture@nanohub.org about your system, including 243 $0: any error possibly output before this message. Then244 $0: install a modern shell, or manually run the script245 $0: under such ashell if you do have one."242 $0: rappture@nanohub.org about your system, including any 243 $0: error possibly output before this message. Then install 244 $0: a modern shell, or manually run the script under such a 245 $0: shell if you do have one." 246 246 fi 247 247 exit 1 … … 1518 1518 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 1519 1519 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} 1520 ( $as_echo "## ----------------------------------- ------##1520 ( $as_echo "## ----------------------------------- ## 1521 1521 ## Report this to rappture@nanohub.org ## 1522 ## ----------------------------------- ------##"1522 ## ----------------------------------- ##" 1523 1523 ) | sed "s/^/$as_me: WARNING: /" >&2 1524 1524 ;; … … 3417 3417 3418 3418 3419 for ac_header in RpLibrary.h RpUnits.h 3419 for ac_header in RpLibrary.h RpUnits.h RpUtils.h 3420 3420 do : 3421 3421 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 3431 3431 3432 3432 if test "${ac_cv_header_RpLibrary_h}" = no || 3433 test "${ac_cv_header_RpUnits_h}" = no; then 3434 as_fn_error $? "\"Rappture headers RpLibrary.h and RpUnits.h not found\"" "$LINENO" 5 3433 test "${ac_cv_header_RpUnits_h}" = no || 3434 test "${ac_cv_header_RpUtils_h}" = no; then 3435 as_fn_error RpUnits.h "\"Rappture headers RpLibrary.h" "$LINENO" 5 3435 3436 fi 3436 3437 … … 3549 3550 else 3550 3551 as_fn_error $? "\"no librappture with RpUnits found\"" "$LINENO" 5 3552 fi 3553 3554 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing rpUtilsProgress" >&5 3555 $as_echo_n "checking for library containing rpUtilsProgress... " >&6; } 3556 if ${ac_cv_search_rpUtilsProgress+:} false; then : 3557 $as_echo_n "(cached) " >&6 3558 else 3559 ac_func_search_save_LIBS=$LIBS 3560 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 3561 /* end confdefs.h. */ 3562 3563 /* Override any GCC internal prototype to avoid an error. 3564 Use char because int might match the return type of a GCC 3565 builtin and then its argument prototype would still apply. */ 3566 #ifdef __cplusplus 3567 extern "C" 3568 #endif 3569 char rpUtilsProgress (); 3570 int 3571 main () 3572 { 3573 return rpUtilsProgress (); 3574 ; 3575 return 0; 3576 } 3577 _ACEOF 3578 for ac_lib in '' rappture; do 3579 if test -z "$ac_lib"; then 3580 ac_res="none required" 3581 else 3582 ac_res=-l$ac_lib 3583 LIBS="-l$ac_lib $ac_func_search_save_LIBS" 3584 fi 3585 if ac_fn_c_try_link "$LINENO"; then : 3586 ac_cv_search_rpUtilsProgress=$ac_res 3587 fi 3588 rm -f core conftest.err conftest.$ac_objext \ 3589 conftest$ac_exeext 3590 if ${ac_cv_search_rpUtilsProgress+:} false; then : 3591 break 3592 fi 3593 done 3594 if ${ac_cv_search_rpUtilsProgress+:} false; then : 3595 3596 else 3597 ac_cv_search_rpUtilsProgress=no 3598 fi 3599 rm conftest.$ac_ext 3600 LIBS=$ac_func_search_save_LIBS 3601 fi 3602 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_rpUtilsProgress" >&5 3603 $as_echo "$ac_cv_search_rpUtilsProgress" >&6; } 3604 ac_res=$ac_cv_search_rpUtilsProgress 3605 if test "$ac_res" != no; then : 3606 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 3607 3608 else 3609 as_fn_error $? "\"no librappture with RpUtils found\"" "$LINENO" 5 3551 3610 fi 3552 3611 -
branches/blt4/lang/R/Rappture/src/RpLibraryRInterface.cc
r2737 r2936 464 464 465 465 466 INTEGER(ans)[0] = 1;466 INTEGER(ans)[0] = 0; 467 467 468 468 UNPROTECT(1); … … 554 554 appendVal); 555 555 556 INTEGER(ans)[0] = 1;556 INTEGER(ans)[0] = 0; 557 557 558 558 UNPROTECT(1); … … 642 642 appendVal); 643 643 644 INTEGER(ans)[0] = 1;644 INTEGER(ans)[0] = 0; 645 645 646 646 UNPROTECT(1); … … 739 739 appendVal); 740 740 741 INTEGER(ans)[0] = 1;741 INTEGER(ans)[0] = 0; 742 742 743 743 UNPROTECT(1); -
branches/blt4/lang/R/Rappture/src/RpRBindings.c
r2737 r2936 14 14 #include "RpLibraryRInterface.h" 15 15 #include "RpUnitsRInterface.h" 16 #include "RpUtilsRInterface.h" 16 17 17 18 #include <R_ext/Rdynload.h> … … 31 32 {"RPRUnitsConvertDouble", (DL_FUNC) &RPRUnitsConvertDouble, 2}, 32 33 {"RPRUnitsConvertString", (DL_FUNC) &RPRUnitsConvertString, 3}, 34 {"RPRUtilsProgress", (DL_FUNC) &RPRUtilsProgress, 2}, 33 35 {NULL, NULL, 0} 34 36 }; -
branches/blt4/lang/python/Rappture/tools.py
r845 r2936 7 7 # ====================================================================== 8 8 9 import sys, os, re, popen2, select9 import sys, os, re, subprocess, select 10 10 11 11 # getCommandOutput function written by Steve Clark … … 15 15 global commandPid 16 16 17 child = popen2.Popen3(command,1) 17 BUFSIZ = 4096 18 child = subprocess.Popen(command,shell=True,bufsize=BUFSIZ, \ 19 stdout=subprocess.PIPE, \ 20 stderr=subprocess.PIPE, \ 21 close_fds=True) 18 22 commandPid = child.pid 19 child.tochild.close() # don't need to talk to child 20 childout = child.fromchild 23 childout = child.stdout 21 24 childoutFd = childout.fileno() 22 childerr = child.childerr25 childerr = child.stderr 23 26 childerrFd = childerr.fileno() 24 27 25 28 outEOF = errEOF = 0 26 BUFSIZ = 409627 29 28 30 outData = [] -
branches/blt4/lang/tcl/scripts/library.tcl
r2201 r2936 20 20 # load the object system along with the XML library code 21 21 Rappture::objects::init 22 encoding system utf-8 22 23 23 24 # ---------------------------------------------------------------------- … … 509 510 return "" 510 511 } 512 set string [$node text] 511 513 # Expat (via tDOM) will always produce utf-8 output, regardless of the 512 514 # encoding of the tool.xml. We need to convert utf-8 to unicode for 513 515 # Tcl/Tk. This shouldn't affect ASCII tool.xml files. 514 set string [encoding convertfrom utf-8 [$node text]] 516 #puts stderr "before $path=$string" 517 #set string [encoding convertfrom utf-8 $string] 518 #puts stderr "after $path=$string [string length $string]" 519 #Rappture::encoding::debug $string 515 520 if {$params(-decode) == "yes"} { 516 set string [Rappture::encoding::decode -- $string] 517 } 521 set string [Rappture::encoding::decode -- $string] 522 } 523 puts stderr "returning $path=$string" 518 524 return [string trim $string] 519 525 } -
branches/blt4/lang/tcl/src/Makefile.in
r2742 r2936 77 77 endif 78 78 79 ifeq ($(HAVE_FFMPEG),yes)80 OBJS += RpVideoTclInterface.o81 LIBS += -L../../../src/objects -lRpObjects82 endif83 84 85 79 # Not using RpLibraryTclInterface.o \ 86 80 -
branches/blt4/lang/tcl/src/Rappture_Init.c
r2676 r2936 38 38 extern Tcl_AppInitProc RpUtils_Init; 39 39 40 #ifdef BUILD_with_ffmpeg41 extern Tcl_AppInitProc RpVideo_Init;42 #endif43 44 40 #ifdef BUILD_Rappture 45 41 __declspec( dllexport ) … … 71 67 return TCL_ERROR; 72 68 } 73 #ifdef BUILD_with_ffmpeg74 if (RpVideo_Init(interp) != TCL_OK) {75 return TCL_ERROR;76 }77 #endif78 69 if (RpRlimit_Init(interp) != TCL_OK) { 79 70 return TCL_ERROR; -
branches/blt4/lang/tcl/src/RpEncodeTclInterface.cc
r2046 r2936 22 22 static Tcl_ObjCmdProc EncodeCmd; 23 23 static Tcl_ObjCmdProc DecodeCmd; 24 static Tcl_ObjCmdProc DebugCmd; 24 25 25 26 /**********************************************************************/ … … 45 46 Tcl_CreateObjCommand(interp, "::Rappture::encoding::decode", 46 47 DecodeCmd, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); 48 49 Tcl_CreateObjCommand(interp, "::Rappture::encoding::debug", 50 DebugCmd, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); 47 51 return TCL_OK; 48 52 } … … 258 262 int n; 259 263 n = Rp_ParseSwitches(interp, decodeSwitches, objc - 1, objv + 1, &switches, 260 264 SWITCH_OBJV_PARTIAL); 261 265 if (n < 0) { 262 266 return TCL_ERROR; … … 270 274 return TCL_ERROR; 271 275 } 272 int n Bytes;273 const char *string;274 string = (const char*)Tcl_GetByteArrayFromObj(objv[last], &nBytes); 275 if (nBytes <= 0) {276 return TCL_OK; // Nothing to decode. 277 }278 Rappture::Buffer buf(string, nBytes); 276 int numBytes; 277 const char *string; 278 279 string = Tcl_GetStringFromObj(objv[last], &numBytes); 280 281 Rappture::Buffer buf(string, numBytes); 282 279 283 Rappture::Outcome status; 280 284 if (!Rappture::encoding::decode(status, buf, switches.flags)) { … … 282 286 return TCL_ERROR; 283 287 } 284 Tcl_SetByteArrayObj(Tcl_GetObjResult(interp), 285 (const unsigned char*)buf.bytes(), buf.size()); 286 return TCL_OK; 287 } 288 Tcl_SetStringObj(Tcl_GetObjResult(interp), buf.bytes(), buf.size()); 289 return TCL_OK; 290 } 291 292 static int 293 DebugCmd(ClientData clientData, Tcl_Interp *interp, int objc, 294 Tcl_Obj *const *objv) 295 { 296 if (objc < 1) { 297 Tcl_AppendResult(interp, "wrong # args: should be \"", 298 Tcl_GetString(objv[0]), " string\"", (char*)NULL); 299 return TCL_ERROR; 300 } 301 int numBytes; 302 const char* string; 303 int i; 304 string = Tcl_GetStringFromObj(objv[objc-1], &numBytes); 305 fprintf(stderr, "string=%s, bytes=", string); 306 for (i = 0; i < numBytes; i++) { 307 fprintf(stderr, "%02x ", string[i]); 308 } 309 fprintf(stderr, "\n"); 310 return TCL_OK; 311 }
Note: See TracChangeset
for help on using the changeset viewer.