return shell;
}
+extern int soughtCounts[];
+extern Board soughtBoard;
+
static int
GameListPrepare(int byPos)
{ // [HGM] filter: put in separate routine, to make callable from call-back
int nstrings;
ListGame *lg;
char **st, *line;
+struct {
+ long sec; /* Assuming this is >= 32 bits */
+ int ms; /* Assuming this is >= 16 bits */
+} t,t2; GetTimeMark(&t);
if(st = glc->strings) while(*st) free(*st++);
nstrings = ((ListGame *) gameList.tailPred)->number;
st = glc->strings;
lg = (ListGame *) gameList.head;
listLength = wins = losses = draws = 0;
+ if(byPos) InitSearch();
while (nstrings--) {
int pos = -1;
line = GameListLine(lg->number, &lg->gameInfo);
lg->position = pos;
lg = (ListGame *) lg->node.succ;
}
+GetTimeMark(&t2);printf("GameListPrepare %d msec\n", SubtractTimeMarks(&t2,&t));
DisplayTitle("XBoard");
*st = NULL;
return listLength;
}
static char *list[1003];
+int listEnd;
static void
GameListReplace(int page)
int i;
if(page) *st++ = _("previous page"); else if(listLength > 1000) *st++ = "";
- for(i=0; i<1000; i++) if( !(*st++ = glc->strings[page+i]) ) break;
+ for(i=0; i<1000; i++) if( !(*st++ = glc->strings[page+i]) ) { st--; break; }
+ listEnd = st - list;
if(page + 1000 <= listLength) *st++ = _("next page");
*st = NULL;
if(doLoad) direction /= 3;
index += direction;
if(direction == -2) index = 0;
- if(direction == 2) index = listLength-1;
- if(index < 0 || index >= listLength) return;
+ if(direction == 2) index = listEnd-1;
+ if(index < 0 || index >= listEnd) return;
XawListHighlight(listwidg, index);
if(!doLoad) return;
}