From 77c59b260d2961a7c2c5eac362e5678baeeec7c6 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sun, 4 Jan 2009 00:25:15 +0100 Subject: [PATCH] merge ibm-acpi and smapi together Well, not really. I don't dare putting it all together into a single source file, as that would just not make sense. Instead, this patch eliminates the --enable-smapi configure option and all related checks, replacing them with the equivalents from --enable-ibm. --- ChangeLog | 1 + configure.ac.in | 14 -------------- src/Makefile.am | 7 +------ src/conky.c | 16 ++++++++-------- src/conky.h | 7 ++----- src/text_object.h | 14 ++++++-------- 6 files changed, 18 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0776ca..290e4f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,7 @@ sohalt). 2009-01-04 + * Drop --enable-smapi and use --enable-ibm instead * Make ibm-acpi objects optional (--enable-ibm) 2008-12-20 diff --git a/configure.ac.in b/configure.ac.in index 84e460d..e0eee7d 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -303,19 +303,6 @@ if test x$want_rss = xyes; then fi dnl -dnl SMAPI -dnl - -AC_ARG_ENABLE([smapi], - AC_HELP_STRING([--enable-smapi], [enable if you want smapi support @<:@default=no@:>@]), - [want_smapi="$enableval"], [want_smapi=no]) - -AM_CONDITIONAL(BUILD_SMAPI, test x$want_smapi = xyes) -if test x$want_smapi = xyes; then - AC_DEFINE(SMAPI, 1, [Define if you want smapi support]) -fi - -dnl dnl Wireless extensions dnl @@ -741,7 +728,6 @@ $PACKAGE $VERSION configured successfully: portmon: $want_portmon RSS: $want_rss wireless: $want_wlan - SMAPI: $want_smapi IBM: $want_ibm nvidia: $want_nvidia eve-online: $want_eve diff --git a/src/Makefile.am b/src/Makefile.am index 058e473..93d3ec3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,7 +48,7 @@ bmpx = bmpx.c endif if BUILD_IBM -ibm = ibm.c ibm.h +ibm = ibm.c ibm.h smapi.c smapi.h endif if BUILD_MPD @@ -107,10 +107,6 @@ if BUILD_RSS rss = rss.c prss.c prss.h endif -if BUILD_SMAPI -smapi = smapi.c smapi.h -endif - if BUILD_NVIDIA nvidia = nvidia.c nvidia.h endif @@ -145,7 +141,6 @@ conky_SOURCES = \ mboxscan.h \ $(x11) \ $(xmms2) \ - $(smapi) \ $(ibm) \ temphelper.c \ temphelper.h \ diff --git a/src/conky.c b/src/conky.c index e617e48..cbcd073 100644 --- a/src/conky.c +++ b/src/conky.c @@ -205,9 +205,9 @@ static void print_version(void) #ifdef HAVE_IWLIB " * wireless\n" #endif /* HAVE_IWLIB */ -#ifdef SMAPI - " * smapi\n" -#endif /* SMAPI */ +#ifdef IBM + " * support for IBM/Lenovo notebooks\n" +#endif /* IBM */ #ifdef NVIDIA " * nvidia\n" #endif @@ -1506,7 +1506,7 @@ static void free_text_objects(struct text_object *root) info.users.times = 0; } break; -#ifdef SMAPI +#ifdef IBM case OBJ_smapi: case OBJ_smapi_bat_perc: case OBJ_smapi_bat_temp: @@ -3032,7 +3032,7 @@ static struct text_object *construct_text_object(const char *s, } else { obj->global_mode = 1; } -#ifdef SMAPI +#ifdef IBM END OBJ(smapi, 0) if (arg) obj->data.s = strndup(arg, text_buffer_size); @@ -3071,7 +3071,7 @@ static struct text_object *construct_text_object(const char *s, } } else ERR("smapi_bat_bar needs an argument"); -#endif /* SMAPI */ +#endif /* IBM */ #ifdef MPD #define mpd_set_maxlen(name) \ if (arg) { \ @@ -5642,7 +5642,7 @@ head: (double) cur->entropy.poolsize; new_bar(p, obj->a, obj->b, (int) (entropy_perc * 255.0f)); } -#ifdef SMAPI +#ifdef IBM OBJ(smapi) { char *s; if(obj->data.s) { @@ -5696,7 +5696,7 @@ head: else new_bar(p, obj->a, obj->b, 0); } -#endif /* SMAPI */ +#endif /* IBM */ OBJ(scroll) { unsigned int j; char *tmp, buf[max_user_text]; diff --git a/src/conky.h b/src/conky.h index 274e837..2010f8e 100644 --- a/src/conky.h +++ b/src/conky.h @@ -90,10 +90,6 @@ char *strndup(const char *s, size_t n); #include "rss.h" #endif -#ifdef SMAPI -#include "smapi.h" -#endif - #ifdef TCP_PORT_MONITOR #include "tcp-portmon.h" #endif @@ -104,6 +100,7 @@ char *strndup(const char *s, size_t n); #ifdef IBM #include "ibm.h" +#include "smapi.h" #endif /* A size for temporary, static buffers to use when @@ -177,7 +174,7 @@ enum { #ifdef RSS INFO_RSS = 24, #endif -#ifdef SMAPI +#ifdef IBM INFO_SMAPI = 25, #endif INFO_USERS = 26, diff --git a/src/text_object.h b/src/text_object.h index 8b61104..d87f597 100644 --- a/src/text_object.h +++ b/src/text_object.h @@ -137,6 +137,12 @@ enum text_object_type { OBJ_ibm_temps, OBJ_ibm_volume, OBJ_ibm_brightness, + OBJ_smapi, + OBJ_smapi_bat_bar, + OBJ_smapi_bat_perc, + OBJ_smapi_bat_temp, + OBJ_smapi_bat_power, + OBJ_if_smapi_bat_installed, #endif /* IBM */ OBJ_if_up, OBJ_if_gw, @@ -352,14 +358,6 @@ enum text_object_type { #ifdef HDDTEMP OBJ_hddtemp, #endif -#ifdef SMAPI - OBJ_smapi, - OBJ_smapi_bat_bar, - OBJ_smapi_bat_perc, - OBJ_smapi_bat_temp, - OBJ_smapi_bat_power, - OBJ_if_smapi_bat_installed, -#endif OBJ_scroll, OBJ_entropy_avail, OBJ_entropy_poolsize, -- 1.7.9.5