home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 262.lha / ACResLib_v1.1 / testlib.c < prev    next >
C/C++ Source or Header  |  1989-06-29  |  1KB  |  50 lines

  1. #include <exec/types.h>
  2. #include <stdio.h>
  3.  
  4. long MyBase;
  5. /*   ^^^^^^ should be the same as the #define'd BASE in mylib.c */
  6.  
  7. #include "mylibpragma.h"
  8. /*        ^^^^^^^^^^^^^ created by fd2pragma of mylib.fd */
  9.  
  10. #define RTC printf("return to continue - ");fflush(stdout);\
  11. getchar();
  12.  
  13. #define DOUBARG 19
  14.  
  15. char text[100] = "hello";
  16.  
  17. main()
  18. {
  19.      LONG     retval;
  20.  
  21.      printf("here we go\n");
  22.      MyBase = (APTR) OpenLibrary("mylib.library", 0L);
  23.      printf("openlib returns base: %lx\n", MyBase);
  24.  
  25.      RTC;
  26.  
  27.      if (MyBase)
  28.      {
  29.          /* test function GetDown()      */
  30.          retval = GetDown();
  31.          printf("called getdown, %ld returned\n", retval);
  32.          RTC;
  33.  
  34.          /* test function Double()       */
  35.          printf("double of %d = %ld\n", DOUBARG, Double((LONG)DOUBARG));
  36.          RTC;
  37.  
  38.          /* test function Triple()       */
  39.          printf("Here is three times %d: %ld\n",DOUBARG,
  40.              Triple((LONG)DOUBARG));
  41.          RTC;
  42.  
  43.          printf("Here is 12+13: %ld\n",Add((LONG)12,(LONG)13));
  44.  
  45.          printf("Here is hello+there: %s\n",StrCat(text,"there"));
  46.  
  47.          CloseLibrary(MyBase);
  48.      }
  49. }
  50.