by joeatwork · 3y ago · 0 comments
In defining the implementation, it's easy enough to do something like this (if the implementation really is common):
static int pdf_ll_foo_impl(pdf_ll_ctx_t c, pdf_ll_type_t t, ...)
{
//real implementation goes here, perhaps switching on t
}
int pdf_page_foo(pdf_page_ctx_t c, ..) { pdf_ll_foo_impl((pdf_ll_ctx_t) c, PDF_PAGE_TYPE, ..); }
int pdf_pattern_foo (pdf_pattern_ctx_t c, ..) { pdf_ll_foo_impl(pdf_ll_ctx_t) c, PDF_PATTERN_TYPE, ..); }
which you can also use macros to help generate if you want to.