X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwgamelist.c;h=d736a8de2c879afb18245de950c6f644064f2706;hb=5abce92da74b24ecbb925e18fd61d53f57db26e5;hp=31d36ff3af77153460c7583a2e2b6d8d26489259;hpb=d5c36d4669c2f625af7c280c5a4ebdc4ba284e95;p=xboard.git diff --git a/winboard/wgamelist.c b/winboard/wgamelist.c index 31d36ff..d736a8d 100644 --- a/winboard/wgamelist.c +++ b/winboard/wgamelist.c @@ -1,7 +1,7 @@ /* * wgamelist.c -- Game list window for WinBoard * - * Copyright 1995,2009 Free Software Foundation, Inc. + * Copyright 1995, 2009, 2010 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -54,62 +54,6 @@ struct GameListStats int unfinished; }; -/* [AS] Wildcard pattern matching */ -static BOOL HasPattern( const char * text, const char * pattern ) -{ - while( *pattern != '\0' ) { - if( *pattern == '*' ) { - while( *pattern == '*' ) { - pattern++; - } - - if( *pattern == '\0' ) { - return TRUE; - } - - while( *text != '\0' ) { - if( HasPattern( text, pattern ) ) { - return TRUE; - } - text++; - } - } - else if( (*pattern == *text) || ((*pattern == '?') && (*text != '\0')) ) { - pattern++; - text++; - continue; - } - - return FALSE; - } - - return TRUE; -} - -static BOOL SearchPattern( const char * text, const char * pattern ) -{ - BOOL result = TRUE; - - if( pattern != NULL && *pattern != '\0' ) { - if( *pattern == '*' ) { - result = HasPattern( text, pattern ); - } - else { - result = FALSE; - - while( *text != '\0' ) { - if( HasPattern( text, pattern ) ) { - result = TRUE; - break; - } - text++; - } - } - } - - return result; -} - /* [AS] Setup the game list according to the specified filter */ static int GameListToListBox( HWND hDlg, BOOL boReset, char * pszFilter, struct GameListStats * stats ) { @@ -260,8 +204,8 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) else GetActualPlacement( gameListDialog, &wpGameList ); - GameListUpdateTitle( hDlg, szDlgTitle, count, ((ListGame *) gameList.tailPred)->number, &stats ); } + GameListUpdateTitle( hDlg, "Game List", count, ((ListGame *) gameList.tailPred)->number, &stats ); return FALSE; case WM_SIZE: @@ -355,7 +299,7 @@ GameListDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if( GetDlgItemText( hDlg, IDC_GameListFilter, filter, sizeof(filter) ) >= 0 ) { filter[ sizeof(filter)-1 ] = '\0'; count = GameListToListBox( hDlg, TRUE, filter, &stats ); - GameListUpdateTitle( hDlg, szDlgTitle, count, ((ListGame *) gameList.tailPred)->number, &stats ); + GameListUpdateTitle( hDlg, "Game List", count, ((ListGame *) gameList.tailPred)->number, &stats ); } } return FALSE;