Introduce shared/defines.h to collect commonly used macros. For now
it defines min() / max() macros.
This commit is contained in:
@@ -13,6 +13,7 @@ v.0.5dev (ongoing development)
|
|||||||
* configure: Fix de-selecting of drivers
|
* configure: Fix de-selecting of drivers
|
||||||
* Build system: Add a check testing if SA_RESTART flag is available.
|
* Build system: Add a check testing if SA_RESTART flag is available.
|
||||||
* picolcd driver: Fix RC-5 for picoLCD 20x2 (A. van Schie)
|
* picolcd driver: Fix RC-5 for picoLCD 20x2 (A. van Schie)
|
||||||
|
* Introduce shared/defines.h to collect commonly used macros
|
||||||
|
|
||||||
v0.5.3
|
v0.5.3
|
||||||
+ lcdexec: notification when called program finishes
|
+ lcdexec: notification when called program finishes
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef MAIN_H
|
#ifndef MAIN_H
|
||||||
#define MAIN_H
|
#define MAIN_H
|
||||||
|
|
||||||
|
#include "shared/defines.h"
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
# define TRUE 1
|
# define TRUE 1
|
||||||
#endif
|
#endif
|
||||||
@@ -61,12 +63,4 @@ const char *get_hostname(void);
|
|||||||
const char *get_sysname(void);
|
const char *get_sysname(void);
|
||||||
const char *get_sysrelease(void);
|
const char *get_sysrelease(void);
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
# define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef max
|
|
||||||
# define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
#ifndef LCDVC_H
|
#ifndef LCDVC_H
|
||||||
#define LCDVC_H
|
#define LCDVC_H
|
||||||
|
|
||||||
|
#include "shared/defines.h"
|
||||||
|
|
||||||
#define CHAIN(e,f) { if( e>=0 ) { e=(f); }}
|
#define CHAIN(e,f) { if( e>=0 ) { e=(f); }}
|
||||||
#define CHAIN_END(e) { if( e<0 ) { report( RPT_CRIT,"Critical error, abort"); exit(e); }}
|
#define CHAIN_END(e) { if( e<0 ) { report( RPT_CRIT,"Critical error, abort"); exit(e); }}
|
||||||
|
|
||||||
#define min(a,b) ((a)<(b))?(a):(b)
|
|
||||||
|
|
||||||
#define UNSET_INT -1
|
#define UNSET_INT -1
|
||||||
#define UNSET_STR "\01"
|
#define UNSET_STR "\01"
|
||||||
|
|
||||||
|
|||||||
@@ -60,17 +60,17 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "lcd.h"
|
|
||||||
#include "pylcd.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "shared/defines.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "pylcd.h"
|
||||||
#include "lcd_lib.h"
|
#include "lcd_lib.h"
|
||||||
#include "report.h"
|
#include "report.h"
|
||||||
|
|
||||||
#define min(a, b) ((a)<(b) ? (a) : (b))
|
|
||||||
#define True 1
|
#define True 1
|
||||||
#define False 0
|
#define False 0
|
||||||
|
|
||||||
|
|||||||
@@ -225,9 +225,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
||||||
|
|
||||||
// Autorepeat values
|
// Autorepeat values
|
||||||
#define KEYPAD_AUTOREPEAT_DELAY 500
|
#define KEYPAD_AUTOREPEAT_DELAY 500
|
||||||
#define KEYPAD_AUTOREPEAT_FREQ 15
|
#define KEYPAD_AUTOREPEAT_FREQ 15
|
||||||
|
|||||||
+1
-1
@@ -55,6 +55,7 @@
|
|||||||
/* TODO: fill in what to include otherwise */
|
/* TODO: fill in what to include otherwise */
|
||||||
|
|
||||||
#include "shared/report.h"
|
#include "shared/report.h"
|
||||||
|
#include "shared/defines.h"
|
||||||
|
|
||||||
#include "drivers.h"
|
#include "drivers.h"
|
||||||
#include "sock.h"
|
#include "sock.h"
|
||||||
@@ -70,7 +71,6 @@
|
|||||||
#include "drivers.h"
|
#include "drivers.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
|
||||||
#if !defined(SYSCONFDIR)
|
#if !defined(SYSCONFDIR)
|
||||||
# define SYSCONFDIR "/etc"
|
# define SYSCONFDIR "/etc"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
# define false 0
|
# define false 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
||||||
|
|
||||||
#include "shared/LL.h"
|
#include "shared/LL.h"
|
||||||
|
|
||||||
/** A Menu is a MenuItem too.
|
/** A Menu is a MenuItem too.
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "shared/report.h"
|
#include "shared/report.h"
|
||||||
|
#include "shared/defines.h"
|
||||||
|
|
||||||
#include "menuitem.h"
|
#include "menuitem.h"
|
||||||
#include "menuscreens.h"
|
#include "menuscreens.h"
|
||||||
|
|||||||
@@ -35,9 +35,6 @@
|
|||||||
# define false 0
|
# define false 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* Data definitions of the menustuff
|
* Data definitions of the menustuff
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "shared/report.h"
|
#include "shared/report.h"
|
||||||
#include "shared/LL.h"
|
#include "shared/LL.h"
|
||||||
|
#include "shared/defines.h"
|
||||||
|
|
||||||
#include "drivers.h"
|
#include "drivers.h"
|
||||||
|
|
||||||
@@ -40,7 +41,6 @@
|
|||||||
|
|
||||||
#define BUFSIZE 1024 /* larger than display width => large enough */
|
#define BUFSIZE 1024 /* larger than display width => large enough */
|
||||||
|
|
||||||
|
|
||||||
int heartbeat = HEARTBEAT_OPEN;
|
int heartbeat = HEARTBEAT_OPEN;
|
||||||
static int heartbeat_fallback = HEARTBEAT_ON; /* If no heartbeat setting has been set at all */
|
static int heartbeat_fallback = HEARTBEAT_ON; /* If no heartbeat setting has been set at all */
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,6 +8,6 @@ libLCDstuff_a_LIBADD = @LIBOBJS@
|
|||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)
|
AM_CPPFLAGS = -I$(top_srcdir)
|
||||||
|
|
||||||
EXTRA_DIST = getopt.c getopt1.c getopt.h
|
EXTRA_DIST = getopt.c getopt1.c getopt.h defines.h
|
||||||
|
|
||||||
## EOF
|
## EOF
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/** \file shared/defines.h
|
||||||
|
* Define macros commonly used in other parts of LCDproc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* This file is part of LCDproc.
|
||||||
|
*
|
||||||
|
* This file is released under the GNU General Public License.
|
||||||
|
* Refer to the COPYING file distributed with this package.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SHARED_DEFINES_H
|
||||||
|
#define SHARED_DEFINES_H
|
||||||
|
|
||||||
|
/* Define min() and max() */
|
||||||
|
#ifndef min
|
||||||
|
# define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
#endif
|
||||||
|
#ifndef max
|
||||||
|
# define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user