typedef const char * (*Responder)( int p1);

typedef struct sDelegate {
    Responder operation;
} *Delegate;


Delegate NewDelegate( Responder rspndr )
{
    Delegate dl = malloc(sizeof(struct sDelegate));
    dl->operation = rspndr;
    return dl;
}


const char *DelegateThing(Delegate dl, int p1)
{
    return  (dl->operation)? (*dl->operation)(p1) : NULL;
}


typedef struct sDelegator {
    int     param;
    char    *phrase;
    Delegate delegate;
} *Delegator;

const char * defaultResponse( int p1)
{
    return ;
}

static struct sDelegate defaultDel = { &defaultResponse };


Delegator NewDelegator( int p, char *phrase)
{
    Delegator d  = malloc(sizeof(struct sDelegator));
    d->param = p;
    d->phrase = phrase;
    d->delegate = &defaultDel;	
    return d;
}


const char *Delegator_Operation( Delegator theDelegator, int p1, Delegate delroy)
{
    const char *rtn;
    if (delroy) {
        rtn = DelegateThing(delroy, p1);
        if (!rtn) {			
            rtn = DelegateThing(theDelegator->delegate, p1);
        }
    }
    else 		
        rtn = DelegateThing(theDelegator->delegate, p1);

    printf(, theDelegator->phrase );
    return rtn;
}


const char *thing1( int p1)
{
    printf( , p1);
    return ;
}

int main()
{
    Delegate del1 = NewDelegate(&thing1);
    Delegate del2 = NewDelegate(NULL);
    Delegator theDelegator = NewDelegator( 14, );

    printf(, 
            Delegator_Operation( theDelegator, 3, NULL));
    printf(, 
            Delegator_Operation( theDelegator, 3, del1));
    printf(,
            Delegator_Operation( theDelegator, 3, del2));
    return 0;
}