added qchat.c - conversion of qchat_client.cpp to C