Hi Bruno

I believe I did this earlier and sent you some patches, back in early October 
this year and from my company email account (schm...@hp.com), in connection 
with getting ACL support to work for HP-NonStop.

Anyway, here it goes, it is not finished, but I'm not sure how to go forward. 
'make check' reports 4 failures, due to failed assertions:
/usr/local/Floss/testdir-stdioext/gltests/test-freadable.c:52: assertion failed
/usr/local/Floss/testdir-stdioext/gltests/test-freading.c:48: assertion failed
/usr/local/Floss/testdir-stdioext/gltests/test-fwritable.c:41: assertion failed
/usr/local/Floss/testdir-stdioext/gltests/test-fwriting.c:41: assertion failed
And this is because I 'forced' them thru the compiler... but see the attached 
diff. The Problem is I don't know that the proper values for _IORW, _IOREAD, 
_IOWRT are, for _IOERR I believe to have found it to be 64 on our platform by 
experiment. I found no hints in stdio.h about these (attached too, in the hope 
you can see something there)

Bye, Jojo

-----Original Message-----
From: Bruno Haible [mailto:br...@clisp.org] 
Sent: Tuesday, December 21, 2010 9:10 PM
To: bug-gnulib@gnu.org
Cc: Eric Blake; Joachim Schmitz; Chet Ramey
Subject: Re: [bash-testers] Bash-4.2-beta available for FTP

[removing bash-testers]

Hello Joachim,

> > "/usr/local/Floss/bash-4.2-beta/lib/sh/fpurge.c", line 143: warning(1852):
> >           #warning directive: "Please port gnulib fpurge.c to your platform!
> >           Look at the definitions of fflush, setvbuf and ungetc on your
> >           system, then report this to bug-gnulib."
> 
> Can you help us fix the upstream copy of fpurge.c in gnulib to 
> appropriately cover your platform?  We would also like to port the 
> other FILE wrapper functions to work with your platform

fpurge is part of a family of functions that are best ported together.
To do so, please fetch
  http://www.haible.de/bruno/gnu/testdir-stdioext.tar.gz
then
  - Unpack the package, configure it. Try "make" and fix the problems.
  - Run "make check" to see the test results.
  - The recommended order of porting (from easy to harder) is:
    fbufmode, fseterr, freadable, fwritable, freading, fwriting,
    fpending, fpurge, freadptr, freadseek, freadahead.
It requires a deep look at the 'struct FILE' and related macros from <stdio.h>.

Please use "#if defined __TANDEM" as condition for your added code (see 
<http://predef.sourceforge.net/preos.html#sec28>).

Bruno

Attachment: testdir-stdioext.diff
Description: Binary data

#ifdef __TANDEM
#pragma columns 80
#if _TANDEM_ARCH_ != 0
#pragma ONCE
#endif
#endif
#ifndef _STDIO
#define _STDIO

/* T8645H02 - (21MAY2008) - stdio.h   standard input/output definitions */
/* T8645G08^AAX - (10MAY2007)                                           */

/*
 *  Copyright 2008 Hewlett Packard Development Company, L.P.
 *
 *     ALL RIGHTS RESERVED
 */

#if (_TANDEM_ARCH_ == 1 && __G_Series_RVU < 629 || \
     _TANDEM_ARCH_ == 2 && __H_Series_RVU < 606) && \
        (_FILE_OFFSET_BITS == 64 || _LARGEFILE64_SOURCE == 1)
   #error 64-bit functions not available for target RVU
#endif /* 64-bit functions requested when not available */

#ifdef __cplusplus
   extern "C" {
#endif

#ifdef __OLDCALLS                      /* TNS C legacy header */
#pragma nooldcalls
#define REVERT_TO_OLDCALLS
#endif


#ifndef NULL
#if defined(_GUARDIAN_TARGET) && defined(__XMEM)
#define NULL   0L
#else
#define NULL   0
#endif
#endif /* NULL */

#ifndef __size_t_DEFINED
#define __size_t_DEFINED
#if _TANDEM_ARCH_ != 0 || !defined(__TANDEM)
typedef unsigned int   size_t;
#else /* _TANDEM_ARCH_ == 0 */
#if !defined(_GUARDIAN_TARGET) || defined(__XMEM)
typedef unsigned long  size_t;
#else
typedef unsigned short size_t;
#endif
#endif /* _TANDEM_ARCH_ == 0 */
#endif /* __size_t_DEFINED */

#ifndef __va_list_DEFINED
#define __va_list_DEFINED
#if _TANDEM_ARCH_ == 2 || _TANDEM_ARCH_ == 1
typedef char *va_list;
#else  /* _TANDEM_ARCH_ == 0 */
typedef int  *va_list;
#endif /* _TANDEM_ARCH_ == 0 */
#endif /* __va_list_DEFINED */

#ifdef __TANDEM
typedef long long fpos_t;
#else
typedef unsigned  fpos_t;
#endif

#if _LARGEFILE64_SOURCE == 1 && _TANDEM_ARCH_ != 0
typedef long long fpos64_t;
#endif

#ifndef __off_t_DEFINED
#define __off_t_DEFINED
#if _FILE_OFFSET_BITS == 64 && _TANDEM_ARCH_ != 0
typedef long long       off_t;          /* file offset (signed integer) */
#else  /* _FILE_OFFSET_BITS != 64 || _TANDEM_ARCH_ != 0 */
typedef long            off_t;          /* file offset (signed integer) */
#endif /* _FILE_OFFSET_BITS != 64 || _TANDEM_ARCH_ != 0 */

#if _LARGEFILE64_SOURCE == 1 && _TANDEM_ARCH_ != 0
typedef long long       off64_t;       /* file offset (signed integer) */
#endif
#endif /* __off_t_DEFINED */

#ifdef __TANDEM
#pragma fieldalign shared8 FILE
#endif

#if _TANDEM_ARCH_ != 0 || !defined(_GUARDIAN_TARGET)

typedef struct FILE {
long           _signature;
int            _cnt;
unsigned char *_ptr;
unsigned char *_base;
int            _bufsiz;
short          _flag;
short          _file;
void          *_unused;
void          *_lock;
char          *__newbase;
unsigned char *_bufendp;
int           *_OFTE_ptr;
} FILE;

#else /* _TANDEM_ARCH_ == 0 && _GUARDIAN_TARGET */

typedef struct FILE {
long           _signature;
short          contents[12];
} FILE;

#endif /* _TANDEM_ARCH_ == 0 && _GUARDIAN_TARGET */

FILE *__stdio_fp (short);

#define stdin   __stdio_fp(0)
#define stdout  __stdio_fp(1)
#define stderr  __stdio_fp(2)

#if _TANDEM_ARCH_ != 0
#define BUFSIZ    4096
#else
#define BUFSIZ    1024
#endif
#define EOF       (-1)

#if defined(_TANDEM_SOURCE) && defined(_GUARDIAN_TARGET)
#define OPEN_MAX  25            /* Max number of open files */
#define NAME_MAX  35            /* Max length of a Guardian file name */
#define FCHR_MAX  2147483647L   /* Max number of bytes in a file */
#endif /* _TANDEM_SOURCE && _GUARDIAN_TARGET */

#ifndef SEEK_SET
#define SEEK_SET  0
#endif

#ifndef SEEK_CUR
#define SEEK_CUR  1
#endif

#ifndef SEEK_END
#define SEEK_END  2
#endif

#define _IOFBF 0                  /*                     */
#define _IOLBF 1                  /* setvbuf() constants */
#define _IONBF 2                  /*                     */

#define FOPEN_MAX    25

#ifdef _GUARDIAN_TARGET
#define FILENAME_MAX  35          /* Maximum length of a Guardian file name */
#define L_tmpnam     9
#ifndef TMP_MAX         /* Acquired from limits.h */
#define TMP_MAX      100
#endif
#else /* open target */
#define FILENAME_MAX  248         /* Maximum length of an OSS file name */
#ifdef _XOPEN_SOURCE
#define P_tmpdir "/tmp/"
#define L_tmpnam  (sizeof(P_tmpdir) + 15)
#else
#define _P_tmpdir "/tmp/"
#define L_tmpnam  (sizeof(_P_tmpdir) + 15)
#endif
#ifndef TMP_MAX         /* Acquired from limits.h */
#define TMP_MAX      27576
#endif
#endif /* _GUARDIAN_TARGET */

int getchar (void);
int putchar (int);
#define getchar()   getc(stdin)
#define putchar(c)  putc((c), stdout)

#ifdef _TANDEM_SOURCE
#ifdef _GUARDIAN_TARGET
#if _TANDEM_ARCH_ != 0 || defined(__XMEM)
int    edfseek(FILE *, long, int);
long   edftell(FILE *);
short  fopen_std_file(short, short, char *);
#if _TANDEM_ARCH_ != 0
#if _LARGEFILE64_SOURCE == 1
short  fopen64_std_file(short, short, char *);
#pragma function fopen64_std_file (extensible, tal)
#endif /* _LARGEFILE64_SOURCE == 1 */
#if _FILE_OFFSET_BITS == 64
   #pragma function fopen_std_file  (alias("fopen64_std_file"), extensible, tal)
#else  /* _FILE_OFFSET_BITS != 64 */
   #pragma function fopen_std_file  (extensible, tal)
#endif /* _FILE_OFFSET_BITS != 64 */
#else  /* _TANDEM_ARCH_ == 0 */
#pragma function fopen_std_file  (alias("C_OPEN_STD_FILE_"), extensible, tal)
#endif /* _TANDEM_ARCH_ == 0 */
#else /* small model TNS C */
int    edfseek(FILE _far *, long, int);
long   edftell(FILE _far *);
short  fopen_std_file(short, short, char _far *);
#pragma function fopen_std_file  (alias("C_OPEN_STD_FILE_"), extensible, tal)
#endif /* small model TNS C */
#endif /* _GUARDIAN_TARGET */

#if _TANDEM_ARCH_ == 0            /* TNS C (all models) */
void   fcloseall(void);
#define setnbuf(fp) setbuf(fp, 0L)
#endif /* _TANDEM_ARCH_ == 0 */
#endif /* _TANDEM_SOURCE */

int    printf(const char *, ...);
int    fprintf(FILE *, const char *, ...);
int    sprintf(char *, const char *, ...);
int    vprintf(const char *, va_list);
int    vfprintf(FILE *, const char *, va_list);
int    vsprintf(char *, const char *, va_list);
int    scanf(const char *, ...);
int    fscanf(FILE *, const char *, ...);
int    sscanf(const char *, const char *, ...);
void   perror(const char *);
#if _TANDEM_ARCH_ != 0
int    snprintf(char *, size_t, const char *, ...);
int    vsnprintf(char *, size_t, const char *, va_list);
#endif /* _TANDEM_ARCH_ != 0 */
#if _TANDEM_ARCH_ == 1 && __G_Series_RVU >= 630 || \
    _TANDEM_ARCH_ == 2 && __H_Series_RVU >= 608
int    vfscanf(FILE *, const char *, va_list);
int    vscanf (const char *, va_list);
int    vsscanf(const char *, const char *, va_list);
#endif /* __G_Series_RVU >= 630 || __H_Series_RVU >= 608 */

#if !defined(_GUARDIAN_TARGET) || defined(__XMEM)
/*
 * OSS and Guardian (wide-model and large-model)
 */
void   clearerr(FILE *);
int    fclose(FILE *);
int    feof(FILE *);
int    ferror(FILE *);
int    fflush(FILE *);
int    fgetc(FILE *);
int    fgetpos(FILE *, fpos_t *);
char  *fgets(char *, int, FILE *);
FILE  *fopen(const char *, const char *);
int    fputc(int, FILE *);
int    fputs(const char *, FILE *);
size_t fread(void *, size_t, size_t, FILE *);
FILE  *freopen(const char *, const char *, FILE *);
int    fseek(FILE *, long, int);
int    fsetpos(FILE *, const fpos_t *);
long   ftell(FILE *);
size_t fwrite(const void *, size_t, size_t, FILE *);
int    getc(FILE *);
char  *gets(char *);
int    putc(int, FILE *);
int    puts(const char *);
void   setbuf(FILE *, char *);
int    setvbuf(FILE *, char *, int, size_t);
int    remove(const char *);
int    rename(const char *, const char *);
void   rewind(FILE *);
FILE  *tmpfile(void);
char  *tmpnam(char *);
int    ungetc(int, FILE *);

#if _TANDEM_ARCH_ != 0
#if _LARGEFILE64_SOURCE == 1 || _FILE_OFFSET_BITS == 64 || \
    defined(_TANDEM_SOURCE)
int     fseeko(FILE *, off_t, int);
off_t   ftello(FILE *);
#if _LARGEFILE64_SOURCE == 1
int     fgetpos64(FILE *, fpos64_t *);
FILE   *fopen64  (const char *, const char *);
FILE   *freopen64(const char *, const char *, FILE *);
int     fseeko64 (FILE *, off64_t, int);
int     fsetpos64(FILE *, const fpos64_t *);
off64_t ftello64 (FILE *);
FILE   *tmpfile64(void);
#endif /* _LARGEFILE64_SOURCE == 1 */

#if _FILE_OFFSET_BITS == 64
   #pragma function fgetpos  (alias("fgetpos64"), unspecified)
   #pragma function fopen    (alias("fopen64")  , unspecified)
   #pragma function freopen  (alias("freopen64"), unspecified)
   #pragma function fseeko   (alias("fseeko64") , unspecified)
   #pragma function fsetpos  (alias("fsetpos64"), unspecified)
   #pragma function ftello   (alias("ftello64") , unspecified)
   #pragma function tmpfile  (alias("tmpfile64"), unspecified)
#else  /* _FILE_OFFSET_BITS != 64 */
   #pragma function fseeko   (alias("fseek"), unspecified)
   #pragma function ftello   (alias("ftell"), unspecified)
#endif /* _FILE_OFFSET_BITS != 64 */
#endif /* _LARGEFILE64_SOURCE == 1 || ... || _TANDEM_SOURCE */
#endif /* _TANDEM_ARCH_ != 0 */

#if defined(_POSIX_SOURCE) || _POSIX_C_SOURCE == 1 || \
    defined(_XOPEN_SOURCE) || _POSIX_C_SOURCE == 2 || \
    defined(_TANDEM_SOURCE)
FILE  *fdopen(int, const char *);
int    fileno(FILE *);
#if defined(_TANDEM_SOURCE) && (_TANDEM_ARCH_ != 0 || !defined(__TANDEM))
int    gfileno(FILE *);
#endif
#endif /* _POSIX_SOURCE || ... || _XOPEN_SOURCE || _TANDEM_SOURCE */

#endif /* !_GUARDIAN_TARGET || __XMEM */

#if _TANDEM_ARCH_ != 0 || defined(__INT32)
#ifdef _TANDEM_SOURCE
FILE *fopen_guardian  (const char *, const char *);
FILE *fopen_oss       (const char *, const char *);
FILE *freopen_guardian(const char *, const char *, FILE *);
FILE *freopen_oss     (const char *, const char *, FILE *);
int   remove_guardian (const char *);
int   remove_oss      (const char *);
int   rename_guardian (const char *, const char *);
int   rename_oss      (const char *, const char *);
FILE *tmpfile_guardian(void);
FILE *tmpfile_oss     (void);
char *tmpnam_guardian (char *);
char *tmpnam_oss      (char *);
#if _TANDEM_ARCH_ != 0
#if _LARGEFILE64_SOURCE == 1
FILE *fopen64_guardian  (const char *, const char *);
FILE *fopen64_oss       (const char *, const char *);
FILE *freopen64_guardian(const char *, const char *, FILE *);
FILE *freopen64_oss     (const char *, const char *, FILE *);
FILE *tmpfile64_guardian(void);
FILE *tmpfile64_oss   (void);
#endif /* _LARGEFILE64_SOURCE == 1 */

#if _FILE_OFFSET_BITS == 64
   #pragma function fopen_guardian    (alias("fopen64_guardian")  , unspecified)
   #pragma function fopen_oss         (alias("fopen64_oss")       , unspecified)
   #pragma function freopen_guardian  (alias("freopen64_guardian"), unspecified)
   #pragma function freopen_oss       (alias("freopen64_oss")     , unspecified)
   #pragma function tmpfile_guardian  (alias("tmpfile64_guardian"), unspecified)
   #pragma function tmpfile_oss       (alias("tmpfile64_oss")     , unspecified)
#endif /* _FILE_OFFSET_BITS == 64 */
#endif /* _TANDEM_ARCH_ != 0 */
#endif /* _TANDEM_SOURCE */

#ifdef __TANDEM
#if _TANDEM_ARCH_ != 0
#if !defined(_EMBEDDED) && !defined(_LIBSPACE)
#pragma function rename           (alias("rename_dynamic"), unspecified)
#endif
#ifdef _TANDEM_SOURCE
#pragma function rename_oss       (alias("rename"), unspecified)
#endif /* _TANDEM_SOURCE */
#else  /* _TANDEM_ARCH_ == 0 */
#ifdef _TANDEM_SOURCE
#pragma function fopen_guardian   (alias("C_LG_FOPEN_"),     unspecified)
#pragma function fopen_oss        (alias("_C_PX_fopen_"),    unspecified)
#pragma function freopen_guardian (alias("C_LG_FREOPEN_"),   unspecified)
#pragma function freopen_oss      (alias("_C_PX_freopen_"),  unspecified)
#pragma function remove_guardian  (alias("C_REMOVE_32_"),    unspecified)
#pragma function remove_oss       (alias("_C_PX_remove_"),   unspecified)
#pragma function rename_guardian  (alias("C_RENAME_32_"),    unspecified)
#pragma function rename_oss       (alias("PXFS_FILE_RENAME_"),       tal)
#pragma function tmpfile_guardian (alias("C_LG_TMPFILE_"),   unspecified)
#pragma function tmpfile_oss      (alias("_C_PX_tmpfile_"),  unspecified)
#pragma function tmpnam_guardian  (alias("C_LG_TMPNAM_"),    unspecified)
#pragma function tmpnam_oss       (alias("_C_PX_tmpnam_"),   unspecified)
#endif /* _TANDEM_SOURCE */
#endif /* _TANDEM_ARCH_ == 0 */
#endif /* __TANDEM */
#endif /* _TANDEM_ARCH_ != 0 || __INT32 */

#if defined(_POSIX_SOURCE) || _POSIX_C_SOURCE == 1 || \
    defined(_XOPEN_SOURCE) || _POSIX_C_SOURCE == 2
#define L_ctermid    9
char *ctermid(char *);

#if _TANDEM_ARCH_ != 0
#define L_cuserid    33
char   *cuserid(char *);
#endif

#endif /* _POSIX_SOURCE || ... || _XOPEN_SOURCE */

#if defined(_XOPEN_SOURCE) || _POSIX_C_SOURCE == 2
int   pclose(FILE *);
FILE *popen(const char *, const char *);
#endif /* _XOPEN_SOURCE || _POSIX_C_SOURCE == 2 */

#ifdef _XOPEN_SOURCE
#ifndef _GUARDIAN_TARGET
int   getw(FILE *);
int   putw(int, FILE *);
#endif
char *tempnam(const char *, const char *);
#endif /* _XOPEN_SOURCE */

/*
 * TNS C aliases and attributes
 */
#if defined(__TANDEM) && _TANDEM_ARCH_ == 0
#ifdef _GUARDIAN_TARGET
#ifdef __XMEM
#ifdef __INT32
/*
 * Wide Model
 */
#ifdef _INTEROPERABLE
#pragma function __stdio_fp    (alias("C_INT_LG_STDIO_FP_"), unspecified)
#pragma function clearerr      (alias("_C_HB_clearerr_"),  unspecified)
#pragma function fclose        (alias("_C_HB_fclose_"),    unspecified)
#pragma function feof          (alias("_C_HB_feof_"),      unspecified)
#pragma function ferror        (alias("_C_HB_ferror_"),    unspecified)
#pragma function fflush        (alias("_C_HB_fflush_"),    unspecified)
#pragma function fgetc         (alias("_C_HB_fgetc_"),     unspecified)
#pragma function fgetpos       (alias("_C_HB_fgetpos_"),   unspecified)
#pragma function fgets         (alias("_C_HB_fgets_"),     unspecified)
#if defined(_POSIX_SOURCE) || _POSIX_C_SOURCE == 1 || \
    defined(_XOPEN_SOURCE) || _POSIX_C_SOURCE == 2 || \
    defined(_TANDEM_SOURCE)
#pragma function fdopen        (alias("_C_HB_fdopen_"),    unspecified)
#pragma function fileno        (alias("_C_HB_fileno_"),    unspecified)
#endif /* _POSIX_SOURCE || ... || _XOPEN_SOURCE || _TANDEM_SOURCE */
#pragma function fopen         (alias("C_LG_FOPEN_"),      unspecified)
#pragma function fprintf       (alias("_C_HB_fprintf_"),   c)
#pragma function fputc         (alias("_C_HB_fputc_"),     unspecified)
#pragma function fputs         (alias("_C_HB_fputs_"),     unspecified)
#pragma function fread         (alias("_C_HB_fread_"),     unspecified)
#pragma function freopen       (alias("C_LG_FREOPEN_"),    tal)
#pragma function fscanf        (alias("_C_HB_fscanf_"),    c)
#pragma function fseek         (alias("_C_HB_fseek_"),     unspecified)
#pragma function fsetpos       (alias("_C_HB_fsetpos_"),   unspecified)
#pragma function ftell         (alias("_C_HB_ftell_"),     unspecified)
#pragma function fwrite        (alias("_C_HB_fwrite_"),    unspecified)
#pragma function getc          (alias("_C_HB_getc_"),      unspecified)
#pragma function gets          (alias("_C_HB_gets_"),      unspecified)
#pragma function printf        (alias("_C_HB_printf_"),    c)
#pragma function putc          (alias("_C_HB_putc_"),      unspecified)
#pragma function puts          (alias("_C_HB_puts_"),      unspecified)
#pragma function remove        (alias("C_REMOVE_32_"),     tal)
#pragma function rename        (alias("C_RENAME_32_"),     unspecified)
#pragma function rewind        (alias("_C_HB_rewind_"),    unspecified)
#pragma function scanf         (alias("_C_HB_scanf_"),     c)
#pragma function setbuf        (alias("_C_HB_setbuf_"),    unspecified)
#pragma function setvbuf       (alias("_C_HB_setvbuf_"),   unspecified)
#pragma function tmpfile       (alias("C_LG_TMPFILE_"),    unspecified)
#pragma function tmpnam        (alias("C_LG_TMPNAM_"),     unspecified)
#pragma function ungetc        (alias("_C_HB_ungetc_"),    unspecified)
#pragma function vfprintf      (alias("_C_HB_vfprintf_"),  c)
#pragma function vprintf       (alias("_C_HB_vprintf_"),   c)
#ifdef _TANDEM_SOURCE
#pragma function edfseek       (alias("C_EDFSEEK_32_"),    tal)
#pragma function edftell       (alias("C_EDFTELL_"),       tal)
#pragma function fcloseall     (alias("C_FCLOSEALL_"),     tal)
#endif /* _TANDEM_SOURCE */
#else /* not interoperable */
#pragma function __stdio_fp    (alias("C_INT_LG_STDIO_FP_"), tal)
#pragma function clearerr      (alias("C_CLEARERR_"),      tal)
#pragma function fclose        (alias("C_FCLOSE_32_"),     tal)
#pragma function feof          (alias("C_FEOF_32_"),       tal)
#pragma function ferror        (alias("C_FERROR_32_"),     tal)
#pragma function fflush        (alias("C_FFLUSH_32_"),     tal)
#pragma function fgetc         (alias("C_FGETC_32_"),      tal)
#pragma function fgetpos       (alias("C_FGETPOS_32_"),    tal)
#pragma function fgets         (alias("C_LG_FGETS_32_"),   tal)
#if defined(_POSIX_SOURCE) || _POSIX_C_SOURCE == 1 || \
    defined(_XOPEN_SOURCE) || _POSIX_C_SOURCE == 2 || \
    defined(_TANDEM_SOURCE)
#pragma function fdopen        (alias ("C_LG_FDOPEN_32_"), tal)
#pragma function fileno        (alias ("C_FILENO_32_"),    tal)
#endif /* _POSIX_SOURCE || ... || _XOPEN_SOURCE || _TANDEM_SOURCE */
#pragma function fopen         (alias ("C_LG_FOPEN_"),     tal)
#pragma function fprintf       (alias ("_C_LG_fprintf_32_"), c)
#pragma function fputc         (alias ("C_FPUTC_32_"),     tal)
#pragma function fputs         (alias ("C_FPUTS_32_"),     tal)
#pragma function fread         (alias ("C_LG_FREAD_"),     tal)
#pragma function freopen       (alias ("C_LG_FREOPEN_"),   tal)
#pragma function fscanf        (alias ("_C_LG_fscanf_32_"),  c)
#pragma function fseek         (alias ("C_FSEEK_32_"),     tal)
#pragma function fsetpos       (alias ("C_FSETPOS_32_"),   tal)
#pragma function ftell         (alias ("C_FTELL_"),        tal)
#pragma function fwrite        (alias ("C_LG_FWRITE_"),    tal)
#pragma function getc          (alias ("C_GETC_32_"),      tal)
#pragma function gets          (alias ("C_LG_GETS_"),      tal)
#pragma function printf        (alias ("_C_LG_printf_32_"),  c)
#pragma function putc          (alias ("C_PUTC_32_"),      tal)
#pragma function puts          (alias ("C_PUTS_32_"),      tal)
#pragma function remove        (alias ("C_REMOVE_32_"),    tal)
#pragma function rename        (alias ("C_RENAME_32_"),    tal)
#pragma function rewind        (alias ("C_REWIND_"),       tal)
#pragma function scanf         (alias ("_C_LG_scanf_32_"),   c)
#pragma function setbuf        (alias ("C_SETBUF_"),       tal)
#pragma function setvbuf       (alias ("C_LG_SETVBUF_32_"),tal)
#pragma function tmpfile       (alias ("C_LG_TMPFILE_"),   tal)
#pragma function tmpnam        (alias ("C_LG_TMPNAM_"),    tal)
#pragma function ungetc        (alias ("C_UNGETC_32_"),    tal)
#pragma function vfprintf      (alias ("_C_LG_vfprintf_32_"),c)
#pragma function vprintf       (alias ("_C_LG_vprintf_32_"), c)
#ifdef _TANDEM_SOURCE
#pragma function edfseek       (alias ("C_EDFSEEK_32_"),   tal)
#pragma function edftell       (alias ("C_EDFTELL_"),      tal)
#pragma function fcloseall     (alias ("C_FCLOSEALL_"),    tal)
#endif /* _TANDEM_SOURCE */
#endif /* _INTEROPERABLE */
#else
/*
 * Large Model
 */
#pragma function __stdio_fp    (alias("C_INT_LG_STDIO_FP_"), tal)
#pragma function clearerr      (alias("C_CLEARERR_"),      tal)
#pragma function fclose        (alias("C_FCLOSE_"),        tal)
#pragma function feof          (alias("C_FEOF_"),          tal)
#pragma function ferror        (alias("C_FERROR_"),        tal)
#pragma function fflush        (alias("C_FFLUSH_"),        tal)
#pragma function fgetc         (alias("C_FGETC_"),         tal)
#pragma function fgetpos       (alias("C_FGETPOS_"),       tal)
#pragma function fgets         (alias("C_LG_FGETS_"),      tal)
#if defined(_POSIX_SOURCE) || _POSIX_C_SOURCE == 1 || \
    defined(_XOPEN_SOURCE) || _POSIX_C_SOURCE == 2 || \
    defined(_TANDEM_SOURCE)
#pragma function fdopen        (alias("C_LG_FDOPEN_"),     tal)
#pragma function fileno        (alias("C_FILENO_"),        tal)
#endif /* _POSIX_SOURCE || ... || _XOPEN_SOURCE || _TANDEM_SOURCE */
#pragma function fopen         (alias("C_LG_FOPEN_"),      tal)
#pragma function fprintf       (alias("_C_LG_fprintf_"),   c)
#pragma function fputc         (alias("C_FPUTC_"),         tal)
#pragma function fputs         (alias("C_FPUTS_"),         tal)
#pragma function fread         (alias("C_LG_FREAD_"),      tal)
#pragma function freopen       (alias("C_LG_FREOPEN_"),    tal)
#pragma function fscanf        (alias("_C_LG_fscanf_"),    c)
#pragma function fseek         (alias("C_FSEEK_"),         tal)
#pragma function fsetpos       (alias("C_FSETPOS_"),       tal)
#pragma function ftell         (alias("C_FTELL_"),         tal)
#pragma function fwrite        (alias("C_LG_FWRITE_"),     tal)
#pragma function getc          (alias("C_GETC_"),          tal)
#pragma function gets          (alias("C_LG_GETS_"),       tal)
#pragma function printf        (alias("_C_LG_printf_"),    c)
#pragma function putc          (alias("C_PUTC_"),          tal)
#pragma function puts          (alias("C_PUTS_"),          tal)
#pragma function remove        (alias("C_REMOVE_"),        tal)
#pragma function rename        (alias("C_RENAME_"),        tal)
#pragma function rewind        (alias("C_REWIND_"),        tal)
#pragma function scanf         (alias("_C_LG_scanf_"),     c)
#pragma function setbuf        (alias("C_SETBUF_"),        tal)
#pragma function setvbuf       (alias("C_LG_SETVBUF_"),    tal)
#pragma function tmpfile       (alias("C_LG_TMPFILE_"),    tal)
#pragma function tmpnam        (alias("C_LG_TMPNAM_"),     tal)
#pragma function ungetc        (alias("C_UNGETC_"),        tal)
#pragma function vfprintf      (alias("_C_LG_vfprintf_"),  c)
#pragma function vprintf       (alias("_C_LG_vprintf_"),   c)
#ifdef _TANDEM_SOURCE
#pragma function edfseek       (alias("C_EDFSEEK_"),       tal)
#pragma function edftell       (alias("C_EDFTELL_"),       tal)
#pragma function fcloseall     (alias("C_FCLOSEALL_"),     tal)
#endif /* _TANDEM_SOURCE */
#endif
#else
/*
 * Small Model
 */
void   clearerr(FILE _far *);
int    fclose(FILE _far *);
FILE  *fdopen(int, const char _far *);
int    feof(FILE _far *);
int    ferror(FILE _far *);
int    fflush(FILE _far *);
int    fgetc(FILE _far *);
int    fgetpos(FILE _far *, fpos_t _far *);
char  *fgets(char _far *, int, FILE _far *);
int    fileno(FILE _far *);
FILE  *fopen(const char _far *, const char _far *);
int    fputc(int, FILE _far *);
int    fputs(const char _far *, FILE _far *);
size_t fread(void _far *, size_t, size_t, FILE _far *);
FILE  *freopen(const char _far *, const char _far *, FILE _far *);
int    fseek(FILE _far *, long, int);
int    fsetpos(FILE _far *, const fpos_t _far *);
long   ftell(FILE _far *);
size_t fwrite(const void _far *, size_t, size_t, FILE _far *);
int    getc(FILE _far *);
char  *gets(char _far *);
int    putc(int, FILE _far *);
int    puts(const char _far *);
int    remove(const char _far *);
int    rename(const char _far *, const char _far *);
void   rewind(FILE _far *);
void   setbuf(FILE _far *, char _far *);
int    setvbuf(FILE _far *, char _far *, int, size_t);
FILE  *tmpfile(void);
char  *tmpnam(char _far *);
int    ungetc(int, FILE _far *);
#pragma function __stdio_fp    (alias("C_INT_SM_STDIO_FP_"), tal)
#pragma function clearerr      (alias("C_CLEARERR_"),        tal)
#pragma function edfseek       (alias("C_EDFSEEK_"),         tal)
#pragma function edftell       (alias("C_EDFTELL_"),         tal)
#pragma function fclose        (alias("C_FCLOSE_"),          tal)
#pragma function fcloseall     (alias("C_FCLOSEALL_"),       tal)
#pragma function fdopen        (alias("C_SM_FDOPEN_"),       tal)
#pragma function feof          (alias("C_FEOF_"),            tal)
#pragma function ferror        (alias("C_FERROR_"),          tal)
#pragma function fflush        (alias("C_FFLUSH_"),          tal)
#pragma function fgetc         (alias("C_FGETC_"),           tal)
#pragma function fgetpos       (alias("C_FGETPOS_"),         tal)
#pragma function fgets         (alias("C_SM_FGETS_"),        tal)
#pragma function fileno        (alias("C_FILENO_"),          tal)
#pragma function fopen         (alias("C_SM_FOPEN_"),        tal)
#pragma function fprintf       (alias("_C_SM_fprintf_"),     c)
#pragma function fputc         (alias("C_FPUTC_"),           tal)
#pragma function fputs         (alias("C_FPUTS_"),           tal)
#pragma function fread         (alias("C_SM_FREAD_"),        tal)
#pragma function freopen       (alias("C_SM_FREOPEN_"),      tal)
#pragma function fscanf        (alias("_C_SM_fscanf_"),      c)
#pragma function fseek         (alias("C_FSEEK_"),           tal)
#pragma function fsetpos       (alias("C_FSETPOS_"),         tal)
#pragma function printf        (alias("_C_SM_printf_"),        c)
#pragma function scanf         (alias("_C_SM_scanf_"),         c)
#pragma function ftell         (alias("C_FTELL_"),           tal)
#pragma function fwrite        (alias("C_SM_FWRITE_"),       tal)
#pragma function getc          (alias("C_GETC_"),            tal)
#pragma function gets          (alias("C_SM_GETS_"),         tal)
#pragma function putc          (alias("C_PUTC_"),            tal)
#pragma function puts          (alias("C_PUTS_"),            tal)
#pragma function remove        (alias("C_REMOVE_"),          tal)
#pragma function rename        (alias("C_RENAME_"),          tal)
#pragma function rewind        (alias("C_REWIND_"),          tal)
#pragma function setbuf        (alias("C_SETBUF_"),          tal)
#pragma function setvbuf       (alias("C_SM_SETVBUF_"),      tal)
#pragma function tmpfile       (alias("C_SM_TMPFILE_"),      tal)
#pragma function tmpnam        (alias("C_SM_TMPNAM_"),       tal)
#pragma function ungetc        (alias("C_UNGETC_"),          tal)
#pragma function vfprintf      (alias("_C_SM_vfprintf_"),    c)
#pragma function vprintf       (alias("_C_SM_vprintf_"),     c)
#endif
#else
/*
 * OSS
 */
#ifdef _INTEROPERABLE
#pragma function __stdio_fp    (alias("C_INT_LG_STDIO_FP_"), unspecified)
#pragma function clearerr      (alias("_C_HB_clearerr_"), unspecified)
#pragma function fclose        (alias("_C_HB_fclose_"),   unspecified)
#pragma function feof          (alias("_C_HB_feof_"),     unspecified)
#pragma function ferror        (alias("_C_HB_ferror_"),   unspecified)
#pragma function fflush        (alias("_C_HB_fflush_"),   unspecified)
#pragma function fgetc         (alias("_C_HB_fgetc_"),    unspecified)
#pragma function fgetpos       (alias("_C_HB_fgetpos_"),  unspecified)
#pragma function fgets         (alias("_C_HB_fgets_"),    unspecified)
#if defined(_POSIX_SOURCE) || _POSIX_C_SOURCE == 1 || \
    defined(_XOPEN_SOURCE) || _POSIX_C_SOURCE == 2 || \
    defined(_TANDEM_SOURCE)
#pragma function fdopen        (alias("_C_HB_fdopen_"),   unspecified)
#pragma function fileno        (alias("_C_HB_fileno_"),   unspecified)
#endif /* _POSIX_SOURCE || ... || _XOPEN_SOURCE || _TANDEM_SOURCE */
#pragma function fopen         (alias("_C_PX_fopen_"),    unspecified)
#pragma function fprintf       (alias("_C_HB_fprintf_"),            c)
#pragma function fputc         (alias("_C_HB_fputc_"),    unspecified)
#pragma function fputs         (alias("_C_HB_fputs_"),    unspecified)
#pragma function fread         (alias("_C_HB_fread_"),    unspecified)
#pragma function freopen       (alias("_C_PX_freopen_"),  unspecified)
#pragma function fscanf        (alias("_C_HB_fscanf_"),             c)
#pragma function fseek         (alias("_C_HB_fseek_"),    unspecified)
#pragma function fsetpos       (alias("_C_HB_fsetpos_"),  unspecified)
#pragma function ftell         (alias("_C_HB_ftell_"),    unspecified)
#pragma function fwrite        (alias("_C_HB_fwrite_"),   unspecified)
#pragma function getc          (alias("_C_HB_getc_"),     unspecified)
#pragma function gets          (alias("_C_HB_gets_"),     unspecified)
#pragma function printf        (alias("_C_HB_printf_"),             c)
#pragma function putc          (alias("_C_HB_putc_"),     unspecified)
#pragma function puts          (alias("_C_HB_puts_"),     unspecified)
#pragma function remove        (alias("_C_PX_remove_"),   unspecified)
#pragma function rename        (alias("PXFS_FILE_RENAME_"),       tal)
#pragma function rewind        (alias("_C_HB_rewind_"),   unspecified)
#pragma function scanf         (alias("_C_HB_scanf_"),              c)
#pragma function setbuf        (alias("_C_HB_setbuf_"),   unspecified)
#pragma function setvbuf       (alias("_C_HB_setvbuf_"),  unspecified)
#pragma function tmpfile       (alias("_C_PX_tmpfile_"),  unspecified)
#pragma function tmpnam        (alias("_C_PX_tmpnam_"),   unspecified)
#pragma function ungetc        (alias("_C_HB_ungetc_"),   unspecified)
#pragma function vfprintf      (alias("_C_HB_vfprintf_"),           c)
#pragma function vprintf       (alias("_C_HB_vprintf_"),            c)
#else /* not interoperable */
#pragma function __stdio_fp    (alias("C_INT_LG_STDIO_FP_"), unspecified)
#pragma function clearerr      (alias("_C_PX_clearerr_"), unspecified)
#pragma function fclose        (alias("_C_PX_fclose_"),   unspecified)
#pragma function feof          (alias("_C_PX_feof_"),     unspecified)
#pragma function ferror        (alias("_C_PX_ferror_"),   unspecified)
#pragma function fflush        (alias("_C_PX_fflush_"),   unspecified)
#pragma function fgetc         (alias("_C_PX_fgetc_"),    unspecified)
#pragma function fgetpos       (alias("_C_PX_fgetpos_"),  unspecified)
#pragma function fgets         (alias("_C_PX_fgets_"),    unspecified)
#if defined(_POSIX_SOURCE) || _POSIX_C_SOURCE == 1 || \
    defined(_XOPEN_SOURCE) || _POSIX_C_SOURCE == 2 || \
    defined(_TANDEM_SOURCE)
#pragma function fdopen        (alias("_C_PX_fdopen_"),  unspecified)
#pragma function fileno        (alias("_C_PX_fileno_"),  unspecified)
#endif /* _POSIX_SOURCE || ... || _XOPEN_SOURCE || _TANDEM_SOURCE */
#pragma function fopen         (alias("_C_PX_fopen_"),   unspecified)
#pragma function fprintf       (alias("_C_PX_fprintf_"),           c)
#pragma function fputc         (alias("_C_PX_fputc_"),   unspecified)
#pragma function fputs         (alias("_C_PX_fputs_"),   unspecified)
#pragma function fread         (alias("_C_PX_fread_"),   unspecified)
#pragma function freopen       (alias("_C_PX_freopen_"), unspecified)
#pragma function fscanf        (alias("_C_PX_fscanf_"),            c)
#pragma function fseek         (alias("_C_PX_fseek_"),   unspecified)
#pragma function fsetpos       (alias("_C_PX_fsetpos_"), unspecified)
#pragma function ftell         (alias("_C_PX_ftell_"),   unspecified)
#pragma function fwrite        (alias("_C_PX_fwrite_"),  unspecified)
#pragma function getc          (alias("_C_PX_getc_"),    unspecified)
#pragma function gets          (alias("_C_PX_gets_"),    unspecified)
#pragma function printf        (alias("_C_PX_printf_"),            c)
#pragma function putc          (alias("_C_PX_putc_"),    unspecified)
#pragma function puts          (alias("_C_PX_puts_"),    unspecified)
#pragma function remove        (alias("_C_PX_remove_"),  unspecified)
#pragma function rename        (alias("PXFS_FILE_RENAME_"),      tal)
#pragma function rewind        (alias("_C_PX_rewind_"),  unspecified)
#pragma function scanf         (alias("_C_PX_scanf_"),             c)
#pragma function setbuf        (alias("_C_PX_setbuf_"),  unspecified)
#pragma function setvbuf       (alias("_C_PX_setvbuf_"), unspecified)
#pragma function tmpfile       (alias("_C_PX_tmpfile_"), unspecified)
#pragma function tmpnam        (alias("_C_PX_tmpnam_"),  unspecified)
#pragma function ungetc        (alias("_C_PX_ungetc_"),  unspecified)
#pragma function vfprintf      (alias("_C_PX_vfprintf_"),          c)
#pragma function vprintf       (alias("_C_PX_vprintf_"),           c)
#endif /* _INTEROPERABLE */
#endif
#endif /* __TANDEM && _TANDEM_ARCH_ == 0 */


#if defined(__TANDEM) && (_TANDEM_ARCH_ != 0 || \
                          defined(_OSS_TARGET) && !defined(_INTEROPERABLE))

extern int __filbuf (register FILE *);
#define getc(stream)    (--(stream)->_cnt >= 0 ? \
                           ((int) *(stream)->_ptr++) : __filbuf(stream))
extern int __flsbuf (int, register FILE *);
#define putc(c, stream) (--(stream)->_cnt >= 0 ? \
                           (int)(*(stream)->_ptr++ = (unsigned char)(c)) : \
                           __flsbuf((unsigned char)(c), stream))

#endif /* __TANDEM && (_TANDEM_ARCH_ != 0 || _OSS_TARGET && !_INTEROPERABLE) */


#ifdef REVERT_TO_OLDCALLS
#undef REVERT_TO_OLDCALLS
#pragma oldcalls
#endif

#ifdef __cplusplus
   }
#endif

#endif  /* _STDIO defined */

Reply via email to