1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-28 13:00:45 +00:00

convert eval to callbacks.print

This commit is contained in:
Phil Sutter 2009-11-26 01:15:33 +01:00
parent f5596a6505
commit 721cdbdd30
4 changed files with 8 additions and 3 deletions

View File

@ -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);
}

View File

@ -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 */

View File

@ -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 =

View File

@ -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)