home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / diskmags / amiga_9310b.lha / SAS-Libraries / teststack.c < prev   
Encoding:
C/C++ Source or Header  |  1993-09-27  |  468 b   |  27 lines

  1. #include <exec/types.h>
  2. #include <proto/exec.h>
  3. #include <stdio.h>
  4. #include "stack_pragmas.h"
  5.  
  6. struct Library *StackBase;
  7.  
  8. extern ULONG Push(ULONG);
  9. extern ULONG Pop(void);
  10.  
  11. main(int argc,
  12.      unsigned char *argv[]) {
  13.   if(StackBase = OpenLibrary
  14.         ("stack.library",0L)) {
  15.     ULONG i;
  16.     for(i = 0; i < 50; i++) {
  17.       printf("Push=%ld\n",Push(i));
  18.     }
  19.  
  20.     while((i = Pop()) != -1) {
  21.       printf("Pop=%ld\n",i);
  22.     }
  23.     CloseLibrary(StackBase);
  24.   }
  25.  
  26. }
  27.