Results 1 to 3 of 3

Thread: Linux to Darwin

  1. #1
    Linux to Darwin
    Debra Baker's Avatar
    Member Since
    Jan 15, 2008
    Location
    University of Maryland
    Posts
    4
    Specs:
    MacPro, OSX 10.5 Leopard, 2 dual core Intel processors, 3.0 GHz, 10Gb RAM, 1.75Tb HD, Darwin 9.1.0
    Question Linux to Darwin
    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() **/

  2. #2
    Linux to Darwin
    Debra Baker's Avatar
    Member Since
    Jan 15, 2008
    Location
    University of Maryland
    Posts
    4
    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() **/

  3. #3
    Linux to Darwin
    Debra Baker's Avatar
    Member Since
    Jan 15, 2008
    Location
    University of Maryland
    Posts
    4
    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!)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dual boot mac os x and linux linux on external hard drive
    By Magus10 in forum Running Windows (or anything else) on your Mac
    Replies: 11
    Last Post: 10-06-2012, 10:33 PM
  2. Mount a linux (ext3) drive in a VM instance of Linux
    By garycarroll in forum Running Windows (or anything else) on your Mac
    Replies: 4
    Last Post: 01-13-2009, 10:22 AM
  3. Darwin
    By timboellis in forum Switcher Hangout
    Replies: 1
    Last Post: 10-06-2005, 05:02 AM
  4. Running Linux apps on my Mac or Linux itself
    By Nightblade in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 05-24-2004, 01:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •