[Pkg-wmaker-commits] [wmix] 19/44: wmix: moved the initialisation of the config to the related file
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Sep 29 10:40:13 UTC 2017
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository wmix.
commit 66d8ee9a7ae79d43872359bbd153886e2e44192d
Author: Christophe CURIS <christophe.curis at free.fr>
Date: Sat Jun 7 21:21:47 2014 +0200
wmix: moved the initialisation of the config to the related file
Signed-off-by: Christophe CURIS <christophe.curis at free.fr>
---
config.c | 25 +++++++++++++++++++++++++
include/common.h | 2 --
include/config.h | 3 +++
wmix.c | 20 +-------------------
4 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/config.c b/config.c
index 8a0419c..9252657 100644
--- a/config.c
+++ b/config.c
@@ -46,6 +46,31 @@ struct _Config config;
/*
+ * Sets the default values in configuration
+ */
+void config_init(void)
+{
+ char *home;
+
+ memset(&config, 0, sizeof(config));
+
+ /* we can theoretically live without a config file */
+ home = getenv("HOME");
+ if (home) {
+ config.file = calloc(1, strlen(home) + 9);
+ sprintf(config.file, "%s/.wmixrc", home);
+ }
+
+ config.mousewheel = 1;
+ config.scrolltext = 1;
+ config.wheel_button_up = 4;
+ config.wheel_button_down = 5;
+ config.scrollstep = 0.03;
+ config.osd = 1;
+ config.osd_color = strdup("green");
+}
+
+/*
* Parse Command-Line options
*
* Supposed to be called before reading config file, as there's an
diff --git a/include/common.h b/include/common.h
index 4fdc857..8d9b303 100644
--- a/include/common.h
+++ b/include/common.h
@@ -33,5 +33,3 @@ typedef unsigned int bool;
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
#define MAX_DOUBLE_CLICK_TIME 0.5
-#define BUTTON_WHEEL_UP 4
-#define BUTTON_WHEEL_DOWN 5
diff --git a/include/config.h b/include/config.h
index 71a79d4..72e4cc4 100644
--- a/include/config.h
+++ b/include/config.h
@@ -47,6 +47,9 @@ extern struct _Config {
/* Current version of WMixer */
#define VERSION "3.0"
+/* Sets the default values in the config */
+void config_init(void);
+
/* Sets configuration from command line */
void parse_cli_options(int argc, char **argv);
diff --git a/wmix.c b/wmix.c
index 94b3422..e8cb6c6 100644
--- a/wmix.c
+++ b/wmix.c
@@ -61,26 +61,8 @@ static void motion_event(XMotionEvent *event);
int main(int argc, char **argv)
{
XEvent event;
- char *home;
-
- memset(&config, 0, sizeof(config));
-
- /* we can theoretically live without a config file */
- home = getenv("HOME");
- if (home) {
- config.file = calloc(1, strlen(home) + 9);
- sprintf(config.file, "%s/.wmixrc", home);
- }
-
- /* default values */
- config.mousewheel = 1;
- config.scrolltext = 1;
- config.wheel_button_up = 4;
- config.wheel_button_down = 5;
- config.scrollstep = 0.03;
- config.osd = 1;
- config.osd_color = strdup("green");
+ config_init();
parse_cli_options(argc, argv);
config_read();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmix.git
More information about the Pkg-wmaker-commits
mailing list