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)
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 ***********************************************************************/
15 #include <fc_config.h>
24 /***********************************************************************
25 'next' function implementation for an "invalid" iterator.
26 ***********************************************************************/
27 static void invalid_iter_next(struct iterator
*it
)
32 /***********************************************************************
33 'get' function implementation for an "invalid" iterator.
34 ***********************************************************************/
35 static void *invalid_iter_get(const struct iterator
*it
)
40 /***********************************************************************
41 'valid' function implementation for an "invalid" iterator.
42 ***********************************************************************/
43 static bool invalid_iter_valid(const struct iterator
*it
)
48 /***********************************************************************
49 Initializes the iterator vtable so that generic_iterate assumes that
50 the iterator is invalid.
51 ***********************************************************************/
52 struct iterator
*invalid_iter_init(struct iterator
*it
)
54 it
->next
= invalid_iter_next
;
55 it
->get
= invalid_iter_get
;
56 it
->valid
= invalid_iter_valid
;