X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=menu%2Fm_pattern.c;h=6fbef236f2e6aa67c858f8f07ccea3789d8957cd;hp=c3ef43a628639ac8152b48046c99435e718aae81;hb=9f479192e3ca3413d235c66bf058f8cc63764898;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/menu/m_pattern.c b/menu/m_pattern.c index c3ef43a6..6fbef236 100644 --- a/menu/m_pattern.c +++ b/menu/m_pattern.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * + * Copyright 2020,2021 Thomas E. Dickey * + * Copyright 1998-2006,2010 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 * @@ -37,12 +38,12 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_pattern.c,v 1.14 2005/04/16 17:53:16 tom Exp $") +MODULE_ID("$Id: m_pattern.c,v 1.20 2021/06/17 21:20:30 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : char *menu_pattern(const MENU *menu) -| +| | Description : Return the value of the pattern buffer. | | Return Values : NULL - if there is no pattern buffer allocated @@ -50,35 +51,35 @@ MODULE_ID("$Id: m_pattern.c,v 1.14 2005/04/16 17:53:16 tom Exp $") | pattern is stored | PatternString - as expected +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(char *) -menu_pattern(const MENU * menu) +MENU_EXPORT(char *) +menu_pattern(const MENU *menu) { static char empty[] = ""; - T((T_CALLED("menu_pattern(%p)"), menu)); + T((T_CALLED("menu_pattern(%p)"), (const void *)menu)); returnPtr(menu ? (menu->pattern ? menu->pattern : empty) : 0); } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_pattern(MENU *menu, const char *p) -| +| | Description : Set the match pattern for a menu and position to the | first item that matches. | | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid menu or pattern pointer -| E_NOT_CONNECTED - no items connected to menu | E_BAD_STATE - menu in user hook routine +| E_NOT_CONNECTED - no items connected to menu | E_NO_MATCH - no item matches pattern +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(int) -set_menu_pattern(MENU * menu, const char *p) +MENU_EXPORT(int) +set_menu_pattern(MENU *menu, const char *p) { ITEM *matchitem; int matchpos; - T((T_CALLED("set_menu_pattern(%p,%s)"), menu, _nc_visbuf(p))); + T((T_CALLED("set_menu_pattern(%p,%s)"), (void *)menu, _nc_visbuf(p))); if (!menu || !p) RETURN(E_BAD_ARGUMENT);