/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "llist.h"
#include "hook-build.h"
struct hook_stack {
/* Pointer to vfuncs struct. This assumes that a struct containing
function pointers equals to an array of function pointers. Not
ANSI-C, but should work in all OSes supported by Dovecot. Much
easier anyway than doing this work manually.. */
void (**vfuncs)();
/* nonzero in the areas where vfuncs has been changed */
void (**mask)();
};
struct hook_build_context {
/* size of the vfuncs struct */
/* number of function pointers in the struct */
unsigned int count;
};
{
}
{
return ctx;
}
static void
void (**vlast)())
{
unsigned int i;
}
}
}
static void
{
unsigned int i;
}
}
}
{
/* no vfuncs overridden */
return;
}
/* ctx->vfuncs_stack->vfuncs points to the root vfuncs,
ctx->vfuncs_stack->next->vfuncs points to the first super function
that is being called, and so on.
the previous plugin added its vfuncs to the stack tail.
vlast contains the previous plugin's super vfuncs, which is where
the next plugin should put its own vfuncs.
first we'll need to figure out what vfuncs the previous plugin
changed and update the mask */
/* now go up in the stack as long as the mask isn't set,
and update the vfuncs */
/* add vlast to stack */
}
{
}