home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 499.lha / GamePortDeviceToolKit / gameport.lzh / src / DeviceToolKits / GamePort / test_proto / test1.c < prev    next >
C/C++ Source or Header  |  1991-01-03  |  776b  |  44 lines

  1. #include <stdio.h>
  2.  
  3. #include "DeviceToolKits/GamePort.h"
  4. #ifndef  TESTPROTO
  5. #define  NO_PRAGMAS  1
  6. #endif
  7. #include "DeviceToolKits/proto/GamePort.h"
  8. #include "DeviceToolKits/GamePortBase.h"
  9.  
  10. DTGamePort_t   Unit1;
  11.  
  12. main(argc,argv)
  13. int   argc;
  14. char  *argv[];
  15. {
  16.    long  status;
  17.  
  18. #ifdef   TESTSHARED
  19. /*  Open the GamePort library  */
  20.  
  21.    DTGamePortOpen(DTGAMEPORTREV);
  22. #endif
  23.  
  24. /*  Try to initialize unit 1 of the GamePort  */
  25.  
  26.    if ((Unit1 = DTGamePortCreate(1L,&status)) == NULL) {
  27.       fprintf(stderr,"Error initializing unit 1 = %ld.\n",status);
  28.       fflush(stderr);
  29.       goto cleanup;
  30.    }
  31.  
  32.    fprintf(stderr,"Unit1 = %lX\n",(long) Unit1);
  33.    fflush(stderr);
  34.  
  35. /*  Free the stuff  */
  36.  
  37. cleanup:
  38.    DTGamePortFree(Unit1);
  39. #ifdef   TESTSHARED
  40.    DTGamePortClose();
  41. #endif
  42. }
  43.  
  44.