forked from amberisvibin/bbs
each screen now has it's own file, and there is a framework for adding more
This commit is contained in:
22
globals.h
22
globals.h
@@ -1,11 +1,21 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#define MAX_ERROR_MESSAGE_SIZE 60 /* size of error_message array */
|
||||
#define MAX_SCREEN_NAME_SIZE 20 /* size of the screen name array */
|
||||
#define MAX_ERROR_MESSAGE_SIZE 60 /* size of error_message array */
|
||||
|
||||
#ifndef GLOBALS_H /* header guard */
|
||||
#define GLOBALS_H
|
||||
|
||||
#include <curses.h>
|
||||
|
||||
extern char error_message[];
|
||||
|
||||
struct Screen {
|
||||
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 */
|
||||
};
|
||||
|
||||
enum Status {
|
||||
STATUS_QUIT,
|
||||
STATUS_WAITING,
|
||||
@@ -17,14 +27,4 @@ enum ActiveScreen {
|
||||
ERROR
|
||||
};
|
||||
|
||||
struct Screen {
|
||||
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 */
|
||||
};
|
||||
|
||||
/* 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