Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/voteinfo.h Source File

Freeciv-3.1

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
22 enum client_vote_type {
23 CVT_NONE = 0,
24 CVT_YES,
25 CVT_NO,
26 CVT_ABSTAIN
27};
28
29 struct voteinfo {
30 /* Set by the server via packets. */
31 int vote_no;
32 char user[MAX_LEN_NAME];
33 char desc[512];
34 int percent_required;
35 int flags;
36 int yes;
37 int no;
38 int abstain;
39 int num_voters;
40 bool resolved;
41 bool passed;
42
43 /* Set/used by the client. */
44 enum client_vote_type client_vote;
45 time_t remove_time;
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);
52void voteinfo_queue_check_removed(void);
53void voteinfo_queue_add(int vote_no, const char *user, const char *desc,
54 int percent_required, int flags);
55struct voteinfo *voteinfo_queue_find(int vote_no);
56void voteinfo_do_vote(int vote_no, enum client_vote_type vote);
57struct voteinfo *voteinfo_queue_get_current(int *pindex);
58void voteinfo_queue_next(void);
59int voteinfo_queue_size(void);
60
61bool voteinfo_bar_can_be_shown(void);
62
63#ifdef __cplusplus
64}
65#endif /* __cplusplus */
66
67#endif /* FC__VOTEINFO_H */
68
fc_types.h
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
vote
Definition voting.h:46
voteinfo
Definition voteinfo.h:29
voteinfo::yes
int yes
Definition voteinfo.h:36
voteinfo::num_voters
int num_voters
Definition voteinfo.h:39
voteinfo::passed
bool passed
Definition voteinfo.h:41
voteinfo::desc
char desc[512]
Definition voteinfo.h:33
voteinfo::abstain
int abstain
Definition voteinfo.h:38
voteinfo::resolved
bool resolved
Definition voteinfo.h:40
voteinfo::flags
int flags
Definition voteinfo.h:35
voteinfo::vote_no
int vote_no
Definition voteinfo.h:31
voteinfo::no
int no
Definition voteinfo.h:37
voteinfo::remove_time
time_t remove_time
Definition voteinfo.h:45
voteinfo::percent_required
int percent_required
Definition voteinfo.h:34
voteinfo::client_vote
enum client_vote_type client_vote
Definition voteinfo.h:44
voteinfo::user
char user[MAX_LEN_NAME]
Definition voteinfo.h:32
voteinfo_queue_init
void voteinfo_queue_init(void)
Definition voteinfo.c:167
voteinfo_queue_delayed_remove
void voteinfo_queue_delayed_remove(int vote_no)
Definition voteinfo.c:53
voteinfo_do_vote
void voteinfo_do_vote(int vote_no, enum client_vote_type vote)
Definition voteinfo.c:234
voteinfo_bar_can_be_shown
bool voteinfo_bar_can_be_shown(void)
Definition voteinfo.c:299
voteinfo_queue_remove
void voteinfo_queue_remove(int vote_no)
Definition voteinfo.c:103
client_vote_type
client_vote_type
Definition voteinfo.h:22
CVT_YES
@ CVT_YES
Definition voteinfo.h:24
CVT_NO
@ CVT_NO
Definition voteinfo.h:25
CVT_NONE
@ CVT_NONE
Definition voteinfo.h:23
CVT_ABSTAIN
@ CVT_ABSTAIN
Definition voteinfo.h:26
voteinfo_queue_find
struct voteinfo * voteinfo_queue_find(int vote_no)
Definition voteinfo.c:150
voteinfo_queue_get_current
struct voteinfo * voteinfo_queue_get_current(int *pindex)
Definition voteinfo.c:201
voteinfo_queue_next
void voteinfo_queue_next(void)
Definition voteinfo.c:272
voteinfo_queue_size
int voteinfo_queue_size(void)
Definition voteinfo.c:291
voteinfo_queue_check_removed
void voteinfo_queue_check_removed(void)
Definition voteinfo.c:72
voteinfo_queue_free
void voteinfo_queue_free(void)
Definition voteinfo.c:179
voteinfo_queue_add
void voteinfo_queue_add(int vote_no, const char *user, const char *desc, int percent_required, int flags)
Definition voteinfo.c:123