Fixed C style functions.
Working. MSVC 2013 tested.
GCC should be work