#include "fbm_container.h"

#include <iostream>

extern "C" void F77NAME(bad_exit)() ;

//
// static storage
//
fbm_container fbm_container_store=0 ;

void fbm_container_register(fbm_container foo) {
  fbm_container_store=foo ;
} ;

extern "C" void F77NAME(fbm_container_call)(int* jflr, int* beam_zone, double* point, double* xksid, 
					    double* engy, int* iznum, double* aweight, 
					    double* dist, int* ier) {
  if (fbm_container_store==0) {
    std::cerr << "?fbm_container_call: no fbm_container function has been registered, " ;
    std::cerr << "fbm_container_register must be called first" << std::endl ;
    F77NAME(bad_exit)() ;
  } ;
  (*fbm_container_store)(jflr,beam_zone,point,xksid,engy,iznum,aweight,dist,ier) ;
} ;



