1mitem_new(3X)                                                    mitem_new(3X)
2
3
4

NAME

6       new_item, free_item - create and destroy menu items
7

SYNOPSIS

9       #include <menu.h>
10
11       ITEM *new_item(const char *name, const char *description);
12       int free_item(ITEM *item);
13

DESCRIPTION

15       The  function new_item allocates a new item and initializes it from the
16       name and description pointers.  Please notice that the item stores only
17       the pointers to the name and description.  Those pointers must be valid
18       during the lifetime of the item.  So you should be  very  careful  with
19       names or descriptions allocated on the stack of some routines.
20       The  function free_item de-allocates an item.  Please notice that it is
21       the responsibility of the application to release  the  memory  for  the
22       name or the description of the item.
23

RETURN VALUE

25       The  function  new_item returns NULL on error.  It sets errno according
26       to the function's failure:
27
28       E_BAD_ARGUMENT
29            Routine detected an incorrect or out-of-range argument.
30
31       E_SYSTEM_ERROR
32            System error occurred, e.g., malloc failure.
33
34       The function free_item returns one of the following:
35
36       E_OK The routine succeeded.
37
38       E_BAD_ARGUMENT
39            Routine detected an incorrect or out-of-range argument.
40
41       E_CONNECTED
42            Item is connected to a menu.
43
44       E_SYSTEM_ERROR
45            System error occurred (see errno(3)).
46

SEE ALSO

48       curses(3X), menu(3X).
49

NOTES

51       The  header  file  <menu.h>  automatically  includes  the  header  file
52       <curses.h>.
53

PORTABILITY

55       These  routines  emulate the System V menu library.  They were not sup‐
56       ported on Version 7 or BSD versions.
57

AUTHORS

59       Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric S.
60       Raymond.
61
62
63
64                                                                 mitem_new(3X)
Impressum