#ifndef SNDIO_PRIV_H
#define SNDIO_PRIV_H
#include "sndio.h"
#define SIO_MAXNFDS 16
struct sio_hdl {
struct sio_ops *ops;
void (*move_cb)(void *, int);
void *move_addr;
void (*vol_cb)(void *, unsigned);
void *vol_addr;
void (*xrun_cb)(void *);
void *xrun_addr;
unsigned mode;
int started;
int nbio;
int eof;
int rdrop;
int wsil;
int rused;
int wused;
int xrun;
int cpending;
long long cpos;
struct sio_par par;
#ifdef DEBUG
unsigned long long pollcnt;
long long start_nsec;
#endif
};
struct sio_ops {
void (*close)(struct sio_hdl *);
int (*setpar)(struct sio_hdl *, struct sio_par *);
int (*getpar)(struct sio_hdl *, struct sio_par *);
int (*getcap)(struct sio_hdl *, struct sio_cap *);
size_t (*write)(struct sio_hdl *, const void *, size_t);
size_t (*read)(struct sio_hdl *, void *, size_t);
int (*start)(struct sio_hdl *);
int (*stop)(struct sio_hdl *);
int (*flush)(struct sio_hdl *);
int (*nfds)(struct sio_hdl *);
int (*pollfd)(struct sio_hdl *, struct pollfd *, int);
int (*revents)(struct sio_hdl *, struct pollfd *);
int (*setvol)(struct sio_hdl *, unsigned);
void (*getvol)(struct sio_hdl *);
};
struct sio_hdl *_sio_aucat_open(const char *, unsigned, int);
struct sio_hdl *_sio_sun_open(const char *, unsigned, int);
void _sio_create(struct sio_hdl *, struct sio_ops *, unsigned, int);
int _sio_xrun(struct sio_hdl *);
void _sio_onmove_cb(struct sio_hdl *, int);
void _sio_onvol_cb(struct sio_hdl *, unsigned);
void _sio_onxrun_cb(struct sio_hdl *);
#ifdef DEBUG
void _sio_printpos(struct sio_hdl *);
#endif
#endif