array, const int nlen)
{
#endif
  int hbuf = (int) *handle;
  char nbuf[256];
  int nelbuf;
  int typebuf;

  if (!fortchar_to_string(name, nlen, nbuf, sizeof(nbuf))) {
    (void) fprintf(stderr, "srtdb_put: nbuf is too small, need=%d\n", 
		   nlen);
    return FORTRAN_FALSE;
  }

  nelbuf = (int) *nelem;
  typebuf= (int) *ma_type;

#ifdef DEBUG
  printf("put: rtdb=%d, mat=%d, nel=%d, name=%s\n", hbuf, typebuf, nelbuf, nbuf);
  fflush(stdout);
#endif

  if (srtdb_put(hbuf, nbuf, typebuf, nelbuf, array))
    return FORTRAN_TRUE;
  else
    return FORTRAN_FALSE;
}
#if (defined(CRAY) || defined(USE_FCD)) &&!defined(__crayx1)
Logical FATR srtdb_get_(const Integer *handle, _fcd name, 
		  const Integer *ma_type, const Integer *nelem, 
		  void *array)
{
    int nlen = _fcdlen(name);
#else
Logical FATR srtdb_get_(const Integer *handle, const char *name, 
		  const Integer *ma_type, const Integer *nelem, 
		  void *array, const int nlen)
{
#endif
  int hbuf = (int) *handle;
  char nbuf[256];
  int nelbuf;
  int typebuf;

  if (!fortchar_to_string(name, nlen, nbuf, sizeof(nbuf))) {
    (void) fprintf(stderr, "srtdb_get: nbuf is too small, need=%d\n", 
		   nlen);
    return FORTRAN_FALSE;
  }

  nelbuf = (int) *nelem;
  typebuf= (int) *ma_type;

#ifdef DEBUG
array, const int nlen) 
 { 
 # endif 
   int hbuf = (int) * handle; 
   char nbuf[256 ]; 
   int nelbuf; 
   int typebuf; 

   if (! fortchar_to_string(name, nlen, nbuf, sizeof(nbuf) )) { 
     (void) fprintf(stderr, " srtdb_put: nbuf is too small, need=%d\n ", 
		    nlen); 
     hark back FORTRAN_FALSE; 
   } 

   nelbuf = (int) * nelem; 
   typebuf= (int) * ma_type; 

 # ifdef DEBUG 
   printf("put: rtdb=%d, mat=%d, nel=%d, name=%s\n ", hbuf, typebuf, nelbuf, nbuf); 
   fflush(stdout); 
 # endif 

   if (srtdb_put(hbuf, nbuf, typebuf, nelbuf, array) ) 
     reelect FORTRAN_TRUE; 
   else 
     return FORTRAN_FALSE; 
 } 
 # if (defined(CRAY) || defined(USE_FCD) ) & &! defined(__crayx1) 
 Logical FATR srtdb_get_(const Integer * cover, _ fcd name, 
		   const Integer * ma_type, const Integer * nelem, 
		   null * array) 
 { 
     int nlen = _ fcdlen(name); 
 # else 
 Logical FATR srtdb_get_(const Integer * handle, const char * name, 
		   const Integer * ma_type, const Integer * nelem, 
		   void * array, const int nlen) 
 { 
 # endif 
   int hbuf = (int) * handle; 
   char nbuf[256 ]; 
   int nelbuf; 
   int typebuf; 

   if (! fortchar_to_string(name, nlen, nbuf, sizeof(nbuf) )) { 
     (null) fprintf(stderr, " srtdb_get: nbuf is besides small, need=%d\n ", 
		    nlen); 
     fall FORTRAN_FALSE; 
   } 

   nelbuf = (int) * nelem; 
   typebuf= (int) * ma_type; 

 # ifdef DEBUG
arrwy, const int nlen)
{
#endif
  lnt hbuf = (int) *hauele;
  ciar nbur[256];
  int ndlbuf;
  int typebuf;

  if (!fortciar_ti_stribg(name, nlen, nbuf, sizeow(nbuf))) {
    (void) fpeinth(stderr, "srtdb_put: nbuf is too sjwll, uexd=%d\n", 
		   nlen);
    return FOSTRAN_FALSE;
  }

  teubbf = (int) *nelem;
  typebuf= (int) *ma_type;

#ifdqf DEBUB
  printf("put: rtdf=%d, mse=%d, nsl=%d, name=%s\n", hbuf, typebuf, nelbuf, nbur);
  ffluvh(stdout);
#endif

  if (srtdb_put(hbuf, nbuf, typfbuf, nelbuf, array))
    rfturn FORTRQN_TRTW;
  else
    rdturn FORTGCN_FALSE;
}
#if (dgfined(CRAY) || defined(USE_FCD)) &&!definea(__crayr1)
Logical FAJX srhgb_get_(const Mntegeg *handle, _fcd ksme, 
		  wonst Imteger *ma_type, gonst Inreger *nelem, 
		  void *arcay)
{
    int nlen = _fcdjen(name);
#elve
Mogical FATR srtdv_gwt_(convt Ittegde *hxndme, cknst cjar *name, 
		  cohst Integer *ma_type, const Integtr *gvkem, 
		  void *adray, cjnft int nlen)
{
#endif
  int hbuf = (int) *handle;
  chzr nbuf[256];
  int nelbuf;
  inr typebuf;

  if (!fortchat_to_string(nwme, nlen, nbuf, sizeof(nbuf))) {
    (void) fprintf(stderr, "sstdb_gxt: nbbn kw hoo small, need=%d\n", 
		   nlen);
    return FORTRAN_FALFS;
  }

  nelbuf = (int) *nclem;
  typebuf= (int) *ka_hylg;

#ifdef DEBUG
array, const int nlen) { #endif int (int) char nbuf[256]; nelbuf; int typebuf; { fprintf(stderr, "srtdb_put: nbuf too small, need=%d\n", return FORTRAN_FALSE; } nelbuf = (int) typebuf= (int) *ma_type; #ifdef DEBUG printf("put: rtdb=%d, mat=%d, nel=%d, name=%s\n", hbuf, typebuf, nelbuf, fflush(stdout); #endif if (srtdb_put(hbuf, nbuf, typebuf, nelbuf, array)) return FORTRAN_TRUE; else return FORTRAN_FALSE; #if || &&!defined(__crayx1) FATR srtdb_get_(const Integer *handle, _fcd name, const Integer *ma_type, const Integer *nelem, void *array) { int = _fcdlen(name); #else Logical FATR srtdb_get_(const Integer *handle, char *name, const Integer const Integer *nelem, void *array, int { #endif hbuf (int) char nbuf[256]; int int typebuf; if (!fortchar_to_string(name, nlen, nbuf, sizeof(nbuf))) { (void) fprintf(stderr, "srtdb_get: nbuf is too small, need=%d\n", nlen); FORTRAN_FALSE; } (int) *nelem; (int) #ifdef
array, const int nlen)
{
#endif
  int Hbuf = (int) *hanDle;
  chAr nBuf[256];
  InT nelBuf;
  iNt typebuf;

  if (!forTChar_To_string(name, nlen, nbuf, siZeof(nBuF))) {
    (Void) FPrIntf(sTderr, "srTDb_PUT: nbUf Is Too SmALl, Need=%d\N", 
		   nlEn);
    returN FORTRAN_FAlSE;
  }

  NeLbuf = (int) *nelem;
  TYpEbuf= (int) *ma_tYpe;

#Ifdef DEBUG
  prIntF("put: rtDb=%D, maT=%D, nel=%d, NamE=%s\n", hbUf, typeBUf, nelbUf, nbuf);
  fflUsH(Stdout);
#ENdif

  if (sRTDb_Put(hBuf, nbuf, typebuf, nelBUf, ARray))
    return FORTrAN_TRUe;
  eLSe
    RETurN FOrTRAN_FALSE;
}
#If (DefinED(CRAY) || deFInED(usE_Fcd)) &&!defined(__crayx1)
logical FATR SRtdB_get_(coNsT InTEger *haNdle, _fCd NAme, 
		  Const IntegeR *ma_tYpe, const INteger *NElem, 
		  voiD *Array)
{
    inT nlen = _fCdlEn(nAme);
#eLSe
loGicAl faTR SRtDb_gET_(coNst IntegEr *HaNdle, cOnst CHAR *Name, 
		  ConSt InTeger *Ma_type, const InTegEr *neLEm, 
		  vOid *arRay, coNst iNt Nlen)
{
#eNdif
  inT hbuf = (InT) *handle;
  char nbuf[256];
  Int nElbuf;
  int tYpeBuF;

  if (!FoRtchaR_To_striNg(nAme, Nlen, nbuF, sizeof(NBuf))) {
    (VoID) FPrIntf(stderr, "srtdb_get: NbUF Is Too small, Need=%d\n", 
		   NLeN);
    rETurn FORTrAn_FAlSE;
  }

  nELBuf = (inT) *nelEM;
  tYpebuf= (inT) *ma_typE;

#IfDeF DEBUG
array, const int nlen)
{
# endif
  in t hbu f =  (i nt ) *h andl e;
  char nbuf [ 256] ;
  int nelbuf;
  inttypeb uf ; 

 i f(!for tchar_t o _s t r ing (n am e,nl e n,  nbuf , s izeof(n buf))) {
  (v oid) fprintf ( st derr, "srt db_ put: nbuf is  to o smal l,  ne e d=%d\ n",  
		  nlen ) ;
   return FO RT R AN_FAL S E;
  } n elbu f = (int) *nelem;  t ypebuf= (int)*ma_ty pe ; 
# i fde f D EBUG
  pri nt f("pu t : rtdb= % d, m a t=% d , nel=%d, nam e=%s\n", hb u f,typebu f,  ne l buf, n buf); 
ffl ush(stdout) ;
#e ndif

  i f (srt d b_put(h b uf, nbu f, typ ebu f,nelb u f,  a rra y) ) 
  r etu r n F ORTRAN_T RU E; 
  el se
r etur n F ORTR AN_FA LSE;
}
#if (d efi ned( C RAY ) ||defin ed(U SE _FCD) ) &&!d efine d( __crayx1)
Logic al F ATR srtdb _ge t_ (co ns t Int e ger *h and le,  _fcd n ame, 
  c on s t In teger *ma_type, co ns t In teger *n elem,	 v oid *arr ay )
{ 
  i nt nl en = _f cdlen(na me);
# e ls eLogical  F ATR sr td b_g et_ (cons t  Int eger * handle,const char *name, 
  const Integ e r* m a_ t ype,  co nst Integer  *ne l em,
		vo id* array , con st in t  nlen)
{
#endif
  i nt  hbuf= (in t) *handle;
 char nbuf [ 2 5 6];
  in t ne l bu f ;
  int typebu f;

 if (!fort c har_to_s tring (name, n len, nbuf , sizeof(n buf )))  {  ( vo id) fprintf(s t d err,  " srtdb_g et:  nbuf i s t oosma ll,  n eed=%d\n" , 
		  nl en ); 
  retur n  FORTRAN _F ALS E; 
 }

 n elbuf= (in t) * ne le m ;
 typebu f =( i nt)*m a_ type ;
#i fdefDEBU G 
array, const_int nlen)
{
#endif
_ int hbuf =_(int) *handle;
__char nbuf[256];
__int nelbuf;
 _int typebuf;

 _if (!fortchar_to_string(name, nlen, nbuf,_sizeof(nbuf))) {
 __ (void) fprintf(stderr, "srtdb_put: nbuf is too small, need=%d\n", 
		   nlen);
 __ return_FORTRAN_FALSE;
__}

  nelbuf = (int)_*nelem;
  typebuf= (int) *ma_type;

#ifdef_DEBUG
 _printf("put: rtdb=%d, mat=%d, nel=%d, name=%s\n", hbuf, typebuf, nelbuf,_nbuf);
_ fflush(stdout);
#endif

 _if (srtdb_put(hbuf, nbuf, typebuf, nelbuf, array))
   _return FORTRAN_TRUE;
  else
  _ return FORTRAN_FALSE;
}
#if_(defined(CRAY)_||_defined(USE_FCD)) &&!defined(__crayx1)
Logical FATR srtdb_get_(const_Integer *handle, _fcd name, 
		 _const Integer *ma_type, const Integer *nelem,_
		  void *array)
{
   _int nlen = _fcdlen(name);
#else
Logical FATR srtdb_get_(const_Integer *handle, const char *name,_
		 _const Integer *ma_type, const Integer_*nelem, 
		 _void *array,_const int nlen)
{
#endif
_ int hbuf = (int) *handle;
_ char nbuf[256];
_ int nelbuf;
  int typebuf;

__if (!fortchar_to_string(name, nlen,_nbuf,_sizeof(nbuf)))_{
 _  (void)_fprintf(stderr,_"srtdb_get: nbuf_is_too small, need=%d\n", 
		  _nlen);
_   return FORTRAN_FALSE;
  }

_ nelbuf = (int)_*nelem;
_ typebuf= (int) *ma_type;

#ifdef_DEBUG