home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / stefanb_src / ums / test / check.c next >
Encoding:
C/C++ Source or Header  |  1994-11-26  |  1.0 KB  |  48 lines

  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. #include <clib/exec_protos.h>
  5. #include <pragmas/exec_pragmas.h>
  6. #include <libraries/ums.h>
  7. #include <clib/ums_protos.h>
  8. #include <pragmas/ums_pragmas.h>
  9.  
  10. struct TagItem Message[] = {
  11.  UMSTAG_WToName,   (ULONG) NULL,
  12.  UMSTAG_WToAddr,   (ULONG) NULL,
  13.  UMSTAG_WFromName, (ULONG) "Stefan Becker",
  14.  UMSTAG_WFromAddr, (ULONG) "stefanb@dfv.rwth-aachen.de",
  15.  UMSTAG_WSubject,  (ULONG) "Dupe Test",
  16.  UMSTAG_WAutoBounce, FALSE,
  17.  UMSTAG_WCheckHeader, TRUE,
  18.  
  19.  TAG_DONE
  20. };
  21.  
  22. extern struct Library *SysBase;
  23.  
  24. int main(int argc, char *argv[])
  25. {
  26.  struct Library *UMSBase;
  27.  
  28.  if (UMSBase = OpenLibrary("ums.library", 11)) {
  29.   UMSAccount account;
  30.  
  31.   if (account = UMSRLogin("meeting", "NNTPD", "")) {
  32.  
  33.    Message[0].ti_Data = (ULONG) "a";
  34.    Message[1].ti_Data = (ULONG) NULL;
  35.    printf("Result: %d\n", UMSWriteMsg(account, Message));
  36.  
  37.    Message[0].ti_Data = (ULONG) "stefanb";
  38.    Message[1].ti_Data = (ULONG) NULL;
  39.    printf("Result: %d\n", UMSWriteMsg(account, Message));
  40.  
  41.    UMSLogout(account);
  42.   }
  43.  
  44.   CloseLibrary(UMSBase);
  45.  }
  46.  return(0);
  47. }
  48.