Freeciv-3.3: /fast/freeciv/nightly/main/utility/iterator.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
iterator.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "shared.h"
20
21#include "iterator.h"
22
23/*******************************************************************/
26 static void invalid_iter_next(struct iterator *it)
27{
28 /* Do nothing. */
29}
30
31/*******************************************************************/
34 static void *invalid_iter_get(const struct iterator *it)
35{
36 return nullptr;
37}
38
39/*******************************************************************/
42 static bool invalid_iter_valid(const struct iterator *it)
43{
44 return FALSE;
45}
46
47/*******************************************************************/
51 struct iterator *invalid_iter_init(struct iterator *it)
52{
53 it->next = invalid_iter_next;
54 it->get = invalid_iter_get;
55 it->valid = invalid_iter_valid;
56
57 return it;
58}
invalid_iter_get
static void * invalid_iter_get(const struct iterator *it)
Definition iterator.c:34
invalid_iter_valid
static bool invalid_iter_valid(const struct iterator *it)
Definition iterator.c:42
invalid_iter_init
struct iterator * invalid_iter_init(struct iterator *it)
Definition iterator.c:51
invalid_iter_next
static void invalid_iter_next(struct iterator *it)
Definition iterator.c:26
iterator.h
shared.h
iterator
Definition iterator.h:31
iterator::valid
bool(* valid)(const struct iterator *it)
Definition iterator.h:34
iterator::get
void *(* get)(const struct iterator *it)
Definition iterator.h:33
iterator::next
void(* next)(struct iterator *it)
Definition iterator.h:32
FALSE
#define FALSE
Definition support.h:47