home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / 3COMM.ZIP / H.ZIP / CHARDEV.H < prev    next >
C/C++ Source or Header  |  1989-05-17  |  5KB  |  146 lines

  1. /********************************************************************/
  2. /**                   Microsoft OS/2 LAN Manager                   **/
  3. /**            Copyright(c) Microsoft Corp., 1987, 1988            **/
  4. /********************************************************************/
  5.  
  6. /********************************************************************
  7.  *                                    *
  8.  *  About this file ...  CHARDEV.H                    *
  9.  *                                    *
  10.  *  This file contains information about the NetCharDev and         *
  11.  *  NetCharDevQ APIs.                            *
  12.  *                                    *
  13.  *    Function prototypes.                        *
  14.  *                                    *
  15.  *    Data structure templates.                    *
  16.  *                                    *
  17.  *    Definition of special values.                    *
  18.  *                                    *
  19.  *                                    *
  20.  *  NOTE:  You must include NETCONS.H before this file, since this  *
  21.  *       file    depends on values defined in NETCONS.H.            *
  22.  *                                    *
  23.  ********************************************************************/
  24.  
  25.  
  26. /**************************************************************** 
  27.  *                                *
  28.  *          Function prototypes                 *
  29.  *                                *
  30.  ****************************************************************/
  31.  
  32. extern API_FUNCTION 
  33. NetCharDevEnum( const char far *, short, char far *, unsigned short,
  34.     unsigned short far *, unsigned short far *);
  35.  
  36. extern API_FUNCTION
  37. NetCharDevGetInfo( const char far *, const char far *, short, char far *, 
  38.     unsigned short, unsigned short far *);
  39.  
  40. extern API_FUNCTION
  41. NetCharDevControl( const char far *, const char far *, short);
  42.  
  43. extern API_FUNCTION 
  44. NetCharDevQEnum( const char far *, const char far *, short, char far *, 
  45.         unsigned short, unsigned short far *, unsigned short far *);
  46.  
  47. extern API_FUNCTION
  48. NetCharDevQGetInfo( const char far *, const char far *, const char far *, 
  49.         short, char far *, unsigned short, unsigned short far *);
  50.  
  51. extern API_FUNCTION
  52. NetCharDevQSetInfo( const char far *, const char far *, short, 
  53.         const char far *, unsigned short, short);
  54.  
  55. extern API_FUNCTION
  56. NetCharDevQPurge ( const char far *, const char far *);
  57.  
  58. extern API_FUNCTION
  59. NetCharDevQPurgeSelf ( const char far *, const char far *, const char far *);
  60.  
  61.  
  62.  
  63. /**************************************************************** 
  64.  *                                *
  65.  *          Data structure templates            *
  66.  *                                *
  67.  ****************************************************************/
  68.  
  69.  
  70. struct chardev_info_0
  71. {
  72.     char       ch0_dev[DEVLEN+1];  /*       device name          */
  73. };
  74.  
  75. struct chardev_info_1
  76. {
  77.     char       ch1_dev[DEVLEN+1]; /* device name                */
  78.     char       ch1_pad1;          /* pad to an word boundary        */
  79.     unsigned short ch1_status;        /* status                             */
  80.                       /*   bit 0 reserved            */
  81.                                       /*   bit 1 on = opened                */
  82.                       /*   bit 1 off = idle            */
  83.                       /*   bit 2 on = error            */
  84.                       /*   bit 2 off = no error         */
  85.     char       ch1_username[UNLEN+1]; /* name of device's current user  */
  86.     char       ch1_pad2;          /* pad to an word boundary        */
  87.     unsigned long  ch1_time;          /* time current user attached         */
  88. };
  89.  
  90.  
  91. struct chardevQ_info_0
  92. {
  93.     char       cq0_dev[NNLEN+1];   /* queue name (network name)        */
  94. };
  95.  
  96. struct chardevQ_info_1
  97. {
  98.     char       cq1_dev[NNLEN+1];   /* queue name (network name)        */
  99.     char       cq1_pad;           /* pad to a word boundary         */
  100.     unsigned short cq1_priority;       /* priority (1 - 9)            */
  101.     char far *     cq1_devs;           /* names of devices assigned to queue */
  102.     unsigned short cq1_numusers;       /* # of users waiting in queue        */
  103.     unsigned short cq1_numahead;       /* # of users in queue ahead of this  */
  104.                                        /*     user. -1 is returned if the    */
  105.                                        /*     user is not in the queue.      */
  106. };
  107.  
  108.  
  109.  
  110. /**************************************************************** 
  111.  *                                *
  112.  *          Special values and constants            *
  113.  *                                *
  114.  ****************************************************************/
  115.  
  116. /*
  117.  *    Bits for chardev_info_1 field ch1_status.
  118.  */
  119.  
  120. #define CHARDEV_STAT_OPENED        0x02
  121. #define CHARDEV_STAT_ERROR        0x04
  122.  
  123. /*
  124.  *    Opcodes for NetCharDevControl
  125.  */
  126.  
  127. #define CHARDEV_CLOSE            0
  128.  
  129. /*
  130.  *    Values for parmnum parameter to NetCharDevQSetInfo.
  131.  */
  132.  
  133. #define CHARDEVQ_PRIORITY_PARMNUM    2
  134. #define CHARDEVQ_DEVICES_PARMNUM    3
  135.  
  136.  
  137. /*
  138.  *    Minimum, maximum, and reccommended default for priority.
  139.  */
  140.  
  141. #define CHARDEVQ_MAX_PRIORITY        1
  142. #define CHARDEVQ_MIN_PRIORITY        9
  143. #define CHARDEVQ_DEF_PRIORITY        5
  144.  
  145.  
  146.