01: /*
02: * StrtoulResult.java
03: *
04: * Stores the result of the Util.strtoul() method.
05: *
06: * Copyright (c) 1997 Cornell University.
07: * Copyright (c) 1997 Sun Microsystems, Inc.
08: *
09: * See the file "license.terms" for information on usage and
10: * redistribution of this file, and for a DISCLAIMER OF ALL
11: * WARRANTIES.
12: *
13: * RCS: @(#) $Id: StrtoulResult.java,v 1.3 2005/09/30 02:12:17 mdejong Exp $
14: *
15: */
16:
17: package tcl.lang;
18:
19: /**
20: * This class stores the result of the Util.strtoul() method.
21: */
22:
23: class StrtoulResult {
24:
25: // If the conversion is successful, errno = 0;
26: //
27: // If the number cannot be converted to a valid unsigned 32-bit integer,
28: // contains the error code (TCL.INTEGER_RANGE or TCL.INVALID_INTEGER).
29:
30: int errno = 0;
31:
32: // If errno is 0, points to the character right after the number
33:
34: int index = -1;
35:
36: // If errno is 0, contains the value of the number.
37:
38: long value = 0;
39:
40: // Update a StrtoulResult. Note that there is typically
41: // just one StrtoulResult for each interp.
42:
43: void update(long v, // value for the value field.
44: int i, // value for the index field.
45: int e) // value for the errno field.
46: {
47: value = v;
48: index = i;
49: errno = e;
50: }
51:
52: } // end StrtoulResult
|