A generic interior-point framework for nonsmooth and complementarity constrained nonlinear optimization