structure used in alsa project

发表于:2007-07-04来源:作者:点击数: 标签:
understand the data structure used in alsa project is the key to the full understanding of the entire project. typedef struct _snd_config snd_config_t; struct _snd_config char *id; snd_config_type_t type; union long integer; long long integ
understand the data structure used in alsa project is the key to the full understanding of the entire project.

typedef struct _snd_config snd_config_t;

struct _snd_config {
    char *id;
    snd_config_type_t type;
    union {
        long integer;
        long long integer64;
        char *string;
        double real;
        const void *ptr;
        struct {
            struct list_head fields;
            int join;
        } compound;
    } u;
    struct list_head list;
    snd_config_t *father;
};

usage: the complete definition of sound card is stored in such structure

typedef struct _snd_config_update snd_config_update_t;

struct _snd_config_update {
    unsigned int count;
    struct finfo *finfo;
};

usage: this structure stored the file information of alsa definition

struct finfo {
    char *name;
    dev_t dev;    //typedef short dev_t
    ino_t ino;
    time_t mtime;
};
usage: this structure stored file name, device ,inode,created time,etc.

原文转自:http://www.ltesting.net