#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#define SNDCFG_ISAPNP
#include "driver.h"


int snd_opl3_getopt(int argc, char **argv);
int opl3_init(void);
void opl3_cleanup(void);


int main(int argc, char **argv)
{
	int err;

//	setvbuf(stdout, NULL, _IONBF, 0 );  // no buffering on printfs (for Netpliance test)
	
	if ( snd_init(argc, argv) == -1 )
		return (EXIT_FAILURE);
	
	snd_opl3_getopt(argc, argv);
	if ((err = opl3_init()) < 0 ) {
		snd_printk( "Unable to detect OPL3-SA(%s)", strerror(-err));
		return( EXIT_FAILURE);
	}
    snd_start();
	opl3_cleanup();
	snd_cleanup();
	return(0);
}
