1 1.8 blymn /* $NetBSD: notimeout.c,v 1.8 2024/12/23 02:58:04 blymn Exp $ */ 2 1.1 mrg 3 1.1 mrg /*- 4 1.6 blymn * Copyright (c) 1998-2014 Brett Lymn (blymn (at) netbsd.org) 5 1.1 mrg * All rights reserved. 6 1.1 mrg * 7 1.1 mrg * Redistribution and use in source and binary forms, with or without 8 1.1 mrg * modification, are permitted provided that the following conditions 9 1.1 mrg * are met: 10 1.1 mrg * 1. Redistributions of source code must retain the above copyright 11 1.1 mrg * notice, this list of conditions and the following disclaimer. 12 1.1 mrg * 2. The name of the author may not be used to endorse or promote products 13 1.5 wiz * derived from this software without specific prior written permission 14 1.1 mrg * 15 1.1 mrg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 1.1 mrg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 1.1 mrg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 1.1 mrg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 1.1 mrg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 1.1 mrg * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 1.1 mrg * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 1.1 mrg * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 1.1 mrg * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 1.1 mrg * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 1.1 mrg * 26 1.1 mrg * 27 1.1 mrg */ 28 1.4 blymn 29 1.4 blymn #include <sys/cdefs.h> 30 1.4 blymn #ifndef lint 31 1.8 blymn __RCSID("$NetBSD: notimeout.c,v 1.8 2024/12/23 02:58:04 blymn Exp $"); 32 1.4 blymn #endif /* not lint */ 33 1.1 mrg 34 1.1 mrg #include "curses.h" 35 1.2 blymn #include "curses_private.h" 36 1.1 mrg 37 1.1 mrg /* 38 1.1 mrg * notimeout -- 39 1.1 mrg * Turn on and off inter-key timeout when assembling function keys for a 40 1.1 mrg * given window. 41 1.1 mrg */ 42 1.2 blymn int 43 1.3 blymn notimeout(WINDOW *win, bool bf) 44 1.1 mrg { 45 1.7 roy 46 1.8 blymn if (__predict_false(win == NULL)) 47 1.8 blymn return ERR; 48 1.8 blymn 49 1.1 mrg if (bf) 50 1.6 blymn win->flags |= __NOTIMEOUT; 51 1.6 blymn else 52 1.1 mrg win->flags &= ~__NOTIMEOUT; 53 1.2 blymn 54 1.2 blymn return OK; 55 1.1 mrg } 56