aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/hci/tui/settings_ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpxe/src/hci/tui/settings_ui.c')
-rw-r--r--gpxe/src/hci/tui/settings_ui.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gpxe/src/hci/tui/settings_ui.c b/gpxe/src/hci/tui/settings_ui.c
index 4ab38270..74ce6afb 100644
--- a/gpxe/src/hci/tui/settings_ui.c
+++ b/gpxe/src/hci/tui/settings_ui.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+FILE_LICENCE ( GPL2_OR_LATER );
+
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
@@ -77,12 +79,8 @@ struct setting_widget {
char value[256]; /* enough size for a DHCP string */
};
-/** Registered configuration settings */
-static struct setting all_settings[0]
- __table_start ( struct setting, settings );
-static struct setting all_settings_end[0]
- __table_end ( struct setting, settings );
-#define NUM_SETTINGS ( ( unsigned ) ( all_settings_end - all_settings ) )
+/** Number of registered configuration settings */
+#define NUM_SETTINGS table_num_entries ( SETTINGS )
static void load_setting ( struct setting_widget *widget ) __nonnull;
static int save_setting ( struct setting_widget *widget ) __nonnull;
@@ -223,6 +221,8 @@ static int edit_setting ( struct setting_widget *widget, int key ) {
static void init_setting_index ( struct setting_widget *widget,
struct settings *settings,
unsigned int index ) {
+ struct setting *all_settings = table_start ( SETTINGS );
+
init_setting ( widget, settings, &all_settings[index],
( SETTINGS_LIST_ROW + index ), SETTINGS_LIST_COL );
}