forked from amberisvibin/bbs
prepare for compile time init of screens[]
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#define MAX_SCREENS 2 /* size of screens array */
|
||||
#define MAX_ERROR_MESSAGE_SIZE 60 /* size of error_message array */
|
||||
#define MAX_SCREEN_NAME_SIZE 20 /* size of the screen name array */
|
||||
|
||||
#ifndef GLOBALS_H /* header guard */
|
||||
#define GLOBALS_H
|
||||
@@ -17,11 +18,13 @@ enum ActiveScreen {
|
||||
};
|
||||
|
||||
struct Screen {
|
||||
char name[20];
|
||||
char name[MAX_SCREEN_NAME_SIZE];
|
||||
WINDOW *win;
|
||||
void (*draw_screen)(struct Screen *, char *input); /* GETCH_TIMEOUT determines how often this is run, in ms */
|
||||
};
|
||||
|
||||
struct Screen screens[MAX_SCREENS];
|
||||
/* TODO: put this in a screens.c file and include all screens there, that way the array can be initialized at compile
|
||||
* time */
|
||||
extern struct Screen screens[];
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user