add some length function
fix cffi type error