function cgauss_rule(icode, n, t, w, work, alpha, beta, endpt) result(info) &
  bind(c)
    !
    ! Provides access to gauss_rule from C; the argument info is returned.
    !
    use gaussquad, only : gauss_rule
    use, intrinsic :: iso_c_binding, only : C_INT, C_DOUBLE, C_CHAR
    integer(C_INT),               intent(in), value :: icode, n
    real(C_DOUBLE),               intent(out)       :: t(n), w(n), work(n)
    real(C_DOUBLE),               intent(in), value :: alpha, beta
    character(len=1,kind=C_CHAR), intent(in), value :: endpt
    integer(C_INT) :: info

    call gauss_rule(icode, n, t, w, work, alpha, beta, endpt, info)

end function cgauss_rule
