Main Page   Compound List   File List   Compound Members   File Members   Related Pages  

ccp4_fortran.h File Reference

#include "ccp4_types.h"

Go to the source code of this file.

Defines

#define _LVTOB(l)   ((long) ((l) == 0 ? 0 : 1))
#define _BTOLV(l)   ((int) ((l) == 0 ? 0 : 1))
#define FTN_STR(s)   s
#define FTN_LEN(s)   s##_len
#define char_struct(s)
#define fill_char_struct(s, str)
#define init_char_struct(s, str, size)
#define FORTRAN_SUBR(NAME, name, p_sun, p_stardent, p_mvs)   void name##_ p_sun
#define FORTRAN_CALL(NAME, name, p_sun, p_stardent, p_mvs)   name##_ p_sun
#define FORTRAN_FUN(val, NAME, name, p_sun, p_stardent, p_mvs)   val name##_ p_sun
#define FORTRAN_LOGICAL_TRUE   1
#define FORTRAN_LOGICAL_FALSE   0

Typedefs

typedef pstr fpstr
typedef unsigned int ftn_logical

Functions

char * ccp4_FtoCString (fpstr str1, int str1_len)
void ccp4_CtoFString (fpstr str1, int str1_len, const char *cstring)


Detailed Description

header file for Fortran APIs Eugene Krissinel


Define Documentation

#define char_struct  
 

Value:

pstr  s;              \
    int   s##_len;

#define fill_char_struct s,
str   
 

Value:

s  = str;                      \
    s##_len = strlen(str);

#define FORTRAN_CALL NAME,
name,
p_sun,
p_stardent,
p_mvs       name##_ p_sun
 

Macro to call a Fortran subroutine from a C function.

Parameters:
NAME  Subroutine name in upper case
name  Subroutine name in lower case
p_sun  Argument list in Sun style
p_stardent  Argument list in Stardent style
p_mvs  Argument list in MVS style

#define FORTRAN_FUN val,
NAME,
name,
p_sun,
p_stardent,
p_mvs       val name##_ p_sun
 

Macro to define a function such that it is callable as a Fortran function.

Parameters:
val  Data type of return value.
NAME  Function name in upper case
name  Function name in lower case
p_sun  Argument list in Sun style
p_stardent  Argument list in Stardent style
p_mvs  Argument list in MVS style

#define FORTRAN_SUBR NAME,
name,
p_sun,
p_stardent,
p_mvs       void name##_ p_sun
 

Macro to define a function such that it is callable as a Fortran subroutine.

Parameters:
NAME  Subroutine name in upper case
name  Subroutine name in lower case
p_sun  Argument list in Sun style
p_stardent  Argument list in Stardent style
p_mvs  Argument list in MVS style

#define init_char_struct s,
str,
size   
 

Value:

s  = str;                      \
    s##_len = size;


Function Documentation

void ccp4_CtoFString fpstr    str1,
int    str1_len,
const char *    cstring
 

Creates a Fortran string from an input C string for passing back to Fortran call. Characters after null-terminator may be junk, so pad with spaces. If input cstring is NULL, return blank string.

Parameters:
str1  pointer Fortran to string
str1_len  Fortran length of string
cstring  input C string

char* ccp4_FtoCString fpstr    str1,
int    str1_len
 

Creates a null-terminated C string from an input string obtained from a Fortran call. Trailing blanks are removed. If input string is blank then return string "\0". Memory assigned by malloc, so can be freed.

Parameters:
str1  pointer to string
str1_len  Fortran length of string