OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / user / expect / expect_comm.h
1 /* expectcomm.h - public symbols common to both expect.h and expect_tcl.h
2
3 Written by: Don Libes, libes@cme.nist.gov, NIST, 12/3/90
4
5 Design and implementation of this program was paid for by U.S. tax
6 dollars.  Therefore it is public domain.  However, the author and NIST
7 would appreciate credit if this program or parts of it are used.
8 */
9
10 #ifndef _EXPECT_COMM_H
11 #define _EXPECT_COMM_H
12
13 /* common return codes for Expect functions */
14 /* The library actually only uses TIMEOUT and EOF */
15 #define EXP_ABEOF       -1      /* abnormal eof in Expect */
16                                 /* when in library, this define is not used. */
17                                 /* Instead "-1" is used literally in the */
18                                 /* usual sense to check errors in system */
19                                 /* calls */
20 #define EXP_TIMEOUT     -2
21 #define EXP_TCLERROR    -3
22 #define EXP_FULLBUFFER  -5
23 #define EXP_MATCH       -6
24 #define EXP_NOMATCH     -7
25 #define EXP_CANTMATCH   EXP_NOMATCH
26 #define EXP_CANMATCH    -8
27 #define EXP_DATA_NEW    -9      /* if select says there is new data */
28 #define EXP_DATA_OLD    -10     /* if we already read data in another cmd */
29 #define EXP_EOF         -11
30 #define EXP_RECONFIGURE -12     /* changes to indirect spawn id lists */
31                                 /* require us to reconfigure things */
32
33 /* in the unlikely event that a signal handler forces us to return this */
34 /* through expect's read() routine, we temporarily convert it to this. */
35 #define EXP_TCLRET      -20
36 #define EXP_TCLCNT      -21
37 #define EXP_TCLCNTTIMER -22
38 #define EXP_TCLBRK      -23
39 #define EXP_TCLCNTEXP   -24
40 #define EXP_TCLRETTCL   -25
41
42 /* yet more TCL return codes */
43 /* Tcl does not safely provide a way to define the values of these, so */
44 /* use ridiculously different numbers for safety */
45 #define EXP_CONTINUE            -101    /* continue expect command */
46                                         /* and restart timer */
47 #define EXP_CONTINUE_TIMER      -102    /* continue expect command */
48                                         /* and continue timer */
49 #define EXP_TCL_RETURN          -103    /* converted by interact */
50                                         /* and interpeter from */
51                                         /* inter_return into */
52                                         /* TCL_RETURN*/
53
54 /*
55  * Everything below here should eventually be moved into expect.h
56  * and Expect-thread-safe variables.
57  */
58
59 EXTERN char *exp_pty_error;             /* place to pass a string generated */
60                                         /* deep in the innards of the pty */
61                                         /* code but needed by anyone */
62 EXTERN int exp_disconnected;            /* proc. disc'd from controlling tty */
63
64
65 #endif /* _EXPECT_COMM_H */