… | |
… | |
46 | |
46 | |
47 | //+GPL |
47 | //+GPL |
48 | |
48 | |
49 | #include <cstdarg> |
49 | #include <cstdarg> |
50 | |
50 | |
51 | #include "compiler.h" |
51 | #include "ecb.h" |
52 | |
52 | |
53 | /* Maximum size of any packet we expect. |
53 | /* Maximum size of any packet we expect. |
54 | * |
54 | * |
55 | * The size must be the same in the server and the client (stupid). |
55 | * The size must be the same in the server and the client (stupid). |
56 | * TODO: make the actual network configurable per client and use 2**16. |
56 | * TODO: make the actual network configurable per client and use 2**16. |
… | |
… | |
270 | packet &operator <<(shstr_tmp sh) { return *this << data_n (sh); } |
270 | packet &operator <<(shstr_tmp sh) { return *this << data_n (sh); } |
271 | packet &operator <<(const std::string &s) { return *this << data_n (s.data (), s.size ()); } |
271 | packet &operator <<(const std::string &s) { return *this << data_n (s.data (), s.size ()); } |
272 | |
272 | |
273 | void vprintf (const char *format, va_list ap); |
273 | void vprintf (const char *format, va_list ap); |
274 | |
274 | |
275 | void printf (const char *format, ...) attribute ((format (printf, 2, 3))) |
275 | void printf (const char *format, ...) ecb_attribute ((format (printf, 2, 3))) |
276 | { |
276 | { |
277 | va_list ap; |
277 | va_list ap; |
278 | va_start (ap, format); |
278 | va_start (ap, format); |
279 | vprintf (format, ap); |
279 | vprintf (format, ap); |
280 | va_end (ap); |
280 | va_end (ap); |