1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcsid_sockets_c = |
3 | * static char *rcsid_sockets_c = |
4 | * "$Id: lowlevel.C,v 1.1 2006/08/13 17:16:06 elmex Exp $"; |
4 | * "$Id: lowlevel.C,v 1.2 2006/08/18 02:06:58 root Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
93 | void SockList_Init(SockList *sl) |
93 | void SockList_Init(SockList *sl) |
94 | { |
94 | { |
95 | sl->len=0; |
95 | sl->len=0; |
96 | sl->buf=NULL; |
96 | sl->buf=NULL; |
97 | } |
97 | } |
98 | |
|
|
99 | void SockList_AddChar(SockList *sl, char c) |
|
|
100 | { |
|
|
101 | sl->buf[sl->len]=c; |
|
|
102 | sl->len++; |
|
|
103 | } |
|
|
104 | |
|
|
105 | void SockList_AddShort(SockList *sl, uint16 data) |
|
|
106 | { |
|
|
107 | sl->buf[sl->len++]= (data>>8)&0xff; |
|
|
108 | sl->buf[sl->len++] = data & 0xff; |
|
|
109 | } |
|
|
110 | |
|
|
111 | |
98 | |
112 | void SockList_AddInt(SockList *sl, uint32 data) |
99 | void SockList_AddInt(SockList *sl, uint32 data) |
113 | { |
100 | { |
114 | sl->buf[sl->len++]= (data>>24)&0xff; |
101 | sl->buf[sl->len++]= (data>>24)&0xff; |
115 | sl->buf[sl->len++]= (data>>16)&0xff; |
102 | sl->buf[sl->len++]= (data>>16)&0xff; |