some common c function