From ee89f9ea28d8e560c5ebc883058a43c25131dab9 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Fri, 4 Feb 2011 17:01:28 +0100 Subject: [PATCH] [Listener] Reindent macros in header --- .../owlps-listener/owlps-listener.h | 162 ++++++++++++------ 1 file changed, 108 insertions(+), 54 deletions(-) diff --git a/infrastructure-centred/owlps-listener/owlps-listener.h b/infrastructure-centred/owlps-listener/owlps-listener.h index f4d43a2..c96cab8 100644 --- a/infrastructure-centred/owlps-listener/owlps-listener.h +++ b/infrastructure-centred/owlps-listener/owlps-listener.h @@ -106,75 +106,129 @@ void print_version(void) ; */ /* libconfuse macros */ #ifdef USE_CONFIG_FILE -#define SET_MODE(MODE) (cfg_setint(cfg, "mode", (MODE))) -#define GET_MODE() (cfg_getint(cfg, "mode")) -#define SET_AGGREGATION_IP(IP) (cfg_setstr(cfg, "aggregation_ip", (IP))) -#define GET_AGGREGATION_IP() (cfg_getstr(cfg, "aggregation_ip")) +#define SET_MODE(MODE) \ + (cfg_setint(cfg, "mode", (MODE))) +#define GET_MODE() \ + (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 -#define SET_KEEP_MONITOR() (cfg_setbool(cfg, "keep_monitor", cfg_true)) -#define GET_KEEP_MONITOR() (cfg_getbool(cfg, "keep_monitor")) +#define SET_KEEP_MONITOR() \ + (cfg_setbool(cfg, "keep_monitor", cfg_true)) +#define GET_KEEP_MONITOR() \ + (cfg_getbool(cfg, "keep_monitor")) #endif // USE_PTHREAD -#define SET_AGGREGATION_PORT(PORT) (cfg_setint(cfg, "aggregation_port", (PORT))) -#define GET_AGGREGATION_PORT() (cfg_getint(cfg, "aggregation_port")) -#define SET_LISTENING_PORT(PORT) (cfg_setint(cfg, "listening_port", (PORT))) -#define GET_LISTENING_PORT() (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")) +#define SET_AGGREGATION_PORT(PORT) \ + (cfg_setint(cfg, "aggregation_port", (PORT))) +#define GET_AGGREGATION_PORT() \ + (cfg_getint(cfg, "aggregation_port")) +#define SET_LISTENING_PORT(PORT) \ + (cfg_setint(cfg, "listening_port", (PORT))) +#define GET_LISTENING_PORT() \ + (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 -#define SET_AUTOCALIBRATION() (cfg_setbool(cfg, "autocalibration", cfg_true)) -#define GET_AUTOCALIBRATION() (cfg_getbool(cfg, "autocalibration")) -#define SET_AUTOCALIBRATION_PORT(PORT) (cfg_setint(cfg, "autocalibration_port", (PORT))) -#define GET_AUTOCALIBRATION_PORT() (cfg_getint(cfg, "autocalibration_port")) -#define SET_AUTOCALIBRATION_HELLO_DELAY(DELAY) (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")) +#define SET_AUTOCALIBRATION() \ + (cfg_setbool(cfg, "autocalibration", cfg_true)) +#define GET_AUTOCALIBRATION() \ + (cfg_getbool(cfg, "autocalibration")) +#define SET_AUTOCALIBRATION_PORT(PORT) \ + (cfg_setint(cfg, "autocalibration_port", (PORT))) +#define GET_AUTOCALIBRATION_PORT() \ + (cfg_getint(cfg, "autocalibration_port")) +#define SET_AUTOCALIBRATION_HELLO_DELAY(DELAY) \ + (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 -#define SET_VERBOSE() (cfg_setbool(cfg, "verbose", cfg_true)) -#define UNSET_VERBOSE() (cfg_setbool(cfg, "verbose", cfg_false)) -#define GET_VERBOSE() (cfg_getbool(cfg, "verbose")) +#define SET_VERBOSE() \ + (cfg_setbool(cfg, "verbose", cfg_true)) +#define UNSET_VERBOSE() \ + (cfg_setbool(cfg, "verbose", cfg_false)) +#define GET_VERBOSE() \ + (cfg_getbool(cfg, "verbose")) /* Home-made structure macros */ #else // USE_CONFIG_FILE -#define SET_MODE(MODE) (options.mode = (MODE)) -#define GET_MODE() (options.mode) -#define SET_AGGREGATION_IP(IP) (strncpy(options.aggregation_ip, (IP), 16)) -#define GET_AGGREGATION_IP() (options.aggregation_ip) +#define SET_MODE(MODE) \ + (options.mode = (MODE)) +#define GET_MODE() \ + (options.mode) +#define SET_AGGREGATION_IP(IP) \ + (strncpy(options.aggregation_ip, (IP), 16)) +#define GET_AGGREGATION_IP() \ + (options.aggregation_ip) #ifdef USE_PTHREAD -#define SET_KEEP_MONITOR() (options.keep_monitor = TRUE) -#define GET_KEEP_MONITOR() (options.keep_monitor) +#define SET_KEEP_MONITOR() \ + (options.keep_monitor = TRUE) +#define GET_KEEP_MONITOR() \ + (options.keep_monitor) #endif // USE_PTHREAD -#define SET_AGGREGATION_PORT(PORT) (options.aggregation_port = (PORT)) -#define GET_AGGREGATION_PORT() (options.aggregation_port) -#define SET_LISTENING_PORT(PORT) (options.listening_port = (PORT)) -#define GET_LISTENING_PORT() (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) +#define SET_AGGREGATION_PORT(PORT) \ + (options.aggregation_port = (PORT)) +#define GET_AGGREGATION_PORT() \ + (options.aggregation_port) +#define SET_LISTENING_PORT(PORT) \ + (options.listening_port = (PORT)) +#define GET_LISTENING_PORT() \ + (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 -#define SET_AUTOCALIBRATION() (options.autocalibration = TRUE) -#define GET_AUTOCALIBRATION() (options.autocalibration) -#define SET_AUTOCALIBRATION_PORT(PORT) (options.autocalibration_port = (PORT)) -#define GET_AUTOCALIBRATION_PORT() (options.autocalibration_port) -#define SET_AUTOCALIBRATION_HELLO_DELAY(DELAY) (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) +#define SET_AUTOCALIBRATION() \ + (options.autocalibration = TRUE) +#define GET_AUTOCALIBRATION() \ + (options.autocalibration) +#define SET_AUTOCALIBRATION_PORT(PORT) \ + (options.autocalibration_port = (PORT)) +#define GET_AUTOCALIBRATION_PORT() \ + (options.autocalibration_port) +#define SET_AUTOCALIBRATION_HELLO_DELAY(DELAY) \ + (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 -#define SET_VERBOSE() (options.verbose = TRUE) -#define UNSET_VERBOSE() (options.verbose = FALSE) -#define GET_VERBOSE() (options.verbose) +#define SET_VERBOSE() \ + (options.verbose = TRUE) +#define UNSET_VERBOSE() \ + (options.verbose = FALSE) +#define GET_VERBOSE() \ + (options.verbose) #endif // USE_CONFIG_FILE