#ifndef _SYS_UTIL_H_ #define _SYS_UTIL_H_ /* fortran interface stuff declare fortran character arguments as F_CHAR(arg) and at at the end for each character argument add int _len to the argument list Use macros STR_TO_C and STR_TO_F to convert from Fortran character strings to C character arrays and vice versa. sys_adr_len (argument of accept and gethostbyadr, system dependent) sys_ctrl_init() (needed in VMS only) */ #if defined __VMS typedef struct { short size, dummy; char *text; } SysVmsChar; #define F_CHAR(VAR) SysVmsChar *VAR##_desc #define STR_TO_C(DST,SRC) str_ntrim(DST, SRC##_desc->text, sizeof(DST), SRC##_len=SRC##_desc->size) #define STR_TO_F(DST,SRC) str_npad(DST##_desc->text, SRC, DST##_len=DST##_desc->size) typedef size_t sys_adr_len; /* argument of accept and gethostbyadr */ void sys_ctrl_init(void); #elif defined __alpha || defined __unix #define F_CHAR(VAR) char *VAR #define STR_TO_C(DST,SRC) str_ntrim(DST, SRC, sizeof(DST), SRC##_len) #define STR_TO_F(DST,SRC) str_npad(DST, SRC, DST##_len) typedef int sys_adr_len; /* argument of accept and gethostbyadr */ #define sys_ctrl_init(DUMMY) 0 #else /* other machines are not supported */ #endif #endif /* _SYS_UTIL_H_ */