10 /* Print spark lines on outf for numval values in val. */
11 int print_spark(char *bf
, int size
, unsigned long *val
, int numval
)
13 static const char *ticks
[NUM_SPARKS
] = {
14 "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"
17 unsigned long min
= ULONG_MAX
, max
= 0, f
;
19 for (i
= 0; i
< numval
; i
++) {
25 f
= ((max
- min
) << SPARK_SHIFT
) / (NUM_SPARKS
- 1);
28 for (i
= 0; i
< numval
; i
++) {
29 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s",
30 ticks
[((val
[i
] - min
) << SPARK_SHIFT
) / f
]);