 <p>You cannot overload functions in C, but you can organize your code to make it optimal. I would create a function for <code>rgb2hsv</code> and that would get a <code>void *</code> type of parameter, would determine the type and use it, handling all possible cases. And you should use only this function. On lower levels you still duplicate your function, on higher level you will not have to call two separate functions. This would simplify usage.</p>