diff linda.h @ 90:8edae89a3877

compile on Mac OS X
author Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
date Thu, 19 May 2011 16:41:21 +0900
parents ce9ef7dcf2f0
children 0b65ca27f113
line wrap: on
line diff
--- a/linda.h	Thu May 19 16:38:44 2011 +0900
+++ b/linda.h	Thu May 19 16:41:21 2011 +0900
@@ -1,3 +1,8 @@
+#ifndef LINDA_H
+#define LINDA_H
+
+
+//#include "linda/lindaapi.h"
 /*
   +-------+-------+-------+-----------+
   | game  | car   | course| data      |
@@ -12,17 +17,6 @@
        ユーザのIDはLinda_IDで判断する
        linda_seq[i]: ユーザID=i
 */
-#define PKT_MODE_OFFSET      0
-#define PKT_CARID_OFFSET     4
-#define PKT_COURSEID_OFFSET  8
-#define PKT_DATA_OFFSET     12
-
-#define PKT_HEADER_SIZE     12
-
-
-#define CLIENT_MAX 2
-#define LINDA_ASK_ID 65535
-#define LINDA_HOST "firefly.cr.ie.u-ryukyu.ac.jp"
 
 #define MODE_INIT             0
 #define MODE_WAIT             1
@@ -39,23 +33,49 @@
 #define MODE_MAIN_FINISH     12
 #define MODE_FINISH          13
 
-
 #define PLAYER_1P 1
 
-static Bool linda_sche_wait0(int);
-static Bool linda_sche_wait1(int);
-static Bool linda_sche_wait_ready0(int);
-static Bool linda_sche_wait_ready1(int);
-static Bool linda_sche_opening0(int);
-static Bool linda_sche_opening1(int);
-static Bool linda_sche_select_car0(int);
-static Bool linda_sche_select_car1(int);
-static Bool linda_sche_select_course0(int);
-static Bool linda_sche_select_course1(int);
-static Bool linda_sche_ready0(int);
-static Bool linda_sche_ready1(int);
-static Bool linda_sche_main_init(int);
-static Bool linda_sche_main_init(int);
-static Bool linda_sche_main_ready0(int);
-static Bool linda_sche_main_ready1(int);
-static Bool linda_sche_main(int);
+#define CLIENT_MAX 2
+#define LINDA_ASK_ID 65535
+#define LINDA_HOST "firefly.cr.ie.u-ryukyu.ac.jp"
+
+
+#define PKT_MODE_OFFSET      0
+#define PKT_CARID_OFFSET     4
+#define PKT_COURSEID_OFFSET  8
+#define PKT_DATA_OFFSET     12
+
+#define PKT_HEADER_SIZE     12
+#include "game.h"
+//#include "schedule.h"
+#include <stdbool.h>
+
+extern Game *game;
+
+static void linda_set_schedule(void *func, int mode, Game *game);
+static bool linda_sche_wait0(int p, Game *game);
+static bool linda_sche_wait1(int p, Game *game);
+static bool linda_sche_wait_ready0(int p, Game *game);
+static bool linda_sche_wait_ready1(int p, Game *game);
+static bool linda_sche_opening0(int p, Game *game);
+static bool linda_sche_opening1(int p, Game *game);
+static bool linda_sche_select_car0(int p, Game *game);
+static bool linda_sche_select_car1(int p, Game *game);
+static bool linda_sche_select_course0(int p, Game *game);
+static bool linda_sche_select_course1(int p, Game *game);
+static bool linda_sche_ready0(int p, Game *game);
+static bool linda_sche_ready1(int p, Game *game);
+static bool linda_sche_main_init(int p, Game *game);
+//static bool linda_sche_main_init(int p, Game *game);
+static bool linda_sche_main_ready0(int p, Game *game);
+static bool linda_sche_main_ready1(int p, Game *game);
+static bool linda_sche_main(int p, Game *game);
+
+int linda_int(Game *game);
+
+extern void psx_id(unsigned char *);
+extern void psx_linda(unsigned char *);
+extern void psx_sync(unsigned char *);
+//unsigned char psx_reply(int seq);
+
+#endif