write-queue: use namespace prefix osmo_wqueue*

Summary of changes:

s/struct write_queue/struct osmo_wqueue/g
s/write_queue_init/osmo_wqueue_init/g
s/void write_queue_clear/osmo_wqueue_clear/g
s/write_queue_enqueue/osmo_wqueue_enqueue/g
s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g
This commit is contained in:
Pablo Neira Ayuso 2011-05-07 12:42:51 +02:00
parent a10dd35566
commit 9111d930a5
2 changed files with 14 additions and 14 deletions

View File

@ -20,13 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
*/ */
#ifndef write_queue_h #ifndef OSMO_WQUEUE_H
#define write_queue_h #define OSMO_WQUEUE_H
#include <osmocom/core/select.h> #include <osmocom/core/select.h>
#include <osmocom/core/msgb.h> #include <osmocom/core/msgb.h>
struct write_queue { struct osmo_wqueue {
struct osmo_fd bfd; struct osmo_fd bfd;
unsigned int max_length; unsigned int max_length;
unsigned int current_length; unsigned int current_length;
@ -38,9 +38,9 @@ struct write_queue {
int (*except_cb)(struct osmo_fd *fd); int (*except_cb)(struct osmo_fd *fd);
}; };
void write_queue_init(struct write_queue *queue, int max_length); void osmo_wqueue_init(struct osmo_wqueue *queue, int max_length);
void write_queue_clear(struct write_queue *queue); void osmo_wqueue_clear(struct osmo_wqueue *queue);
int write_queue_enqueue(struct write_queue *queue, struct msgb *data); int osmo_wqueue_enqueue(struct osmo_wqueue *queue, struct msgb *data);
int write_queue_bfd_cb(struct osmo_fd *fd, unsigned int what); int osmo_wqueue_bfd_cb(struct osmo_fd *fd, unsigned int what);
#endif #endif

View File

@ -23,11 +23,11 @@
#include <osmocom/core/write_queue.h> #include <osmocom/core/write_queue.h>
int write_queue_bfd_cb(struct osmo_fd *fd, unsigned int what) int osmo_wqueue_bfd_cb(struct osmo_fd *fd, unsigned int what)
{ {
struct write_queue *queue; struct osmo_wqueue *queue;
queue = container_of(fd, struct write_queue, bfd); queue = container_of(fd, struct osmo_wqueue, bfd);
if (what & BSC_FD_READ) if (what & BSC_FD_READ)
queue->read_cb(fd); queue->read_cb(fd);
@ -56,17 +56,17 @@ int write_queue_bfd_cb(struct osmo_fd *fd, unsigned int what)
return 0; return 0;
} }
void write_queue_init(struct write_queue *queue, int max_length) void osmo_wqueue_init(struct osmo_wqueue *queue, int max_length)
{ {
queue->max_length = max_length; queue->max_length = max_length;
queue->current_length = 0; queue->current_length = 0;
queue->read_cb = NULL; queue->read_cb = NULL;
queue->write_cb = NULL; queue->write_cb = NULL;
queue->bfd.cb = write_queue_bfd_cb; queue->bfd.cb = osmo_wqueue_bfd_cb;
INIT_LLIST_HEAD(&queue->msg_queue); INIT_LLIST_HEAD(&queue->msg_queue);
} }
int write_queue_enqueue(struct write_queue *queue, struct msgb *data) int osmo_wqueue_enqueue(struct osmo_wqueue *queue, struct msgb *data)
{ {
// if (queue->current_length + 1 >= queue->max_length) // if (queue->current_length + 1 >= queue->max_length)
// LOGP(DMSC, LOGL_ERROR, "The queue is full. Dropping not yet implemented.\n"); // LOGP(DMSC, LOGL_ERROR, "The queue is full. Dropping not yet implemented.\n");
@ -78,7 +78,7 @@ int write_queue_enqueue(struct write_queue *queue, struct msgb *data)
return 0; return 0;
} }
void write_queue_clear(struct write_queue *queue) void osmo_wqueue_clear(struct osmo_wqueue *queue)
{ {
while (!llist_empty(&queue->msg_queue)) { while (!llist_empty(&queue->msg_queue)) {
struct msgb *msg = msgb_dequeue(&queue->msg_queue); struct msgb *msg = msgb_dequeue(&queue->msg_queue);