#ifdef CAN_PROTOTYPE
#define XSdec(x) XS(x)
#else
#define XSdec(x) void x()
#endif

#ifndef ERRSV
#define ERRSV GvSV(errgv)
#endif

#ifdef dirty
#undef dirty
#endif
#ifdef bufptr
#undef bufptr
#endif
#ifdef colors
#undef colors
#endif

#define Tcl_Interp     HV
#define LangCallback   SV
#define Arg            SV *
#define Var            SV *
#define LangResultSave AV
#define Tcl_Command    struct Lang_CmdInfo *
#define Tcl_RegExp     regexp *
#define Tcl_Obj        SV 
#define Tcl_DString    SV *

#ifndef PerlIO 
#define PerlIO FILE 
#define PerlIO_stderr()			stderr
#define PerlIO_printf			fprintf
#define PerlIO_flush(f)			Fflush(f)
#define PerlIO_vprintf(f,fmt,a)		vfprintf(f,fmt,a)          
#define PerlIO_putc(f,c)		fputc(c,f)
#define PerlIO_fileno(f)		fileno(f)

/* Now our interface to Configure's FILE_xxx macros */

#ifdef USE_STDIO_PTR
#define PerlIO_has_cntptr(f)		1       
#define PerlIO_get_ptr(f)		FILE_ptr(f)          
#define PerlIO_get_cnt(f)		FILE_cnt(f)          

#ifdef FILE_CNT_LVALUE
#define PerlIO_canset_cnt(f)		1      
#ifdef FILE_PTR_LVALUE
#define PerlIO_fast_gets(f)		1        
#endif
#define PerlIO_set_cnt(f,c)		(FILE_cnt(f) = (c))          
#else
#define PerlIO_canset_cnt(f)		0      
#define PerlIO_set_cnt(f,c)		abort()
#endif

#ifdef FILE_PTR_LVALUE
#define PerlIO_set_ptrcnt(f,p,c)	(FILE_ptr(f) = (p), PerlIO_set_cnt(f,c))          
#else
#define PerlIO_set_ptrcnt(f,p,c)	abort()
#endif

#else  /* USE_STDIO_PTR */

#define PerlIO_has_cntptr(f)		0
#define PerlIO_get_cnt(f)		(abort(),0)
#define PerlIO_get_ptr(f)		(abort(),0)
#define PerlIO_set_cnt(f,c)		abort()
#define PerlIO_set_ptrcnt(f,p,c)	abort()

#endif /* USE_STDIO_PTR */

#endif
