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

  1. /********************************************************************/
  2. /**                   Microsoft OS/2 LAN Manager                   **/
  3. /**            Copyright(c) Microsoft Corp., 1987, 1988            **/
  4. /********************************************************************/
  5.  
  6.  
  7. /********************************************************************
  8.  *
  9.  *  About this file ...  ALERT.H
  10.  *
  11.  *  This file contains information about the NetUse 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.  *  NOTE:  ALERT.H includes ALERTMSG.H, which defined the alert message
  24.  *       numbers.
  25.  *
  26.  ********************************************************************/
  27.  
  28.  
  29. #include "alertmsg.h"
  30.  
  31.  
  32.  
  33. /**************************************************************** 
  34.  *                                *
  35.  *          Function prototypes                 *
  36.  *                                *
  37.  ****************************************************************/
  38.  
  39. extern API_FUNCTION
  40.   NetAlertStart ( const char far *, const char far *, unsigned short );
  41.  
  42. extern API_FUNCTION
  43.   NetAlertStop ( const char far *, const char far * );
  44.  
  45. extern API_FUNCTION
  46.   NetAlertRaise ( const char far *, const char far *, unsigned short, unsigned long );
  47.  
  48.  
  49.  
  50. /**************************************************************** 
  51.  *                                *
  52.  *          Data structure templates            *
  53.  *                                *
  54.  ****************************************************************/
  55.  
  56.  
  57. /***   Standard alert structure
  58.  */
  59.  
  60. struct std_alert
  61. {
  62.         long    alrt_timestamp;          
  63.         char    alrt_eventname[EVLEN+1]; 
  64.     char    alrt_pad1;
  65.         char    alrt_servicename[SNLEN+1];
  66. };
  67.  
  68. /*
  69.  *    The following macro gives a pointer to the other_info data.
  70.  *    It takes a "struct std_alert *" and returns a "char *".
  71.  */
  72.  
  73. #define ALERT_OTHER_INFO(x)    ((char *)(x)     + sizeof(struct std_alert))
  74. #define ALERT_OTHER_INFO_F(x)  ((char far *)(x) + sizeof(struct std_alert))
  75.  
  76. /*
  77.  *    The following macro gives a pointer to the variable-length data.
  78.  *    It takes a pointer to one of the other-info structs and
  79.  *    returns a "char *".
  80.  */
  81.  
  82. #define ALERT_VAR_DATA(p)      ((char *)(p)     + sizeof(*p))
  83. #define ALERT_VAR_DATA_F(p)    ((char far *)(p) + sizeof(*p))
  84.  
  85.  
  86. /***   Print alert other-info structure
  87.  */
  88.  
  89. struct print_other_info { 
  90.         short   alrtpr_jobid;       /* Job id for job */
  91.         short   alrtpr_status;      /* Status word from job info struct */
  92.                     /* bit 15 == 1 means job deleted */
  93.         long    alrtpr_submitted;   /* When submitted */
  94.         long    alrtpr_size;        /* Bytes in job */
  95. };
  96.  
  97. /*    Followed by (consecutive ASCIZ strings) ...
  98.  *
  99.  *        computername
  100.  *        username
  101.  *        queuename
  102.  *        destination
  103.  *        status string
  104.  */
  105.  
  106. /***   Error log alert other-info structure
  107.  */
  108.  
  109. struct errlog_other_info {
  110.     short    alrter_errcode;
  111.     long    alrter_offset;
  112. };
  113.  
  114. /***   Admin alert other-info structure
  115.  */
  116.  
  117. struct admin_other_info {
  118.     short    alrtad_errcode;        /* code for message in net error message file */
  119.     short    alrtad_numstrings;    /* the number of merge strings 0-9 */
  120. };
  121.  
  122. /*    Followed by merge strings (consecutive ASCIZ strings, count
  123.  *    is in alrtad_numstrings field).
  124.  */
  125.  
  126.  
  127. /***   User alert other-info structure
  128.  */
  129.  
  130. struct user_other_info {
  131.     short    alrtus_errcode;    /* code for message in net error message file */
  132.     short    alrtus_numstrings;     /* the number of merge strings 0-9 */
  133. };
  134.  
  135. /*    Followed by merge strings (consecutive ASCIZ strings, count
  136.  *    is in alrtus_numstrings field).
  137.  *
  138.  *    Further followed by (consecutive ASCIZ strings) ...
  139.  *
  140.  *        username
  141.  *        computername
  142.  */
  143.  
  144.  
  145. /***  Release memory alert other info.  Used to request memory from the server
  146.  */
  147. struct releasemem_other_info {
  148.     unsigned short memneeded;
  149.     unsigned short waittime;
  150. };
  151.  
  152. /**************************************************************** 
  153.  *                                *
  154.  *          Special values and constants            *
  155.  *                                *
  156.  ****************************************************************/
  157.  
  158. /*
  159.  *    Names of standard Microsoft-defined alert events.
  160.  */
  161.  
  162. #define ALERT_PRINT_EVENT    "PRINTING"   
  163. #define ALERT_MESSAGE_EVENT    "MESSAGE"
  164. #define ALERT_ERRORLOG_EVENT    "ERRORLOG"
  165. #define ALERT_ADMIN_EVENT    "ADMIN"
  166. #define ALERT_USER_EVENT    "USER"
  167. #define ALERT_RELEASE_MEMORY    "RELEASEMEMORY"
  168.  
  169. /*
  170.  *     Three suggested timeouts (in milliseconds) for NetAlertRaise.
  171.  */
  172.  
  173. #define ALERT_SHORT_WAIT    100L
  174. #define ALERT_MED_WAIT        1000L
  175. #define ALERT_LONG_WAIT        10000L
  176.  
  177.  
  178.  
  179.