X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_has_cap.c;h=17e59d5351734266ad433f07d9a6eb211bc8f5f2;hp=7121fc758f4f366498498c46d9d4d8bbbaac3549;hb=a20e6eb464be80b9cd8cae7ce925d27fe9c209ed;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce diff --git a/ncurses/tinfo/lib_has_cap.c b/ncurses/tinfo/lib_has_cap.c index 7121fc75..17e59d53 100644 --- a/ncurses/tinfo/lib_has_cap.c +++ b/ncurses/tinfo/lib_has_cap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2013 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,9 +29,10 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-2003 * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ - /* ** lib_has_cap.c ** @@ -41,23 +42,53 @@ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_has_cap.c,v 1.1 1998/10/23 15:32:21 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.10 2013/11/16 19:57:22 tom Exp $") -bool has_ic(void) +NCURSES_EXPORT(bool) +NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0) { - T((T_CALLED("has_ic()"))); - returnCode(cur_term && - (insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)); + bool code = FALSE; + + T((T_CALLED("has_ic(%p)"), (void *) SP_PARM)); + + if (HasTInfoTerminal(SP_PARM)) { + code = ((insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)) ? TRUE : FALSE; + } + + returnCode(code); +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(bool) +has_ic(void) +{ + return NCURSES_SP_NAME(has_ic) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(bool) +NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0) +{ + bool code = FALSE; + T((T_CALLED("has_il(%p)"), (void *) SP_PARM)); + if (HasTInfoTerminal(SP_PARM)) { + code = ((insert_line || parm_insert_line) + && (delete_line || parm_delete_line)) ? TRUE : FALSE; + } + + returnCode(code); } -bool has_il(void) +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(bool) +has_il(void) { - T((T_CALLED("has_il()"))); - returnCode(cur_term - && (insert_line || parm_insert_line) - && (delete_line || parm_delete_line)); + return NCURSES_SP_NAME(has_il) (CURRENT_SCREEN); } +#endif