01: /*
02: * FblockedCmd.java --
03: *
04: * Copyright (c) 1997 Sun Microsystems, Inc.
05: *
06: * See the file "license.terms" for information on usage and
07: * redistribution of this file, and for a DISCLAIMER OF ALL
08: * WARRANTIES.
09: *
10: * RCS: @(#) $Id: FblockedCmd.java,v 1.5 2003/03/08 03:42:43 mdejong Exp $
11: *
12: */
13:
14: package tcl.lang;
15:
16: import java.util.*;
17:
18: /**
19: * This class implements the built-in "fblocked" command in Tcl.
20: */
21:
22: class FblockedCmd implements Command {
23: /**
24: * This procedure is invoked to process the "fblocked" Tcl command.
25: * See the user documentation for details on what it does.
26: *
27: * @param interp the current interpreter.
28: * @param argv command arguments.
29: */
30:
31: public void cmdProc(Interp interp, TclObject argv[])
32: throws TclException {
33:
34: Channel chan; // The channel being operated on this method
35:
36: if (argv.length != 2) {
37: throw new TclNumArgsException(interp, 1, argv, "channelId");
38: }
39:
40: chan = TclIO.getChannel(interp, argv[1].toString());
41: if (chan == null) {
42: throw new TclException(interp,
43: "can not find channel named \""
44: + argv[1].toString() + "\"");
45: }
46:
47: interp.setResult(chan.isBlocked(interp));
48: }
49: }
|