|
Crossfire Client, Trunk
R18666
|
#include <stdio.h>#include <stdarg.h>#include <errno.h>#include <client.h>#include <shared/newclient.h>#include <script.h>
Go to the source code of this file.
Defines | |
| #define | llevDebug LOG_DEBUG |
| #define | llevError LOG_ERROR |
Functions | |
| void | SockList_Init (SockList *sl, uint8 *buf) |
| void | SockList_AddChar (SockList *sl, char c) |
| void | SockList_AddShort (SockList *sl, uint16 data) |
| void | SockList_AddInt (SockList *sl, uint32 data) |
| void | SockList_AddString (SockList *sl, const char *str) |
| int | SockList_Send (SockList *sl, int fd) |
| char | GetChar_String (const unsigned char *data) |
| int | GetInt_String (const unsigned char *data) |
| sint64 | GetInt64_String (const unsigned char *data) |
| short | GetShort_String (const unsigned char *data) |
| int | SockList_ReadPacket (int fd, SockList *sl, int len) |
| int | cs_print_string (int fd, const char *str,...) |
Variables | |
| const char *const | rcsid_common_newsocket_c = "$Id: newsocket.c 13947 2010-10-01 02:24:23Z kbulgrien $" |
Made this either client or server specific for 0.95.2 release - getting too complicated to keep them the same, and the common code is pretty much frozen now.
Definition in file newsocket.c.
Definition at line 53 of file newsocket.c.
Definition at line 54 of file newsocket.c.
| int cs_print_string | ( | int | fd, |
| const char * | str, | ||
| ... | |||
| ) |
Send a printf-formatted packet to the socket.
| fd | The socket to send to. |
| str | The printf format string. |
| ... | An optional list of values to fulfill the format string. |
Definition at line 330 of file newsocket.c.


| char GetChar_String | ( | const unsigned char * | data | ) |
| data |
Definition at line 173 of file newsocket.c.

| sint64 GetInt64_String | ( | const unsigned char * | data | ) |
The reverse of SockList_AddInt, but on strings instead. Same for the GetShort, but for 64 bits
| data |
Definition at line 197 of file newsocket.c.

| int GetInt_String | ( | const unsigned char * | data | ) |
The reverse of SockList_AddInt, but on strings instead. Same for the GetShort, but for 16 bits.
| data |
Definition at line 185 of file newsocket.c.

| short GetShort_String | ( | const unsigned char * | data | ) |
| data |
Definition at line 215 of file newsocket.c.

| void SockList_AddChar | ( | SockList * | sl, |
| char | c | ||
| ) |
| sl | |
| c |
Definition at line 110 of file newsocket.c.

| void SockList_AddInt | ( | SockList * | sl, |
| uint32 | data | ||
| ) |
| sl | |
| data |
Definition at line 131 of file newsocket.c.

| void SockList_AddShort | ( | SockList * | sl, |
| uint16 | data | ||
| ) |
| sl | |
| data |
Definition at line 120 of file newsocket.c.

| void SockList_AddString | ( | SockList * | sl, |
| const char * | str | ||
| ) |
| sl | |
| str |
Definition at line 144 of file newsocket.c.

| void SockList_Init | ( | SockList * | sl, |
| uint8 * | buf | ||
| ) |
| sl | |
| buf |
Definition at line 99 of file newsocket.c.

| int SockList_ReadPacket | ( | int | fd, |
| SockList * | sl, | ||
| int | len | ||
| ) |
Reads from the socket and puts data into a socklist. The only processing done is to remove the initial size value. An assumption made is that the buffer is at least 2 bytes long.
| fd | Socket to read from. |
| sl | Pointer to a buffer to put the read data. |
| len | Size of the buffer allocated to accept data. |
Definition at line 230 of file newsocket.c.


| int SockList_Send | ( | SockList * | sl, |
| int | fd | ||
| ) |
Send data from a socklist to the socket.
| sl | |
| fd |
Definition at line 160 of file newsocket.c.

| const char* const rcsid_common_newsocket_c = "$Id: newsocket.c 13947 2010-10-01 02:24:23Z kbulgrien $" |
Definition at line 1 of file newsocket.c.
1.7.6.1