mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
Control API encapsulation. Better names for kernel API. Simpler PCM hw_params API. Added missing const.
This commit is contained in:
parent
ccb399f0cd
commit
8f0cb26fdf
71 changed files with 2001 additions and 694 deletions
|
|
@ -24,7 +24,6 @@
|
|||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <asm/page.h>
|
||||
#include "rawmidi_local.h"
|
||||
|
|
@ -162,13 +161,13 @@ int snd_rawmidi_params_default(snd_rawmidi_t *rmidi, snd_rawmidi_stream_t stream
|
|||
int snd_rawmidi_open(snd_rawmidi_t **rawmidip, char *name,
|
||||
int streams, int mode)
|
||||
{
|
||||
char *str;
|
||||
const char *str;
|
||||
int err;
|
||||
snd_config_t *rawmidi_conf, *conf, *type_conf;
|
||||
snd_config_iterator_t i;
|
||||
snd_rawmidi_params_t params;
|
||||
unsigned int stream;
|
||||
char *lib = NULL, *open = NULL;
|
||||
const char *lib = NULL, *open = NULL;
|
||||
int (*open_func)(snd_rawmidi_t **rawmidip, char *name, snd_config_t *conf,
|
||||
int streams, int mode);
|
||||
void *h;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "../control/control_local.h"
|
||||
|
|
@ -276,7 +275,7 @@ int _snd_rawmidi_hw_open(snd_rawmidi_t **handlep, char *name, snd_config_t *conf
|
|||
{
|
||||
snd_config_iterator_t i;
|
||||
long card = -1, device = 0, subdevice = -1;
|
||||
char *str;
|
||||
const char *str;
|
||||
int err;
|
||||
snd_config_foreach(i, conf) {
|
||||
snd_config_t *n = snd_config_entry(i);
|
||||
|
|
|
|||
|
|
@ -19,11 +19,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include "local.h"
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ size_t snd_rawmidi_params_sizeof()
|
|||
int snd_rawmidi_params_malloc(snd_rawmidi_params_t **ptr)
|
||||
{
|
||||
assert(ptr);
|
||||
*ptr = malloc(sizeof(snd_rawmidi_params_t));
|
||||
*ptr = calloc(1, sizeof(snd_rawmidi_params_t));
|
||||
if (!*ptr)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
|
@ -98,7 +98,7 @@ size_t snd_rawmidi_info_sizeof()
|
|||
int snd_rawmidi_info_malloc(snd_rawmidi_info_t **ptr)
|
||||
{
|
||||
assert(ptr);
|
||||
*ptr = malloc(sizeof(snd_rawmidi_info_t));
|
||||
*ptr = calloc(1, sizeof(snd_rawmidi_info_t));
|
||||
if (!*ptr)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
|
@ -145,19 +145,19 @@ unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *obj)
|
|||
return obj->flags;
|
||||
}
|
||||
|
||||
const char * snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj)
|
||||
const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
return obj->id;
|
||||
}
|
||||
|
||||
const char * snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj)
|
||||
const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
return obj->name;
|
||||
}
|
||||
|
||||
const char * snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj)
|
||||
const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
return obj->subname;
|
||||
|
|
@ -201,7 +201,7 @@ size_t snd_rawmidi_status_sizeof()
|
|||
int snd_rawmidi_status_malloc(snd_rawmidi_status_t **ptr)
|
||||
{
|
||||
assert(ptr);
|
||||
*ptr = malloc(sizeof(snd_rawmidi_status_t));
|
||||
*ptr = calloc(1, sizeof(snd_rawmidi_status_t));
|
||||
if (!*ptr)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue