renamed res_init as res_init_ because of conflict with res_init(3) [which was called under Linux when using simulations]