home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk393.lzh / LibTool / CComplex / ComplexCApp.c < prev   
C/C++ Source or Header  |  1990-10-28  |  2KB  |  84 lines

  1. /****************************************************************************
  2.   This is an example application to test the C "complex.library". Make the
  3.   glue code with LibTool (-c option).
  4.  
  5. Manx 3.6
  6.  
  7. cc +p ComplexCApp.c
  8. LibTool -cho glue.asm ComplexC.fd
  9. as -cd glue.asm
  10. ln -o ram:TestProgram ComplexCApp.o glue.o -lcl32
  11.  
  12. Lattice 5.0
  13.  
  14. lc -b0 ComplexCApp.c
  15. LibTool -cho glue.asm ComplexC.fd
  16. assemble glue.asm
  17. blink lib:c.o ComplexCApp.o glue.o LIB lib:lcnb.lib TO ram:TestProgram
  18.  
  19. ****************************************************************************/
  20.  
  21. #ifdef AZTEC_C
  22. #define NARGS
  23. #define NO_PRAGMAS
  24. #endif
  25.  
  26. #ifdef AZTEC_C
  27. #include "functions.h"
  28. #else
  29. #include "proto/all.h"
  30. #endif
  31.  
  32. #include <exec/types.h>
  33. #include <exec/io.h>
  34. #include <intuition/intuition.h>
  35.  
  36. /* LibTool made this include file */
  37. #include ComplexC.h
  38.  
  39. ULONG  argcount;  /* Saves argc from main(). argcount==0, then run from WB. */
  40.  
  41. #ifdef NARGS
  42. VOID exit_program();
  43. #else
  44. VOID exit_program( char, ULONG );
  45. long main( long, char ** );
  46. #endif
  47.  
  48. VOID exit_program( error_words, error_code )    /* All exits through here. */
  49. char  error_words;
  50. ULONG error_code;
  51. {
  52.     if( argcount && error_words ) puts( error_words );
  53.     CloseComplexBase();
  54.     exit( error_code );
  55. }
  56.  
  57.  
  58. /************************ MAIN ROUTINE *****************************/
  59.  
  60. VOID main(argc, argv)
  61. LONG argc;
  62. char **argv;
  63. {
  64. register struct Window *myWind;
  65.  
  66.     argcount = argc;
  67.  
  68.     /* open complex.library */
  69.     if (! (OpenComplexBase()) )
  70.         exit_program("Can't open complex library.\n", 10L);
  71.  
  72.     /* open a window by calling complex lib's MakeWindow() */
  73.     if ( !( myWind = MakeWindow() ) )
  74.         exit_program("Can't open window.\n", 11L);
  75.  
  76.     /* Print text to the window and wait for CLOSEWINDOW */
  77.     PrintMsg(10L, 20L, myWind, "Close window to exit");
  78.  
  79.     /* Close the window */
  80.     RemWindow(myWind);
  81.  
  82.     exit_program(0L,0L);
  83. }
  84.