Diffuse interstellar clouds as a chemical laboratory - The chemistry of diatomic carbon species