home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0210 - 0219 / ibm0210-0219 / ibm0213.tar / ibm0213 / LS4APWAD.ZIP / LS40A.A12 / IBMLSA / IBM400R2 / OSLANAPI.ZIP / IBMLAN / NETSRC / H / ALERT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-10  |  7.0 KB  |  244 lines

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*              IBM OS/2(tm) Local Area Network (LAN) Server              */
  4. /*                            Version 3.0                                 */
  5. /* (c) Copyright International Business Machines Corporation, 1988, 1992  */
  6. /*                                                                        */
  7. /**************************************************************************/
  8. /********************************************************************/
  9.  
  10.  
  11. /********************************************************************
  12.  *
  13.  *  About this file ...  ALERT.H
  14.  *
  15.  *  This file contains information about the NetAlert APIs.
  16.  *
  17.  *    Function prototypes.
  18.  *
  19.  *    Data structure templates.
  20.  *
  21.  *    Definition of special values.
  22.  *
  23.  *
  24.  *  NOTE:  You must include NETCONS.H before this file, since this
  25.  *       file    depends on values defined in NETCONS.H.
  26.  *
  27.  *  NOTE:  ALERT.H includes ALERTMSG.H, which defines the alert message
  28.  *       numbers.
  29.  *
  30.  ********************************************************************/
  31.  
  32.  
  33. #ifdef  INCL_32
  34. #pragma pack(1)
  35. #endif
  36.  
  37.  
  38. #ifndef NETALERT_INCLUDED
  39.  
  40. #define NETALERT_INCLUDED
  41.  
  42.  
  43. #include "alertmsg.h"
  44.  
  45.  
  46. /****************************************************************
  47.  *                                                              *
  48.  *              Function prototypes                             *
  49.  *                                                              *
  50.  ****************************************************************/
  51.  
  52. extern API_FUNCTION
  53.   NetAlertRaise ( const unsigned char LSFAR * pszEvent,
  54.                   const unsigned char LSFAR * pbBuffer,
  55.                   unsigned short              usBuffer,
  56.                   unsigned long               ulTimeout );
  57.  
  58. extern API_FUNCTION
  59.   NetAlertStart ( const unsigned char LSFAR * pszEvent,
  60.                   const unsigned char LSFAR * pszRecipient,
  61.                   unsigned short              usMaxData );
  62.  
  63. extern API_FUNCTION
  64.   NetAlertStop ( const unsigned char LSFAR * pszEvent,
  65.                  const unsigned char LSFAR * pszRecipient );
  66.  
  67.  
  68.  
  69. /****************************************************************
  70.  *                                *
  71.  *          Data structure templates            *
  72.  *                                *
  73.  ****************************************************************/
  74.  
  75.  
  76. /***   Standard alert structure
  77.  */
  78.  
  79. struct std_alert
  80. {
  81.         long            alrt_timestamp;
  82.         unsigned char   alrt_eventname[EVLEN+1];
  83.         unsigned char   alrt_pad1;
  84.         unsigned char   alrt_servicename[SNLEN+1];
  85. };
  86.  
  87. /*
  88.  *    The following macro gives a pointer to the other_info data.
  89.  *    It takes a "struct std_alert *" and returns a "unsigned char *".
  90.  */
  91.  
  92. #define ALERT_OTHER_INFO(x)    ((unsigned char *)(x)     + sizeof(struct std_alert))
  93. #define ALERT_OTHER_INFO_F(x)  ((unsigned char LSFAR *)(x) + sizeof(struct std_alert))
  94.  
  95. /*
  96.  *    The following macro gives a pointer to the variable-length data.
  97.  *    It takes a pointer to one of the other-info structs and
  98.  *    returns a "unsigned char *".
  99.  */
  100.  
  101. #define ALERT_VAR_DATA(p)      ((unsigned char *)(p)     + sizeof(*p))
  102. #define ALERT_VAR_DATA_F(p)    ((unsigned char LSFAR *)(p) + sizeof(*p))
  103.  
  104.  
  105. /***   Print alert other-info structure
  106.  */
  107.  
  108. struct print_other_info {
  109.         short   alrtpr_jobid;       /* Job ID for job */
  110.         short   alrtpr_status;      /* Status word from job info struct */
  111.                     /* bit 15 == 1 means job deleted */
  112.         long    alrtpr_submitted;   /* When submitted */
  113.         long    alrtpr_size;        /* Bytes in job */
  114. };
  115.  
  116. /*    Followed by (consecutive ASCIIZ strings) ...
  117.  *
  118.  *        computername
  119.  *        username
  120.  *        queuename
  121.  *        destination
  122.  *        status string
  123.  */
  124.  
  125. /***   Error log alert other-info structure
  126.  */
  127.  
  128. struct errlog_other_info {
  129.     short    alrter_errcode;
  130.     long    alrter_offset;
  131. };
  132.  
  133. /***   Admin alert other-info structure
  134.  */
  135.  
  136. struct admin_other_info {
  137.     short    alrtad_errcode;        /* code for message in net error message file */
  138.     short    alrtad_numstrings;    /* the number of merge strings 0-9 */
  139. };
  140.  
  141. /*    Followed by merge strings (consecutive ASCIIZ strings, count
  142.  *    is in alrtad_numstrings field).
  143.  */
  144.  
  145.  
  146. /***   User alert other-info structure
  147.  */
  148.  
  149. struct user_other_info {
  150.     short    alrtus_errcode;    /* code for message in net error message file */
  151.     short    alrtus_numstrings;     /* the number of merge strings 0-9 */
  152. };
  153.  
  154. /*    Followed by merge strings (consecutive ASCIIZ strings, count
  155.  *    is in alrtus_numstrings field).
  156.  *
  157.  *    Further followed by (consecutive ASCIIZ strings) ...
  158.  *
  159.  *        username
  160.  *        computername
  161.  */
  162.  
  163.  
  164.  
  165.  
  166. /***    Time set alert other-info structure.
  167.  *
  168.  *    Provides detailed information about a change in the system clock.
  169.  */
  170.  
  171. struct timeset_other_info {
  172.     unsigned long    alrtts_old_time;
  173.     unsigned long    alrtts_new_time;
  174.     unsigned long    alrtts_old_msec;
  175.     unsigned long    alrtts_new_msec;
  176.     unsigned char   alrtts_old_hsec;
  177.     unsigned char   alrtts_new_hsec;
  178.     unsigned short    alrtts_old_tz;
  179.     unsigned short    alrtts_new_tz;
  180. };
  181.  
  182.  
  183. /* -------------------- Begin f00 --------------------- */
  184.  
  185. #ifdef PURE_32
  186. /****************************************************************
  187.  *                                                              *
  188.  *              Function prototypes                             *
  189.  *                                                              *
  190.  ****************************************************************/
  191.  
  192. extern API32_FUNCTION
  193.   Net32AlertRaise ( const unsigned char    * pszEvent,
  194.                     const unsigned char    * pbBuffer,
  195.                     unsigned long            ulBuffer,
  196.                     unsigned long            ulTimeout );
  197.  
  198. extern API32_FUNCTION
  199.   Net32AlertStart ( const unsigned char    * pszEvent,
  200.                     const unsigned char    * pszRecipient,
  201.                     unsigned long            ulMaxData );
  202.  
  203. extern API32_FUNCTION
  204.   Net32AlertStop ( const unsigned char * pszEvent,
  205.                    const unsigned char * pszRecipient );
  206. #endif /* PURE_32 */
  207.  
  208. /* --------------------  End  f00  --------------------- */
  209.  
  210. /****************************************************************
  211.  *                                *
  212.  *          Special values and constants            *
  213.  *                                *
  214.  ****************************************************************/
  215.  
  216. /*
  217.  *    Names of standard Microsoft-defined alert events.
  218.  */
  219.  
  220. #define ALERT_PRINT_EVENT    "PRINTING"
  221. #define ALERT_MESSAGE_EVENT    "MESSAGE"
  222. #define ALERT_ERRORLOG_EVENT    "ERRORLOG"
  223. #define ALERT_ADMIN_EVENT    "ADMIN"
  224. #define ALERT_USER_EVENT    "USER"
  225.  
  226. /*
  227.  *     Three suggested timeouts (in milliseconds) for NetAlertRaise.
  228.  */
  229.  
  230. #define ALERT_SHORT_WAIT    100L
  231. #define ALERT_MED_WAIT        1000L
  232. #define ALERT_LONG_WAIT        10000L
  233.  
  234.  
  235.  
  236. #endif /* NETALERT_INCLUDED */
  237.  
  238. #if   defined(INCL_32) || defined(MIXED_32)
  239. #pragma linkage (NetAlertRaise, far16 pascal)
  240. #pragma linkage (NetAlertStart, far16 pascal)
  241. #pragma linkage (NetAlertStop, far16 pascal)
  242. #pragma pack()
  243. #endif
  244.