some code about c lib realized by myself