[Pkg-wmaker-commits] [fookb] 07/17: fookb: Make WUtil required instead of optional.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Sun Sep 10 14:35:25 UTC 2017
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository fookb.
commit c1cf2c0217d6ad6edfc44cf9f5aff760d98f895b
Author: Doug Torrance <dtorrance at piedmont.edu>
Date: Sat Sep 9 21:24:23 2017 -0400
fookb: Make WUtil required instead of optional.
---
Makefile.am | 2 +-
opts.c | 4 ----
params.c | 51 ---------------------------------------------------
params.h | 5 +----
4 files changed, 2 insertions(+), 60 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index fcddd6a..0f0a075 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ dist_man_MANS = fookb.1x
dist_pkgdata_DATA = 1.xpm 2.xpm 3.xpm 4.xpm rus.xpm lat.xpm boom.xpm \
En.xpm Ru.xpm beep_spring.au
-AM_CFLAGS = $(Xlib_CFLAGS) $(libXpm_CFLAGS) $(WUtil_CFLAGS) -DHAVE_WINGS_WUTIL_H
+AM_CFLAGS = $(Xlib_CFLAGS) $(libXpm_CFLAGS) $(WUtil_CFLAGS)
LIBS += $(Xlib_LIBS) $(libXpm_LIBS) $(WUtil_LIBS)
EXTRA_DIST = copyright fookb.cf KNOWN_BUGS LICENSE README.russian.koi8-r \
diff --git a/opts.c b/opts.c
index ec675e9..2143518 100644
--- a/opts.c
+++ b/opts.c
@@ -61,7 +61,6 @@ void ParseOptions(int *argc, register char *argv[])
puts("-iconboom xpm_file\tIcon to show when Xkb system goes crazy");
puts("-display X_display\tX display to use (normally not needed)");
puts("");
-#ifdef HAVE_WINGS_WUTIL_H
puts("Command line parameters takes precedence over X resources or configuration file!");
printf("Configuration file location: ");
#ifdef WMAKER
@@ -69,9 +68,6 @@ void ParseOptions(int *argc, register char *argv[])
#else
puts("~/.fookb");
#endif
-#else
- puts("Command line paramaters takes precedence over X resources!");
-#endif
exit(0);
}
diff --git a/params.c b/params.c
index 9ce38ed..b974246 100644
--- a/params.c
+++ b/params.c
@@ -12,41 +12,19 @@ char *read_param(char *string)
{
XrmValue xvalue;
-#ifdef HAVE_WINGS_WUTIL_H
WMPropList *pl;
WMPropList *value;
WMPropList *tmp;
char *path;
-#endif
-
char *newstring;
char *newString;
char *result;
- char *str_type[20];
/* Let's make lint happy */
xvalue.size = 0;
-#ifndef HAVE_WINGS_WUTIL_H
- newstring = (char *) malloc(7 + strlen(string));
- newString = (char *) malloc(7 + strlen(string));
- /* 7 is strlen("fookb.") + 1 */
-
- if ((NULL == newstring) || (NULL == newString)) {
- lputs("Not enough memory");
- exit(EXIT_FAILURE);
- }
-
- strcpy(newstring, "fookb.");
- strcpy(newString, "Fookb.");
-
- strcat(newstring, string);
- strcat(newString, string);
-#else
- /* libWUtil contains handy function */
newstring = wstrconcat("fookb.", string);
newString = wstrconcat("Fookb.", string);
-#endif
newstring[6] = tolower((unsigned char)newstring[6]);
newString[6] = toupper((unsigned char)newString[6]);
@@ -65,18 +43,11 @@ char *read_param(char *string)
strncpy(result, xvalue.addr, (size_t)xvalue.size);
result[(int) xvalue.size + 1] = '\0';
-#ifdef HAVE_WINGS_WUTIL_H
wfree(newstring);
wfree(newString);
-#else
- free(newstring);
- free(newString);
-#endif
return result;
}
-#ifdef HAVE_WINGS_WUTIL_H
-
wfree(newstring);
wfree(newString);
@@ -130,26 +101,4 @@ char *read_param(char *string)
return result;
-#else /* HAVE_WINGS_WUTIL_H */
-
- if (XrmGetResource(finalDB, newstring, newString, str_type,
- &xvalue) == True) {
- result = (char *) malloc(xvalue.size + 1);
- if (NULL == result) {
- lputs("Not enough memory");
- exit(EXIT_FAILURE);
- }
- strncpy(result, xvalue.addr, (size_t)xvalue.size);
- result[(int) xvalue.size + 1] = '\0';
- free(newstring);
- free(newString);
- return result;
- } else {
- (void)printf("Fatal error: cannot find configuration parameter %s\n",
- newstring);
- exit(EXIT_FAILURE);
- }
-
-#endif
-
}
diff --git a/params.h b/params.h
index b261f5f..5fdc73e 100644
--- a/params.h
+++ b/params.h
@@ -8,8 +8,7 @@
#ifndef PARAMS_H
#define PARAMS_H
-#ifdef HAVE_WINGS_WUTIL_H
-#include <WINGs/WUtil.h>
+#include <WINGs/WUtil.h>
#ifdef WMAKER
#define DEFAULTS_FILE "~/GNUstep/Defaults/FOOkb"
@@ -17,8 +16,6 @@
#define DEFAULTS_FILE "~/.fookb"
#endif /* WMAKER */
-#endif /* HAVE_WINGS_WUTIL_H */
-
#include <X11/Xlib.h> /* X Window standard header */
#include <X11/Xresource.h> /* X resource manager stuff */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/fookb.git
More information about the Pkg-wmaker-commits
mailing list