codex
Loading...
Searching...
No Matches
mult_opt.c File Reference
#include <stddef.h>
#include <stdio.h>
Include dependency graph for mult_opt.c:

Classes

struct  a_vtbl
 
struct  b_vtbl
 
struct  c_vtbl
 
struct  d_vtbl
 
struct  a
 
struct  b
 
struct  c
 
struct  d
 

Macros

#define container_of(p, t, m)   ((t*)((char*)(p) - offsetof(t, m)))
 
#define vptr_shared(b, d)
 
#define call(t, vf, p)   (((p)->t.vptr->vf)((p)))
 
#define vcall(vf, p)   (((p)->vptr->vf)((p)))
 
#define X(n, t, m)   void n(t *p) { printf("%-5s %s\n", __func__, p->m data); }
 

Functions

void af0 (struct a *)
 
void bf0 (struct b *)
 
void cf0 (struct c *)
 
void af1 (struct a *)
 
void bf1 (struct b *)
 
void cf1 (struct c *)
 
void d_af1 (struct d *)
 
void d_bf1 (struct d *)
 
void d_cf1 (struct d *)
 
void df (struct d *)
 
void d_pre_af1 (struct d *p)
 
void d_pre_bf1 (struct d *p)
 
void d_pre_cf1 (struct d *p)
 
int main (void)
 

Variables

const struct a_vtbl a_vtbl = {.af0 = af0, .af1 = af1}
 
const struct b_vtbl b_vtbl = {.bf0 = bf0, .bf1 = bf1}
 
const struct c_vtbl c_vtbl = {.cf0 = cf0, .cf1 = cf1}
 
const struct d_vtbl d_vtbl
 
const struct b_vtbl db_vtbl = {.bf0 = bf0, .bf1 = d_pre_bf1}
 
const struct c_vtbl dc_vtbl = {.cf0 = cf0, .cf1 = d_pre_cf1}
 

Macro Definition Documentation

◆ call

#define call ( t,
vf,
p )   (((p)->t.vptr->vf)((p)))

◆ container_of

#define container_of ( p,
t,
m )   ((t*)((char*)(p) - offsetof(t, m)))

◆ vcall

#define vcall ( vf,
p )   (((p)->vptr->vf)((p)))

◆ vptr_shared

#define vptr_shared ( b,
d )
Value:
union { \
struct b b; \
const struct d ## _vtbl *vptr; \
}
Definition mult_inh.c:26
Definition mult_inh.c:28

◆ X

#define X ( n,
t,
m )   void n(t *p) { printf("%-5s %s\n", __func__, p->m data); }

Function Documentation

◆ af0()

void af0 ( struct a * )
Here is the caller graph for this function:

◆ af1()

void af1 ( struct a * )
Here is the caller graph for this function:

◆ bf0()

void bf0 ( struct b * )
Here is the caller graph for this function:

◆ bf1()

void bf1 ( struct b * )
Here is the caller graph for this function:

◆ cf0()

void cf0 ( struct c * )
Here is the caller graph for this function:

◆ cf1()

void cf1 ( struct c * )
Here is the caller graph for this function:

◆ d_af1()

void d_af1 ( struct d * )
Here is the caller graph for this function:

◆ d_bf1()

void d_bf1 ( struct d * )
Here is the caller graph for this function:

◆ d_cf1()

void d_cf1 ( struct d * )
Here is the caller graph for this function:

◆ d_pre_af1()

void d_pre_af1 ( struct d * p)
Here is the call graph for this function:

◆ d_pre_bf1()

void d_pre_bf1 ( struct d * p)
Here is the call graph for this function:

◆ d_pre_cf1()

void d_pre_cf1 ( struct d * p)
Here is the call graph for this function:

◆ df()

void df ( struct d * )
Here is the caller graph for this function:

◆ main()

int main ( void )
Here is the call graph for this function:

Variable Documentation

◆ a_vtbl

const struct a_vtbl a_vtbl = {.af0 = af0, .af1 = af1}

◆ b_vtbl

const struct b_vtbl b_vtbl = {.bf0 = bf0, .bf1 = bf1}

◆ c_vtbl

const struct c_vtbl c_vtbl = {.cf0 = cf0, .cf1 = cf1}

◆ d_vtbl

const struct d_vtbl d_vtbl
Initial value:
= {
.a = {.af0 = af0, .af1 = d_pre_af1},
.df = df,
}
void af0(struct a *)
void df(struct d *)
void d_pre_af1(struct d *p)
Definition mult_opt.c:32

◆ db_vtbl

const struct b_vtbl db_vtbl = {.bf0 = bf0, .bf1 = d_pre_bf1}

◆ dc_vtbl

const struct c_vtbl dc_vtbl = {.cf0 = cf0, .cf1 = d_pre_cf1}