The inviscid flows, possibly rotational and nonsmooth, which satisfy the equation of stationary incompressible hydrodynamics, are characterized as giving zero variation rate to some real functional when the corresponding scalar and vector fields are transported by what is called a carrier, i.e. a mobile differential manifold. This transport does not have to preserve volumes; the Bernoulli function figures as the natural unknown scalar field rather than the pressure. Inhomogeneity may be sharp, implying in particular the presence of free surfaces. The key mathematical concept is that of a divergence-free vector measure convected by a carrier. For easier handling of this concept, some versions of the main variational statement are derived, involving vector potentials and stream functions in two or three dimensions; axially symmetric flows are also considered.