/* Cursor motion subroutines for GNU Emacs.
- Copyright (C) 1985, 1995, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1995, 2001-2012 Free Software Foundation, Inc.
based primarily on public domain code written by Chris Torek
This file is part of GNU Emacs.
#include <config.h>
#include <stdio.h>
-#include <setjmp.h>
#include "lisp.h"
#include "frame.h"
#include "cm.h"
#include "termhooks.h"
#include "termchar.h"
-
-
-/* For now, don't try to include termcap.h. On some systems,
- configure finds a non-standard termcap.h that the main build
- won't find. */
-extern void tputs (const char *, int, int (*)(int));
-extern char *tgoto (const char *, int, int);
+#include "tparam.h"
#define BIG 9999 /* 9999 good on VAXen. For 16 bit machines
use about 2000.... */
-extern char *BC, *UP;
-
int cost; /* sums up costs */
/* ARGSUSED */
if (curX (tty) == FrameCols (tty))
{
if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1)
- abort ();
+ emacs_abort ();
if (tty->termscript)
putc ('\r', tty->termscript);
putc ('\r', tty->output);
tabx,
tab2x,
tabcost;
- register char *p;
+ register const char *p;
/* If have just wrapped on a terminal with xn,
don't believe the cursor position: give up here
}
totalcost = c * deltay;
if (doit)
- while (--deltay >= 0)
+ do
emacs_tputs (tty, p, 1, cmputc);
+ while (0 < --deltay);
x:
if ((deltax = dstx - srcx) == 0)
goto done;
}
totalcost += c * deltax;
if (doit)
- while (--deltax >= 0)
+ do
emacs_tputs (tty, p, 1, cmputc);
+ while (0 < --deltax);
done:
return totalcost;
}
#if 0
-losecursor ()
+void
+losecursor (void)
{
curY = -1;
}
llcost,
relcost,
directcost;
- int use;
- char *p,
- *dcm;
+ int use IF_LINT (= 0);
+ char *p;
+ const char *dcm;
/* First the degenerate case */
if (row == curY (tty) && col == curX (tty)) /* already there */
return - 2;
return 0;
}
-