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.
 
 
 
 
 
 

57 lines
1.5 KiB

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