2018-07-06 14:11:38 +00:00
|
|
|
#ifndef ENGINE_SHARED_WEBSOCKETS_H
|
|
|
|
#define ENGINE_SHARED_WEBSOCKETS_H
|
2015-02-07 22:15:58 +00:00
|
|
|
|
2020-09-15 12:54:33 +00:00
|
|
|
#if defined(CONF_FAMILY_UNIX)
|
|
|
|
#elif defined(CONF_FAMILY_WINDOWS)
|
|
|
|
#include <winsock2.h>
|
2015-02-07 22:15:58 +00:00
|
|
|
#endif
|
|
|
|
|
Make sure headers compile standalone
Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.
$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done
Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
2020-09-26 08:23:33 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2015-02-07 22:15:58 +00:00
|
|
|
int websocket_create(const char *addr, int port);
|
|
|
|
int websocket_destroy(int socket);
|
|
|
|
int websocket_recv(int socket, unsigned char *data, size_t maxsize, struct sockaddr_in *sockaddrbuf, size_t fromLen);
|
2020-09-12 15:12:00 +00:00
|
|
|
int websocket_send(int socket, const unsigned char *data, size_t size,
|
|
|
|
const char *addr_str, int port);
|
2015-02-07 22:15:58 +00:00
|
|
|
int websocket_fd_set(int socket, fd_set *set);
|
|
|
|
|
2018-07-06 14:11:38 +00:00
|
|
|
#endif // ENGINE_SHARED_WEBSOCKETS_H
|