comparison src/scroll.c @ 529:413127b220ef

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Tue, 04 Feb 1992 01:11:11 +0000
parents 1cc29824b3f1
children a8d94735277e
comparison
equal deleted inserted replaced
528:5af35411366a 529:413127b220ef
235 int unchanged_at_top; 235 int unchanged_at_top;
236 { 236 {
237 register struct matrix_elt *p; 237 register struct matrix_elt *p;
238 register int i, j; 238 register int i, j;
239 register struct screen_glyphs *current_screen; 239 register struct screen_glyphs *current_screen;
240 /* temp_screen->enable[i] means line i has been moved to current_screen. */
240 register struct screen_glyphs *temp_screen; 241 register struct screen_glyphs *temp_screen;
241 struct queue { int count, pos; } *queue; 242 struct queue { int count, pos; } *queue;
242 int offset = unchanged_at_top; 243 int offset = unchanged_at_top;
243 int qi = 0; 244 int qi = 0;
244 int window = 0; 245 int window = 0;
485 register int i; 486 register int i;
486 register int screen_height = SCREEN_HEIGHT (screen); 487 register int screen_height = SCREEN_HEIGHT (screen);
487 register int insert_overhead = ov1 * 10; 488 register int insert_overhead = ov1 * 10;
488 register int next_insert_cost = ovn * 10; 489 register int next_insert_cost = ovn * 10;
489 490
490 for (i = 0; i < screen_height; i++) 491 for (i = screen_height-1; i >= 0; i--)
491 { 492 {
492 mf[screen_height - i] = next_insert_cost / 10; 493 mf[i] = next_insert_cost / 10;
493 next_insert_cost += pfn; 494 next_insert_cost += pfn;
494 ov[screen_height - i] = (insert_overhead + next_insert_cost) / 10; 495 ov[i] = (insert_overhead + next_insert_cost) / 10;
495 insert_overhead += pf1; 496 insert_overhead += pf1;
496 } 497 }
497 } 498 }
498 499
499 static void 500 static void
566 char *setup_string, *cleanup_string; 567 char *setup_string, *cleanup_string;
567 int coefficient; 568 int coefficient;
568 { 569 {
569 if (SCREEN_INSERT_COST (screen) != 0) 570 if (SCREEN_INSERT_COST (screen) != 0)
570 { 571 {
571 SCREEN_INSERT_COST (screen) 572 SCREEN_INSERT_COST (screen) =
572 = (int *) xrealloc (SCREEN_INSERT_COST (screen), 573 (int *) xrealloc (SCREEN_INSERT_COST (screen),
573 SCREEN_HEIGHT (screen) * sizeof (int)); 574 SCREEN_HEIGHT (screen) * sizeof (int));
574 SCREEN_DELETEN_COST (screen) 575 SCREEN_DELETEN_COST (screen) =
575 = (int *) xrealloc (SCREEN_DELETEN_COST (screen), 576 (int *) xrealloc (SCREEN_DELETEN_COST (screen),
576 SCREEN_HEIGHT (screen) * sizeof (int)); 577 SCREEN_HEIGHT (screen) * sizeof (int));
577 SCREEN_INSERTN_COST (screen) 578 SCREEN_INSERTN_COST (screen) =
578 = (int *) xrealloc (SCREEN_INSERTN_COST (screen), 579 (int *) xrealloc (SCREEN_INSERTN_COST (screen),
579 SCREEN_HEIGHT (screen) * sizeof (int)); 580 SCREEN_HEIGHT (screen) * sizeof (int));
580 SCREEN_DELETE_COST (screen) 581 SCREEN_DELETE_COST (screen) =
581 = (int *) xrealloc (SCREEN_DELETE_COST (screen), 582 (int *) xrealloc (SCREEN_DELETE_COST (screen),
582 SCREEN_HEIGHT (screen) * sizeof (int)); 583 SCREEN_HEIGHT (screen) * sizeof (int));
583 } 584 }
584 else 585 else
585 { 586 {
586 SCREEN_INSERT_COST (screen) 587 SCREEN_INSERT_COST (screen) =
587 = (int *) xmalloc (SCREEN_HEIGHT (screen) * sizeof (int)); 588 (int *) xmalloc (SCREEN_HEIGHT (screen) * sizeof (int));
588 SCREEN_DELETEN_COST (screen) 589 SCREEN_DELETEN_COST (screen) =
589 = (int *) xmalloc (SCREEN_HEIGHT (screen) * sizeof (int)); 590 (int *) xmalloc (SCREEN_HEIGHT (screen) * sizeof (int));
590 SCREEN_INSERTN_COST (screen) 591 SCREEN_INSERTN_COST (screen) =
591 = (int *) xmalloc (SCREEN_HEIGHT (screen) * sizeof (int)); 592 (int *) xmalloc (SCREEN_HEIGHT (screen) * sizeof (int));
592 SCREEN_DELETE_COST (screen) 593 SCREEN_DELETE_COST (screen) =
593 = (int *) xmalloc (SCREEN_HEIGHT (screen) * sizeof (int)); 594 (int *) xmalloc (SCREEN_HEIGHT (screen) * sizeof (int));
594 } 595 }
595 596
596 ins_del_costs (screen, 597 ins_del_costs (screen,
597 ins_line_string, multi_ins_string, 598 ins_line_string, multi_ins_string,
598 setup_string, cleanup_string, 599 setup_string, cleanup_string,