Renamed to NickelMenu
This commit is contained in:
18
src/menu.h
18
src/menu.h
@@ -1,5 +1,5 @@
|
||||
#ifndef NMI_MENU_H
|
||||
#define NMI_MENU_H
|
||||
#ifndef NM_MENU_H
|
||||
#define NM_MENU_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -7,23 +7,23 @@ extern "C" {
|
||||
#include <stddef.h>
|
||||
|
||||
typedef enum {
|
||||
NMI_MENU_LOCATION_MAIN_MENU = 1,
|
||||
NMI_MENU_LOCATION_READER_MENU = 2,
|
||||
} nmi_menu_location_t;
|
||||
NM_MENU_LOCATION_MAIN_MENU = 1,
|
||||
NM_MENU_LOCATION_READER_MENU = 2,
|
||||
} nm_menu_location_t;
|
||||
|
||||
typedef struct {
|
||||
nmi_menu_location_t loc;
|
||||
nm_menu_location_t loc;
|
||||
char *lbl;
|
||||
char *arg;
|
||||
int (*act)(const char *arg, char **out_err); // can block, must return 0 on success, nonzero with out_err set to the malloc'd error message on error
|
||||
} nmi_menu_item_t;
|
||||
} nm_menu_item_t;
|
||||
|
||||
// nmi_menu_hook hooks a dlopen'd libnickel handle to add the specified menus,
|
||||
// nm_menu_hook hooks a dlopen'd libnickel handle to add the specified menus,
|
||||
// and returns 0 on success, or 1 with err_out (if provided) set to the malloc'd
|
||||
// error message on error. The provided configuration and all pointers it
|
||||
// references must remain valid for the lifetime of the program (i.e. not stack
|
||||
// allocated). It MUST NOT be called more than once.
|
||||
int nmi_menu_hook(void *libnickel, nmi_menu_item_t **items, size_t items_n, char **err_out);
|
||||
int nm_menu_hook(void *libnickel, nm_menu_item_t **items, size_t items_n, char **err_out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user