From carbonate-cuprates to cuprate-carbonates: the structural equivalence of CO3 and CuOx groups in the Ba-Cu-C-O system