t* dwmstatus for OpenBSD
URI git clone git://git.codevoid.de/dwmstatus-sdk
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
DIR commit e5af0098dd9d10ef0d8b5004fce2a244b46422d1
DIR parent ab367a96f64c78ed3677259b3b86ba96e2307d50
URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de>
Date: Tue, 13 Nov 2018 16:26:06 +0100
Remove FreeBSD ifdef
Diffstat:
M dwmstatus.c | 57 +++----------------------------
1 file changed, 4 insertions(+), 53 deletions(-)
---
DIR diff --git a/dwmstatus.c b/dwmstatus.c
t@@ -2,7 +2,6 @@
* Copy me if you can.
* by 20h
*
- * done. ~sdk
*/
#define _BSD_SOURCE
t@@ -19,11 +18,9 @@
#include <sys/wait.h>
#include <signal.h>
#include <fcntl.h>
-
#include <X11/Xlib.h>
-
-#include <sys/param.h> // freebsd
-#include <sys/mount.h> // freebsd
+#include <sys/param.h>
+#include <sys/mount.h>
// configuration
#define UPDATE_INTERVAL 10
t@@ -70,63 +67,17 @@ getfreespace(const char *path) {
return smprintf("%ld", (vfs.f_bavail * vfs.f_bsize) / 1024 / 1024);
}
-/* Use FreeBSDs sysctl to retrieve information
- * Sysctl may return different types, so you want
- * to call the appropriate smprintf() in main();
- */
char *
getsysctl(char *input_str) {
-#ifdef __FreeBSD__
char *ret_val;
size_t ret_size;
- sysctlbyname(input_str, NULL, &ret_size, NULL, 0);
- ret_val = malloc(ret_size);
-
- // call to get size
- sysctlbyname(input_str, NULL, &ret_size, NULL, 0);
-
- // allocate memory
- ret_val = malloc(ret_size);
-
- // retrieve value
- sysctlbyname(input_str, &ret_val, &ret_size, NULL, 0);
-
- // caller must know how to interpret this (s or i)
- return ret_val;
-#else
- return smprintf("N/A");
-#endif
+ return "not implemented";
}
-/* Use FreeBSDs mixer device to determine the master
- * volume. Returns the volume % as int.
- */
char *
getvolume(char *mixerpath) {
-#ifdef __FreeBSD__
- char defaultmixer[] = "/dev/mixer";
- int mixfd, vol, devmask = 0;
-
- if (mixerpath == NULL)
- mixerpath = defaultmixer;
-
- if ((mixfd = open(mixerpath, O_RDWR)) < 0) {
- smprintf(("Cannot open mixer"));
- }
-
- if (ioctl(mixfd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) {
- smprintf(("Cannot read mixer info"));
- }
- if (ioctl(mixfd, MIXER_READ(0), &vol) == -1) {
- smprintf(("Cannot read mixer info"));
- }
- close(mixfd);
- return smprintf("%i", vol & 0x7f);
-#else
- return smprintf("N/A");
-#endif
-
+ return smprintf("not implemented");
}
void