1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-26 04:17:33 +00:00

convert gw_* objects to callbacks.print

This commit is contained in:
Phil Sutter 2009-11-16 01:09:37 +01:00
parent faa47450ad
commit f3cafc6a7c
4 changed files with 10 additions and 10 deletions

View File

@ -907,12 +907,6 @@ void generate_text_internal(char *p, int p_max_size,
DO_JUMP;
}
}
OBJ(gw_iface) {
print_gateway_iface(p, p_max_size);
}
OBJ(gw_ip) {
print_gateway_ip(p, p_max_size);
}
OBJ(laptop_mode) {
snprintf(p, p_max_size, "%d", get_laptop_mode());
}

View File

@ -1009,7 +1009,9 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(user_terms, &update_users)
END OBJ(user_number, &update_users)
END OBJ(gw_iface, &update_gateway_info)
obj->callbacks.print = &print_gateway_iface;
END OBJ(gw_ip, &update_gateway_info)
obj->callbacks.print = &print_gateway_ip;
#endif /* !__linux__ */
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
|| defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))

View File

@ -315,13 +315,17 @@ int gateway_exists(void)
return !!gw_info.count;
}
void print_gateway_iface(char *p, int p_max_size)
void print_gateway_iface(struct text_object *obj, char *p, int p_max_size)
{
(void)obj;
snprintf(p, p_max_size, "%s", gw_info.iface);
}
void print_gateway_ip(char *p, int p_max_size)
void print_gateway_ip(struct text_object *obj, char *p, int p_max_size)
{
(void)obj;
snprintf(p, p_max_size, "%s", gw_info.ip);
}

View File

@ -13,8 +13,8 @@ int get_laptop_mode(void);
void update_gateway_info(void);
void free_gateway_info(void);
int gateway_exists(void);
void print_gateway_iface(char *, int);
void print_gateway_ip(char *, int);
void print_gateway_iface(struct text_object *, char *, int);
void print_gateway_ip(struct text_object *, char *, int);
enum { PB_BATT_STATUS, PB_BATT_PERCENT, PB_BATT_TIME };
void get_powerbook_batt_info(char *, size_t, int);