Gluoproduction of heavy quark flavors in hadronic scattering