home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / CLISP / CLISPSRC.TAR / clisp-1995-01-01 / amiga / jchlib / test.c < prev   
Encoding:
C/C++ Source or Header  |  1994-10-24  |  1009 b   |  41 lines

  1. /* test file for the Tiny GCC Library */
  2. #include <exec/types.h>
  3. #include <libraries/dos.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <libgoodies.h>    /* for BPTRfprintf() */
  7.  
  8. #include <inline/dos.h>
  9.  
  10. /* This comes from the startup code */
  11. extern BPTR Output_handle;
  12.  
  13. const char *usage = "Usage:
  14. Please try this from WorkBench also, using the ARGS tooltype.
  15. When called with four arguments, does setjmp() test.
  16. ";
  17.  
  18. int main(int argc, char *argv[])
  19. {
  20.   /* the startup code should have initialised this */
  21.   if (Output_handle == NULL) exit(RETURN_FAIL);
  22.  
  23.   Write(Output_handle,"Hello World!\n",13);
  24.   switch (argc)
  25.     {
  26.     case 0:
  27.       Write(Output_handle,"argc is 0!",10);
  28.       break;
  29.     default:
  30.       BPTRfprintf(Output_handle,"Argc is %ld:\n",argc);
  31.     }
  32.   if (argc > 0)
  33.     { int i;
  34.       for (i=0; i<argc; i++)
  35.         { BPTRfprintf(Output_handle,"%ld: %s\n",i,argv[i]); }
  36.     }
  37.   if (argc == 1)
  38.     { Write(Output_handle,usage,strlen(usage)); }
  39.   exit(RETURN_WARN-1); /* test return code */
  40. }
  41.