equal
deleted
inserted
replaced
8 #include "../../helpers.hpp" |
8 #include "../../helpers.hpp" |
9 |
9 |
10 #include "packet.h" |
10 #include "packet.h" |
11 |
11 |
12 /** |
12 /** |
13 * @file packet.h Basic functions to create, fill and read packets. |
13 * @file packet.cpp Basic functions to create, fill and read packets. |
14 */ |
14 */ |
15 |
15 |
16 |
16 |
17 /* Do not want to include functions.h and all required headers */ |
17 /* Do not want to include functions.h and all required headers */ |
18 extern void NORETURN CDECL error(const char *str, ...); |
18 extern void NORETURN CDECL error(const char *str, ...); |
92 } |
92 } |
93 |
93 |
94 /** |
94 /** |
95 * Sends a string over the network. It sends out |
95 * Sends a string over the network. It sends out |
96 * the string + '\0'. No size-byte or something. |
96 * the string + '\0'. No size-byte or something. |
|
97 * @param packet packet to send the string in |
|
98 * @param data the string to send |
97 */ |
99 */ |
98 void NetworkSend_string(Packet *packet, const char* data) |
100 void NetworkSend_string(Packet *packet, const char* data) |
99 { |
101 { |
100 assert(data != NULL); |
102 assert(data != NULL); |
101 assert(packet->size < sizeof(packet->buffer) - strlen(data) - 1); |
103 assert(packet->size < sizeof(packet->buffer) - strlen(data) - 1); |