Changed data type of alsa-lib handles from 'void *' to the specific type for

the handle in use. This should be more type-safe as the compiler will perform
checking on type now.
This commit is contained in:
Frank van de Pol 1999-06-02 00:40:30 +00:00
parent 9679707a00
commit 19811bb9b4
15 changed files with 417 additions and 404 deletions

View file

@ -16,6 +16,8 @@ typedef struct snd_ctl_callbacks {
extern "C" {
#endif
typedef struct snd_ctl snd_ctl_t;
int snd_card_load(int card);
int snd_cards(void);
unsigned int snd_cards_mask(void);
@ -29,36 +31,36 @@ int snd_defaults_pcm_device(void);
int snd_defaults_rawmidi_card(void);
int snd_defaults_rawmidi_device(void);
int snd_ctl_open(void **handle, int card);
int snd_ctl_close(void *handle);
int snd_ctl_file_descriptor(void *handle);
int snd_ctl_hw_info(void *handle, struct snd_ctl_hw_info *info);
int snd_ctl_switch_list(void *handle, snd_switch_list_t * list);
int snd_ctl_switch_read(void *handle, snd_switch_t * sw);
int snd_ctl_switch_write(void *handle, snd_switch_t * sw);
int snd_ctl_pcm_info(void *handle, int dev, snd_pcm_info_t * info);
int snd_ctl_pcm_playback_info(void *handle, int dev, snd_pcm_playback_info_t * info);
int snd_ctl_pcm_record_info(void *handle, int dev, snd_pcm_record_info_t * info);
int snd_ctl_pcm_playback_switch_list(void *handle, int dev, snd_switch_list_t * list);
int snd_ctl_pcm_playback_switch_read(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_pcm_playback_switch_write(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_pcm_record_switch_list(void *handle, int dev, snd_switch_list_t * list);
int snd_ctl_pcm_record_switch_read(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_pcm_record_switch_write(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_mixer_info(void *handle, int dev, snd_mixer_info_t * info);
int snd_ctl_mixer_switch_list(void *handle, int dev, snd_switch_list_t *list);
int snd_ctl_mixer_switch_read(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_mixer_switch_write(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_rawmidi_info(void *handle, int dev, snd_rawmidi_info_t * info);
int snd_ctl_rawmidi_output_info(void *handle, int dev, snd_rawmidi_output_info_t * info);
int snd_ctl_rawmidi_input_info(void *handle, int dev, snd_rawmidi_input_info_t * info);
int snd_ctl_rawmidi_output_switch_list(void *handle, int dev, snd_switch_list_t *list);
int snd_ctl_rawmidi_output_switch_read(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_rawmidi_output_switch_write(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_rawmidi_input_switch_list(void *handle, int dev, snd_switch_list_t *list);
int snd_ctl_rawmidi_input_switch_read(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_rawmidi_input_switch_write(void *handle, int dev, snd_switch_t * sw);
int snd_ctl_read(void *handle, snd_ctl_callbacks_t * callbacks);
int snd_ctl_open(snd_ctl_t **handle, int card);
int snd_ctl_close(snd_ctl_t *handle);
int snd_ctl_file_descriptor(snd_ctl_t *handle);
int snd_ctl_hw_info(snd_ctl_t *handle, struct snd_ctl_hw_info *info);
int snd_ctl_switch_list(snd_ctl_t *handle, snd_switch_list_t * list);
int snd_ctl_switch_read(snd_ctl_t *handle, snd_switch_t * sw);
int snd_ctl_switch_write(snd_ctl_t *handle, snd_switch_t * sw);
int snd_ctl_pcm_info(snd_ctl_t *handle, int dev, snd_pcm_info_t * info);
int snd_ctl_pcm_playback_info(snd_ctl_t *handle, int dev, snd_pcm_playback_info_t * info);
int snd_ctl_pcm_record_info(snd_ctl_t *handle, int dev, snd_pcm_record_info_t * info);
int snd_ctl_pcm_playback_switch_list(snd_ctl_t *handle, int dev, snd_switch_list_t * list);
int snd_ctl_pcm_playback_switch_read(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_pcm_playback_switch_write(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_pcm_record_switch_list(snd_ctl_t *handle, int dev, snd_switch_list_t * list);
int snd_ctl_pcm_record_switch_read(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_pcm_record_switch_write(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_mixer_info(snd_ctl_t *handle, int dev, snd_mixer_info_t * info);
int snd_ctl_mixer_switch_list(snd_ctl_t *handle, int dev, snd_switch_list_t *list);
int snd_ctl_mixer_switch_read(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_mixer_switch_write(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_rawmidi_info(snd_ctl_t *handle, int dev, snd_rawmidi_info_t * info);
int snd_ctl_rawmidi_output_info(snd_ctl_t *handle, int dev, snd_rawmidi_output_info_t * info);
int snd_ctl_rawmidi_input_info(snd_ctl_t *handle, int dev, snd_rawmidi_input_info_t * info);
int snd_ctl_rawmidi_output_switch_list(snd_ctl_t *handle, int dev, snd_switch_list_t *list);
int snd_ctl_rawmidi_output_switch_read(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_rawmidi_output_switch_write(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_rawmidi_input_switch_list(snd_ctl_t *handle, int dev, snd_switch_list_t *list);
int snd_ctl_rawmidi_input_switch_read(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_rawmidi_input_switch_write(snd_ctl_t *handle, int dev, snd_switch_t * sw);
int snd_ctl_read(snd_ctl_t *handle, snd_ctl_callbacks_t * callbacks);
#ifdef __cplusplus
}

View file

@ -17,27 +17,29 @@ typedef struct snd_mixer_callbacks {
extern "C" {
#endif
int snd_mixer_open(void **handle, int card, int device);
int snd_mixer_close(void *handle);
int snd_mixer_file_descriptor(void *handle);
int snd_mixer_info(void *handle, snd_mixer_info_t * info);
int snd_mixer_elements(void *handle, snd_mixer_elements_t * elements);
int snd_mixer_routes(void *handle, snd_mixer_routes_t * routes);
int snd_mixer_groups(void *handle, snd_mixer_groups_t * groups);
int snd_mixer_group(void *handle, snd_mixer_group_t * group);
int snd_mixer_element_info(void *handle, snd_mixer_element_info_t * info);
int snd_mixer_element_read(void *handle, snd_mixer_element_t * element);
int snd_mixer_element_write(void *handle, snd_mixer_element_t * element);
int snd_mixer_read(void *handle, snd_mixer_callbacks_t * callbacks);
typedef struct snd_mixer snd_mixer_t;
int snd_mixer_open(snd_mixer_t **handle, int card, int device);
int snd_mixer_close(snd_mixer_t *handle);
int snd_mixer_file_descriptor(snd_mixer_t *handle);
int snd_mixer_info(snd_mixer_t *handle, snd_mixer_info_t * info);
int snd_mixer_elements(snd_mixer_t *handle, snd_mixer_elements_t * elements);
int snd_mixer_routes(snd_mixer_t *handle, snd_mixer_routes_t * routes);
int snd_mixer_groups(snd_mixer_t *handle, snd_mixer_groups_t * groups);
int snd_mixer_group(snd_mixer_t *handle, snd_mixer_group_t * group);
int snd_mixer_element_info(snd_mixer_t *handle, snd_mixer_element_info_t * info);
int snd_mixer_element_read(snd_mixer_t *handle, snd_mixer_element_t * element);
int snd_mixer_element_write(snd_mixer_t *handle, snd_mixer_element_t * element);
int snd_mixer_read(snd_mixer_t *handle, snd_mixer_callbacks_t * callbacks);
void snd_mixer_set_bit(unsigned int *bitmap, int bit, int val);
int snd_mixer_get_bit(unsigned int *bitmap, int bit);
int snd_mixer_element_has_info(snd_mixer_eid_t *eid);
int snd_mixer_element_info_build(void *handle, snd_mixer_element_info_t * info);
int snd_mixer_element_info_build(snd_mixer_t *handle, snd_mixer_element_info_t * info);
int snd_mixer_element_info_free(snd_mixer_element_info_t * info);
int snd_mixer_element_has_control(snd_mixer_eid_t *eid);
int snd_mixer_element_build(void *handle, snd_mixer_element_t * element);
int snd_mixer_element_build(snd_mixer_t *handle, snd_mixer_element_t * element);
int snd_mixer_element_free(snd_mixer_element_t * element);
#ifdef __cplusplus

View file

@ -13,27 +13,30 @@
extern "C" {
#endif
int snd_pcm_open(void **handle, int card, int device, int mode);
int snd_pcm_close(void *handle);
int snd_pcm_file_descriptor(void *handle);
int snd_pcm_block_mode(void *handle, int enable);
int snd_pcm_info(void *handle, snd_pcm_info_t * info);
int snd_pcm_playback_info(void *handle, snd_pcm_playback_info_t * info);
int snd_pcm_record_info(void *handle, snd_pcm_record_info_t * info);
int snd_pcm_playback_format(void *handle, snd_pcm_format_t * format);
int snd_pcm_record_format(void *handle, snd_pcm_format_t * format);
int snd_pcm_playback_params(void *handle, snd_pcm_playback_params_t * params);
int snd_pcm_record_params(void *handle, snd_pcm_record_params_t * params);
int snd_pcm_playback_status(void *handle, snd_pcm_playback_status_t * status);
int snd_pcm_record_status(void *handle, snd_pcm_record_status_t * status);
int snd_pcm_drain_playback(void *handle);
int snd_pcm_flush_playback(void *handle);
int snd_pcm_flush_record(void *handle);
int snd_pcm_playback_pause(void *handle, int enable);
int snd_pcm_playback_time(void *handle, int enable);
int snd_pcm_record_time(void *handle, int enable);
ssize_t snd_pcm_write(void *handle, const void *buffer, size_t size);
ssize_t snd_pcm_read(void *handle, void *buffer, size_t size);
typedef struct snd_pcm snd_pcm_t;
typedef struct snd_pcm_loopback snd_pcm_loopback_t;
int snd_pcm_open(snd_pcm_t **handle, int card, int device, int mode);
int snd_pcm_close(snd_pcm_t *handle);
int snd_pcm_file_descriptor(snd_pcm_t *handle);
int snd_pcm_block_mode(snd_pcm_t *handle, int enable);
int snd_pcm_info(snd_pcm_t *handle, snd_pcm_info_t * info);
int snd_pcm_playback_info(snd_pcm_t *handle, snd_pcm_playback_info_t * info);
int snd_pcm_record_info(snd_pcm_t *handle, snd_pcm_record_info_t * info);
int snd_pcm_playback_format(snd_pcm_t *handle, snd_pcm_format_t * format);
int snd_pcm_record_format(snd_pcm_t *handle, snd_pcm_format_t * format);
int snd_pcm_playback_params(snd_pcm_t *handle, snd_pcm_playback_params_t * params);
int snd_pcm_record_params(snd_pcm_t *handle, snd_pcm_record_params_t * params);
int snd_pcm_playback_status(snd_pcm_t *handle, snd_pcm_playback_status_t * status);
int snd_pcm_record_status(snd_pcm_t *handle, snd_pcm_record_status_t * status);
int snd_pcm_drain_playback(snd_pcm_t *handle);
int snd_pcm_flush_playback(snd_pcm_t *handle);
int snd_pcm_flush_record(snd_pcm_t *handle);
int snd_pcm_playback_pause(snd_pcm_t *handle, int enable);
int snd_pcm_playback_time(snd_pcm_t *handle, int enable);
int snd_pcm_record_time(snd_pcm_t *handle, int enable);
ssize_t snd_pcm_write(snd_pcm_t *handle, const void *buffer, size_t size);
ssize_t snd_pcm_read(snd_pcm_t *handle, void *buffer, size_t size);
#ifdef __cplusplus
}
@ -46,13 +49,13 @@ ssize_t snd_pcm_read(void *handle, void *buffer, size_t size);
extern "C" {
#endif
int snd_pcm_loopback_open(void **handle, int card, int device, int mode);
int snd_pcm_loopback_close(void *handle);
int snd_pcm_loopback_file_descriptor(void *handle);
int snd_pcm_loopback_block_mode(void *handle, int enable);
int snd_pcm_loopback_stream_mode(void *handle, int mode);
int snd_pcm_loopback_format(void *handle, snd_pcm_format_t * format);
ssize_t snd_pcm_loopback_read(void *handle, void *buffer, size_t size);
int snd_pcm_loopback_open(snd_pcm_loopback_t **handle, int card, int device, int mode);
int snd_pcm_loopback_close(snd_pcm_loopback_t *handle);
int snd_pcm_loopback_file_descriptor(snd_pcm_loopback_t *handle);
int snd_pcm_loopback_block_mode(snd_pcm_loopback_t *handle, int enable);
int snd_pcm_loopback_stream_mode(snd_pcm_loopback_t *handle, int mode);
int snd_pcm_loopback_format(snd_pcm_loopback_t *handle, snd_pcm_format_t * format);
ssize_t snd_pcm_loopback_read(snd_pcm_loopback_t *handle, void *buffer, size_t size);
#ifdef __cplusplus
}

View file

@ -13,20 +13,22 @@
extern "C" {
#endif
int snd_rawmidi_open(void **handle, int card, int device, int mode);
int snd_rawmidi_close(void *handle);
int snd_rawmidi_file_descriptor(void *handle);
int snd_rawmidi_block_mode(void *handle, int enable);
int snd_rawmidi_info(void *handle, snd_rawmidi_info_t * info);
int snd_rawmidi_output_params(void *handle, snd_rawmidi_output_params_t * params);
int snd_rawmidi_input_params(void *handle, snd_rawmidi_input_params_t * params);
int snd_rawmidi_output_status(void *handle, snd_rawmidi_output_status_t * status);
int snd_rawmidi_input_status(void *handle, snd_rawmidi_input_status_t * status);
int snd_rawmidi_drain_output(void *handle);
int snd_rawmidi_flush_output(void *handle);
int snd_rawmidi_flush_input(void *handle);
ssize_t snd_rawmidi_write(void *handle, const void *buffer, size_t size);
ssize_t snd_rawmidi_read(void *handle, void *buffer, size_t size);
typedef struct snd_rawmidi snd_rawmidi_t;
int snd_rawmidi_open(snd_rawmidi_t **handle, int card, int device, int mode);
int snd_rawmidi_close(snd_rawmidi_t *handle);
int snd_rawmidi_file_descriptor(snd_rawmidi_t *handle);
int snd_rawmidi_block_mode(snd_rawmidi_t *handle, int enable);
int snd_rawmidi_info(snd_rawmidi_t *handle, snd_rawmidi_info_t * info);
int snd_rawmidi_output_params(snd_rawmidi_t *handle, snd_rawmidi_output_params_t * params);
int snd_rawmidi_input_params(snd_rawmidi_t *handle, snd_rawmidi_input_params_t * params);
int snd_rawmidi_output_status(snd_rawmidi_t *handle, snd_rawmidi_output_status_t * status);
int snd_rawmidi_input_status(snd_rawmidi_t *handle, snd_rawmidi_input_status_t * status);
int snd_rawmidi_drain_output(snd_rawmidi_t *handle);
int snd_rawmidi_flush_output(snd_rawmidi_t *handle);
int snd_rawmidi_flush_input(snd_rawmidi_t *handle);
ssize_t snd_rawmidi_write(snd_rawmidi_t *handle, const void *buffer, size_t size);
ssize_t snd_rawmidi_read(snd_rawmidi_t *handle, void *buffer, size_t size);
#ifdef __cplusplus
}

View file

@ -13,44 +13,46 @@
extern "C" {
#endif
int snd_seq_open(void **handle, int mode);
int snd_seq_close(void *handle);
int snd_seq_file_descriptor(void *handle);
int snd_seq_block_mode(void *handle, int enable);
int snd_seq_client_id(void *handle);
int snd_seq_system_info(void *handle, snd_seq_system_info_t *info);
int snd_seq_get_client_info(void *handle, snd_seq_client_info_t *info);
int snd_seq_get_any_client_info(void *handle, int client, snd_seq_client_info_t *info);
int snd_seq_set_client_info(void *handle, snd_seq_client_info_t *info);
int snd_seq_create_port(void *handle, snd_seq_port_info_t *info);
int snd_seq_delete_port(void *handle, snd_seq_port_info_t *info);
int snd_seq_get_port_info(void *handle, int port, snd_seq_port_info_t *info);
int snd_seq_get_any_port_info(void *handle, int client, int port, snd_seq_port_info_t *info);
int snd_seq_set_port_info(void *handle, int port, snd_seq_port_info_t *info);
int snd_seq_subscribe_port(void *handle, snd_seq_port_subscribe_t *sub);
int snd_seq_unsubscribe_port(void *handle, snd_seq_port_subscribe_t *sub);
int snd_seq_get_queue_status(void *handle, int q, snd_seq_queue_status_t *status);
int snd_seq_get_queue_tempo(void *handle, int q, snd_seq_queue_tempo_t *tempo);
int snd_seq_set_queue_tempo(void *handle, int q, snd_seq_queue_tempo_t *tempo);
int snd_seq_get_queue_owner(void *handle, int q, snd_seq_queue_owner_t *owner);
int snd_seq_set_queue_owner(void *handle, int q, snd_seq_queue_owner_t *owner);
int snd_seq_get_queue_timer(void *handle, int q, snd_seq_queue_timer_t *timer);
int snd_seq_set_queue_timer(void *handle, int q, snd_seq_queue_timer_t *timer);
int snd_seq_get_queue_sync(void *handle, int q, snd_seq_queue_sync_t *sync);
int snd_seq_set_queue_sync(void *handle, int q, snd_seq_queue_sync_t *sync);
int snd_seq_get_queue_client(void *handle, int q, snd_seq_queue_client_t *queue);
int snd_seq_set_queue_client(void *handle, int q, snd_seq_queue_client_t *queue);
int snd_seq_alloc_queue(void *handle);
int snd_seq_free_queue(void *handle, int q);
typedef struct snd_seq snd_seq_t;
int snd_seq_open(snd_seq_t **handle, int mode);
int snd_seq_close(snd_seq_t *handle);
int snd_seq_file_descriptor(snd_seq_t *handle);
int snd_seq_block_mode(snd_seq_t *handle, int enable);
int snd_seq_client_id(snd_seq_t *handle);
int snd_seq_system_info(snd_seq_t *handle, snd_seq_system_info_t *info);
int snd_seq_get_client_info(snd_seq_t *handle, snd_seq_client_info_t *info);
int snd_seq_get_any_client_info(snd_seq_t *handle, int client, snd_seq_client_info_t *info);
int snd_seq_set_client_info(snd_seq_t *handle, snd_seq_client_info_t *info);
int snd_seq_create_port(snd_seq_t *handle, snd_seq_port_info_t *info);
int snd_seq_delete_port(snd_seq_t *handle, snd_seq_port_info_t *info);
int snd_seq_get_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info);
int snd_seq_get_any_port_info(snd_seq_t *handle, int client, int port, snd_seq_port_info_t *info);
int snd_seq_set_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info);
int snd_seq_subscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub);
int snd_seq_unsubscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub);
int snd_seq_get_queue_status(snd_seq_t *handle, int q, snd_seq_queue_status_t *status);
int snd_seq_get_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo);
int snd_seq_set_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo);
int snd_seq_get_queue_owner(snd_seq_t *handle, int q, snd_seq_queue_owner_t *owner);
int snd_seq_set_queue_owner(snd_seq_t *handle, int q, snd_seq_queue_owner_t *owner);
int snd_seq_get_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer);
int snd_seq_set_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer);
int snd_seq_get_queue_sync(snd_seq_t *handle, int q, snd_seq_queue_sync_t *sync);
int snd_seq_set_queue_sync(snd_seq_t *handle, int q, snd_seq_queue_sync_t *sync);
int snd_seq_get_queue_client(snd_seq_t *handle, int q, snd_seq_queue_client_t *queue);
int snd_seq_set_queue_client(snd_seq_t *handle, int q, snd_seq_queue_client_t *queue);
int snd_seq_alloc_queue(snd_seq_t *handle);
int snd_seq_free_queue(snd_seq_t *handle, int q);
/* event routines */
snd_seq_event_t *snd_seq_create_event(void);
int snd_seq_free_event(snd_seq_event_t *ev);
int snd_seq_event_length(snd_seq_event_t *ev);
int snd_seq_event_output(void *handle, snd_seq_event_t *ev);
int snd_seq_event_input(void *handle, snd_seq_event_t **ev);
int snd_seq_flush_output(void *handle);
int snd_seq_drain_output(void *handle);
int snd_seq_drain_input(void *handle);
int snd_seq_event_output(snd_seq_t *handle, snd_seq_event_t *ev);
int snd_seq_event_input(snd_seq_t *handle, snd_seq_event_t **ev);
int snd_seq_flush_output(snd_seq_t *handle);
int snd_seq_drain_output(snd_seq_t *handle);
int snd_seq_drain_input(snd_seq_t *handle);
/* misc */
void snd_seq_set_bit(int nr, void *array);
int snd_seq_change_bit(int nr, void *array);

View file

@ -9,18 +9,20 @@
extern "C" {
#endif
int snd_timer_open(void **handle);
int snd_timer_close(void *handle);
int snd_timer_file_descriptor(void *handle);
int snd_timer_general_info(void *handle, snd_timer_general_info_t * info);
int snd_timer_select(void *handle, snd_timer_select_t *tselect);
int snd_timer_info(void *handle, snd_timer_info_t *timer);
int snd_timer_params(void *handle, snd_timer_params_t *params);
int snd_timer_status(void *handle, snd_timer_status_t *status);
int snd_timer_start(void *handle);
int snd_timer_stop(void *handle);
int snd_timer_continue(void *handle);
ssize_t snd_timer_read(void *handle, void *buffer, size_t size);
typedef struct snd_timer snd_timer_t;
int snd_timer_open(snd_timer_t **handle);
int snd_timer_close(snd_timer_t *handle);
int snd_timer_file_descriptor(snd_timer_t *handle);
int snd_timer_general_info(snd_timer_t *handle, snd_timer_general_info_t * info);
int snd_timer_select(snd_timer_t *handle, snd_timer_select_t *tselect);
int snd_timer_info(snd_timer_t *handle, snd_timer_info_t *timer);
int snd_timer_params(snd_timer_t *handle, snd_timer_params_t *params);
int snd_timer_status(snd_timer_t *handle, snd_timer_status_t *status);
int snd_timer_start(snd_timer_t *handle);
int snd_timer_stop(snd_timer_t *handle);
int snd_timer_continue(snd_timer_t *handle);
ssize_t snd_timer_read(snd_timer_t *handle, void *buffer, size_t size);
#ifdef __cplusplus
}