hook-build.h revision bcb4e51a409d94ae670de96afb8483a4f7855294
bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2017-2018 Dovecot authors, see the included COPYING file */
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi#ifndef HOOK_BUILD_H
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi#define HOOK_BUILD_H 1
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomistruct hook_build_context;
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomistruct hook_stack;
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi/* Initialize new hook building context, vfuncs should point to
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi the functions table that is being manipulated, and size should be
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi the size of this table. */
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomistruct hook_build_context *hook_build_init(void (**vfuncs)(), size_t size);
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi/* This is called after a hook may have updated vfuncs */
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomivoid hook_build_update(struct hook_build_context *ctx, void *_vlast);
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi/* Free memory used by build context */
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomivoid hook_build_deinit(struct hook_build_context **_ctx);
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi
6004fdf3cc8fe87a6c35ce297d39ab68feb707b0Aki Tuomi#endif