home *** CD-ROM | disk | FTP | other *** search
- /* sys/dev.h (c) Copyright 1990 H.Rogers */
-
- #ifndef __SYS_DEV_H
- #define __SYS_DEV_H
-
- #ifndef __SYS_TYPES_H
- #include <sys/types.h>
- #endif
-
- #ifndef __SYS_UNIX_H
- #include <sys/unix.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #define NDEV 4
-
- /* major device numbers */
-
- #define DEV_RISCOS 0 /* RiscOS file system */
- #define DEV_TTY 1 /* tty */
- #define DEV_PIPE 2 /* UnixLib pipe() */
- #define DEV_NULL 3 /* /dev/null */
-
- struct dev
- {
- int (*open)(char *,int,struct file *);
- int (*close)(int,struct file *);
- int (*read)(int,void *,int,struct file *);
- int (*write)(int,void *,int,struct file *);
- long (*lseek)(int,long,int,struct file *);
- int (*ioctl)(int,int,void *,struct file *);
- };
-
- extern struct dev __dev[NDEV];
-
- extern int __fsopen(char *,int,struct file *);
- extern int __fsclose(int,struct file *);
- extern int __fsread(int,void *,int,struct file *);
- extern int __fswrite(int,void *,int,struct file *);
- extern long __fslseek(int,long,int,struct file *);
- extern int __fsioctl(int,int,void *,struct file *);
-
- extern int __ttyopen(char *,int,struct file *);
- extern int __ttyclose(int,struct file *);
- extern int __ttyread(int,void *,int,struct file *);
- extern int __ttywrite(int,void *,int,struct file *);
- extern long __ttylseek(int,long,int,struct file *);
- extern int __ttyioctl(int,int,void *,struct file *);
-
- extern int __pipeopen(char *,int,struct file *);
- extern int __pipeclose(int,struct file *);
- extern int __piperead(int,void *,int,struct file *);
- extern int __pipewrite(int,void *,int,struct file *);
- extern long __pipelseek(int,long,int,struct file *);
- extern int __pipeioctl(int,int,void *,struct file *);
-
- extern int __pipeflag; /* pipe in action flag */
-
- extern int __nullopen(char *,int,struct file *);
- extern int __nullclose(int,struct file *);
- extern int __nullread(int,void *,int,struct file *);
- extern int __nullwrite(int,void *,int,struct file *);
- extern long __nulllseek(int,long,int,struct file *);
- extern int __nullioctl(int,int,void *,struct file *);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-