#ifdef PERLIO_IS_STDIO
void
-PerlIO_init()
+PerlIO_init(void)
{
/* Does nothing (yet) except force this file to be included
in perl binary. That allows this file to force inclusion
#undef PerlIO_tmpfile
PerlIO *
-PerlIO_tmpfile()
+PerlIO_tmpfile(void)
{
return tmpfile();
}
sfset(sfstdout,SF_SHARE,0);
}
-#else
+#else /* USE_SFIO */
/* Implement all the PerlIO interface using stdio.
- this should be only file to include <stdio.h>
return fgetname(f,buf);
#else
croak("Don't know how to get file name");
+ return NULL;
#endif
}
#ifdef HAS_SETLINEBUF
setlinebuf(f);
#else
+# ifdef __BORLANDC__ /* Borland doesn't like NULL size for _IOLBF */
+ setvbuf(f, Nullch, _IOLBF, BUFSIZ);
+# else
setvbuf(f, Nullch, _IOLBF, 0);
+# endif
#endif
}
PerlIO *f;
int ch;
{
- putc(ch,f);
+ return putc(ch,f);
}
#undef PerlIO_ungetc
PerlIO *f;
int ch;
{
- ungetc(ch,f);
+ return ungetc(ch,f);
}
#undef PerlIO_read
-int
+SSize_t
PerlIO_read(f,buf,count)
PerlIO *f;
void *buf;
-size_t count;
+Size_t count;
{
return fread(buf,1,count,f);
}
#undef PerlIO_write
-int
+SSize_t
PerlIO_write(f,buf,count)
PerlIO *f;
const void *buf;
-size_t count;
+Size_t count;
{
return fwrite1(buf,1,count,f);
}
#undef PerlIO_printf
int
-#ifdef I_STDARG
PerlIO_printf(PerlIO *f,const char *fmt,...)
-#else
-PerlIO_printf(f,fmt,va_alist)
-PerlIO *f;
-const char *fmt;
-va_dcl
-#endif
{
va_list ap;
int result;
-#ifdef I_STDARG
va_start(ap,fmt);
-#else
- va_start(ap);
-#endif
result = vfprintf(f,fmt,ap);
va_end(ap);
return result;
#undef PerlIO_stdoutf
int
-#ifdef I_STDARG
PerlIO_stdoutf(const char *fmt,...)
-#else
-PerlIO_stdoutf(fmt, va_alist)
-const char *fmt;
-va_dcl
-#endif
{
va_list ap;
int result;
-#ifdef I_STDARG
va_start(ap,fmt);
-#else
- va_start(ap);
-#endif
result = PerlIO_vprintf(PerlIO_stdout(),fmt,ap);
va_end(ap);
return result;
#if (defined(PERLIO_IS_STDIO) || !defined(USE_SFIO)) && !defined(HAS_VPRINTF)
int
-vprintf(fd, pat, args)
+vprintf(pat, args)
+char *pat, *args;
+{
+ _doprnt(pat, args, stdout);
+ return 0; /* wrong, but perl doesn't use the return value */
+}
+
+int
+vfprintf(fd, pat, args)
FILE *fd;
char *pat, *args;
{
#ifndef PerlIO_vsprintf
int
-PerlIO_vsprintf(s,n,fmt,ap)
-char *s;
-const char *fmt;
-int n;
-va_list ap;
+PerlIO_vsprintf(char *s, int n, const char *fmt, va_list ap)
{
int val = vsprintf(s, fmt, ap);
if (n >= 0)
#ifndef PerlIO_sprintf
int
-#ifdef I_STDARG
PerlIO_sprintf(char *s, int n, const char *fmt,...)
-#else
-PerlIO_sprintf(s, n, fmt, va_alist)
-char *s;
-int n;
-const char *fmt;
-va_dcl
-#endif
{
va_list ap;
int result;
-#ifdef I_STDARG
va_start(ap,fmt);
-#else
- va_start(ap);
-#endif
result = PerlIO_vsprintf(s, n, fmt, ap);
va_end(ap);
return result;