Add the mapping.[ch] files.
Modify the mapping.[hc] fixing compilation problems
and adjust the style.