2002-08-19 20:47:52 +00:00
|
|
|
/*
|
2006-11-19 14:33:01 +00:00
|
|
|
* lcdexec/menu.h
|
2002-08-19 20:47:52 +00:00
|
|
|
* This file is part of lcdexec, an LCDproc client.
|
|
|
|
|
*
|
|
|
|
|
* This file is released under the GNU General Public License. Refer to the
|
|
|
|
|
* COPYING file distributed with this package.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2002, Joris Robijn
|
2006-11-19 14:33:01 +00:00
|
|
|
* Copyright (c) 2006, Peter Marschall
|
2002-08-19 20:47:52 +00:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2006-11-19 14:33:01 +00:00
|
|
|
#ifndef LCDEXEC_MENU_H
|
|
|
|
|
#define LCDEXEC_MENU_H
|
2002-08-19 20:47:52 +00:00
|
|
|
|
2006-11-19 14:33:01 +00:00
|
|
|
#ifndef TRUE
|
|
|
|
|
# define TRUE 1
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef FALSE
|
|
|
|
|
# define FALSE 0
|
|
|
|
|
#endif
|
2002-08-19 20:47:52 +00:00
|
|
|
|
|
|
|
|
|
2006-04-29 19:44:11 +00:00
|
|
|
typedef enum {
|
|
|
|
|
unknown = 0,
|
|
|
|
|
menu = 1,
|
|
|
|
|
exec = 2,
|
|
|
|
|
} MenuType;
|
2002-08-19 20:47:52 +00:00
|
|
|
|
|
|
|
|
|
2006-04-29 19:44:11 +00:00
|
|
|
typedef struct menu_entry {
|
|
|
|
|
char *name;
|
|
|
|
|
char *displayname;
|
|
|
|
|
int id;
|
|
|
|
|
MenuType type;
|
|
|
|
|
|
|
|
|
|
// variables necessary for type menu
|
|
|
|
|
struct menu_entry *entries;
|
|
|
|
|
struct menu_entry *next;
|
|
|
|
|
|
|
|
|
|
// variables necessary for type exec
|
|
|
|
|
char *command;
|
|
|
|
|
} MenuEntry;
|
|
|
|
|
|
|
|
|
|
|
2006-10-22 13:04:01 +00:00
|
|
|
MenuEntry *menu_read(MenuEntry *parent, const char *name);
|
2006-04-29 19:44:11 +00:00
|
|
|
int menu_sock_send(MenuEntry *me, MenuEntry *parent, int sock);
|
|
|
|
|
MenuEntry *menu_find_by_id(MenuEntry *me, int id);
|
|
|
|
|
const char *menu_command(MenuEntry *me);
|
|
|
|
|
void menu_free(MenuEntry *me);
|
2006-09-21 05:29:06 +00:00
|
|
|
void menu_dump(MenuEntry *me);
|
2006-04-29 19:44:11 +00:00
|
|
|
|
2006-11-19 14:33:01 +00:00
|
|
|
#endif
|