Removed silencing of gtk warning logs from gtk3.22-client.
[freeciv.git] / utility / iterator.c
blobac901c060e1c88a433b13f0858fdc37679a237f4
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.
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 ***********************************************************************/
14 #ifdef HAVE_CONFIG_H
15 #include <fc_config.h>
16 #endif
18 /* utility */
19 #include "shared.h"
21 #include "iterator.h"
24 /***********************************************************************
25 'next' function implementation for an "invalid" iterator.
26 ***********************************************************************/
27 static void invalid_iter_next(struct iterator *it)
29 /* Do nothing. */
32 /***********************************************************************
33 'get' function implementation for an "invalid" iterator.
34 ***********************************************************************/
35 static void *invalid_iter_get(const struct iterator *it)
37 return NULL;
40 /***********************************************************************
41 'valid' function implementation for an "invalid" iterator.
42 ***********************************************************************/
43 static bool invalid_iter_valid(const struct iterator *it)
45 return FALSE;
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;
57 return it;