simpler socket api. Now the blocking of functions and error codes aren't function parameters but attributes of the socket object with their respective getters and setters

This commit is contained in:
cozis
2023-11-01 21:33:49 +01:00
parent e6dbeafcd7
commit c3f4a52b6d
6 changed files with 322 additions and 304 deletions
+1 -4
View File
@@ -58,9 +58,7 @@ typedef struct {
typedef void (*xh_callback)(xh_request*, xh_response*, void*);
const char *xhttp(unsigned short port, xh_callback callback,
void *userp, xh_handle *handle,
microhttp_config_t config);
const char *xhttp(unsigned short port, xh_callback callback, xh_handle *handle);
void xh_quit(xh_handle handle);
void xh_header_add(xh_response *res, const char *name, const char *valfmt, ...);
@@ -71,7 +69,6 @@ _Bool xh_header_cmp(const char *a, const char *b);
int xh_urlcmp(const char *URL, const char *fmt, ...);
int xh_vurlcmp(const char *URL, const char *fmt, va_list va);
#define xh_string_new(s, l) \
((xh_string) { (s), ((int) (l)) < 0 ? (int) strlen(s) : (int) (l) })