update FFI samples/tests/document to use new cdef syntax

Signed-off-by: Qingping Hou <qingping.hou@gmail.com>
Signed-off-by: Yicheng Qin <qycqycqycqycqyc@gmail.com>