summaryrefslogtreecommitdiff
path: root/led/complex1/menu.h
blob: 11ac9bab66f448b6db91439a72136ba5bf67ee75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 *  This is a general set of routines to provide a user interface
 *  for testing.
 *
 *  $Id$
 */

#ifndef __menu_h
#define __menu_h

#ifdef __cplusplus
extern "C" {
#endif


typedef void (*test_menu_routine_t)( void );   /* Test routine */

  typedef struct {                             /* entry for a test */
  const char             *name;
  test_menu_routine_t     routine;
} Menu_entry;

  typedef struct {                             /* A menu  */
  const char   *header;
  unsigned int  number_of_entries;
  Menu_entry   *entry;
} Test_menu;

  /*
   * returns an int between min and max for value described by str.
   */

int Test_menu_Get_int_bounded(
  const char        *str,
  int                min,
  int                max
);

float Test_menu_Get_float_bounded(
  const char        *str,
  float              min,
  float              max
);

int Test_menu_Get_int(
  char              *str
);

/*
 * Returns a selection from the selection list.
 */

int Test_menu_Get_selection(
  const char        *title,
  int                select_count,
  char              *selection[]
);

/*
 * Returns a user entered string.  This is a static local variable.
 */

char *Test_menu_Get_string(
   const char        *str
);

  /*
   * Displays and processes the menu passed in.
   */

void Test_menu_run(
  Test_menu     *menu
);


#ifdef __cplusplus
}
#endif

#endif