void update_running_processes(void);
void update_stuff(void);
char get_freq(char *, size_t, const char *, int, unsigned int);
-char get_voltage(char *, size_t, const char *, int, unsigned int); /* ptarjan */
+void print_voltage_mv(struct text_object *, char *, int);
+void print_voltage_v(struct text_object *, char *, int);
void update_load_average(void);
void update_top(void);
void free_all_processes(void);
}
#if defined(__linux__)
OBJ(voltage_mv) {
- static int ok = 1;
- if (ok) {
- ok = get_voltage(p, p_max_size, "%.0f", 1,
- obj->data.i);
- }
+ print_voltage_mv(obj, p, p_max_size);
}
OBJ(voltage_v) {
- static int ok = 1;
- if (ok) {
- ok = get_voltage(p, p_max_size, "%'.3f", 1000,
- obj->data.i);
- }
+ print_voltage_v(obj, p, p_max_size);
}
#ifdef HAVE_IWLIB
* Peter Tarjan (ptarjan@citromail.hu) */
/* return cpu voltage in mV (use divisor=1) or V (use divisor=1000) */
-char get_voltage(char *p_client_buffer, size_t client_buffer_size,
+static char get_voltage(char *p_client_buffer, size_t client_buffer_size,
const char *p_format, int divisor, unsigned int cpu)
{
FILE *f;
return 1;
}
+void print_voltage_mv(struct text_object *obj, char *p, int p_max_size)
+{
+ static int ok = 1;
+ if (ok) {
+ ok = get_voltage(p, p_max_size, "%.0f", 1, obj->data.i);
+ }
+}
+
+void print_voltage_v(struct text_object *obj, char *p, int p_max_size)
+{
+ static int ok = 1;
+ if (ok) {
+ ok = get_voltage(p, p_max_size, "%'.3f", 1000, obj->data.i);
+ }
+}
+
#define ACPI_FAN_DIR "/proc/acpi/fan/"
void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size)