home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / examples / reslib / test.c < prev   
Encoding:
C/C++ Source or Header  |  1996-12-24  |  1.1 KB  |  43 lines

  1. /* Copyright (c) 1992-1993 SAS Institute, Inc, Cary, NC, USA */
  2. /* All Rights Reserved */
  3.  
  4. #define __USE_SYSBASE 1
  5.  
  6. #include <proto/exec.h>
  7. #include <proto/dos.h>
  8. #include <exec/execbase.h>
  9. #include <stdio.h>
  10. #include "mylib_pragmas.h"
  11.  
  12. char __stdiowin[] = "con:0/0/640/100/";
  13.  
  14. struct Library *MyLibBase;
  15.  
  16. main()
  17. {
  18.         int ret;
  19.         
  20.         MyLibBase = OpenLibrary("mylib.library",0);
  21.  
  22.         if (MyLibBase)
  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.  
  33.             CloseLibrary(MyLibBase);
  34.  
  35.             printf("Library Closed.\n");
  36.  
  37.             /* If not running AmigaDOS 2.0 or above, we call Delay() */
  38.             /* to give them a chance to see the contents of the      */
  39.             /* window.  Under 2.0 and above, they have to click on   */
  40.             /* the close gadget before the window goes away.         */
  41.             if(SysBase->LibNode.lib_Version < 37) Delay(200);
  42.         }
  43. }