mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 11:05:18 +00:00
convert eval to callbacks.print
This commit is contained in:
parent
f5596a6505
commit
721cdbdd30
@ -601,3 +601,8 @@ void print_cached(struct text_object *obj, char *p, int p_max_size)
|
||||
(void)obj;
|
||||
human_readable(info.cached * 1024, p, p_max_size);
|
||||
}
|
||||
|
||||
void print_evaluate(struct text_object *obj, char *p, int p_max_size)
|
||||
{
|
||||
evaluate(obj->data.s, p, p_max_size);
|
||||
}
|
||||
|
@ -102,4 +102,6 @@ void print_threads(struct text_object *, char *, int);
|
||||
void print_buffers(struct text_object *, char *, int);
|
||||
void print_cached(struct text_object *, char *, int);
|
||||
|
||||
void print_evaluate(struct text_object *, char *, int);
|
||||
|
||||
#endif /* _COMMON_H */
|
||||
|
@ -889,9 +889,6 @@ void generate_text_internal(char *p, int p_max_size,
|
||||
cimlib_add_image(obj->data.s);
|
||||
}
|
||||
#endif /* IMLIB2 */
|
||||
OBJ(eval) {
|
||||
evaluate(obj->data.s, p, p_max_size);
|
||||
}
|
||||
OBJ(if_empty) {
|
||||
char buf[max_user_text];
|
||||
struct information *tmp_info =
|
||||
|
@ -536,6 +536,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
obj_be_ifblock_endif(ifblock_opaque, obj);
|
||||
END OBJ(eval, 0)
|
||||
obj->data.s = strndup(arg ? arg : "", text_buffer_size);
|
||||
obj->callbacks.print = &print_evaluate;
|
||||
obj->callbacks.free = &gen_free_opaque;
|
||||
#if defined(IMLIB2) && defined(X11)
|
||||
END OBJ(image, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user