home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / Kibitz / Start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  2.1 KB  |  98 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:             start.c
  5. ** Originally from:  Traffic Light 2.0 (2.0 version by Keith Rollin)
  6. ** Modified by:      Eric Soldan
  7. **
  8. ** Copyright © 1989-1992 Apple Computer, Inc.
  9. ** All rights reserved. */
  10.  
  11.  
  12.  
  13. /*****************************************************************************/
  14.  
  15.  
  16.  
  17. #include "Kibitz.h"                /* Get the Kibitz includes/typedefs, etc.    */
  18. #include "KibitzCommon.h"        /* Get the stuff in common with rez.        */
  19. #include "Kibitz.protos"        /* Get the prototypes for Kibitz.            */
  20.  
  21. #ifndef __TOOLUTILS__
  22. #include <ToolUtils.h>
  23. #endif
  24.  
  25. #ifndef __TEXTEDITCONTROL__
  26. #include <TextEditControl.h>
  27. #endif
  28.  
  29. #ifndef    __TSMTE__
  30. #include <TSMTE.h>
  31. #endif
  32.  
  33.  
  34.  
  35. /*****************************************************************************/
  36.  
  37.  
  38.  
  39. extern void _DataInit();
  40.  
  41.  
  42.  
  43. /*****************************************************************************/
  44. /*****************************************************************************/
  45.  
  46.  
  47.  
  48. #pragma segment Main
  49. void    main(void)
  50. {
  51.     NamesTableEntry    appNTE;
  52.     EntityName        appEntityName;
  53.     OSErr            atErr;
  54.  
  55. #ifdef __PPCC__
  56.     /* 
  57.        Work around compiler bug with aggregate initializers
  58.        of mixed alignment structures.
  59.     */
  60.     extern void InitNewDocData(void);
  61.     InitNewDocData();
  62. #endif /* __PPCC__ */
  63.  
  64. #ifdef applec
  65.     UnloadSeg((Ptr)_DataInit);        /* Note that _DataInit can't be in Main! */
  66. #endif
  67.     
  68.     SetApplLimit(GetApplLimit() - 16384);
  69.         /* This decreases the application heap by 16k, which in turn
  70.         ** increases the stack by 16k. */
  71.  
  72.     MaxApplZone();        /* Expand the heap so code segments load at the top. */
  73.     Initialize();                            /* Initialize the program. */
  74.  
  75.     DoSetCursor(*GetCursor(watchCursor));    /* Rest of startup may take a while. */
  76.  
  77.     StartDocuments();                /* Open (or print) designated documents. */
  78.  
  79.     if(CTEUseTSMTE())
  80.         InitTSMAwareApplication();
  81.  
  82.     UnloadSeg((Ptr)Initialize);        /* Initialize can't be in Main! */
  83.  
  84.     atErr = AddPPCNBPAlias(&appNTE, "\pKibitz", &appEntityName);
  85.  
  86.     EventLoop();                /* Call the main event loop. */
  87.  
  88.     if (!atErr) RemoveNBPAlias(&appEntityName);
  89.  
  90.     if(CTEUseTSMTE())
  91.         CloseTSMAwareApplication();
  92.  
  93.     ExitToShell();                    /* Quit the application. */
  94. }
  95.  
  96.  
  97.  
  98.