src/main.c

changeset 197
9cbd4f09a22f
parent 195
27d02ccb0cef
child 199
3d4d361ebb80
equal deleted inserted replaced
196:168a38ae1b2d 197:9cbd4f09a22f
40 #include <sys/stat.h> 40 #include <sys/stat.h>
41 #include <signal.h> 41 #include <signal.h>
42 #include <errno.h> 42 #include <errno.h>
43 #include <unistd.h> 43 #include <unistd.h>
44 #include <getopt.h> 44 #include <getopt.h>
45 #include <curses.h>
45 46
46 typedef struct { 47 typedef struct {
47 /** 48 /**
48 * Server host address. 49 * Server host address.
49 * TCP: server address or \c NULL when we are the server 50 * TCP: server address or \c NULL when we are the server
68 69
69 static void init_settings(void) { 70 static void init_settings(void) {
70 memset(&settings, 0, sizeof(settings)); 71 memset(&settings, 0, sizeof(settings));
71 settings.servercolor = WHITE; 72 settings.servercolor = WHITE;
72 settings.port = 27015; 73 settings.port = 27015;
74 #ifndef DISABLE_UNICODE
73 settings.unicode = !!setlocale(LC_CTYPE, "C.UTF-8"); 75 settings.unicode = !!setlocale(LC_CTYPE, "C.UTF-8");
76 #endif
74 } 77 }
75 78
76 static void cleanup() { 79 static void cleanup() {
77 endwin(); 80 endwin();
78 if (settings.usedomainsocket && settings.ishost) { 81 if (settings.usedomainsocket && settings.ishost) {
182 "\nGeneral options\n" 185 "\nGeneral options\n"
183 " -c <PGN file> Continue the specified game\n" 186 " -c <PGN file> Continue the specified game\n"
184 " -h This help page\n" 187 " -h This help page\n"
185 " -p TCP port to use (default: 27015)\n" 188 " -p TCP port to use (default: 27015)\n"
186 " -u Use Unix domain socket instead of TCP\n" 189 " -u Use Unix domain socket instead of TCP\n"
190 #ifndef DISABLE_UNICODE
187 " -U Disables unicode pieces\n" 191 " -U Disables unicode pieces\n"
192 #endif
188 " -v Print version information and exits\n" 193 " -v Print version information and exits\n"
189 "\nTime control (default: disabled)\n" 194 "\nTime control (default: disabled)\n"
190 " -t <time> Time limit in minutes (or seconds when used with 's' suffix)\n" 195 " -t <time> Time limit in minutes (or seconds when used with 's' suffix)\n"
191 " -a <time> The time in seconds to add after each move\n" 196 " -a <time> The time in seconds to add after each move\n"
192 " -d <time> A delay in seconds before the clock starts ticking each move\n" 197 " -d <time> A delay in seconds before the clock starts ticking each move\n"

mercurial