queue.h 1.37 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* 
 * Copyright (c) 2012 Christoph Mueller <ruunhb@googlemail.com>
 * 
 * Crystal is free software: you can redistribute it and/or modify
 * it under the terms of the Lesser GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Crystal 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
 * Lesser GNU General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

19 20 21 22 23 24 25 26
#ifndef CRYSTAL_STRUCTURES_QUEUE_H
#define CRYSTAL_STRUCTURES_QUEUE_H

#include "structures.h"

struct CryQueue;

struct CryQueue*  	cry_queue_new(void);
27
void            	cry_queue_free(struct CryQueue* queue, cry_free_funptr handler);
28 29 30
int             	cry_queue_size(struct CryQueue* queue);

pointer         	cry_queue_front(struct CryQueue* queue);
31 32 33
pointer                 cry_queue_rear(struct CryQueue* queue);
pointer                 cry_queue_nth(struct CryQueue* queue, size_t index);

34 35 36 37 38
pointer         	cry_queue_dequeue(struct CryQueue* queue);
void            	cry_queue_enqueue(struct CryQueue* queue, pointer data);


#endif // CRYSTAL_STRUCTURES_QUEUE_H