under Digital UNIX.
p4raw-id: //depot/cfgperl@3913
while (IoIFP(io)) {
if (PerlIO_has_cntptr(IoIFP(io))) { /* (the code works without this) */
- if (PerlIO_get_cnt(aTHX_ IoIFP(io)) > 0) /* cheat a little, since */
+ if (PerlIO_get_cnt(IoIFP(io)) > 0) /* cheat a little, since */
return FALSE; /* this is the most usual case */
}
return FALSE;
}
if (PerlIO_has_cntptr(IoIFP(io)) && PerlIO_canset_cnt(IoIFP(io))) {
- if (PerlIO_get_cnt(aTHX_ IoIFP(io)) < -1)
- PerlIO_set_cnt(aTHX_ IoIFP(io),-1);
+ if (PerlIO_get_cnt(IoIFP(io)) < -1)
+ PerlIO_set_cnt(IoIFP(io),-1);
}
if (PL_op->op_flags & OPf_SPECIAL) { /* not necessarily a real EOF yet? */
if (!nextargv(PL_argvgv)) /* get another fp handy */
(*PL_StdIO->pClearerr)(PL_StdIO, (f))
#define PerlIO_getc(f) \
(*PL_StdIO->pGetc)(PL_StdIO, (f))
-#define PerlIO_get_base(mTHX_ f) \
+#define PerlIO_get_base(f) \
(*PL_StdIO->pGetBase)(PL_StdIO, (f))
-#define PerlIO_get_bufsiz(mTHX_ f) \
+#define PerlIO_get_bufsiz(f) \
(*PL_StdIO->pGetBufsiz)(PL_StdIO, (f))
-#define PerlIO_get_cnt(mTHX_ f) \
+#define PerlIO_get_cnt(f) \
(*PL_StdIO->pGetCnt)(PL_StdIO, (f))
-#define PerlIO_get_ptr(mTHX_ f) \
+#define PerlIO_get_ptr(f) \
(*PL_StdIO->pGetPtr)(PL_StdIO, (f))
#define PerlIO_putc(f,c) \
(*PL_StdIO->pPutc)(PL_StdIO, (f),(c))
(*PL_StdIO->pSetBuf)(PL_StdIO, (f), (b))
#define PerlIO_setvbuf(f,b,t,s) \
(*PL_StdIO->pSetVBuf)(PL_StdIO, (f),(b),(t),(s))
-#define PerlIO_set_cnt(mTHX_ f,c) \
+#define PerlIO_set_cnt(f,c) \
(*PL_StdIO->pSetCnt)(PL_StdIO, (f), (c))
-#define PerlIO_set_ptrcnt(mTHX_ f,p,c) \
+#define PerlIO_set_ptrcnt(f,p,c) \
(*PL_StdIO->pSetPtrCnt)(PL_StdIO, (f), (p), (c))
#define PerlIO_setlinebuf(f) \
(*PL_StdIO->pSetlinebuf)(PL_StdIO, (f))
extern int PerlIO_canset_cnt (PerlIO *);
#endif
#ifndef PerlIO_get_ptr
-extern STDCHAR * PerlIO_get_ptr (pTHX_ PerlIO *);
+extern STDCHAR * PerlIO_get_ptr (PerlIO *);
#endif
#ifndef PerlIO_get_cnt
-extern int PerlIO_get_cnt (pTHX_ PerlIO *);
+extern int PerlIO_get_cnt (PerlIO *);
#endif
#ifndef PerlIO_set_cnt
-extern void PerlIO_set_cnt (pTHX_ PerlIO *,int);
+extern void PerlIO_set_cnt (PerlIO *,int);
#endif
#ifndef PerlIO_set_ptrcnt
-extern void PerlIO_set_ptrcnt (pTHX_ PerlIO *,STDCHAR *,int);
+extern void PerlIO_set_ptrcnt (PerlIO *,STDCHAR *,int);
#endif
#ifndef PerlIO_get_base
-extern STDCHAR * PerlIO_get_base (pTHX_ PerlIO *);
+extern STDCHAR * PerlIO_get_base (PerlIO *);
#endif
#ifndef PerlIO_get_bufsiz
-extern int PerlIO_get_bufsiz (pTHX_ PerlIO *);
+extern int PerlIO_get_bufsiz (PerlIO *);
#endif
#ifndef PerlIO_tmpfile
extern PerlIO * PerlIO_tmpfile (void);
# define dTHXa(a) pTHX = (PerlInterpreter *)a
# define dTHX dTHXa(PERL_GET_INTERP)
# endif
-# define mTHX macro_argument
# define pTHX_ pTHX,
# define _pTHX ,pTHX
# define aTHX_ aTHX,
# define _aTHX ,aTHX
-# define mTHX_ mTHX,
-# define _mTHX ,mTHX
#endif
#define STATIC static
# define aTHX
# define aTHX_
# define _aTHX
-# define mTHX
-# define mTHX_
-# define _mTHX
# define dTHXa(a) dNOOP
# define dTHX dNOOP
#endif
#undef PerlIO_set_cnt
void
-PerlIO_set_cnt(pTHX_ PerlIO *f, int cnt)
+PerlIO_set_cnt(PerlIO *f, int cnt)
{
dTHX;
if (cnt < -1 && ckWARN_d(WARN_INTERNAL))
#undef PerlIO_set_ptrcnt
void
-PerlIO_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR *ptr, int cnt)
+PerlIO_set_ptrcnt(PerlIO *f, STDCHAR *ptr, int cnt)
{
#ifdef FILE_bufsiz
dTHX;
#undef PerlIO_get_cnt
int
-PerlIO_get_cnt(pTHX_ PerlIO *f)
+PerlIO_get_cnt(PerlIO *f)
{
#ifdef FILE_cnt
return FILE_cnt(f);
#undef PerlIO_get_bufsiz
int
-PerlIO_get_bufsiz(pTHX_ PerlIO *f)
+PerlIO_get_bufsiz(PerlIO *f)
{
#ifdef FILE_bufsiz
return FILE_bufsiz(f);
#undef PerlIO_get_ptr
STDCHAR *
-PerlIO_get_ptr(pTHX_ PerlIO *f)
+PerlIO_get_ptr(PerlIO *f)
{
#ifdef FILE_ptr
return FILE_ptr(f);
#undef PerlIO_get_base
STDCHAR *
-PerlIO_get_base(pTHX_ PerlIO *f)
+PerlIO_get_base(PerlIO *f)
{
#ifdef FILE_base
return FILE_base(f);
#undef PerlIO_getname
char *
-PerlIO_getname(pTHX_ PerlIO *f, char *buf)
+PerlIO_getname(PerlIO *f, char *buf)
{
#ifdef VMS
return fgetname(f,buf);
# define PerlIO_read(f,buf,count) (SSize_t)fread(buf,1,count,f)
#endif
#define PerlIO_eof(f) feof(f)
-#define PerlIO_getname(mTHX_ f,b) fgetname(f,b)
+#define PerlIO_getname(f,b) fgetname(f,b)
#define PerlIO_error(f) ferror(f)
#define PerlIO_fileno(f) fileno(f)
#define PerlIO_clearerr(f) clearerr(f)
#ifdef USE_STDIO_PTR
#define PerlIO_has_cntptr(f) 1
-#define PerlIO_get_ptr(mTHX_ f) FILE_ptr(f)
-#define PerlIO_get_cnt(mTHX_ f) FILE_cnt(f)
+#define PerlIO_get_ptr(f) FILE_ptr(f)
+#define PerlIO_get_cnt(f) FILE_cnt(f)
#ifdef STDIO_CNT_LVALUE
#define PerlIO_canset_cnt(f) 1
#ifdef STDIO_PTR_LVALUE
#define PerlIO_fast_gets(f) 1
#endif
-#define PerlIO_set_cnt(mTHX_ f,c) (FILE_cnt(f) = (c))
+#define PerlIO_set_cnt(f,c) (FILE_cnt(f) = (c))
#else
#define PerlIO_canset_cnt(f) 0
-#define PerlIO_set_cnt(mTHX_ f,c) abort()
+#define PerlIO_set_cnt(f,c) abort()
#endif
#ifdef STDIO_PTR_LVALUE
-#define PerlIO_set_ptrcnt(mTHX_ f,p,c) (FILE_ptr(f) = (p), pTHX_ PerlIO_set_cnt(mTHX_ f,c))
+#define PerlIO_set_ptrcnt(f,p,c) (FILE_ptr(f) = (p), PerlIO_set_cnt(f,c))
#else
-#define PerlIO_set_ptrcnt(mTHX_ f,p,c) abort()
+#define PerlIO_set_ptrcnt(f,p,c) abort()
#endif
#else /* USE_STDIO_PTR */
#define PerlIO_has_cntptr(f) 0
#define PerlIO_canset_cnt(f) 0
-#define PerlIO_get_cnt(mTHX_ f) (abort(),0)
-#define PerlIO_get_ptr(mTHX_ f) (abort(),(void *)0)
-#define PerlIO_set_cnt(mTHX_ f,c) abort()
-#define PerlIO_set_ptrcnt(mTHX_ f,p,c) abort()
+#define PerlIO_get_cnt(f) (abort(),0)
+#define PerlIO_get_ptr(f) (abort(),(void *)0)
+#define PerlIO_set_cnt(f,c) abort()
+#define PerlIO_set_ptrcnt(f,p,c) abort()
#endif /* USE_STDIO_PTR */
#ifdef FILE_base
#define PerlIO_has_base(f) 1
-#define PerlIO_get_base(mTHX_ f) FILE_base(f)
-#define PerlIO_get_bufsiz(mTHX_ f) FILE_bufsiz(f)
+#define PerlIO_get_base(f) FILE_base(f)
+#define PerlIO_get_bufsiz(f) FILE_bufsiz(f)
#else
#define PerlIO_has_base(f) 0
-#define PerlIO_get_base(mTHX_ f) (abort(),(void *)0)
-#define PerlIO_get_bufsiz(mTHX_ f) (abort(),0)
+#define PerlIO_get_base(f) (abort(),(void *)0)
+#define PerlIO_get_bufsiz(f) (abort(),0)
#endif
#else /* PERLIO_IS_STDIO */
#ifdef PERL_CORE
/* Now our interface to equivalent of Configure's FILE_xxx macros */
#define PerlIO_has_cntptr(f) 1
-#define PerlIO_get_ptr(mTHX_ f) ((f)->next)
-#define PerlIO_get_cnt(mTHX_ f) ((f)->endr - (f)->next)
+#define PerlIO_get_ptr(f) ((f)->next)
+#define PerlIO_get_cnt(f) ((f)->endr - (f)->next)
#define PerlIO_canset_cnt(f) 1
#define PerlIO_fast_gets(f) 1
-#define PerlIO_set_ptrcnt(mTHX_ f,p,c) ((f)->next = (p))
-#define PerlIO_set_cnt(mTHX_ f,c) 1
+#define PerlIO_set_ptrcnt(f,p,c) ((f)->next = (p))
+#define PerlIO_set_cnt(f,c) 1
#define PerlIO_has_base(f) 1
-#define PerlIO_get_base(mTHX_ f) ((f)->data)
-#define PerlIO_get_bufsiz(mTHX_ f) ((f)->endr - (f)->data)
+#define PerlIO_get_base(f) ((f)->data)
+#define PerlIO_get_bufsiz(f) ((f)->endr - (f)->data)
RETPUSHNO;
else
RETPUSHYES;
- if (PerlIO_get_cnt(aTHX_ IoIFP(io)) <= 0) {
+ if (PerlIO_get_cnt(IoIFP(io)) <= 0) {
i = PerlIO_getc(IoIFP(io));
if (i != EOF)
(void)PerlIO_ungetc(IoIFP(io),i);
}
- if (PerlIO_get_cnt(aTHX_ IoIFP(io)) <= 0) /* null file is anything */
+ if (PerlIO_get_cnt(IoIFP(io)) <= 0) /* null file is anything */
RETPUSHYES;
- len = PerlIO_get_bufsiz(aTHX_ IoIFP(io));
- s = (STDCHAR *) PerlIO_get_base(aTHX_ IoIFP(io));
+ len = PerlIO_get_bufsiz(IoIFP(io));
+ s = (STDCHAR *) PerlIO_get_base(IoIFP(io));
/* sfio can have large buffers - limit to 512 */
if (len > 512)
len = 512;
/* Here is some breathtakingly efficient cheating */
- cnt = PerlIO_get_cnt(aTHX_ fp); /* get count into register */
+ cnt = PerlIO_get_cnt(fp); /* get count into register */
(void)SvPOK_only(sv); /* validate pointer */
if (SvLEN(sv) - append <= cnt + 1) { /* make sure we have the room */
if (cnt > 80 && SvLEN(sv) > append) {
else
shortbuffered = 0;
bp = (STDCHAR*)SvPVX(sv) + append; /* move these two too to registers */
- ptr = (STDCHAR*)PerlIO_get_ptr(aTHX_ fp);
+ ptr = (STDCHAR*)PerlIO_get_ptr(fp);
DEBUG_P(PerlIO_printf(Perl_debug_log,
"Screamer: entering, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
DEBUG_P(PerlIO_printf(Perl_debug_log,
"Screamer: entering: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
- (long)PerlIO_get_ptr(aTHX_ fp), (long)PerlIO_get_cnt(aTHX_ fp),
- (long)(PerlIO_has_base(fp) ? PerlIO_get_base(aTHX_ fp) : 0)));
+ (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp),
+ (long)(PerlIO_has_base(fp) ? PerlIO_get_base(fp) : 0)));
for (;;) {
screamer:
if (cnt > 0) {
DEBUG_P(PerlIO_printf(Perl_debug_log,
"Screamer: going to getc, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
- PerlIO_set_ptrcnt(aTHX_ fp, ptr, cnt); /* deregisterize cnt and ptr */
+ PerlIO_set_ptrcnt(fp, ptr, cnt); /* deregisterize cnt and ptr */
DEBUG_P(PerlIO_printf(Perl_debug_log,
"Screamer: pre: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
- (long)PerlIO_get_ptr(aTHX_ fp), (long)PerlIO_get_cnt(aTHX_ fp),
- (long)(PerlIO_has_base (fp) ? PerlIO_get_base(aTHX_ fp) : 0)));
+ (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp),
+ (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
/* This used to call 'filbuf' in stdio form, but as that behaves like
getc when cnt <= 0 we use PerlIO_getc here to avoid introducing
another abstraction. */
i = PerlIO_getc(fp); /* get more characters */
DEBUG_P(PerlIO_printf(Perl_debug_log,
"Screamer: post: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
- (long)PerlIO_get_ptr(aTHX_ fp), (long)PerlIO_get_cnt(aTHX_ fp),
- (long)(PerlIO_has_base (fp) ? PerlIO_get_base(aTHX_ fp) : 0)));
- cnt = PerlIO_get_cnt(aTHX_ fp);
- ptr = (STDCHAR*)PerlIO_get_ptr(aTHX_ fp); /* reregisterize cnt and ptr */
+ (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp),
+ (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+ cnt = PerlIO_get_cnt(fp);
+ ptr = (STDCHAR*)PerlIO_get_ptr(fp); /* reregisterize cnt and ptr */
DEBUG_P(PerlIO_printf(Perl_debug_log,
"Screamer: after getc, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
cnt += shortbuffered;
DEBUG_P(PerlIO_printf(Perl_debug_log,
"Screamer: quitting, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
- PerlIO_set_ptrcnt(aTHX_ fp, ptr, cnt); /* put these back or we're in trouble */
+ PerlIO_set_ptrcnt(fp, ptr, cnt); /* put these back or we're in trouble */
DEBUG_P(PerlIO_printf(Perl_debug_log,
"Screamer: end: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
- (long)PerlIO_get_ptr(aTHX_ fp), (long)PerlIO_get_cnt(aTHX_ fp),
- (long)(PerlIO_has_base (fp) ? PerlIO_get_base(aTHX_ fp) : 0)));
+ (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp),
+ (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
*bp = '\0';
SvCUR_set(sv, bp - (STDCHAR*)SvPVX(sv)); /* set length */
DEBUG_P(PerlIO_printf(Perl_debug_log,