Freeciv-3.3
Loading...
Searching...
No Matches
voteinfo.h
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#ifndef FC__VOTEINFO_H
14#define FC__VOTEINFO_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20#include "fc_types.h"
21
28
29struct voteinfo {
30 /* Set by the server via packets. */
33 char desc[512];
35 int flags;
36 int yes;
37 int no;
41 bool passed;
42
43 /* Set/used by the client. */
46};
47
48void voteinfo_queue_init(void);
49void voteinfo_queue_free(void);
50void voteinfo_queue_remove(int vote_no);
51void voteinfo_queue_delayed_remove(int vote_no);
53void voteinfo_queue_add(int vote_no, const char *user, const char *desc,
54 int percent_required, int flags);
58void voteinfo_queue_next(void);
59int voteinfo_queue_size(void);
60
62
63#ifdef __cplusplus
64}
65#endif /* __cplusplus */
66
67#endif /* FC__VOTEINFO_H */
68
char * incite_cost
Definition comments.c:76
#define MAX_LEN_NAME
Definition fc_types.h:66
Definition voting.h:46
int yes
Definition voteinfo.h:36
int num_voters
Definition voteinfo.h:39
bool passed
Definition voteinfo.h:41
char desc[512]
Definition voteinfo.h:33
int abstain
Definition voteinfo.h:38
bool resolved
Definition voteinfo.h:40
int flags
Definition voteinfo.h:35
int vote_no
Definition voteinfo.h:31
int no
Definition voteinfo.h:37
time_t remove_time
Definition voteinfo.h:45
int percent_required
Definition voteinfo.h:34
enum client_vote_type client_vote
Definition voteinfo.h:44
char user[MAX_LEN_NAME]
Definition voteinfo.h:32
void voteinfo_queue_init(void)
Definition voteinfo.c:167
void voteinfo_queue_delayed_remove(int vote_no)
Definition voteinfo.c:53
void voteinfo_do_vote(int vote_no, enum client_vote_type vote)
Definition voteinfo.c:234
bool voteinfo_bar_can_be_shown(void)
Definition voteinfo.c:299
void voteinfo_queue_remove(int vote_no)
Definition voteinfo.c:103
client_vote_type
Definition voteinfo.h:22
@ CVT_YES
Definition voteinfo.h:24
@ CVT_NO
Definition voteinfo.h:25
@ CVT_NONE
Definition voteinfo.h:23
@ CVT_ABSTAIN
Definition voteinfo.h:26
struct voteinfo * voteinfo_queue_find(int vote_no)
Definition voteinfo.c:150
struct voteinfo * voteinfo_queue_get_current(int *pindex)
Definition voteinfo.c:201
void voteinfo_queue_next(void)
Definition voteinfo.c:272
int voteinfo_queue_size(void)
Definition voteinfo.c:291
void voteinfo_queue_check_removed(void)
Definition voteinfo.c:72
void voteinfo_queue_free(void)
Definition voteinfo.c:179
void voteinfo_queue_add(int vote_no, const char *user, const char *desc, int percent_required, int flags)
Definition voteinfo.c:123