comparison seobeo/seobeo.h @ 66:a0f0ad5e42eb

[Misc] taking out capital P stuff.
author June Park <parkjune1995@gmail.com>
date Wed, 24 Dec 2025 06:34:19 -0800
parents a30944e5719e
children 4532ce6d9eb8
comparison
equal deleted inserted replaced
65:ecb6ee6a22c3 66:a0f0ad5e42eb
47 47
48 extern volatile sig_atomic_t stop_server; 48 extern volatile sig_atomic_t stop_server;
49 49
50 // --- TCP --- // 50 // --- TCP --- //
51 // --- Generate a Server Handle. ---// 51 // --- Generate a Server Handle. ---//
52 extern Seobeo_PHandle Seobeo_Stream_Handle_Server_Create(const char *host, const char* port); 52 extern Seobeo_Handle *Seobeo_Stream_Handle_Server_Create(const char *host, const char* port);
53 // --- Generate a Client Handle. ---// 53 // --- Generate a Client Handle. ---//
54 extern Seobeo_PHandle Seobeo_Stream_Handle_Client_Create(const char *host, const char* port, boolean use_tls); 54 extern Seobeo_Handle *Seobeo_Stream_Handle_Client_Create(const char *host, const char* port, boolean use_tls);
55 // --- Generate a Client Handle from given Server Handle. ---// 55 // --- Generate a Client Handle from given Server Handle. ---//
56 extern Seobeo_PHandle Seobeo_Stream_Handle_Server_Accept(Seobeo_PHandle p_server_handle); 56 extern Seobeo_Handle *Seobeo_Stream_Handle_Server_Accept(Seobeo_Handle *p_server_handle);
57 57
58 // --- Web --- // 58 // --- Web --- //
59 /* Generate HTTP 1.1 Header value with given content_types and length. */ 59 /* Generate HTTP 1.1 Header value with given content_types and length. */
60 extern void Seobeo_Web_Header_Generate(void *buffer, int status, const char *content_type, const int content_length); 60 extern void Seobeo_Web_Header_Generate(void *buffer, int status, const char *content_type, const int content_length);
61 /* Start a Generic HTTP static file server with given folder. It will store folder into memory. */ 61 /* Start a Generic HTTP static file server with given folder. It will store folder into memory. */
63 /* Generic HTTP GET Rquest to given host and port with path. It will mimic chrome. */ 63 /* Generic HTTP GET Rquest to given host and port with path. It will mimic chrome. */
64 extern int Seobeo_Web_Client_Get(const char *host, const char *port, const char *path); 64 extern int Seobeo_Web_Client_Get(const char *host, const char *port, const char *path);
65 65
66 // --- Helper functions --- // 66 // --- Helper functions --- //
67 /* Destroy handle. It will handle all NULL poointers. */ 67 /* Destroy handle. It will handle all NULL poointers. */
68 extern void Seobeo_Handle_Destroy(Seobeo_PHandle p_handle); 68 extern void Seobeo_Handle_Destroy(Seobeo_Handle *p_handle);
69 /* Write to socket from write_buffer in the handle. */ 69 /* Write to socket from write_buffer in the handle. */
70 extern int Seobeo_Handle_Flush(Seobeo_PHandle p_handle); 70 extern int Seobeo_Handle_Flush(Seobeo_Handle *p_handle);
71 /* Write to socket with given data source, if the data source is bigger than the write buffer for handle then we just directly write from the data source. */ 71 /* Write to socket with given data source, if the data source is bigger than the write buffer for handle then we just directly write from the data source. */
72 extern int Seobeo_Handle_Queue(Seobeo_PHandle p_handle, const uint8_t *data, uint32_t data_size); 72 extern int Seobeo_Handle_Queue(Seobeo_Handle *p_handle, const uint8_t *data, uint32_t data_size);
73 /* Read to socket from read_buffer in the handle. */ 73 /* Read to socket from read_buffer in the handle. */
74 extern int Seobeo_Handle_Read(Seobeo_PHandle p_handle); 74 extern int Seobeo_Handle_Read(Seobeo_Handle *p_handle);
75 /* Move to read_buffer to front and we already consumed the given amount in the handle. */ 75 /* Move to read_buffer to front and we already consumed the given amount in the handle. */
76 extern void Seobeo_Handle_Consume(Seobeo_PHandle p_handle, uint32 consumed); 76 extern void Seobeo_Handle_Consume(Seobeo_Handle *p_handle, uint32 consumed);
77 /* Assign IP4 or IP6 to sockaddr. TODO: Maybe create my own struct for this? */ 77 /* Assign IP4 or IP6 to sockaddr. TODO: Maybe create my own struct for this? */
78 extern void *Seobeo_Get_IP4_Or_IP6(struct sockaddr *sa); 78 extern void *Seobeo_Get_IP4_Or_IP6(struct sockaddr *sa);
79 #endif 79 #endif