void db_oauth2_lookup(struct db_oauth2 *db, struct db_oauth2_request *req, const char *token, struct auth_request *request, db_oauth2_lookup_callback_t *callback, void *context);
#define db_oauth2_lookup(db, req, token, request, callback, context) \
- db_oauth2_lookup(db, req, token + \
+ db_oauth2_lookup(db, req, token - \
CALLBACK_TYPECHECK(callback, void(*)(struct db_oauth2_request *, enum passdb_result, const char*, typeof(context))), \
request, (db_oauth2_lookup_callback_t*)callback, (void*)context)
imap_fetch_handler_t *handler, void *context)
ATTR_NULL(3, 5);
#define imap_fetch_add_handler(ctx, flags, nil_reply, handler, context) \
- imap_fetch_add_handler(ctx, flags, nil_reply + \
+ imap_fetch_add_handler(ctx, flags, nil_reply - \
CALLBACK_TYPECHECK(handler, int (*)( \
struct imap_fetch_context *, struct mail *, \
typeof(context))), \
dns_lookup_callback_t *callback, void *context,
struct dns_lookup **lookup_r) ATTR_NULL(4);
#define dns_lookup(host, set, callback, context, lookup_r) \
- dns_lookup(host + \
+ dns_lookup(host - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct dns_lookup_result *, typeof(context))), \
set, (dns_lookup_callback_t *)callback, context, lookup_r)
dns_lookup_callback_t *callback, void *context,
struct dns_lookup **lookup_r) ATTR_NULL(4);
#define dns_lookup_ptr(host, set, callback, context, lookup_r) \
- dns_lookup_ptr(host + \
+ dns_lookup_ptr(host - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct dns_lookup_result *, typeof(context))), \
set, (dns_lookup_callback_t *)callback, context, lookup_r)
dns_lookup_callback_t *callback, void *context,
struct dns_lookup **lookup_r) ATTR_NULL(4);
#define dns_client_lookup(client, host, callback, context, lookup_r) \
- dns_client_lookup(client, host + \
+ dns_client_lookup(client, host - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct dns_lookup_result *, typeof(context))), \
(dns_lookup_callback_t *)callback, context, lookup_r)
dns_lookup_callback_t *callback, void *context,
struct dns_lookup **lookup_r) ATTR_NULL(4);
#define dns_client_lookup_ptr(client, host, callback, context, lookup_r) \
- dns_client_lookup_ptr(client, host + \
+ dns_client_lookup_ptr(client, host - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct dns_lookup_result *, typeof(context))), \
(dns_lookup_callback_t *)callback, context, lookup_r)
const char *method, const char *host, const char *target,
http_client_request_callback_t *callback, void *context);
#define http_client_request(client, method, host, target, callback, context) \
- http_client_request(client, method, host, target + \
+ http_client_request(client, method, host, target - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct http_response *response, typeof(context))), \
(http_client_request_callback_t *)callback, context)
const char *method, const struct http_url *target_url,
http_client_request_callback_t *callback, void *context);
#define http_client_request_url(client, method, target_url, callback, context) \
- http_client_request_url(client, method, target_url + \
+ http_client_request_url(client, method, target_url - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct http_response *response, typeof(context))), \
(http_client_request_callback_t *)callback, context)
const char *method, const char *url_str,
http_client_request_callback_t *callback, void *context);
#define http_client_request_url_str(client, method, url_str, callback, context) \
- http_client_request_url_str(client, method, url_str + \
+ http_client_request_url_str(client, method, url_str - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct http_response *response, typeof(context))), \
(http_client_request_callback_t *)callback, context)
http_client_request_callback_t *callback,
void *context);
#define http_client_request_connect(client, host, port, callback, context) \
- http_client_request_connect(client, host, port + \
+ http_client_request_connect(client, host, port - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct http_response *response, typeof(context))), \
(http_client_request_callback_t *)callback, context)
http_client_request_callback_t *callback,
void *context);
#define http_client_request_connect_ip(client, ip, port, callback, context) \
- http_client_request_connect_ip(client, ip, port + \
+ http_client_request_connect_ip(client, ip, port - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct http_response *response, typeof(context))), \
(http_client_request_callback_t *)callback, context)
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, 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, 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, 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, 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, context - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))))
/*
ldap_result_callback_t *callback,
void *context);
#define ldap_search_start(client, input, callback, context) \
- ldap_search_start(client, input + \
+ ldap_search_start(client, input - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct ldap_result *, typeof(context))), \
(ldap_result_callback_t *)callback, context)
const struct ldap_compare_input *input,
ldap_result_callback_t *callback, void *context);
#define ldap_compare_start(client, input, callback, context) \
- ldap_compare_start(client, input + \
+ ldap_compare_start(client, input - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct ldap_result *, typeof(context))), \
(ldap_result_callback_t *)callback, context)
ATTR_NULL(6);
#define i_stream_create_header_filter(input, flags, headers, headers_count, \
callback, context) \
- i_stream_create_header_filter(input, flags, headers, headers_count + \
+ i_stream_create_header_filter(input, flags, headers, headers_count - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct header_filter_istream *, \
struct message_header_line *, bool *, typeof(context))), \
message_header_callback_t *callback, void *context)
ATTR_NULL(2);
#define message_parse_header(input, hdr_size, flags, callback, context) \
- message_parse_header(input, hdr_size, flags + \
+ message_parse_header(input, hdr_size, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct message_header_line *hdr, typeof(context))), \
(message_header_callback_t *)callback, context)
message_part_header_callback_t *callback,
void *context) ATTR_NULL(4);
#define message_parser_parse_header(ctx, hdr_size, callback, context) \
- message_parser_parse_header(ctx, hdr_size + \
+ message_parser_parse_header(ctx, hdr_size - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct message_part *, \
struct message_header_line *, typeof(context))), \
#define message_parser_parse_body(ctx, callback, context) \
message_parser_parse_body(ctx, \
(message_part_header_callback_t *)callback, \
- (void *)((uintptr_t)context + CALLBACK_TYPECHECK(callback, \
+ (void *)((uintptr_t)context - CALLBACK_TYPECHECK(callback, \
void (*)(struct message_part *, \
struct message_header_line *, typeof(context)))))
oauth2_request_callback_t *callback,
void *context);
#define oauth2_passwd_grant_start(set, input, username, password, callback, context) \
- oauth2_passwd_grant_start(set, input + \
+ oauth2_passwd_grant_start(set, input - \
CALLBACK_TYPECHECK(callback, void(*)(struct oauth2_request_result*, typeof(context))), \
username, password, \
(oauth2_request_callback_t*)callback, (void*)context);
oauth2_request_callback_t *callback,
void *context);
#define oauth2_token_validation_start(set, input, callback, context) \
- oauth2_token_validation_start(set, input + \
+ oauth2_token_validation_start(set, input - \
CALLBACK_TYPECHECK(callback, void(*)(struct oauth2_request_result*, typeof(context))), \
(oauth2_request_callback_t*)callback, (void*)context);
oauth2_request_callback_t *callback,
void *context);
#define oauth2_introspection_start(set, input, callback, context) \
- oauth2_introspection_start(set, input + \
+ oauth2_introspection_start(set, input - \
CALLBACK_TYPECHECK(callback, void(*)(struct oauth2_request_result*, typeof(context))), \
(oauth2_request_callback_t*)callback, (void*)context);
oauth2_request_callback_t *callback,
void *context);
#define oauth2_refresh_start(set, input, callback, context) \
- oauth2_refresh_start(set, input + \
+ oauth2_refresh_start(set, input - \
CALLBACK_TYPECHECK(callback, void(*)(struct oauth2_request_result*, typeof(context))), \
(oauth2_request_callback_t*)callback, (void*)context);
void program_client_set_extra_fd(struct program_client *pclient, int fd,
program_client_fd_callback_t * callback, void *context);
#define program_client_set_extra_fd(pclient, fd, callback, context) \
- program_client_set_extra_fd(pclient, fd + \
+ program_client_set_extra_fd(pclient, fd - \
CALLBACK_TYPECHECK(callback, \
void (*)(typeof(context), struct istream *input)), \
(program_client_fd_callback_t *)callback, context)
program_client_callback_t *, void*);
#define program_client_run_async(pclient, callback, context) \
program_client_run_async(pclient, (program_client_callback_t*)callback, \
- (char*)context + CALLBACK_TYPECHECK(callback, \
+ (char*)context - CALLBACK_TYPECHECK(callback, \
void (*)(int, typeof(context))))
#endif
const char **error_r)
ATTR_NULL(2, 4, 5);
#define settings_read(path, section, callback, sect_callback, context, error_r) \
- settings_read_i(path + \
+ settings_read_i(path - \
CALLBACK_TYPECHECK(callback, const char *(*)( \
- const char *, const char *, typeof(context))) + \
+ const char *, const char *, typeof(context))) - \
CALLBACK_TYPECHECK(sect_callback, bool (*)( \
const char *, const char *, typeof(context), \
const char **)), \
section, (settings_callback_t *)callback, \
(settings_section_callback_t *)sect_callback, context, error_r)
#define settings_read_nosection(path, callback, context, error_r) \
- settings_read_i(path + \
+ settings_read_i(path - \
CALLBACK_TYPECHECK(callback, const char *(*)( \
const char *, const char *, typeof(context))), \
NULL, (settings_callback_t *)callback, NULL, context, error_r)
enum smtp_client_command_flags flags,
smtp_client_command_callback_t *callback, void *context);
#define smtp_client_command_new(conn, flags, callback, context) \
- smtp_client_command_new(conn, flags + \
+ smtp_client_command_new(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
(smtp_client_command_callback_t *)callback, context)
void *context);
#define smtp_client_command_noop_submit_after(conn, \
flags, after, callback, context) \
- smtp_client_command_noop_submit_after(conn, flags + \
+ smtp_client_command_noop_submit_after(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), after, \
(smtp_client_command_callback_t *)callback, context)
void *context);
#define smtp_client_command_noop_submit(conn, \
flags, callback, context) \
- smtp_client_command_noop_submit(conn, flags + \
+ smtp_client_command_noop_submit(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
(smtp_client_command_callback_t *)callback, context)
void *context);
#define smtp_client_command_vrfy_submit_after(conn, \
flags, after, param, callback, context) \
- smtp_client_command_vrfy_submit_after(conn, flags + \
+ smtp_client_command_vrfy_submit_after(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
after, param, \
void *context);
#define smtp_client_command_vrfy_submit(conn, \
flags, param, callback, context) \
- smtp_client_command_vrfy_submit(conn, flags + \
+ smtp_client_command_vrfy_submit(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
param, (smtp_client_command_callback_t *)callback, context)
void *context);
#define smtp_client_command_rset_submit_after(conn, \
flags, after, callback, context) \
- smtp_client_command_rset_submit_after(conn, flags + \
+ smtp_client_command_rset_submit_after(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
after, (smtp_client_command_callback_t *)callback, context)
void *context);
#define smtp_client_command_rset_submit(conn, \
flags, callback, context) \
- smtp_client_command_rset_submit(conn, flags + \
+ smtp_client_command_rset_submit(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
(smtp_client_command_callback_t *)callback, context)
void *context);
#define smtp_client_command_mail_submit(conn, \
flags, address, params, callback, context) \
- smtp_client_command_mail_submit(conn, flags + \
+ smtp_client_command_mail_submit(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
address, params, \
void *context);
#define smtp_client_command_rcpt_submit_after(conn, \
flags, after, to, params, callback, context) \
- smtp_client_command_rcpt_submit_after(conn, flags + \
+ smtp_client_command_rcpt_submit_after(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
after, to, params, \
void *context);
#define smtp_client_command_rcpt_submit(conn, \
flags, to, params, callback, context) \
- smtp_client_command_rcpt_submit(conn, flags + \
+ smtp_client_command_rcpt_submit(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
to, params, \
void *context);
#define smtp_client_command_data_submit_after(conn, \
flags, after, data, callback, context) \
- smtp_client_command_data_submit_after(conn, flags + \
+ smtp_client_command_data_submit_after(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
after, data, (smtp_client_command_callback_t *)callback, context)
void *context);
#define smtp_client_command_data_submit(conn, \
flags, data, callback, context) \
- smtp_client_command_data_submit(conn, flags + \
+ smtp_client_command_data_submit(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
data, (smtp_client_command_callback_t *)callback, context)
smtp_client_transaction_callback_t *callback, void *context)
ATTR_NULL(4);
#define smtp_client_transaction_create_empty(conn, flags, callback, context) \
- smtp_client_transaction_create_empty(conn, flags + \
+ smtp_client_transaction_create_empty(conn, flags - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(smtp_client_transaction_callback_t *)callback, context)
/* Create a new transaction, including the parameters for the MAIL FROM
ATTR_NULL(2, 3, 6);
#define smtp_client_transaction_create(conn, \
mail_from, mail_params, flags, callback, context) \
- smtp_client_transaction_create(conn, mail_from, mail_params, flags + \
+ smtp_client_transaction_create(conn, mail_from, mail_params, flags - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(smtp_client_transaction_callback_t *)callback, 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 (*)( \
+ 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
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 (*)( \
+ 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
ATTR_NOWARN_UNUSED_RESULT ATTR_NULL(3,5);
#define smtp_client_transaction_add_mail(trans, \
mail_from, mail_params, mail_callback, context) \
- smtp_client_transaction_add_mail(trans, mail_from + \
+ smtp_client_transaction_add_mail(trans, mail_from - \
CALLBACK_TYPECHECK(mail_callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
mail_params, \
ATTR_NOWARN_UNUSED_RESULT ATTR_NULL(3,5,6);
#define smtp_client_transaction_add_rcpt(trans, \
rcpt_to, rcpt_params, rcpt_callback, data_callback, context) \
- smtp_client_transaction_add_rcpt(trans, rcpt_to + \
+ smtp_client_transaction_add_rcpt(trans, rcpt_to - \
CALLBACK_TYPECHECK(rcpt_callback, void (*)( \
- const struct smtp_reply *reply, typeof(context))) + \
+ const struct smtp_reply *reply, typeof(context))) - \
CALLBACK_TYPECHECK(data_callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
rcpt_params, \
ATTR_NOWARN_UNUSED_RESULT ATTR_NULL(4,6,7);
#define smtp_client_transaction_add_pool_rcpt(trans, pool, \
rcpt_to, rcpt_params, rcpt_callback, context) \
- smtp_client_transaction_add_pool_rcpt(trans, pool, rcpt_to + \
+ smtp_client_transaction_add_pool_rcpt(trans, pool, rcpt_to - \
CALLBACK_TYPECHECK(rcpt_callback, void (*)( \
const struct smtp_reply *reply, typeof(context))), \
rcpt_params, \
smtp_client_command_callback_t *data_callback, void *data_context);
#define smtp_client_transaction_send(trans, \
data_input, data_callback, data_context) \
- smtp_client_transaction_send(trans, data_input + \
+ smtp_client_transaction_send(trans, data_input - \
CALLBACK_TYPECHECK(data_callback, void (*)( \
const struct smtp_reply *reply, typeof(data_context))), \
(smtp_client_command_callback_t *)data_callback, data_context)
#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 (*)( \
+ 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-
struct smtp_server_connection *conn,
smtp_server_input_callback_t *callback, void *context);
#define smtp_server_connection_input_capture(conn, callback, context) \
- smtp_server_connection_input_capture(conn + \
+ smtp_server_connection_input_capture(conn - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(smtp_server_input_callback_t *)callback, context)
smtp_server_rcpt_func_t func,
void *context);
#define smtp_server_recipient_add_hook(_rcpt, _type, _func, _context) \
- smtp_server_recipient_add_hook((_rcpt), (_type) + \
+ smtp_server_recipient_add_hook((_rcpt), (_type) - \
CALLBACK_TYPECHECK(_func, void (*)( \
struct smtp_server_recipient *, typeof(_context))), \
(smtp_server_rcpt_func_t *)(_func), (_context))
smtp_server_cmd_func_t func,
void *context);
#define smtp_server_command_add_hook(_cmd, _type, _func, _context) \
- smtp_server_command_add_hook((_cmd), (_type) + \
+ smtp_server_command_add_hook((_cmd), (_type) - \
CALLBACK_TYPECHECK(_func, void (*)( \
struct smtp_server_cmd_ctx *, typeof(_context))), \
(smtp_server_cmd_func_t *)(_func), (_context))
#define smtp_submit_run_async(subm, callback, context) \
smtp_submit_run_async(subm, \
(smtp_submit_callback_t*)callback, \
- (char*)context + CALLBACK_TYPECHECK(callback, \
+ (char*)context - CALLBACK_TYPECHECK(callback, \
void (*)(const struct smtp_submit_result *result, typeof(context))))
/* Returns 1 on success, 0 on permanent failure (e.g. invalid destination),
void sql_query(struct sql_db *db, const char *query,
sql_query_callback_t *callback, void *context);
#define sql_query(db, query, callback, context) \
- sql_query(db, query + \
+ sql_query(db, query - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct sql_result *, typeof(context))), \
(sql_query_callback_t *)callback, context)
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, context - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct sql_result *, typeof(context))))
struct sql_result *sql_statement_query_s(struct sql_statement **stmt);
void sql_result_more(struct sql_result **result,
sql_query_callback_t *callback, void *context);
#define sql_result_more(result, callback, context) \
- sql_result_more(result + \
+ sql_result_more(result - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct sql_result *, typeof(context))), \
(sql_query_callback_t *)callback, context)
void sql_transaction_commit(struct sql_transaction_context **ctx,
sql_commit_callback_t *callback, void *context);
#define sql_transaction_commit(ctx, callback, context) \
- sql_transaction_commit(ctx + \
+ sql_transaction_commit(ctx - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct sql_commit_result *, typeof(context))), \
(sql_commit_callback_t *)callback, context)
int maildir_file_do(struct maildir_mailbox *mbox, uint32_t uid,
maildir_file_do_func *callback, void *context);
#define maildir_file_do(mbox, seq, callback, context) \
- maildir_file_do(mbox, seq + \
+ maildir_file_do(mbox, seq - \
CALLBACK_TYPECHECK(callback, int (*)( \
struct maildir_mailbox *, const char *, typeof(context))), \
(maildir_file_do_func *)callback, context)
mail_search_mime_foreach_callback_t *callback,
void *context) ATTR_NULL(3);
#define mail_search_mime_args_foreach(args, callback, context) \
- mail_search_mime_args_foreach(args + \
+ mail_search_mime_args_foreach(args - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct mail_search_mime_arg *, typeof(context))), \
(mail_search_mime_foreach_callback_t *)callback, context)
mail_search_foreach_callback_t *callback,
void *context) ATTR_NULL(3);
#define mail_search_args_foreach(args, callback, context) \
- mail_search_args_foreach(args + \
+ mail_search_args_foreach(args - \
CALLBACK_TYPECHECK(callback, void (*)( \
struct mail_search_arg *, typeof(context))), \
(mail_search_foreach_callback_t *)callback, context)
ATTR_NULL(3);
#define mailbox_notify_changes(box, callback, context) \
mailbox_notify_changes(box, (mailbox_notify_callback_t *)callback, \
- (void *)((char *)context + CALLBACK_TYPECHECK(callback, \
+ (void *)((char *)context - CALLBACK_TYPECHECK(callback, \
void (*)(struct mailbox *, typeof(context)))))
void mailbox_notify_changes_stop(struct mailbox *box);
void mailbox_list_notify_wait(struct mailbox_list_notify *notify,
mailbox_list_notify_callback_t *callback, void *context);
#define mailbox_list_notify_wait(notify, callback, context) \
- mailbox_list_notify_wait(notify + CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
+ mailbox_list_notify_wait(notify - CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(mailbox_list_notify_callback_t*)callback, context);
/* Flush any delayed notifications now. */
void mailbox_list_notify_flush(struct mailbox_list_notify *notify);
const struct array *array2,
int (*cmp)(const void*, const void *)) ATTR_PURE;
#define array_equal_fn(array1, array2, cmp) \
- array_equal_fn_i(&(array1)->arr + \
+ array_equal_fn_i(&(array1)->arr - \
ARRAY_TYPES_CHECK(array1, array2), \
- &(array2)->arr + \
+ &(array2)->arr - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(*(array1)->v), \
typeof(*(array2)->v))), \
(int (*)(const void *, const void *))cmp)
so ``const typeof(*context)*'' is required instead, and that requires a
complete type. */
#define array_equal_fn_ctx(array1, array2, cmp, ctx) \
- array_equal_fn_ctx_i(&(array1)->arr + \
+ array_equal_fn_ctx_i(&(array1)->arr - \
ARRAY_TYPES_CHECK(array1, array2), \
- &(array2)->arr + \
+ &(array2)->arr - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(*(array1)->v), \
typeof(*(array2)->v), \
const typeof(*ctx)*)), \
void array_sort_i(struct array *array, int (*cmp)(const void *, const void *));
#define array_sort(array, cmp) \
- array_sort_i(&(array)->arr + \
+ array_sort_i(&(array)->arr - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(*(array)->v), \
typeof(*(array)->v))), \
(int (*)(const void *, const void *))cmp)
void *array_bsearch_i(struct array *array, const void *key,
int (*cmp)(const void *, const void *));
#define array_bsearch(array, key, cmp) \
- ARRAY_TYPE_CAST_MODIFIABLE(array)array_bsearch_i(&(array)->arr + \
+ ARRAY_TYPE_CAST_MODIFIABLE(array)array_bsearch_i(&(array)->arr - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(const typeof(*key) *), \
typeof(*(array)->v))), \
(const void *)key, (int (*)(const void *, const void *))cmp)
}
#define ARRAY_LSEARCH_CALL(modifiable, array, key, cmp) \
array_lsearch##modifiable##i( \
- &(array)->arr + \
+ &(array)->arr - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(const typeof(*key) *), \
typeof(*(array)->v))), \
(const void *)key, \
size_t size, int (*cmp)(const void *, const void *),
unsigned int *idx_r);
#define bsearch_insert_pos(key, base, nmemb, size, cmp, idx_r) \
- bsearch_insert_pos(key, base, nmemb, size + \
+ bsearch_insert_pos(key, base, nmemb, size - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(const typeof(*key) *), \
typeof(const typeof(*base) *))), \
(int (*)(const void *, const void *))cmp, idx_r)
int (*cmp)(const void *, const void *),
unsigned int *idx_r);
#define array_bsearch_insert_pos(array, key, cmp, idx_r) \
- array_bsearch_insert_pos_i(&(array)->arr + \
+ array_bsearch_insert_pos_i(&(array)->arr - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(const typeof(*key) *), \
typeof(*(array)->v))), \
(const void *)key, (int (*)(const void *, const void *))cmp, idx_r)
child_wait_new_with_pid(pid_t pid, child_wait_callback_t *callback,
void *context) ATTR_NULL(3);
#define child_wait_new_with_pid(pid, callback, context) \
- child_wait_new_with_pid(pid + \
+ child_wait_new_with_pid(pid - \
CALLBACK_TYPECHECK(callback, void (*)( \
const struct child_wait_status *status, typeof(context))), \
(child_wait_callback_t *)callback, context)
unsigned int source_linenum,
io_callback_t *callback, void *context) ATTR_NULL(5);
#define io_add(fd, condition, callback, context) \
- io_add(fd, condition, __FILE__, __LINE__ + \
+ io_add(fd, condition, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context)
struct io *io_add_to(struct ioloop *ioloop, int fd, enum io_condition condition,
unsigned int source_linenum,
io_callback_t *callback, void *context) ATTR_NULL(5);
#define io_add_to(ioloop, fd, condition, callback, context) \
- io_add_to(ioloop, fd, condition, __FILE__, __LINE__ + \
+ io_add_to(ioloop, fd, condition, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context)
io_callback_t *callback, void *context,
struct io **io_r) ATTR_NULL(3);
#define io_add_notify(path, callback, context, io_r) \
- io_add_notify(path, __FILE__, __LINE__ + \
+ io_add_notify(path, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context, io_r)
unsigned int source_linenum,
io_callback_t *callback, void *context) ATTR_NULL(3);
#define io_add_istream(input, callback, context) \
- io_add_istream(input, __FILE__, __LINE__ + \
+ io_add_istream(input, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context)
struct io *io_add_istream_to(struct ioloop *ioloop, struct istream *input,
io_callback_t *callback, void *context)
ATTR_NULL(3);
#define io_add_istream_to(ioloop, input, callback, context) \
- io_add_istream_to(ioloop, input, __FILE__, __LINE__ + \
+ io_add_istream_to(ioloop, input, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context)
unsigned int source_linenum,
timeout_callback_t *callback, void *context) ATTR_NULL(4);
#define timeout_add(msecs, callback, context) \
- timeout_add(msecs, __FILE__, __LINE__ + \
- CALLBACK_TYPECHECK(callback, void (*)(typeof(context))) + \
+ timeout_add(msecs, __FILE__, __LINE__ - \
+ CALLBACK_TYPECHECK(callback, void (*)(typeof(context))) - \
COMPILE_ERROR_IF_TRUE(__builtin_constant_p(msecs) && \
((msecs) > 0 && (msecs) < 1000)), \
(io_callback_t *)callback, context)
const char *source_filename, unsigned int source_linenum,
timeout_callback_t *callback, void *context) ATTR_NULL(4);
#define timeout_add_to(ioloop, msecs, callback, context) \
- timeout_add_to(ioloop, msecs, __FILE__, __LINE__ + \
- CALLBACK_TYPECHECK(callback, void (*)(typeof(context))) + \
+ timeout_add_to(ioloop, msecs, __FILE__, __LINE__ - \
+ CALLBACK_TYPECHECK(callback, void (*)(typeof(context))) - \
COMPILE_ERROR_IF_TRUE(__builtin_constant_p(msecs) && \
((msecs) > 0 && (msecs) < 1000)), \
(io_callback_t *)callback, context)
unsigned int source_linenum,
timeout_callback_t *callback, void *context) ATTR_NULL(4);
#define timeout_add_short(msecs, callback, context) \
- timeout_add_short(msecs, __FILE__, __LINE__ + \
+ timeout_add_short(msecs, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context)
struct timeout *
const char *source_filename, unsigned int source_linenum,
timeout_callback_t *callback, void *context) ATTR_NULL(4);
#define timeout_add_short_to(ioloop, msecs, callback, context) \
- timeout_add_short_to(ioloop, msecs, __FILE__, __LINE__ + \
+ timeout_add_short_to(ioloop, msecs, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context)
unsigned int source_linenum,
timeout_callback_t *callback, void *context) ATTR_NULL(4);
#define timeout_add_absolute(time, callback, context) \
- timeout_add_absolute(time, __FILE__, __LINE__ + \
+ timeout_add_absolute(time, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context)
struct timeout *
unsigned int source_linenum,
timeout_callback_t *callback, void *context) ATTR_NULL(4);
#define timeout_add_absolute_to(ioloop, time, callback, context) \
- timeout_add_absolute_to(ioloop, time, __FILE__, __LINE__ + \
+ timeout_add_absolute_to(ioloop, time, __FILE__, __LINE__ - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(io_callback_t *)callback, context)
io_callback_t *deactivate, void *context);
#define io_loop_context_add_callbacks(ctx, activate, deactivate, context) \
io_loop_context_add_callbacks(ctx, 1 ? (io_callback_t *)activate : \
- CALLBACK_TYPECHECK(activate, void (*)(typeof(context))) + \
+ CALLBACK_TYPECHECK(activate, void (*)(typeof(context))) - \
CALLBACK_TYPECHECK(deactivate, void (*)(typeof(context))), \
(io_callback_t *)deactivate, context)
/* Remove callbacks with the given callbacks and context. */
io_callback_t *deactivate, void *context);
#define io_loop_context_remove_callbacks(ctx, activate, deactivate, context) \
io_loop_context_remove_callbacks(ctx, 1 ? (io_callback_t *)activate : \
- CALLBACK_TYPECHECK(activate, void (*)(typeof(context))) + \
+ CALLBACK_TYPECHECK(activate, void (*)(typeof(context))) - \
CALLBACK_TYPECHECK(deactivate, void (*)(typeof(context))), \
(io_callback_t *)deactivate, context)
/* Returns the current context set to ioloop. */
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, context - \
CALLBACK_TYPECHECK(callback, void (*)(enum iostream_proxy_side side, enum iostream_proxy_status, typeof(context))))
void iostream_proxy_ref(struct iostream_proxy *proxy);
#define iostream_pump_set_completion_callback(pump, callback, context) \
iostream_pump_set_completion_callback(pump, \
(iostream_pump_callback_t *)callback, \
- context + CALLBACK_TYPECHECK(callback, \
+ 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
istream_sized_callback_t *error_callback,
void *context);
#define i_stream_create_sized_with_callback(input, size, error_callback, context) \
- i_stream_create_sized_with_callback(input, size + \
+ i_stream_create_sized_with_callback(input, size - \
CALLBACK_TYPECHECK(error_callback, \
const char *(*)(const struct istream_sized_error_data *, typeof(context))), \
(istream_sized_callback_t *)error_callback, context)
istream_callback_t *callback, void *context)
ATTR_NULL(3);
#define i_stream_add_destroy_callback(stream, callback, context) \
- i_stream_add_destroy_callback(stream + \
+ i_stream_add_destroy_callback(stream - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(istream_callback_t *)callback, context)
/* Remove the destroy 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))))
+ context - CALLBACK_TYPECHECK(callback, const char *(*)(typeof(context))))
/* Set the event's name. The name is specific to a single sending of an event,
and it'll be automatically cleared once the event is sent. This should
log_throttle_init(const struct log_throttle_settings *set,
log_throttle_callback_t *callback, void *context);
#define log_throttle_init(set, callback, context) \
- log_throttle_init(set + \
+ log_throttle_init(set - \
CALLBACK_TYPECHECK(callback, void (*)(unsigned int, typeof(context))), \
(log_throttle_callback_t *)callback, context)
void log_throttle_deinit(struct log_throttle **throttle);
memarea_init(const void *data, size_t size,
memarea_free_callback_t *callback, void *context);
#define memarea_init(data, size, callback, context) \
- memarea_init(data, size + \
+ memarea_init(data, size - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(memarea_free_callback_t *)callback, context)
/* Returns an empty memory area. */
ostream_callback_t *callback, void *context)
ATTR_NULL(3);
#define o_stream_add_destroy_callback(stream, callback, context) \
- o_stream_add_destroy_callback(stream + \
+ o_stream_add_destroy_callback(stream - \
CALLBACK_TYPECHECK(callback, void (*)(typeof(context))), \
(ostream_callback_t *)callback, context)
/* Remove the destroy callback. */
stream_flush_callback_t *callback,
void *context) ATTR_NULL(3);
#define o_stream_set_flush_callback(stream, callback, context) \
- o_stream_set_flush_callback(stream + \
+ o_stream_set_flush_callback(stream - \
CALLBACK_TYPECHECK(callback, int (*)(typeof(context))), \
(stream_flush_callback_t *)callback, context)
void o_stream_unset_flush_callback(struct ostream *stream);
INTEGER_CMP(uint32_cmp, uint32_t)
#define i_qsort(base, nmemb, size, cmp) \
- qsort(base, nmemb, size + \
+ qsort(base, nmemb, size - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(const typeof(*base) *), \
typeof(const typeof(*base) *))), \
(int (*)(const void *, const void *))cmp)
#define i_bsearch(key, base, nmemb, size, cmp) \
- bsearch(key, base, nmemb, size + \
+ bsearch(key, base, nmemb, size - \
CALLBACK_TYPECHECK(cmp, int (*)(typeof(const typeof(*key) *), \
typeof(const typeof(*base) *))), \
(int (*)(const void *, const void *))cmp)