summaryrefslogtreecommitdiff
path: root/components/netspeeds.c
AgeCommit message (Collapse)Author
2022-10-28radical re-formatting 2/3: Fix blocksdrkhsh
Fixes coding style. Formatting commits suck, incoherent coding style sucks more. https://suckless.org/coding_style/
2022-10-28radical re-formatting 3/3: Error checksdrkhsh
Check for `< 0` instead of `== -1`. Fixes coding style. Formatting commits suck, incoherent coding style sucks more. https://suckless.org/coding_style/
2022-10-28various: Put paths into defines to avoid line wrapsdrkhsh
Long, wrapped, multi-line if statements suck to read. This fixes readability in the worst places by packing format strings for paths into defines.
2022-10-28radical re-formatting 0/3: Alphabetic headersdrkhsh
Except stated otherwise in comment. Fixes coding style. Formatting commits suck, incoherent coding style sucks more. https://suckless.org/coding_style/
2022-10-27components/*.c: include slstatus.hNRK
this gives the compiler a chance to check weather the prototype and definiton matches or not, which would catch issues like 3c47701.
2019-02-07Add FreeBSD support for netspeeds, entropy and ip componentsMichael Buch
2018-07-07Simplify format specifiers for uintmax_tAaron Marcher
2018-07-07Change uint64_t to uintmax_tAaron Marcher
2018-05-22netspeeds: Fix indentationAaron Marcher
2018-05-22Change to fmt_human in netspeeds on OpenBSDAaron Marcher
Thanks to Hiltjo
2018-05-21Merge fmt_human_2 and fmt_human_10 to one functionAaron Marcher
Now only one function, fmt_human, takes an additional argument "base".
2018-05-21Remove units from numbersAaron Marcher
This is a first step to decouple formatting from information because of two reasons: 1. The components should only gather and return the values by design 2. Fine grained user control should be a focus Scaling will be implemented in a different way in a later commit.
2018-05-20Remove initialization to 0 for static varsAaron Marcher
2018-05-19Implement fmt_human_2() and fmt_human_10()Laslo Hunhold
These functions take the raw number and a unit and automatically print it out "scaled down" to a proper SI-prefix, for powers of 2 and 10 respectively. Apply them to the 2-power cases and keep the 10-power for a later commit.
2018-05-19Increase precision in netspeeds.cLaslo Hunhold
First dividing by interval before multiplying with 1000 decreases the precision by +-(interval - 1) * 1000, as interval arithmetic always applies the Gauß-function to the result. This is not necessary and simply reordering the operations mitigates this.
2018-05-19Implement esnprintf() and make formatted calls more efficientLaslo Hunhold
Within the components, snprintf() was unchecked and had inefficient calls in some places. We implement esnprintf() that does all the dirty laundry for us and use it exclusively now.
2018-05-19Use `int` for flagsAaron Marcher
2018-05-19Set {r,t}xbytes 0 before incrementing them on OBSDAaron Marcher
2018-05-19Missing assignment for last commitAaron Marcher
2018-05-19Unify and simplify netspeed logic and typesAaron Marcher
2018-05-19netspeeds: added error condition for openbsdTobias Tschinkowitz
implemented additional error condition for openbsd netstat in case the interface could not be found in the interface list or if_data is not readable.
2018-05-19implemented openbsd netspeed functionsTobias Tschinkowitz
implemented the netspeed functionality for openbsd. furthermore the static keyword was removed of the interval variable in config.def.h for usage as extern variable.
2018-05-19Add network speed functionsAaron Marcher