[Listener] Reindent macros in header

This commit is contained in:
Matteo Cypriani 2011-02-04 17:01:28 +01:00
parent 57f1331273
commit ee89f9ea28
1 changed files with 108 additions and 54 deletions

View File

@ -106,75 +106,129 @@ void print_version(void) ;
*/ */
/* libconfuse macros */ /* libconfuse macros */
#ifdef USE_CONFIG_FILE #ifdef USE_CONFIG_FILE
#define SET_MODE(MODE) (cfg_setint(cfg, "mode", (MODE))) #define SET_MODE(MODE) \
#define GET_MODE() (cfg_getint(cfg, "mode")) (cfg_setint(cfg, "mode", (MODE)))
#define SET_AGGREGATION_IP(IP) (cfg_setstr(cfg, "aggregation_ip", (IP))) #define GET_MODE() \
#define GET_AGGREGATION_IP() (cfg_getstr(cfg, "aggregation_ip")) (cfg_getint(cfg, "mode"))
#define SET_AGGREGATION_IP(IP) \
(cfg_setstr(cfg, "aggregation_ip", (IP)))
#define GET_AGGREGATION_IP() \
(cfg_getstr(cfg, "aggregation_ip"))
#ifdef USE_PTHREAD #ifdef USE_PTHREAD
#define SET_KEEP_MONITOR() (cfg_setbool(cfg, "keep_monitor", cfg_true)) #define SET_KEEP_MONITOR() \
#define GET_KEEP_MONITOR() (cfg_getbool(cfg, "keep_monitor")) (cfg_setbool(cfg, "keep_monitor", cfg_true))
#define GET_KEEP_MONITOR() \
(cfg_getbool(cfg, "keep_monitor"))
#endif // USE_PTHREAD #endif // USE_PTHREAD
#define SET_AGGREGATION_PORT(PORT) (cfg_setint(cfg, "aggregation_port", (PORT))) #define SET_AGGREGATION_PORT(PORT) \
#define GET_AGGREGATION_PORT() (cfg_getint(cfg, "aggregation_port")) (cfg_setint(cfg, "aggregation_port", (PORT)))
#define SET_LISTENING_PORT(PORT) (cfg_setint(cfg, "listening_port", (PORT))) #define GET_AGGREGATION_PORT() \
#define GET_LISTENING_PORT() (cfg_getint(cfg, "listening_port")) (cfg_getint(cfg, "aggregation_port"))
#define SET_RTAP_IFACE(IFACE) (cfg_setstr(cfg, "rtap_iface", (IFACE))) #define SET_LISTENING_PORT(PORT) \
#define GET_RTAP_IFACE() (cfg_getstr(cfg, "rtap_iface")) (cfg_setint(cfg, "listening_port", (PORT)))
#define SET_WIFI_IFACE(IFACE) (cfg_setstr(cfg, "wifi_iface", (IFACE))) #define GET_LISTENING_PORT() \
#define GET_WIFI_IFACE() (cfg_getstr(cfg, "wifi_iface")) (cfg_getint(cfg, "listening_port"))
#define SET_RTAP_IFACE(IFACE) \
(cfg_setstr(cfg, "rtap_iface", (IFACE)))
#define GET_RTAP_IFACE() \
(cfg_getstr(cfg, "rtap_iface"))
#define SET_WIFI_IFACE(IFACE) \
(cfg_setstr(cfg, "wifi_iface", (IFACE)))
#define GET_WIFI_IFACE() \
(cfg_getstr(cfg, "wifi_iface"))
#ifdef USE_PTHREAD #ifdef USE_PTHREAD
#define SET_AUTOCALIBRATION() (cfg_setbool(cfg, "autocalibration", cfg_true)) #define SET_AUTOCALIBRATION() \
#define GET_AUTOCALIBRATION() (cfg_getbool(cfg, "autocalibration")) (cfg_setbool(cfg, "autocalibration", cfg_true))
#define SET_AUTOCALIBRATION_PORT(PORT) (cfg_setint(cfg, "autocalibration_port", (PORT))) #define GET_AUTOCALIBRATION() \
#define GET_AUTOCALIBRATION_PORT() (cfg_getint(cfg, "autocalibration_port")) (cfg_getbool(cfg, "autocalibration"))
#define SET_AUTOCALIBRATION_HELLO_DELAY(DELAY) (cfg_setint(cfg, "autocalibration_hello_delay", (DELAY))) #define SET_AUTOCALIBRATION_PORT(PORT) \
#define GET_AUTOCALIBRATION_HELLO_DELAY() (cfg_getint(cfg, "autocalibration_hello_delay")) (cfg_setint(cfg, "autocalibration_port", (PORT)))
#define SET_AUTOCALIBRATION_DELAY(DELAY) (cfg_setint(cfg, "autocalibration_delay", (DELAY))) #define GET_AUTOCALIBRATION_PORT() \
#define GET_AUTOCALIBRATION_DELAY() (cfg_getint(cfg, "autocalibration_delay")) (cfg_getint(cfg, "autocalibration_port"))
#define SET_AUTOCALIBRATION_NBPKT(NBPKT) (cfg_setint(cfg, "autocalibration_nb_packets", (NBPKT))) #define SET_AUTOCALIBRATION_HELLO_DELAY(DELAY) \
#define GET_AUTOCALIBRATION_NBPKT() (cfg_getint(cfg, "autocalibration_nb_packets")) (cfg_setint(cfg, "autocalibration_hello_delay", (DELAY)))
#define GET_AUTOCALIBRATION_HELLO_DELAY() \
(cfg_getint(cfg, "autocalibration_hello_delay"))
#define SET_AUTOCALIBRATION_DELAY(DELAY) \
(cfg_setint(cfg, "autocalibration_delay", (DELAY)))
#define GET_AUTOCALIBRATION_DELAY() \
(cfg_getint(cfg, "autocalibration_delay"))
#define SET_AUTOCALIBRATION_NBPKT(NBPKT) \
(cfg_setint(cfg, "autocalibration_nb_packets", (NBPKT)))
#define GET_AUTOCALIBRATION_NBPKT() \
(cfg_getint(cfg, "autocalibration_nb_packets"))
#endif // USE_PTHREAD #endif // USE_PTHREAD
#define SET_VERBOSE() (cfg_setbool(cfg, "verbose", cfg_true)) #define SET_VERBOSE() \
#define UNSET_VERBOSE() (cfg_setbool(cfg, "verbose", cfg_false)) (cfg_setbool(cfg, "verbose", cfg_true))
#define GET_VERBOSE() (cfg_getbool(cfg, "verbose")) #define UNSET_VERBOSE() \
(cfg_setbool(cfg, "verbose", cfg_false))
#define GET_VERBOSE() \
(cfg_getbool(cfg, "verbose"))
/* Home-made structure macros */ /* Home-made structure macros */
#else // USE_CONFIG_FILE #else // USE_CONFIG_FILE
#define SET_MODE(MODE) (options.mode = (MODE)) #define SET_MODE(MODE) \
#define GET_MODE() (options.mode) (options.mode = (MODE))
#define SET_AGGREGATION_IP(IP) (strncpy(options.aggregation_ip, (IP), 16)) #define GET_MODE() \
#define GET_AGGREGATION_IP() (options.aggregation_ip) (options.mode)
#define SET_AGGREGATION_IP(IP) \
(strncpy(options.aggregation_ip, (IP), 16))
#define GET_AGGREGATION_IP() \
(options.aggregation_ip)
#ifdef USE_PTHREAD #ifdef USE_PTHREAD
#define SET_KEEP_MONITOR() (options.keep_monitor = TRUE) #define SET_KEEP_MONITOR() \
#define GET_KEEP_MONITOR() (options.keep_monitor) (options.keep_monitor = TRUE)
#define GET_KEEP_MONITOR() \
(options.keep_monitor)
#endif // USE_PTHREAD #endif // USE_PTHREAD
#define SET_AGGREGATION_PORT(PORT) (options.aggregation_port = (PORT)) #define SET_AGGREGATION_PORT(PORT) \
#define GET_AGGREGATION_PORT() (options.aggregation_port) (options.aggregation_port = (PORT))
#define SET_LISTENING_PORT(PORT) (options.listening_port = (PORT)) #define GET_AGGREGATION_PORT() \
#define GET_LISTENING_PORT() (options.listening_port) (options.aggregation_port)
#define SET_RTAP_IFACE(IFACE) (strncpy(options.rtap_iface, (IFACE), IFNAMSIZ+1)) #define SET_LISTENING_PORT(PORT) \
#define GET_RTAP_IFACE() (options.rtap_iface) (options.listening_port = (PORT))
#define SET_WIFI_IFACE(IFACE) (strncpy(options.wifi_iface, (IFACE), IFNAMSIZ+1)) #define GET_LISTENING_PORT() \
#define GET_WIFI_IFACE() (options.wifi_iface) (options.listening_port)
#define SET_RTAP_IFACE(IFACE) \
(strncpy(options.rtap_iface, (IFACE), IFNAMSIZ+1))
#define GET_RTAP_IFACE() \
(options.rtap_iface)
#define SET_WIFI_IFACE(IFACE) \
(strncpy(options.wifi_iface, (IFACE), IFNAMSIZ+1))
#define GET_WIFI_IFACE() \
(options.wifi_iface)
#ifdef USE_PTHREAD #ifdef USE_PTHREAD
#define SET_AUTOCALIBRATION() (options.autocalibration = TRUE) #define SET_AUTOCALIBRATION() \
#define GET_AUTOCALIBRATION() (options.autocalibration) (options.autocalibration = TRUE)
#define SET_AUTOCALIBRATION_PORT(PORT) (options.autocalibration_port = (PORT)) #define GET_AUTOCALIBRATION() \
#define GET_AUTOCALIBRATION_PORT() (options.autocalibration_port) (options.autocalibration)
#define SET_AUTOCALIBRATION_HELLO_DELAY(DELAY) (options.autocalibration_hello_delay = (DELAY)) #define SET_AUTOCALIBRATION_PORT(PORT) \
#define GET_AUTOCALIBRATION_HELLO_DELAY() (options.autocalibration_hello_delay) (options.autocalibration_port = (PORT))
#define SET_AUTOCALIBRATION_DELAY(DELAY) (options.autocalibration_delay = (DELAY)) #define GET_AUTOCALIBRATION_PORT() \
#define GET_AUTOCALIBRATION_DELAY() (options.autocalibration_delay) (options.autocalibration_port)
#define SET_AUTOCALIBRATION_NBPKT(NBPKT) (options.autocalibration_nb_packets = (NBPKT)) #define SET_AUTOCALIBRATION_HELLO_DELAY(DELAY) \
#define GET_AUTOCALIBRATION_NBPKT() (options.autocalibration_nb_packets) (options.autocalibration_hello_delay = (DELAY))
#define GET_AUTOCALIBRATION_HELLO_DELAY() \
(options.autocalibration_hello_delay)
#define SET_AUTOCALIBRATION_DELAY(DELAY) \
(options.autocalibration_delay = (DELAY))
#define GET_AUTOCALIBRATION_DELAY() \
(options.autocalibration_delay)
#define SET_AUTOCALIBRATION_NBPKT(NBPKT) \
(options.autocalibration_nb_packets = (NBPKT))
#define GET_AUTOCALIBRATION_NBPKT() \
(options.autocalibration_nb_packets)
#endif // USE_PTHREAD #endif // USE_PTHREAD
#define SET_VERBOSE() (options.verbose = TRUE) #define SET_VERBOSE() \
#define UNSET_VERBOSE() (options.verbose = FALSE) (options.verbose = TRUE)
#define GET_VERBOSE() (options.verbose) #define UNSET_VERBOSE() \
(options.verbose = FALSE)
#define GET_VERBOSE() \
(options.verbose)
#endif // USE_CONFIG_FILE #endif // USE_CONFIG_FILE