Tcl Source Code

Hex Artifact Content
Login

Artifact dd3da82dacb80d70ff4383741b9479b284f8d7b7ee88766aa45c4f9ff01cfffb:

Attachment "refchan-core-8-branch.diff" to ticket [4b4830eb54] added by chw 2021-03-15 09:45:46. (unpublished)
0000: 49 6e 64 65 78 3a 20 64 6f 63 2f 72 65 66 63 68  Index: doc/refch
0010: 61 6e 2e 6e 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  an.n.===========
0020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0050: 3d 3d 3d 3d 3d 3d 3d 0a 2d 2d 2d 20 64 6f 63 2f  =======.--- doc/
0060: 72 65 66 63 68 61 6e 2e 6e 0a 2b 2b 2b 20 64 6f  refchan.n.+++ do
0070: 63 2f 72 65 66 63 68 61 6e 2e 6e 0a 40 40 20 2d  c/refchan.n.@@ -
0080: 33 32 30 2c 31 30 20 2b 33 32 30 2c 32 33 20 40  320,10 +320,23 @
0090: 40 0a 20 49 66 20 74 68 65 20 73 75 62 63 6f 6d  @. If the subcom
00a0: 6d 61 6e 64 20 74 68 72 6f 77 73 20 61 6e 20 65  mand throws an e
00b0: 72 72 6f 72 20 74 68 65 20 63 6f 6d 6d 61 6e 64  rror the command
00c0: 20 77 68 69 63 68 20 63 61 75 73 65 64 20 69 74   which caused it
00d0: 73 0a 20 69 6e 76 6f 63 61 74 69 6f 6e 20 28 75  s. invocation (u
00e0: 73 75 61 6c 6c 79 20 5c 66 42 66 63 6f 6e 66 69  sually \fBfconfi
00f0: 67 75 72 65 5c 66 52 20 6f 72 20 5c 66 42 63 68  gure\fR or \fBch
0100: 61 6e 20 63 6f 6e 66 69 67 75 72 65 5c 66 52 29  an configure\fR)
0110: 20 77 69 6c 6c 20 61 70 70 65 61 72 20 74 6f 0a   will appear to.
0120: 20 68 61 76 65 20 74 68 72 6f 77 6e 20 74 68 69   have thrown thi
0130: 73 20 65 72 72 6f 72 2e 20 41 6e 79 20 65 78 63  s error. Any exc
0140: 65 70 74 69 6f 6e 20 62 65 79 6f 6e 64 20 5c 66  eption beyond \f
0150: 42 65 72 72 6f 72 5c 66 52 20 28 65 2e 67 2e 2c  Berror\fR (e.g.,
0160: 5c 20 5c 66 42 62 72 65 61 6b 5c 66 52 2c 0a 20  \ \fBbreak\fR,. 
0170: 65 74 63 2e 29 20 69 73 20 74 72 65 61 74 65 64  etc.) is treated
0180: 20 61 73 20 61 6e 64 20 63 6f 6e 76 65 72 74 65   as and converte
0190: 64 20 74 6f 20 61 6e 20 65 72 72 6f 72 2e 0a 20  d to an error.. 
01a0: 2e 52 45 0a 2b 2e 54 50 0a 2b 5c 66 49 63 6d 64  .RE.+.TP.+\fIcmd
01b0: 50 72 65 66 69 78 20 5c 66 42 74 72 75 6e 63 61  Prefix \fBtrunca
01c0: 74 65 5c 66 52 20 5c 66 49 63 68 61 6e 6e 65 6c  te\fR \fIchannel
01d0: 49 64 20 6c 65 6e 67 74 68 5c 66 52 0a 2b 2e 0a  Id length\fR.+..
01e0: 2b 54 68 69 73 20 5c 66 49 6f 70 74 69 6f 6e 61  +This \fIoptiona
01f0: 6c 5c 66 52 20 73 75 62 63 6f 6d 6d 61 6e 64 20  l\fR subcommand 
0200: 68 61 6e 64 6c 65 73 20 63 68 61 6e 67 69 6e 67  handles changing
0210: 20 74 68 65 20 6c 65 6e 67 74 68 20 6f 66 20 74   the length of t
0220: 68 65 0a 2b 75 6e 64 65 72 6c 79 69 6e 67 20 64  he.+underlying d
0230: 61 74 61 20 73 74 72 65 61 6d 20 66 6f 72 20 74  ata stream for t
0240: 68 65 20 63 68 61 6e 6e 65 6c 20 5c 66 49 63 68  he channel \fIch
0250: 61 6e 6e 65 6c 49 64 5c 66 52 2e 20 49 74 73 20  annelId\fR. Its 
0260: 6c 65 6e 67 74 68 0a 2b 67 65 74 73 20 73 65 74  length.+gets set
0270: 20 74 6f 20 5c 66 49 6c 65 6e 67 74 68 5c 66 52   to \fIlength\fR
0280: 2e 0a 2b 2e 52 53 0a 2b 2e 50 50 0a 2b 49 66 20  ..+.RS.+.PP.+If 
0290: 74 68 65 20 73 75 62 63 6f 6d 6d 61 6e 64 20 74  the subcommand t
02a0: 68 72 6f 77 73 20 61 6e 20 65 72 72 6f 72 20 74  hrows an error t
02b0: 68 65 20 63 6f 6d 6d 61 6e 64 20 77 68 69 63 68  he command which
02c0: 20 63 61 75 73 65 64 20 69 74 73 0a 2b 69 6e 76   caused its.+inv
02d0: 6f 63 61 74 69 6f 6e 20 28 75 73 75 61 6c 6c 79  ocation (usually
02e0: 20 5c 66 42 63 68 61 6e 20 74 72 75 6e 63 61 74   \fBchan truncat
02f0: 65 5c 66 52 29 20 77 69 6c 6c 20 61 70 70 65 61  e\fR) will appea
0300: 72 20 74 6f 20 68 61 76 65 20 74 68 72 6f 77 6e  r to have thrown
0310: 0a 2b 74 68 69 73 20 65 72 72 6f 72 2e 20 41 6e  .+this error. An
0320: 79 20 65 78 63 65 70 74 69 6f 6e 20 62 65 79 6f  y exception beyo
0330: 6e 64 20 5c 66 42 65 72 72 6f 72 5c 66 52 20 28  nd \fBerror\fR (
0340: 65 2e 67 2e 2c 5c 20 5c 66 42 62 72 65 61 6b 5c  e.g.,\ \fBbreak\
0350: 66 52 2c 0a 2b 65 74 63 2e 29 20 69 73 20 74 72  fR,.+etc.) is tr
0360: 65 61 74 65 64 20 61 73 20 61 6e 64 20 63 6f 6e  eated as and con
0370: 76 65 72 74 65 64 20 74 6f 20 61 6e 20 65 72 72  verted to an err
0380: 6f 72 2e 0a 2b 2e 52 45 0a 20 2e 53 48 20 4e 4f  or..+.RE. .SH NO
0390: 54 45 53 0a 20 53 6f 6d 65 20 6f 66 20 74 68 65  TES. Some of the
03a0: 20 66 75 6e 63 74 69 6f 6e 73 20 73 75 70 70 6f   functions suppo
03b0: 72 74 65 64 20 69 6e 20 63 68 61 6e 6e 65 6c 73  rted in channels
03c0: 20 64 65 66 69 6e 65 64 20 69 6e 20 54 63 6c 27   defined in Tcl'
03d0: 73 20 43 0a 20 69 6e 74 65 72 66 61 63 65 20 61  s C. interface a
03e0: 72 65 20 6e 6f 74 20 61 76 61 69 6c 61 62 6c 65  re not available
03f0: 20 74 6f 20 63 68 61 6e 6e 65 6c 73 20 72 65 66   to channels ref
0400: 6c 65 63 74 65 64 20 74 6f 20 74 68 65 20 54 63  lected to the Tc
0410: 6c 20 6c 65 76 65 6c 2e 0a 20 2e 50 50 0a 20 54  l level.. .PP. T
0420: 68 65 20 66 75 6e 63 74 69 6f 6e 20 5c 66 42 54  he function \fBT
0430: 63 6c 5f 44 72 69 76 65 72 47 65 74 48 61 6e 64  cl_DriverGetHand
0440: 6c 65 50 72 6f 63 5c 66 52 20 69 73 20 6e 6f 74  leProc\fR is not
0450: 20 73 75 70 70 6f 72 74 65 64 3b 0a 0a 49 6e 64   supported;..Ind
0460: 65 78 3a 20 67 65 6e 65 72 69 63 2f 74 63 6c 49  ex: generic/tclI
0470: 4f 52 43 68 61 6e 2e 63 0a 3d 3d 3d 3d 3d 3d 3d  ORChan.c.=======
0480: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0490: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
04a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
04b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 2d 2d 2d 20  ===========.--- 
04c0: 67 65 6e 65 72 69 63 2f 74 63 6c 49 4f 52 43 68  generic/tclIORCh
04d0: 61 6e 2e 63 0a 2b 2b 2b 20 67 65 6e 65 72 69 63  an.c.+++ generic
04e0: 2f 74 63 6c 49 4f 52 43 68 61 6e 2e 63 0a 40 40  /tclIORChan.c.@@
04f0: 20 2d 35 34 2c 31 36 20 2b 35 34 2c 31 38 20 40   -54,16 +54,18 @
0500: 40 0a 20 09 09 09 20 20 20 20 54 63 6c 5f 49 6e  @. ...    Tcl_In
0510: 74 65 72 70 20 2a 69 6e 74 65 72 70 2c 20 63 6f  terp *interp, co
0520: 6e 73 74 20 63 68 61 72 20 2a 6f 70 74 69 6f 6e  nst char *option
0530: 4e 61 6d 65 2c 0a 20 09 09 09 20 20 20 20 54 63  Name,. ...    Tc
0540: 6c 5f 44 53 74 72 69 6e 67 20 2a 64 73 50 74 72  l_DString *dsPtr
0550: 29 3b 0a 20 73 74 61 74 69 63 20 69 6e 74 09 09  );. static int..
0560: 52 65 66 6c 65 63 74 53 65 74 4f 70 74 69 6f 6e  ReflectSetOption
0570: 28 43 6c 69 65 6e 74 44 61 74 61 20 63 6c 69 65  (ClientData clie
0580: 6e 74 44 61 74 61 2c 0a 20 09 09 09 20 20 20 20  ntData,. ...    
0590: 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65  Tcl_Interp *inte
05a0: 72 70 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a  rp, const char *
05b0: 6f 70 74 69 6f 6e 4e 61 6d 65 2c 0a 20 09 09 09  optionName,. ...
05c0: 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a      const char *
05d0: 6e 65 77 56 61 6c 75 65 29 3b 0a 2b 73 74 61 74  newValue);.+stat
05e0: 69 63 20 69 6e 74 09 09 52 65 66 6c 65 63 74 54  ic int..ReflectT
05f0: 72 75 6e 63 61 74 65 28 43 6c 69 65 6e 74 44 61  runcate(ClientDa
0600: 74 61 20 63 6c 69 65 6e 74 44 61 74 61 2c 0a 2b  ta clientData,.+
0610: 09 09 09 20 20 20 20 6c 6f 6e 67 20 6c 6f 6e 67  ...    long long
0620: 20 6c 65 6e 67 74 68 29 3b 0a 20 73 74 61 74 69   length);. stati
0630: 63 20 76 6f 69 64 20 20 20 20 20 54 69 6d 65 72  c void     Timer
0640: 52 75 6e 52 65 61 64 28 43 6c 69 65 6e 74 44 61  RunRead(ClientDa
0650: 74 61 20 63 6c 69 65 6e 74 44 61 74 61 29 3b 0a  ta clientData);.
0660: 20 73 74 61 74 69 63 20 76 6f 69 64 20 20 20 20   static void    
0670: 20 54 69 6d 65 72 52 75 6e 57 72 69 74 65 28 43   TimerRunWrite(C
0680: 6c 69 65 6e 74 44 61 74 61 20 63 6c 69 65 6e 74  lientData client
0690: 44 61 74 61 29 3b 0a 20 0a 20 2f 2a 0a 20 20 2a  Data);. . /*.  *
06a0: 20 54 68 65 20 43 20 6c 61 79 65 72 20 63 68 61   The C layer cha
06b0: 6e 6e 65 6c 20 74 79 70 65 2f 64 72 69 76 65 72  nnel type/driver
06c0: 20 64 65 66 69 6e 69 74 69 6f 6e 20 75 73 65 64   definition used
06d0: 20 62 79 20 74 68 65 20 72 65 66 6c 65 63 74 69   by the reflecti
06e0: 6f 6e 2e 20 54 68 69 73 20 69 73 0a 2d 20 2a 20  on. This is.- * 
06f0: 61 20 76 65 72 73 69 6f 6e 20 33 20 73 74 72 75  a version 3 stru
0700: 63 74 75 72 65 2e 0a 2b 20 2a 20 61 20 76 65 72  cture..+ * a ver
0710: 73 69 6f 6e 20 35 20 73 74 72 75 63 74 75 72 65  sion 5 structure
0720: 2e 0a 20 20 2a 2f 0a 20 0a 20 73 74 61 74 69 63  ..  */. . static
0730: 20 63 6f 6e 73 74 20 54 63 6c 5f 43 68 61 6e 6e   const Tcl_Chann
0740: 65 6c 54 79 70 65 20 74 63 6c 52 43 68 61 6e 6e  elType tclRChann
0750: 65 6c 54 79 70 65 20 3d 20 7b 0a 20 20 20 20 20  elType = {.     
0760: 22 74 63 6c 72 63 68 61 6e 6e 65 6c 22 2c 09 20  "tclrchannel",. 
0770: 20 20 2f 2a 20 54 79 70 65 20 6e 61 6d 65 2e 09    /* Type name..
0780: 09 09 09 20 20 2a 2f 0a 20 20 20 20 20 54 43 4c  ...  */.     TCL
0790: 5f 43 48 41 4e 4e 45 4c 5f 56 45 52 53 49 4f 4e  _CHANNEL_VERSION
07a0: 5f 35 2c 20 2f 2a 20 76 35 20 63 68 61 6e 6e 65  _5, /* v5 channe
07b0: 6c 20 2a 2f 0a 40 40 20 2d 38 37 2c 31 31 20 2b  l */.@@ -87,11 +
07c0: 38 39 2c 31 31 20 40 40 0a 20 23 69 66 20 54 43  89,11 @@. #if TC
07d0: 4c 5f 54 48 52 45 41 44 53 0a 20 20 20 20 20 52  L_THREADS.     R
07e0: 65 66 6c 65 63 74 54 68 72 65 61 64 2c 20 20 20  eflectThread,   
07f0: 20 20 20 20 20 20 2f 2a 20 74 68 72 65 61 64 20        /* thread 
0800: 61 63 74 69 6f 6e 2c 20 74 72 61 63 6b 69 6e 67  action, tracking
0810: 20 6f 77 6e 65 72 20 2a 2f 0a 20 23 65 6c 73 65   owner */. #else
0820: 0a 20 09 4e 55 4c 4c 2c 09 09 20 20 20 2f 2a 20  . .NULL,..   /* 
0830: 74 68 72 65 61 64 20 61 63 74 69 6f 6e 20 2a 2f  thread action */
0840: 0a 20 23 65 6e 64 69 66 0a 2d 20 20 20 20 4e 55  . #endif.-    NU
0850: 4c 4c 09 09 20 20 20 2f 2a 20 74 72 75 6e 63 61  LL..   /* trunca
0860: 74 65 20 2a 2f 0a 2b 20 20 20 20 52 65 66 6c 65  te */.+    Refle
0870: 63 74 54 72 75 6e 63 61 74 65 09 20 20 20 2f 2a  ctTruncate.   /*
0880: 20 54 72 75 6e 63 61 74 65 2e 09 09 09 09 4e 55   Truncate.....NU
0890: 4c 4c 27 61 62 6c 65 20 2a 2f 0a 20 7d 3b 0a 20  LL'able */. };. 
08a0: 0a 20 2f 2a 0a 20 20 2a 20 49 6e 73 74 61 6e 63  . /*.  * Instanc
08b0: 65 20 64 61 74 61 20 66 6f 72 20 61 20 72 65 66  e data for a ref
08c0: 6c 65 63 74 65 64 20 63 68 61 6e 6e 65 6c 2e 20  lected channel. 
08d0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
08e0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 20 20 2a 2f  ===========.  */
08f0: 0a 40 40 20 2d 31 38 35 2c 31 30 20 2b 31 38 37  .@@ -185,10 +187
0900: 2c 31 31 20 40 40 0a 20 20 20 20 20 22 63 6f 6e  ,11 @@.     "con
0910: 66 69 67 75 72 65 22 2c 09 2f 2a 20 4f 50 54 20  figure",./* OPT 
0920: 2a 2f 0a 20 20 20 20 20 22 66 69 6e 61 6c 69 7a  */.     "finaliz
0930: 65 22 2c 09 09 2f 2a 20 20 20 20 20 2a 2f 0a 20  e",../*     */. 
0940: 20 20 20 20 22 69 6e 69 74 69 61 6c 69 7a 65 22      "initialize"
0950: 2c 09 2f 2a 20 20 20 20 20 2a 2f 0a 20 20 20 20  ,./*     */.    
0960: 20 22 72 65 61 64 22 2c 09 09 2f 2a 20 4f 50 54   "read",../* OPT
0970: 20 2a 2f 0a 20 20 20 20 20 22 73 65 65 6b 22 2c   */.     "seek",
0980: 09 09 2f 2a 20 4f 50 54 20 2a 2f 0a 2b 20 20 20  ../* OPT */.+   
0990: 20 22 74 72 75 6e 63 61 74 65 22 2c 09 09 2f 2a   "truncate",../*
09a0: 20 4f 50 54 20 2a 2f 0a 20 20 20 20 20 22 77 61   OPT */.     "wa
09b0: 74 63 68 22 2c 09 09 2f 2a 20 20 20 20 20 2a 2f  tch",../*     */
09c0: 0a 20 20 20 20 20 22 77 72 69 74 65 22 2c 09 09  .     "write",..
09d0: 2f 2a 20 4f 50 54 20 2a 2f 0a 20 20 20 20 20 4e  /* OPT */.     N
09e0: 55 4c 4c 0a 20 7d 3b 0a 20 74 79 70 65 64 65 66  ULL. };. typedef
09f0: 20 65 6e 75 6d 20 7b 0a 40 40 20 2d 31 39 38 2c   enum {.@@ -198,
0a00: 32 30 20 2b 32 30 31 2c 32 32 20 40 40 0a 20 20  20 +201,22 @@.  
0a10: 20 20 20 4d 45 54 48 5f 43 4f 4e 46 49 47 55 52     METH_CONFIGUR
0a20: 45 2c 0a 20 20 20 20 20 4d 45 54 48 5f 46 49 4e  E,.     METH_FIN
0a30: 41 4c 2c 0a 20 20 20 20 20 4d 45 54 48 5f 49 4e  AL,.     METH_IN
0a40: 49 54 2c 0a 20 20 20 20 20 4d 45 54 48 5f 52 45  IT,.     METH_RE
0a50: 41 44 2c 0a 20 20 20 20 20 4d 45 54 48 5f 53 45  AD,.     METH_SE
0a60: 45 4b 2c 0a 2b 20 20 20 20 4d 45 54 48 5f 54 52  EK,.+    METH_TR
0a70: 55 4e 43 41 54 45 2c 0a 20 20 20 20 20 4d 45 54  UNCATE,.     MET
0a80: 48 5f 57 41 54 43 48 2c 0a 20 20 20 20 20 4d 45  H_WATCH,.     ME
0a90: 54 48 5f 57 52 49 54 45 0a 20 7d 20 4d 65 74 68  TH_WRITE. } Meth
0aa0: 6f 64 4e 61 6d 65 3b 0a 20 0a 20 23 64 65 66 69  odName;. . #defi
0ab0: 6e 65 20 46 4c 41 47 28 6d 29 20 28 31 20 3c 3c  ne FLAG(m) (1 <<
0ac0: 20 28 6d 29 29 0a 20 23 64 65 66 69 6e 65 20 52   (m)). #define R
0ad0: 45 51 55 49 52 45 44 5f 4d 45 54 48 4f 44 53 20  EQUIRED_METHODS 
0ae0: 5c 0a 20 09 28 46 4c 41 47 28 4d 45 54 48 5f 49  \. .(FLAG(METH_I
0af0: 4e 49 54 29 20 7c 20 46 4c 41 47 28 4d 45 54 48  NIT) | FLAG(METH
0b00: 5f 46 49 4e 41 4c 29 20 7c 20 46 4c 41 47 28 4d  _FINAL) | FLAG(M
0b10: 45 54 48 5f 57 41 54 43 48 29 29 0a 20 23 64 65  ETH_WATCH)). #de
0b20: 66 69 6e 65 20 4e 55 4c 4c 41 42 4c 45 5f 4d 45  fine NULLABLE_ME
0b30: 54 48 4f 44 53 20 5c 0a 20 09 28 46 4c 41 47 28  THODS \. .(FLAG(
0b40: 4d 45 54 48 5f 42 4c 4f 43 4b 49 4e 47 29 20 7c  METH_BLOCKING) |
0b50: 20 46 4c 41 47 28 4d 45 54 48 5f 53 45 45 4b 29   FLAG(METH_SEEK)
0b60: 20 7c 20 5c 0a 2d 09 46 4c 41 47 28 4d 45 54 48   | \.-.FLAG(METH
0b70: 5f 43 4f 4e 46 49 47 55 52 45 29 20 7c 20 46 4c  _CONFIGURE) | FL
0b80: 41 47 28 4d 45 54 48 5f 43 47 45 54 29 20 7c 20  AG(METH_CGET) | 
0b90: 46 4c 41 47 28 4d 45 54 48 5f 43 47 45 54 41 4c  FLAG(METH_CGETAL
0ba0: 4c 29 29 0a 2b 09 46 4c 41 47 28 4d 45 54 48 5f  L)).+.FLAG(METH_
0bb0: 43 4f 4e 46 49 47 55 52 45 29 20 7c 20 46 4c 41  CONFIGURE) | FLA
0bc0: 47 28 4d 45 54 48 5f 43 47 45 54 29 20 7c 20 5c  G(METH_CGET) | \
0bd0: 0a 2b 09 46 4c 41 47 28 4d 45 54 48 5f 43 47 45  .+.FLAG(METH_CGE
0be0: 54 41 4c 4c 29 20 20 20 7c 20 46 4c 41 47 28 4d  TALL)   | FLAG(M
0bf0: 45 54 48 5f 54 52 55 4e 43 41 54 45 29 29 0a 20  ETH_TRUNCATE)). 
0c00: 0a 20 23 64 65 66 69 6e 65 20 52 41 4e 44 57 20  . #define RANDW 
0c10: 5c 0a 20 09 28 54 43 4c 5f 52 45 41 44 41 42 4c  \. .(TCL_READABL
0c20: 45 20 7c 20 54 43 4c 5f 57 52 49 54 41 42 4c 45  E | TCL_WRITABLE
0c30: 29 0a 20 0a 20 23 64 65 66 69 6e 65 20 49 4d 50  ). . #define IMP
0c40: 4c 49 45 53 28 61 2c 62 29 09 28 28 21 28 61 29  LIES(a,b).((!(a)
0c50: 29 20 7c 7c 20 28 62 29 29 0a 40 40 20 2d 32 33  ) || (b)).@@ -23
0c60: 37 2c 31 31 20 2b 32 34 32 2c 31 32 20 40 40 0a  7,11 +242,12 @@.
0c70: 20 20 20 20 20 46 6f 72 77 61 72 64 65 64 53 65       ForwardedSe
0c80: 65 6b 2c 0a 20 20 20 20 20 46 6f 72 77 61 72 64  ek,.     Forward
0c90: 65 64 57 61 74 63 68 2c 0a 20 20 20 20 20 46 6f  edWatch,.     Fo
0ca0: 72 77 61 72 64 65 64 42 6c 6f 63 6b 2c 0a 20 20  rwardedBlock,.  
0cb0: 20 20 20 46 6f 72 77 61 72 64 65 64 53 65 74 4f     ForwardedSetO
0cc0: 70 74 2c 0a 20 20 20 20 20 46 6f 72 77 61 72 64  pt,.     Forward
0cd0: 65 64 47 65 74 4f 70 74 2c 0a 2d 20 20 20 20 46  edGetOpt,.-    F
0ce0: 6f 72 77 61 72 64 65 64 47 65 74 4f 70 74 41 6c  orwardedGetOptAl
0cf0: 6c 0a 2b 20 20 20 20 46 6f 72 77 61 72 64 65 64  l.+    Forwarded
0d00: 47 65 74 4f 70 74 41 6c 6c 2c 0a 2b 20 20 20 20  GetOptAll,.+    
0d10: 46 6f 72 77 61 72 64 65 64 54 72 75 6e 63 61 74  ForwardedTruncat
0d20: 65 0a 20 7d 20 46 6f 72 77 61 72 64 65 64 4f 70  e. } ForwardedOp
0d30: 65 72 61 74 69 6f 6e 3b 0a 20 0a 20 2f 2a 0a 20  eration;. . /*. 
0d40: 20 2a 20 45 76 65 6e 74 20 75 73 65 64 20 74 6f   * Event used to
0d50: 20 66 6f 72 77 61 72 64 20 64 72 69 76 65 72 20   forward driver 
0d60: 69 6e 76 6f 63 61 74 69 6f 6e 73 20 74 6f 20 74  invocations to t
0d70: 68 65 20 74 68 72 65 61 64 20 61 63 74 75 61 6c  he thread actual
0d80: 6c 79 20 6d 61 6e 61 67 69 6e 67 0a 20 20 2a 20  ly managing.  * 
0d90: 74 68 65 20 63 68 61 6e 6e 65 6c 2e 20 57 65 20  the channel. We 
0da0: 63 61 6e 6e 6f 74 20 63 6f 6e 73 74 72 75 63 74  cannot construct
0db0: 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 74 6f 20   the command to 
0dc0: 65 78 65 63 75 74 65 20 61 6e 64 20 66 6f 72 77  execute and forw
0dd0: 61 72 64 20 74 68 61 74 2e 0a 40 40 20 2d 33 30  ard that..@@ -30
0de0: 30 2c 31 30 20 2b 33 30 36 2c 31 34 20 40 40 0a  0,10 +306,14 @@.
0df0: 20 73 74 72 75 63 74 20 46 6f 72 77 61 72 64 50   struct ForwardP
0e00: 61 72 61 6d 47 65 74 4f 70 74 20 7b 0a 20 20 20  aramGetOpt {.   
0e10: 20 20 46 6f 72 77 61 72 64 50 61 72 61 6d 42 61    ForwardParamBa
0e20: 73 65 20 62 61 73 65 3b 09 2f 2a 20 22 53 75 70  se base;./* "Sup
0e30: 65 72 74 79 70 65 22 2e 20 4d 55 53 54 20 43 4f  ertype". MUST CO
0e40: 4d 45 20 46 49 52 53 54 2e 20 2a 2f 0a 20 20 20  ME FIRST. */.   
0e50: 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 6e 61    const char *na
0e60: 6d 65 3b 09 09 2f 2a 20 4e 61 6d 65 20 6f 66 20  me;../* Name of 
0e70: 6f 70 74 69 6f 6e 20 74 6f 20 67 65 74 2c 20 6d  option to get, m
0e80: 61 79 62 65 20 4e 55 4c 4c 20 2a 2f 0a 20 20 20  aybe NULL */.   
0e90: 20 20 54 63 6c 5f 44 53 74 72 69 6e 67 20 2a 76    Tcl_DString *v
0ea0: 61 6c 75 65 3b 09 09 2f 2a 20 52 65 73 75 6c 74  alue;../* Result
0eb0: 20 2a 2f 0a 20 7d 3b 0a 2b 73 74 72 75 63 74 20   */. };.+struct 
0ec0: 46 6f 72 77 61 72 64 50 61 72 61 6d 54 72 75 6e  ForwardParamTrun
0ed0: 63 61 74 65 20 7b 0a 2b 20 20 20 20 46 6f 72 77  cate {.+    Forw
0ee0: 61 72 64 50 61 72 61 6d 42 61 73 65 20 62 61 73  ardParamBase bas
0ef0: 65 3b 09 2f 2a 20 22 53 75 70 65 72 74 79 70 65  e;./* "Supertype
0f00: 22 2e 20 4d 55 53 54 20 43 4f 4d 45 20 46 49 52  ". MUST COME FIR
0f10: 53 54 2e 20 2a 2f 0a 2b 20 20 20 20 54 63 6c 5f  ST. */.+    Tcl_
0f20: 57 69 64 65 49 6e 74 20 6c 65 6e 67 74 68 3b 09  WideInt length;.
0f30: 09 2f 2a 20 49 3a 20 4c 65 6e 67 74 68 20 6f 66  ./* I: Length of
0f40: 20 66 69 6c 65 2e 20 2a 2f 0a 2b 7d 3b 0a 20 0a   file. */.+};. .
0f50: 20 2f 2a 0a 20 20 2a 20 4e 6f 77 20 6a 6f 69 6e   /*.  * Now join
0f60: 20 61 6c 6c 20 74 68 65 73 65 20 74 6f 67 65 74   all these toget
0f70: 68 65 72 20 69 6e 20 61 20 73 69 6e 67 6c 65 20  her in a single 
0f80: 75 6e 69 6f 6e 20 66 6f 72 20 63 6f 6e 76 65 6e  union for conven
0f90: 69 65 6e 63 65 2e 0a 20 20 2a 2f 0a 20 0a 40 40  ience..  */. .@@
0fa0: 20 2d 33 31 34 2c 31 30 20 2b 33 32 34 2c 31 31   -314,10 +324,11
0fb0: 20 40 40 0a 20 20 20 20 20 73 74 72 75 63 74 20   @@.     struct 
0fc0: 46 6f 72 77 61 72 64 50 61 72 61 6d 53 65 65 6b  ForwardParamSeek
0fd0: 20 73 65 65 6b 3b 0a 20 20 20 20 20 73 74 72 75   seek;.     stru
0fe0: 63 74 20 46 6f 72 77 61 72 64 50 61 72 61 6d 57  ct ForwardParamW
0ff0: 61 74 63 68 20 77 61 74 63 68 3b 0a 20 20 20 20  atch watch;.    
1000: 20 73 74 72 75 63 74 20 46 6f 72 77 61 72 64 50   struct ForwardP
1010: 61 72 61 6d 42 6c 6f 63 6b 20 62 6c 6f 63 6b 3b  aramBlock block;
1020: 0a 20 20 20 20 20 73 74 72 75 63 74 20 46 6f 72  .     struct For
1030: 77 61 72 64 50 61 72 61 6d 53 65 74 4f 70 74 20  wardParamSetOpt 
1040: 73 65 74 4f 70 74 3b 0a 20 20 20 20 20 73 74 72  setOpt;.     str
1050: 75 63 74 20 46 6f 72 77 61 72 64 50 61 72 61 6d  uct ForwardParam
1060: 47 65 74 4f 70 74 20 67 65 74 4f 70 74 3b 0a 2b  GetOpt getOpt;.+
1070: 20 20 20 20 73 74 72 75 63 74 20 46 6f 72 77 61      struct Forwa
1080: 72 64 50 61 72 61 6d 54 72 75 6e 63 61 74 65 20  rdParamTruncate 
1090: 74 72 75 6e 63 61 74 65 3b 0a 20 7d 20 46 6f 72  truncate;. } For
10a0: 77 61 72 64 50 61 72 61 6d 3b 0a 20 0a 20 2f 2a  wardParam;. . /*
10b0: 0a 20 20 2a 20 46 6f 72 77 61 72 64 20 64 65 63  .  * Forward dec
10c0: 6c 61 72 61 74 69 6f 6e 2e 0a 20 20 2a 2f 0a 40  laration..  */.@
10d0: 40 20 2d 37 30 33 2c 31 30 20 2b 37 31 34 2c 31  @ -703,10 +714,1
10e0: 33 20 40 40 0a 20 09 69 66 20 28 21 28 6d 65 74  3 @@. .if (!(met
10f0: 68 6f 64 73 20 26 20 46 4c 41 47 28 4d 45 54 48  hods & FLAG(METH
1100: 5f 53 45 45 4b 29 29 29 20 7b 0a 20 23 69 66 6e  _SEEK))) {. #ifn
1110: 64 65 66 20 54 43 4c 5f 4e 4f 5f 44 45 50 52 45  def TCL_NO_DEPRE
1120: 43 41 54 45 44 0a 20 09 20 20 20 20 63 6c 6f 6e  CATED. .    clon
1130: 65 50 74 72 2d 3e 73 65 65 6b 50 72 6f 63 20 3d  ePtr->seekProc =
1140: 20 4e 55 4c 4c 3b 0a 20 23 65 6e 64 69 66 0a 20   NULL;. #endif. 
1150: 09 20 20 20 20 63 6c 6f 6e 65 50 74 72 2d 3e 77  .    clonePtr->w
1160: 69 64 65 53 65 65 6b 50 72 6f 63 20 3d 20 4e 55  ideSeekProc = NU
1170: 4c 4c 3b 0a 2b 09 7d 0a 2b 09 69 66 20 28 21 28  LL;.+.}.+.if (!(
1180: 6d 65 74 68 6f 64 73 20 26 20 46 4c 41 47 28 4d  methods & FLAG(M
1190: 45 54 48 5f 54 52 55 4e 43 41 54 45 29 29 29 20  ETH_TRUNCATE))) 
11a0: 7b 0a 2b 09 20 20 20 20 63 6c 6f 6e 65 50 74 72  {.+.    clonePtr
11b0: 2d 3e 74 72 75 6e 63 61 74 65 50 72 6f 63 20 3d  ->truncateProc =
11c0: 20 4e 55 4c 4c 3b 0a 20 09 7d 0a 20 0a 20 09 63   NULL;. .}. . .c
11d0: 68 61 6e 50 74 72 2d 3e 74 79 70 65 50 74 72 20  hanPtr->typePtr 
11e0: 3d 20 63 6c 6f 6e 65 50 74 72 3b 0a 20 20 20 20  = clonePtr;.    
11f0: 20 7d 0a 20 0a 40 40 20 2d 32 30 34 34 2c 31 30   }. .@@ -2044,10
1200: 20 2b 32 30 35 38 2c 37 37 20 40 40 0a 20 20 20   +2058,77 @@.   
1210: 20 20 72 65 74 75 72 6e 20 72 65 73 75 6c 74 3b    return result;
1220: 0a 20 20 65 72 72 6f 72 3a 0a 20 20 20 20 20 72  .  error:.     r
1230: 65 73 75 6c 74 20 3d 20 54 43 4c 5f 45 52 52 4f  esult = TCL_ERRO
1240: 52 3b 0a 20 20 20 20 20 67 6f 74 6f 20 73 74 6f  R;.     goto sto
1250: 70 3b 0a 20 7d 0a 2b 0c 0a 2b 2f 2a 0a 2b 20 2a  p;. }.+..+/*.+ *
1260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1280: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1290: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12a0: 2d 2d 2d 2d 2d 2d 0a 2b 20 2a 0a 2b 20 2a 20 52  ------.+ *.+ * R
12b0: 65 66 6c 65 63 74 54 72 75 6e 63 61 74 65 20 2d  eflectTruncate -
12c0: 2d 0a 2b 20 2a 0a 2b 20 2a 09 54 68 69 73 20 66  -.+ *.+ *.This f
12d0: 75 6e 63 74 69 6f 6e 20 69 73 20 69 6e 76 6f 6b  unction is invok
12e0: 65 64 20 74 6f 20 74 72 75 6e 63 61 74 65 20 61  ed to truncate a
12f0: 20 63 68 61 6e 6e 65 6c 27 73 20 66 69 6c 65 20   channel's file 
1300: 73 69 7a 65 2e 0a 2b 20 2a 0a 2b 20 2a 20 52 65  size..+ *.+ * Re
1310: 73 75 6c 74 73 3a 0a 2b 20 2a 09 41 20 73 74 61  sults:.+ *.A sta
1320: 6e 64 61 72 64 20 54 63 6c 20 72 65 73 75 6c 74  ndard Tcl result
1330: 20 63 6f 64 65 2e 0a 2b 20 2a 0a 2b 20 2a 20 53   code..+ *.+ * S
1340: 69 64 65 20 65 66 66 65 63 74 73 3a 0a 2b 20 2a  ide effects:.+ *
1350: 09 41 72 62 69 74 72 61 72 79 2c 20 61 73 20 69  .Arbitrary, as i
1360: 74 20 63 61 6c 6c 73 20 75 70 6f 6e 20 61 20 54  t calls upon a T
1370: 63 6c 20 73 63 72 69 70 74 2e 0a 2b 20 2a 0a 2b  cl script..+ *.+
1380: 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   *--------------
1390: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13c0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 2b 20 2a 2f 0a 2b 0a  --------.+ */.+.
13d0: 2b 73 74 61 74 69 63 20 69 6e 74 0a 2b 52 65 66  +static int.+Ref
13e0: 6c 65 63 74 54 72 75 6e 63 61 74 65 28 0a 2b 20  lectTruncate(.+ 
13f0: 20 20 20 43 6c 69 65 6e 74 44 61 74 61 20 63 6c     ClientData cl
1400: 69 65 6e 74 44 61 74 61 2c 09 2f 2a 20 43 68 61  ientData,./* Cha
1410: 6e 6e 65 6c 20 74 6f 20 71 75 65 72 79 20 2a 2f  nnel to query */
1420: 0a 2b 20 20 20 20 6c 6f 6e 67 20 6c 6f 6e 67 20  .+    long long 
1430: 6c 65 6e 67 74 68 29 09 09 2f 2a 20 4c 65 6e 67  length)../* Leng
1440: 74 68 20 74 6f 20 74 72 75 6e 63 61 74 65 20 74  th to truncate t
1450: 6f 2e 20 2a 2f 0a 2b 7b 0a 2b 20 20 20 20 52 65  o. */.+{.+    Re
1460: 66 6c 65 63 74 65 64 43 68 61 6e 6e 65 6c 20 2a  flectedChannel *
1470: 72 63 50 74 72 20 3d 20 28 52 65 66 6c 65 63 74  rcPtr = (Reflect
1480: 65 64 43 68 61 6e 6e 65 6c 20 2a 29 63 6c 69 65  edChannel *)clie
1490: 6e 74 44 61 74 61 3b 0a 2b 20 20 20 20 54 63 6c  ntData;.+    Tcl
14a0: 5f 4f 62 6a 20 2a 6c 65 6e 4f 62 6a 3b 0a 2b 20  _Obj *lenObj;.+ 
14b0: 20 20 20 69 6e 74 20 65 72 72 6f 72 4e 75 6d 3b     int errorNum;
14c0: 09 09 2f 2a 20 45 49 4e 56 41 4c 20 6f 72 20 45  ../* EINVAL or E
14d0: 4f 4b 20 28 73 75 63 63 65 73 73 29 2e 20 2a 2f  OK (success). */
14e0: 0a 2b 20 20 20 20 54 63 6c 5f 4f 62 6a 20 2a 72  .+    Tcl_Obj *r
14f0: 65 73 4f 62 6a 3b 09 09 2f 2a 20 52 65 73 75 6c  esObj;../* Resul
1500: 74 20 66 6f 72 20 27 74 72 75 6e 63 61 74 65 27  t for 'truncate'
1510: 20 2a 2f 0a 2b 0a 2b 20 20 20 20 2f 2a 0a 2b 20   */.+.+    /*.+ 
1520: 20 20 20 20 2a 20 41 72 65 20 77 65 20 69 6e 20      * Are we in 
1530: 74 68 65 20 63 6f 72 72 65 63 74 20 74 68 72 65  the correct thre
1540: 61 64 3f 0a 2b 20 20 20 20 20 2a 2f 0a 2b 0a 2b  ad?.+     */.+.+
1550: 23 69 66 64 65 66 20 54 43 4c 5f 54 48 52 45 41  #ifdef TCL_THREA
1560: 44 53 0a 2b 20 20 20 20 69 66 20 28 72 63 50 74  DS.+    if (rcPt
1570: 72 2d 3e 74 68 72 65 61 64 20 21 3d 20 54 63 6c  r->thread != Tcl
1580: 5f 47 65 74 43 75 72 72 65 6e 74 54 68 72 65 61  _GetCurrentThrea
1590: 64 28 29 29 20 7b 0a 2b 09 46 6f 72 77 61 72 64  d()) {.+.Forward
15a0: 50 61 72 61 6d 20 70 3b 0a 2b 0a 2b 09 70 2e 74  Param p;.+.+.p.t
15b0: 72 75 6e 63 61 74 65 2e 6c 65 6e 67 74 68 20 3d  runcate.length =
15c0: 20 6c 65 6e 67 74 68 3b 0a 2b 0a 2b 09 46 6f 72   length;.+.+.For
15d0: 77 61 72 64 4f 70 54 6f 48 61 6e 64 6c 65 72 54  wardOpToHandlerT
15e0: 68 72 65 61 64 28 72 63 50 74 72 2c 20 46 6f 72  hread(rcPtr, For
15f0: 77 61 72 64 65 64 54 72 75 6e 63 61 74 65 2c 20  wardedTruncate, 
1600: 26 70 29 3b 0a 2b 0a 2b 09 69 66 20 28 70 2e 62  &p);.+.+.if (p.b
1610: 61 73 65 2e 63 6f 64 65 20 21 3d 20 54 43 4c 5f  ase.code != TCL_
1620: 4f 4b 29 20 7b 0a 2b 09 20 20 20 20 50 61 73 73  OK) {.+.    Pass
1630: 52 65 63 65 69 76 65 64 45 72 72 6f 72 28 72 63  ReceivedError(rc
1640: 50 74 72 2d 3e 63 68 61 6e 2c 20 26 70 29 3b 0a  Ptr->chan, &p);.
1650: 2b 09 20 20 20 20 72 65 74 75 72 6e 20 45 49 4e  +.    return EIN
1660: 56 41 4c 3b 0a 2b 09 7d 0a 2b 0a 2b 09 72 65 74  VAL;.+.}.+.+.ret
1670: 75 72 6e 20 45 4f 4b 3b 0a 2b 20 20 20 20 7d 0a  urn EOK;.+    }.
1680: 2b 23 65 6e 64 69 66 0a 2b 0a 2b 20 20 20 20 2f  +#endif.+.+    /
1690: 2a 20 41 53 53 45 52 54 3a 20 72 63 50 74 72 2d  * ASSERT: rcPtr-
16a0: 3e 6d 65 74 68 6f 64 20 26 20 46 4c 41 47 28 4d  >method & FLAG(M
16b0: 45 54 48 5f 54 52 55 4e 43 41 54 45 29 20 2a 2f  ETH_TRUNCATE) */
16c0: 0a 2b 0a 2b 20 20 20 20 54 63 6c 5f 50 72 65 73  .+.+    Tcl_Pres
16d0: 65 72 76 65 28 72 63 50 74 72 29 3b 0a 2b 0a 2b  erve(rcPtr);.+.+
16e0: 20 20 20 20 6c 65 6e 4f 62 6a 20 20 3d 20 54 63      lenObj  = Tc
16f0: 6c 5f 4e 65 77 49 6e 74 4f 62 6a 28 6c 65 6e 67  l_NewIntObj(leng
1700: 74 68 29 3b 0a 2b 20 20 20 20 54 63 6c 5f 49 6e  th);.+    Tcl_In
1710: 63 72 52 65 66 43 6f 75 6e 74 28 6c 65 6e 4f 62  crRefCount(lenOb
1720: 6a 29 3b 0a 2b 0a 2b 20 20 20 20 69 66 20 28 49  j);.+.+    if (I
1730: 6e 76 6f 6b 65 54 63 6c 4d 65 74 68 6f 64 28 72  nvokeTclMethod(r
1740: 63 50 74 72 2c 4d 45 54 48 5f 54 52 55 4e 43 41  cPtr,METH_TRUNCA
1750: 54 45 2c 6c 65 6e 4f 62 6a 2c 4e 55 4c 4c 2c 26  TE,lenObj,NULL,&
1760: 72 65 73 4f 62 6a 29 21 3d 54 43 4c 5f 4f 4b 29  resObj)!=TCL_OK)
1770: 20 7b 0a 2b 09 54 63 6c 5f 53 65 74 43 68 61 6e   {.+.Tcl_SetChan
1780: 6e 65 6c 45 72 72 6f 72 28 72 63 50 74 72 2d 3e  nelError(rcPtr->
1790: 63 68 61 6e 2c 20 72 65 73 4f 62 6a 29 3b 0a 2b  chan, resObj);.+
17a0: 09 65 72 72 6f 72 4e 75 6d 20 3d 20 45 49 4e 56  .errorNum = EINV
17b0: 41 4c 3b 0a 2b 20 20 20 20 7d 20 65 6c 73 65 20  AL;.+    } else 
17c0: 7b 0a 2b 09 65 72 72 6f 72 4e 75 6d 20 3d 20 45  {.+.errorNum = E
17d0: 4f 4b 3b 0a 2b 20 20 20 20 7d 0a 2b 0a 2b 20 20  OK;.+    }.+.+  
17e0: 20 20 54 63 6c 5f 44 65 63 72 52 65 66 43 6f 75    Tcl_DecrRefCou
17f0: 6e 74 28 6c 65 6e 4f 62 6a 29 3b 0a 2b 20 20 20  nt(lenObj);.+   
1800: 20 54 63 6c 5f 44 65 63 72 52 65 66 43 6f 75 6e   Tcl_DecrRefCoun
1810: 74 28 72 65 73 4f 62 6a 29 3b 09 09 2f 2a 20 52  t(resObj);../* R
1820: 65 6d 6f 76 65 20 72 65 66 65 72 65 6e 63 65 20  emove reference 
1830: 68 65 6c 64 20 66 72 6f 6d 20 69 6e 76 6f 6b 65  held from invoke
1840: 20 2a 2f 0a 2b 20 20 20 20 54 63 6c 5f 52 65 6c   */.+    Tcl_Rel
1850: 65 61 73 65 28 72 63 50 74 72 29 3b 0a 2b 20 20  ease(rcPtr);.+  
1860: 20 20 72 65 74 75 72 6e 20 65 72 72 6f 72 4e 75    return errorNu
1870: 6d 3b 0a 2b 7d 0a 20 0c 0a 20 2f 2a 0a 20 20 2a  m;.+}. .. /*.  *
1880: 20 48 65 6c 70 65 72 73 2e 20 3d 3d 3d 3d 3d 3d   Helpers. ======
1890: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
18a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
18b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
18c0: 3d 3d 3d 0a 20 20 2a 2f 0a 20 0a 40 40 20 2d 33  ===.  */. .@@ -3
18d0: 32 37 35 2c 31 30 20 2b 33 33 35 36 2c 32 33 20  275,10 +3356,23 
18e0: 40 40 0a 20 09 09 7d 0a 20 09 20 20 20 20 7d 0a  @@. ..}. .    }.
18f0: 20 09 7d 0a 20 20 20 20 20 20 20 20 20 54 63 6c   .}.         Tcl
1900: 5f 52 65 6c 65 61 73 65 28 72 63 50 74 72 29 3b  _Release(rcPtr);
1910: 0a 20 09 62 72 65 61 6b 3b 0a 2b 0a 2b 20 20 20  . .break;.+.+   
1920: 20 63 61 73 65 20 46 6f 72 77 61 72 64 65 64 54   case ForwardedT
1930: 72 75 6e 63 61 74 65 3a 20 7b 0a 2b 09 54 63 6c  runcate: {.+.Tcl
1940: 5f 4f 62 6a 20 2a 6c 65 6e 4f 62 6a 20 3d 20 54  _Obj *lenObj = T
1950: 63 6c 5f 4e 65 77 49 6e 74 4f 62 6a 28 70 61 72  cl_NewIntObj(par
1960: 61 6d 50 74 72 2d 3e 74 72 75 6e 63 61 74 65 2e  amPtr->truncate.
1970: 6c 65 6e 67 74 68 29 3b 0a 2b 0a 2b 09 54 63 6c  length);.+.+.Tcl
1980: 5f 49 6e 63 72 52 65 66 43 6f 75 6e 74 28 6c 65  _IncrRefCount(le
1990: 6e 4f 62 6a 29 3b 0a 2b 09 54 63 6c 5f 50 72 65  nObj);.+.Tcl_Pre
19a0: 73 65 72 76 65 28 72 63 50 74 72 29 3b 0a 2b 09  serve(rcPtr);.+.
19b0: 69 66 20 28 49 6e 76 6f 6b 65 54 63 6c 4d 65 74  if (InvokeTclMet
19c0: 68 6f 64 28 72 63 50 74 72 2c 4d 45 54 48 5f 54  hod(rcPtr,METH_T
19d0: 52 55 4e 43 41 54 45 2c 6c 65 6e 4f 62 6a 2c 4e  RUNCATE,lenObj,N
19e0: 55 4c 4c 2c 26 72 65 73 4f 62 6a 29 21 3d 54 43  ULL,&resObj)!=TC
19f0: 4c 5f 4f 4b 29 20 7b 0a 2b 09 20 20 20 20 46 6f  L_OK) {.+.    Fo
1a00: 72 77 61 72 64 53 65 74 4f 62 6a 45 72 72 6f 72  rwardSetObjError
1a10: 28 70 61 72 61 6d 50 74 72 2c 20 72 65 73 4f 62  (paramPtr, resOb
1a20: 6a 29 3b 0a 2b 09 7d 0a 2b 09 54 63 6c 5f 52 65  j);.+.}.+.Tcl_Re
1a30: 6c 65 61 73 65 28 72 63 50 74 72 29 3b 0a 2b 09  lease(rcPtr);.+.
1a40: 54 63 6c 5f 44 65 63 72 52 65 66 43 6f 75 6e 74  Tcl_DecrRefCount
1a50: 28 6c 65 6e 4f 62 6a 29 3b 0a 2b 09 62 72 65 61  (lenObj);.+.brea
1a60: 6b 3b 0a 2b 20 20 20 20 7d 0a 20 0a 20 20 20 20  k;.+    }. .    
1a70: 20 64 65 66 61 75 6c 74 3a 0a 20 09 2f 2a 0a 20   default:. ./*. 
1a80: 09 20 2a 20 42 61 64 20 6f 70 65 72 61 74 69 6f  . * Bad operatio
1a90: 6e 20 63 6f 64 65 2e 0a 20 09 20 2a 2f 0a 0a     n code.. . */..