1
0

jnetlib_defines.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #include "../foundation/types.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /* Connection */
  7. typedef struct jnl_connection_struct jnl_connection_struct;
  8. typedef jnl_connection_struct *jnl_connection_t;
  9. enum
  10. {
  11. JNL_CONNECTION_STATE_ERROR = 0,
  12. JNL_CONNECTION_STATE_NOCONNECTION = 1,
  13. JNL_CONNECTION_STATE_RESOLVING = 2,
  14. JNL_CONNECTION_STATE_CONNECTING = 3,
  15. JNL_CONNECTION_STATE_CONNECTED = 4,
  16. JNL_CONNECTION_STATE_CLOSING = 5,
  17. JNL_CONNECTION_STATE_CLOSED = 6,
  18. JNL_CONNECTION_STATE_RESOLVED = 7, // happens after RESOLVING, but going here for compatability
  19. };
  20. /* UDP */
  21. typedef struct jnl_udp_struct jnl_udp_struct;
  22. typedef jnl_udp_struct *jnl_udp_t;
  23. /* HTTP */
  24. typedef struct jnl_http_struct jnl_http_struct;
  25. typedef jnl_http_struct *jnl_http_t;
  26. enum
  27. {
  28. HTTPGET_STATUS_ERROR = -1,
  29. JNL_HTTP_STATUS_ERROR = HTTPGET_STATUS_ERROR,
  30. HTTPGET_STATUS_CONNECTING = 0,
  31. JNL_HTTP_STATUS_CONNECTING = HTTPGET_STATUS_CONNECTING,
  32. HTTPGET_STATUS_READING_HEADERS = 1,
  33. JNL_HTTP_STATUS_READING_HEADERS = HTTPGET_STATUS_READING_HEADERS,
  34. HTTPGET_STATUS_READING_CONTENT = 2,
  35. JNL_HTTP_STATUS_READING_CONTENT = HTTPGET_STATUS_READING_CONTENT,
  36. };
  37. enum
  38. {
  39. HTTPGET_RUN_ERROR = -1,
  40. HTTPGET_RUN_OK = 0,
  41. JNL_HTTP_RUN_OK = HTTPGET_RUN_OK,
  42. HTTPGET_RUN_CONNECTION_CLOSED = 1,
  43. };
  44. /* DNS */
  45. typedef struct jnl_dns_struct jnl_dns_struct;
  46. typedef jnl_dns_struct *jnl_dns_t;
  47. typedef struct jnl_httpu_request_struct jnl_httpu_request_struct;
  48. typedef jnl_httpu_request_struct *jnl_httpu_request_t;
  49. typedef struct jnl_http_request_struct jnl_http_request_struct;
  50. typedef jnl_http_request_struct *jnl_http_request_t;
  51. typedef struct jnl_listen_struct jnl_listen_struct;
  52. typedef jnl_listen_struct *jnl_listen_t;
  53. #ifdef __cplusplus
  54. }
  55. #endif