home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1999 February
/
MACPOWER-1999-02.ISO.7z
/
MACPOWER-1999-02.ISO
/
9902⁄AMUG
/
UTILITY
/
mac06-0.95.sit
/
mac06-0.95
/
usr
/
include
/
stdio.h
< prev
next >
Wrap
Text File
|
1998-11-04
|
3KB
|
106 lines
/* mac06ゥ1997,98 by HNS/DSITRI hns@computer.org
** stdio.h
**
** 02.01.1998 HNS rename(), remove(), gets() corrected
*/
#pragma once
#include "stdarg.h"
#include "limits.h"
#include "size_t.h"
#define BUFSIZ (1024)
#define EOF (-1)
#define FILENAME_MAX (256)
#define FOPEN_MAX (OPEN_MAX)
#ifndef NULL
#define NULL (0)
#endif
#ifndef SEEK_SET
#define SEEK_CUR (1)
#define SEEK_END (2)
#define SEEK_SET (0)
#endif
#define TMP_MAX 26
#define L_tmpnam 32
typedef unsigned long fpos_t;
typedef struct
{
int fd;
unsigned char *bfr; /* base address */
unsigned char *ptr; /* read/write pointer */
unsigned char *fill; /* fill for read */
unsigned char *end; /* max size for write */
#define _IORD 0x01
#define _IOWR 0x02
#define _IOEOF 0x04
#define _IOERR 0x08
#define _IOFBF 0x10
#define _IOLBF 0x20
#define _IONBF 0x40
#define _IOTTY 0x80
int flags;
int pid; /* for popen */
} FILE;
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
#define clearerr(fp) ((fp)->flags&=~_IOERR)
int fclose(FILE *fp);
#define feof(fp) ((fp)->flags&_IOEOF)
#define ferror(fp) ((fp)->flags&_IOERR)
int _fflush(FILE *fp, int c);
#define fflush(fp) _fflush((fp), 0)
int fgetc(FILE *f);
#define fgetpos(f, pos) ((*(pos)=ftell(f)) != -1l)
char *fgets(char *s, int n, FILE *fp);
#define fopen(N, M) (freopen((N), (M), NULL))
int fprintf(FILE *f, char *format, ...);
int fputc(int c, FILE *f);
#define fputs(s, fp) (fwrite((s), 1, strlen(s), (fp)))
size_t fread(void *buf, size_t size, size_t nitems, FILE *fp);
FILE *freopen(char *name, char *mode, FILE *fp);
int fscanf(FILE *f, char *format, ...);
int fseek(FILE *fp, long off, int w);
#define fsetpos(f, pos) fseek((f), *(pos), SEEK_SET)
long int ftell(FILE *fp);
size_t fwrite(void *buf, size_t size, size_t nitems, FILE *fp);
int _ffill(FILE *);
#define getc(fp) ((fp)->ptr < (fp)->fill?*(fp)->ptr++:_ffill(fp))
#define getchar() getc(stdin)
char *gets(char *s);
void perror(char const *s);
int pclose(FILE *f);
FILE *popen(const char *cmd, const char *mod);
int printf(char *format, ...);
#define putc(C, fp) (*(fp)->ptr++=(C), (((fp)->ptr >= (fp)->end) || (((fp)->flags&_IOTTY) != 0 && (C) == '¥n'))?_fflush(fp, (C)):(C))
#define putchar(C) (putc(C, stdout))
#define puts(s) (fputs((s), stdout), putchar('¥n'))
int remove(char *name);
int rename(char *from, char *to);
#define rewind(fp) (fseek((fp), 0l, SEEK_SET))
int scanf(char *format, ...);
#define setbuf(fp, buf) setvbuf((fp), (buf), _IOFBF, BUFSIZE)
#define setvbuf(fp, buf, mode, size) /* ignore */
int sprintf(char *buf, char *format, ...);
int sscanf(char *buf, char *format, ...);
FILE *tmpfile(void);
char *tmpnam(char *s);
#define ungetc(c, fp) if((fp)->ptr == (fp)->bfr) *(fp)->ptr=(c), (fp)->fill=(fp)->bfr+1; else *--(fp)->ptr=(c)
int vprintf(char *format, va_list arg);
int vfprintf(FILE *f, char *format, va_list arg);
int vsprintf(char *buf, char *format, va_list arg);
#define fileno(fp) ((fp)->fd)
#define fdopen(FD, M) (fdreopen((FD), (M), NULL))
#ifndef _POSIX_SOURCE
FILE *fdreopen(int fd, const char *mode, FILE *fp);
#endif
/* EOF */