diff options
author | andreas_kupries <akupries@shaw.ca> | 2005-08-24 17:56:23 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2005-08-24 17:56:23 (GMT) |
commit | b32c5538015a9a182a54be4f711d0e01feb0a47c (patch) | |
tree | 20a737ae03097f905f0e9230c85c04123e5b5894 /generic/tclInt.h | |
parent | d1b987be17d4f05e79530f9f0896284fbe354205 (diff) | |
download | tcl-b32c5538015a9a182a54be4f711d0e01feb0a47c.zip tcl-b32c5538015a9a182a54be4f711d0e01feb0a47c.tar.gz tcl-b32c5538015a9a182a54be4f711d0e01feb0a47c.tar.bz2 |
TIP#219 IMPLEMENTATION
* doc/SetChanErr.3: ** New File **. Documentation of the new
channel API functions.
* generic/tcl.decls: Stub declarations of the new channel API.
* generic/tclDecls.h: Regenerated
* generic/tclStubInit.c:
* tclIORChan.c: ** New File **. Implementation of the reflected
channel.
* generic/tclInt.h: Integration of reflected channel and new error
* generic/tclIO.c: propagation into the generic I/O core.
* generic/tclIOCmd.c:
* generic/tclIO.h:
* library/init.tcl:
* tests/io.test: Extended testsuite.
* tests/ioCmd.test:
* tests/chan.test:
* generic/tclTest.c:
* generic/tclThreadTest.c:
* unix/Makefile.in: Integration into the build machinery.
* win/Makefile.in:
* win/Makefile.vc:
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 8ba85b6..1da1a43 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.245 2005/08/11 22:06:47 kennykb Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.246 2005/08/24 17:56:23 andreas_kupries Exp $ */ #ifndef _TCLINT @@ -1515,6 +1515,15 @@ typedef struct Interp { * inserted by an ensemble. */ } ensembleRewrite; + /* TIP #219 ... Global info for the I/O system ... + * Error message set by channel drivers, for the propagation of + * arbitrary Tcl errors. This information, if present (chanMsg not + * NULL), takes precedence over a posix error code returned by a + * channel operation. + */ + + Tcl_Obj* chanMsg; + /* * Statistical information about the bytecode compiler and interpreter's * operation. @@ -1527,6 +1536,42 @@ typedef struct Interp { } Interp; /* + * General list of interpreters. Doubly linked for easier + * removal of items deep in the list. + */ + +typedef struct InterpList { + Interp* interpPtr; + struct InterpList* prevPtr; + struct InterpList* nextPtr; +} InterpList; + +/* + * Macros for splicing into and out of doubly linked lists. + * They assume existence of struct items 'prevPtr' and 'nextPtr'. + * + * a = element to add or remove. + * b = list head. + * + * TclSpliceIn adds to the head of the list. + */ + +#define TclSpliceIn(a,b) \ + (a)->nextPtr = (b); \ + if ((b) != NULL) \ + (b)->prevPtr = (a); \ + (a)->prevPtr = NULL, (b) = (a); + +#define TclSpliceOut(a,b) \ + if ((a)->prevPtr != NULL) \ + (a)->prevPtr->nextPtr = (a)->nextPtr; \ + else \ + (b) = (a)->nextPtr; \ + if ((a)->nextPtr != NULL) \ + (a)->nextPtr->prevPtr = (a)->prevPtr; + + +/* * EvalFlag bits for Interp structures: * * TCL_ALLOW_EXCEPTIONS 1 means it's OK for the script to terminate with @@ -1941,6 +1986,12 @@ MODULE_SCOPE int TclArraySet _ANSI_ARGS_((Tcl_Interp *interp, MODULE_SCOPE double TclBignumToDouble _ANSI_ARGS_((mp_int* bignum)); MODULE_SCOPE int TclCheckBadOctal _ANSI_ARGS_((Tcl_Interp *interp, CONST char *value)); +MODULE_SCOPE int TclChanCreateObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); +MODULE_SCOPE int TclChanPostEventObjCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); +MODULE_SCOPE int TclChanCaughtErrorBypass _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Channel chan)); MODULE_SCOPE void TclCleanupLiteralTable _ANSI_ARGS_(( Tcl_Interp* interp, LiteralTable* tablePtr)); MODULE_SCOPE int TclDoubleDigits _ANSI_ARGS_((char* buf, |