コード例 #1
0
/*
 * LookUpCharToken - look up to token for a specified character
 */
char *LookUpCharToken( vi_key key, bool want_single )
{
    int         i;
    static int  num = 0;

    if( num == 0 ) {
        if( readKeyData() != ERR_NO_ERR ) {
            return( NULL );
        }
        num = GetNumberOfTokens( charTokens );
    }
    if( want_single ) {
        switch( key ) {
        case VI_KEY( ESC ):
            return( "e" );
        case VI_KEY( ENTER ):
            return( "n" );
        case VI_KEY( TAB ):
            return( "t" );
        case NO_ADD_TO_HISTORY_KEY:
            return( "h" );
        case '\\':
            return( "\\" );
        }
    }
    for( i = 0; i < num; i++ ) {
        if( key == keyVals[i] ) {
            return( GetTokenString( charTokens, i ) );
        }
    }
    return( NULL );

} /* LookUpCharToken */
コード例 #2
0
/*
 * getSetInfo - build string of values
 */
static int getSetInfo( char ***vals, char ***list, int *longest )
{
    int         i, j;
    char        settokstr[TOK_MAX_LEN + 1];
    char        tmpstr[MAX_STR];
    set_data    **sdata;
    int         tc, tc1, tc2;

    tc1 = GetNumberOfTokens( SetTokens1 );
    tc2 = GetNumberOfTokens( SetTokens2 );
    tc = tc1 + tc2;
    sdata = MemAlloc( tc * sizeof( set_data * ) );
    *list = MemAlloc( tc * sizeof( char * ) );
    *vals = MemAlloc( tc * sizeof( char * ) );

    for( i = 0; i < tc1; i++ ) {
        sdata[i] = MemAlloc( sizeof( set_data ) );
        AddString( &(sdata[i]->setting), GetTokenStringCVT( SetTokens1, i, settokstr, TRUE ) );
        AddString( &(sdata[i]->val), getOneSetVal( i, TRUE, tmpstr, TRUE ) );
    }
    for( i = 0; i < tc2; i++ ) {
        sdata[tc1 + i] = MemAlloc( sizeof( set_data ) );
        AddString( &(sdata[tc1 + i]->setting), GetTokenStringCVT( SetTokens2, i, settokstr, TRUE ) );
        AddString( &(sdata[tc1 + i]->val), getOneSetVal( i, FALSE, tmpstr, TRUE ) );
    }
    qsort( sdata, tc, sizeof( set_data * ), compareString );
    for( i = 0; i < tc; i++ ) {
        (*list)[i] = sdata[i]->setting;
        (*vals)[i] = sdata[i]->val;
        MemFree( sdata[i] );
    }
    MemFree( sdata );
    i = GetLongestTokenLength( SetTokens1 );
    j = GetLongestTokenLength( SetTokens2 );
    if( i > j ) {
        *longest = i;
    } else {
        *longest = j;
    }
    return( tc );

} /* getSetInfo */
コード例 #3
0
/*
 * GenerateConfiguration - write out a config file
 */
vi_rc GenerateConfiguration( const char *fname, bool is_cmdline )
{
    FILE        *fp;
    int         i;
    char        token[128];
    const char  *str;
    char        *buff;
    int         num;
    rgb         c;
    const char  *res;
    char        tmpstr[MAX_STR];

    if( fname == NULL ) {
        fname = CFG_NAME;
    }
    fp = fopen( fname, "w" );
    if( fp == NULL ) {
        return( ERR_FILE_OPEN );
    }
    isCmdLine = is_cmdline;
    buff = MemAllocUnsafe( VBUF_SIZE );
    if( buff != NULL ) {
        setvbuf( fp, buff, _IOFBF, VBUF_SIZE );
    }
    MyFprintf( fp, "#\n# %s configuration file\n# %s\n#\n",
#if defined( __WIN__ )
    banner1w1( "Text Editor for Windows" ), banner1w2( _VI_VERSION_ ) );
#else
    banner1w1( "Vi Text Editor" ), banner1w2( _VI_VERSION_ ) );
#endif
    if( is_cmdline ) {
        GetDateTimeString( token );
        MyFprintf( fp, "# File generated on %s\n#\n", token );
    }

    writeTitle( fp, "Hook script assignments" );
    doHookAssign( fp, SRC_HOOK_WRITE );
    doHookAssign( fp, SRC_HOOK_READ );
    doHookAssign( fp, SRC_HOOK_BUFFIN );
    doHookAssign( fp, SRC_HOOK_BUFFOUT );
    doHookAssign( fp, SRC_HOOK_COMMAND );
    doHookAssign( fp, SRC_HOOK_MODIFIED );
    doHookAssign( fp, SRC_HOOK_MENU );
    doHookAssign( fp, SRC_HOOK_MOUSE_LINESEL );
    doHookAssign( fp, SRC_HOOK_MOUSE_CHARSEL );

    writeTitle( fp, "General Settings" );
    num = GetNumberOfTokens( SetVarTokens );
    for( i = 0; i < num; i++ ) {
        if( i == SETVAR_T_TILECOLOR || i == SETVAR_T_FIGNORE || i == SETVAR_T_FILENAME ) {
            continue;
        }
        res = GetASetVal( GetTokenStringCVT( SetVarTokens, i, token, true ), tmpstr );
        switch( i ) {
        case SETVAR_T_STATUSSTRING:
        case SETVAR_T_FILEENDSTRING:
        case SETVAR_T_HISTORYFILE:
        case SETVAR_T_TMPDIR:
            /* strings with possible spaces */
            MyFprintf( fp, "set %s = \"%s\"\n", token, res );
            break;
        case SETVAR_T_GADGETSTRING:
            if( !IsGadgetStringChanged( res ) )
                break;
            // fall through
        default:
            MyFprintf( fp, "set %s = %s\n", token, res );
            break;
        }
    }

    writeTitle( fp, "Boolean Settings" );
    num = GetNumberOfTokens( SetFlagTokens );
    for( i = 0; i < num; i++ ) {
        str = GetASetVal( GetTokenStringCVT( SetFlagTokens, i, token, true ), tmpstr );
        MyFprintf( fp, "set %s%s\n", (*str == '0') ? "no" : "", token );
    }
    writeTitle( fp, "Match pairs" );
    for( i = INITIAL_MATCH_COUNT; i < MatchCount; i += 2 ) {
        MyFprintf( fp, "match /" );
        outputMatchData( fp, MatchData[i] );
        outputMatchData( fp, MatchData[i + 1] );
        MyFprintf( fp, "\n" );
    }

    writeTitle( fp, "Command Mode Mappings" );
    doMaps( fp, KeyMaps, "" );
    writeTitle( fp, "Insert Mode Mappings" );
    doMaps( fp, InputKeyMaps, "!" );

    writeTitle( fp, "Color Settings" );
    for( i = 0; i < GetNumColors(); i++ ) {
        if( GetColorSetting( i, &c ) ) {
            MyFprintf( fp, "setcolor %d %d %d %d\n", i, c.red, c.green, c.blue );
        }
    }

#ifdef __WIN__
    writeTitle( fp, "Font Settings" );
    BarfFontData( fp );
#endif

    writeTitle( fp, "Window Configuration" );
    doWindow( fp, PCL_T_COMMANDWINDOW, &cmdlinew_info, false );
    doWindow( fp, PCL_T_STATUSWINDOW, &statusw_info, false );
    doWindow( fp, PCL_T_COUNTWINDOW, &repcntw_info, false );
    doWindow( fp, PCL_T_EDITWINDOW, &editw_info, false );
    doWindow( fp, PCL_T_FILECWINDOW, &filecw_info, false );
    doWindow( fp, PCL_T_DIRWINDOW, &dirw_info, false );
    doWindow( fp, PCL_T_FILEWINDOW, &filelistw_info, false );
    doWindow( fp, PCL_T_MESSAGEWINDOW, &messagew_info, false );
#ifndef __WIN__
    doWindow( fp, PCL_T_SETWINDOW, &setw_info, false );
    doWindow( fp, PCL_T_LINENUMBERWINDOW, &linenumw_info, false );
    doWindow( fp, PCL_T_EXTRAINFOWINDOW, &extraw_info, false );
    doWindow( fp, PCL_T_SETVALWINDOW, &setvalw_info, false );
    doWindow( fp, PCL_T_MENUWINDOW, &menuw_info, false );
    doWindow( fp, PCL_T_MENUBARWINDOW, &menubarw_info, true );
    doWindow( fp, PCL_T_ACTIVEMENUWINDOW, &activemenu_info, true );
    doWindow( fp, PCL_T_GREYEDMENUWINDOW, &greyedmenu_info, true );
    doWindow( fp, PCL_T_ACTIVEGREYEDMENUWINDOW, &activegreyedmenu_info, true );
#endif

    writeTitle( fp, "Menu Configuration" );
    BarfMenuData( fp );

#ifdef __WIN__
    writeTitle( fp, "ToolBar Configuration" );
    BarfToolBarData( fp );
#endif

    writeTitle( fp, "File Type Source" );
    FTSBarfData( fp );

    fclose( fp );
    if( is_cmdline ) {
        Message1( "Configuration file \"%s\" generated", fname );
    }

    MemFree( buff );
    return( DO_NOT_CLEAR_MESSAGE_WINDOW );

} /* GenerateConfiguration */
コード例 #4
0
void LinguisticaMainWindow::updateTreeViewSlot()
{
  // Adapted from MFC version: CMyTree::UpdateUpperTree, CMyTree::UpdateStatistics

  int     count,    // used for various counts
          index;    // mini-lexicon index
  index = 0;
  count = 0;

//  bool      add = TRUE;

  CStem* pWord;

  Q3ListViewItem  * MiscItem      = NULL,
		  * MiscItem1       = NULL,
          * LexiconItem     = NULL,
          * WordsReadItem   = NULL,
          * PrefixesItem    = NULL,
          * SuffixesItem    = NULL,
          * WordsItem       = NULL,
 		  * CompoundsItem   = NULL,
          * ComponentItem   = NULL,
		  *	STRINGEDITITEM  = NULL,
		  * CorpusWordsItem = NULL;
		  
 
  // Clear the tree
  m_treeView->clear();
  m_treeView->setFont( GetFontPreference( "Main" ) );
  m_treeView->hideColumn(1);

//**************************************************************************************
// A NOTE ON THE ORGANIZATION OF THIS FUNCTION:
// The items are inserted into the tree in reverse order respective to their group.  They
// are organized by depth here, i.e. what is connected to the root is the first group,
// then do the groups of items connected to this first group, etc.  The only items that
// get their own name are those that have children.  The rest use MiscItem
//**************************************************************************************


//======================================================================================//
  // START CONNECTED DIRECTLY TO m_treeView
//======================================================================================//


	count = GetNumberOfTokens();
	if( count >= 0 )
	{
		MiscItem = new CTreeViewItem( m_treeView,
									  "Tokens requested: " + IntToStringWithCommas( count ),
									  TOKENS_REQUESTED );
		MiscItem->setSelectable(false);
	}  

//======================================================================================//

	if( m_lexicon->GetWords() && m_lexicon->GetMiniCount() )
	{
		count = m_lexicon->GetTokenCount();
		if ( count >= 0 )
		{
			WordsReadItem = new CTreeViewItem( m_treeView,
											   "Tokens read: " + IntToStringWithCommas( count ) );
			WordsReadItem->setSelectable(false);
			WordsReadItem->setOpen(true);
		}

//======================================================================================//

		LexiconItem = new CTreeViewItem( m_treeView,
						 "Lexicon : click items to display them" );
		LexiconItem->setSelectable(false);
		LexiconItem->setOpen(true);
	}

//======================================================================================//

  if ( m_projectDirectory.length()  )
  {
    MiscItem = new CTreeViewItem( m_treeView, "Project directory: " + m_projectDirectory );
    MiscItem->setSelectable(false);
  }
  else
  {
    MiscItem = new CTreeViewItem( m_treeView, "No project directory." );
    MiscItem->setSelectable(false);
  }

//======================================================================================//

  if ( m_logging )
  {
    MiscItem = new CTreeViewItem( m_treeView, "Log file (now on) " + GetLogFileName() );
    MiscItem->setSelectable(false);
  }
  else
  {
    MiscItem = new CTreeViewItem( m_treeView, "Log file (now off) " + GetLogFileName() );
    MiscItem->setSelectable(false);
  }

//=================================================================================================
  // END CONNECTED DIRECTLY TO m_treeView
  // START CONNECTED TO LexiconItem
//=================================================================================================

	if ( LexiconItem && m_lexicon->GetHMM() )
	{		
		MiscItem = new CTreeViewItem( LexiconItem,
									   "HMM",
									   HMM_Document);
		double dl = m_lexicon->GetHMM()->GetLogProbability();
		MiscItem1 = new CTreeViewItem(MiscItem,"HMM description length: " + IntToStringWithCommas(int( dl) )
									   );		
		MiscItem1 = new CTreeViewItem(MiscItem,
									  "Iterations: " + IntToStringWithCommas( m_lexicon->GetHMM()->m_NumberOfIterations )
									   );		
		MiscItem1 = new CTreeViewItem(MiscItem,
									  "Number of states: " + IntToStringWithCommas( m_lexicon->GetHMM()->m_countOfStates )
									   );		
	}
	MiscItem->setOpen(true);

//======================================================================================//

  if( LexiconItem )
  {
	  if( m_lexicon->GetDLHistory()->count() > 0 )
	  {
		 MiscItem = new CTreeViewItem( LexiconItem,
									   "Description length history",
									   DESCRIPTION_LENGTH_HISTORY );
	  }
  }

//////////////////////////////
//// StringEdit Display

	if ((LexiconItem != NULL) && (m_Words_InitialTemplates != NULL))
	{
		if ( m_Words_InitialTemplates ->GetCount() > 0)
		{
			STRINGEDITITEM = new CTreeViewItem( LexiconItem,
										  "StringEditDistanceTemplates: " + IntToStringWithCommas( 2 ), 
										  STRINGEDITDISTANCE, -1);

			count = m_Words_Templates ->GetCount();
			if ( count != 0)
			{
				MiscItem = new CTreeViewItem( STRINGEDITITEM,
										  "StringEdit_Templates: " + IntToStringWithCommas( count ), 
										  WORKINGSTRINGEDITTEMPLATES, -1);

			}

			count = m_Words_InitialTemplates ->GetCount();
			MiscItem = new CTreeViewItem( STRINGEDITITEM,
										  "StringEdit_InitialTemplates: " + IntToStringWithCommas( count ), 
										  INITIALSTRINGEDITTEMPLATES, -1);
		}
	}

		count = 0;
		Q3DictIterator<PrefixSet> it5( *m_lexicon->GetAllPrefixes() );
		for( ; it5.current(); ++it5 )
		{
			count += it5.current()->count();
		}
		if( count > 0 )
		{
			PrefixesItem = new CTreeViewItem( LexiconItem,
											  "All Prefixes " + IntToStringWithCommas( count ),
											  ALL_PREFIXES );
			PrefixesItem->setOpen( TRUE );
		}    
//======================================================================================//
		count = 0;
		Q3DictIterator<SuffixSet> it4( *m_lexicon->GetAllSuffixes() );
		for( ; it4.current(); ++it4 )
		{
			count += it4.current()->count();
		}
		if( count > 0 )
		{
			SuffixesItem = new CTreeViewItem( LexiconItem,
											  "All Suffixes " + IntToStringWithCommas( count ),
											  ALL_SUFFIXES );
			SuffixesItem->setOpen( TRUE );
		}
//======================================================================================//
		count = 0;
		Q3DictIterator<StemSet> it1( *m_lexicon->GetAllStems() );
		for( ; it1.current(); ++it1 )
		{
			count += it1.current()->count();
		}
		if( count > 0 )
		{
			MiscItem = new CTreeViewItem( LexiconItem,
										  "All Stems " + IntToStringWithCommas( count ),
										  ALL_STEMS );
		}
 //======================================================================================//
		count = 0;
		Q3DictIterator<StemSet> it2( *m_lexicon->GetAllWords() );
		for( ; it2.current(); ++it2 )
		{
			count += it2.current()->count();
		}

		if( count > 0 )
		{
			WordsItem = new CTreeViewItem( LexiconItem,
										  "All Words " + IntToStringWithCommas( count ),
										  ALL_WORDS );
			WordsItem->setOpen( TRUE );
		}	
//======================================================================================//
	  if( m_lexicon->GetMiniCount() )
	  {
		for( index = m_lexicon->GetMiniSize() - 1; index >= 0; index-- )
		{
			if( m_lexicon->GetMiniLexicon( index ) )
				MiscItem = GetMiniLexiconSubTree( LexiconItem, index );
		}
	  }
//======================================================================================//
		count = m_lexicon->GetCompounds()->GetCount();
		if( count > 0 )
		{
			CompoundsItem = new CTreeViewItem( LexiconItem,
											   "Compounds " + IntToStringWithCommas( count ),
											   COMPOUNDS );
			CompoundsItem->setOpen( TRUE );
            int count2 = m_lexicon->GetCompounds()->GetComponents()->GetSize();
            ComponentItem = new CTreeViewItem( CompoundsItem, "Components "+ IntToStringWithCommas (count2),
                                                COMPOUND_COMPONENTS);
		}
//======================================================================================//

	  count = m_lexicon->GetWords()->GetCount();
	  if( count > 0 )
	  {
		CorpusWordsItem = new CTreeViewItem( LexiconItem,
											 "Corpus Words " + IntToStringWithCommas( count ),
											 CORPUS_WORDS );
		CorpusWordsItem->setOpen( TRUE );
	  }
//=================================================================================================
  // END CONNECTED TO LexiconItem
  // START CONNECTED TO CorpusWordsItem
//=================================================================================================

	count = 0;
	if( CorpusWordsItem )
	{

		CCorpusWord* pCorpusWord;
		CCorpusWordCollection* pWords = m_lexicon->GetWords();

		pWords->Sort( KEY );

		for( int i = 0; i < pWords->GetCount(); i++ )
		{
			pCorpusWord = pWords->GetAtSort(i);

			if( pCorpusWord->Size() > 1 )
			{
				count++;
			}
		}

		if( count > 0 )
		{
			MiscItem = new CTreeViewItem( CorpusWordsItem,
										  "Analyzed " + IntToStringWithCommas( count ),
										  ANALYZED_CORPUS_WORDS );
		}
	}
 
//=================================================================================================
  // END CONNECTED TO CorpusWordsItem
  // START CONNECTED TO WordsItem
//=================================================================================================

	count = 0;

	bool analyzed_exists;
	Q3DictIterator<StemSet> it3( *m_lexicon->GetAllWords() );
        for( ; it3.current(); ++it3 )
	{
            analyzed_exists = FALSE;
            //for( pWord = it3.current()->first(); pWord; pWord = it3.current()->next() )
            for (int z = 0; z < it3.current()->size(); z++)
            {
                pWord = it3.current()->at(z);
                if( pWord->Size() > 1 )
                {
                        analyzed_exists = TRUE;
                        count++;
                }
            }
	}

	if( count > 0 )
	{
		MiscItem = new CTreeViewItem( WordsItem,
									  "Analyzed " + IntToStringWithCommas( count ),
									  ALL_ANALYZED_WORDS );
	}

//=================================================================================================
  // END CONNECTED TO WordsItem
  // START CONNECTED TO SuffixesItem
//=================================================================================================

	count = 0;

	Q3DictIterator<SignatureSet> it7( *m_lexicon->GetAllSuffixSigs() );
	for( ; it7.current(); ++it7 )
	{
		count += it7.current()->count();
	}
	if( count > 0 )
	{
		MiscItem = new CTreeViewItem( SuffixesItem,
									  "Signatures " + IntToStringWithCommas( count ),
									  ALL_SUFFIX_SIGNATURES );
	}

//=================================================================================================
  // END CONNECTED TO SuffixesItem
  // START CONNECTED TO PrefixesItem
//=================================================================================================

	count = 0;

	Q3DictIterator<SignatureSet> it6( *m_lexicon->GetAllPrefixSigs() );
	for( ; it6.current(); ++it6 )
	{
		count += it6.current()->count();
	}
	if( count > 0 )
	{
		MiscItem = new CTreeViewItem( PrefixesItem,
									  "Signatures " + IntToStringWithCommas( count ),
									  ALL_PREFIX_SIGNATURES );
	}

//=================================================================================================
  // END CONNECTED TO PrefixesItem
  // START CONNECTED TO WordsReadItem
//=================================================================================================

	if( WordsReadItem )
	{
		if( m_lexicon->GetWords() )
		{
			count = m_lexicon->GetWords()->GetCount();
			if( count > 0 )
			{
				MiscItem = new CTreeViewItem( WordsReadItem,
											  "Distinct types read: " + IntToStringWithCommas( count ) );
				MiscItem->setSelectable(false);
			}
		} 

//======================================================================================//

		count = m_lexicon->GetCorpusCount();
		if( count >= 0 )
		{
			MiscItem = new CTreeViewItem( WordsReadItem,
										  "Tokens included: " + IntToStringWithCommas( count ) );
			MiscItem->setSelectable(false);
		} 
	}


//=================================================================================================
  // END CONNECTED TO WordsReadItem
  // START CONNECTED TO CompoundsItem
//=================================================================================================

	count = m_lexicon->GetLinkers()->GetCount();
	if( count > 0 )
	{
		MiscItem = new CTreeViewItem( CompoundsItem,
									  "Linkers " + IntToStringWithCommas( count ),
									  LINKERS, index );
	}
}
コード例 #5
0
/*
 * GenerateConfiguration - write out a config file
 */
vi_rc GenerateConfiguration( char *fname, bool is_cmdline )
{
    FILE        *f;
    int         i;
    char        token[128];
    char        *str;
    char        boolstr[3];
    char        *buff;
    int         num;
    rgb         c;
    char        *fmt;
    char        *res;

    if( fname == NULL ) {
        fname = CFG_NAME;
    }
    f = fopen( fname, "w" );
    if( f == NULL ) {
        return( ERR_FILE_OPEN );
    }
    isCmdLine = is_cmdline;
    buff = MemAllocUnsafe( VBUF_SIZE );
    if( buff != NULL ) {
        setvbuf( f, buff, _IOFBF, VBUF_SIZE );
    }
    MyFprintf( f, "#\n# WATCOM %s %s configuration file\n# %s\n#\n",
               TITLE, VERSIONT, AUTHOR );
    if( is_cmdline ) {
        GetDateTimeString( token );
        MyFprintf( f, "# File generated on %s\n#\n", token );
    }

    writeTitle( f, "Hook script assignments" );
    doHookAssign( f, SRC_HOOK_WRITE );
    doHookAssign( f, SRC_HOOK_READ );
    doHookAssign( f, SRC_HOOK_BUFFIN );
    doHookAssign( f, SRC_HOOK_BUFFOUT );
    doHookAssign( f, SRC_HOOK_COMMAND );
    doHookAssign( f, SRC_HOOK_MODIFIED );
    doHookAssign( f, SRC_HOOK_MENU );
    doHookAssign( f, SRC_HOOK_MOUSE_LINESEL );
    doHookAssign( f, SRC_HOOK_MOUSE_CHARSEL );

    writeTitle( f, "General Settings" );
    num = GetNumberOfTokens( SetTokens1 );
    for( i = 0; i < num; i++ ) {
        if( i == SET1_T_TILECOLOR || i == SET1_T_FIGNORE || i == SET1_T_FILENAME ) {
            continue;
        }
        strcpy( token, GetTokenString( SetTokens1, i ) );
        strlwr( token );
        res = GetASetVal( token );
        if( i == SET1_T_STATUSSTRING || i == SET1_T_FILEENDSTRING ||
            i == SET1_T_HISTORYFILE || i == SET1_T_TMPDIR ) {    /* strings with possible spaces */
            fmt = "set %s = \"%s\"\n";
        } else {
            fmt = "set %s = %s\n";
        }
        MyFprintf( f, fmt, token, res );
    }

    writeTitle( f, "Boolean Settings" );
    num = GetNumberOfTokens( SetTokens2 );
    for( i = 0; i < num; i++ ) {
        strcpy( token, GetTokenString( SetTokens2, i ) );
        strlwr( token );
        str = GetASetVal( token );
        boolstr[0] = 0;
        if( str[0] == '0' ) {
            boolstr[0] = 'n';
            boolstr[1] = 'o';
            boolstr[2] = 0;
        }
        MyFprintf( f, "set %s%s\n", boolstr, token );
    }
    writeTitle( f, "Match pairs" );
    for( i = INITIAL_MATCH_COUNT; i < MatchCount; i += 2 ) {
        MyFprintf( f, "match /" );
        outputMatchData( f, MatchData[i] );
        outputMatchData( f, MatchData[i + 1] );
        MyFprintf( f, "\n" );
    }

    writeTitle( f, "Command Mode Mappings" );
    doMaps( f, KeyMaps, "" );
    writeTitle( f, "Insert Mode Mappings" );
    doMaps( f, InputKeyMaps, "!" );

    writeTitle( f, "Color Settings" );
    for( i = 0; i < GetNumColors(); i++ ) {
        if( GetColorSetting( i, &c ) ) {
            MyFprintf( f, "setcolor %d %d %d %d\n", i, c.red, c.green, c.blue );
        }
    }

#ifdef __WIN__
    writeTitle( f, "Font Settings" );
    BarfFontData( f );
#endif

    writeTitle( f, "Window Configuration" );
    doWindow( f, PCL_T_COMMANDWINDOW, &cmdlinew_info, FALSE );
    doWindow( f, PCL_T_STATUSWINDOW, &statusw_info, FALSE );
    doWindow( f, PCL_T_COUNTWINDOW, &repcntw_info, FALSE );
    doWindow( f, PCL_T_EDITWINDOW, &editw_info, FALSE );
    doWindow( f, PCL_T_FILECWINDOW, &filecw_info, FALSE );
    doWindow( f, PCL_T_DIRWINDOW, &dirw_info, FALSE );
    doWindow( f, PCL_T_FILEWINDOW, &filelistw_info, FALSE );
    doWindow( f, PCL_T_MESSAGEWINDOW, &messagew_info, FALSE );
#ifndef __WIN__
    doWindow( f, PCL_T_SETWINDOW, &setw_info, FALSE );
    doWindow( f, PCL_T_LINENUMBERWINDOW, &linenumw_info, FALSE );
    doWindow( f, PCL_T_EXTRAINFOWINDOW, &extraw_info, FALSE );
    doWindow( f, PCL_T_SETVALWINDOW, &setvalw_info, FALSE );
    doWindow( f, PCL_T_MENUWINDOW, &menuw_info, FALSE );
    doWindow( f, PCL_T_MENUBARWINDOW, &menubarw_info, TRUE );
    doWindow( f, PCL_T_ACTIVEMENUWINDOW, &activemenu_info, TRUE );
    doWindow( f, PCL_T_GREYEDMENUWINDOW, &greyedmenu_info, TRUE );
    doWindow( f, PCL_T_ACTIVEGREYEDMENUWINDOW, &activegreyedmenu_info, TRUE );
#endif

    writeTitle( f, "Menu Configuration" );
    BarfMenuData( f );

#ifdef __WIN__
    writeTitle( f, "ToolBar Configuration" );
    BarfToolBarData( f );
#endif

    writeTitle( f, "File Type Source" );
    FTSBarfData( f );

    fclose( f );
    if( is_cmdline ) {
        Message1( "Configuration file \"%s\" generated", fname );
    }

    MemFree( buff );
    return( DO_NOT_CLEAR_MESSAGE_WINDOW );

} /* GenerateConfiguration */