intial commit, wrap some common function in c_driver