Quark decay functions and heavy hadron production in QCD