Angband
Data Structures | Functions
z-set.c File Reference

Sets of pointers. More...

#include "z-set.h"
#include "z-rand.h"
#include "z-virt.h"

Data Structures

struct  set
 

Functions

static void _set_check (struct set *s)
 
static void _set_grow (struct set *s)
 
static int _set_find (struct set *s, void *p)
 
struct setset_new (void)
 
void set_free (struct set *s)
 
void set_add (struct set *s, void *p)
 
bool set_del (struct set *s, void *p)
 
size_t set_size (struct set *s)
 
voidset_choose (struct set *s)
 
voidset_get (struct set *s, size_t index)
 
void set_insert (struct set *s, size_t index, void *p)
 

Detailed Description

Sets of pointers.

Copyright (c) 2013 elly+.nosp@m.angb.nosp@m.and@l.nosp@m.epto.nosp@m.quark.nosp@m..net. See COPYING.

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.

Function Documentation

◆ _set_check()

static void _set_check ( struct set s)
static

◆ _set_find()

static int _set_find ( struct set s,
void p 
)
static

References i.

Referenced by set_del().

◆ _set_grow()

static void _set_grow ( struct set s)
static

References mem_realloc().

Referenced by set_add(), and set_insert().

◆ set_add()

void set_add ( struct set s,
void p 
)

References _set_check(), _set_grow(), and p.

Referenced by choose_nearby_injured_kin().

◆ set_choose()

void* set_choose ( struct set s)

References _set_check(), NULL, and randint0.

Referenced by choose_nearby_injured_kin().

◆ set_del()

bool set_del ( struct set s,
void p 
)

References _set_check(), _set_find(), and i.

◆ set_free()

void set_free ( struct set s)

References _set_check(), and mem_free().

Referenced by choose_nearby_injured_kin().

◆ set_get()

void* set_get ( struct set s,
size_t  index 
)

References _set_check(), index, and NULL.

◆ set_insert()

void set_insert ( struct set s,
size_t  index,
void p 
)

References _set_grow(), index, and p.

◆ set_new()

struct set* set_new ( void  )

References mem_zalloc().

Referenced by choose_nearby_injured_kin().

◆ set_size()

size_t set_size ( struct set s)