13 Commits (a18439af114b98ab026921b0cac61164f7a4eea8)

Author SHA1 Message Date
Aaron Marcher ec5c35ec9f Remove units from numbers
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.
8 years ago
Aaron Marcher 74c4f4ebda Add the percent sign to *_perc functions
Units should be added to the corresponding numbers
8 years ago
Laslo Hunhold 80fc20d1d6 Add warn() and die()
Given slstatus is a tool that runs in the background, most likely run
from .xinitrc, it's important to prepend the name of the tool to error
messages so it becomes clear where the error is coming from.

To make this much more consistent, this commit adds warn() and die()
utility functions consistent with other suckless projects and adapts all
calls to fprintf(stderr, *) to the warn() and die() functions, greatly
increasing the readability of the code.
8 years ago
Aaron Marcher 7be675f154 Unify type of `i` in for loops
int for normal indexes
size_t for usage with the LEN macro
8 years ago
Aaron Marcher 16a97fbca1 Unify header includes
- Sort Alphabetically
- Same indentation for preprocessor clauses
8 years ago
Aaron Marcher ee5ec75621 Fix coding style
- Use block for single statement ifs
- Keep lines to reasonable length (current debate as to reasonable)
- When functions return -1 for error test against 0 not -1
- Do not indent cases another level
- Do not test against NULL and 0 explicitly
- Use tabs for indentation, use spaces for alignment
8 years ago
parazyd 34010907a6 volume: Cast SOUND_MIXER_READ_DEVMASK to int to avoid warning. 8 years ago
parazyd d66e775c8d Add OpenBSD support in volume.c 8 years ago
Aaron Marcher faa52bdcc0 Format error messages properly
Make use of strerror(errno) and format all errors equally:
function ['parameters']: error message
8 years ago
Aaron Marcher 96f3a8a54e Get rid of err.h as it is not portable
Replace warn() and warnx() with fprintf() and add <stdio.h> where
necessary.
8 years ago
Aaron Marcher e79d4932ea More robust preprocessor switches
Replace #ifdef with #if defined() and #elif with #elif defined() as it
should only test if it is defined or not.
8 years ago
Aaron Marcher ebf5a35052 Build Linux-only functions only on Linux 8 years ago
Laslo Hunhold 7246dc4381
Move components into dedicated subdirectory
This brings us a lot more tidiness.
8 years ago