home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 376_01 / os2tool.000 / ALERT.C < prev    next >
C/C++ Source or Header  |  1992-08-25  |  1KB  |  51 lines

  1. /* =========================================================
  2. *
  3. *  ALERT.C - General alert mechanism.
  4. *
  5. *  Version 1.0
  6. *
  7. *  COPYRIGHT(c)   :     Dis Kit Project
  8. *  CREATED        :     11.8.1992
  9. *  PROGRAMMER     :     Martti Ylikoski
  10. *  NOTES          :
  11. *  LAST UPDATE    :     
  12. *
  13. *
  14. * ==========================================================*/
  15. #define INCL_DOS
  16. #include <os2.h>
  17. #include <stdio.h>
  18. #include <string.h>
  19. #include <netcons.h>
  20. #include <message.h>
  21. #include "alert.h"
  22.  
  23.  
  24. /*
  25. int main(int argc, char *argv[])
  26. {
  27.  
  28.    if (argc < 3)
  29.    {
  30.       printf("%s: at least 2  arguments are needed!\Exiting...\n", argv[0]) ;
  31.       printf("Usage: %s user message\n", argv[0] ) ;
  32.       return( 1 ) ;
  33.    }
  34.    
  35.    alert(argv[1], argv[2]) ;
  36.    return( 0 ) ;
  37. }
  38. */
  39.  
  40. int alert (char *machine, char *user, char *message)
  41. {
  42. unsigned short ret ;
  43.  
  44.    ret = NetMessageBufferSend(machine, user, message,
  45.               (unsigned short) strlen(message)) ;
  46.    if (ret != 0)
  47.       return( ERROR ) ;
  48.    else
  49.       return( OK ) ;
  50. }
  51.