Data Structures | Macros | Typedefs | Functions
z-queue.h File Reference

Simple circular integer queue. More...

#include "h-basic.h"

Go to the source code of this file.

Data Structures

struct  queue


#define q_push_ptr(q, ptr)   q_push((q), (uintptr_t)(ptr))
#define q_pop_ptr(q)   ((void *)(q_pop((q))))
#define q_push_int(q, i)   q_push((q), (uintptr_t)(i))
#define q_pop_int(q)   ((int)(q_pop((q))))


typedef unsigned long uintptr_t


struct queueq_new (size_t size)
int q_len (struct queue *q)
void q_push (struct queue *q, uintptr_t item)
uintptr_t q_pop (struct queue *q)
void q_free (struct queue *q)

Detailed Description

Simple circular integer queue.

Copyright (c) 2011 Erik Osheim

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Macro Definition Documentation

#define q_pop_int (   q)    ((int)(q_pop((q))))

Referenced by build_color_point(), and join_region().

#define q_pop_ptr (   q)    ((void *)(q_pop((q))))

Referenced by push_object().

#define q_push_int (   q,
)    q_push((q), (uintptr_t)(i))

Referenced by build_color_point(), and join_region().

#define q_push_ptr (   q,
)    q_push((q), (uintptr_t)(ptr))

Referenced by push_object().

Typedef Documentation

typedef unsigned long uintptr_t

Function Documentation

void q_free ( struct queue q)

References queue::data.

Referenced by build_color_point(), join_region(), and push_object().

int q_len ( struct queue q)
struct queue* q_new ( size_t  size)
uintptr_t q_pop ( struct queue q)
void q_push ( struct queue q,
uintptr_t  item