Sha256: 4deb024b189a772ded530fcbe0e6c022d603a4c5f166b16be38187cc23b0907a

Contents?: true

Size: 1.55 KB

Versions: 20

Compression:

Stored size: 1.55 KB

Contents

/*
 * Queue implementation
 *
 * Copyright (C) 2008-2013 NEC Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, version 2, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */


#ifndef MESSAGE_QUEUE_H
#define MESSAGE_QUEUE_H


#include "bool.h"
#include "buffer.h"


typedef struct message_queue_element {
  buffer *data;
  struct message_queue_element *next;
} message_queue_element;


typedef struct {
  message_queue_element *head;
  message_queue_element *divider;
  message_queue_element *tail;
  unsigned int length;
} message_queue;


message_queue *create_message_queue( void );
bool delete_message_queue( message_queue *queue );
bool enqueue_message( message_queue *queue, buffer *message );
buffer *dequeue_message( message_queue *queue );
buffer *peek_message( message_queue *queue );
void foreach_message_queue( message_queue *queue, bool function( buffer *message, void *user_data ), void *user_data );


#endif // MESSAGE_QUEUE_H


/*
 * Local variables:
 * c-basic-offset: 2
 * indent-tabs-mode: nil
 * End:
 */

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
trema-0.4.7 src/lib/message_queue.h
trema-0.4.6 src/lib/message_queue.h
trema-0.4.5 src/lib/message_queue.h
trema-0.4.4 src/lib/message_queue.h
trema-0.4.3 src/lib/message_queue.h
trema-0.4.2 src/lib/message_queue.h
trema-0.4.1 src/lib/message_queue.h
trema-0.4.0 src/lib/message_queue.h
trema-0.3.21 src/lib/message_queue.h
trema-0.3.20 src/lib/message_queue.h
trema-0.3.19 src/lib/message_queue.h
trema-0.3.18 src/lib/message_queue.h
trema-0.3.17 src/lib/message_queue.h
trema-0.3.16 src/lib/message_queue.h
trema-0.3.15 src/lib/message_queue.h
trema-0.3.14 src/lib/message_queue.h
trema-0.3.13 src/lib/message_queue.h
trema-0.3.12 src/lib/message_queue.h
trema-0.3.11 src/lib/message_queue.h
trema-0.3.10 src/lib/message_queue.h