useDynLib(DPQ, .registration = TRUE, .fixes = "C_")
                                        # <--> src/init.c

## We do *NOT* import from  Rmpfr here,
## as we only __suggest__ the package in ./DESCRIPTION
##  ==> where we use it we check every time if it's load()able ...

importFrom("sfsmisc"
         , eaxis
         , mult.fig
     )

importFrom("stats"
         , dnorm, pnorm, qnorm
         , dbeta, pbeta, qbeta
         , dbinom, pbinom
         , dgamma, pgamma, qgamma
         , dchisq, pchisq, qchisq
         , df, pf, qf
         , dhyper, phyper
         , dt, pt, qt
         , dpois, ppois, qpois
)

importFrom("graphics",
           curve, legend, lines, par, plot
           )

importFrom("methods", is, new
           )

importFrom("utils"
         , globalVariables
         , str
           )

### ----------------------- Exporting ----------------------------

## For now export everything (but the C_*() C routines
export(
    ## R/dpq-h.R
    ## ---------
    ".D_0", ".D_1"
  , ".D_Clog", ".D_Cval", ".D_exp"
  , ".D_LExp", ".D_log", ".D_Lval", ".D_qIv", ".D_val"
  , ".DT_0", ".DT_1"
  , ".DT_Cexp", ".DT_CIv", ".DT_Clog", ".DT_Cval", ".DT_exp", ".DT_log", ".DT_Log"
  , ".DT_qIv", ".DT_val"
  , log1mexp
  , M_LN2, M_cutoff, M_minExp
  , G_half

  , .dntJKBch, .dntJKBch1


  , Qab_terms

  , all_mpfr, any_mpfr # simple wrappers in  R/utils.R

  , b_chi, b_chiAsymp
  , lb_chi0, lb_chi00, lb_chiAsymp

  , betaI

  , c_dt, c_dtAsymp, c_pt ## related to lb_chi*() above FIXME

  , dchisqAsym, dnchisqBessel, dnchisqR, dnoncentchisq
  , dntJKBf, dntJKBf1
  # , dntRwrong, dntRwrong1
  , dtWV

  , logspace.add
  , logspace.sub

  , ppoisErr
  , format01prec
 ## R/wienergerm_nchisq-fn.R : -----
  , g2, gnt
  , h, h0, h1, h2, hnt  # h := h2
  , sW
  , qs ## ??
  , z0, z.f, z.s
  , ss, ss2, ss2.
  , pchisqW.R
  , pchisqV, pchisqW., pchisqW # man/pnchisqAppr.Rd
  , pnchisqRC
  ## , scalefactor
 ## --------------------------------

  , lbeta_asy, lbetaI, lbetaM, lbetaMM
  ## , lbetaIhalf
  , algdiv # name as in TOMS 708 .. but really?
  , okLongDouble # as with valgrind, it does not work contrary to what .Machine says

  , lgamma1p., lgamma1p, lgamma1p_series
  , log1pmx
  , logQab_asy
  , logcf, logr
  , lssum, lsum

  , newton # R/pnchisq.R
  , pl2curves
  , plRpois  # another plot ... keep ?

  , pbetaRv1
  , pnbetaAS310
  , pnbetaAppr2, pnbetaAppr2v1

  , pnchisq, pnchi1sq, pnchi3sq
  , pnchisqAbdelAty, pnchisqPatnaik, pnchisqPearson, pnchisqSankaran_d
  , pnchisq_ss, pnchisqIT, pnchisqTerms, pnchisqV
  , pnchisqT93, pnchisqT93.a, pnchisqT93.b
  , pnchisqBolKuz
  , qnchisqBolKuz

  ## Naming -fixme?
  , pnt3150, pnt3150.1
  , pntChShP94, pntChShP94.1
  , pntJW39, pntJW39.0
  , pntLrg
  , pntP94, pntP94.1
  , pntR, pntR1

  , ppoisD

  , qbetaAppr, qbetaAppr.1, qbetaAppr.2, qbetaAppr.3, qbetaAppr.4, qbeta.R
  , qgamma.R

  , dgamma.R
  , dpois_raw, bd0, stirlerr

    ## from R/qchisqAppr.R :
  , qchisqAppr.R
  , qchisqAppr
  , qchisqKG, qchisqWH
  , .qgammaApprBnd

    ## from R/hyper-dist.R :
  , Bern
  , .suppHyper
  , dhyperBinMolenaar
  , hyper2binomP
  , lfastchoose, f05lchoose
  , lgammaAsymp
  , phyper1molenaar, phyper2molenaar
  , phyperAllBin, phyperAllBinM
  , phyperApprAS152
  , phyperBin.1, phyperBin.2, phyperBin.3, phyperBin.4
  , phyperBinMolenaar, phyperBinMolenaar.1, phyperBinMolenaar.2, phyperBinMolenaar.3, phyperBinMolenaar.4
  , phyperIbeta, phyperPeizer, phyperR, phypers
  , pdhyper, phyperR2

    ## from R/qnchisq.R
  , qchisqAppr.0, qchisqAppr.1, qchisqAppr.2, qchisqAppr.3
  , qchisqApprCF1, qchisqApprCF2, qchisqCappr.2
  , qchisqN
  , qnchisqAbdelAty, qnchisqPatnaik, qnchisqPearson, qnchisqSankaran_d

  , qgammaAppr, qgammaApprSmallP, qgammaApprKG

  , qnormAppr, qnormUappr
  , qtAppr
  , r_pois, r_pois_expr
    ## no! titleR.exp (FIXME eventually: should not need such a global)
)
