Mega change to the LCDd's header files:

1. Use <stdbool.h> if it is available but keep a compatibility shim in
   shared/defines.h in case it is not.
2. Unbreak the circular header dependencies (mostly):
   2a. client.c and client.h may NOT depend on 'struct Menu'. Use a void pointer
       and casts instead.
   2b. Separate the data type definitions in client.h and screen.h from
       function prototypes which may require other data structures. This makes
       header dependencies much more easy to maintain. Usually the data types
       should have been moved to their own files but I (mmdolze) chose to
       separate them using different header guards.
   2c. Remove many now unused header includes.
Apply (old BSD-) style on menuscreens.c.
This commit is contained in:
mmdolze
2012-02-22 22:25:32 +00:00
parent 5e1edf5b60
commit a151ee0fc4
33 changed files with 321 additions and 247 deletions
+8 -10
View File
@@ -12,27 +12,25 @@
* 2005, Peter Marschall - error checks, ...
*/
#include "menuitem.h"
/* These headers are placed here on purpose ! (circular references) */
#ifndef MENU_H
#define MENU_H
#ifndef bool
# define bool short
# define true 1
# define false 0
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
#include "shared/defines.h"
#include "shared/LL.h"
#include "menuitem.h"
/** A Menu is a MenuItem too.
* This definition is only for better understanding of this code.
*/
typedef MenuItem Menu;
#include "screen.h"
/** Creates a new menu. */
Menu *menu_create(char *id, MenuEventFunc(*event_func),
char *text, Client *client);
@@ -43,8 +41,8 @@ Menu *menu_create(char *id, MenuEventFunc(*event_func),
*/
void menu_destroy(Menu *menu);
void menu_add_item(Menu *menu, MenuItem *item);
/** Adds an item to the menu */
void menu_add_item(Menu *menu, MenuItem *item);
/** Removes an item from the menu (does not destroy it) */
void menu_remove_item(Menu *menu, MenuItem *item);