home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / stefanb_src / ums / test / writevar.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-24  |  1.0 KB  |  49 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. static struct TagItem TagArray[] = {
  11.  UMSTAG_CfgName,  (ULONG) "temp.123456",
  12.  UMSTAG_CfgData,  (ULONG) "g1\ng2\ng3",
  13.  UMSTAG_CfgLocal, TRUE,
  14.  TAG_DONE
  15. };
  16.  
  17. extern struct Library *SysBase;
  18.  
  19. int main(int argc, char *argv[])
  20. {
  21.  struct Library *UMSBase;
  22.  
  23.  if (UMSBase = OpenLibrary("ums.library", 11)) {
  24.   UMSAccount account;
  25.  
  26.   if (account = UMSRLogin("test", "uucp.lilly", "")) {
  27.    ULONG rc;
  28.  
  29. #if 1
  30.    rc = UMSWriteConfigTags(account, UMSTAG_CfgName,  "temp.123456",
  31.                                     UMSTAG_CfgData,  "g1\ng2\ng3",
  32.                                     UMSTAG_CfgLocal, TRUE,
  33.                                     TAG_DONE);
  34. #else
  35.    rc = UMSWriteConfig(account, TagArray);
  36. #endif
  37.  
  38.    printf("Result: 0x%08lx\n", rc);
  39.  
  40.    printf("UMS Error: %d - %s\n", UMSErrNum(account), UMSErrTxt(account));
  41.  
  42.    UMSLogout(account);
  43.   }
  44.  
  45.   CloseLibrary(UMSBase);
  46.  }
  47.  return(0);
  48. }
  49.