home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / YAEC / examples / bla.library.e < prev    next >
Encoding:
Text File  |  2001-02-23  |  1.2 KB  |  45 lines

  1. LIBRARY 'bla.library', 37, 1, 'bla.library by nisse 2001'
  2.  
  3. /* NOTE1 : LIBRARY mode is not for beginners */
  4.  
  5. /* NOTE2 : we only have execbase opened for us ! */
  6.  
  7. /* NOTE3 : do NOT pass out exceptions from librarycode */
  8.  
  9. /* NOTE4 : filename of library will be src-filename without .e */
  10.  
  11. /* NOTE5 : unlike ec3.3a, yaec libraries uses SHARED globals */
  12.  
  13. /* NOTE6 : at the moment, you have to write your .ext/.fd files by hand ! */
  14.  
  15. /* our public entrypoints, starting at -30 */
  16.                     
  17. ENTRY Nisse IS nisse(D0, A0, A1) -> any regs BUT a2/a4/a7/d7 !
  18.  
  19. ENTRY BlaBla IS bla(D0, A0)
  20.  
  21. /* the four required functions */
  22. /* see amiga dev cd x.x (RKM) for info about theese functions */
  23. /* for example, do NOT use functions that could break Forbid()! */
  24.  
  25. PROC Init() -> gets called once (when loaded from disk) !
  26. ENDPROC libbase  -> return base for success
  27.  
  28. PROC Open() -> gets called on every OpenLibrary() !
  29. ENDPROC libbase  -> return base for success
  30.  
  31. PROC Close() -> get scalled on every CloseLibrary() !
  32. ENDPROC
  33.  
  34. PROC Expunge() -> gets called once (when removed from mem) !
  35. ENDPROC
  36.  
  37. /* just some silly functions */
  38.  
  39. PROC nisse(x, y, z)
  40. ENDPROC x+y+z
  41.  
  42. PROC bla(a, b)
  43. ENDPROC a+b
  44.  
  45.