home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / SNPDOSYS.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  3KB  |  121 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*
  4. **  SNPDOSYS.H - Snippets header file for DOS system-level functions
  5. */
  6.  
  7. #ifndef SNPDOSYS__H
  8. #define SNPDOSYS__H
  9.  
  10. #include <stdio.h>
  11. #include "sniptype.h"
  12. #include "extkword.h"
  13.  
  14.  
  15. /*
  16. **  Prototypes
  17. */
  18.  
  19. int       isBreakOn(void);                            /* Break.C        */
  20. void      setBreak(int OnOff);                        /* Break.C        */
  21. int       drop_time(void);                            /* Droptime.C     */
  22. unsigned  findIslot(void);                            /* Fndislot.C     */
  23. int       format(char drive, char *switches,
  24.             char *vlabel);                            /* Dosfrmat.C     */
  25. int       is_share(char *arg);                        /* Isshare.C      */
  26. long      memavail(void);                             /* Memavail.C     */
  27. int       getNwLoginName (char * namebuf);            /* Nwlinnam.C     */
  28. int       shell_to_DOS(void);                         /* Shel2Dos.C     */
  29. void FAR *addptr (char FAR *p, unsigned long num);    /* Fptr_Add.C     */
  30. void FAR *farnormal(void FAR *ptr);                   /* Fptr_Add.C     */
  31.  
  32.  
  33. /*
  34. **  File: JOYSTICK.C
  35. */
  36.  
  37. struct joystick {
  38.         Boolean_T switch_0;
  39.         Boolean_T switch_1;
  40.         Boolean_T switch_2;
  41.         Boolean_T switch_3;
  42.  
  43.         int     pos_Ax;
  44.         int     pos_Ay;
  45.         int     pos_Bx;
  46.         int     pos_By;
  47. };
  48.  
  49. extern struct joystick JoyStick;
  50.  
  51. Boolean_T read_joystick(void);
  52.  
  53.  
  54. /*
  55. **  File: OS_ID.C
  56. */
  57.  
  58. struct i_os_ver
  59. {
  60.   int maj;
  61.   int min;
  62. };
  63.  
  64. #define DOS     0
  65. #define OS2     1
  66. #define DV      2
  67. #define WINS    3
  68. #define WIN3    4
  69. #define TOT_OS  5
  70.  
  71.                         /*   76543210  */
  72. #define is_DOS  0x01    /* b'00000001' */
  73. #define is_OS2  0x02    /* b'00000010' */
  74. #define is_DV   0x04    /* b'00000100' */
  75. #define is_WINS 0x08    /* b'00001000' */
  76. #define is_WIN3 0x10    /* b'00010000' */
  77.  
  78. #ifndef OS_ID_MAIN
  79.   extern int id_os_type;
  80.   extern int id_os;
  81.   extern const char *id_os_name[TOT_OS];
  82.   extern struct i_os_ver id_os_ver[TOT_OS];
  83. #endif
  84.  
  85. int  get_os(void);                  /* Determine OS                     */
  86. void t_slice(int t_os);             /* Give up a time slice to the OS   */
  87.  
  88.  
  89. /*
  90. **  File: PFOPEN.C
  91. */
  92.  
  93. #ifdef unix
  94.  #define SEP_CHARS ":"
  95. #else
  96.  #define SEP_CHARS ";"
  97. #endif
  98.  
  99. FILE *pfopen(const char *name, const char *mode, const char *dirs);
  100.  
  101.  
  102. /*
  103. **  File: REDIRECT.C
  104. */
  105.  
  106. typedef  struct {
  107.       char  path[FILENAME_MAX];
  108.       int   which;
  109.       int   what;
  110.       int   oldhandle;
  111.       int   flag;
  112. } REDIR_STRUCT;
  113.  
  114. extern REDIR_STRUCT redir_stdin, redir_stdout, redir_stderr;
  115.  
  116. void  start_redirect    ( REDIR_STRUCT *s );
  117. void  stop_redirect     ( REDIR_STRUCT *s );
  118.  
  119.  
  120. #endif /* SNPDOSYS__H */
  121.