00001 #include "cfortran.h"
00002 #include <drms.h>
00003 #include <drms_types.h>
00004 #include "drms_record.h"
00005 #include "drms_names.h"
00006 #include "drms_segment.h"
00007 #include <drms_array.h>
00008 #include <sum_rpc.h>
00009 #include <xassert.h>
00010 #include <drms_network.h>
00011 #include <drms_keyword.h>
00012 #include <drms_link.h>
00013 #include <drms_parser.h>
00014 #include <drms_series.h>
00015 #include <drms_storageunit.h>
00016
00017
00018 #define VF_EXISTING 0x00000001
00019 #define VF_SECTPTR 0x00000002
00020 #define VF_OWNMEMORY 0x00000004
00021
00022 #define DEFBOUND 0x10000000
00023
00024 typedef struct
00025 {
00026 int lbound;
00027 int ubound;
00028 int stride;
00029 } triplet;
00030
00031
00032
00033
00034 (X).m_pBase[(X).m_Dim[0].lBound - 1 + i * (X).m_Dim[0].iStride/sizeof(T)]
00035
00036
00037 (X).m_pBase[(X).m_Dim[0].lBound - 1 + i * (X).m_Dim[0].iStride/sizeof(T) + \
00038 (X).m_Dim[1].lBound - 1 + j * (X).m_Dim[1].iStride/sizeof(T)]
00039
00040 typedef struct VFDimension
00041 {
00042 int iExtent;
00043 int iStride;
00044 int lBound;
00045 } VFDimension;
00046
00047 typedef struct Fort_Alloc_struct
00048 {
00049 void * m_pBase;
00050 size_t m_sizeof;
00051 int m_iOffset;
00052
00053 unsigned int m_iFlags;
00054 unsigned int m_iRank;
00055 #ifdef INTEL_FORTRAN
00056 unsigned int m_iWhatever;
00057 #endif
00058 VFDimension m_Dim[1];
00059
00060 } Fort_Alloc_t;
00061
00062 #ifndef __FORTRAN_DRMS_SETKEY
00063 #define __FORTRAN_DRMS_SETKEY
00064
00065
00066 #define int_ARG() *value
00067 #define short_ARG() *value
00068 #define long_ARG() *value
00069 #define float_ARG() *value
00070 #define double_ARG() *value
00071 #define char_ARG() *value
00072 #define longlong_ARG() *value
00073 #define string_ARG() value
00074
00075 #define int_TARG() int *value
00076 #define short_TARG() short *value
00077 #define long_TARG() long *value
00078 #define float_TARG() float *value
00079 #define double_TARG() double *value
00080 #define char_TARG() char *value
00081 #define longlong_TARG() long long *value
00082 #define string_TARG() char *value
00083
00084 #define int_RET() int
00085 #define short_RET() short
00086 #define long_RET() long
00087 #define float_RET() float
00088 #define double_RET() double
00089 #define char_RET() char
00090 #define longlong_RET() long long
00091
00092 #define FDRMS_SETKEY(TYPE) \
00093 int fdrms_setkey_ ##TYPE ##_ (DRMS_Record_hdl *rhdl, const char * keyname,TYPE ##_TARG()) { \
00094 DRMS_Record_t *rec = (DRMS_Record_t *) *rhdl; \
00095 return drms_setkey_ ##TYPE (rec, keyname, TYPE ##_ARG()); \
00096 }
00097
00098 #define FDRMS_GETKEY(TYPE) \
00099 TYPE ##_RET() fdrms_getkey_ ##TYPE ##_ (DRMS_Record_hdl *rhdl, const char * keyname, int *status) { \
00100 DRMS_Record_t *rec = (DRMS_Record_t *) *rhdl; \
00101 return drms_getkey_ ##TYPE (rec, keyname, status); \
00102 }
00103 #endif
00104
00105 #define FHANDLEKEYSIZE 257 //max lenght of hash key
00106
00107 void fort_alloc(Fort_Alloc_t *, void *, int, int, int);
00108 void free_fort_alloc ( Fort_Alloc_t *);
00109 char * _pointer2handle(void *, char *, char *);
00110 void dealloc_C_string_array(char **, int);
00111 void * _convert_handle(char *);
00112 void convert_C2F_string_array(Fort_Alloc_t *, char **, int, int);
00113 void convert_F2C_string_array(Fort_Alloc_t *, char ***, int, int);
00114 void create_fortran_handleH(void);
00115 void insert2hash(char *, void *);
00116 int sizeof_drms_type ( DRMS_Type_t );
00117