Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / apps / openchess / src / main.c
blob24fbcc7b3e15f10f9e732eb967dcb3eabfff0ea1
1 /*
2 * ZeX/OS
3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "config.h"
20 #include "net.h"
21 #include "game.h"
22 #include "client.h"
24 #include <stdio.h>
25 #include <string.h>
26 #include <stdlib.h>
27 #include <unistd.h>
28 #include <sys/socket.h>
30 /** INIT function */
31 int init ()
33 if (!init_game ())
34 return 0;
36 if (!init_client ())
37 return 0;
39 if (!init_net ())
40 return 0;
42 return 1;
45 /** MAIN LOOP */
46 int loop ()
48 return net_loop ();
51 /** MAIN Function */
52 int main (int argc, char **argv)
54 printf ("OpenChess - game server\n");
56 if (!init ())
57 return 0;
59 while (1) {
60 if (loop () == -1)
61 break;
62 #ifdef __zexos__
63 schedule ();
64 #endif
67 printf ("-> exit\n");
69 return 1;