1mitem_new(3X) mitem_new(3X)
2
3
4
6 new_item, free_item - create and destroy menu items
7
9 #include <menu.h>
10 ITEM *new_item(const char *name, const char *description);
11 int free_item(ITEM *item);
12
14 The function new_item allocates a new item and initializes it from the
15 name and description pointers. Please notice that the item stores only
16 the pointers to the name and description. Those pointers must be valid
17 during the lifetime of the item. So you should be very careful with
18 names or descriptions allocated on the stack of some routines.
19 The function free_item de-allocates an item. Please notice that it is
20 the responsibility of the application to release the memory for the
21 name or the description of the item.
22
24 The function new_item returns NULL on error. It sets errno according
25 to the function's failure:
26
27 E_BAD_ARGUMENT
28 Routine detected an incorrect or out-of-range argument.
29
30 E_SYSTEM_ERROR
31 System error occurred, e.g., malloc failure.
32
33 The function free_item returns one of the following:
34
35 E_OK The routine succeeded.
36
37 E_BAD_ARGUMENT
38 Routine detected an incorrect or out-of-range argument.
39
40 E_CONNECTED
41 Item is connected to a menu.
42
43 E_SYSTEM_ERROR
44 System error occurred (see errno(3)).
45
47 curses(3X), menu(3X).
48
50 The header file <menu.h> automatically includes the header file
51 <curses.h>.
52
54 These routines emulate the System V menu library. They were not sup‐
55 ported on Version 7 or BSD versions.
56
58 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S.
59 Raymond.
60
61
62
63 mitem_new(3X)