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

convert $endif to callbacks.print

This commit is contained in:
Phil Sutter 2009-11-28 23:02:58 +01:00
parent 718ed9d280
commit 37cbdcf89b
4 changed files with 12 additions and 3 deletions

View File

@ -804,9 +804,6 @@ void generate_text_internal(char *p, int p_max_size,
need_to_load_fonts = 1;
}
#endif /* X11 */
OBJ(endif) {
/* harmless object, just ignore */
}
OBJ(pid_chroot) {
char buf[max_user_text];

View File

@ -547,6 +547,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.iftest = &gen_false_iftest;
END OBJ(endif, 0)
obj_be_ifblock_endif(ifblock_opaque, obj);
obj->callbacks.print = &gen_print_nothing;
END OBJ(eval, 0)
obj->data.s = strndup(arg ? arg : "", text_buffer_size);
obj->callbacks.print = &print_evaluate;

View File

@ -43,6 +43,13 @@ int gen_false_iftest(struct text_object *obj)
return 0;
}
void gen_print_nothing(struct text_object *obj, char *p, int p_max_size)
{
(void)obj;
(void)p;
(void)p_max_size;
}
/* text_object_list
*
* this list is special. it looks like this:

View File

@ -497,6 +497,10 @@ void gen_free_opaque(struct text_object *);
* used for the else object */
int gen_false_iftest(struct text_object *);
/* generic nothing printer callback printing nothing
* used for the endif object */
void gen_print_nothing(struct text_object *, char *, int);
struct text_object {
struct text_object *next, *prev; /* doubly linked list of text objects */
struct text_object *sub; /* for objects parsing text into objects */