Mercurial > hg > Members > kono > Cerium
comparison Renderer/Engine/lindaapi.h @ 606:32a7260fad2f
32bit/64bit ABI (64 bit is not tested yet).
64bit ABI requires 64bit SDL library etc.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 07 Nov 2009 18:05:52 +0900 |
parents | 42c94f85c779 |
children | 0decff4e867b |
comparison
equal
deleted
inserted
replaced
605:90c61fe2b109 | 606:32a7260fad2f |
---|---|
1 #ifndef _LINDAAPI_H | 1 #ifndef _LINDAAPI_H |
2 | 2 |
3 #define _LINDAAPI_H 1 | 3 #define _LINDAAPI_H 1 |
4 | |
5 #include "types.h" | |
4 | 6 |
5 #ifdef __cplusplus | 7 #ifdef __cplusplus |
6 extern "C" { | 8 extern "C" { |
7 #endif | 9 #endif |
8 | 10 |
22 | 24 |
23 #define LDSERV_PORT 11511 | 25 #define LDSERV_PORT 11511 |
24 | 26 |
25 /*---------------------------------------------------------------------- | 27 /*---------------------------------------------------------------------- |
26 パケットフォーマット | 28 パケットフォーマット |
27 char short 8byte int | 29 char short int int |
28 Mode + ID + Seq + Data_len + Padding + Data | 30 Mode + ID + Seq + Data_len + Padding + Data |
29 0 1 3 7 11 12 | 31 0 1 3 7 11 12 |
30 ----------------------------------------------------------------------*/ | 32 ----------------------------------------------------------------------*/ |
31 | 33 |
32 #define LINDA_MODE_OFFSET 0 | 34 #define LINDA_MODE_OFFSET 0 |
33 #define LINDA_ID_OFFSET 1 | 35 #define LINDA_ID_OFFSET 1 |
34 #define LINDA_SEQ_OFFSET 3 | 36 #define LINDA_SEQ_OFFSET 3 |
43 unsigned int seq; | 45 unsigned int seq; |
44 struct psx_reply *next; | 46 struct psx_reply *next; |
45 char mode; | 47 char mode; |
46 void(*callback)(unsigned char * tuple, void * obj); | 48 void(*callback)(unsigned char * tuple, void * obj); |
47 void * obj; | 49 void * obj; |
48 } REPLY, Reply, *ReplyPtr; | 50 } REPLY; |
49 | 51 |
50 typedef struct command_queue{ | 52 typedef struct command_queue{ |
51 struct command_queue *next; | 53 struct command_queue *next; |
52 unsigned int tspace_id; /* ID of destination Tuple Space */ | 54 unsigned int tspace_id; /* ID of destination Tuple Space */ |
53 unsigned int size; | 55 unsigned int size; |
73 extern unsigned int psx_get_seq(unsigned char *); | 75 extern unsigned int psx_get_seq(unsigned char *); |
74 extern unsigned short psx_get_id(unsigned char *); | 76 extern unsigned short psx_get_id(unsigned char *); |
75 extern unsigned char psx_get_mode(unsigned char *); | 77 extern unsigned char psx_get_mode(unsigned char *); |
76 extern unsigned char * psx_get_data(unsigned char *); | 78 extern unsigned char * psx_get_data(unsigned char *); |
77 | 79 |
78 extern int psx_out(unsigned int tspace_id, unsigned int id, | 80 extern long psx_out(unsigned int tspace_id, unsigned int id, |
79 unsigned char *data, unsigned int size); | 81 unsigned char *data, unsigned int size); |
80 extern int psx_ld(unsigned int tspace_id, unsigned int id, | 82 extern long psx_ld(unsigned int tspace_id, unsigned int id, |
81 char mode, void(*callback)(unsigned char *,void *),void * obj); | 83 char mode, void(*callback)(unsigned char *,void *),void * obj); |
82 | 84 |
83 #define psx_in(tid, id) psx_ld(tid, id, 'i', NULL, NULL) | 85 #define psx_in(tid, id) psx_ld(tid, id, 'i', NULL, NULL) |
84 #define psx_rd(tid, id) psx_ld(tid, id, 'r', NULL, NULL) | 86 #define psx_rd(tid, id) psx_ld(tid, id, 'r', NULL, NULL) |
85 #define psx_ck(tid, id) psx_ld(tid, id, 'c', NULL, NULL) | 87 #define psx_ck(tid, id) psx_ld(tid, id, 'c', NULL, NULL) |