home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / unixlib36d / UnixLib36d / clib / sys / h / dev < prev    next >
Encoding:
Text File  |  1993-09-01  |  2.0 KB  |  74 lines

  1. /* sys/dev.h (c) Copyright 1990 H.Rogers */
  2.  
  3. #ifndef __SYS_DEV_H
  4. #define __SYS_DEV_H
  5.  
  6. #ifndef __SYS_TYPES_H
  7. #include <sys/types.h>
  8. #endif
  9.  
  10. #ifndef __SYS_UNIX_H
  11. #include <sys/unix.h>
  12. #endif
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. #define NDEV        4
  19.  
  20. /* major device numbers */
  21.  
  22. #define DEV_RISCOS    0    /* RiscOS file system */
  23. #define DEV_TTY     1    /* tty */
  24. #define DEV_PIPE    2    /* UnixLib pipe() */
  25. #define DEV_NULL    3    /* /dev/null */
  26.  
  27. struct dev
  28.   {
  29.   int (*open)(char *,int,struct file *);
  30.   int (*close)(int,struct file *);
  31.   int (*read)(int,void *,int,struct file *);
  32.   int (*write)(int,void *,int,struct file *);
  33.   long (*lseek)(int,long,int,struct file *);
  34.   int (*ioctl)(int,int,void *,struct file *);
  35.   };
  36.  
  37. extern struct dev __dev[NDEV];
  38.  
  39. extern int __fsopen(char *,int,struct file *);
  40. extern int __fsclose(int,struct file *);
  41. extern int __fsread(int,void *,int,struct file *);
  42. extern int __fswrite(int,void *,int,struct file *);
  43. extern long __fslseek(int,long,int,struct file *);
  44. extern int __fsioctl(int,int,void *,struct file *);
  45.  
  46. extern int __ttyopen(char *,int,struct file *);
  47. extern int __ttyclose(int,struct file *);
  48. extern int __ttyread(int,void *,int,struct file *);
  49. extern int __ttywrite(int,void *,int,struct file *);
  50. extern long __ttylseek(int,long,int,struct file *);
  51. extern int __ttyioctl(int,int,void *,struct file *);
  52.  
  53. extern int __pipeopen(char *,int,struct file *);
  54. extern int __pipeclose(int,struct file *);
  55. extern int __piperead(int,void *,int,struct file *);
  56. extern int __pipewrite(int,void *,int,struct file *);
  57. extern long __pipelseek(int,long,int,struct file *);
  58. extern int __pipeioctl(int,int,void *,struct file *);
  59.  
  60. extern int __pipeflag;    /* pipe in action flag */
  61.  
  62. extern int __nullopen(char *,int,struct file *);
  63. extern int __nullclose(int,struct file *);
  64. extern int __nullread(int,void *,int,struct file *);
  65. extern int __nullwrite(int,void *,int,struct file *);
  66. extern long __nulllseek(int,long,int,struct file *);
  67. extern int __nullioctl(int,int,void *,struct file *);
  68.  
  69. #ifdef __cplusplus
  70.     }
  71. #endif
  72.  
  73. #endif
  74.