From owner-freebsd-hackers Tue Jun 16 14:08:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA22910 for freebsd-hackers-outgoing; Tue, 16 Jun 1998 14:08:11 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (daemon@smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA22811 for ; Tue, 16 Jun 1998 14:08:00 -0700 (PDT) (envelope-from tlambert@usr08.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id OAA11439; Tue, 16 Jun 1998 14:07:53 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp04.primenet.com, id smtpd011371; Tue Jun 16 14:07:43 1998 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id OAA23150; Tue, 16 Jun 1998 14:07:40 -0700 (MST) From: Terry Lambert Message-Id: <199806162107.OAA23150@usr08.primenet.com> Subject: Re: getty issue file To: vovik@ntu-kpi.kiev.ua (Vladimir A. Jakovenko) Date: Tue, 16 Jun 1998 21:07:40 +0000 (GMT) Cc: tlambert@primenet.com, freebsd-hackers@FreeBSD.ORG In-Reply-To: <19980616224451.65299@NTU-KPI.Kiev.UA> from "Vladimir A. Jakovenko" at Jun 16, 98 10:44:51 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > The point is that getline() will fail is there is more than 512 bytes > > before the EOL (LF). > > > > I'll see, sorry for my mistake :-( > > In previous posting you said: > > * This means you needs to ensure the terminal is in the base state before > * doing the newline. This is relatively easy to do, and won't damage the > * ability to download the sixel based character sets. > > so if I still need to load sixel fonts in getty, I have to add code to > check if terminal in a base state, do newline, and send next data > portion < 512, check base state, do newline, send data, etc .... > > Can you point me how I can check is a terminal in the base state? OK. Terminals are finite state automatons. They default to their base state when powered on. As you progress through an escape sequence, they leave the base state for other states, and when the sequence is completed, they return to the base state. Consider a simple parser for ANSI 3.64 escape sequences: state = 0; /* set initial automaton state to base state*/ for(;;) { c = input_char(); switch( state) { case 0: /* base state*/ switch( c) { case '\x1b': /* escape*/ state = 1; break; case '\b': /* backspace*/ cursor( CD_LEFT, 1); break; ... default: display_char( c); break; } break; case 1: /* processing an escape sequence*/ switch( c) { case '\x1b': /* escape escape -- return to base state*/ state = 0; break; case '[': /* CSI*/ ... } ... As you can see, "base state" just means "not in the middle of a sequence". For sixels, you send sequences of (from the comp.emulators.misc FAQ): fn : font number 0 or 1 cn : starting character (position of first character sent in character set) 0..95 ec : erase control 0..2 cmw: character matrix width 0..6 w : font width 0..2 t : text or full-cell 0..2 cmh: character matrix height 0..12 css: character set size 0..1 Dscs:define character set name <"space"../ "space"../ F> Sxbpn: sixel bit patterns So you get around the 512 byte limit by breaking up the sequence into multiple sequences, with interspersed linefeeds for "getline", using the "fn" and "cn" to download runs of characters. This means you send: DCS ..... ST LF DCS ..... ST LF DCS ..... ST LF DCS ..... ST LF Instead of: DCS ...................................................... ST Note also that the pcvt console for FreeBSD supports sixel character sets as well... it may be a way for you to unify all your character set processing. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message