home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume6 / glib / part01 / mac-vt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-14  |  2.0 KB  |  68 lines

  1. /* $Id: mac-vt.h,v 1.6 89/05/06 17:13:35 lee Exp $
  2.  * vt.h - definitions for the vt100-like console device handler
  3.  *
  4.  * Steven A. Falco  4/30/87
  5.  * $Log:    mac-vt.h,v $
  6.  * Revision 1.6  89/05/06  17:13:35  lee
  7.  * rel. to comp.sources.misc
  8.  * 
  9.  */
  10.  
  11. #ifndef EOF
  12. #define EOF        -1
  13. #endif
  14.  
  15. /* this structure defines one member of the _StdDevs array.  This is
  16.  * similar to the Unix concept of bdevsw and cdevsw.
  17.  */
  18. typedef struct {
  19.     int name;            /* 'CONS' for the console */
  20.     int (*l_access)();    /* NOT the same as open - can do mv or rm also */
  21.     int (*l_close)();    /* close */
  22.     int (*l_read)();    /* read */
  23.     int (*l_write)();    /* write */
  24.     int (*l_ioctl)();    /* ioctl */
  25. } DEVSW;
  26.  
  27. extern DEVSW _StdDevs[];
  28.  
  29. /* this structure defines one member of the file table.  I believe
  30.  * the table is dynamically allocated for 200 bytes at a time or
  31.  * 10 entries.  But _lockedHandle may return words or something else.
  32.  */
  33. typedef struct {
  34.     short flags;    /* high byte sometimes has fileno */
  35.     short errcode;    /* a MacOS error code */
  36.     DEVSW *handler;    /* a pointer to our _StdDevs array entry */
  37.     int z;            /* unknown */
  38.     int count;        /* read or write count desired. <-- --> */
  39.     char *buffer;    /* buffer pointer to use. <-- --> */
  40. } IOSTR;
  41.  
  42. /* look up a file number in the file table and return a pointer to the
  43.  * entry.  Pass in -1 to get a new entry.  NOTE - the ADDRESS of the
  44.  * file number is passed - NOT the file number itself.  I wonder why?
  45.  */
  46. IOSTR *_getIOPort();
  47.  
  48. /* these are the low-level entry points to link the driver (handler)
  49.  * into the system.  They require strange input arguments and always
  50.  * return 0 on success.  Don't call them directly...
  51.  */
  52. extern    vt_faccess();
  53. extern    vt_close();
  54. extern    vt_read();
  55. extern    vt_write();
  56. extern    vt_ioctl();
  57.  
  58. /* these are the ultra-low level calls that do all the work.  You can
  59.  * call them directly to avoid all the IntEnv overhead.  See vt.c for
  60.  * the input and output specifications.
  61.  */
  62. extern    vt_open();
  63. extern    vt_getch();
  64. extern    vt_peekch();
  65. extern    vt_putch();
  66. extern    vt_cooked();
  67. extern    vt_raw();
  68.