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

convert sysname to callbacks.print

This commit is contained in:
Phil Sutter 2009-11-26 00:29:50 +01:00
parent e9dde6293b
commit cce12efda7
4 changed files with 8 additions and 3 deletions

View File

@ -547,3 +547,9 @@ void print_nodename(struct text_object *obj, char *p, int p_max_size)
(void)obj; (void)obj;
snprintf(p, p_max_size, "%s", info.uname_s.nodename); snprintf(p, p_max_size, "%s", info.uname_s.nodename);
} }
void print_sysname(struct text_object *obj, char *p, int p_max_size)
{
(void)obj;
snprintf(p, p_max_size, "%s", info.uname_s.sysname);
}

View File

@ -89,5 +89,6 @@ uint8_t swap_barval(struct text_object *);
void print_kernel(struct text_object *, char *, int); void print_kernel(struct text_object *, char *, int);
void print_machine(struct text_object *, char *, int); void print_machine(struct text_object *, char *, int);
void print_nodename(struct text_object *, char *, int); void print_nodename(struct text_object *, char *, int);
void print_sysname(struct text_object *, char *, int);
#endif /* _COMMON_H */ #endif /* _COMMON_H */

View File

@ -1251,9 +1251,6 @@ void generate_text_internal(char *p, int p_max_size,
OBJ(text) { OBJ(text) {
snprintf(p, p_max_size, "%s", obj->data.s); snprintf(p, p_max_size, "%s", obj->data.s);
} }
OBJ(sysname) {
snprintf(p, p_max_size, "%s", cur->uname_s.sysname);
}
OBJ(gid_name) { OBJ(gid_name) {
char buf[max_user_text]; char buf[max_user_text];

View File

@ -994,6 +994,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.barval = &swap_barval; obj->callbacks.barval = &swap_barval;
/* XXX: swapgraph, swapgauge? */ /* XXX: swapgraph, swapgauge? */
END OBJ(sysname, 0) END OBJ(sysname, 0)
obj->callbacks.print = &print_sysname;
END OBJ(time, 0) END OBJ(time, 0)
scan_time(obj, arg); scan_time(obj, arg);
obj->callbacks.print = &print_time; obj->callbacks.print = &print_time;