X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=menu%2Fm_item_new.c;h=4e3f67bacdd0580de188fc5243509ecae3211380;hb=HEAD;hp=1e6130e678e2426d36ef7fb099f6d819862aad1b;hpb=5925150381bb42a4d8c7116d62c348a7b84309f3;p=ncurses.git diff --git a/menu/m_item_new.c b/menu/m_item_new.c index 1e6130e6..28b71caf 100644 --- a/menu/m_item_new.c +++ b/menu/m_item_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020-2021 Thomas E. Dickey * * Copyright 1998-2010,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -45,12 +45,12 @@ #endif #endif -MODULE_ID("$Id: m_item_new.c,v 1.36 2020/12/12 00:38:08 tom Exp $") +MODULE_ID("$Id: m_item_new.c,v 1.38 2021/06/17 21:26:02 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : bool Is_Printable_String(const char *s) -| +| | Description : Checks whether or not the string contains only printable | characters. | @@ -98,9 +98,9 @@ Is_Printable_String(const char *s) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : ITEM *new_item(char *name, char *description) -| +| | Description : Create a new item with name and description. Return | a pointer to this new item. | N.B.: an item must(!) have a name. @@ -127,6 +127,7 @@ new_item(const char *name, const char *description) if (item) { + T((T_CREATE("item %p"), (void *)item)); *item = _nc_Default_Item; /* hope we have struct assignment */ item->name.length = (unsigned short)strlen(name); @@ -151,15 +152,15 @@ new_item(const char *name, const char *description) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int free_item(ITEM *item) -| -| Description : Free the allocated storage for this item. +| +| Description : Free the allocated storage for this item. | N.B.: a connected item can't be freed. | | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid value has been passed -| E_CONNECTED - item is still connected to a menu +| E_CONNECTED - item is still connected to a menu +--------------------------------------------------------------------------*/ MENU_EXPORT(int) free_item(ITEM *item) @@ -178,16 +179,16 @@ free_item(ITEM *item) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_mark( MENU *menu, const char *mark ) -| +| | Description : Set the mark string used to indicate the current | item (single-valued menu) or the selected items | (multi-valued menu). -| The mark argument may be NULL, in which case no +| The mark argument may be NULL, in which case no | marker is used. -| This might be a little bit tricky, because this may -| affect the geometry of the menu, which we don't allow +| This might be a little bit tricky, because this may +| affect the geometry of the menu, which we don't allow | if it is already posted. | | Return Values : E_OK - success @@ -259,9 +260,9 @@ set_menu_mark(MENU *menu, const char *mark) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : char *menu_mark(const MENU *menu) -| +| | Description : Return a pointer to the marker string | | Return Values : The marker string pointer or NULL if no marker defined