"""
Declarations for non-inline functions from PARI.

This file contains all declarations from headers/paridecl.h from
the PARI distribution, except the inline functions which are in
sage/libs/pari/declinl.pxi (that file is automatically included by
this file).


AUTHORS:

 - (unknown authors before 2010)

 - Robert Bradshaw, Jeroen Demeyer, William Stein (2010-08-15):
   Upgrade to PARI 2.4.3 (#9343)

 - Jeroen Demeyer (2010-08-15): big clean up (#9898)

"""
include 'cdefs.pxi'

cdef extern from 'setjmp.h':
    struct __jmp_buf_tag:
        pass
    ctypedef __jmp_buf_tag jmp_buf
    int setjmp (jmp_buf __env)
    int longjmp (jmp_buf __env, int val)

ctypedef unsigned long ulong

cdef extern from 'pari/paricfg.h':
    char* PARIVERSION

cdef extern from 'wordsize.h':
     pass

cdef extern from 'pari/pari.h':
    ctypedef long* GEN

    # PARI types: these are actually an enum type, but I can't get Pyrex to "properly"
    # wrap enums. It doesn't matter as long as they are treated as ints by pyrex.
    extern int t_INT, t_REAL, t_INTMOD, t_FRAC, t_FFELT, t_COMPLEX, t_PADIC, t_QUAD, \
        t_POLMOD, t_POL, t_SER, t_RFRAC, t_QFR, t_QFI, t_VEC, t_COL,  \
        t_MAT, t_LIST, t_STR, t_VECSMALL, t_CLOSURE

    # PARI stack
    ctypedef unsigned long pari_sp
    extern pari_sp avma, bot, top


    # parigen.h

    extern int BITS_IN_LONG
    extern int DEFAULTPREC       #  64 bits precision
    extern int MEDDEFAULTPREC    # 128 bits precision
    extern int BIGDEFAULTPREC    # 192 bits precision
    long    typ(GEN x)
    long    settyp(GEN x, long s)
    long    isclone(GEN x)
    long    setisclone(GEN x)
    long    unsetisclone(GEN x)
    long    lg(GEN x)
    long    setlg(GEN x, long s)
    long    signe(GEN x)
    long    setsigne(GEN x, long s)
    long    lgefint(GEN x)               # macro
    long    setlgefint(GEN x, long s)    # macro
    long    expo(GEN x)
    long    setexpo(GEN x, long s)
    long    valp(GEN x)
    long    setvalp(GEN x, long s)
    long    precp(GEN x)
    long    setprecp(GEN x, long s)
    long    varn(GEN x)
    long    setvarn(GEN x, long s)
    long    evaltyp(long x)
    long    evallg(long x)
    long    evalvarn(long x)
    long    evalsigne(long x)
    long    evalprecp(long x)
    long    evalvalp(long x)
    long    evalexpo(long x)
    long    evallgefint(long x)

    # paricast.h

    long    mael2(GEN,long,long)
    long    mael3(GEN,long,long,long)
    long    mael4(GEN,long,long,long,long)
    long    mael5(GEN,long,long,long,long,long)
    long    mael(GEN,long,long)
    GEN     gmael1(GEN,long)
    GEN     gmael2(GEN,long,long)
    GEN     gmael3(GEN,long,long,long)
    GEN     gmael4(GEN,long,long,long,long)
    GEN     gmael5(GEN,long,long,long,long,long)
    GEN     gmael(GEN,long,long)
    GEN     gel(GEN,long)
    GEN     gcoeff(GEN,long,long)
    long    coeff(GEN,long,long)

    # paricom.h
    
    GEN     gpi
    GEN     geuler
    GEN     gen_m1
    GEN     gen_1
    GEN     gen_2
    GEN     ghalf
    GEN     gi
    GEN     gen_0
    GEN     gnil
    extern int INIT_JMPm, INIT_SIGm, INIT_DFTm
    extern int new_galois_format, precdl

    # level1.h (incomplete!)
    
    GEN     cgetg_copy(long lx, GEN x)
    GEN     cgetg(long x, long y)
    GEN     cgeti(long x)
    GEN     cgetr(long x)
    long    itos(GEN x)
    GEN     real_0_bit(long bitprec)
    GEN     stoi(long s)

    # Flx.c

    GEN     Fl_to_Flx(ulong x, long sv)
    GEN     Flm_to_FlxV(GEN x, long sv)
    GEN     Flm_to_FlxX(GEN x, long v,long w)
    GEN     Flm_to_ZM(GEN z)
    GEN     Flv_to_Flx(GEN x, long vs)
    GEN     Flv_to_ZV(GEN z)
    GEN     Flv_polint(GEN xa, GEN ya, ulong p, long vs)
    GEN     Flv_roots_to_pol(GEN a, ulong p, long vs)
    GEN     Flx_Fl_mul(GEN y, ulong x, ulong p)
    GEN     Flx_to_Flv(GEN x, long N)
    GEN     Flx_to_ZX(GEN z)
    GEN     Flx_to_ZX_inplace(GEN z)
    GEN     Flx_add(GEN x, GEN y, ulong p)
    GEN     Flx_deriv(GEN z, ulong p)
    GEN     Flx_div_by_X_x(GEN a, ulong x, ulong p, ulong *rem)
    GEN     Flx_divrem(GEN x, GEN y, ulong p, GEN *pr)
    ulong   Flx_eval(GEN x, ulong y, ulong p)
    GEN     Flx_extgcd(GEN a, GEN b, ulong p, GEN *ptu, GEN *ptv)
    ulong   Flx_extresultant(GEN a, GEN b, ulong p, GEN *ptU, GEN *ptV)
    GEN     Flx_gcd(GEN a, GEN b, ulong p)
    GEN     Flx_gcd_i(GEN a, GEN b, ulong p)
    int     Flx_is_squarefree(GEN z, ulong p)
    GEN     Flx_mul(GEN x, GEN y, ulong p)
    GEN     Flx_neg(GEN x, ulong p)
    GEN     Flx_neg_inplace(GEN x, ulong p)
    GEN     Flx_normalize(GEN z, ulong p)
    GEN     Flx_pow(GEN x, long n, ulong p)
    GEN     Flx_recip(GEN x)
    GEN     Flx_red(GEN z, ulong p)
    GEN     Flx_rem(GEN x, GEN y, ulong p)
    GEN     Flx_renormalize(GEN x, long l)
    ulong   Flx_resultant(GEN a, GEN b, ulong p)
    GEN     Flx_shift(GEN a, long n)
    GEN     Flx_sqr(GEN x, ulong p)
    GEN     Flx_sub(GEN x, GEN y, ulong p)
    GEN     FlxM_to_ZXM(GEN z)
    GEN     FlxV_to_Flm(GEN v, long n)
    GEN     FlxX_add(GEN P, GEN Q, ulong p)
    GEN     FlxX_shift(GEN a, long n)
    GEN     FlxX_to_Flm(GEN v, long n)
    GEN     FlxX_to_ZXX(GEN B)
    GEN     FlxYqQ_pow(GEN x, GEN n, GEN S, GEN T, ulong p)
    GEN     Flxq_inv(GEN x,GEN T,ulong p)
    GEN     Flxq_invsafe(GEN x, GEN T, ulong p)
    GEN     Flxq_mul(GEN y,GEN x,GEN T,ulong p)
    GEN     Flxq_pow(GEN x, GEN n, GEN T, ulong p)
    GEN     Flxq_powers(GEN x, long l, GEN T, ulong p)
    GEN     Flxq_sqr(GEN y,GEN T,ulong p)
    GEN     FlxqX_normalize(GEN z, GEN T, ulong p)
    GEN     FlxqX_Flxq_mul(GEN P, GEN U, GEN T, ulong p)
    GEN     FlxqX_red(GEN z, GEN T, ulong p)
    GEN     FlxqX_mul(GEN x, GEN y, GEN T, ulong p)
    GEN     FlxqX_safegcd(GEN P, GEN Q, GEN T, ulong p)
    GEN     FlxqX_sqr(GEN x, GEN T, ulong p)
    GEN     FlxqX_divrem(GEN x, GEN y, GEN T, ulong p, GEN *pr)
    GEN     FlxqXQ_pow(GEN x, GEN n, GEN S, GEN T, ulong p)
    GEN     Z_to_Flx(GEN x, ulong p, long v)
    GEN     ZM_to_Flm(GEN x, ulong p)
    GEN     ZV_to_Flv(GEN x, ulong p)
    GEN     ZX_to_Flx(GEN x, ulong p)
    GEN     ZXV_to_FlxV(GEN v, ulong p)
    GEN     ZXX_to_FlxX(GEN B, ulong p, long v)
    GEN     polx_Flx(long sv)
    GEN     zero_Flx(long sv)

     # alglin1.c

    GEN     Flm_deplin(GEN x, ulong p)
    GEN     Flm_indexrank(GEN x, ulong p)
    GEN     Flm_inv(GEN x, ulong p)
    GEN     Flm_ker(GEN x, ulong p)
    GEN     Flm_ker_sp(GEN x, ulong p, long deplin)
    GEN     Flm_mul(GEN x, GEN y, ulong p)
    GEN     FlxqM_ker(GEN x, GEN T, ulong p)
    GEN     FpC_FpV_mul(GEN x, GEN y, GEN p)
    GEN     FpM_deplin(GEN x, GEN p)
    GEN     FpM_image(GEN x, GEN p)
    GEN     FpM_intersect(GEN x, GEN y, GEN p)
    GEN     FpM_inv(GEN x, GEN p)
    GEN     FpM_invimage(GEN m, GEN v, GEN p)
    GEN     FpM_ker(GEN x, GEN p)
    GEN     FpM_mul(GEN x, GEN y, GEN p)
    long    FpM_rank(GEN x, GEN p)
    GEN     FpM_indexrank(GEN x, GEN p)
    GEN     FpM_suppl(GEN x, GEN p)
    GEN     FqM_gauss(GEN a, GEN b, GEN T, GEN p)
    GEN     FqM_ker(GEN x, GEN T, GEN p)
    GEN     FqM_suppl(GEN x, GEN T, GEN p)
    GEN     QM_inv(GEN M, GEN dM)
    GEN     ZM_inv(GEN M, GEN dM)
    GEN     concat(GEN x, GEN y)
    GEN     deplin(GEN x)
    GEN     det(GEN a)
    GEN     det0(GEN a,long flag)
    GEN     det2(GEN a)
    GEN     detint(GEN x)
    GEN     diagonal(GEN x)
    GEN     eigen(GEN x, long prec)
    GEN     shallowextract(GEN x, GEN l)
    GEN     extract0(GEN x, GEN l1, GEN l2)
    GEN     gauss(GEN a, GEN b)
    GEN     gaussmodulo(GEN M, GEN D, GEN Y)
    GEN     gaussmodulo2(GEN M, GEN D, GEN Y)
    GEN     scalarmat_s(long x, long n)
    GEN     gtomat(GEN x)
    GEN     gtrans(GEN x)
    int     hnfdivide(GEN A, GEN B)
    GEN     matid(long n)
    GEN     image(GEN x)
    GEN     image2(GEN x)
    GEN     imagecompl(GEN x)
    GEN     indexrank(GEN x)
    GEN     inverseimage(GEN mat, GEN y)
    long    isdiagonal(GEN x)
    GEN     ker(GEN x)
    GEN     keri(GEN x)
    GEN     matimage0(GEN x,long flag)
    GEN     matker0(GEN x, long flag)
    GEN     matmuldiagonal(GEN x, GEN d)
    GEN     matmultodiagonal(GEN x, GEN y)
    GEN     matsolvemod0(GEN M, GEN D, GEN Y,long flag)
    long    rank(GEN x)
    GEN     indexrank(GEN x)
    # we rename sum to pari_sum to avoid conflicts with
    # python's sum function
    GEN     pari_sum "sum"(GEN v, long a, long b)
    GEN     suppl(GEN x)
    GEN     vconcat(GEN A, GEN B)

    # alglin2.c

    GEN     ZM_to_zm(GEN z)
    GEN     adj(GEN x)
    GEN     caract(GEN x, int v)
    GEN     caradj(GEN x, long v, GEN *py)
    GEN     carhess(GEN x, long v)
    GEN     charpoly0(GEN x, int v,long flag)
    GEN     conjvec(GEN x,long prec)
    GEN     gconj(GEN x)
    GEN     gnorm(GEN x)
    GEN     gnorml1(GEN x,long prec)
    GEN     gnorml2(GEN x)
    GEN     gtrace(GEN x)
    GEN     hess(GEN x)
    GEN     hnf(GEN x)
    GEN     hnfall(GEN x)
    GEN     hnflll(GEN x)
    GEN     hnfmod(GEN x, GEN detmat)
    GEN     hnfmodid(GEN x,GEN p)
    GEN     hnfperm(GEN x)
    GEN     intersect(GEN x, GEN y)
    GEN     jacobi(GEN a, long prec)
    GEN     matfrobenius(GEN M, long flag, long v)
    GEN     matrixqz(GEN x, GEN pp)
    GEN     matrixqz0(GEN x, GEN pp)
    GEN     qfsign(GEN a)
    GEN     smith(GEN x)
    GEN     smithall(GEN x)
    GEN     smithclean(GEN z)
    GEN     qfgaussred(GEN a)
    GEN     zm_to_ZM(GEN z)
    GEN     zx_to_ZX(GEN z)

    # anal.c

    void    addhelp(char *e, char *s)
    long    delete_var()
    long    fetch_user_var(char *s)
    long    fetch_var()
    GEN     gp_read_str(char *s)
    void    kill0(char *e)
    void    name_var(long n, char *s)
    GEN     readseq(char *t)
    GEN     strtoGENstr(char *s)
    GEN     type0(GEN x)

    # arith1.c

    GEN     bestappr0(GEN x, GEN a, GEN b)
    GEN     bestappr(GEN x, GEN k)
    long    cgcd(long a,long b)
    void    check_quaddisc(GEN x, long *s, long *r, char *f)
    GEN     chinese(GEN x, GEN y)
    GEN     classno2(GEN x)
    GEN     classno(GEN x)
    long    clcm(long a,long b)
    GEN     contfrac0(GEN x, GEN b, long flag)
    GEN     fibo(long n)
    GEN     gboundcf(GEN x, long k)
    GEN     gissquareall(GEN x, GEN *pt)
    GEN     gissquare(GEN x)
    GEN     gcf2(GEN b, GEN x)
    GEN     gcf(GEN x)
    GEN     quadunit(GEN x)
    long    gisanypower(GEN x, GEN *pty)
    GEN     gisprime(GEN x, long flag)
    GEN     gispseudoprime(GEN x, long flag)
    GEN     gkronecker(GEN x, GEN y)
    GEN     gnextprime(GEN n)
    GEN     gprecprime(GEN n)
    GEN     quadregulator(GEN x, long prec)
    GEN     hclassno(GEN x)
    long    hilbert0 "hilbert"(GEN x, GEN y, GEN p)
    long    Z_isfundamental(GEN x)
    long    ispower(GEN x, GEN k, GEN *pty)
    long    isprimeAPRCL(GEN N)
    long    isprime(GEN x)
    long    ispseudoprime(GEN x, long flag)
    long    krois(GEN x, long y)
    long    kronecker(GEN x, GEN y)
    long    krosi(long s, GEN x)
    long    kross(long x, long y)
    long    krouu(ulong x, ulong y)
    GEN     lcmii(GEN a, GEN b)
    GEN     mpfact(long n)
    GEN     mpfactr(long n, long prec)
    GEN     Fp_pow(GEN a, GEN n, GEN m)
    GEN     Fp_sqrt(GEN a, GEN p)
    GEN     Fp_sqrtn(GEN a, GEN n, GEN p, GEN *zetan)
    GEN     nucomp(GEN x, GEN y, GEN l)
    GEN     nudupl(GEN x, GEN l)
    GEN     nupow(GEN x, GEN n)
    GEN     order(GEN x)
    GEN     pnqn(GEN x)
    GEN     primeform(GEN x, GEN p, long prec)
    GEN     Qfb0(GEN x, GEN y, GEN z, GEN d, long prec)
    GEN     qfbclassno0(GEN x,long flag)
    GEN     qfbred0(GEN x, long flag, GEN D, GEN isqrtD, GEN sqrtD)
    GEN     qfbsolve(GEN Q, GEN n)
    GEN     qfi(GEN x, GEN y, GEN z)
    GEN     qfr(GEN x, GEN y, GEN z, GEN d)
    GEN     quaddisc(GEN x)
    GEN     redimag(GEN x)
    GEN     redreal(GEN x)
    GEN     redrealnod(GEN x, GEN isqrtD)
    GEN     rhoreal(GEN x)
    GEN     rhorealnod(GEN x, GEN isqrtD)
    ulong   Fl_sqrt(ulong a, ulong p)
    GEN     znprimroot0(GEN m)
    GEN     znstar(GEN x)

    # arith2.c

    GEN     addprimes(GEN primes)
    long    bigomega(GEN n)
    GEN     binaire(GEN x)
    long    bittest(GEN x, long n)
    GEN     boundfact(GEN n, long lim)
    GEN     core(GEN n)
    GEN     corepartial(GEN n, long l)
    GEN     core0(GEN n,long flag)
    GEN     core2(GEN n)
    GEN     core2partial(GEN n, long l)
    GEN     coredisc(GEN n)
    GEN     coredisc0(GEN n,long flag)
    GEN     coredisc2(GEN n)
    GEN     Z_factor(GEN n)
    GEN     divisors(GEN n)
    GEN     factorint(GEN n, long flag)
    GEN     gbigomega(GEN n)
    GEN     gbitand(GEN x, GEN y)
    GEN     gbitneg(GEN x, long n)
    GEN     gbitnegimply(GEN x, GEN y)
    GEN     gbitor(GEN x, GEN y)
    GEN     gbittest(GEN x, GEN n)
    GEN     gbitxor(GEN x, GEN y)
    GEN     gissquarefree(GEN x)
    GEN     gmoebius(GEN n)
    GEN     gnumbdiv(GEN n)
    GEN     gomega(GEN n)
    GEN     gsumdiv(GEN n)
    GEN     gsumdivk(GEN n,long k)
    unsigned char*   initprimes(ulong maxnum)
    long    issquarefree(GEN x)
    ulong   maxprime()
    void    maxprime_check(ulong c)
    GEN     numbdiv(GEN n)
    long    omega(GEN n)
    GEN     geulerphi(GEN n)
    GEN     prime(long n)
    GEN     primepi(GEN x)
    GEN     primes(long n)
    GEN     removeprimes(GEN primes)
    GEN     sumdiv(GEN n)
    GEN     sumdivk(GEN n,long k)

    # base1.c

    GEN     bnfnewprec(GEN nf, long prec)
    GEN     bnrnewprec(GEN bnr, long prec)
    void    checkbid(GEN bid)
    GEN     checkbnf(GEN bnf)
    void    checkbnr(GEN bnr)
    void    checkbnrgen(GEN bnr)
    GEN     checknf(GEN nf)
    GEN     checknfelt_mod(GEN nf, GEN x, char *s)
    void    checkrnf(GEN rnf)
    GEN     galoisapply(GEN nf, GEN aut, GEN x)
    GEN     polgalois(GEN x, long prec)
    GEN     get_bnf(GEN x, long *t)
    GEN     get_bnfpol(GEN x, GEN *bnf, GEN *nf)
    GEN     get_nf(GEN x, long *t)
    GEN     get_nfpol(GEN x, GEN *nf)
    GEN     glambdak(GEN nfz, GEN s, long prec)
    GEN     gsmith(GEN x)
    GEN     gsmithall(GEN x)
    GEN     gzetak(GEN nfz, GEN s, long prec)
    GEN     gzetakall(GEN nfz, GEN s, long flag, long prec)
    GEN     mathnf0(GEN x,long flag)
    GEN     matsnf0(GEN x,long flag)
    GEN     nfinit0(GEN x, long flag, long prec)
    GEN     nfnewprec(GEN nf, long prec)
    GEN     rootsof1(GEN x)
    GEN     tschirnhaus(GEN x)

    # base2.c

    GEN     base(GEN x, GEN *y)
    GEN     base2(GEN x, GEN *y)
    void    checkmodpr(GEN modpr)
    GEN     compositum(GEN pol1, GEN pol2)
    GEN     compositum2(GEN pol1, GEN pol2)
    GEN     discf(GEN x)
    long    idealval(GEN nf,GEN ix,GEN vp)
    GEN     idealprodprime(GEN nf, GEN L)
    GEN     indexpartial(GEN P, GEN DP)
    GEN     nfbasis(GEN x, GEN *y,long flag,GEN p)
    GEN     nfbasis0(GEN x,long flag,GEN p)
    GEN     nfdisc0(GEN x,long flag, GEN p)
    GEN     nfreducemodpr(GEN nf, GEN x, GEN modpr)
    GEN     polcompositum0(GEN pol1, GEN pol2,long flag)
    GEN     idealprimedec(GEN nf,GEN p)
    GEN     rnfbasis(GEN bnf, GEN order)
    GEN     rnfdet(GEN nf, GEN order)
    GEN     rnfdiscf(GEN nf, GEN pol)
    GEN     rnfequation(GEN nf, GEN pol2)
    GEN     rnfequation0(GEN nf, GEN pol2, long flall)
    GEN     rnfequation2(GEN nf, GEN pol)
    GEN     rnfhnfbasis(GEN bnf, GEN order)
    long    rnfisfree(GEN bnf, GEN order)
    GEN     rnflllgram(GEN nf, GEN pol, GEN order,long prec)
    GEN     rnfpolred(GEN nf, GEN pol, long prec)
    GEN     rnfpolredabs(GEN nf, GEN pol, long flag)
    GEN     rnfpseudobasis(GEN nf, GEN pol)
    GEN     rnfsimplifybasis(GEN bnf, GEN order)

    # base3.c

    GEN     algtobasis(GEN nf, GEN x)
    GEN     basistoalg(GEN nf, GEN x)
    long    nfval(GEN nf, GEN x, GEN vp)
    GEN     ideallist(GEN nf,long bound)
    GEN     ideallist0(GEN nf,long bound, long flag)
    GEN     ideallistarch(GEN nf, GEN list, GEN arch)
    GEN     idealstar0(GEN nf, GEN x,long flag)
    GEN     nfdiveuc(GEN nf, GEN a, GEN b)
    GEN     nfdivrem(GEN nf, GEN a, GEN b)
    GEN     nfmod(GEN nf, GEN a, GEN b)
    GEN     reducemodinvertible(GEN x, GEN y)
    GEN     vecmodii(GEN a, GEN b)
    GEN     ideallog(GEN nf,GEN x,GEN bigideal)
    GEN     zidealstar(GEN nf, GEN x)
    GEN     znlog(GEN x, GEN g)

    # base4.c

    GEN     nfreduce(GEN nf, GEN x, GEN ideal)
    GEN     idealtwoelt(GEN nf, GEN ix)
    GEN     idealtwoelt0(GEN nf, GEN ix, GEN a)
    GEN     idealtwoelt2(GEN nf, GEN x, GEN a)
    GEN     idealadd(GEN nf, GEN x, GEN y)
    GEN     idealaddmultoone(GEN nf, GEN list)
    GEN     idealaddtoone(GEN nf, GEN x, GEN y)
    GEN     idealaddtoone0(GEN nf, GEN x, GEN y)
    GEN     idealappr(GEN nf, GEN x)
    GEN     idealappr0(GEN nf, GEN x, long fl)
    GEN     idealapprfact(GEN nf, GEN x)
    GEN     idealchinese(GEN nf, GEN x, GEN y)
    GEN     idealcoprime(GEN nf, GEN x, GEN y)
    GEN     idealdiv(GEN nf, GEN x, GEN y)
    GEN     idealdiv0(GEN nf, GEN x, GEN y,long flag)
    GEN     idealdivexact(GEN nf, GEN x, GEN y)
    GEN     idealdivpowprime(GEN nf, GEN x, GEN vp, GEN n)
    GEN     idealmulpowprime(GEN nf, GEN x, GEN vp, GEN n)
    GEN     idealfactor(GEN nf, GEN x)
    GEN     idealhnf(GEN nf, GEN x)
    GEN     idealhnf0(GEN nf, GEN a, GEN b)
    GEN     idealintersect(GEN nf, GEN x, GEN y)
    GEN     idealinv(GEN nf, GEN ix)
    GEN     idealred0(GEN nf, GEN ix, GEN vdir)
    GEN     idealmul(GEN nf, GEN ix, GEN iy)
    GEN     idealmul0(GEN nf, GEN ix, GEN iy, long flag, long prec)
    GEN     idealmulred(GEN nf, GEN ix, GEN iy)
    GEN     idealnorm(GEN nf, GEN x)
    GEN     idealpow(GEN nf, GEN ix, GEN n)
    GEN     idealpow0(GEN nf, GEN ix, GEN n, long flag, long prec)
    GEN     idealpowred(GEN nf, GEN ix, GEN n,long prec)
    GEN     idealpows(GEN nf, GEN ideal, long iexp)
    long    idealtyp(GEN *ideal, GEN *arch)
    long    isideal(GEN nf,GEN x)
    GEN     minideal(GEN nf,GEN ix,GEN vdir,long prec)
    GEN     mul_content(GEN cx, GEN cy)
    GEN     nfdetint(GEN nf,GEN pseudo)
    GEN     nfkermodpr(GEN nf, GEN x, GEN modpr)
    GEN     nfsnf(GEN nf, GEN x)
    GEN     nfsolvemodpr(GEN nf, GEN a, GEN b, GEN modpr)
    GEN     vecdiv(GEN x, GEN y)
    GEN     vecinv(GEN x)
    GEN     vecmul(GEN x, GEN y)
    GEN     vecpow(GEN x, GEN n)

    # base5.c

    GEN     matalgtobasis(GEN nf, GEN x)
    GEN     matbasistoalg(GEN nf, GEN x)
    GEN     rnfalgtobasis(GEN rnf, GEN x)
    GEN     rnfbasistoalg(GEN rnf, GEN x)
    GEN     rnfelementabstorel(GEN rnf, GEN x)
    GEN     rnfelementdown(GEN rnf, GEN x)
    GEN     rnfelementreltoabs(GEN rnf, GEN x)
    GEN     rnfelementup(GEN rnf, GEN x)
    GEN     rnfidealabstorel(GEN rnf, GEN x)
    GEN     rnfidealdown(GEN rnf, GEN x)
    GEN     rnfidealhermite(GEN rnf, GEN x)
    GEN     rnfidealmul(GEN rnf,GEN x,GEN y)
    GEN     rnfidealnormabs(GEN rnf, GEN x)
    GEN     rnfidealnormrel(GEN rnf, GEN x)
    GEN     rnfidealreltoabs(GEN rnf, GEN x)
    GEN     rnfidealtwoelement(GEN rnf,GEN x)
    GEN     rnfidealup(GEN rnf, GEN x)
    GEN     rnfinit(GEN nf, GEN pol)

    # bibli1.c

    GEN     ZM_zc_mul(GEN x, GEN y)
    GEN     ZM_zm_mul(GEN x, GEN y)
    GEN     T2_from_embed(GEN x, long r1)
    GEN     algdep(GEN x, long n)
    GEN     algdep0(GEN x, long n, long bit)
    GEN     factoredpolred(GEN x, GEN p)
    GEN     factoredpolred2(GEN x, GEN p)
    GEN     kerint(GEN x)
    GEN     lindep(GEN x)
    GEN     lindep0(GEN x, long flag)
    GEN     lindep2(GEN x, long bit)
    GEN     lll(GEN x, long prec)
    GEN     lllgen(GEN x)
    GEN     lllgram(GEN x, long prec)
    GEN     lllgramgen(GEN x)
    GEN     lllgramint(GEN x)
    GEN     lllgramkerim(GEN x)
    GEN     lllgramkerimgen(GEN x)
    GEN     lllint(GEN x)
    GEN     lllintpartial(GEN mat)
    GEN     lllkerim(GEN x)
    GEN     lllkerimgen(GEN x)
    GEN     matkerint0(GEN x,long flag)
    GEN     minim(GEN a, GEN borne, GEN stockmax)
    GEN     qfrep0(GEN a, GEN borne, long flag)
    GEN     qfminim0(GEN a, GEN borne, GEN stockmax,long flag, long prec)
    GEN     minim2(GEN a, GEN borne, GEN stockmax)
    GEN     ordred(GEN x)
    GEN     perf(GEN a)
    GEN     polred(GEN x)
    GEN     polred0(GEN x, long flag, GEN p)
    GEN     polred2(GEN x)
    GEN     polredabs(GEN x)
    GEN     polredabs0(GEN x, long flag)
    GEN     polredabs2(GEN x)
    GEN     polredabsall(GEN x, long flun)
    GEN     qflll0(GEN x, long flag)
    GEN     qflllgram0(GEN x, long flag)
    GEN     smallpolred(GEN x)
    GEN     smallpolred2(GEN x)
    char    *stackmalloc(size_t N)
    GEN     zncoppersmith(GEN P0, GEN N, GEN X, GEN B)

    # bibli2.c

    GEN     binomial(GEN x, long k)
    int     cmp_prime_ideal(GEN x, GEN y)
    int     cmp_prime_over_p(GEN x, GEN y)
    GEN     convol(GEN x, GEN y)
    GEN     polcyclo(long n, long v)
    GEN     dirdiv(GEN x, GEN y)
    GEN     dirmul(GEN x, GEN y)
    GEN     dirzetak(GEN nf, GEN b)
    long    gen_search(GEN x, GEN y, int flag, int (*cmp)(GEN,GEN))
    GEN     gen_setminus(GEN set1, GEN set2, int (*cmp)(GEN,GEN))
    GEN     gen_sort(GEN x, int flag, int (*cmp)(GEN,GEN))
    GEN     genrand(GEN N)
    GEN     getheap()
    GEN     getrand()
    long    getstack()
    long    gettime()
    GEN     gprec(GEN x, long l)
    GEN     gprec_w(GEN x, long pr)
    GEN     ggrando(GEN x, long n)
    GEN     gtoset(GEN x)
    GEN     indexlexsort(GEN x)
    GEN     indexsort(GEN x)
    GEN     laplace(GEN x)
    GEN     pollegendre(long n, long v)
    GEN     lexsort(GEN x)
    GEN     mathilbert(long n)
    GEN     matqpascal(long n, GEN q)
    GEN     numtoperm(long n, GEN x)
    GEN     permtonum(GEN x)
    GEN     polint(GEN xa, GEN ya, GEN x, GEN *dy)
    GEN     polrecip(GEN x)
    GEN     modreverse(GEN x)
    GEN     roots_to_pol(GEN a, long v)
    GEN     setintersect(GEN x, GEN y)
    long    setisset(GEN x)
    GEN     setminus(GEN x, GEN y)
    void    setrand(GEN seed)
    long    setsearch(GEN x, GEN y, long flag)
    GEN     setunion(GEN x, GEN y)
    GEN     indexlexsort(GEN x)
    GEN     indexsort(GEN x)
    GEN     sort(GEN x)
    long    tablesearch(GEN T, GEN x, int (*cmp)(GEN,GEN))
    GEN     tayl(GEN x, long v, long precdl)
    GEN     polchebyshev1(long n, long v)
    GEN     vecsort(GEN x, GEN k)
    GEN     vecsort0(GEN x, GEN k, long flag)

    # buch1.c

    GEN     buchimag(GEN D, GEN gcbach, GEN gcbach2, GEN gCO)
    GEN     buchreal(GEN D, GEN gsens, GEN gcbach, GEN gcbach2, GEN gRELSUP, long prec)
    GEN     cgetalloc(long t, size_t l)
    GEN     quadclassunit0(GEN x, long flag,GEN data, long prec)
    GEN     quadhilbert(GEN D, long prec)
    GEN     quadray(GEN bnf, GEN f, GEN flag, long prec)

    # buch2.c
    
    GEN     bnfinit0(GEN P,long flag,GEN data,long prec)
    GEN     check_and_build_obj(GEN S, int tag, GEN (*build)(GEN))
    GEN     isprincipal(GEN bignf, GEN x)
    GEN     bnfisprincipal0(GEN bignf, GEN x,long flall)
    GEN     isprincipalfact(GEN bnf,GEN P, GEN e, GEN C, long flag)
    GEN     isprincipalforce(GEN bignf,GEN x)
    GEN     isprincipalgen(GEN bignf, GEN x)
    GEN     isprincipalgenforce(GEN bignf,GEN x)
    GEN     bnfisunit(GEN bignf, GEN x)
    GEN     regulator(GEN P,GEN data,long prec)
    GEN     signunits(GEN bignf)

    # buch3.c

    GEN     bnrconductor(GEN arg0,GEN arg1,GEN arg2,GEN flag)
    GEN     bnrconductorofchar(GEN bnr,GEN chi)
    GEN     bnrdisc0(GEN arg0, GEN arg1, GEN arg2, long flag)
    GEN     bnrdisclist0(GEN bnf,GEN borne, GEN arch, long all)
    long    bnrisconductor(GEN arg0,GEN arg1,GEN arg2)
    GEN     buchnarrow(GEN bignf)
    long    bnfcertify(GEN bnf)
    GEN     conductor(GEN bnr,GEN subgroup,long all)
    GEN     decodemodule(GEN nf, GEN fa)
    GEN     discrayabs(GEN bnr,GEN subgroup)
    GEN     discrayabscond(GEN bnr,GEN subgroup)
    GEN     discrayabslist(GEN bnf,GEN listes)
    GEN     discrayabslistarch(GEN bnf, GEN arch, long bound)
    GEN     discrayabslistlong(GEN bnf, long bound)
    GEN     discrayrel(GEN bnr,GEN subgroup)
    GEN     discrayrelcond(GEN bnr,GEN subgroup)
    GEN     isprincipalray(GEN bignf, GEN x)
    GEN     bnrisprincipal(GEN bignf, GEN x,long flall)
    GEN     isprincipalraygen(GEN bignf, GEN x)
    GEN     bnrclassno(GEN bignf,GEN ideal)
    GEN     bnrclassnolist(GEN bnf,GEN listes)
    GEN     rnfconductor(GEN bnf, GEN polrel, long flag)
    GEN     rnfnormgroup(GEN bnr, GEN polrel)
    GEN     subgrouplist0(GEN bnr, GEN indexbound, long all)

    # buch4.c

    GEN     bnfisnorm(GEN bnf, GEN x, long flag)
    GEN     rnfisnorm(GEN S, GEN x, long flag)
    GEN     rnfisnorminit(GEN T, GEN relpol, int galois)
    GEN     bnfissunit(GEN bnf,GEN suni,GEN x)
    GEN     bnfsunit(GEN bnf,GEN s,long PREC)
    long    nfhilbert(GEN bnf,GEN a,GEN b)
    long    nfhilbert0(GEN bnf,GEN a,GEN b,GEN p)

    # default.c

    extern int d_SILENT, d_ACKNOWLEDGE, d_INITRC, d_RETURN
    GEN     default0(char *a, char *b)
    long    getrealprecision()
    GEN     sd_TeXstyle(char *v, long flag)
    GEN     sd_breakloop(char *v, long flag)
    GEN     sd_colors(char *v, long flag)
    GEN     sd_compatible(char *v, long flag)
    GEN     sd_datadir(char *v, long flag)
    GEN     sd_debug(char *v, long flag)
    GEN     sd_debugfiles(char *v, long flag)
    GEN     sd_debugmem(char *v, long flag)
    GEN     sd_echo(char *v, long flag)
    GEN     sd_factor_add_primes(char *v, long flag)
    GEN     sd_factor_proven(char *v, long flag)
    GEN     sd_format(char *v, long flag)
    GEN     sd_graphcolormap(char *v, long flag)
    GEN     sd_graphcolors(char *v, long flag)
    GEN     sd_help(char *v, long flag)
    GEN     sd_histsize(char *v, long flag)
    GEN     sd_lines(char *v, long flag)
    GEN     sd_log(char *v, long flag)
    GEN     sd_logfile(char *v, long flag)
    GEN     sd_new_galois_format(char *v, long flag)
    GEN     sd_output(char *v, long flag)
    GEN     sd_parisize(char *v, long flag)
    GEN     sd_path(char *v, long flag)
    GEN     sd_prettyprinter(char *v, long flag)
    GEN     sd_primelimit(char *v, long flag)
    GEN     sd_prompt(char *v, long flag)
    GEN     sd_prompt_cont(char *v, long flag)
    GEN     sd_psfile(char *v, long flag)
    GEN     sd_realprecision(char *v, long flag)
    GEN     sd_recover(char *v, long flag)
    GEN     sd_rl(char *v, long flag)
    GEN     sd_secure(char *v, long flag)
    GEN     sd_seriesprecision(char *v, long flag)
    GEN     sd_simplify(char *v, long flag)
    GEN     sd_strictmatch(char *v, long flag)
    GEN     sd_timer(char *v, long flag)
    long    setrealprecision(long n, long *prec)

    # ellanal.c

    GEN     ellanalyticrank(GEN e, GEN eps, long prec)
    GEN     ellL1(GEN e, long r, long prec)

    # elliptic.c

    GEN     addell(GEN e, GEN z1, GEN z2)
    GEN     akell(GEN e, GEN n)
    GEN     anell(GEN e, long n)
    GEN     ellap(GEN e, GEN p)
    GEN     bilhell(GEN e, GEN z1, GEN z2, long prec)
    GEN     ellchangecurve(GEN e, GEN ch)
    GEN     ellap0(GEN e, GEN p, long flag)
    GEN     elleisnum(GEN om, long k, long flag, long prec)
    GEN     elleta(GEN om, long prec)
    GEN     ellheight0(GEN e, GEN a, long flag,long prec)
    GEN     ellinit0(GEN x,long flag,long prec)
    GEN     ellminimalmodel(GEN E, GEN *ptv)
    long    ellrootno(GEN e, GEN p)
    GEN     ellsigma(GEN om, GEN z, long flag, long prec)
    GEN     elltors0(GEN e, long flag)
    GEN     ellwp0(GEN e, GEN z, long flag, long precdl, long prec)
    GEN     ellzeta(GEN om, GEN z, long prec)
    GEN     ghell(GEN e, GEN a, long prec)
    GEN     ellglobalred(GEN e1)
    GEN     elllocalred(GEN e, GEN p1)
    GEN     elllseries(GEN e, GEN s, GEN A, long prec)
    GEN     mathell(GEN e, GEN x, long prec)
    int     oncurve(GEN e, GEN z)
    GEN     ellordinate(GEN e, GEN x, long prec)
    GEN     orderell(GEN e, GEN p)
    GEN     ellchangepoint(GEN x, GEN ch)
    GEN     pointell(GEN e, GEN z, long prec)
    GEN     powell(GEN e, GEN z, GEN n)
    GEN     subell(GEN e, GEN z1, GEN z2)
    GEN     taniyama(GEN e)
    GEN     weipell(GEN e, long precdl)
    GEN     zell(GEN e, GEN z, long prec)

    # es.c
    
    GEN     GENtoGENstr(GEN x)
    char*   GENtoTeXstr(GEN x)
    char*   GENtostr(GEN x)
    GEN     Str(GEN g)
    GEN     Strchr(GEN g)
    GEN     Strexpand(GEN g)
    GEN     Strtex(GEN g)
    void    brute(GEN g, char format, long dec)
    void    dbgGEN(GEN x, long nb)
    int     file_is_binary(FILE *f)
    void    gpwritebin(char *filename, GEN x)
    GEN     gp_read_file(char *filename)
    GEN     gp_read_str(char *s)
    void    killallfiles(int check)
    GEN     gp_read_stream(FILE *f)
    void    matbrute(GEN g, char format, long dec)
    char*   os_getenv(char *s)
    void    (*os_signal(int sig, void (*f)(int)))(int)
    void    outmat(GEN x)
    void    output(GEN x)
    char*   pari_strdup(char *s)
    char*   pari_strndup(char *s, long n)
    char*   pari_unique_filename(char *s)
    void    pari_unlink(char *s)
    void    pari_flush()
    void    pari_putc(char c)
    void    pari_puts(char *s)
    #void    print(GEN g)   # syntax error
    void    print1(GEN g)
    void    printtex(GEN g)
    GEN     readbin(char *name, FILE *f)
    void    switchin(char *name)
    void    switchout(char *name)
    void    texe(GEN g, char format, long dec)
    char*   type_name(long t)
    void    write0(char *s, GEN g)
    void    write1(char *s, GEN g)
    void    writetex(char *s, GEN g)

    # galconj.c

    GEN     checkgal(GEN gal)
    GEN     galoisconj0(GEN nf, long flag, GEN d, long prec)
    GEN     galoisexport(GEN gal, long format)
    GEN     galoisfixedfield(GEN gal, GEN v, long flag, long y)
    GEN     galoisidentify(GEN gal)
    GEN     galoisinit(GEN nf, GEN den)
    GEN     galoisisabelian(GEN gal, long flag)
    long    galoisisnormal(GEN gal, GEN sub)
    GEN     galoispermtopol(GEN gal, GEN perm)
    GEN     galoissubgroups(GEN G)
    GEN     galoissubfields(GEN G, long flag, long v)
    long    numberofconjugates(GEN T, long pdepart)
    GEN     vandermondeinverse(GEN L, GEN T, GEN den, GEN prep)
    
    # gen1.c

    GEN     gadd(GEN x, GEN y)
    GEN     gaddsg(long x, GEN y)
    GEN     gdiv(GEN x, GEN y)
    GEN     gmul(GEN x, GEN y)
    GEN     gsqr(GEN x)
    GEN     gsub(GEN x, GEN y)

    # gen2.c
    
    GEN     ZX_mul(GEN x, GEN y)
    GEN     cgetp(GEN x)
    GEN     cvtop(GEN x, GEN p, long l)
    GEN     cvtop2(GEN x, GEN y)
    GEN     gabs(GEN x, long prec)
    void    gaffect(GEN x, GEN y)
    void    gaffsg(long s, GEN x)
    GEN     gclone(GEN x)
    int     gcmp(GEN x, GEN y)
    int     gcmpsg(long x, GEN y)
    int     gequal0(GEN x)
    int     gequal1(GEN x)
    int     gequalm1(GEN x)
    GEN     gcvtop(GEN x, GEN p, long r)
    int     gequal(GEN x, GEN y)
    int     gequalsg(long s, GEN x)
    long    gexpo(GEN x)
    long    ggval(GEN x, GEN p)
    long    glength(GEN x)
    GEN     gmax(GEN x, GEN y)
    GEN     gmin(GEN x, GEN y)
    GEN     gneg(GEN x)
    GEN     gneg_i(GEN x)
    GEN     greffe(GEN x, long l, long use_stack)
    int     gsigne(GEN x)
    GEN     gtofp(GEN z, long prec)
    GEN     gtolist(GEN x)
    long    gtolong(GEN x)
    int     lexcmp(GEN x, GEN y)
    GEN     listcreate()
    GEN     listinsert(GEN list, GEN object, long index)
    void    listkill(GEN list)
    GEN     listput(GEN list, GEN object, long index)
    GEN     listsort(GEN list, long flag)
    GEN     matsize(GEN x)
    GEN     normalize(GEN x)
    GEN     normalizepol(GEN x)
    long    sizedigit(GEN x)
    long    u_lval(ulong x, ulong p)
    long    u_lvalrem(ulong x, ulong p, ulong *py)
    long    u_pvalrem(ulong x, GEN p, ulong *py)
    GEN     vecmax(GEN x)
    GEN     vecmin(GEN x)
    long    Z_lval(GEN n, ulong p)
    long    Z_lvalrem(GEN n, ulong p, GEN *py)
    long    z_pval(long n, GEN p)
    long    Z_pval(GEN n, GEN p)
    long    Z_pvalrem(GEN x, GEN p, GEN *py)

    # gen3.c

    GEN     ceil_safe(GEN x)
    GEN     ceilr(GEN x)
    GEN     centerlift(GEN x)
    GEN     centerlift0(GEN x,long v)
    GEN     compo(GEN x, long n)
    GEN     deg1pol(GEN x1, GEN x0,long v)
    long    degree(GEN x)
    GEN     denom(GEN x)
    GEN     deriv(GEN x, long v)
    GEN     RgX_deriv(GEN x)
    GEN     derivser(GEN x)
    GEN     diviiround(GEN x, GEN y)
    GEN     divrem(GEN x, GEN y, long v)
    GEN     gand(GEN x, GEN y)
    GEN     gceil(GEN x)
    GEN     gcvtoi(GEN x, long *e)
    GEN     gdivent(GEN x, GEN y)
    GEN     gdiventres(GEN x, GEN y)
    GEN     gdivgs(GEN x, long s)
    GEN     gdivmod(GEN x, GEN y, GEN *pr)
    GEN     gdivround(GEN x, GEN y)
    GEN     geq(GEN x, GEN y)
    GEN     geval(GEN x)
    GEN     gfloor(GEN x)
    GEN     gfrac(GEN x)
    GEN     gge(GEN x, GEN y)
    GEN     ggrando(GEN x, long n)
    GEN     ggt(GEN x, GEN y)
    GEN     gimag(GEN x)
    GEN     ginv(GEN x)
    GEN     gle(GEN x, GEN y)
    GEN     glt(GEN x, GEN y)
    GEN     gmod(GEN x, GEN y)
    GEN     gmodulo(GEN x,GEN y)
    GEN     gmodgs(GEN x, long y)
    GEN     gmodulo(GEN x,GEN y)
    GEN     gmodulsg(long x, GEN y)
    GEN     gmodulss(long x, long y)
    GEN     gmul2n(GEN x, long n)
    GEN     gmulsg(long s, GEN y)
    GEN     gne(GEN x, GEN y)
    GEN     gnot(GEN x)
    GEN     gor(GEN x, GEN y)
    GEN     gpolvar(GEN y)
    long    gprecision(GEN x)
    GEN     gram_matrix(GEN M)
    GEN     greal(GEN x)
    GEN     grndtoi(GEN x, long *e)
    GEN     ground(GEN x)
    GEN     gshift(GEN x, long n)
    GEN     gsubst(GEN x, long v, GEN y)
    GEN     gsubstpol(GEN x, GEN v, GEN y)
    GEN     gsubstvec(GEN x, GEN v, GEN y)
    GEN     gtocol(GEN x)
    GEN     gtocol0(GEN x, long n)
    GEN     gtopoly(GEN x, long v)
    GEN     gtopolyrev(GEN x, long v)
    GEN     gtoser(GEN x, long v, long precdl)
    GEN     gtovec(GEN x)
    GEN     gtovec0(GEN x, long n)
    GEN     gtovecrev(GEN x)
    GEN     gtovecrev0(GEN x, long n)
    GEN     gtovecsmall(GEN x)
    GEN     gtovecsmall0(GEN x, long n)
    GEN     gtrunc(GEN x)
    int     gvar(GEN x)
    int     gvar2(GEN x)
    GEN     hqfeval(GEN q, GEN x)
    GEN     imag_i(GEN x)
    GEN     int2n(long n)
    GEN     integ(GEN x, long v)
    int     iscomplex(GEN x)
    int     isexactzero(GEN g)
    int     isinexact(GEN x)
    int     isinexactreal(GEN x)
    long    isint(GEN n, long *ptk)
    int     issmall(GEN n, long *ptk)
    GEN     lift(GEN x)
    GEN     lift0(GEN x,long v)
    GEN     lift_intern0(GEN x,long v)
    GEN     truncr(GEN x)
    GEN     mkcoln(long n, ...)
    GEN     mkintn(long n, ...)
    GEN     mkpoln(long n, ...)
    GEN     mkvecn(long n, ...)
    GEN     numer(GEN x)
    GEN     padicappr(GEN f, GEN a)
    long    padicprec(GEN x, GEN p)
    GEN     polcoeff0(GEN x,long n,long v)
    GEN     polcoeff_i(GEN x, long n, long v)
    long    poldegree(GEN x,long v)
    GEN     poleval(GEN x, GEN y)
    GEN     pollead(GEN x,long v)
    long    precision(GEN x)
    GEN     precision0(GEN x,long n)
    GEN     qfeval(GEN q, GEN x)
    GEN     real_i(GEN x)
    GEN     real2n(long n, long prec)
    GEN     recip(GEN x)
    GEN     round0(GEN x, GEN *pte)
    GEN     roundr(GEN x)
    GEN     scalarpol(GEN x, long v)
    GEN     scalarser(GEN x, long v, long prec)
    GEN     simplify(GEN x)
    GEN     tayl(GEN x, long v, long precdl)
    GEN     toser_i(GEN x)
    GEN     trunc0(GEN x, GEN *pte)

    # groupid.c

    long    group_ident(GEN G, GEN S)

    # hash.c

    ulong   hash_GEN(GEN x)

    # ifactor1.c

    int     is_357_power(GEN x, GEN *pt, ulong *mask)
    int     is_pth_power(GEN x, GEN *pt, ulong *curexp, ulong cutoffbits)
    GEN     nextprime(GEN n)
    GEN     precprime(GEN n)

    # init.c

    long    allocatemoremem(size_t newsize)
    GEN     changevar(GEN x, GEN y)
    void    pari_err(long numerr, ...)
    long    err_catch(long errnum, jmp_buf *penv)
    GEN     gcopy(GEN x)
    void    gunclone(GEN x)
    void    msgtimer(char *format, ...)
    GEN     newblock(long n)
    void    pari_close()
    void    pari_init(size_t parisize, ulong maxprime)
    void    pari_init_opts(size_t parisize, ulong maxprime, ulong init_opts)
    void    stackdummy(GEN x, long l)
    long    gsizebyte(GEN x)
    long    gsizeword(GEN x)
    long    timer()
    long    timer2()

    # intnum.c

    GEN     intcirc(void *E, GEN (*eval) (GEN, void *), GEN a, GEN R, GEN tab, long prec)
    GEN     intfouriercos(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, GEN x, GEN tab, long prec)
    GEN     intfourierexp(void *E, GEN (*eval)(GEN, void*), GEN a, GEN b, GEN x, GEN tab, long prec)
    GEN     intfouriersin(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, GEN x, GEN tab, long prec)
    GEN     intfuncinit(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, long m, long flag, long prec)
    GEN     intlaplaceinv(void *E, GEN (*eval) (GEN, void *), GEN sig, GEN x, GEN tab, long prec)
    GEN     intmellininv(void *E, GEN (*eval) (GEN, void *), GEN sig, GEN x, GEN tab, long prec)
    GEN     intmellininvshort(GEN sig, GEN x, GEN tab, long prec)
    GEN     intnum(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, GEN tab, long prec)
    GEN     intnuminit(GEN a, GEN b, long m, long prec)
    GEN     intnuminitgen(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, long m, long flext, long prec)
    GEN     intnumromb(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, long flag, long prec)
    long    intnumstep(long prec)
    GEN     sumnum(void *E, GEN (*f) (GEN, void *), GEN a, GEN sig, GEN tab, long flag, long prec)
    GEN     sumnumalt(void *E, GEN (*f) (GEN, void *), GEN a, GEN s, GEN tab, long flag, long prec)
    GEN     sumnuminit(GEN sig, long m, long sgn, long prec)

    # kummer.c

    GEN     rnfkummer(GEN bnr, GEN subgroup, long all, long prec)

    # members.c

    GEN     member_a1(GEN x)
    GEN     member_a2(GEN x)
    GEN     member_a3(GEN x)
    GEN     member_a4(GEN x)
    GEN     member_a6(GEN x)
    GEN     member_area(GEN x)
    GEN     member_b2(GEN x)
    GEN     member_b4(GEN x)
    GEN     member_b6(GEN x)
    GEN     member_b8(GEN x)
    GEN     member_bnf(GEN x)
    GEN     member_c4(GEN x)
    GEN     member_c6(GEN x)
    GEN     member_clgp(GEN x)
    GEN     member_codiff(GEN x)
    GEN     member_cyc(GEN clg)
    GEN     member_diff(GEN x)
    GEN     member_disc(GEN x)
    GEN     member_e(GEN x)
    GEN     member_eta(GEN x)
    GEN     member_f(GEN x)
    GEN     member_fu(GEN x)
    GEN     member_futu(GEN x)
    GEN     member_gen(GEN x)
    GEN     member_group(GEN x)
    GEN     member_index(GEN x)
    GEN     member_j(GEN x)
    GEN     member_mod(GEN x)
    GEN     member_nf(GEN x)
    GEN     member_no(GEN clg)
    GEN     member_omega(GEN x)
    GEN     member_orders(GEN x)
    GEN     member_p(GEN x)
    GEN     member_pol(GEN x)
    GEN     member_reg(GEN x)
    GEN     member_roots(GEN x)
    GEN     member_sign(GEN x)
    GEN     member_t2(GEN x)
    GEN     member_tate(GEN x)
    GEN     member_tufu(GEN x)
    GEN     member_tu(GEN x)
    GEN     member_w(GEN x)
    GEN     member_zk(GEN x)
    GEN     member_zkst(GEN bid)

    # mp.c

    int     absi_cmp(GEN x, GEN y)
    int     absi_equal(GEN x, GEN y)
    int     absr_cmp(GEN x, GEN y)
    GEN     addii_sign(GEN x, long sx, GEN y, long sy)
    GEN     addir_sign(GEN x, long sx, GEN y, long sy)
    GEN     addrr_sign(GEN x, long sx, GEN y, long sy)
    GEN     addsi_sign(long x, GEN y, long sy)
    GEN     addsr(long x, GEN y)
    GEN     addss(long x, long y)
    void    affir(GEN x, GEN y)
    void    affrr(GEN x, GEN y)
    GEN     bezout(GEN a, GEN b, GEN *u, GEN *v)
    long    cbezout(long a,long b,long *uu,long *vv)
    int     cmpii(GEN x, GEN y)
    int     cmprr(GEN x, GEN y)
    int     cmpsi(long x, GEN y)
    int     cmpui(ulong x, GEN y)
    GEN     dbltor(double x)
    GEN     diviiexact(GEN x, GEN y)
    GEN     diviuexact(GEN x, ulong y)
    GEN     divir(GEN x, GEN y)
    GEN     divis(GEN y, long x)
    GEN     divis_rem(GEN x, long y, long *rem)
    GEN     diviu_rem(GEN y, ulong x, ulong *rem)
    GEN     divri(GEN x, GEN y)
    GEN     divrr(GEN x, GEN y)
    GEN     divrs(GEN x, long y)
    GEN     divsi(long x, GEN y)
    GEN     divsr(long x, GEN y)
    GEN     dvmdii(GEN x, GEN y, GEN *z)
    int     equalii(GEN x, GEN y)
    GEN     floorr(GEN x)
    GEN     gcdii(GEN x, GEN y)
    GEN     int_normalize(GEN x, long known_zero_words)
    int     invmod(GEN a, GEN b, GEN *res)
    ulong   Fl_inv(ulong x, ulong p)
    GEN     modii(GEN x, GEN y)
    void    modiiz(GEN x, GEN y, GEN z)
    GEN     mulii(GEN x, GEN y)
    GEN     mulir(GEN x, GEN y)
    GEN     mulrr(GEN x, GEN y)
    GEN     mulsi(long x, GEN y)
    GEN     mulsr(long x, GEN y)
    GEN     mulss(long x, long y)
    GEN     mului(ulong x, GEN y)
    GEN     mulur(ulong x, GEN y)
    GEN     muluu(ulong x, ulong y)
    GEN     randomi(GEN x)
    int     ratlift(GEN x, GEN m, GEN *a, GEN *b, GEN amax, GEN bmax)
    double  rtodbl(GEN x)
    GEN     shifti(GEN x, long n)
    GEN     sqri(GEN x)
    #define sqrti(x) sqrtremi((x),NULL)
    GEN     sqrtremi(GEN S, GEN *R)
    GEN     subsr(long x, GEN y)
    GEN     truedvmdii(GEN x, GEN y, GEN *z)
    ulong   umodiu(GEN y, ulong x)
    long    vals(ulong x)

    # nffactor.c

    GEN     nffactor(GEN nf,GEN x)
    GEN     nffactormod(GEN nf,GEN pol,GEN pr)
    GEN     nfroots(GEN nf,GEN pol)
    GEN     rnfcharpoly(GEN nf,GEN T,GEN alpha,int n)
    GEN     rnfdedekind(GEN nf,GEN T,GEN pr)

    # part.c

    GEN     numbpart(GEN x)

    # perm.c

    GEN     abelian_group(GEN G)
    GEN     cyclicgroup(GEN g, long s)
    GEN     cyc_pow(GEN cyc, long exp)
    GEN     cyc_pow_perm(GEN cyc, long exp)
    GEN     dicyclicgroup(GEN g1, GEN g2, long s1, long s2)
    GEN     group_abelianHNF(GEN G, GEN L)
    GEN     group_abelianSNF(GEN G, GEN L)
    long    group_domain(GEN G)
    GEN     group_elts(GEN G, long n)
    GEN     group_export(GEN G, long format)
    long    group_isA4S4(GEN G)
    long    group_isabelian(GEN G)
    GEN     group_leftcoset(GEN G, GEN g)
    long    group_order(GEN G)
    long    group_perm_normalize(GEN N, GEN g)
    GEN     group_quotient(GEN G, GEN H)
    GEN     group_rightcoset(GEN G, GEN g)
    GEN     group_subgroups(GEN G)
    GEN     groupelts_center(GEN S)
    GEN     groupelts_abelian_group(GEN S)
    int     perm_commute(GEN p, GEN q)
    GEN     perm_cycles(GEN v)
    long    perm_order(GEN perm)
    GEN     perm_pow(GEN perm, long exp)
    GEN     quotient_group(GEN C, GEN G)
    GEN     quotient_perm(GEN C, GEN p)
    GEN     vecperm_orbits(GEN v, long n)
    void    vecsmall_sort(GEN V)
    GEN     vecsmall_uniq(GEN V)
    GEN     vecvecsmall_indexsort(GEN x)
    GEN     vecvecsmall_sort(GEN x)
    long    vecvecsmall_search(GEN x, GEN y, long flag)

    # polarit1.c

    long    Flx_nbfact(GEN z, ulong p)
    long    Flx_nbroots(GEN f, ulong p)
    GEN     FpX_degfact(GEN f, GEN p)
    long    FpX_is_irred(GEN f, GEN p)
    long    FpX_is_squarefree(GEN f, GEN p)
    long    FpX_is_totally_split(GEN f, GEN p)
    GEN     FpX_factor(GEN f, GEN p)
    long    FpX_nbfact(GEN f, GEN p)
    long    FpX_nbroots(GEN f, GEN p)
    GEN     FpXQX_gcd(GEN P, GEN Q, GEN T, GEN p)
    GEN     FqX_factor(GEN x, GEN T, GEN p)
    GEN     FqX_gcd(GEN P, GEN Q, GEN T, GEN p)
    long    FqX_is_squarefree(GEN P, GEN T, GEN p)
    long    FqX_nbfact(GEN u, GEN T, GEN p)
    long    FqX_nbroots(GEN f, GEN T, GEN p)
    GEN     random_FpX(long d, long v, GEN p)
    GEN     FpX_roots(GEN f, GEN p)
    GEN     padicappr(GEN f, GEN a)
    GEN     factcantor(GEN x, GEN p)
    GEN     factmod(GEN f, GEN p)
    GEN     factorff(GEN f, GEN p, GEN a)
    GEN     factormod0(GEN f, GEN p, long flag)
    GEN     factorpadic0(GEN f,GEN p,long r,long flag)
    GEN     factorpadic(GEN x, GEN p, long r)
    int     gdvd(GEN x, GEN y)
    GEN     poldivrem(GEN x, GEN y, GEN *pr)
    GEN     rootmod(GEN f, GEN p)
    GEN     rootmod0(GEN f, GEN p,long flag)
    GEN     rootmod2(GEN f, GEN p)
    GEN     rootpadic(GEN f, GEN p, long r)
    GEN     rootpadicfast(GEN f, GEN p, long e)
    GEN     simplefactmod(GEN f, GEN p)

    # polarit2.c

    GEN     Q_content(GEN x)
    GEN     Q_denom(GEN x)
    GEN     Q_div_to_int(GEN x, GEN c)
    GEN     Q_muli_to_int(GEN x, GEN d)
    GEN     Q_primitive_part(GEN x, GEN *ptc)
    GEN     Q_primpart(GEN x)
    GEN     Q_remove_denom(GEN x, GEN *ptd)
    GEN     RgX_extgcd(GEN x, GEN y, GEN *U, GEN *V)
    GEN     ZX_squff(GEN f, GEN *ex)
    GEN     centermod(GEN x, GEN p)
    GEN     centermod_i(GEN x, GEN p, GEN ps2)
    GEN     centermodii(GEN x, GEN p, GEN po2)
    GEN     content(GEN x)
    GEN     deg1_from_roots(GEN L, long v)
    GEN     discsr(GEN x)
    GEN     divide_conquer_prod(GEN x, GEN (*mul)(GEN,GEN))
    GEN     factor(GEN x)
    GEN     factor0(GEN x,long flag)
    GEN     factorback(GEN fa,GEN nf)
    GEN     gbezout(GEN x, GEN y, GEN *u, GEN *v)
    GEN     ggcd0(GEN x, GEN )
    GEN     gdeflate(GEN x, long v, long d)
    GEN     gdivexact(GEN x, GEN y)
    GEN     ggcd(GEN x, GEN y)
    GEN     ginvmod(GEN x, GEN y)
    GEN     gisirreducible(GEN x)
    GEN     glcm(GEN x, GEN y)
    GEN     glcm0(GEN x, GEN y)
    GEN     gen_pow(GEN,GEN,void*,GEN (*sqr)(void*,GEN),GEN (*mul)(void*,GEN,GEN))
    GEN     gen_pow_u(GEN x, ulong n, void *data, GEN (*sqr)(void*,GEN), GEN (*mul)(void*,GEN,GEN))
    long    logint(GEN B, GEN y, GEN *ptq)
    GEN     newtonpoly(GEN x, GEN p)
    GEN     nfgcd(GEN P, GEN Q, GEN nf, GEN den)
    GEN     nfisincl(GEN a, GEN b)
    GEN     nfisisom(GEN a, GEN b)
    GEN     nfrootsQ(GEN x)
    GEN     poldisc0(GEN x, long v)
    GEN     polfnf(GEN a, GEN t)
    GEN     polhensellift(GEN pol, GEN fct, GEN p, long exp)
    GEN     polresultant0(GEN x, GEN y,long v,long flag)
    GEN     polsym(GEN x, long n)
    GEN     primitive_part(GEN x, GEN *c)
    GEN     primpart(GEN x)
    GEN     quadgen(GEN x)
    GEN     quadpoly(GEN x)
    GEN     quadpoly0(GEN x, long v)
    GEN     reduceddiscsmith(GEN pol)
    GEN     resultant2(GEN x, GEN y)
    GEN     roots_from_deg1(GEN x)
    GEN     sort_factor(GEN y, int (*cmp)(GEN,GEN))
    GEN     sort_factor_gen(GEN y, int (*cmp)(GEN,GEN))
    GEN     sort_vecpol(GEN a, int (*cmp)(GEN,GEN))
    GEN     srgcd(GEN x, GEN y)
    long    sturmpart(GEN x, GEN a, GEN b)
    GEN     subresext(GEN x, GEN y, GEN *U, GEN *V)
    GEN     sylvestermatrix(GEN x,GEN y)
    GEN     vecbezout(GEN x, GEN y)
    GEN     vecbezoutres(GEN x, GEN y)

    # polarit3.c

    GEN     Fp_pows(GEN A, long k, GEN N)
    GEN     Fp_powu(GEN x, ulong k, GEN p)
    GEN     FpM_red(GEN z, GEN p)
    GEN     FpM_to_mod(GEN z, GEN p)
    GEN     FpV_polint(GEN xa, GEN ya, GEN p)
    GEN     FpV_red(GEN z, GEN p)
    GEN     FpV_roots_to_pol(GEN V, GEN p, long v)
    GEN     FpV_to_mod(GEN z, GEN p)
    GEN     FpX_Fp_add(GEN y,GEN x,GEN p)
    GEN     FpX_Fp_mul(GEN y,GEN x,GEN p)
    GEN     FpX_add(GEN x,GEN y,GEN p)
    GEN     FpX_center(GEN T,GEN mod)
    GEN     FpX_chinese_coprime(GEN x,GEN y,GEN Tx,GEN Ty,GEN Tz,GEN p)
    GEN     FpX_divrem(GEN x, GEN y, GEN p, GEN *pr)
    GEN     FpX_eval(GEN x,GEN y,GEN p)
    GEN     FpX_extgcd(GEN x, GEN y, GEN p, GEN *ptu, GEN *ptv)
    GEN     FpX_factorff_irred(GEN P, GEN Q, GEN l)
    void    FpX_ffintersect(GEN P,GEN Q,long n,GEN l,GEN *SP,GEN *SQ,GEN MA,GEN MB)
    GEN     FpX_ffisom(GEN P,GEN Q,GEN l)
    GEN     FpX_gcd(GEN x, GEN y, GEN p)
    GEN     FpX_mul(GEN x,GEN y,GEN p)
    GEN     FpX_neg(GEN x,GEN p)
    GEN     FpX_normalize(GEN z, GEN p)
    GEN     FpX_red(GEN z, GEN p)
    GEN     FpX_sqr(GEN x,GEN p)
    GEN     FpX_sub(GEN x,GEN y,GEN p)
    GEN     FpX_to_mod(GEN z, GEN p)
    GEN     FpXQ_charpoly(GEN x, GEN T, GEN p)
    GEN     FpXQ_div(GEN x,GEN y,GEN T,GEN p)
    GEN     FpXQ_ffisom_inv(GEN S,GEN Tp, GEN p)
    GEN     FpXQ_inv(GEN x,GEN T,GEN p)
    GEN     FpXQ_invsafe(GEN x, GEN T, GEN p)
    GEN     FpXQ_matrix_pow(long n, long m, GEN y, GEN P, GEN l)
    GEN     FpXQ_minpoly(GEN x, GEN T, GEN p)
    GEN     FpXQ_mul(GEN y,GEN x,GEN T,GEN p)
    GEN     FpXQ_pow(GEN x, GEN n, GEN T, GEN p)
    GEN     FpXQ_powers(GEN x, long l, GEN T, GEN p)
    GEN     FpXQ_sqr(GEN y, GEN T, GEN p)
    GEN     FpXQ_sqrtn(GEN a, GEN n, GEN T, GEN p, GEN *zetan)
    GEN     FpXQX_mul(GEN x, GEN y, GEN T, GEN p)
    GEN     FpXQX_red(GEN z, GEN T, GEN p)
    GEN     FpXQX_sqr(GEN x, GEN T, GEN p)
    GEN     FpXQX_extgcd(GEN x, GEN y, GEN T, GEN p, GEN *ptu, GEN *ptv)
    GEN     FpXQX_divrem(GEN x, GEN y, GEN T, GEN p, GEN *pr)
    GEN     FpXQXV_prod(GEN V, GEN Tp, GEN p)
    GEN     FpXV_prod(GEN V, GEN p)
    GEN     FpXV_red(GEN z, GEN p)
    GEN     FpXX_red(GEN z, GEN p)
    GEN     FpX_rescale(GEN P, GEN h, GEN p)
    GEN     Fq_inv(GEN x, GEN T, GEN p)
    GEN     Fq_invsafe(GEN x, GEN T, GEN p)
    GEN     Fq_add(GEN x, GEN y, GEN T, GEN p)
    GEN     Fq_mul(GEN x, GEN y, GEN T, GEN p)
    GEN     Fq_neg(GEN x, GEN T, GEN p)
    GEN     Fq_neg_inv(GEN x, GEN T, GEN p)
    GEN     Fq_pow(GEN x, GEN n, GEN T, GEN p)
    GEN     Fq_red(GEN x, GEN T, GEN p)
    GEN     Fq_sub(GEN x, GEN y, GEN T, GEN p)
    GEN     FqM_to_FlxM(GEN x, GEN T, GEN pp)
    GEN     FqV_roots_to_pol(GEN V, GEN T, GEN p, long v)
    GEN     FqV_red(GEN z, GEN T, GEN p)
    GEN     FqX_Fq_mul(GEN P, GEN U, GEN T, GEN p)
    GEN     FqX_div(GEN x, GEN y, GEN T, GEN p)
    GEN     FqX_divrem(GEN x, GEN y, GEN T, GEN p, GEN *z)
    GEN     FqX_normalize(GEN z, GEN T, GEN p)
    GEN     FqX_red(GEN z, GEN T, GEN p)
    GEN     FqX_rem(GEN x, GEN y, GEN T, GEN p)
    GEN     FqX_mul(GEN x, GEN y, GEN T, GEN p)
    GEN     FqX_sqr(GEN x, GEN T, GEN p)
    GEN     QXQ_inv(GEN A, GEN B)
    GEN     ZX_disc(GEN x)
    int     ZX_is_squarefree(GEN x)
    GEN     ZX_resultant(GEN A, GEN B)
    long    brent_kung_optpow(long d, long n)

    # RgX.c

    int     RgX_is_rational(GEN x)
    GEN     RgM_to_RgXV(GEN x, long v)
    GEN     RgM_to_RgXX(GEN x, long v,long w)
    GEN     RgM_zc_mul(GEN x, GEN y)
    GEN     RgM_zm_mul(GEN x, GEN y)
    GEN     RgV_to_RgX(GEN x, long v)
    GEN     RgV_zc_mul(GEN x, GEN y)
    GEN     RgV_zm_mul(GEN x, GEN y)
    GEN     RgX_divrem(GEN x,GEN y,GEN *r)
    GEN     RgX_mul(GEN x,GEN y)
    GEN     RgX_mulspec(GEN a, GEN b, long na, long nb)
    GEN     RgXQX_divrem(GEN x,GEN y,GEN T,GEN *r)
    GEN     RgXQX_mul(GEN x,GEN y,GEN T)
    GEN     RgXQX_red(GEN P, GEN T)
    GEN     RgXQX_RgXQ_mul(GEN x, GEN y, GEN T)
    GEN     RgX_Rg_mul(GEN y, GEN x)
    GEN     RgX_shift(GEN x, long n)
    GEN     RgX_sqr(GEN x)
    GEN     RgX_sqrspec(GEN a, long na)
    GEN     RgXV_to_RgM(GEN v, long n)
    GEN     RgX_to_RgV(GEN x, long N)
    GEN     RgXX_to_RgM(GEN v, long n)
    GEN     RgXY_swap(GEN x, long n, long w)

    # rootpol.c

    GEN     cleanroots(GEN x,long l)
    int     isrealappr(GEN x, long l)
    GEN     roots(GEN x,long l)
    GEN     roots0(GEN x,long flag,long l)

    # subcyclo.c

    GEN     galoissubcyclo(GEN N, GEN sg, long flag, long v)
    GEN     polsubcyclo(long n, long d, long v)
    GEN     znstar_small(GEN zn)

    # subfield.c

    GEN     nfsubfields(GEN nf, long d)

    # subgroup.c

    GEN     subgrouplist(GEN cyc, GEN bound)
    void    traversesubgroups(GEN cyc, GEN B, void fun(GEN,void*), void *E)

    # stark.c

    GEN     bnrL1(GEN bnr, GEN sbgrp, long flag, long prec)
    GEN     bnrrootnumber(GEN bnr, GEN chi, long flag, long prec)
    GEN     bnrstark(GEN bnr, GEN subgroup, long prec)

    # sumiter.c

    GEN     derivnum(void *E, GEN (*eval)(GEN,void*), GEN x, long prec)
    GEN     direuler(void *E, GEN (*eval)(GEN,void*), GEN ga, GEN gb, GEN c)
    GEN     forvec_start(GEN x, long flag, GEN *d, GEN (**next)(GEN,GEN))
    GEN     polzag(long n, long m)
    GEN     prodeuler(void *E, GEN (*eval)(GEN,void*), GEN ga, GEN gb, long prec)
    GEN     prodinf(void *E, GEN (*eval)(GEN,void*), GEN a, long prec)
    GEN     prodinf1(void *E, GEN (*eval)(GEN,void*), GEN a, long prec)
    GEN     sumalt(void *E, GEN (*eval)(GEN,void*), GEN a, long prec)
    GEN     sumalt2(void *E, GEN (*eval)(GEN,void*), GEN a, long prec)
    GEN     sumpos(void *E, GEN (*eval)(GEN,void*), GEN a, long prec)
    GEN     sumpos2(void *E, GEN (*eval)(GEN,void*), GEN a, long prec)
    GEN     suminf(void *E, GEN (*eval)(GEN,void*), GEN a, long prec)
    GEN     zbrent(void *E, GEN (*eval)(GEN,void*), GEN a, GEN b, long prec)

    # thue.c

    GEN     bnfisintnorm(GEN x, GEN y)
    GEN     thue(GEN thueres, GEN rhs, GEN ne)
    GEN     thueinit(GEN pol, long flag, long prec)

    # trans1.c

    GEN     Pi2n(long n, long prec)
    GEN     PiI2(long prec)
    GEN     PiI2n(long n, long prec)
    void    consteuler(long prec)
    void    constpi(long prec)
    GEN     exp_Ir(GEN x)
    GEN     gcos(GEN x, long prec)
    GEN     gcotan(GEN x, long prec)
    GEN     gexp(GEN x, long prec)
    GEN     glog(GEN x, long prec)
    GEN     gpow(GEN x, GEN n, long prec)
    GEN     gpowgs(GEN x, long n)
    GEN     gsin(GEN x, long prec)
    void    gsincos(GEN x, GEN *s, GEN *c, long prec)
    GEN     gsqrt(GEN x, long prec)
    GEN     gsqrtn(GEN x, GEN n, GEN *zetan, long prec)
    GEN     gtan(GEN x, long prec)
    GEN     mpcos(GEN x)
    GEN     mpeuler(long prec)
    GEN     mpexp(GEN x)
    GEN     mpexp1(GEN x)
    GEN     mplog(GEN x)
    GEN     mplog2(long prec)
    GEN     mppi(long prec)
    GEN     mpsin(GEN x)
    void    mpsincos(GEN x, GEN *s, GEN *c)
    GEN     powgi(GEN x, GEN n)
    GEN     teich(GEN x)

    # trans2.c

    GEN     bernfrac(long n)
    GEN     bernreal(long n, long prec)
    GEN     bernvec(long nomb)
    GEN     gach(GEN x, long prec)
    GEN     gacos(GEN x, long prec)
    GEN     garg(GEN x, long prec)
    GEN     gash(GEN x, long prec)
    GEN     gasin(GEN x, long prec)
    GEN     gatan(GEN x, long prec)
    GEN     gath(GEN x, long prec)
    GEN     gch(GEN x, long prec)
    GEN     ggamd(GEN x, long prec)
    GEN     ggamma(GEN x, long prec)
    GEN     glngamma(GEN x, long prec)
    GEN     gpsi(GEN x, long prec)
    GEN     gsh(GEN x, long prec)
    GEN     gth(GEN x, long prec)
    void    mpbern(long nomb, long prec)

    # trans3.c

    GEN     agm(GEN x, GEN y, long prec)
    GEN     dilog(GEN x, long prec)
    GEN     eint1(GEN x, long prec)
    GEN     eta(GEN x, long prec)
    GEN     eta0(GEN x, long flag,long prec)
    GEN     gerfc(GEN x, long prec)
    GEN     gpolylog(long m, GEN x, long prec)
    GEN     gzeta(GEN x, long prec)
    GEN     hyperu(GEN a, GEN b, GEN gx, long prec)
    GEN     incgam(GEN a, GEN x, long prec)
    GEN     incgam0(GEN a, GEN x, GEN z,long prec)
    GEN     incgamc(GEN a, GEN x, long prec)
    GEN     hbessel1(GEN n, GEN z, long prec)
    GEN     hbessel2(GEN n, GEN z, long prec)
    GEN     ibessel(GEN n, GEN z, long prec)
    GEN     jbessel(GEN n, GEN z, long prec)
    GEN     jbesselh(GEN n, GEN z, long prec)
    GEN     nbessel(GEN n, GEN z, long prec)
    GEN     jell(GEN x, long prec)
    GEN     kbessel(GEN nu, GEN gx, long prec)
    GEN     polylog(long m, GEN x, long prec)
    GEN     polylog0(long m, GEN x, long flag, long prec)
    GEN     szeta(long x, long prec)
    GEN     theta(GEN q, GEN z, long prec)
    GEN     thetanullk(GEN q, long k, long prec)
    GEN     trueeta(GEN x, long prec)
    GEN     veceint1(GEN C, GEN nmax, long prec)
    GEN     vecthetanullk(GEN q, long k, long prec)
    GEN     weber0(GEN x, long flag,long prec)
    GEN     weberf(GEN x, long prec)
    GEN     weberf2(GEN x, long prec)

    # gmp/int.h
    long*   int_MSW(GEN x)
    long*   int_LSW(GEN x)
    long*   int_precW(long * xp)
    long*   int_nextW(long * xp)

    # misc...
    extern char* diffptr

#x#cdef extern from 'stdsage.h':
cdef extern from 'misc.h':
    GEN set_gel(GEN x, long n, GEN z)              # gel(x,n) = z
    GEN set_gmael(GEN x, long i, long j, GEN z)    # gmael(x,i,j) = z
    GEN set_gcoeff(GEN x, long i, long j, GEN z)   # gcoeff(x,i,j) = z


# Inline functions in separate file
include 'declinl.pxi'


cdef extern from *:   # paristio.h
    struct PariOUT:
        void (*putch)(char)
        void (*puts)(char*)
        void (*flush)()
    extern PariOUT *pariOut, *pariErr
    extern unsigned char* diffptr

cdef extern from 'pari/paripriv.h':
    struct pariout_t:
        char format  # e,f,g
        long fieldw  # 0 (ignored) or field width
        long sigd    # -1 (all) or number of significant digits printed */
        int sp       # 0 = suppress whitespace from output */
        int prettyp  # output style: raw, prettyprint, etc */
        int TeXstyle

    struct gp_data:
        jmp_buf env
        pariout_t *fmt
    extern gp_data* GP_DATA
