Changeset 2936 for branches/blt4/lang


Ignore:
Timestamp:
Apr 3, 2012, 3:51:13 PM (13 years ago)
Author:
gah
Message:

sync back with trunk

Location:
branches/blt4/lang
Files:
3 added
3 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/lang/R/Rappture/NAMESPACE

    r2737 r2936  
    1212        rp_lib_result,
    1313        rp_units_convert_double,
    14         rp_units_convert_string )
     14        rp_units_convert_string,
     15        rp_utils_progress )
    1516 
  • branches/blt4/lang/R/Rappture/R/Rappture.R

    r2737 r2936  
    4949}
    5050
     51rp_utils_progress <- function(percent,message) {
     52    .Call("RPRUtilsProgress",percent,message)
     53}
     54
    5155.onLoad <- function(lib,pkg) {
    5256}
  • branches/blt4/lang/R/Rappture/configure

    r2737 r2936  
    240240  else
    241241    $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. Then
    244 $0: install a modern shell, or manually run the script
    245 $0: under such a shell 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."
    246246  fi
    247247  exit 1
     
    15181518    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
    15191519$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
    1520 ( $as_echo "## ----------------------------------------- ##
     1520( $as_echo "## ----------------------------------- ##
    15211521## Report this to rappture@nanohub.org ##
    1522 ## ----------------------------------------- ##"
     1522## ----------------------------------- ##"
    15231523     ) | sed "s/^/$as_me: WARNING:     /" >&2
    15241524    ;;
     
    34173417
    34183418
    3419 for ac_header in RpLibrary.h RpUnits.h
     3419for ac_header in RpLibrary.h RpUnits.h RpUtils.h
    34203420do :
    34213421  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    34313431
    34323432if 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
    34353436fi
    34363437
     
    35493550else
    35503551  as_fn_error $? "\"no librappture with RpUnits found\"" "$LINENO" 5
     3552fi
     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; }
     3556if ${ac_cv_search_rpUtilsProgress+:} false; then :
     3557  $as_echo_n "(cached) " >&6
     3558else
     3559  ac_func_search_save_LIBS=$LIBS
     3560cat 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
     3567extern "C"
     3568#endif
     3569char rpUtilsProgress ();
     3570int
     3571main ()
     3572{
     3573return rpUtilsProgress ();
     3574  ;
     3575  return 0;
     3576}
     3577_ACEOF
     3578for 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
     3587fi
     3588rm -f core conftest.err conftest.$ac_objext \
     3589    conftest$ac_exeext
     3590  if ${ac_cv_search_rpUtilsProgress+:} false; then :
     3591  break
     3592fi
     3593done
     3594if ${ac_cv_search_rpUtilsProgress+:} false; then :
     3595
     3596else
     3597  ac_cv_search_rpUtilsProgress=no
     3598fi
     3599rm conftest.$ac_ext
     3600LIBS=$ac_func_search_save_LIBS
     3601fi
     3602{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_rpUtilsProgress" >&5
     3603$as_echo "$ac_cv_search_rpUtilsProgress" >&6; }
     3604ac_res=$ac_cv_search_rpUtilsProgress
     3605if test "$ac_res" != no; then :
     3606  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
     3607
     3608else
     3609  as_fn_error $? "\"no librappture with RpUtils found\"" "$LINENO" 5
    35513610fi
    35523611
  • branches/blt4/lang/R/Rappture/src/RpLibraryRInterface.cc

    r2737 r2936  
    464464
    465465
    466     INTEGER(ans)[0] = 1;
     466    INTEGER(ans)[0] = 0;
    467467
    468468    UNPROTECT(1);
     
    554554                 appendVal);
    555555
    556     INTEGER(ans)[0] = 1;
     556    INTEGER(ans)[0] = 0;
    557557
    558558    UNPROTECT(1);
     
    642642             appendVal);
    643643
    644     INTEGER(ans)[0] = 1;
     644    INTEGER(ans)[0] = 0;
    645645
    646646    UNPROTECT(1);
     
    739739                 appendVal);
    740740
    741     INTEGER(ans)[0] = 1;
     741    INTEGER(ans)[0] = 0;
    742742
    743743    UNPROTECT(1);
  • branches/blt4/lang/R/Rappture/src/RpRBindings.c

    r2737 r2936  
    1414#include "RpLibraryRInterface.h"
    1515#include "RpUnitsRInterface.h"
     16#include "RpUtilsRInterface.h"
    1617
    1718#include <R_ext/Rdynload.h>
     
    3132    {"RPRUnitsConvertDouble", (DL_FUNC) &RPRUnitsConvertDouble, 2},
    3233    {"RPRUnitsConvertString", (DL_FUNC) &RPRUnitsConvertString, 3},
     34    {"RPRUtilsProgress", (DL_FUNC) &RPRUtilsProgress, 2},
    3335    {NULL, NULL, 0}
    3436};
  • branches/blt4/lang/python/Rappture/tools.py

    r845 r2936  
    77# ======================================================================
    88
    9 import sys, os, re, popen2, select
     9import sys, os, re, subprocess, select
    1010
    1111# getCommandOutput function written by Steve Clark
     
    1515    global commandPid
    1616
    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)
    1822    commandPid = child.pid
    19     child.tochild.close() # don't need to talk to child
    20     childout = child.fromchild
     23    childout   = child.stdout
    2124    childoutFd = childout.fileno()
    22     childerr = child.childerr
     25    childerr   = child.stderr
    2326    childerrFd = childerr.fileno()
    2427
    2528    outEOF = errEOF = 0
    26     BUFSIZ = 4096
    2729
    2830    outData = []
  • branches/blt4/lang/tcl/scripts/library.tcl

    r2201 r2936  
    2020# load the object system along with the XML library code
    2121Rappture::objects::init
     22encoding system utf-8
    2223
    2324# ----------------------------------------------------------------------
     
    509510        return ""
    510511    }
     512    set string [$node text]
    511513    # Expat (via tDOM) will always produce utf-8 output, regardless of the
    512514    # encoding of the tool.xml.  We need to convert utf-8 to unicode for
    513515    # 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
    515520    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"
    518524    return [string trim $string]
    519525}
  • branches/blt4/lang/tcl/src/Makefile.in

    r2742 r2936  
    7777endif
    7878
    79 ifeq ($(HAVE_FFMPEG),yes)
    80     OBJS += RpVideoTclInterface.o
    81     LIBS += -L../../../src/objects -lRpObjects
    82 endif
    83 
    84 
    8579# Not using     RpLibraryTclInterface.o \
    8680
  • branches/blt4/lang/tcl/src/Rappture_Init.c

    r2676 r2936  
    3838extern Tcl_AppInitProc RpUtils_Init;
    3939
    40 #ifdef BUILD_with_ffmpeg
    41 extern Tcl_AppInitProc RpVideo_Init;
    42 #endif
    43 
    4440#ifdef BUILD_Rappture
    4541__declspec( dllexport )
     
    7167        return TCL_ERROR;
    7268    }
    73 #ifdef BUILD_with_ffmpeg
    74     if (RpVideo_Init(interp) != TCL_OK) {
    75         return TCL_ERROR;
    76     }
    77 #endif
    7869    if (RpRlimit_Init(interp) != TCL_OK) {
    7970        return TCL_ERROR;
  • branches/blt4/lang/tcl/src/RpEncodeTclInterface.cc

    r2046 r2936  
    2222static Tcl_ObjCmdProc EncodeCmd;
    2323static Tcl_ObjCmdProc DecodeCmd;
     24static Tcl_ObjCmdProc DebugCmd;
    2425
    2526/**********************************************************************/
     
    4546    Tcl_CreateObjCommand(interp, "::Rappture::encoding::decode",
    4647        DecodeCmd, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
     48
     49    Tcl_CreateObjCommand(interp, "::Rappture::encoding::debug",
     50        DebugCmd, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
    4751    return TCL_OK;
    4852}
     
    258262    int n;
    259263    n = Rp_ParseSwitches(interp, decodeSwitches, objc - 1, objv + 1, &switches,
    260                          SWITCH_OBJV_PARTIAL);
     264        SWITCH_OBJV_PARTIAL);
    261265    if (n < 0) {
    262266        return TCL_ERROR;
     
    270274        return TCL_ERROR;
    271275    }
    272     int nBytes;
    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
    279283    Rappture::Outcome status;
    280284    if (!Rappture::encoding::decode(status, buf, switches.flags)) {
     
    282286        return TCL_ERROR;
    283287    }
    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
     292static int
     293DebugCmd(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.