1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

Removed ACPI battery code for OpenBSD

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@912 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Toni Spets 2007-08-10 21:06:30 +00:00
parent 0e5974ef90
commit fc7c9b5fae
2 changed files with 8 additions and 18 deletions

View File

@ -946,9 +946,11 @@ enum text_object_type {
OBJ_acpitemp,
OBJ_acpitempf,
OBJ_battery,
#ifndef __OpenBSD__
OBJ_battery_time,
OBJ_battery_percent,
OBJ_battery_bar,
#endif /* !__OpenBSD__ */
OBJ_buffers,
OBJ_cached,
OBJ_color,
@ -2053,12 +2055,14 @@ static void free_text_objects(unsigned int count, struct text_object *objs)
break;
#endif
case OBJ_pre_exec:
#ifndef __OpenBSD__
case OBJ_battery:
free(objs[i].data.s);
break;
case OBJ_battery_time:
free(objs[i].data.s);
break;
#endif /* !__OpenBSD__ */
case OBJ_execi:
free(objs[i].data.execi.cmd);
free(objs[i].data.execi.buffer);
@ -2244,6 +2248,7 @@ static struct text_object *construct_text_object(const char *s, const char *arg,
END OBJ(freq_dyn, 0);
END OBJ(freq_dyn_g, 0);
END OBJ(acpifan, 0);
#ifndef __OpenBSD__
END OBJ(battery, 0);
char bat[64];
if (arg)
@ -2274,6 +2279,7 @@ static struct text_object *construct_text_object(const char *s, const char *arg,
strcpy(bat, "BAT0");
}
obj->data.s = strdup(bat);
#endif /* !__OpenBSD__ */
#if defined(__linux__)
END OBJ(i8k_version, INFO_I8K)
END OBJ(i8k_bios, INFO_I8K)
@ -3614,6 +3620,7 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
OBJ(acpiacadapter) {
get_acpi_ac_adapter(p, p_max_size);
}
#ifndef __OpenBSD__
OBJ(battery) {
get_battery_stuff(p, p_max_size, obj->data.s, BATTERY_STATUS);
}
@ -3627,6 +3634,7 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
OBJ(battery_bar) {
new_bar(p, obj->a, obj->b, get_battery_perct_bar(obj->data.s));
}
#endif /* __OpenBSD__ */
OBJ(buffers) {
human_readable(cur->buffers * 1024, p, 255);
}

View File

@ -823,18 +823,6 @@ char
#endif
/* empty stubs so conky links */
int
get_battery_perct(const char *bat)
{
return (0);
}
int
get_battery_perct_bar(const char *bar)
{
return (0);
}
void
prepare_update()
{
@ -858,12 +846,6 @@ get_acpi_temperature(int fd)
return (0);
}
void
get_battery_stuff(char *buf, unsigned int n, const char *bat, int item)
{
return;
}
int
open_i2c_sensor(const char *dev, const char *type, int n, int *div,
char *devtype)