Linux to Darwin

Joined
Jan 15, 2008
Messages
4
Reaction score
1
Points
3
Location
University of Maryland
Your Mac's Specs
MacPro, OSX 10.5 Leopard, 2 dual core Intel processors, 3.0 GHz, 10Gb RAM, 1.75Tb HD, Darwin 9.1.0
Hi:

I am trying to get a Linux program (ioapi 3.0) to run on my new Mac Pro. I have successfully converted some functions, but the following C code for Fortran bindings is not being recognized. The two included functions (name2cstr and fstr2cstr) are working. Any ideas?

Debra Baker

/** -------------------------- ENVYN() ------------------------- **/

FINT ENVYN( const char * lname,
const char * descrip,
const FINT * defaultval,
FINT * status,
FSTR_L llen,
FSTR_L dlen )
{
char nbuff[ BUFLEN ] ;
char dbuff[ BUFLEN ] ;
int result, istat ;

name2cstr( lname, nbuff, llen, BUFLEN ) ;
fstr2cstr( descrip, dbuff, dlen, BUFLEN ) ;

result = envync( nbuff, dbuff, (int)*defaultval, & istat ) ;
*status = (FINT) istat ;
return (FINT) result ;

} /** END MACH int function ENVYN() **/


/** ------------------------ ENVINT() -------------------------- **/

FINT ENVINT( const char * lname,
const char * descrip,
const int * defaultval,
FINT * status,
FSTR_L llen,
FSTR_L dlen )
{
char nbuff[ BUFLEN ] ;
char dbuff[ BUFLEN ] ;
int result, istat ;

name2cstr( lname, nbuff, llen, BUFLEN ) ;
fstr2cstr( descrip, dbuff, dlen, BUFLEN ) ;

result = (FINT) envintc( nbuff, dbuff, (int)*defaultval, & istat ) ;
*status = (FINT) istat ;
return (FINT) result ;

} /** END MACH int function ENVINT() **/
 
OP
Debra Baker
Joined
Jan 15, 2008
Messages
4
Reaction score
1
Points
3
Location
University of Maryland
Your Mac's Specs
MacPro, OSX 10.5 Leopard, 2 dual core Intel processors, 3.0 GHz, 10Gb RAM, 1.75Tb HD, Darwin 9.1.0
Correction to my e-mail: EVINT() works. The other delinquent function is:

/** ------------------------ ENVSTR() -------------------------- **/

void ENVSTR( const char * lname,
const char * description,
const char * defaultval,
char * eqname,
FINT * status,
FSTR_L namlen,
FSTR_L deslen,
FSTR_L deflen,
FSTR_L eqlen )
{
char nambuf[ BUFLEN ] ;
char desbuf[ BUFLEN ] ;
char defbuf[ BUFLEN ] ;
char eqbuf [ BUFLEN ] ;
int istat ;

name2cstr( lname , nambuf, namlen, BUFLEN ) ;
fstr2cstr( description, desbuf, deslen, BUFLEN ) ;
fstr2cstr( defaultval , defbuf, deflen, BUFLEN ) ;

envstrc( nambuf, desbuf, defbuf, eqbuf, & istat, eqlen ) ;

cstr2fstr( eqbuf, eqname, eqlen ) ;
*status = istat ;

return ;

} /** END MACH void function ENVSTR() **/
 
OP
Debra Baker
Joined
Jan 15, 2008
Messages
4
Reaction score
1
Points
3
Location
University of Maryland
Your Mac's Specs
MacPro, OSX 10.5 Leopard, 2 dual core Intel processors, 3.0 GHz, 10Gb RAM, 1.75Tb HD, Darwin 9.1.0
I fixed it! It wasn't a code issue (of course!)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top