예제 #1
0
void localOutput(const char *format, va_list args) {
   static int initializedTrace XPT_DATA_SECTION = 0;
   char buffer[256];

   Int16 len = StrVPrintF(buffer, format, args);

   if (len >= sizeof buffer) {
      /* Bad news:  We overflowed the buffer.  Die now. */
      ErrDisplayFileLineMsg(__FILE__, (UInt16) __LINE__,
         "Overflowed msg buffer in utilities.c, localOutput()");
   }

   if (!initializedTrace) {
      HostTraceInit();
      initializedTrace = 1;
   }

   /* Call either HostTraceOutputT() or HostTraceOutputTL(), depending on     */
   /* whether or not the given string ends in a newline.  We don't support    */
   /* strings that have embedded newlines anywhere but at the end.            */
   len = StrLen(buffer);
   if (len) {
      if (buffer[len-1]=='\n') {
         buffer[len-1]='\0';
         HostTraceOutputTL(appErrorClass, buffer);
      } else {
         HostTraceOutputT(appErrorClass, buffer);
      }
   }
}
/***********************************************************************
 *
 * FUNCTION:    PilotMain
 *
 * DESCRIPTION: This is the main entry point for the application.
 *
 * PARAMETERS:  cmd - word value specifying the launch code. 
 *              cmdPB - pointer to a structure that is associated with the launch code. 
 *              launchFlags -  word value providing extra information about the launch.
 * RETURNED:    Result of launch
 *
 * REVISION HISTORY:
 *
 *
 ***********************************************************************/
UInt32 PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
{

//   char result[40];
HostTraceInit();

	return StarterPalmMain(cmd, cmdPBP, launchFlags);
}