Added swap function impl in c. Including generic swap.