You need some software to calculate the DFT of your signal, then you need to add the squares of all the bins that are not signal or its harmonics to calculate the SNR. The SFDR is the difference between the signal power and the highest tone, while the THD is the sum of the power of all the harmonics.
Of course you could do this in C. For the DFT/FFT check fftw.org for C source code.