add c implementations of in.cgi and out.cgi