From 8e947db6be8e79607ecddaa9bafbd7f29940a187 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 9 Sep 2015 16:28:25 +1200 Subject: Changed header include policy to increase build time --- Makefile | 2 ++ bat_tray.c | 9 ++++++++- common.c | 5 ++++- config_file.c | 5 ++++- config_file.h | 3 +++ defaults.c | 5 ++++- defaults.h | 2 ++ getcore.c | 6 +++++- getfreq.c | 9 ++++++++- getfreq.h | 2 ++ getgov.c | 8 +++++++- getgov.h | 2 ++ paramano.c | 17 +++++++++++++++++ paramano.h | 21 --------------------- paramano_set.c | 8 ++++++-- paramano_set_interface.c | 7 ++++++- tray.c | 15 +++++++++++++-- tray.h | 2 ++ 18 files changed, 95 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 822f319..0dc7028 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ BINDIR=$(PREFIX)/bin SYSCONFDIR=/etc SHAREDIR=$(PREFIX)/share LOCALEDIR=$(SHAREDIR)/locale +POWER_DIR="/sys/class/power_supply/" # External program/support programs SUDO=$(BINDIR)/sudo @@ -22,6 +23,7 @@ DEFS += -DPREFIX=\"$(PREFIX)\" \ -DPARAMANO_CONF=\"$(PARAMANO_CONF)\" \ -DLOCALEDIR=\"$(LOCALEDIR)\" \ -DSHAREDIR=\"$(SHAREDIR)\" \ + -DPOWERDIR=\"$(POWER_DIR)\" \ -DROOT_UID=$(ROOT_UID) \ -D_GNU_SOURCE diff --git a/bat_tray.c b/bat_tray.c index 81435c2..f7c4a4c 100644 --- a/bat_tray.c +++ b/bat_tray.c @@ -17,7 +17,14 @@ ************************************************************************/ -#include "paramano.h" +#include "bat_tray.h" +#include "common.h" +#include "defaults.h" + +#include +#include +#include +#include static GtkStatusIcon* tray; static char tooltip_text[1024]; diff --git a/common.c b/common.c index 953a33b..9cca098 100644 --- a/common.c +++ b/common.c @@ -16,8 +16,11 @@ * . * ************************************************************************/ -#include "paramano.h" +#include "common.h" +#include +#include +#include #include /*********************************************************************** diff --git a/config_file.c b/config_file.c index 2faeaa3..17e3005 100644 --- a/config_file.c +++ b/config_file.c @@ -16,7 +16,10 @@ * . * ************************************************************************/ -#include "paramano.h" +#include "config_file.h" + +#include +#include gboolean config_open(struct config_file* config_file) { diff --git a/config_file.h b/config_file.h index 61ef74b..c9d964a 100644 --- a/config_file.h +++ b/config_file.h @@ -19,6 +19,9 @@ #ifndef CONFIG_FILE_H #define CONFIG_FILE_H +#include +#include + struct config_file { GKeyFile* key_file; diff --git a/defaults.c b/defaults.c index d9ff21d..9119622 100644 --- a/defaults.c +++ b/defaults.c @@ -16,7 +16,10 @@ * . * ************************************************************************/ -#include "paramano.h" +#include "defaults.h" + +#include +#include void defaults_init() { diff --git a/defaults.h b/defaults.h index 519c082..2a4515b 100644 --- a/defaults.h +++ b/defaults.h @@ -19,6 +19,8 @@ #ifndef DEFAULTS_H #define DEFAULTS_H +#include + char* DEFAULT_GOV; char* DEFAULT_FREQ; char* DEFAULT_PROG; diff --git a/getcore.c b/getcore.c index 2c25c75..2b2637b 100644 --- a/getcore.c +++ b/getcore.c @@ -16,7 +16,11 @@ * . * ************************************************************************/ -#include "paramano.h" +#include "getcore.h" + +#include +#include +#include static unsigned int cores; diff --git a/getfreq.c b/getfreq.c index 3ff6245..4ded3be 100644 --- a/getfreq.c +++ b/getfreq.c @@ -16,7 +16,14 @@ * . * ************************************************************************/ -#include "paramano.h" +#include "getfreq.h" +#include "getcore.h" +#include "common.h" + +#include +#include +#include +#include #define MAX_CORES 1000 #define MAX_FREQS 50 diff --git a/getfreq.h b/getfreq.h index 5ec9d35..f13a9e9 100644 --- a/getfreq.h +++ b/getfreq.h @@ -19,6 +19,8 @@ #ifndef GETFREQ_H #define GETFREQ_H +#include + void gf_init(); int gf_current(int core); int gf_available(int core, char* out, int size); diff --git a/getgov.c b/getgov.c index f75e6c9..e366f41 100644 --- a/getgov.c +++ b/getgov.c @@ -16,7 +16,13 @@ * . * ************************************************************************/ -#include "paramano.h" +#include "getgov.h" +#include "getcore.h" +#include "common.h" + +#include +#include +#include /* [CORE][GOVERNOR NUMBER] */ static char governors[999][50][13]; diff --git a/getgov.h b/getgov.h index 9339d20..5a5d8d8 100644 --- a/getgov.h +++ b/getgov.h @@ -19,6 +19,8 @@ #ifndef GETGOV_H #define GETGOV_H +#include + void gg_init(); bool gg_current(int core, char* out, int size); bool gg_available(int core, char* out, int size); diff --git a/paramano.c b/paramano.c index b3f75d2..fe8bdac 100644 --- a/paramano.c +++ b/paramano.c @@ -17,6 +17,23 @@ ************************************************************************/ #include "paramano.h" +#include "getcore.h" +#include "getgov.h" +#include "getfreq.h" +#include "tray.h" +#include "bat_tray.h" +#include "defaults.h" +#include "config_file.h" +#include "common.h" + +#include +#include // getuid, getgid +#include // printf, FILE, fopen, etc +#include // free etc +#include // boolean types +#include // strlen +#include // gettext +#include // LC_ALL etc /*********************************************************************** diff --git a/paramano.h b/paramano.h index 9686a2e..5227aa0 100644 --- a/paramano.h +++ b/paramano.h @@ -19,27 +19,6 @@ #ifndef PARAMANO_H #define PARAMANO_H -#define POWERDIR "/sys/class/power_supply/" - -#include -#include // getuid, getgid -#include // printf, FILE, fopen, etc -#include // free etc -#include // boolean types -#include // strlen -#include // gettext -#include // LC_ALL etc - -#include "tray.h" -#include "bat_tray.h" -#include "getfreq.h" -#include "getcore.h" -#include "getgov.h" -#include "config_file.h" -#include "defaults.h" -#include "common.h" -#include "paramano_set_interface.h" - void config_init(); #endif /* ifndef PARAMANO_H */ diff --git a/paramano_set.c b/paramano_set.c index b902a84..e94f9ec 100644 --- a/paramano_set.c +++ b/paramano_set.c @@ -16,8 +16,12 @@ * . * ************************************************************************/ - -#include "paramano.h" +#include +#include +#include +#include +#include +#include #define set_freq_max(freq, core) write_str_to_file("scaling_max_freq", freq, core) #define set_freq_min(freq, core) write_str_to_file("scaling_min_freq", freq, core) diff --git a/paramano_set_interface.c b/paramano_set_interface.c index 2806253..9ac3cb4 100644 --- a/paramano_set_interface.c +++ b/paramano_set_interface.c @@ -16,7 +16,12 @@ * . * ************************************************************************/ -#include "paramano.h" +#include "paramano_set_interface.h" +#include "common.h" + +#include +#include +#include void si_gov(char* gov, int core) { diff --git a/tray.c b/tray.c index dafda1f..d4eed31 100644 --- a/tray.c +++ b/tray.c @@ -16,8 +16,19 @@ * . * ************************************************************************/ -#include "paramano.h" - +#include "tray.h" +#include "getcore.h" +#include "getfreq.h" +#include "getgov.h" +#include "bat_tray.h" +#include "defaults.h" +#include "paramano_set_interface.h" + +#include +#include +#include +#include +#include static GtkStatusIcon* tray; static char tooltip_text[1024]; diff --git a/tray.h b/tray.h index 8560017..3c519a6 100644 --- a/tray.h +++ b/tray.h @@ -19,6 +19,8 @@ #ifndef TRAY_H #define TRAY_H +#include + void tray_set_defaults(); void tray_init(); void tray_show(); -- cgit v1.1