/* expect_tcl.h - include file for using the expect library, libexpect.a
with Tcl (and optionally Tk)

Written by: Don Libes, libes@cme.nist.gov, NIST, 12/3/90

Design and implementation of this program was paid for by U.S. tax
dollars.  Therefore it is public domain.  However, the author and NIST
would appreciate credit if this program or parts of it are used.

*/

#ifndef _EXPECT_TCL_H
#define _EXPECT_TCL_H

#include <stdio.h>
#include "expect_comm.h"

/*
 * This is a convenience macro used to initialize a thread local storage ptr.
 * Stolen from tclInt.h
 */
#ifndef TCL_TSD_INIT
#define TCL_TSD_INIT(keyPtr)	(ThreadSpecificData *)Tcl_GetThreadData((keyPtr), sizeof(ThreadSpecificData))
#endif

EXTERN int exp_cmdlinecmds;
EXTERN int exp_interactive;
EXTERN FILE *exp_cmdfile;
EXTERN const char *exp_cmdfilename;
EXTERN int exp_getpid;	/* pid of Expect itself */
EXTERN int exp_buffer_command_input;

EXTERN int exp_strict_write;

EXTERN int exp_tcl_debugger_available;

EXTERN Tcl_Interp *exp_interp;

#define Exp_Init Expect_Init
EXTERN int	Expect_Init (Tcl_Interp *);	/* for Tcl_AppInit apps */
EXTERN void	exp_parse_argv (Tcl_Interp *,int argc,char * const*argv);
EXTERN int	exp_interpreter (Tcl_Interp *,Tcl_Obj *);
EXTERN int	exp_interpret_cmdfile (Tcl_Interp *,FILE *);
EXTERN int	exp_interpret_cmdfilename (Tcl_Interp *,const char *);
EXTERN void	exp_interpret_rcfiles (Tcl_Interp *,int my_rc,int sys_rc);

EXTERN const char *exp_cook (const char *s,Tcl_Size *len);

EXTERN void	expCloseOnExec (int);

			/* app-specific exit handler */
EXTERN void	(*exp_app_exit)(Tcl_Interp *);
EXTERN void	exp_exit_handlers (ClientData);

EXTERN void	exp_error (Tcl_Interp * interp,...);

#endif /* _EXPECT_TCL_H */
