Boundary singularities of functions in symplectic and volume-preserving geometry