Quantitative information flow under generic leakage functions and adaptive adversaries (Logical Methods in Computer Science, 2015)