summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1999-06-24 13:04:33 +0000
committeryokota <yokota@FreeBSD.org>1999-06-24 13:04:33 +0000
commitaf2f08c3ae7043bd91601daac047801532ef990f (patch)
tree7d3467c6644cbd3d3d8d0b62b99df0e21cbc8009
parent3e3cf46989dc0a23e9009be02179e18cbbd55b40 (diff)
downloadFreeBSD-src-af2f08c3ae7043bd91601daac047801532ef990f.zip
FreeBSD-src-af2f08c3ae7043bd91601daac047801532ef990f.tar.gz
Fix ESC[P (delete N chars) and ESC[@ (insert N chars). These deletion
and insertion should affect the line the cursor is on only. This change should have been committed together with syscons.c rev 1.308. (I forgot to do so, when I committed syscons.c :-( Pointed out by: sos
-rw-r--r--sys/dev/syscons/scvtb.c20
-rw-r--r--sys/dev/syscons/syscons.h3
2 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/syscons/scvtb.c b/sys/dev/syscons/scvtb.c
index a7d1a71..3c62ec9 100644
--- a/sys/dev/syscons/scvtb.c
+++ b/sys/dev/syscons/scvtb.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id:$
+ * $Id: scvtb.c,v 1.1 1999/06/22 14:13:30 yokota Exp $
*/
#include "sc.h"
@@ -232,6 +232,24 @@ sc_vtb_erase(sc_vtb_t *vtb, int at, int count, int c, int attr)
}
void
+sc_vtb_move(sc_vtb_t *vtb, int from, int to, int count)
+{
+ if (from + count > vtb->vtb_size)
+ count = vtb->vtb_size - from;
+ if (to + count > vtb->vtb_size)
+ count = vtb->vtb_size - to;
+ if (count <= 0)
+ return;
+ if (vtb->vtb_type == VTB_FRAMEBUFFER) {
+ bcopy_io(sc_vtb_pointer(vtb, from),
+ sc_vtb_pointer(vtb, to), count*sizeof(u_int16_t));
+ } else {
+ bcopy((void *)sc_vtb_pointer(vtb, from),
+ (void *)sc_vtb_pointer(vtb, to), count*sizeof(u_int16_t));
+ }
+}
+
+void
sc_vtb_delete(sc_vtb_t *vtb, int at, int count, int c, int attr)
{
int len;
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h
index da48c7c..d7f3d19 100644
--- a/sys/dev/syscons/syscons.h
+++ b/sys/dev/syscons/syscons.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.h,v 1.47 1999/04/12 13:34:56 des Exp $
+ * $Id: syscons.h,v 1.48 1999/06/22 14:13:32 yokota Exp $
*/
#ifndef _DEV_SYSCONS_SYSCONS_H_
@@ -496,6 +496,7 @@ void sc_vtb_append(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2,
int count);
void sc_vtb_seek(sc_vtb_t *vtb, int pos);
void sc_vtb_erase(sc_vtb_t *vtb, int at, int count, int c, int attr);
+void sc_vtb_move(sc_vtb_t *vtb, int from, int to, int count);
void sc_vtb_delete(sc_vtb_t *vtb, int at, int count, int c, int attr);
void sc_vtb_ins(sc_vtb_t *vtb, int at, int count, int c, int attr);
OpenPOWER on IntegriCloud