Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsCommandLineServiceMac.cpp File Reference
#include "nsCommandLineServiceMac.h"
#include "nsDebug.h"
#include "nsILocalFileMac.h"
#include "nsNetUtil.h"
#include "nsIAppStartup.h"
#include "nsIServiceManager.h"
#include "nsIURL.h"
#include "nsIIOService.h"
#include "nsNetCID.h"
#include "nsIDOMWindow.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIWindowWatcher.h"
#include "jsapi.h"
#include "nsReadableUtils.h"
#include "nsICloseAllWindows.h"
#include "nsIPrefService.h"
#include "nsAEEventHandling.h"
#include "nsXPFEComponentsCID.h"
#include "prmem.h"
#include "plstr.h"
#include "prenv.h"

Go to the source code of this file.

Functions

static PRInt32 ReadLine (FILE *inStream, char *buf, PRInt32 bufSize)
static PRUint32 ProcessAppleEvents ()
void SetupMacCommandLine (int &argc, char **&argv)

Function Documentation

static PRUint32 ProcessAppleEvents ( ) [static]

Definition at line 109 of file nsCommandLineServiceMac.cpp.

{
  // Dispatch all of the Apple Events waiting in the event queue.

  PRUint32 processed = 0;

  const EventTypeSpec kAppleEventList[] = {
    { kEventClassAppleEvent, kEventAppleEvent },
  };

  EventRef carbonEvent;
  while (::ReceiveNextEvent(GetEventTypeCount(kAppleEventList),
                            kAppleEventList,
                            kEventDurationNoWait,
                            PR_TRUE,
                            &carbonEvent) == noErr) {
    EventRecord eventRecord;
    ::ConvertEventRefToEventRecord(carbonEvent, &eventRecord);
    ::AEProcessAppleEvent(&eventRecord);
    ::ReleaseEvent(carbonEvent);
    processed++;
  }

  return processed;
}
static PRInt32 ReadLine ( FILE inStream,
char *  buf,
PRInt32  bufSize 
) [static]

Definition at line 89 of file nsCommandLineServiceMac.cpp.

{
  PRInt32 charsRead = 0;
  int c;
  
  if (bufSize < 2)
    return -1;

  while (charsRead < (bufSize-1)) {
    c = getc(inStream);
    if (c == EOF || c == '\n' || c == '\r')
      break;
    buf[charsRead++] = c;
  }
  buf[charsRead] = '\0';
  
  return (c == EOF && !charsRead) ? -1 : charsRead; 
}
void SetupMacCommandLine ( int argc,
char **&  argv 
)

Definition at line 505 of file nsCommandLineServiceMac.cpp.

{
  nsMacCommandLine& cmdLine = nsMacCommandLine::GetMacCommandLine();
  return cmdLine.SetupCommandLine(argc, argv);
}

Here is the caller graph for this function: