/* Use AppIndicator 0.2.9 */
#undef HAVE_APPINDICATOR_029
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
/* Use libatasmart */
#undef HAVE_ATASMART
*/
#undef HAVE_DCGETTEXT
-/* Define to 1 if you have the <getopt.h> header file. */
-#undef HAVE_GETOPT_H
-
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
/* Define to 1 if you have the <NVCtrl/NVCtrlLib.h> header file. */
#undef HAVE_NVCTRL_NVCTRLLIB_H
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
+/* Define to 1 if you have the <stdbool.h> header file. */
+#undef HAVE_STDBOOL_H
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
# Checks for header files.
AC_PATH_X
-AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h getopt.h])
+AC_CHECK_HEADERS([stdbool.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
top_srcdir = ..
-prefix = /tmp
+prefix = /usr/local
exec_prefix = ${prefix}
datarootdir = ${prefix}/share
datadir = ${datarootdir}
return c;
}
-static unsigned int is_alpha_channel_enabled()
+static bool is_alpha_channel_enabled()
{
return gconf_client_get_bool(client, KEY_ALPHA_CHANNEL_ENABLED, NULL);
}
free(key);
}
-int config_get_sensor_alarm_enabled(const char *sid)
+bool config_get_sensor_alarm_enabled(const char *sid)
{
gboolean b;
char *key;
return b;
}
-void config_set_sensor_alarm_enabled(const char *sid, int enabled)
+void config_set_sensor_alarm_enabled(const char *sid, bool enabled)
{
char *key;
free(key);
}
-int config_is_sensor_enabled(const char *sid)
+bool config_is_sensor_enabled(const char *sid)
{
gboolean b;
char *key;
return b;
}
-void config_set_sensor_enabled(const char *sid, int enabled)
+void config_set_sensor_enabled(const char *sid, bool enabled)
{
char *key;
free(key);
}
-unsigned int config_is_appindicator_enabled(const char *sid)
+bool config_is_appindicator_enabled(const char *sid)
{
char *key;
gboolean b;
return !b;
}
-void config_set_appindicator_enabled(const char *sid, unsigned int enabled)
+void config_set_appindicator_enabled(const char *sid, bool enabled)
{
char *key;
}
-static int is_window_decoration_enabled()
+static bool is_window_decoration_enabled()
{
return !gconf_client_get_bool(client,
KEY_INTERFACE_WINDOW_DECORATION_DISABLED,
NULL);
}
-static int is_window_keep_below_enabled()
+static bool is_window_keep_below_enabled()
{
return gconf_client_get_bool(client,
KEY_INTERFACE_WINDOW_KEEP_BELOW_ENABLED,
NULL);
}
-static void set_window_decoration_enabled(int enabled)
+static void set_window_decoration_enabled(bool enabled)
{
gconf_client_set_bool
(client,
KEY_INTERFACE_WINDOW_DECORATION_DISABLED, !enabled, NULL);
}
-static void set_window_keep_below_enabled(int enabled)
+static void set_window_keep_below_enabled(bool enabled)
{
gconf_client_set_bool(client,
KEY_INTERFACE_WINDOW_KEEP_BELOW_ENABLED,
#ifndef _PSENSOR_CONFIG_H_
#define _PSENSOR_CONFIG_H_
+#include "bool.h"
#include "color.h"
enum temperature_unit {
double graph_bg_alpha;
- int alpha_channel_enabled;
+ bool alpha_channel_enabled;
/*
* Position of the sensors list table
*/
enum sensorlist_position sensorlist_position;
- int window_decoration_enabled;
- int window_keep_below_enabled;
- int window_restore_enabled;
+ bool window_decoration_enabled;
+ bool window_keep_below_enabled;
+ bool window_restore_enabled;
/* Last saved position of the window. */
int window_x;
int window_y;
int sensor_values_max_length;
int sensor_update_interval;
- int menu_bar_disabled;
+ bool menu_bar_disabled;
- int unity_launcher_count_disabled;
+ bool unity_launcher_count_disabled;
int hide_on_startup;
int config_get_sensor_alarm_low_threshold(const char *);
void config_set_sensor_alarm_low_threshold(const char *, int);
-int config_get_sensor_alarm_enabled(const char *);
-void config_set_sensor_alarm_enabled(const char *, int);
+bool config_get_sensor_alarm_enabled(const char *);
+void config_set_sensor_alarm_enabled(const char *, bool);
-int config_is_sensor_enabled(const char *);
-void config_set_sensor_enabled(const char *, int);
+bool config_is_sensor_enabled(const char *);
+void config_set_sensor_enabled(const char *, bool);
char *config_get_sensor_name(const char *);
void config_set_sensor_name(const char *, const char *);
-unsigned int config_is_appindicator_enabled(const char *);
-void config_set_appindicator_enabled(const char *, unsigned int);
+bool config_is_appindicator_enabled(const char *);
+void config_set_appindicator_enabled(const char *, bool);
#endif
libpsensor_a_SOURCES = \
amd.h \
+ bool.h \
color.h color.c \
cpu.h \
hdd.h hdd_hddtemp.c\
nvidia.h \
psensor.h psensor.c\
pio.h pio.c \
- slog.c \
+ slog.c slog.h \
url.c url.h
AM_CPPFLAGS = -Wall -Werror
ARFLAGS = cru
libpsensor_a_AR = $(AR) $(ARFLAGS)
libpsensor_a_LIBADD =
-am__libpsensor_a_SOURCES_DIST = amd.h color.h color.c cpu.h hdd.h \
- hdd_hddtemp.c lmsensor.h lmsensor.c log.h log.c measure.h \
- measure.c nvidia.h psensor.h psensor.c pio.h pio.c slog.c \
- url.c url.h hdd_atasmart.c nvidia.c amd.c cpu.c psensor_json.h \
- psensor_json.c
+am__libpsensor_a_SOURCES_DIST = amd.h bool.h color.h color.c cpu.h \
+ hdd.h hdd_hddtemp.c lmsensor.h lmsensor.c log.h log.c \
+ measure.h measure.c nvidia.h psensor.h psensor.c pio.h pio.c \
+ slog.c slog.h url.c url.h hdd_atasmart.c nvidia.c amd.c cpu.c \
+ psensor_json.h psensor_json.c
@ATASMART_TRUE@am__objects_1 = hdd_atasmart.$(OBJEXT)
@NVIDIA_TRUE@am__objects_2 = nvidia.$(OBJEXT)
@LIBATIADL_TRUE@am__objects_3 = amd.$(OBJEXT)
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LIBRARIES = libpsensor.a
-libpsensor_a_SOURCES = amd.h color.h color.c cpu.h hdd.h hdd_hddtemp.c \
- lmsensor.h lmsensor.c log.h log.c measure.h measure.c nvidia.h \
- psensor.h psensor.c pio.h pio.c slog.c url.c url.h \
- $(am__append_1) $(am__append_4) $(am__append_7) \
- $(am__append_8) $(am__append_11)
+libpsensor_a_SOURCES = amd.h bool.h color.h color.c cpu.h hdd.h \
+ hdd_hddtemp.c lmsensor.h lmsensor.c log.h log.c measure.h \
+ measure.c nvidia.h psensor.h psensor.c pio.h pio.c slog.c \
+ slog.h url.c url.h $(am__append_1) $(am__append_4) \
+ $(am__append_7) $(am__append_8) $(am__append_11)
AM_CPPFLAGS = -Wall -Werror $(am__append_3) $(am__append_6) \
$(am__append_10) $(am__append_13)
EXTRA_DIST = $(libpsensor_a_SOURCES) \
--- /dev/null
+/*
+ * Copyright (C) 2010-2012 jeanfi@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+#ifndef _PSENSOR_BOOL_H_
+#define _PSENSOR_BOOL_H_
+
+#include "config.h"
+
+#if HAVE_STDBOOL
+#include <stdbool.h>
+#else
+#define bool char
+#endif
+
+#endif
#ifndef _PSENSOR_PSENSOR_H_
#define _PSENSOR_PSENSOR_H_
-#include "config.h"
#include <sensors/sensors.h>
+#include "config.h"
#ifdef HAVE_ATASMART
#include <atasmart.h>
#endif
+#include "bool.h"
#include "color.h"
#include "log.h"
#include "measure.h"
struct color *color;
/* Whether the graph sensor is displayed. */
- unsigned int enabled;
+ bool enabled;
/* see psensor_type */
unsigned int type;
double min;
/* Whether alarm alert is enabled for this sensor */
- unsigned int alarm_enabled;
+ bool alarm_enabled;
int alarm_high_threshold;
int alarm_low_threshold;
char *url;
- unsigned int appindicator_enabled;
+ bool appindicator_enabled;
};
struct psensor *psensor_create(char *id,