/*
!===============================================================================
!
! ranlxd_f.c - Fortran interface to ranlxd.c
!
!-------------------------------------------------------------------------------
!
! Copyright (C) 2007 Hinnerk Stueben
!
! This file is part of BQCD -- Berlin Quantum ChromoDynamics program
!
! BQCD is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! BQCD is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with BQCD.  If not, see <http://www.gnu.org/licenses/>.
!
!-------------------------------------------------------------------------------
*/

# include "ranlxd.h"

#ifdef NamesToLower
# define RANLXD_F ranlxd_f
# define RLXD_INIT_F rlxd_init_f
# define RLXD_SIZE_F rlxd_size_f
# define RLXD_GET_F rlxd_get_f
# define RLXD_RESET_F rlxd_reset_f
#endif

#ifdef NamesToLower_
# define RANLXD_F ranlxd_f_
# define RLXD_INIT_F rlxd_init_f_
# define RLXD_SIZE_F rlxd_size_f_
# define RLXD_GET_F rlxd_get_f_
# define RLXD_RESET_F rlxd_reset_f_
#endif

#ifdef NamesToLower__
# define RANLXD_F ranlxd_f__
# define RLXD_INIT_F rlxd_init_f__
# define RLXD_SIZE_F rlxd_size_f__
# define RLXD_GET_F rlxd_get_f__
# define RLXD_RESET_F rlxd_reset_f__
#endif

void RANLXD_F(double r[], int *pn);
void RLXD_INIT_F(int *plevel, int *pseed);
int RLXD_SIZE_F(void);
void RLXD_GET_F(int state[]);
void RLXD_RESET_F(int state[]);

void RANLXD_F(double r[], int *pn)
{
  ranlxd(r, *pn);
}

void RLXD_INIT_F(int *plevel, int *pseed)
{
  rlxd_init(*plevel, *pseed);
}

int RLXD_SIZE_F(void)
{
  return rlxd_size();
}

void RLXD_GET_F(int state[])
{
  rlxd_get(state);
}

void RLXD_RESET_F(int state[])
{
  rlxd_reset(state);
}
