2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.5 KiB

  1. #ifndef IZ_WSSERVER_H
  2. #define IZ_WSSERVER_H
  3. #include <sys/stat.h>
  4. #include "libwebsockets.h"
  5. #include <string.h>
  6. #include "../../IZ_common.h"
  7. #include "../../IZ_config.h"
  8. #include "../core/IZ_websocket.h"
  9. #ifndef S_ISDIR
  10. #define S_ISDIR(s) s & S_IFDIR
  11. #endif
  12. /* one of these is created for each client connecting to us */
  13. typedef struct IZ_WSServerSessionData {
  14. struct IZ_WSServerSessionData* pss_list;
  15. struct lws* wsi;
  16. u32 tail;
  17. u8 culled: 1;
  18. } IZ_WSServerSessionData;
  19. /* one of these is created for each vhost our protocol is used with */
  20. typedef struct {
  21. struct lws_context* context;
  22. struct lws_vhost* vhost;
  23. const struct lws_protocols* protocol;
  24. IZ_WSServerSessionData* pss_list; /* linked-list of live pss*/
  25. struct lws_ring* ring; /* ringbuffer holding unsent messages */
  26. u16* port;
  27. const void* app;
  28. } IZ_WSServerVHostData;
  29. typedef struct {
  30. u16 port;
  31. } IZ_WSServerInitializeParams;
  32. IZ_ProcedureResult IZ_WSServerInitialize(IZ_Websocket*, IZ_WSServerInitializeParams);
  33. IZ_ProcedureResult IZ_WSServerHandle(IZ_Websocket*);
  34. void IZ_WSServerTeardown(IZ_Websocket*);
  35. void IZ_WSServerCancelService(IZ_Websocket*);
  36. IZ_ProcedureResult IZ_WSServerProtocolInitialize(struct lws*, void*);
  37. void IZ_WSServerProtocolTeardown(struct lws*);
  38. IZ_ProcedureResult IZ_WSServerWritable(struct lws*, IZ_WSServerSessionData*);
  39. IZ_ProcedureResult IZ_WSServerOnReceive(struct lws*, void*, size_t);
  40. void IZ_WSServerOnOpen(struct lws*, IZ_WSServerSessionData*);
  41. void IZ_WSServerOnClose(struct lws*, IZ_WSServerSessionData*);
  42. #endif