コード例 #1
0
ファイル: windovl.cpp プロジェクト: dylancarlson/citplus
Bool TERMWINDOWMEMBER save_screen(void)
	{
#ifndef WINCIT
	if (saveBuffer == NULL)
		{
		compactMemory();

		saveBuffer = new char[(conRows + 1) * conCols * 2];

		if (saveBuffer == NULL)
			{
			mPrintfCR(getmsg(135));
			return (FALSE);
			}
		else
			{
			memcpy(saveBuffer, logiScreen,
					((scrollpos + 1) * conCols * 2));

			if (scrollpos != conRows)
				{
				memset(saveBuffer + ((scrollpos + 1) * conCols * 2), 0,
						(conRows - scrollpos) * conCols * 2);
				}

			s_conRows = conRows;
			return (TRUE);
			}
		}
	else
		{
		return (FALSE);
		}
#else
	return (FALSE);
#endif
	}
コード例 #2
0
ファイル: netnode.cpp プロジェクト: dylancarlson/citplus
Bool ReadNodesCit(NodesCitC **newNode, const char *NameOrAddrToFind, ModemConsoleE W, Bool option)
#endif
    {
    FILE *fBuf;
    char *words[256];
    int i;
    char path[80];
    int count;
    uint lineno = 0;
    l_slot logslot;

    if (!read_node_ddata())
        {
        TWwPrintf(W, getmsg(59));
        return (FALSE);
        }

    const char **nodekeywords = (const char **) nddd->aux;
    const char **nettypes = (const char **) nddd->next->aux;
    const char **nodemsgs = (const char **) nddd->next->next->aux;

    label NameToFind;
    CopyStringToBuffer(NameToFind, NameOrAddrToFind);

    if (SameString(NameOrAddrToFind, getnodemsg(2)))
        {
        // if default, start fresh
        if (!clearNode(newNode))
            {
            dump_node_ddata();
            return (FALSE);
            }
        }
    else
        {
        // else first read in default
#ifdef WINCIT
        ReadNodesCit(TW, newNode, getnodemsg(2), W, FALSE);
#else
        ReadNodesCit(newNode, getnodemsg(2), W, FALSE);
#endif

        if (*newNode)
            {
#ifdef WINCIT
            logslot = nodexists(NameOrAddrToFind, TW ? TW->LogOrder : NULL);
#else
            logslot = nodexists(NameOrAddrToFind);
#endif

            if (logslot == CERROR)
                {
                TWwDoCR(W);
                TWwPrintf(W, getnodemsg(3), NameOrAddrToFind);

                if (strlen(NameOrAddrToFind) < 4)
                    {
                    char temp[4];

                    CopyStringToBuffer(temp, NameOrAddrToFind);
                    strlwr(temp);
                    TWwPrintf(W, getnodemsg(4), temp, cfg.locID);
                    }

                dump_node_ddata();
                return (FALSE);
                }

            label Alias, LocID;

#ifdef WINCIT
            if (!*LogTab[TW ? TW->LogOrder[logslot] : logslot].GetAlias(Alias, sizeof(Alias)) ||
                    !*LogTab[TW ? TW->LogOrder[logslot] : logslot].GetLocID(LocID, sizeof(LocID)))
#else
            if (!*LTab(logslot).GetAlias(Alias, sizeof(Alias)) || !*LTab(logslot).GetLocID(LocID, sizeof(LocID)))
#endif
                {
                TWwDoCR(W);
                TWwPrintf(W, getnodemsg(5), NameOrAddrToFind);

                dump_node_ddata();
                return (FALSE);
                }

            (*newNode)->SetAlias(Alias);
            (*newNode)->SetLocID(LocID);

            label FileName;
            sprintf(FileName, getnodemsg(6), (*newNode)->GetAlias());
            (*newNode)->SetMailFileName(FileName);

            // Make sure NameToFind is a name, not address.
#ifdef WINCIT
            LogTab[TW ? TW->LogOrder[logslot] : logslot].GetName(NameToFind, sizeof(NameToFind));
#else
            LTab(logslot).GetName(NameToFind, sizeof(NameToFind));
#endif

            // Support for optional nodes.cit entries.
            (*newNode)->SetName(NameToFind);
            }
        }

    if (!*newNode)
        {
        cOutOfMemory(44);
        dump_node_ddata();
        return (FALSE);
        }

    compactMemory();

    sprintf(path, sbs, cfg.homepath, getnodemsg(8));

    if ((fBuf = fopen(path, FO_R)) == NULL) // ASCII mode
        {
        TWdoccr();
        TWcPrintf(getmsg(15), getnodemsg(8));
        TWdoccr();

        dump_node_ddata();
        return (option);
        }

    char line[256];
    Bool FoundOurEntry = FALSE;
    long pos = ftell(fBuf);
    while (fgets(line, 254, fBuf) != NULL)
        {
        lineno++;

        if (line[0] != '#')
            {
            pos = ftell(fBuf);
            continue;
            }

        // Don't read anything until we found our entry, except possible beginnings of our entry. (#NODE...)
        if (!FoundOurEntry && strnicmp(line + 1, nodekeywords[NOK_NODE], strlen(nodekeywords[NOK_NODE])) != SAMESTRING)
            {
            pos = ftell(fBuf);
            continue;
            }

        // Save a copy of the line in case this is the #LOGIN macro: parse_it
        // changes what is passed to it.
        char ltmp[256];
        CopyStringToBuffer(ltmp, line);

        count = parse_it(words, line);

        // Look up our first word in table of keywords.
        for (i = 0; i < NOK_NUM; i++)
            {
            if (SameString(words[0] + 1, nodekeywords[i]))
                {                   //^ add one for '#'
                break;
                }
            }

        if (i < NOK_NUM && !words[1][0])    // valid keywords need a param
            {
            TWcPrintf(getnodemsg(9), getnodemsg(8), ltoac(lineno), nodekeywords[i], ns);
            TWdoccr();
            continue;
            }

        if (i == NOK_NODE)
            {
            // This is a #NODE line... if we have alread found our entry,
            // then this is the start of the next one, and we are done.
            if (FoundOurEntry)
                {
                fclose(fBuf);
                dump_node_ddata();
                return (TRUE);
                }

            // This is a #NODE line... if it is for us, then we have now
            // found our entry. If not, then we continue looking.
            if (SameString(NameToFind, words[1]))
                {
                FoundOurEntry = TRUE;
                }
            else
                {
                pos = ftell(fBuf);
                continue;
                }
            }

        switch (i)
            {
            case NOK_BAUD:
                {
                PortSpeedE PS = digitbaud(atol(words[1]));

                if (PS == PS_ERROR)
                    {
                    TWcPrintf(getnodemsg(9), getnodemsg(8), ltoac(lineno), nodekeywords[i], words[1]);
                    TWdoccr();
                    }
                else
                    {
                    (*newNode)->SetBaud(PS);
                    }

                break;
                }

            case NOK_DIALOUT:
            case NOK_PHONE:
                {
                (*newNode)->SetDialOut(words[1]);

                if (strlen(words[1]) > 49)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], 50);
                    TWdoccr();
                    }

                break;
                }

            case NOK_PREDIAL:
                {
                (*newNode)->SetPreDial(words[1]);

                if (strlen(words[1]) > 63)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], 64);
                    TWdoccr();
                    }

                break;
                }

            case NOK_FETCH_TIMEOUT:
                {
                (*newNode)->SetFetchTimeout(atoi(words[1]));
                break;
                }

            case NOK_ZIP:
                {
                if (!words[2][0])   // need second param
                    {
                    TWcPrintf(getnodemsg(9), getnodemsg(8), ltoac(lineno), nodekeywords[i], ns);
                    TWdoccr();
                    continue;
                    }
                else
                    {
                    (*newNode)->SetCreatePacket(words[1]);

                    if (strlen(words[1]) > 39)
                        {
                        TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], 40);
                        TWdoccr();
                        }

                    (*newNode)->SetExtractPacket(words[2]);

                    if (strlen(words[2]) > 39)
                        {
                        TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], 40);
                        TWdoccr();
                        }
                    }

                break;
                }

            case NOK_NETWORK:
                {
                (*newNode)->SetNetworkRevisionNumber(0);

                NETTYPES j;
                for (j = (NETTYPES) 0; j < NET_NUM; j = (NETTYPES) (j + 1))
                    {
                    if (SameString(words[1], nettypes[j]))
                        {
                        break;
                        }
                    }

                if (j == NET_DCIT11)
                    {
                    j = NET_DCIT10;
                    }

                if (j == NET_6_9a)
                    {
                    (*newNode)->SetNetworkRevisionNumber(1);
                    j = NET_6_9;
                    }

                if (j == NET_NUM)
                    {
                    TWcPrintf(getnodemsg(9), getnodemsg(8), ltoac(lineno), nodekeywords[i], words[1]);
                    TWdoccr();
                    }
                else
                    {
                    (*newNode)->SetNetworkType(j);
                    }

                break;
                }

            case NOK_PROTOCOL:
                {
                (*newNode)->SetProtocol(words[1][0]);
                break;
                }

            case NOK_AUTOHALL:
                {
                (*newNode)->SetAutoHall(hallexists(words[1]));

                if (strlen(words[1]) > LABELSIZE)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], LABELSIZE + 1);
                    TWdoccr();
                    }

                break;
                }

            case NOK_AUTOGROUP:
                {
                (*newNode)->SetAutoGroup(FindGroupByName(words[1]));

                if (strlen(words[1]) > LABELSIZE)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], LABELSIZE + 1);
                    TWdoccr();
                    }

                break;
                }

            case NOK_MAPUNKGROUP:
                {
                g_slot GroupSlot = FindGroupByName(words[1]);

                if (GroupSlot == CERROR)
                    {
                    GroupSlot = SPECIALSECURITY;
                    }

                (*newNode)->SetMapUnknownGroup(GroupSlot);

                if (strlen(words[1]) > LABELSIZE)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], LABELSIZE + 1);
                    TWdoccr();
                    }

                break;
                }

            case NOK_LOGIN:
                {
                (*newNode)->SetLoginMacro(ltmp + strlen(nodekeywords[NOK_LOGIN]) + 1);
                break;
                }

            case NOK_NODE:
                {
                // A bit silly.
                (*newNode)->SetName(words[1]);

                if (strlen(words[1]) > LABELSIZE)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], LABELSIZE + 1);
                    TWdoccr();
                    }

                if (count > 2)
                    {
                    (*newNode)->SetOldRegion(words[2]);

                    if (strlen(words[2]) > LABELSIZE)
                        {
                        TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], LABELSIZE + 1);
                        TWdoccr();
                        }
                    }
                else
                    {
                    (*newNode)->SetOldRegion(ns);
                    }

                (*newNode)->FreeMappedGroups();
                (*newNode)->SetRoomOffset(0);

                break;
                }

            case NOK_DIAL_TIMEOUT:
                {
                (*newNode)->SetDialTimeout(atoi(words[1]));
                break;
                }

            case NOK_REQUEST:
                {
                (*newNode)->SetRequest(atoi(words[1]));
                break;
                }

            case NOK_WAIT_TIMEOUT:
                {
                (*newNode)->SetWaitTimeout(atoi(words[1]));
                break;
                }

            case NOK_AUTOROOM:
                {
                (*newNode)->SetAutoRoom(atoi(words[1]));
                break;
                }

            case NOK_VERBOSE:
                {
                (*newNode)->SetDefaultVerbose();

                const char **verbosekeywords = (const char **) nddd->next->next->next->aux;

                for (int j = 1; j < count; j++)
                    {
                    if (SameString(words[j], getnodemsg(39)))
                        {
                        (*newNode)->SetDefaultVerbose();
                        }
                    else if (SameString(words[j], getnodemsg(40)))
                        {
                        (*newNode)->SetDefaultVerbose();
                        (*newNode)->SetVerbose(NCV_FILE69INFULL, TRUE);
                        (*newNode)->SetVerbose(NCV_NOACCESS, TRUE);
                        }
                    else if (SameString(words[j], getnodemsg(41)))
                        {
                        (*newNode)->SetDefaultVerbose();
                        (*newNode)->SetVerbose(NCV_FILE69INFULL, TRUE);
                        (*newNode)->SetVerbose(NCV_NOACCESS, TRUE);
                        (*newNode)->SetVerbose(NCV_ROOMCREATED, TRUE);
                        (*newNode)->SetVerbose(NCV_ROOMNOTCREATED, TRUE);
                        (*newNode)->SetVerbose(NCV_NETIDNOTFOUND, TRUE);
                        (*newNode)->SetVerbose(NCV_NONETIDONSYSTEM, TRUE);
                        }
                    else
                        {
                        const char *Keyword;
                        Bool NewSetting;

                        if (words[j][0] == '!')
                            {
                            Keyword = words[j] + 1;
                            NewSetting = FALSE;
                            }
                        else
                            {
                            Keyword = words[j];
                            NewSetting = TRUE;
                            }

                        NCV_Type TestType;

                        for (TestType = (NCV_Type) 0; TestType < NCV_MAX; TestType = (NCV_Type) (TestType + 1))
                            {
                            if (SameString(Keyword, verbosekeywords[TestType]))
                                {
                                (*newNode)->SetVerbose(TestType, NewSetting);
                                break;
                                }
                            }

                        if (TestType == NCV_MAX)
                            {
                            if (SameString(Keyword, getnodemsg(13)))
                                {
                                // ALL
                                for (TestType = (NCV_Type) 0; TestType < NCV_MAX; TestType = (NCV_Type) (TestType + 1))
                                    {
                                    (*newNode)->SetVerbose(TestType, NewSetting);
                                    }
                                }
                            else
                                {
                                TWcPrintf(getnodemsg(12), getnodemsg(8), ltoac(lineno), words[0], Keyword);
                                TWdoccr();
                                }
                            }
                        }
                    }

                break;
                }

            case NOK_CHAT:
                {
                (*newNode)->SetDefaultChat();

                const char **chatkeywords = (const char **) nddd->next->next->next->next->aux;

                for (int j = 1; j < count; j++)
                    {
                    const char *Keyword;
                    Bool NewSetting;

                    if (words[j][0] == '!')
                        {
                        Keyword = words[j] + 1;
                        NewSetting = FALSE;
                        }
                    else
                        {
                        Keyword = words[j];
                        NewSetting = TRUE;
                        }

                    NCC_Type TestType;

                    for (TestType = (NCC_Type) 0; TestType < NCC_MAX; TestType = (NCC_Type) (TestType + 1))
                        {
                        if (SameString(Keyword, chatkeywords[TestType]))
                            {
                            (*newNode)->SetChat(TestType, NewSetting);
                            break;
                            }
                        }

                    if (TestType == NCV_MAX)
                        {
                        if (SameString(Keyword, getnodemsg(13)))
                            {
                            // ALL
                            for (TestType = (NCC_Type) 0; TestType < NCC_MAX; TestType = (NCC_Type) (TestType + 1))
                                {
                                (*newNode)->SetChat(TestType, NewSetting);
                                }
                            }
                        else
                            {
                            TWcPrintf(getnodemsg(12), getnodemsg(8), ltoac(lineno), words[0], Keyword);
                            TWdoccr();
                            }
                        }
                    }

                break;
                }

            case NOK_REDIAL:
                {
                (*newNode)->SetRedial(atoi(words[1]));
                break;
                }

            case NOK_ROOM:
                {
                (*newNode)->SetRoomOffset(pos);
                fclose(fBuf);
                dump_node_ddata();
                return (TRUE);
                }

            case NOK_GROUP:
                {
                if (!(*newNode)->AddMappedGroups(words[1], words[2]))
                    {
                    TWcPrintf(getnodemsg(10), words[1]);
                    TWdoccr();
                    }

                if (strlen(words[1]) > LABELSIZE)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], LABELSIZE + 1);
                    TWdoccr();
                    }

                if (strlen(words[2]) > LABELSIZE)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], LABELSIZE + 1);
                    TWdoccr();
                    }

                break;
                }

            case NOK_GATEWAY:
                {
                (*newNode)->SetGateway(atoi(words[1]));
                break;
                }

            case NOK_FETCH:
                {
                (*newNode)->SetFetch(atoi(words[1]));
                break;
                }

            case NOK_NETFAIL:
                {
                (*newNode)->SetNetFail(atoi(words[1]));
                break;
                }

            case NOK_OUTPUTPACE:
                {
                (*newNode)->SetOutputPace(atoi(words[1]));
                break;
                }

            case NOK_IPADDRESS:
                {
#ifdef WINCIT
                (*newNode)->SetIpAddress(words[1]);

                if (strlen(words[1]) > 255)
                    {
                    TWcPrintf(getnodemsg(1), getnodemsg(8), ltoac(lineno), nodekeywords[i], 256);
                    TWdoccr();
                    }
#endif
                break;
                }

            case NOK_IPPORT:
                {
#ifdef WINCIT
                (*newNode)->SetIpPort(atoi(words[1]));
#endif
                break;
                }

            default:
                {
                TWcPrintf(getnodemsg(11), getnodemsg(8), ltoac(lineno), words[0]);
                TWdoccr();

                break;
                }
            }

        pos = ftell(fBuf);
        }

    fclose(fBuf);

    if (!FoundOurEntry && !option && debug)
        {
        TWwDoCR(W);
        TWwPrintf(W, getmsg(206), NameOrAddrToFind);
        TWwDoCR(W);
        }

    dump_node_ddata();

    if (option)
        {
        return (TRUE);
        }
    else
        {
        return (FoundOurEntry);
        }
    }
コード例 #3
0
ファイル: bestFit.c プロジェクト: michaelatremblay/school
/**
* This method allocates memory for the processes. It makes sure that
* there is enough room in memory and calls methods to pick the 
* appropriate hole to place it and also calls a method to compact
* memory. Returns the size of the process allocated.
*/
int allocateMemory(Process* processTable[TABLE_SIZE], int memorySize, Hole** holes, int* numHoles, int* numProcesses)
{
   int size;
   int pid;
   scanf("%d", &size);   
   scanf("%d", &pid);
   printf("%d ", size);
   printf("%d ", pid);
   
   /* Inform the user of an error if the size of the process is
   greater than the size of memory*/
   if(size > memorySize) 
   {
      printf("\nError: Memory exceeds available free memory.");
      return 0;
   }
   
   /******************Stores Process in HashTable******************/
   Process** cur;
   int index = pid%TABLE_SIZE;
   cur = findNext(processTable[index], pid);
   if(cur == NULL)
   {
      /* Inform the user of an error if the process id already
      exists in the processTable*/
      printf("\nError: Process already exists");
      return 0;
   }
   /***************************************************************/
   
   // Finds the best fit hole for the process
   int startLocation = findHole(holes, size, numHoles, memorySize);
   
   /****Handles Compaction if there was external fragmentation*****/
   if(startLocation == -1)
   {
      printf("\nError: Memory not available due to external fragmentation, can't allocate memory space to process %d", pid);
      compactMemory(processTable, holes, numHoles, numProcesses, memorySize);
      
      /*Checks if the process can now fit into memory. If it cannoy
      warn the user and return from the method.*/
      if(size > holes[0]->size)
      {
         printf("\nError: There is not enough room in memory. Clear space and then try again.");
         return 0;
      }
      
      /*Tries to add the process into memory again.*/
      printf("\nAdding Process to Memory");
      startLocation = findHole(holes, size, numHoles, memorySize);
   }
   /***************************************************************/
   
   /*************Create and set the new process values*************/
   *cur = malloc(sizeof(Process));
   if(*cur == NULL)
   {
      fprintf(stderr, "Malloc failed to allocate memory!\n");
      exit(-1);
   }
   
   (*cur)->pid = pid;
   (*cur)->size = size;
   (*cur)->startLocation = startLocation;
   (*cur)->next = NULL;
   (*numProcesses)++;
   /***************************************************************/
   
   return size;
}
コード例 #4
0
ファイル: init.cpp プロジェクト: dylancarlson/citplus
static Bool initCitadel(void)
    {
    if (!read_cfg_messages())
        {
#ifdef WINCIT
        char Buffer[128];
        sprintf(Buffer, getmsg(188), getmsg(671));
        MessageBox(NULL, Buffer, NULL, MB_ICONSTOP | MB_OK);
#else
        printf(getmsg(188), getmsg(671));
#endif
        return (FALSE);
        }

    checkfiles();

    initExtDrivers();

    get_os();

	cfg.battr = 0xff;
    setscreen();

    logo(TRUE); // no go for debug version; td32 go crash crash

    init_internal_sound();

	// some mouse initialization technology!!!!
    initMouseHandler();
    hideCounter = 1;

    if (time(NULL) < 700000000L)
        {
#ifdef WINCIT
        MessageBox(NULL, getcfgmsg(119), NULL, MB_ICONSTOP | MB_OK);
#else
        doccr();
        doccr();
        cPrintf(getcfgmsg(119));
        doccr();
#endif
        dump_cfg_messages();
        return (FALSE);
        }


    static char prompt[92];
    static char citadel[92];
    char *envprompt;
    char *citprompt;

    envprompt = getenv(getcfgmsg(120));
    citprompt = getenv(getcfgmsg(121));
    if (citprompt)
        {
        sprintf(prompt, getcfgmsg(122), citprompt);
        }
    else if (envprompt)
        {
        sprintf(prompt, getcfgmsg(123), envprompt);
        }
    else
        {
        strcpy(prompt, getcfgmsg(124));
        }
    putenv(prompt);

    sprintf(citadel, getcfgmsg(125), programName, version);
    putenv(citadel);


#ifndef WINCIT
    OC.whichIO = CONSOLE;
    OC.SetOutFlag(OUTOK);
    OC.Echo = BOTH;
    OC.setio();
#endif

    VerifyHeap(1);

    // If we aren't reconfiguring, load the tables...
    if (!reconfig)
        {
        // Start by reading ETC.TAB
        getcwd(etcpath, 64);

        FILE *fd;
        if ((fd = fopen(etcTab, FO_RB)) != NULL)
            {
            if (filelength(fileno(fd)) != (long) sizeof(config) ||
					fread(&cfg, 1, sizeof(config), fd) != (long) sizeof(config))
                {
                memset(&cfg, 0, sizeof(cfg));
                reconfig = TRUE;
                }

            fclose(fd);
            unlink(etcTab);


            // If ETC.TAB could be loaded, load the rest
            if (!reconfig)
                {
                changedir(cfg.homepath);

                allocateTables();

                if (!LogTab.Load() || !MessageDat.LoadTable() || !RoomTab.Load())
                    {
                    reconfig = TRUE;
                    }

                Cron.ReadTable(WC_TWpn);
                }
            }
        else
            {
            if (!batchmode)
                {
#ifdef WINCIT
                MessageBox(NULL, "No ETC.TAB.", NULL, MB_ICONSTOP | MB_OK);
#else
                doccr();

                discardable *d;

                if ((d = readData(6)) != NULL)
                    {
                    int i;

                    for (i = 0; ((char **) d->next->aux)[i][0] != '#'; i++)
                        {
                        cPrintf(pcts, ((char **) d->next->aux)[i]);
                        doccr();
                        }

                    doccr();

                    discardData(d);
                    }
                else
                    {
                    cOutOfMemory(28);
                    }

                DeinitializeTimer();
                critical(FALSE);
#endif
                exit(1);
                }

            reconfig = TRUE;
            }
        }



    if (reconfig)
        {
        cfg.attr = 7;

#ifndef WINCIT
        pause(200);
        cls(SCROLL_SAVE);

        cCPrintf(getcfgmsg(126));
        doccr();
#endif


        if (!configcit())
            {
#ifdef WINCIT
            MessageBox(NULL, getcfgmsg(127), NULL, MB_ICONSTOP | MB_OK);
#else
            doccr();
            doccr();
            cPrintf(getcfgmsg(127));
            doccr();
#endif
            dump_cfg_messages();
            return (FALSE);
            }


#ifndef WINCIT
        setdefaultTerm(TT_ANSI);
        CurrentUser->SetWidth(80);
#endif

        Cron.ReadCronCit(WC_TWpn);
        }
    else
        {
#ifndef WINCIT
        if (!CreateScrollBackBuffer())
            {
            cPrintf(getcfgmsg(60));
            doccr();
            }
#endif


        if (readconfigcit)  // forced to read in config.cit
            {
            if (!readconfig(NULL, 1))
                {
#ifdef WINCIT
                MessageBox(NULL, getcfgmsg(129), NULL, MB_ICONSTOP | MB_OK);
#else
                doccr();
                doccr();
                cPrintf(getcfgmsg(129));
                doccr();
#endif
                dump_cfg_messages();
                return (FALSE);
                }
            }
        }

    VerifyHeap(1);

    makeBorders();
    readBordersDat();

    if (cmd_nobells)
        {
        cfg.noBells = 2;
        }

    if (cmd_nochat)
        {
        cfg.noChat = TRUE;
        }

    if (cmd_mdata != CERROR)
        {
        cfg.mdata = cmd_mdata;
        }

    if (*cfg.f6pass)
        {
        if (SameString(cfg.f6pass, getmsg(670)))
            {
            ConsoleLock.LockF6();
            }
        else
            {
            ConsoleLock.Lock();
            }
        }


#ifndef WINCIT
    if (cfg.ovrEms)
        {
        if (_OvrInitEms(0, 0, 0))
            {
            cPrintf(getcfgmsg(130));
            doccr();
            pause(200);
            }
        }

    if (cfg.ovrExt)
        {
        if (_OvrInitExt(0, 0))
            {
            cPrintf(getcfgmsg(131));
            doccr();
            pause(200);
            }
        }

    CommPort->Init();
    setscreen();
#endif

    logo(TRUE); // no go for debug version; td32 go crash crash

#ifndef WINCIT
    StatusLine.Update(WC_TWp);
#endif

    if (cfg.msgpath[(strlen(cfg.msgpath) - 1)] == '\\')
        {
        cfg.msgpath[(strlen(cfg.msgpath) - 1)] = '\0';
        }

    // move to home path
    changedir(cfg.homepath);
    char FileName[128];

    ReIndexFileInfo();  // keep fileinfo.dat nice and pretty

    // open message file
    if (!MessageDat.OpenMessageFile(cfg.msgpath))
		{
		illegal(getmsg(78), MessageDat.GetFilename());
		}

    // Then room file
    sprintf(FileName, sbs, cfg.homepath, roomDat);
    openFile(FileName, &RoomFile);

    citOpen(cfg.trapfile, CO_A, &TrapFile);
    initMenus();
    dump_cfg_messages();

    if(!read_tr_messages())
        {
        errorDisp(getmsg(172));
        }
    else
        {
#ifdef WINCIT
    trap(T_SYSOP, "", gettrmsg(37));
#else
    trap(T_SYSOP, gettrmsg(37));
#endif
        dump_tr_messages();
        }

        read_cfg_messages();            // uh-oh!

    if (!GroupData.Load())
        {
        return (FALSE);
        }

    if (!HallData.Load())
        {
        return (FALSE);
        }

    getRoomPos();

    if (cfg.accounting)
        {
        ReadGrpdataCit(WC_TWpn);
        }

    ReadExternalCit(WC_TWpn);
    ReadProtocolCit(WC_TWpn);
    ReadMdmresltCit(WC_TWpn);
    ReadCommandsCit(WC_TWpn);


#ifndef WINCIT
    ReadMCICit(FALSE);

    CurrentRoom->Load(LOBBY);
    thisRoom = LOBBY;
    checkdir();

    if (!slv_door)
        {
        CITWINDOW *w = CitWindowsMsg(NULL, getmsg(19));

        Initport();
        Initport();

        if (w)
            {
            destroyCitWindow(w, FALSE);
            }
        }
    else
        {
        CommPort->Enable();
        }

    OC.whichIO = MODEM;
    OC.setio();
#endif


    // record when we put system up
    time(&uptimestamp);

#ifndef WINCIT
    setdefaultconfig(FALSE);
    Talley->Fill();
#endif
    logo(FALSE);

    VerifyHeap(1);

    dump_cfg_messages();
    compactMemory(1);

    return (TRUE);
    }