code mode hook for c/c++