From 640c1355e6ae2bc48460acd1cb97f001cb236290 Mon Sep 17 00:00:00 2001 From: "Rob Swindell (on ChromeOS)" <rob@synchro.net> Date: Tue, 21 Feb 2023 20:26:15 -0800 Subject: [PATCH] Add uifcapi_t.kmode that can be used to set global key-input mode flags e.g. this a way to set the K_TRIM mode globally for all keyboard input --- src/uifc/uifc.h | 17 ++--------------- src/uifc/uifc32.c | 2 ++ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/uifc/uifc.h b/src/uifc/uifc.h index d40c823b39..da7220b3b1 100644 --- a/src/uifc/uifc.h +++ b/src/uifc/uifc.h @@ -1,7 +1,5 @@ /* Text-mode User Interface Library (inspired by Novell SYSCON look & feel) */ -/* $Id: uifc.h,v 1.97 2020/08/16 20:37:08 rswindell Exp $ */ - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -15,21 +13,9 @@ * See the GNU Lesser General Public License for more details: lgpl.txt or * * http://www.fsf.org/copyleft/lesser.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -346,7 +332,8 @@ typedef struct { /****************************************************************************/ /* Controls general UIFC library behavior. */ /****************************************************************************/ - long mode; + int mode; + int kmode; /****************************************************************************/ /* Set to TRUE when changes to data have been made by input function. */ /****************************************************************************/ diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index f5c36d254f..97f35d48eb 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -2135,6 +2135,8 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int char *pastebuf=NULL; unsigned char *pb=NULL; + mode |= api->kmode; // Global keyboard input mode flags (e.g. K_TRIM) + api->exit_flags = 0; if((str=alloca(max+1))==NULL) { cprintf("UIFC line %d: error allocating %u bytes\r\n" -- GitLab