Multiple client API contexts can exist in the same process.
Also get rid of shared.h; it actually doesn't have much value. Just copy the tiny function it contained into the 2 files which used it.