예제 #1
0
파일: ipc.c 프로젝트: Paresh1693/carmen
IPC_RETURN_TYPE _IPC_initialize (BOOLEAN isLispModule)
{
  x_ipcModuleInitialize();
#ifdef LISP
  if (isLispModule) set_Is_Lisp_Module();
#else
  if (isLispModule) ; /* No-op to keep compiler happy */
#endif
  return IPC_OK;
}
예제 #2
0
파일: ipc.c 프로젝트: guillep19/frob
IPC_RETURN_TYPE IPC_initialize (void)
{
  x_ipcModuleInitialize();
  return IPC_OK;
}
예제 #3
0
int main(int argc, char **argv)
#endif
{
  int expectedMods = 0;
  
#ifdef macintosh
  doSiouxStuff();
  argc = ccommand(&argv);
#endif
 
  /* Added by Bob Goode/Tam Ngo, 5/21/97, for WINSOCK option. */
#ifdef OS2
  sock_init();
#elif defined(_WINSOCK_)
  startWinsock();
#endif /* Winsock DLL loading */

  x_ipcModuleInitialize();
#ifdef VXWORKS
  /* Do this only after the socket is set up (in case there is an
     old central lying around that needs killed */
  centralTID = taskIdSelf();
#endif
  globalSInit();
  
#if !defined(THINK_C) && !defined(macintosh) && !defined(__TURBOC__) && !defined(OS2) && !defined(_WIN95_MSC_) && !defined(WINNT) && !defined(WIN32)
  (void)signal(SIGINT, abortCentral);
  (void)signal(SIGBUS, abortCentral);
  (void)signal(SIGSEGV, abortCentral);
  (void)signal(SIGPIPE, pipeClosedHnd);
  (void)signal(SIGTERM, abortCentral);
#endif /* !THINK_C && !macintosh */
  
#ifndef VXWORKS
  if ((argc > 1) && (STREQ(argv[1], "-v")))
    displayVersion();
  else if ((argc > 1) && (STREQ(argv[1], "-h"))) {
    displayOptions(argv[0]);
#ifdef macintosh
  SIOUXSettings.autocloseonquit = FALSE;
#endif
  } else {
    parseExpectedMods(argc, argv, &expectedMods);
    parseCommandLineOptions(argc, argv);
#else
  if ((options!= NULL) && (strstr(options, "-v") || strstr(options, "-V"))) {
    displayVersion();
  } else if ((options!= NULL) && 
	     (strstr(options, "-h") || strstr(options, "-H"))) {
    displayOptions("central");
  } else {
    parseOpsFromStr(options, &expectedMods, FALSE);
#endif
      
    if (expectedMods < 1)
      expectedMods = 1;
      
    if (!serverInitialize(expectedMods)) {
      X_IPC_ERROR("ERROR: Unable to start server, Is one already running?\n");
    }
      
#ifndef VXWORKS
    /* Register a method for freeing memory in an emergency. */
    x_ipcRegisterFreeMemHnd(centralFreeMemory,3);
      
    if (GET_S_GLOBAL(listenToStdin))
      printPrompt();
#endif

#ifndef DEFAULT_OPTIONS
    fprintf(stderr, "central running...\n");
#endif

    listenLoop();
  }
#ifdef _WINSOCK_
  WSACleanup();
  printf("Socket cleaned up.");
#endif /* Unload Winsock DLL */
#ifndef VXWORKS
  return 1;
#endif
}