Simple hook system in C