- Timestamp:
- Jul 2, 2010, 11:54:32 AM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 9797b96
- Parents:
- 2f5c27ce
- Location:
- toltcl/generic
- Files:
-
- 3 edited
-
tolaccess.cpp (modified) (3 diffs)
-
toltcl.c (modified) (3 diffs)
-
toltclInt.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
toltcl/generic/tolaccess.cpp
r2f5c27ce rd3d6a42 1933 1933 return TCL_OK; 1934 1934 } 1935 1935 1936 /* 1936 1937 * … … 1938 1939 * 1939 1940 */ 1940 1941 1941 int Tol_SetGrammarsObj(Tcl_Interp * interp, Tcl_Obj * obj_result ) 1942 1942 { … … 1980 1980 "\" isn't a grammar", NULL ); 1981 1981 return TCL_ERROR; 1982 } 1983 1984 /* 1985 * 1986 * Fill in obj_result the list of packages defined in TOL 1987 * 1988 */ 1989 int 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 */ 2004 int 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; 1982 2013 } 1983 2014 -
toltcl/generic/toltcl.c
r2f5c27ce rd3d6a42 100 100 101 101 static int Tol_InfoGrammars _ANSI_ARGS_((Tcl_Interp *interp, 102 int objc, Tcl_Obj *CONST objv[], 103 Tcl_Obj * obj_result)); 104 105 static int Tol_InfoPackages _ANSI_ARGS_((Tcl_Interp *interp, 102 106 int objc, Tcl_Obj *CONST objv[], 103 107 Tcl_Obj * obj_result)); … … 974 978 else if (!strncasecmp("grammars", arg, length)) 975 979 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); 976 982 else if (!strncasecmp("variables", arg, length)) 977 983 tcl_result = Tol_InfoVariables(interp, objc-1, objv+1, obj_result); … … 1141 1147 return objc == 1 ? Tol_SetGrammarsObj(interp, obj_result) : 1142 1148 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 1169 static int 1170 Tol_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); 1143 1185 } 1144 1186 -
toltcl/generic/toltclInt.h
r2f5c27ce rd3d6a42 200 200 Tcl_Obj * obj_result)); 201 201 202 /*! Fill in obj_result the list of packages defined in TOL 203 */ 204 extern int Tol_SetPackagesObj _ANSI_ARGS_((Tcl_Interp * interp, 205 Tcl_Obj * obj_result)); 206 202 207 /*! Fill in obj_result the description of gra_name. 203 208 */ 204 209 int Tol_SetGrammarDescObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * gra_name, 205 210 Tcl_Obj * obj_result)); 211 212 /*! Fill in obj_result the description of pkgName. 213 */ 214 int Tol_SetPackageDescObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj *pkgName, 215 Tcl_Obj * obj_result)); 206 216 207 217 /*! Fill in obj_result the functions defined for grammar gra_name.
Note: See TracChangeset
for help on using the changeset viewer.
