This code is not complete yet, so don't worry about it. It is, however, a good example of how to do a complex command.
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include "bitmap.h"
#include "effect.h"
#include "lib.h"
#include "rve.h"
Defines | |
| #define | MAXCHOICES 5 |
| #define | BARR 255 |
| #define | BARG 255 |
| #define | BARB 255 |
| #define | VALPHA -64 |
| #define | HALPHA -192 |
Functions | |
| int | init_vote_old () |
| int | lookup_choice_old (const char *name) |
| char * | symlink_target_old (const char *path) |
| int | count_votes_old (int curvotes[]) |
| int | init_vote (int argc, char *argv[]) |
| void | paint_bar (Bitmap &bitmap, Bitmap *source) |
| void | init_screen (Bitmap *source) |
| int | count_votes (int curvotes[], const char *line) |
| void | update_bars (int votes[]) |
| int | cmd_vote (int argc, char *argv[]) |
| | |
Variables | |
| int | voteheight |
| int | barwidth |
| int | textypos |
| int | barheight |
| int | barypos |
| int | nchoices = 0 |
| char | choices [MAXCHOICES][NAME_MAX+1] |
|
||||||||||||
|
Visualizes a voting between 2 or more choices. The names of those choices are given as arguments to the vote command, and the scores are updated by feeding in numbers on stdin, like "3 2 5\n" for a voting with 3 choices. |
1.3.3