コード例 #1
0
CDspDispConfigGuard::~CDspDispConfigGuard ()
{
	CleanupConfig();
	delete m_pMultiEditDispConfig;
}
コード例 #2
0
ファイル: squish.c プロジェクト: klamonte/maximus
int _stdc main(int argc, char *argv[])
{
  char *p;

  NW(__fd2n);

#if defined(__FLAT__) && !defined(UNIX)
  Hello("SQUISH/386", "SquishMail Conference Processor", version, "1990, " THIS_YEAR);
#elif defined(LINUX)
  Hello("SQUISH/LINUX", "SquishMail Conference Processor", version, "1990, " THIS_YEAR);
#elif defined(UNIX)
  Hello("SQUISH/UNIX", "SquishMail Conference Processor", version, "1990, " THIS_YEAR);
#else
  Hello("SQUISH", "SquishMail Conference Processor", version, "1990, " THIS_YEAR);
#endif

#ifdef OS_2 /* Serialize Squish's execution */
  BbsSemSerialize("/sem/squish/default", "BBSSEM");
#endif

#ifdef __WATCOMC__
  setbuf(stdout, NULL);
#endif

#ifdef DMALLOC
  /*dmalloc_on(TRUE);*/
#endif

#ifdef DJ
  dj=fopen("dj.log", "a");
#endif

#ifdef UNIX
  if (!getenv("SQUISH"))
    putenv("SQUISH=" INSTALL_PREFIX "/etc/squish.cfg");
#endif

  if (!fexist(ar.cfgname) && (p=getenv("SQUISH")) != NULL)
    (void)strcpy(ar.cfgname, p);

#if defined(__MSDOS__) && !defined(__FLAT__)
  install_24();
  (void)atexit(uninstall_24);
#endif

  if (argc < 2)
    usage();
    
  Initialize_Variables();

  /* Use the SQUISH environment variable to locate config file, if necessary */

  p=getenv("SQUISH");

  if (p && !fexist(ar.cfgname)) /* as long as there's no squish.cfg in cwd */
    (void)strcpy(ar.cfgname, p);

  ParseArgs(&ar, (byte **)argv);   /* Command-line arguments */
/*  strcpy(ar.cfgname,"Squish.Cfg");*/

  Parse_Config(ar.cfgname);  /* parse squish.cfg and areas.bbs */

/*
  {
    NETADDR bill={1,249,1,0};

    if (DestIsHereA(&bill))
      printf("!!! This copy of Squish is registered to Bill Cassidy !!!\n");
  }
*/

  Parse_Areas(*ar.areasbbs ? ar.areasbbs : config.areasbbs);

  /* If a log-file override was specified on the command line */

  if (*ar.logfile)
  {
    if (config.logfile)
      free(config.logfile);

    config.logfile=sstrdup(ar.logfile);
  }

  InitializeConfig();     /* Initialize configuration */

  if (ar.action==ACTION_GET || ar.action==ACTION_SEND ||
      ar.action==ACTION_UPDATE || ar.action==ACTION_POLL)
  {
    config.flag &= ~FLAG_ADDMODE;
    HandleAttReqPoll(ar.action, ar.toscan);
  }
  else SquishSquashCycle();

#ifdef DJ
  if (dj)
    fclose(dj);
#endif

  CleanupConfig();

  (void)printf("\n" SQNAME ": Done!\n");

  return (erl_max ? ERL_MAXMSGS : erl_echo ? ERL_TOSS_ECHO :
          erl_net ? ERL_TOSS_NET : erl_sent ? ERL_SENT_ECHO :
          ERL_NONE);
}