home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / utility / poplibsr / xlib.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-19  |  1.1 KB  |  66 lines

  1. /* Test Library Implementation */
  2.  
  3. #include "libs.h"
  4. #define XLIB_IMPLEMENTATION
  5. #include "xlib.h"
  6. #include <debug.h>
  7.  
  8.  
  9. /*===== Library Entry Points =====*/
  10.  
  11.  
  12. void XLibP0 () { DEBUG(("in XLibP0\n")); }
  13. void XLibP1 () { DEBUG(("in XLibP1\n")); }
  14. void XLibP2 () { DEBUG(("in XLibP2\n")); }
  15.  
  16.  
  17. /*===== Overhead =====*/
  18.  
  19.  
  20. /* array of entry points for this library */
  21.  
  22. Procedure XLibBase[] = {
  23.   XLibP0,
  24.   XLibP1,
  25.   XLibP2
  26. };
  27.  
  28.  
  29. /*
  30.     This routine is called by FindLibrary when a program wants
  31.     to use the library.  If the version number given by the caller
  32.     is not acceptable we will return NULL.  If we wanted to support
  33.     more than one version with the same library, we could choose to
  34.     return a different library base pointer for some versions. 
  35. */
  36.  
  37. Library
  38. Entrance (version)
  39.   int version;
  40. {
  41.   DEBUG(("XLib Entrance with version %d\n",version)); 
  42.   if (version==XLIB_VERSION)
  43.     return XLibBase;
  44.   return 0L;
  45. }
  46.  
  47.  
  48. /* The link for this library */
  49.  
  50. LibLink XLib = {
  51.   0L,
  52.   XLIB_NAME,
  53.   XLIB_VERSION,
  54.   Entrance
  55. };
  56.  
  57.  
  58. /* initialization code for library */
  59.  
  60. int
  61. main ()
  62. {
  63.   /* install this library */
  64.   return InstallLibrary(&XLib,0L);
  65. }
  66.