00001
00002
00003
00004
00005
00006 #ifndef __CHARM_API_H
00007 #define __CHARM_API_H
00008
00009 #include "conv-config.h"
00010
00011 #ifdef __cplusplus
00012 # define CLINKAGE extern "C"
00013 #else
00014 # define CLINKAGE
00015 #endif
00016
00018 #undef CDECL
00019 #define CDECL CLINKAGE
00020
00022 #define FDECL CLINKAGE
00023
00026 #if CMK_FORTRAN_USES_ALLCAPS
00027 # define FTN_NAME(caps,nocaps) caps
00028 #elif CMK_FORTRAN_USES_TWOSCORE
00029 # define FTN_NAME(caps,nocaps) nocaps##__
00030 #elif CMK_FORTRAN_USES_ONESCORE
00031 # define FTN_NAME(caps,nocaps) nocaps##_
00032 #elif CMK_FORTRAN_USES_NOSCORE
00033 # define FTN_NAME(caps,nocaps) nocaps
00034 #else
00035
00036 # define FTN_NAME(caps,nocaps) NONMANGLED_##nocaps
00037 #endif
00038
00039
00051 #define FORTRAN_AS_C(CAPITALNAME,Cname,lowername, routine_args,c_args) \
00052 FDECL void \
00053 FTN_NAME(CAPITALNAME,lowername) routine_args { \
00054 Cname c_args;\
00055 }
00056
00060 #define FORTRAN_AS_C_RETURN(returnType, CAPITALNAME,Cname,lowername, routine_args,c_args) \
00061 FDECL returnType \
00062 FTN_NAME(CAPITALNAME,lowername) routine_args { \
00063 return Cname c_args;\
00064 }
00065
00066
00067 #endif
00068