#include <sys/types.h>
#include <sys/stat.h>
-#define LOCAL_DEBUG 0
-
struct cpufreq_info
{
struct list_head list;
if (num_cpus <= 0)
return;
-#if LOCAL_DEBUG
- printf("%s(%d, %s) - Creating HUD object\n", __func__, cpu_index,
- mode == CPUFREQ_MINIMUM ? "MIN" :
- mode == CPUFREQ_CURRENT ? "CUR" :
- mode == CPUFREQ_MAXIMUM ? "MAX" : "UNDEFINED");
-#endif
-
cfi = find_cfi_by_index(cpu_index, mode);
if (!cfi)
return;
#include <sys/stat.h>
#include <unistd.h>
-#define LOCAL_DEBUG 0
-
struct stat_s
{
/* Read */
if (num_devs <= 0)
return;
-#if LOCAL_DEBUG
- printf("%s(%s, %s) - Creating HUD object\n", __func__, dev_name,
- mode == DISKSTAT_RD ? "RD" :
- mode == DISKSTAT_WR ? "WR" : "UNDEFINED");
-#endif
-
dsi = find_dsi_by_name(dev_name, mode);
if (!dsi)
return;
#include <sys/ioctl.h>
#include <linux/wireless.h>
-#define LOCAL_DEBUG 0
-
struct nic_info
{
struct list_head list;
*leveldBm = ((char) stats.qual.level * -1);
close(sockfd);
-
-#if LOCAL_DEBUG
- printf("NIC signal level%s is %d%s.\n",
- (stats.qual.updated & IW_QUAL_DBM ? " (in dBm)" : ""),
- (char) stats.qual.level,
- (stats.qual.updated & IW_QUAL_LEVEL_UPDATED ? " (updated)" : ""));
-#endif
}
static void
if (num_nics <= 0)
return;
-#if LOCAL_DEBUG
- printf("%s(%s, %s) - Creating HUD object\n", __func__, nic_name,
- mode == NIC_DIRECTION_RX ? "RX" :
- mode == NIC_DIRECTION_TX ? "TX" :
- mode == NIC_RSSI_DBM ? "RSSI" : "UNDEFINED");
-#endif
-
nic = find_nic_by_name(nic_name, mode);
if (!nic)
return;
#include <unistd.h>
#include <sensors/sensors.h>
-#define LOCAL_DEBUG 0
-
/* TODO: We don't handle dynamic sensor discovery / arrival or removal.
* Static globals specific to this HUD category.
*/
SENSORS_SUBFEATURE_TEMP_MAX);
if (sf)
sti->max = get_value(sti->chip, sf);
-#if LOCAL_DEBUG
- printf("%s.%s.current = %.1f\n", sti->chipname, sti->featurename,
- sti->current);
- printf("%s.%s.critical = %.1f\n", sti->chipname, sti->featurename,
- sti->critical);
-#endif
}
static struct sensors_temp_info *
int num_devs = hud_get_num_sensors(0);
if (num_devs <= 0)
return;
-#if LOCAL_DEBUG
- printf("%s(%s, %s) - Creating HUD object\n", __func__, dev_name,
- mode == SENSORS_VOLTAGE_CURRENT ? "VOLTS" :
- mode == SENSORS_CURRENT_CURRENT ? "AMPS" :
- mode == SENSORS_TEMP_CURRENT ? "CU" :
- mode == SENSORS_POWER_CURRENT ? "POWER" :
- mode == SENSORS_TEMP_CRITICAL ? "CR" : "UNDEFINED");
-#endif
sti = find_sti_by_name(dev_name, mode);
if (!sti)
const sensors_chip_name *chip, const sensors_feature *feature,
int mode)
{
-#if LOCAL_DEBUG
- printf("%03d: %s.%s\n", gsensors_temp_count, chipname, featurename);
-#endif
struct sensors_temp_info *sti = CALLOC_STRUCT(sensors_temp_info);
sti->mode = mode;