This fails if the context type is incomplete.
void (*callback)(void *),
void *context);
#define http_client_request_set_destroy_callback(req, callback, context) \
- http_client_request_set_destroy_callback(req, (void(*)(void*))callback, context - \
+ http_client_request_set_destroy_callback(req, (void(*)(void*))callback, \
+ TRUE ? context : \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))))
/* submits request and blocks until the provided payload is sent. Multiple
#define http_server_request_forward_payload(req, \
output, max_size, callback, context) \
http_server_request_forward_payload(req, output, max_size, \
- (void(*)(void*))callback, context - \
+ (void(*)(void*))callback, TRUE ? context : \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))))
/* Forward the incoming request payload to the provided buffer in the
background. Behaves identical to http_server_request_forward_payload()
#define http_server_request_buffer_payload(req, \
buffer, max_size, callback, context) \
http_server_request_buffer_payload(req, buffer, max_size, \
- (void(*)(void*))callback, context - \
+ (void(*)(void*))callback, TRUE ? context : \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))))
/* Handle the incoming request payload by calling the callback each time
more data is available. Payload reading automatically finishes when the
void (*callback)(void *context), void *context);
#define http_server_request_handle_payload(req, callback, context) \
http_server_request_handle_payload(req,\
- (void(*)(void*))callback, context - \
+ (void(*)(void*))callback, TRUE ? context : \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))))
/* Get the authentication credentials provided in this request. Returns 0 if
void (*callback)(void *),
void *context);
#define http_server_request_set_destroy_callback(req, callback, context) \
- http_server_request_set_destroy_callback(req, (void(*)(void*))callback, context - \
+ http_server_request_set_destroy_callback(req, (void(*)(void*))callback, \
+ TRUE ? context : \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))))
/*
smtp_client_command_callback_t *mail_callback, void *context);
#define smtp_client_transaction_start(trans, mail_callback, context) \
smtp_client_transaction_start(trans, \
- (smtp_client_command_callback_t *)mail_callback, \
- context - CALLBACK_TYPECHECK(mail_callback, void (*)( \
+ (smtp_client_command_callback_t *)mail_callback, TRUE ? context : \
+ CALLBACK_TYPECHECK(mail_callback, void (*)( \
const struct smtp_reply *reply, typeof(context))))
/* Start the transaction with a MAIL command. This function allows providing the
parameters for the MAIL FROM command for when the transaction was created
#define smtp_client_transaction_start_empty(trans, mail_from, mail_params, \
mail_callback, context) \
smtp_client_transaction_start_empty(trans, mail_from, mail_params, \
- (smtp_client_command_callback_t *)mail_callback, \
- context - CALLBACK_TYPECHECK(mail_callback, void (*)( \
+ (smtp_client_command_callback_t *)mail_callback, TRUE ? context : \
+ CALLBACK_TYPECHECK(mail_callback, void (*)( \
const struct smtp_reply *reply, typeof(context))))
/* Add an extra pipelined MAIL command to the transaction. The mail_callback is
#define smtp_client_transaction_reset(trans, reset_callback, reset_context) \
smtp_client_transaction_reset(trans, \
(smtp_client_command_callback_t *)reset_callback, \
- reset_context - CALLBACK_TYPECHECK(reset_callback, void (*)( \
+ TRUE ? reset_context : \
+ CALLBACK_TYPECHECK(reset_callback, void (*)( \
const struct smtp_reply *reply, typeof(reset_context))))
/* Enables mode in which all commands are submitted immediately and (non-
sql_query_callback_t *callback, void *context);
#define sql_statement_query(stmt, callback, context) \
sql_statement_query(stmt, \
- (sql_query_callback_t *)callback, context - \
+ (sql_query_callback_t *)callback, TRUE ? context : \
CALLBACK_TYPECHECK(callback, void (*)( \
struct sql_result *, typeof(context))))
struct sql_result *sql_statement_query_s(struct sql_statement **stmt);
void iostream_proxy_set_completion_callback(struct iostream_proxy *proxy,
iostream_proxy_callback_t *callback, void *context);
#define iostream_proxy_set_completion_callback(proxy, callback, context) \
- iostream_proxy_set_completion_callback(proxy, (iostream_proxy_callback_t *)callback, context - \
+ iostream_proxy_set_completion_callback(proxy, (iostream_proxy_callback_t *)callback, \
+ TRUE ? context : \
CALLBACK_TYPECHECK(callback, void (*)(enum iostream_proxy_side side, enum iostream_proxy_status, typeof(context))))
void iostream_proxy_ref(struct iostream_proxy *proxy);
void *context);
#define iostream_pump_set_completion_callback(pump, callback, context) \
iostream_pump_set_completion_callback(pump, \
- (iostream_pump_callback_t *)callback, \
- context - CALLBACK_TYPECHECK(callback, \
+ (iostream_pump_callback_t *)callback, TRUE ? context : \
+ CALLBACK_TYPECHECK(callback, \
void (*)(enum iostream_pump_status, typeof(context))))
/* Returns TRUE if the pump is currently only writing to the ostream. The input
event_log_prefix_callback_t *callback,
void *context);
#define event_set_log_prefix_callback(event, replace, callback, context) \
- event_set_log_prefix_callback(event, replace, (event_log_prefix_callback_t*)callback, \
- context - CALLBACK_TYPECHECK(callback, const char *(*)(typeof(context))))
+ event_set_log_prefix_callback(event, replace, \
+ (event_log_prefix_callback_t*)callback, TRUE ? context : \
+ CALLBACK_TYPECHECK(callback, const char *(*)(typeof(context))))
/* Sets event message amendment callback */
struct event *event_set_log_message_callback(struct event *event,
void *context);
#define event_set_log_message_callback(event, callback, context) \
event_set_log_message_callback(event, \
- (event_log_message_callback_t*)callback, \
- context - CALLBACK_TYPECHECK(callback, \
+ (event_log_message_callback_t*)callback, TRUE ? context : \
+ CALLBACK_TYPECHECK(callback, \
const char *(*)(typeof(context), enum log_type, \
const char *)))