I've started coding it in C++.
Though there's another python library that looks good too:
http://colour-science.org/
Unfortunately, that linked C function of yours implements spectral analysis for black body radiation, which I believe is emissive. We want the reflective calculations that use a slightly more complicated form of the equations. That include a reference illuminant in addition to the color matching functions for each x, y, z component.
ColorPy may do it, but the equations they list are for emissive.
X = ∫ I (λ) * CIE-X (λ) * dλ
Y = ∫ I (λ) * CIE-Y (λ) * dλ
Z = ∫ I (λ) * CIE-Z (λ) * dλ
I located the CIE color matching functions (CIE 1931) for 2-degree observer angle (the common one, apparently) and the data for the D65 reference illuminant (also the common one, I think) so now it's a matter of interpolating between the spectrometer wavelenths and the wavelengths represented in the CMF's and the reference illuminant and summning all that shit up.
On Bruce Lindblooms site, the equations look more like:
Which turns into the sum of, for all lambdas in the spectral data from the machine: the color matching function at wavelength lambda * the spectral data (transmission) at wavelength lambda * the reference illuminant at wavelength lambda.
And then each component normalized by N.
At least that's what I currently think it is. I just started looking at this stuff the other night, and I have no experience in color science. If anyone sees any issues with what I said in this message, please let me know!