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

◆ q_pop_int

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

◆ q_pop_ptr

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

Referenced by push_object().

◆ q_push_int

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

◆ q_push_ptr

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

Referenced by push_object().

Typedef Documentation

◆ uintptr_t

typedef unsigned long uintptr_t

Function Documentation

◆ q_free()

void q_free ( struct queue q)

◆ q_len()

int q_len ( struct queue q)

◆ q_new()

struct queue* q_new ( size_t  size)

◆ q_pop()

uintptr_t q_pop ( struct queue q)

◆ q_push()

void q_push ( struct queue q,
uintptr_t  item