From patchwork Tue Sep 26 11:28:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 818568 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y1dxv3w5Rz9tXb for ; Tue, 26 Sep 2017 21:28:51 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3y1dxv20XpzDsPN for ; Tue, 26 Sep 2017 21:28:51 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lvivier@redhat.com; receiver=) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3y1dx355SKzDsQB for ; Tue, 26 Sep 2017 21:28:07 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 098CA4DD4B for ; Tue, 26 Sep 2017 11:28:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 098CA4DD4B Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lvivier@redhat.com Received: from thinkpad.redhat.com (ovpn-116-104.ams2.redhat.com [10.36.116.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AA8E17AAC; Tue, 26 Sep 2017 11:28:04 +0000 (UTC) From: Laurent Vivier To: slof@lists.ozlabs.org Date: Tue, 26 Sep 2017 13:28:03 +0200 Message-Id: <20170926112803.4206-1-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 26 Sep 2017 11:28:05 +0000 (UTC) Subject: [SLOF] [PATCH] Fix output word X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" We can select the console output, but it does not really work Implement term-io-emit, as we have term-io-key to really send characters to the output selected by stdout. Signed-off-by: Laurent Vivier Reviewed-by: Nikunj A Dadhania --- slof/fs/term-io.fs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/slof/fs/term-io.fs b/slof/fs/term-io.fs index 52ce12a..a0b0f4b 100644 --- a/slof/fs/term-io.fs +++ b/slof/fs/term-io.fs @@ -40,6 +40,20 @@ 1 BUFFER: (term-io-char-buf) +: term-io-emit ( char -- ) + s" stdout" get-chosen IF + decode-int nip nip dup 0= IF 0 EXIT THEN + swap (term-io-char-buf) c! + >r (term-io-char-buf) 1 s" write" r@ $call-method + drop + r> drop + ELSE + [ ' emit behavior compile, ] + THEN +; + +' term-io-emit to emit + : term-io-key ( -- char ) s" stdin" get-chosen IF decode-int nip nip dup 0= IF 0 EXIT THEN