home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / MTLB49CF.LZH / include / ioctl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-29  |  7.2 KB  |  288 lines

  1. #ifndef    _IOCTL_H
  2. #define _IOCTL_H
  3.  
  4. #ifndef _COMPILER_H
  5. #include <compiler.h>
  6. #endif
  7.  
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. #define TIOCGETP    (('T'<< 8) | 0)
  13. #define TIOCSETN    (('T'<< 8) | 1)
  14. #define TIOCGETC    (('T'<< 8) | 2)
  15. #define TIOCSETC    (('T'<< 8) | 3)
  16. #define TIOCGLTC    (('T'<< 8) | 4)
  17. #define TIOCSLTC    (('T'<< 8) | 5)
  18. #define TIOCGWINSZ    (('T'<< 8) | 11)
  19. #define TIOCSWINSZ    (('T'<< 8) | 12)
  20.  
  21. #ifdef __MINT__
  22. #define FSTAT        (('F'<< 8) | 0)
  23. #define FIONREAD    (('F'<< 8) | 1)
  24. #define FIONWRITE    (('F'<< 8) | 2)
  25. #define FUTIME        (('F'<< 8) | 3)
  26. #define FTRUNCATE    (('F'<< 8) | 4)
  27. #define TIOCGPGRP    (('T'<< 8) | 6)
  28. #define TIOCSPGRP    (('T'<< 8) | 7)
  29. #define TIOCFLUSH    (('T'<< 8) | 8)
  30. #define TIOCSTOP    (('T'<< 8) | 9)
  31. #define TIOCSTART    (('T'<< 8) | 10)
  32. #define TIOCGXKEY    (('T'<< 8) | 13)
  33. #define TIOCSXKEY    (('T'<< 8) | 14)
  34.  
  35. #define TIOCIBAUD    (('T'<< 8) | 18)
  36. #define TIOCOBAUD    (('T'<< 8) | 19)
  37. #define TIOCCBRK    (('T'<< 8) | 20)
  38. #define TIOCSBRK    (('T'<< 8) | 21)
  39. #define TIOCGFLAGS    (('T'<< 8) | 22)
  40. #define TIOCSFLAGS    (('T'<< 8) | 23)
  41. #define TIOCOUTQ    (('T'<< 8) | 24)
  42. #define TIOCSETP    (('T'<< 8) | 25)
  43. #define TIOCHPCL    (('T'<< 8) | 26)
  44. #define TIOCCAR        (('T'<< 8) | 27)
  45. #define TIOCNCAR    (('T'<< 8) | 28)
  46. #define TIOCWONLINE    (('T'<< 8) | 29)
  47. #define TIOCSFLAGSB    (('T'<< 8) | 30)
  48. #define TIOCGSTATE    (('T'<< 8) | 31)
  49. #define TIOCSSTATEB    (('T'<< 8) | 32)
  50. #define TIOCGVMIN    (('T'<< 8) | 33)
  51. #define TIOCSVMIN    (('T'<< 8) | 34)
  52.  
  53. /* faked by the library */
  54. #define TIOCLBIS    (('T'<< 8) | 246)
  55. #define TIOCLBIC    (('T'<< 8) | 247)
  56. #define TIOCMGET    (('T'<< 8) | 248)
  57. #define TIOCCDTR    (('T'<< 8) | 249)
  58. #define TIOCSDTR    (('T'<< 8) | 250)
  59. #define TIOCNOTTY    (('T'<< 8) | 251)
  60.  
  61. /* bits in longword fetched by TIOCMGET */
  62. #define TIOCM_LE    0001 /* not supported */
  63. #define TIOCM_DTR    0002
  64. #define TIOCM_RTS    0004
  65. #define TIOCM_ST    0010 /* not supported */
  66. #define TIOCM_SR    0020 /* not supported */
  67. #define TIOCM_CTS    0040
  68. #define TIOCM_CAR    0100
  69. #define TIOCM_CD    TIOCM_CAR
  70. #define TIOCM_RNG    0200
  71. #define TIOCM_RI    TIOCM_RNG
  72. #define TIOCM_DSR    0400 /* not supported */
  73.  
  74. /* not yet implemented in MiNT */
  75. #define TIOCGETD    (('T'<< 8) | 252)
  76. #define TIOCSETD    (('T'<< 8) | 253)
  77. #define TIOCLGET    (('T'<< 8) | 254)
  78. #define TIOCLSET    (('T'<< 8) | 255)
  79.  
  80. #define NTTYDISC    1
  81.  
  82. /* ioctl's to act on processes */
  83. #define PPROCADDR    (('P'<< 8) | 1)
  84. #define PBASEADDR    (('P'<< 8) | 2)
  85. #define PCTXTSIZE    (('P'<< 8) | 3)
  86. #define PSETFLAGS    (('P'<< 8) | 4)
  87. #define PGETFLAGS    (('P'<< 8) | 5)
  88. #define PTRACESFLAGS    (('P'<< 8) | 6)
  89. #define PTRACEGFLAGS    (('P'<< 8) | 7)
  90. #    define    P_ENABLE    (1 << 0)    /* enable tracing */
  91. #if 0 /* NOTYETDEFINED */
  92. #    define    P_DOS        (1 << 1)    /* trace DOS calls - unimplemented */
  93. #    define    P_BIOS        (1 << 2)    /* trace BIOS calls - unimplemented */
  94. #    define    P_XBIOS        (1 << 3)    /* trace XBIOS calls - unimplemented */
  95. #endif
  96.  
  97. #define PTRACEGO    (('P'<< 8) | 8)    /* these 4 must be together */
  98. #define PTRACEFLOW    (('P'<< 8) | 9)
  99. #define PTRACESTEP    (('P'<< 8) | 10)
  100. #define PTRACE11    (('P'<< 8) | 11)
  101. #define PLOADINFO    (('P'<< 8) | 12)
  102. #define    PFSTAT        (('P'<< 8) | 13)
  103.  
  104. struct __ploadinfo {
  105.     /* passed */
  106.     short fnamelen;
  107.     /* returned */
  108.     char *cmdlin, *fname;
  109. };
  110.  
  111. /* shared memory ioctl's */
  112. #define SHMGETBLK    (('M'<< 8) | 0)
  113. #define SHMSETBLK    (('M'<< 8) | 1)
  114.  
  115. /* cursor control ioctl's */
  116. #define TCURSOFF    (('c'<< 8) | 0)
  117. #define TCURSON        (('c'<< 8) | 1)
  118. #define TCURSBLINK    (('c'<< 8) | 2)
  119. #define TCURSSTEADY    (('c'<< 8) | 3)
  120. #define TCURSSRATE    (('c'<< 8) | 4)
  121. #define TCURSGRATE    (('c'<< 8) | 5)
  122.  
  123. /* Socket ioctls: these require MiNT-Net 3.0 (or later) */
  124.  
  125. /* socket-level I/O control calls */
  126. #define SIOCGLOWAT    (('S' << 8) | 1)
  127. #define SIOCSLOWAT    (('S' << 8) | 2)
  128. #define SIOCGHIWAT    (('S' << 8) | 3)
  129. #define SIOCSHIWAT    (('S' << 8) | 4)
  130. #define SIOCSPGRP    (('S' << 8) | 5)
  131. #define SIOCGPGRP    (('S' << 8) | 6)
  132. #define SIOCATMARK    (('S' << 8) | 7)
  133.  
  134. /* socket configuration controls */
  135. #define SIOCGIFCONF    (('S' << 8) | 12)    /* get iface list */
  136. #define SIOCGIFFLAGS    (('S' << 8) | 13)    /* get flags */
  137. #define SIOCSIFFLAGS    (('S' << 8) | 14)    /* set flags */
  138. #define SIOCGIFADDR    (('S' << 8) | 15)    /* get iface address */
  139. #define SIOCSIFADDR    (('S' << 8) | 16)    /* set iface address */
  140. #define SIOCGIFDSTADDR    (('S' << 8) | 17)    /* get iface remote address */
  141. #define SIOCSIFDSTADDR    (('S' << 8) | 18)    /* set iface remotw address */
  142. #define SIOCGIFBRDADDR    (('S' << 8) | 19)    /* get iface ibroadcast address */
  143. #define SIOCSIFBRDADDR    (('S' << 8) | 20)    /* set iface broadcast address */
  144. #define SIOCGIFNETMASK    (('S' << 8) | 21)    /* get iface network mask */
  145. #define SIOCSIFNETMASK    (('S' << 8) | 22)    /* set iface network mask */
  146. #define SIOCGIFMETRIC    (('S' << 8) | 23)    /* get metric */
  147. #define SIOCSIFMETRIC    (('S' << 8) | 24)    /* set metric */
  148. #define SIOCGIFMTU    (('S' << 8) | 27)    /* get MTU size */
  149. #define SIOCSIFMTU    (('S' << 8) | 28)    /* set MTU size */
  150.  
  151. /* routing table calls */
  152. #define SIOCADDRT    (('S' << 8) | 30)    /* add routing table entry */
  153. #define SIOCDELRT    (('S' << 8) | 31)    /* delete routing table entry */
  154.  
  155. /* ARP cache control calls */
  156. #define SIOCDARP    (('S' << 8) | 40)    /* delete ARP table entry */
  157. #define SIOCGARP    (('S' << 8) | 41)    /* get ARP table entry */
  158. #define SIOCSARP    (('S' << 8) | 42)    /* set ARP table entry */
  159.  
  160. #endif /* __MINT__ */
  161.  
  162. #ifndef _filesys_h
  163. struct tchars {
  164.     char    t_intrc;
  165.     char    t_quitc;
  166.     char    t_startc;
  167.     char    t_stopc;
  168.     char    t_eofc;
  169.     char    t_brkc;
  170. };
  171.  
  172. struct ltchars {
  173.     char    t_suspc;
  174.     char    t_dsuspc;
  175.     char    t_rprntc;
  176.     char    t_flushc;
  177.     char    t_werasc;
  178.     char    t_lnextc;
  179. };
  180.  
  181. #define    CRMOD        0x0001
  182. #define    CBREAK        0x0002
  183. #ifndef _TERMIOS_H
  184. #define ECHO        0x0004
  185. #endif /* _TERMIOS_H */
  186. #define    XTABS        0x0008
  187. #define    RAW        0x0010
  188. #define LCASE        0x0020        /* does nothing */
  189. #ifndef _TERMIOS_H
  190. #define NOFLSH        0x0040
  191. #ifdef __MINT__
  192. #define TOSTOP        0x0100
  193. #define ECHOCTL        0x0400
  194. #endif /* __MINT__ */
  195. #endif /* _TERMIOS_H */
  196. #define TANDEM        0x1000
  197. #define RTSCTS        0x2000
  198. #define EVENP        0x4000
  199. #define ODDP        0x8000
  200. #define ANYP        (0)
  201. #endif /* _filesys_h */
  202.  
  203. #ifndef _TERMIOS_H
  204. #define B0        0
  205. #define B50        1
  206. #define B75        2
  207. #define B110        3
  208. #define B134        4
  209. #define B135        4
  210. #define B150        5
  211. #define B200        6
  212. #define B300        7
  213. #define B600        8
  214. #define B1200        9
  215. #define B1800        10
  216. #define B2400        11
  217. #define B4800        12
  218. #define B9600        13
  219. #define B19200        14
  220. #define B38400        15
  221. #define B57600          16
  222. #define B115200         17
  223. #define B230400         18
  224. #endif
  225.  
  226. /* The ones below aren't supported by the kernel, at least not yet */
  227. #define VTDELAY        0
  228. #define ALLDELAY    0
  229.  
  230. #ifdef __MINT__
  231.  
  232. #define XKEY        0x0200
  233.  
  234. #ifndef _filesys_h
  235. struct xkey {
  236.     short    xk_num;
  237.     char    xk_def[8];
  238. };
  239. #endif
  240.  
  241. /* some fake defines for the line discipline stuff */
  242.  
  243. #define LCRTBS        0x01
  244. #define LCRTERA        0x02
  245. #define LCRTKIL        0x04
  246. #define LPRTERA        0x10
  247. #define LFLUSHO        0x20
  248. #define LLITOUT        0x100
  249.  
  250. #else
  251.  
  252. #define META        0x0100        /* extension: Alternate as meta key */
  253. #define PASS8        0x0100
  254.  
  255. #endif /* __MINT__ */
  256.  
  257. #ifndef _filesys_h
  258. struct sgttyb {
  259.     char    sg_ispeed;
  260.     char    sg_ospeed;
  261.     char    sg_erase;
  262.     char    sg_kill;
  263.     short    sg_flags;
  264. };
  265.  
  266. struct winsize {
  267.     short    ws_row;
  268.     short    ws_col;
  269.     short    ws_xpixel;
  270.     short    ws_ypixel;
  271. };
  272. #endif
  273.  
  274. struct _mutimbuf {
  275.     unsigned short actime, acdate;    /* GEMDOS format */
  276.     unsigned short modtime, moddate;
  277. };
  278.  
  279. __EXTERN int ioctl    __PROTO((int, int, void *));
  280. __EXTERN int stty    __PROTO((int, struct sgttyb *));
  281. __EXTERN int gtty    __PROTO((int, struct sgttyb *));
  282.  
  283. #ifdef __cplusplus
  284. }
  285. #endif
  286.  
  287. #endif    /* _IOCTL_H */
  288.