OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [peripheral/] [channels/] [channel.c] - Diff between revs 1070 and 1118

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1070 Rev 1118
Line 34... Line 34...
        const char * name;
        const char * name;
        const struct channel_ops * ops;
        const struct channel_ops * ops;
        struct channel_factory * next;
        struct channel_factory * next;
};
};
 
 
extern struct channel_ops fd_channel_ops, file_channel_ops, xterm_channel_ops;
extern struct channel_ops fd_channel_ops, file_channel_ops,
 
        xterm_channel_ops, tcp_channel_ops;
 
 
static struct channel_factory preloaded[] =
static struct channel_factory preloaded[] =
{
{
        { "fd",     &fd_channel_ops,     &preloaded[1] },
        { "fd",     &fd_channel_ops,     &preloaded[1] },
        { "file",   &file_channel_ops,   &preloaded[2] },
        { "file",   &file_channel_ops,   &preloaded[2] },
        { "xterm",  &xterm_channel_ops,  NULL          }
        { "xterm",  &xterm_channel_ops,  &preloaded[3] },
 
        { "tcp",    &tcp_channel_ops,    NULL          }
};
};
 
 
static struct channel_factory * head = &preloaded[0];
static struct channel_factory * head = &preloaded[0];
 
 
static struct channel_factory * find_channel_factory(const char * name);
static struct channel_factory * find_channel_factory(const char * name);
Line 161... Line 163...
        }
        }
}
}
 
 
void channel_free(struct channel * channel)
void channel_free(struct channel * channel)
{
{
        if(channel && channel->ops && channel->ops->close)
        if(channel && channel->ops && channel->ops->free)
        {
        {
                (channel->ops->free)(channel->data);
                (channel->ops->free)(channel->data);
                free(channel);
                free(channel);
        }
        }
}
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.