68 len = (
sizeof ( *dynui ) + name_len + title_len );
72 name_copy = ( (
void * ) ( dynui + 1 ) );
73 title_copy = ( name_copy + name_len );
78 dynui->
name = name_copy;
81 dynui->
title = title_copy;
87 DBGC ( dynui,
"DYNUI %s created with title \"%s\"\n",
120 len = (
sizeof ( *item ) + name_len + text_len );
124 name_copy = ( (
void * ) ( item + 1 ) );
125 text_copy = ( name_copy + name_len );
130 item->
name = name_copy;
133 item->
text = text_copy;
193 unsigned int index ) {
A dynamic user interface item.
struct dynamic_ui * find_dynui(const char *name)
Find dynamic user interface.
unsigned int count
Number of user interface items.
#define list_del(list)
Delete an entry from a list.
static LIST_HEAD(dynamic_uis)
List of all dynamic user interfaces.
struct list_head items
Dynamic user interface items.
struct dynamic_item * dynui_shortcut(struct dynamic_ui *dynui, int key)
Find dynamic user interface item by shortcut key.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
char * strcpy(char *dest, const char *src)
Copy string.
struct dynamic_ui * create_dynui(const char *name, const char *title)
Create dynamic user interface.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
struct dynamic_item * add_dynui_item(struct dynamic_ui *dynui, const char *name, const char *text, unsigned int flags, int shortcut)
Add dynamic user interface item.
static void(* free)(struct refcnt *refcnt))
void * zalloc(size_t size)
Allocate cleared memory.
size_t strlen(const char *src)
Get length of string.
A dynamic user interface.
#define INIT_LIST_HEAD(list)
Initialise a list head.
int shortcut
Shortcut key.
int strcmp(const char *first, const char *second)
Compare strings.
struct list_head list
List of dynamic user interfaces.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void destroy_dynui(struct dynamic_ui *dynui)
Destroy dynamic user interface.
struct dynamic_item * dynui_item(struct dynamic_ui *dynui, unsigned int index)
Find dynamic user interface item by index.
struct list_head list
List of dynamic user interface items.
#define NULL
NULL pointer (VOID *)