1 diff -up expect5.45/exp_clib.c.orig expect5.45/exp_clib.c
2 --- expect5.45/exp_clib.c.orig 2010-09-01 00:20:27.000000000 +0200
3 +++ expect5.45/exp_clib.c 2015-05-19 12:01:22.413349423 +0200
4 @@ -84,6 +84,8 @@ would appreciate credit if this program
10 extern void abort _ANSI_ARGS_((void));
11 extern double atof _ANSI_ARGS_((CONST char *string));
12 extern int atoi _ANSI_ARGS_((CONST char *string));
13 @@ -114,7 +116,6 @@ extern unsigned long strtoul _ANSI_ARGS_
14 #include <stdlib.h> /* for malloc */
19 #define TclRegError exp_TclRegError
21 @@ -1465,6 +1466,467 @@ TclGetRegError()
25 + * following stolen from tcl8.0.4/generic/tclPosixStr.c
29 + *----------------------------------------------------------------------
33 + * Return a human-readable message corresponding to a given
37 + * The return value is the standard POSIX error message for
38 + * errno. This procedure is used instead of strerror because
39 + * strerror returns slightly different values on different
40 + * machines (e.g. different capitalizations), which cause
41 + * problems for things such as regression tests. This procedure
42 + * provides messages for most standard errors, then it calls
43 + * strerror for things it doesn't understand.
48 + *----------------------------------------------------------------------
54 + int err; /* Error number (such as in errno variable). */
58 + case E2BIG: return "argument list too long";
61 + case EACCES: return "permission denied";
64 + case EADDRINUSE: return "address already in use";
67 + case EADDRNOTAVAIL: return "can't assign requested address";
70 + case EADV: return "advertise error";
73 + case EAFNOSUPPORT: return "address family not supported by protocol family";
76 + case EAGAIN: return "resource temporarily unavailable";
79 + case EALIGN: return "EALIGN";
81 +#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY ))
82 + case EALREADY: return "operation already in progress";
85 + case EBADE: return "bad exchange descriptor";
88 + case EBADF: return "bad file number";
91 + case EBADFD: return "file descriptor in bad state";
94 + case EBADMSG: return "not a data message";
97 + case EBADR: return "bad request descriptor";
100 + case EBADRPC: return "RPC structure is bad";
103 + case EBADRQC: return "bad request code";
106 + case EBADSLT: return "invalid slot";
109 + case EBFONT: return "bad font file format";
112 + case EBUSY: return "file busy";
115 + case ECHILD: return "no children";
118 + case ECHRNG: return "channel number out of range";
121 + case ECOMM: return "communication error on send";
124 + case ECONNABORTED: return "software caused connection abort";
127 + case ECONNREFUSED: return "connection refused";
130 + case ECONNRESET: return "connection reset by peer";
132 +#if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
133 + case EDEADLK: return "resource deadlock avoided";
135 +#if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK))
136 + case EDEADLOCK: return "resource deadlock avoided";
139 + case EDESTADDRREQ: return "destination address required";
142 + case EDIRTY: return "mounting a dirty fs w/o force";
145 + case EDOM: return "math argument out of range";
148 + case EDOTDOT: return "cross mount point";
151 + case EDQUOT: return "disk quota exceeded";
154 + case EDUPPKG: return "duplicate package name";
157 + case EEXIST: return "file already exists";
160 + case EFAULT: return "bad address in system call argument";
163 + case EFBIG: return "file too large";
166 + case EHOSTDOWN: return "host is down";
169 + case EHOSTUNREACH: return "host is unreachable";
171 +#if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS))
172 + case EIDRM: return "identifier removed";
175 + case EINIT: return "initialization error";
178 + case EINPROGRESS: return "operation now in progress";
181 + case EINTR: return "interrupted system call";
184 + case EINVAL: return "invalid argument";
187 + case EIO: return "I/O error";
190 + case EISCONN: return "socket is already connected";
193 + case EISDIR: return "illegal operation on a directory";
196 + case EISNAM: return "is a name file";
199 + case ELBIN: return "ELBIN";
202 + case EL2HLT: return "level 2 halted";
205 + case EL2NSYNC: return "level 2 not synchronized";
208 + case EL3HLT: return "level 3 halted";
211 + case EL3RST: return "level 3 reset";
214 + case ELIBACC: return "can not access a needed shared library";
217 + case ELIBBAD: return "accessing a corrupted shared library";
220 + case ELIBEXEC: return "can not exec a shared library directly";
223 + case ELIBMAX: return
224 + "attempting to link in more shared libraries than system limit";
227 + case ELIBSCN: return ".lib section in a.out corrupted";
230 + case ELNRNG: return "link number out of range";
232 +#if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT))
233 + case ELOOP: return "too many levels of symbolic links";
236 + case EMFILE: return "too many open files";
239 + case EMLINK: return "too many links";
242 + case EMSGSIZE: return "message too long";
245 + case EMULTIHOP: return "multihop attempted";
248 + case ENAMETOOLONG: return "file name too long";
251 + case ENAVAIL: return "not available";
254 + case ENET: return "ENET";
257 + case ENETDOWN: return "network is down";
260 + case ENETRESET: return "network dropped connection on reset";
263 + case ENETUNREACH: return "network is unreachable";
266 + case ENFILE: return "file table overflow";
269 + case ENOANO: return "anode table overflow";
271 +#if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR))
272 + case ENOBUFS: return "no buffer space available";
275 + case ENOCSI: return "no CSI structure available";
277 +#if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED))
278 + case ENODATA: return "no data available";
281 + case ENODEV: return "no such device";
284 + case ENOENT: return "no such file or directory";
287 + case ENOEXEC: return "exec format error";
290 + case ENOLCK: return "no locks available";
293 + case ENOLINK: return "link has be severed";
296 + case ENOMEM: return "not enough memory";
299 + case ENOMSG: return "no message of desired type";
302 + case ENONET: return "machine is not on the network";
305 + case ENOPKG: return "package not installed";
308 + case ENOPROTOOPT: return "bad proocol option";
311 + case ENOSPC: return "no space left on device";
313 +#if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR))
314 + case ENOSR: return "out of stream resources";
316 +#if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR))
317 + case ENOSTR: return "not a stream device";
320 + case ENOSYM: return "unresolved symbol name";
323 + case ENOSYS: return "function not implemented";
326 + case ENOTBLK: return "block device required";
329 + case ENOTCONN: return "socket is not connected";
332 + case ENOTDIR: return "not a directory";
334 +#if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST))
335 + case ENOTEMPTY: return "directory not empty";
338 + case ENOTNAM: return "not a name file";
341 + case ENOTSOCK: return "socket operation on non-socket";
344 + case ENOTSUP: return "operation not supported";
347 + case ENOTTY: return "inappropriate device for ioctl";
350 + case ENOTUNIQ: return "name not unique on network";
353 + case ENXIO: return "no such device or address";
355 +#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
356 + case EOPNOTSUPP: return "operation not supported on socket";
359 + case EPERM: return "not owner";
361 +#if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT))
362 + case EPFNOSUPPORT: return "protocol family not supported";
365 + case EPIPE: return "broken pipe";
368 + case EPROCLIM: return "too many processes";
371 + case EPROCUNAVAIL: return "bad procedure for program";
373 +#ifdef EPROGMISMATCH
374 + case EPROGMISMATCH: return "program version wrong";
377 + case EPROGUNAVAIL: return "RPC program not available";
380 + case EPROTO: return "protocol error";
382 +#ifdef EPROTONOSUPPORT
383 + case EPROTONOSUPPORT: return "protocol not suppored";
386 + case EPROTOTYPE: return "protocol wrong type for socket";
389 + case ERANGE: return "math result unrepresentable";
391 +#if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED))
392 + case EREFUSED: return "EREFUSED";
395 + case EREMCHG: return "remote address changed";
398 + case EREMDEV: return "remote device";
401 + case EREMOTE: return "pathname hit remote file system";
404 + case EREMOTEIO: return "remote i/o error";
406 +#ifdef EREMOTERELEASE
407 + case EREMOTERELEASE: return "EREMOTERELEASE";
410 + case EROFS: return "read-only file system";
413 + case ERPCMISMATCH: return "RPC version is wrong";
416 + case ERREMOTE: return "object is remote";
419 + case ESHUTDOWN: return "can't send afer socket shutdown";
421 +#ifdef ESOCKTNOSUPPORT
422 + case ESOCKTNOSUPPORT: return "socket type not supported";
425 + case ESPIPE: return "invalid seek";
428 + case ESRCH: return "no such process";
431 + case ESRMNT: return "srmount error";
434 + case ESTALE: return "stale remote file handle";
437 + case ESUCCESS: return "Error 0";
439 +#if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP))
440 + case ETIME: return "timer expired";
442 +#if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR))
443 + case ETIMEDOUT: return "connection timed out";
446 + case ETOOMANYREFS: return "too many references: can't splice";
449 + case ETXTBSY: return "text file or pseudo-device busy";
452 + case EUCLEAN: return "structure needs cleaning";
455 + case EUNATCH: return "protocol driver not attached";
458 + case EUSERS: return "too many users";
461 + case EVERSION: return "version mismatch";
463 +#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
464 + case EWOULDBLOCK: return "operation would block";
467 + case EXDEV: return "cross-domain link";
470 + case EXFULL: return "message tables full";
474 + return "unknown POSIX error";
476 + return strerror(errno);
482 + * end of excerpt from tcl8.0.X/generic/tclPosixStr.c
486 * stolen from exp_log.c - this function is called from the Expect library
487 * but the one that the library supplies calls Tcl functions. So we supply
489 diff -up expect5.45/expect.h.orig expect5.45/expect.h
490 --- expect5.45/expect.h.orig 2010-09-01 00:20:27.000000000 +0200
491 +++ expect5.45/expect.h 2015-05-19 12:00:58.674248152 +0200
492 @@ -258,6 +258,46 @@ typedef long LONG;
493 typedef struct Tcl_RegExp_ *Tcl_RegExp;
496 + * The following declarations either map ckalloc and ckfree to
497 + * malloc and free, or they map them to procedures with all sorts
498 + * of debugging hooks defined in tclCkalloc.c.
501 +#ifdef TCL_MEM_DEBUG
503 +# define Tcl_Alloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
504 +# define Tcl_Free(x) Tcl_DbCkfree(x, __FILE__, __LINE__)
505 +# define Tcl_Realloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
506 +# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
507 +# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__)
508 +# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
513 + * If USE_TCLALLOC is true, then we need to call Tcl_Alloc instead of
514 + * the native malloc/free. The only time USE_TCLALLOC should not be
515 + * true is when compiling the Tcl/Tk libraries on Unix systems. In this
516 + * case we can safely call the native malloc/free directly as a performance
521 +# define ckalloc(x) Tcl_Alloc(x)
522 +# define ckfree(x) Tcl_Free(x)
523 +# define ckrealloc(x,y) Tcl_Realloc(x,y)
525 +# define ckalloc(x) malloc(x)
526 +# define ckfree(x) free(x)
527 +# define ckrealloc(x,y) realloc(x,y)
529 +# define Tcl_DumpActiveMemory(x)
530 +# define Tcl_ValidateAllMemory(x,y)
532 +#endif /* !TCL_MEM_DEBUG */
536 * These function have been renamed. The old names are deprecated, but we
537 * define these macros for backwards compatibilty.
539 @@ -268,6 +308,14 @@ typedef struct Tcl_RegExp_ *Tcl_RegExp;
540 #define Tcl_Return Tcl_SetResult
541 #define Tcl_TildeSubst Tcl_TranslateFileName
544 + * In later releases, Tcl_Panic will be the correct name to use. For now
545 + * we leave it as panic to avoid breaking existing binaries.
548 +#define Tcl_Panic panic
549 +#define Tcl_PanicVA panicVA
551 #endif /* RESOURCE_INCLUDED */
553 #undef TCL_STORAGE_CLASS