Changeset fe54d8d in tol for toltcl


Ignore:
Timestamp:
Mar 28, 2011, 3:21:43 PM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
dd6e916
Parents:
7b25567
Message:

refs #740, implement

tol::info anything $objRef

it is invoked when and Anything object is inserted in the inspector.

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3370 be4846ae-f051-483a-831f-b64e7d08527f

Location:
toltcl/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • toltcl/generic/tolaccess.cpp

    r7b25567 rfe54d8d  
    24372437  }
    24382438  BText addr = syn->GetAddressFromObject( );
    2439   Tcl_AppendStringsToObj( obj_result, addr.Buffer( ), NULL );
     2439  Tcl_SetStringObj( obj_result, addr.Buffer( ), -1 );
     2440  return TCL_OK;
     2441}
     2442                           
     2443/*
     2444 * Fill in obj_result the specific type for an Anything object, could
     2445 * be: Struct, Class or Anything.
     2446 */
     2447int Tol_GetAnythingType( Tcl_Interp * interp,
     2448                         Tcl_Obj * obj_ref,
     2449                         Tcl_Obj * obj_result)
     2450{
     2451  const BSyntaxObject *syn ;
     2452
     2453#ifndef _NDEBUG
     2454  //#define _PRINT_ANYTHING_OBJREF_
     2455#endif
     2456
     2457#ifdef _PRINT_ANYTHING_OBJREF_
     2458  printf( "obj_ref = %s\n", Tcl_GetString( obj_ref ) );
     2459#endif
     2460
     2461  if ( !( syn = Tol_ResolveObject( interp, obj_ref, obj_result ) ) ) {
     2462    return TCL_ERROR;
     2463  }
     2464 
     2465  if ( syn->Mode() == BCLASSMODE ) {
     2466    Tcl_SetStringObj( obj_result, "Class", -1 );
     2467  } else if ( syn->Mode() == BSTRUCTMODE ) {
     2468    Tcl_SetStringObj( obj_result, "Struct", -1 );
     2469  } else {
     2470    Tcl_SetStringObj( obj_result, "Anything", -1 );
     2471  }
    24402472  return TCL_OK;
    24412473}
  • toltcl/generic/toltcl.c

    r7b25567 rfe54d8d  
    964964                                              objv[2], obj_result );
    965965      }
     966    } else if (!strncasecmp("anything", arg, length)) {
     967      if (objc != 3) {
     968        Tcl_AppendStringsToObj(obj_result,
     969                               "wrong # args: should be '",
     970                               Tcl_GetString(objv[0]),
     971                               " anything {grammar|container objname ?indexes?}'",
     972                               NULL);
     973        tcl_result = TCL_ERROR;
     974      } else {
     975        tcl_result = Tol_GetAnythingType( interp,
     976                                          objv[2], obj_result );
     977      }
    966978    } else if (!strncasecmp("included", arg, length)) {
    967979      if (objc == 2)
  • toltcl/generic/toltclInt.h

    r7b25567 rfe54d8d  
    124124                                                 Tcl_Obj * obj_ref,
    125125                                                 Tcl_Obj * obj_result));
     126/*
     127 * Fill in obj_result the specific type for an Anything object, could
     128 * be: Struct, Class or Anything.
     129 */
     130extern int Tol_GetAnythingType _ANSI_ARGS_( (Tcl_Interp * interp,
     131                                             Tcl_Obj * obj_ref,
     132                                             Tcl_Obj * obj_result));
     133
    126134/*! Return the path of a set if it is a file, trigger an error in other case
    127135 */
Note: See TracChangeset for help on using the changeset viewer.