mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 11:05:18 +00:00
convert entropy_perc to callbacks.percentage
This commit is contained in:
parent
0631b2ab2e
commit
61c4efb305
@ -1375,7 +1375,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
|||||||
END OBJ(entropy_avail, &update_entropy)
|
END OBJ(entropy_avail, &update_entropy)
|
||||||
obj->callbacks.print = &print_entropy_avail;
|
obj->callbacks.print = &print_entropy_avail;
|
||||||
END OBJ(entropy_perc, &update_entropy)
|
END OBJ(entropy_perc, &update_entropy)
|
||||||
obj->callbacks.print = &print_entropy_perc;
|
obj->callbacks.percentage = &entropy_percentage;
|
||||||
END OBJ(entropy_poolsize, &update_entropy)
|
END OBJ(entropy_poolsize, &update_entropy)
|
||||||
obj->callbacks.print = &print_entropy_poolsize;
|
obj->callbacks.print = &print_entropy_poolsize;
|
||||||
END OBJ(entropy_bar, &update_entropy)
|
END OBJ(entropy_bar, &update_entropy)
|
||||||
|
@ -61,11 +61,10 @@ void print_entropy_avail(struct text_object *obj, char *p, int p_max_size)
|
|||||||
snprintf(p, p_max_size, "%u", entropy.avail);
|
snprintf(p, p_max_size, "%u", entropy.avail);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_entropy_perc(struct text_object *obj, char *p, int p_max_size)
|
uint8_t entropy_percentage(struct text_object *obj)
|
||||||
{
|
{
|
||||||
(void)obj;
|
(void)obj;
|
||||||
percent_print(p, p_max_size, entropy.avail *
|
return round_to_int((double)entropy.avail * 100.0 / (double)entropy.poolsize);
|
||||||
100 / entropy.poolsize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_entropy_poolsize(struct text_object *obj, char *p, int p_max_size)
|
void print_entropy_poolsize(struct text_object *obj, char *p, int p_max_size)
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
void update_entropy(void);
|
void update_entropy(void);
|
||||||
|
|
||||||
void print_entropy_avail(struct text_object *, char *, int);
|
void print_entropy_avail(struct text_object *, char *, int);
|
||||||
void print_entropy_perc(struct text_object *, char *, int);
|
uint8_t entropy_percentage(struct text_object *);
|
||||||
void print_entropy_poolsize(struct text_object *, char *, int);
|
void print_entropy_poolsize(struct text_object *, char *, int);
|
||||||
uint8_t entropy_barval(struct text_object *);
|
uint8_t entropy_barval(struct text_object *);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user