[ALSA] Remove xxx_t typedefs: Sequencer

Modules: ALSA sequencer

Remove xxx_t typedefs from the core sequencer codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2005-11-17 14:04:02 +01:00
committed by Jaroslav Kysela
parent 6ac77bc180
commit c7e0b5bf9f
33 changed files with 1358 additions and 1274 deletions

View File

@@ -51,40 +51,40 @@ module_param(input_buffer_size, int, 0644);
MODULE_PARM_DESC(input_buffer_size, "Input buffer size in bytes.");
/* data for this midi synth driver */
typedef struct {
snd_card_t *card;
struct seq_midisynth {
struct snd_card *card;
int device;
int subdevice;
snd_rawmidi_file_t input_rfile;
snd_rawmidi_file_t output_rfile;
struct snd_rawmidi_file input_rfile;
struct snd_rawmidi_file output_rfile;
int seq_client;
int seq_port;
snd_midi_event_t *parser;
} seq_midisynth_t;
struct snd_midi_event *parser;
};
typedef struct {
struct seq_midisynth_client {
int seq_client;
int num_ports;
int ports_per_device[SNDRV_RAWMIDI_DEVICES];
seq_midisynth_t *ports[SNDRV_RAWMIDI_DEVICES];
} seq_midisynth_client_t;
struct seq_midisynth *ports[SNDRV_RAWMIDI_DEVICES];
};
static seq_midisynth_client_t *synths[SNDRV_CARDS];
static struct seq_midisynth_client *synths[SNDRV_CARDS];
static DECLARE_MUTEX(register_mutex);
/* handle rawmidi input event (MIDI v1.0 stream) */
static void snd_midi_input_event(snd_rawmidi_substream_t * substream)
static void snd_midi_input_event(struct snd_rawmidi_substream *substream)
{
snd_rawmidi_runtime_t *runtime;
seq_midisynth_t *msynth;
snd_seq_event_t ev;
struct snd_rawmidi_runtime *runtime;
struct seq_midisynth *msynth;
struct snd_seq_event ev;
char buf[16], *pbuf;
long res, count;
if (substream == NULL)
return;
runtime = substream->runtime;
msynth = (seq_midisynth_t *) runtime->private_data;
msynth = runtime->private_data;
if (msynth == NULL)
return;
memset(&ev, 0, sizeof(ev));
@@ -112,9 +112,9 @@ static void snd_midi_input_event(snd_rawmidi_substream_t * substream)
}
}
static int dump_midi(snd_rawmidi_substream_t *substream, const char *buf, int count)
static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, int count)
{
snd_rawmidi_runtime_t *runtime;
struct snd_rawmidi_runtime *runtime;
int tmp;
snd_assert(substream != NULL || buf != NULL, return -EINVAL);
@@ -128,12 +128,12 @@ static int dump_midi(snd_rawmidi_substream_t *substream, const char *buf, int co
return 0;
}
static int event_process_midi(snd_seq_event_t * ev, int direct,
static int event_process_midi(struct snd_seq_event *ev, int direct,
void *private_data, int atomic, int hop)
{
seq_midisynth_t *msynth = (seq_midisynth_t *) private_data;
struct seq_midisynth *msynth = private_data;
unsigned char msg[10]; /* buffer for constructing midi messages */
snd_rawmidi_substream_t *substream;
struct snd_rawmidi_substream *substream;
int len;
snd_assert(msynth != NULL, return -EINVAL);
@@ -161,8 +161,8 @@ static int event_process_midi(snd_seq_event_t * ev, int direct,
}
static int snd_seq_midisynth_new(seq_midisynth_t *msynth,
snd_card_t *card,
static int snd_seq_midisynth_new(struct seq_midisynth *msynth,
struct snd_card *card,
int device,
int subdevice)
{
@@ -175,12 +175,12 @@ static int snd_seq_midisynth_new(seq_midisynth_t *msynth,
}
/* open associated midi device for input */
static int midisynth_subscribe(void *private_data, snd_seq_port_subscribe_t *info)
static int midisynth_subscribe(void *private_data, struct snd_seq_port_subscribe *info)
{
int err;
seq_midisynth_t *msynth = (seq_midisynth_t *)private_data;
snd_rawmidi_runtime_t *runtime;
snd_rawmidi_params_t params;
struct seq_midisynth *msynth = private_data;
struct snd_rawmidi_runtime *runtime;
struct snd_rawmidi_params params;
/* open midi port */
if ((err = snd_rawmidi_kernel_open(msynth->card->number, msynth->device, msynth->subdevice, SNDRV_RAWMIDI_LFLG_INPUT, &msynth->input_rfile)) < 0) {
@@ -203,10 +203,10 @@ static int midisynth_subscribe(void *private_data, snd_seq_port_subscribe_t *inf
}
/* close associated midi device for input */
static int midisynth_unsubscribe(void *private_data, snd_seq_port_subscribe_t *info)
static int midisynth_unsubscribe(void *private_data, struct snd_seq_port_subscribe *info)
{
int err;
seq_midisynth_t *msynth = (seq_midisynth_t *)private_data;
struct seq_midisynth *msynth = private_data;
snd_assert(msynth->input_rfile.input != NULL, return -EINVAL);
err = snd_rawmidi_kernel_release(&msynth->input_rfile);
@@ -214,11 +214,11 @@ static int midisynth_unsubscribe(void *private_data, snd_seq_port_subscribe_t *i
}
/* open associated midi device for output */
static int midisynth_use(void *private_data, snd_seq_port_subscribe_t *info)
static int midisynth_use(void *private_data, struct snd_seq_port_subscribe *info)
{
int err;
seq_midisynth_t *msynth = (seq_midisynth_t *)private_data;
snd_rawmidi_params_t params;
struct seq_midisynth *msynth = private_data;
struct snd_rawmidi_params params;
/* open midi port */
if ((err = snd_rawmidi_kernel_open(msynth->card->number, msynth->device, msynth->subdevice, SNDRV_RAWMIDI_LFLG_OUTPUT, &msynth->output_rfile)) < 0) {
@@ -237,9 +237,9 @@ static int midisynth_use(void *private_data, snd_seq_port_subscribe_t *info)
}
/* close associated midi device for output */
static int midisynth_unuse(void *private_data, snd_seq_port_subscribe_t *info)
static int midisynth_unuse(void *private_data, struct snd_seq_port_subscribe *info)
{
seq_midisynth_t *msynth = (seq_midisynth_t *)private_data;
struct seq_midisynth *msynth = private_data;
unsigned char buf = 0xff; /* MIDI reset */
snd_assert(msynth->output_rfile.output != NULL, return -EINVAL);
@@ -250,7 +250,7 @@ static int midisynth_unuse(void *private_data, snd_seq_port_subscribe_t *info)
}
/* delete given midi synth port */
static void snd_seq_midisynth_delete(seq_midisynth_t *msynth)
static void snd_seq_midisynth_delete(struct seq_midisynth *msynth)
{
if (msynth == NULL)
return;
@@ -265,10 +265,10 @@ static void snd_seq_midisynth_delete(seq_midisynth_t *msynth)
}
/* set our client name */
static int set_client_name(seq_midisynth_client_t *client, snd_card_t *card,
snd_rawmidi_info_t *rmidi)
static int set_client_name(struct seq_midisynth_client *client, struct snd_card *card,
struct snd_rawmidi_info *rmidi)
{
snd_seq_client_info_t cinfo;
struct snd_seq_client_info cinfo;
const char *name;
memset(&cinfo, 0, sizeof(cinfo));
@@ -281,17 +281,17 @@ static int set_client_name(seq_midisynth_client_t *client, snd_card_t *card,
/* register new midi synth port */
static int
snd_seq_midisynth_register_port(snd_seq_device_t *dev)
snd_seq_midisynth_register_port(struct snd_seq_device *dev)
{
seq_midisynth_client_t *client;
seq_midisynth_t *msynth, *ms;
snd_seq_port_info_t *port;
snd_rawmidi_info_t *info;
struct seq_midisynth_client *client;
struct seq_midisynth *msynth, *ms;
struct snd_seq_port_info *port;
struct snd_rawmidi_info *info;
int newclient = 0;
unsigned int p, ports;
snd_seq_client_callback_t callbacks;
snd_seq_port_callback_t pcallbacks;
snd_card_t *card = dev->card;
struct snd_seq_client_callback callbacks;
struct snd_seq_port_callback pcallbacks;
struct snd_card *card = dev->card;
int device = dev->device;
unsigned int input_count = 0, output_count = 0;
@@ -342,7 +342,7 @@ snd_seq_midisynth_register_port(snd_seq_device_t *dev)
} else if (device == 0)
set_client_name(client, card, info); /* use the first device's name */
msynth = kcalloc(ports, sizeof(seq_midisynth_t), GFP_KERNEL);
msynth = kcalloc(ports, sizeof(struct seq_midisynth), GFP_KERNEL);
port = kmalloc(sizeof(*port), GFP_KERNEL);
if (msynth == NULL || port == NULL)
goto __nomem;
@@ -432,11 +432,11 @@ snd_seq_midisynth_register_port(snd_seq_device_t *dev)
/* release midi synth port */
static int
snd_seq_midisynth_unregister_port(snd_seq_device_t *dev)
snd_seq_midisynth_unregister_port(struct snd_seq_device *dev)
{
seq_midisynth_client_t *client;
seq_midisynth_t *msynth;
snd_card_t *card = dev->card;
struct seq_midisynth_client *client;
struct seq_midisynth *msynth;
struct snd_card *card = dev->card;
int device = dev->device, p, ports;
down(&register_mutex);
@@ -465,7 +465,7 @@ snd_seq_midisynth_unregister_port(snd_seq_device_t *dev)
static int __init alsa_seq_midi_init(void)
{
static snd_seq_dev_ops_t ops = {
static struct snd_seq_dev_ops ops = {
snd_seq_midisynth_register_port,
snd_seq_midisynth_unregister_port,
};