ratchov 1cdc22aca6 Use the new sioctl_open(3) interface in place of /dev/mixer
Now xstatbar shows the same control as "sndioctl output.level".

ok sthen, rsadowski
2020-04-16 06:54:41 +00:00

65 lines
1.4 KiB
Plaintext

$OpenBSD: patch-stats_h,v 1.4 2020/04/16 06:54:41 ratchov Exp $
Index: stats.h
--- stats.h.orig
+++ stats.h
@@ -25,15 +25,18 @@
#include <fcntl.h>
#include <math.h>
#include <err.h>
+#include <poll.h>
+#include <sndio.h>
#include <machine/apmvar.h>
-#include <sys/audioio.h>
#include <sys/ioctl.h>
#include <sys/param.h>
+#include <sys/mount.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <sys/swap.h>
+#include <sys/vmmeter.h>
#include "xstatbar.h"
@@ -45,14 +48,14 @@
/* volume */
typedef struct {
bool is_setup;
-
- int dev_fd;
- int master_idx;
-
- int max;
- int nchan;
- int left;
- int right;
+ struct sioctl_hdl *hdl;
+ struct pollfd *pfds;
+ int left;
+ int left_addr;
+ int left_max;
+ int right;
+ int right_addr;
+ int right_max;
} volume_info_t;
extern volume_info_t volume;
@@ -74,6 +77,8 @@ typedef struct {
int swap_used; /* swap space used */
int swap_total; /* total amount of swap space */
+
+ int *cpu_online; /* ncpu */
/* cpu/memory historical stuff (for graphs) */
@@ -84,6 +89,7 @@ typedef struct {
#define MEM_ACT 0
#define MEM_TOT 1
#define MEM_FRE 2
+#define MEM_CCH 3
int **memory; /* [hist_size][3] */
int ***cpu_pcnts; /* [ncpu][hist_size][CPUSTATES] */
uint64_t ***cpu_raw; /* [ncpu][hist_size][CPUSTATES] */