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

convert $include to callbacks.print

This commit is contained in:
Phil Sutter 2009-11-29 12:59:04 +01:00
parent 3ed82a34dd
commit d48c2f143c
4 changed files with 13 additions and 10 deletions

View File

@ -781,3 +781,14 @@ void print_blink(struct text_object *obj, char *p, int p_max_size)
snprintf(p, p_max_size, "%s", buf);
visible = !visible;
}
void print_include(struct text_object *obj, char *p, int p_max_size)
{
char buf[max_user_text];
if (!obj->sub)
return;
generate_text_internal(buf, max_user_text, *obj->sub, &info);
snprintf(p, p_max_size, "%s", buf);
}

View File

@ -127,5 +127,6 @@ void print_battery_short(struct text_object *, char *, int);
void print_to_bytes(struct text_object *, char *, int);
void print_blink(struct text_object *, char *, int);
void print_include(struct text_object *, char *, int);
#endif /* _COMMON_H */

View File

@ -1143,16 +1143,6 @@ void generate_text_internal(char *p, int p_max_size,
}
#endif /* HAVE_ICONV */
OBJ(include) {
if(obj->sub) {
char buf[max_user_text];
generate_text_internal(buf, max_user_text, *obj->sub, cur);
snprintf(p, p_max_size, "%s", buf);
} else {
p[0] = 0;
}
}
break;
}
#undef DO_JUMP

View File

@ -1449,6 +1449,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
currentconffile = leaf;
extract_variable_text_internal(obj->sub, get_global_text());
currentconffile = leaf->back;
obj->callbacks.print = &print_include;
} else {
NORM_ERR("Can't load configfile '%s'.", arg);
}