Changeset d3d6a42 in tol


Ignore:
Timestamp:
Jul 2, 2010, 11:54:32 AM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
9797b96
Parents:
2f5c27ce
Message:

refs #931: implementing required functions within toltcl:

  • tol::info packages
  • tol::info packages GuiTools

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

Location:
toltcl/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • toltcl/generic/tolaccess.cpp

    r2f5c27ce rd3d6a42  
    19331933  return TCL_OK;
    19341934}
     1935
    19351936/*
    19361937 *
    … …  
    19381939 *
    19391940 */
    1940 
    19411941int Tol_SetGrammarsObj(Tcl_Interp * interp, Tcl_Obj * obj_result )
    19421942{
    … …  
    19801980                          "\" isn't a grammar", NULL );
    19811981  return TCL_ERROR;
     1982}
     1983
     1984/*
     1985 *
     1986 * Fill in obj_result the list of packages defined in TOL
     1987 *
     1988 */
     1989int Tol_SetPackagesObj(Tcl_Interp * interp, Tcl_Obj * obj_result )
     1990{
     1991
     1992  BList* lstGra = BPackage::Required();
     1993
     1994  BList2TclList( interp, lstGra, obj_result, &GetName );
     1995  Tcl_AppendObjToObj( obj_result, Tcl_GetObjResult( interp ) );
     1996  return TCL_OK;
     1997}
     1998
     1999/*
     2000 *
     2001 * Fill in obj_result the description of package.
     2002 *
     2003 */
     2004int Tol_SetPackageDescObj( Tcl_Interp *interp, Tcl_Obj *pkgName,
     2005                           Tcl_Obj *obj_result )
     2006{
     2007  int status;
     2008  Tcl_Obj *graName = Tcl_NewStringObj( "NameBlock", -1 );
     2009 
     2010  status = Tol_SetVariableInfoObj( graName, pkgName, obj_result );
     2011  Tcl_DecrRefCount( graName );
     2012  return status;
    19822013}
    19832014
  • toltcl/generic/toltcl.c

    r2f5c27ce rd3d6a42  
    100100
    101101static int Tol_InfoGrammars _ANSI_ARGS_((Tcl_Interp *interp,
     102                                         int objc, Tcl_Obj *CONST objv[],
     103                                         Tcl_Obj * obj_result));
     104
     105static int Tol_InfoPackages _ANSI_ARGS_((Tcl_Interp *interp,
    102106                                         int objc, Tcl_Obj *CONST objv[],
    103107                                         Tcl_Obj * obj_result));
    … …  
    974978    else if (!strncasecmp("grammars", arg, length))
    975979      tcl_result = Tol_InfoGrammars(interp, objc-1, objv+1, obj_result);
     980    else if (!strncasecmp("packages", arg, length))
     981      tcl_result = Tol_InfoPackages(interp, objc-1, objv+1, obj_result);
    976982    else if (!strncasecmp("variables", arg, length))
    977983      tcl_result = Tol_InfoVariables(interp, objc-1, objv+1, obj_result);
    … …  
    11411147  return  objc == 1 ? Tol_SetGrammarsObj(interp, obj_result) :
    11421148    Tol_SetGrammarDescObj(interp, objv[1], obj_result);
     1149}
     1150
     1151
     1152
     1153/*
     1154 *----------------------------------------------------------------------
     1155 *
     1156 * Tol_InfoGrammars --
     1157 *
     1158 *        Implements the subcommand "::tol::info grammars ?grammar?".
     1159 *
     1160 * Results:
     1161 *       A standard Tcl result
     1162 *
     1163 * Side effects:
     1164 *       None.
     1165 *
     1166 *----------------------------------------------------------------------
     1167 */
     1168
     1169static int
     1170Tol_InfoPackages(interp, objc, objv, obj_result)
     1171     Tcl_Interp *interp;       /* Current interpreter */
     1172     int objc;                 /* Number of arguments */
     1173     Tcl_Obj *CONST objv[];    /* Argument objects */
     1174     Tcl_Obj * obj_result;
     1175{
     1176  if ( objc > 2 ) {
     1177    Tcl_AppendStringsToObj(obj_result,
     1178                           "wrong # args: should be '",
     1179                           Tcl_GetString(objv[0]), " packages ?pkgName?'",
     1180                           NULL);
     1181    return TCL_ERROR;
     1182  }
     1183  return  objc == 1 ? Tol_SetPackagesObj(interp, obj_result) :
     1184    Tol_SetPackageDescObj(interp, objv[1], obj_result);
    11431185}
    11441186
  • toltcl/generic/toltclInt.h

    r2f5c27ce rd3d6a42  
    200200                                           Tcl_Obj * obj_result));
    201201
     202/*! Fill in obj_result the list of packages defined in TOL
     203 */
     204extern int Tol_SetPackagesObj _ANSI_ARGS_((Tcl_Interp * interp,
     205                                           Tcl_Obj * obj_result));
     206
    202207/*! Fill in obj_result the description of gra_name.
    203208 */
    204209int Tol_SetGrammarDescObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * gra_name,
    205210                                        Tcl_Obj * obj_result));
     211
     212/*! Fill in obj_result the description of pkgName.
     213 */
     214int Tol_SetPackageDescObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj *pkgName,
     215                                       Tcl_Obj * obj_result));
    206216
    207217/*! Fill in obj_result the functions defined for grammar gra_name.
Note: See TracChangeset for help on using the changeset viewer.