Passing var b/w .C and .PDE

OK so I am working with the socket example from the WiShield project. I want the Wishield to send a packet with a 1, 2, 3 depending on which button I tap (connected to arduino). OK I can successfully trigger a packet by using

extern "C" {
         void function (void);
}

But I can't seem to pass a variable from my .PDE to my .C file. I've tried it several different ways, I guess I just don't know how to describe properly what I'm doing because Google hasn't been very helpful.