home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / examples / samplelib / try_one.c < prev   
Encoding:
C/C++ Source or Header  |  1996-12-24  |  896 b   |  37 lines

  1. #include "proto/exec.h"
  2. #include "proto/dos.h"
  3. #include "test_pragmas.h"
  4. #include <stdio.h>
  5.  
  6. char __stdiowin[] = "con:0/0/640/100";
  7.  
  8.  
  9. struct Library *TestBase;
  10.  
  11. main()
  12. {
  13.         int ret;
  14.         
  15.         printf("Each time this version is run, the value\n");
  16.         printf("returned from test1() will be incremented\n");
  17.         printf("The value is not reset unless the library\n");
  18.         printf("gets flushed from memory.\n");
  19.         
  20.         
  21.         TestBase = OpenLibrary("test_one.library",0);
  22.         if (TestBase)
  23.         {
  24.             printf("Library Opened Sucessfully.\n");
  25.             ret = test1();
  26.             
  27.             printf("test1 returned = %d\n", ret);
  28.             
  29.             test2(ret+1);
  30.             
  31.             printf("test1 returned = %d\n",test1());
  32.             CloseLibrary(TestBase);
  33.             printf("Library Closed.\n");
  34.             Delay(200);
  35.         }
  36. }
  37.