add c version of xpv