* tuiSourceWin.c (tui_show_source_line): New function.
[deliverable/binutils-gdb.git] / gdb / tui / tuiSourceWin.c
1 /* TUI display source/assembly window.
2
3 Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
4 Inc.
5
6 Contributed by Hewlett-Packard Company.
7
8 This file is part of GDB.
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
24
25 /* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
26 "defs.h" should be included first. Unfortunatly some systems
27 (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
28 and they clash with "bfd.h"'s definiton of true/false. The correct
29 fix is to remove true/false from "bfd.h", however, until that
30 happens, hack around it by including "config.h" and <curses.h>
31 first. */
32
33 #include "config.h"
34 #ifdef HAVE_NCURSES_H
35 #include <ncurses.h>
36 #else
37 #ifdef HAVE_CURSES_H
38 #include <curses.h>
39 #endif
40 #endif
41
42 #include "defs.h"
43 #include <ctype.h>
44 #include "symtab.h"
45 #include "frame.h"
46 #include "breakpoint.h"
47 #include "value.h"
48
49 #include "tui.h"
50 #include "tuiData.h"
51 #include "tuiStack.h"
52 #include "tuiWin.h"
53 #include "tuiGeneralWin.h"
54 #include "tuiSourceWin.h"
55 #include "tuiSource.h"
56 #include "tuiDisassem.h"
57
58
59 /*****************************************
60 ** EXTERNAL FUNCTION DECLS **
61 ******************************************/
62
63 /*****************************************
64 ** EXTERNAL DATA DECLS **
65 ******************************************/
66 extern int current_source_line;
67 extern struct symtab *current_source_symtab;
68
69 /*
70 ** tuiDisplayMainFunction().
71 ** Function to display the "main" routine"
72 */
73 void
74 tuiDisplayMainFunction (void)
75 {
76 if ((sourceWindows ())->count > 0)
77 {
78 CORE_ADDR addr;
79
80 addr = parse_and_eval_address ("main");
81 if (addr == (CORE_ADDR) 0)
82 addr = parse_and_eval_address ("MAIN");
83 if (addr != (CORE_ADDR) 0)
84 {
85 struct symtab_and_line sal;
86
87 tuiUpdateSourceWindowsWithAddr (addr);
88 sal = find_pc_line (addr, 0);
89 tuiSwitchFilename (sal.symtab->filename);
90 }
91 }
92
93 return;
94 } /* tuiDisplayMainFunction */
95
96
97
98 /*
99 ** tuiUpdateSourceWindow().
100 ** Function to display source in the source window. This function
101 ** initializes the horizontal scroll to 0.
102 */
103 void
104 tuiUpdateSourceWindow (TuiWinInfoPtr winInfo, struct symtab *s,
105 TuiLineOrAddress lineOrAddr, int noerror)
106 {
107 winInfo->detail.sourceInfo.horizontalOffset = 0;
108 tuiUpdateSourceWindowAsIs (winInfo, s, lineOrAddr, noerror);
109
110 return;
111 } /* tuiUpdateSourceWindow */
112
113
114 /*
115 ** tuiUpdateSourceWindowAsIs().
116 ** Function to display source in the source/asm window. This
117 ** function shows the source as specified by the horizontal offset.
118 */
119 void
120 tuiUpdateSourceWindowAsIs (TuiWinInfoPtr winInfo, struct symtab *s,
121 TuiLineOrAddress lineOrAddr, int noerror)
122 {
123 TuiStatus ret;
124
125 if (winInfo->generic.type == SRC_WIN)
126 ret = tuiSetSourceContent (s, lineOrAddr.lineNo, noerror);
127 else
128 ret = tuiSetDisassemContent (s, lineOrAddr.addr);
129
130 if (ret == TUI_FAILURE)
131 {
132 tuiClearSourceContent (winInfo, EMPTY_SOURCE_PROMPT);
133 tuiClearExecInfoContent (winInfo);
134 }
135 else
136 {
137 tuiEraseSourceContent (winInfo, NO_EMPTY_SOURCE_PROMPT);
138 tuiShowSourceContent (winInfo);
139 tuiUpdateExecInfo (winInfo);
140 if (winInfo->generic.type == SRC_WIN)
141 {
142 current_source_line = lineOrAddr.lineNo +
143 (winInfo->generic.contentSize - 2);
144 current_source_symtab = s;
145 /*
146 ** If the focus was in the asm win, put it in the src
147 ** win if we don't have a split layout
148 */
149 if (tuiWinWithFocus () == disassemWin &&
150 currentLayout () != SRC_DISASSEM_COMMAND)
151 tuiSetWinFocusTo (srcWin);
152 }
153 }
154
155
156 return;
157 } /* tuiUpdateSourceWindowAsIs */
158
159
160 /*
161 ** tuiUpdateSourceWindowsWithAddr().
162 ** Function to ensure that the source and/or disassemly windows
163 ** reflect the input address.
164 */
165 void
166 tuiUpdateSourceWindowsWithAddr (CORE_ADDR addr)
167 {
168 if (addr != 0)
169 {
170 struct symtab_and_line sal;
171 TuiLineOrAddress l;
172
173 switch (currentLayout ())
174 {
175 case DISASSEM_COMMAND:
176 case DISASSEM_DATA_COMMAND:
177 tuiShowDisassem (addr);
178 break;
179 case SRC_DISASSEM_COMMAND:
180 tuiShowDisassemAndUpdateSource (addr);
181 break;
182 default:
183 sal = find_pc_line (addr, 0);
184 l.lineNo = sal.line;
185 tuiShowSource (sal.symtab, l, FALSE);
186 break;
187 }
188 }
189 else
190 {
191 int i;
192
193 for (i = 0; i < (sourceWindows ())->count; i++)
194 {
195 TuiWinInfoPtr winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
196
197 tuiClearSourceContent (winInfo, EMPTY_SOURCE_PROMPT);
198 tuiClearExecInfoContent (winInfo);
199 }
200 }
201
202 return;
203 } /* tuiUpdateSourceWindowsWithAddr */
204
205 /*
206 ** tuiUpdateSourceWindowsWithLine().
207 ** Function to ensure that the source and/or disassemly windows
208 ** reflect the input address.
209 */
210 void
211 tuiUpdateSourceWindowsWithLine (struct symtab *s, int line)
212 {
213 CORE_ADDR pc;
214 TuiLineOrAddress l;
215
216 switch (currentLayout ())
217 {
218 case DISASSEM_COMMAND:
219 case DISASSEM_DATA_COMMAND:
220 find_line_pc (s, line, &pc);
221 tuiUpdateSourceWindowsWithAddr (pc);
222 break;
223 default:
224 l.lineNo = line;
225 tuiShowSource (s, l, FALSE);
226 if (currentLayout () == SRC_DISASSEM_COMMAND)
227 {
228 find_line_pc (s, line, &pc);
229 tuiShowDisassem (pc);
230 }
231 break;
232 }
233
234 return;
235 } /* tuiUpdateSourceWindowsWithLine */
236
237 /*
238 ** tuiClearSourceContent().
239 */
240 void
241 tuiClearSourceContent (TuiWinInfoPtr winInfo, int displayPrompt)
242 {
243 if (m_winPtrNotNull (winInfo))
244 {
245 register int i;
246
247 winInfo->generic.contentInUse = FALSE;
248 tuiEraseSourceContent (winInfo, displayPrompt);
249 for (i = 0; i < winInfo->generic.contentSize; i++)
250 {
251 TuiWinElementPtr element =
252 (TuiWinElementPtr) winInfo->generic.content[i];
253 element->whichElement.source.hasBreak = FALSE;
254 element->whichElement.source.isExecPoint = FALSE;
255 }
256 }
257
258 return;
259 } /* tuiClearSourceContent */
260
261
262 /*
263 ** tuiEraseSourceContent().
264 */
265 void
266 tuiEraseSourceContent (TuiWinInfoPtr winInfo, int displayPrompt)
267 {
268 int xPos;
269 int halfWidth = (winInfo->generic.width - 2) / 2;
270
271 if (winInfo->generic.handle != (WINDOW *) NULL)
272 {
273 werase (winInfo->generic.handle);
274 checkAndDisplayHighlightIfNeeded (winInfo);
275 if (displayPrompt == EMPTY_SOURCE_PROMPT)
276 {
277 char *noSrcStr;
278
279 if (winInfo->generic.type == SRC_WIN)
280 noSrcStr = NO_SRC_STRING;
281 else
282 noSrcStr = NO_DISASSEM_STRING;
283 if (strlen (noSrcStr) >= halfWidth)
284 xPos = 1;
285 else
286 xPos = halfWidth - strlen (noSrcStr);
287 mvwaddstr (winInfo->generic.handle,
288 (winInfo->generic.height / 2),
289 xPos,
290 noSrcStr);
291
292 /* elz: added this function call to set the real contents of
293 the window to what is on the screen, so that later calls
294 to refresh, do display
295 the correct stuff, and not the old image */
296
297 tuiSetSourceContentNil (winInfo, noSrcStr);
298 }
299 tuiRefreshWin (&winInfo->generic);
300 }
301 return;
302 } /* tuiEraseSourceContent */
303
304
305 /*
306 ** tuiEraseAllSourceContent().
307 */
308 void
309 tuiEraseAllSourceWinsContent (int displayPrompt)
310 {
311 int i;
312
313 for (i = 0; i < (sourceWindows ())->count; i++)
314 tuiEraseSourceContent ((TuiWinInfoPtr) (sourceWindows ())->list[i],
315 displayPrompt);
316
317 return;
318 } /* tuiEraseAllSourceWinsContent */
319
320
321 /* Redraw the complete line of a source or disassembly window. */
322 static void
323 tui_show_source_line (TuiWinInfoPtr winInfo, int lineno)
324 {
325 TuiWinElementPtr line;
326 int x, y;
327
328 line = (TuiWinElementPtr) winInfo->generic.content[lineno - 1];
329 if (line->whichElement.source.isExecPoint)
330 wattron (winInfo->generic.handle, A_STANDOUT);
331
332 mvwaddstr (winInfo->generic.handle, lineno, 1,
333 line->whichElement.source.line);
334 if (line->whichElement.source.isExecPoint)
335 wattroff (winInfo->generic.handle, A_STANDOUT);
336
337 /* Clear to end of line but stop before the border. */
338 getyx (winInfo->generic.handle, y, x);
339 while (x + 1 < winInfo->generic.width)
340 {
341 waddch (winInfo->generic.handle, ' ');
342 getyx (winInfo->generic.handle, y, x);
343 }
344 }
345
346 /*
347 ** tuiShowSourceContent().
348 */
349 void
350 tuiShowSourceContent (TuiWinInfoPtr winInfo)
351 {
352 if (winInfo->generic.contentSize > 0)
353 {
354 int lineno;
355
356 for (lineno = 1; lineno <= winInfo->generic.contentSize; lineno++)
357 tui_show_source_line (winInfo, lineno);
358 }
359 else
360 tuiEraseSourceContent (winInfo, TRUE);
361
362 checkAndDisplayHighlightIfNeeded (winInfo);
363 tuiRefreshWin (&winInfo->generic);
364 winInfo->generic.contentInUse = TRUE;
365 }
366
367
368 /*
369 ** tuiHorizontalSourceScroll().
370 ** Scroll the source forward or backward horizontally
371 */
372 void
373 tuiHorizontalSourceScroll (TuiWinInfoPtr winInfo,
374 TuiScrollDirection direction,
375 int numToScroll)
376 {
377 if (winInfo->generic.content != (OpaquePtr) NULL)
378 {
379 int offset;
380 struct symtab *s;
381
382 if (current_source_symtab == (struct symtab *) NULL)
383 s = find_pc_symtab (selected_frame->pc);
384 else
385 s = current_source_symtab;
386
387 if (direction == LEFT_SCROLL)
388 offset = winInfo->detail.sourceInfo.horizontalOffset + numToScroll;
389 else
390 {
391 if ((offset =
392 winInfo->detail.sourceInfo.horizontalOffset - numToScroll) < 0)
393 offset = 0;
394 }
395 winInfo->detail.sourceInfo.horizontalOffset = offset;
396 tuiUpdateSourceWindowAsIs (
397 winInfo,
398 s,
399 ((TuiWinElementPtr)
400 winInfo->generic.content[0])->whichElement.source.lineOrAddr,
401 FALSE);
402 }
403
404 return;
405 } /* tuiHorizontalSourceScroll */
406
407
408 /*
409 ** tuiSetHasExecPointAt().
410 ** Set or clear the hasBreak flag in the line whose line is lineNo.
411 */
412 void
413 tuiSetIsExecPointAt (TuiLineOrAddress l, TuiWinInfoPtr winInfo)
414 {
415 int i;
416 TuiWinContent content = (TuiWinContent) winInfo->generic.content;
417
418 i = 0;
419 while (i < winInfo->generic.contentSize)
420 {
421 if (content[i]->whichElement.source.lineOrAddr.addr == l.addr)
422 content[i]->whichElement.source.isExecPoint = TRUE;
423 else
424 content[i]->whichElement.source.isExecPoint = FALSE;
425 i++;
426 }
427
428 return;
429 } /* tuiSetIsExecPointAt */
430
431 /*
432 ** tuiSetHasBreakAt().
433 ** Set or clear the hasBreak flag in the line whose line is lineNo.
434 */
435 void
436 tuiSetHasBreakAt (struct breakpoint *bp, TuiWinInfoPtr winInfo, int hasBreak)
437 {
438 int i;
439 TuiWinContent content = (TuiWinContent) winInfo->generic.content;
440
441 i = 0;
442 while (i < winInfo->generic.contentSize)
443 {
444 int gotIt;
445 TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
446
447 if (winInfo == srcWin)
448 {
449 char *fileNameDisplayed = (char *) NULL;
450
451 if (((TuiWinElementPtr)
452 locator->content[0])->whichElement.locator.fileName !=
453 (char *) NULL)
454 fileNameDisplayed = ((TuiWinElementPtr)
455 locator->content[0])->whichElement.locator.fileName;
456 else if (current_source_symtab != (struct symtab *) NULL)
457 fileNameDisplayed = current_source_symtab->filename;
458
459 gotIt = (fileNameDisplayed != (char *) NULL &&
460 bp->source_file != NULL &&
461 (strcmp (bp->source_file, fileNameDisplayed) == 0) &&
462 content[i]->whichElement.source.lineOrAddr.lineNo ==
463 bp->line_number);
464 }
465 else
466 gotIt = (content[i]->whichElement.source.lineOrAddr.addr
467 == bp->address);
468 if (gotIt)
469 {
470 content[i]->whichElement.source.hasBreak = hasBreak;
471 break;
472 }
473 i++;
474 }
475
476 return;
477 } /* tuiSetHasBreakAt */
478
479
480 /*
481 ** tuiAllSetHasBreakAt().
482 ** Set or clear the hasBreak flag in all displayed source windows.
483 */
484 void
485 tuiAllSetHasBreakAt (struct breakpoint *bp, int hasBreak)
486 {
487 int i;
488
489 for (i = 0; i < (sourceWindows ())->count; i++)
490 tuiSetHasBreakAt (bp,
491 (TuiWinInfoPtr) (sourceWindows ())->list[i], hasBreak);
492
493 return;
494 } /* tuiAllSetHasBreakAt */
495
496
497 /*********************************
498 ** EXECUTION INFO FUNCTIONS **
499 *********************************/
500
501 /*
502 ** tuiSetExecInfoContent().
503 ** Function to initialize the content of the execution info window,
504 ** based upon the input window which is either the source or
505 ** disassembly window.
506 */
507 TuiStatus
508 tuiSetExecInfoContent (TuiWinInfoPtr winInfo)
509 {
510 TuiStatus ret = TUI_SUCCESS;
511
512 if (winInfo->detail.sourceInfo.executionInfo != (TuiGenWinInfoPtr) NULL)
513 {
514 TuiGenWinInfoPtr execInfoPtr = winInfo->detail.sourceInfo.executionInfo;
515
516 if (execInfoPtr->content == (OpaquePtr) NULL)
517 execInfoPtr->content =
518 (OpaquePtr) allocContent (winInfo->generic.height,
519 execInfoPtr->type);
520 if (execInfoPtr->content != (OpaquePtr) NULL)
521 {
522 int i;
523
524 for (i = 0; i < winInfo->generic.contentSize; i++)
525 {
526 TuiWinElementPtr element;
527 TuiWinElementPtr srcElement;
528
529 element = (TuiWinElementPtr) execInfoPtr->content[i];
530 srcElement = (TuiWinElementPtr) winInfo->generic.content[i];
531 /*
532 ** First check to see if we have a breakpoint that is
533 ** temporary. If so, and this is our current execution point,
534 ** then clear the break indicator.
535 */
536 if (srcElement->whichElement.source.hasBreak &&
537 srcElement->whichElement.source.isExecPoint)
538 {
539 struct breakpoint *bp;
540 int found = FALSE;
541 extern struct breakpoint *breakpoint_chain;
542
543 for (bp = breakpoint_chain;
544 (bp != (struct breakpoint *) NULL && !found);
545 bp = bp->next)
546 {
547 found =
548 (winInfo == srcWin &&
549 bp->line_number ==
550 srcElement->whichElement.source.lineOrAddr.lineNo) ||
551 (winInfo == disassemWin &&
552 bp->address == (CORE_ADDR)
553 srcElement->whichElement.source.lineOrAddr.addr);
554 if (found)
555 srcElement->whichElement.source.hasBreak =
556 (bp->disposition != disp_del || bp->hit_count <= 0);
557 }
558 if (!found)
559 srcElement->whichElement.source.hasBreak = FALSE;
560 }
561 /*
562 ** Now update the exec info content based upon the state
563 ** of each line as indicated by the source content.
564 */
565 if (srcElement->whichElement.source.hasBreak &&
566 srcElement->whichElement.source.isExecPoint)
567 element->whichElement.simpleString = breakLocationStr ();
568 else if (srcElement->whichElement.source.hasBreak)
569 element->whichElement.simpleString = breakStr ();
570 else if (srcElement->whichElement.source.isExecPoint)
571 element->whichElement.simpleString = locationStr ();
572 else
573 element->whichElement.simpleString = blankStr ();
574 }
575 execInfoPtr->contentSize = winInfo->generic.contentSize;
576 }
577 else
578 ret = TUI_FAILURE;
579 }
580
581 return ret;
582 } /* tuiSetExecInfoContent */
583
584
585 /*
586 ** tuiShowExecInfoContent().
587 */
588 void
589 tuiShowExecInfoContent (TuiWinInfoPtr winInfo)
590 {
591 TuiGenWinInfoPtr execInfo = winInfo->detail.sourceInfo.executionInfo;
592 int curLine;
593
594 werase (execInfo->handle);
595 tuiRefreshWin (execInfo);
596 for (curLine = 1; (curLine <= execInfo->contentSize); curLine++)
597 mvwaddstr (execInfo->handle,
598 curLine,
599 0,
600 ((TuiWinElementPtr)
601 execInfo->content[curLine - 1])->whichElement.simpleString);
602 tuiRefreshWin (execInfo);
603 execInfo->contentInUse = TRUE;
604
605 return;
606 } /* tuiShowExecInfoContent */
607
608
609 /*
610 ** tuiShowAllExecInfosContent()
611 */
612 void
613 tuiShowAllExecInfosContent (void)
614 {
615 int i;
616
617 for (i = 0; i < (sourceWindows ())->count; i++)
618 tuiShowExecInfoContent ((TuiWinInfoPtr) (sourceWindows ())->list[i]);
619
620 return;
621 } /* tuiShowAllExecInfosContent */
622
623
624 /*
625 ** tuiEraseExecInfoContent().
626 */
627 void
628 tuiEraseExecInfoContent (TuiWinInfoPtr winInfo)
629 {
630 TuiGenWinInfoPtr execInfo = winInfo->detail.sourceInfo.executionInfo;
631
632 werase (execInfo->handle);
633 tuiRefreshWin (execInfo);
634
635 return;
636 } /* tuiEraseExecInfoContent */
637
638 /*
639 ** tuiClearExecInfoContent().
640 */
641 void
642 tuiClearExecInfoContent (TuiWinInfoPtr winInfo)
643 {
644 winInfo->detail.sourceInfo.executionInfo->contentInUse = FALSE;
645 tuiEraseExecInfoContent (winInfo);
646
647 return;
648 } /* tuiClearExecInfoContent */
649
650 /*
651 ** tuiUpdateExecInfo().
652 ** Function to update the execution info window
653 */
654 void
655 tuiUpdateExecInfo (TuiWinInfoPtr winInfo)
656 {
657 tuiSetExecInfoContent (winInfo);
658 tuiShowExecInfoContent (winInfo);
659 } /* tuiUpdateExecInfo */
660
661
662 /*
663 ** tuiUpdateAllExecInfos()
664 */
665 void
666 tuiUpdateAllExecInfos (void)
667 {
668 int i;
669
670 for (i = 0; i < (sourceWindows ())->count; i++)
671 tuiUpdateExecInfo ((TuiWinInfoPtr) (sourceWindows ())->list[i]);
672
673 return;
674 } /* tuiUpdateAllExecInfos */
675
676 TuiStatus
677 tuiAllocSourceBuffer (TuiWinInfoPtr winInfo)
678 {
679 register char *srcLine, *srcLineBuf;
680 register int i, lineWidth, c, maxLines;
681 TuiStatus ret = TUI_FAILURE;
682
683 maxLines = winInfo->generic.height; /* less the highlight box */
684 lineWidth = winInfo->generic.width - 1;
685 /*
686 ** Allocate the buffer for the source lines. Do this only once since they
687 ** will be re-used for all source displays. The only other time this will
688 ** be done is when a window's size changes.
689 */
690 if (winInfo->generic.content == (OpaquePtr) NULL)
691 {
692 srcLineBuf = (char *) xmalloc ((maxLines * lineWidth) * sizeof (char));
693 if (srcLineBuf == (char *) NULL)
694 fputs_unfiltered (
695 "Unable to Allocate Memory for Source or Disassembly Display.\n",
696 gdb_stderr);
697 else
698 {
699 /* allocate the content list */
700 if ((winInfo->generic.content =
701 (OpaquePtr) allocContent (maxLines, SRC_WIN)) == (OpaquePtr) NULL)
702 {
703 tuiFree (srcLineBuf);
704 srcLineBuf = (char *) NULL;
705 fputs_unfiltered (
706 "Unable to Allocate Memory for Source or Disassembly Display.\n",
707 gdb_stderr);
708 }
709 }
710 for (i = 0; i < maxLines; i++)
711 ((TuiWinElementPtr)
712 winInfo->generic.content[i])->whichElement.source.line =
713 srcLineBuf + (lineWidth * i);
714 ret = TUI_SUCCESS;
715 }
716 else
717 ret = TUI_SUCCESS;
718
719 return ret;
720 } /* tuiAllocSourceBuffer */
721
722
723 /*
724 ** tuiLineIsDisplayed().
725 ** Answer whether the a particular line number or address is displayed
726 ** in the current source window.
727 */
728 int
729 tuiLineIsDisplayed (int line, TuiWinInfoPtr winInfo,
730 int checkThreshold)
731 {
732 int isDisplayed = FALSE;
733 int i, threshold;
734
735 if (checkThreshold)
736 threshold = SCROLL_THRESHOLD;
737 else
738 threshold = 0;
739 i = 0;
740 while (i < winInfo->generic.contentSize - threshold && !isDisplayed)
741 {
742 isDisplayed = (((TuiWinElementPtr)
743 winInfo->generic.content[i])->whichElement.source.lineOrAddr.lineNo
744 == (int) line);
745 i++;
746 }
747
748 return isDisplayed;
749 } /* tuiLineIsDisplayed */
750
751
752 /*
753 ** tuiLineIsDisplayed().
754 ** Answer whether the a particular line number or address is displayed
755 ** in the current source window.
756 */
757 int
758 tuiAddrIsDisplayed (CORE_ADDR addr, TuiWinInfoPtr winInfo,
759 int checkThreshold)
760 {
761 int isDisplayed = FALSE;
762 int i, threshold;
763
764 if (checkThreshold)
765 threshold = SCROLL_THRESHOLD;
766 else
767 threshold = 0;
768 i = 0;
769 while (i < winInfo->generic.contentSize - threshold && !isDisplayed)
770 {
771 isDisplayed = (((TuiWinElementPtr)
772 winInfo->generic.content[i])->whichElement.source.lineOrAddr.addr
773 == addr);
774 i++;
775 }
776
777 return isDisplayed;
778 }
779
780
781 /*****************************************
782 ** STATIC LOCAL FUNCTIONS **
783 ******************************************/
This page took 0.061591 seconds and 4 git commands to generate.