new tecs version M.Z.08.2001

This commit is contained in:
cvs
2001-08-16 10:17:09 +00:00
parent b56745eb46
commit 0cda158849
35 changed files with 5289 additions and 2065 deletions

View File

@@ -1,33 +1,35 @@
#ifndef _SYS_UTIL_H_
#define _SYS_UTIL_H_
#ifdef FORTIFY
#include "fortify.h"
#endif
/*
/* secure allocation stuff ----------------------------------
change these macros if you want to log dynamic memory access
*/
fortran interface stuff
#define NEW(PTR) ERR_SP(PTR=calloc(1,sizeof(*PTR)))
#define MALLOC(SIZ) calloc(1,SIZ)
#define FREE(PTR) free(PTR)
declare fortran character arguments as F_CHAR(arg)
and at at the end for each character argument <arg> add
int <arg>_len to the argument list
/* fortran interface stuff ----------------------------------
Use macros STR_TO_C and STR_TO_F to convert from Fortran character strings
to C character arrays and vice versa.
declare fortran character arguments as CHAR(arg)
and at at the end for each character argument <arg> add
int <arg>_len to the argument list
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 struct { short size, dummy; char *text; } SysVmsChar;
typedef size_t sys_adr_len; /* argument of accept and gethostbyadr */
void sys_ctrl_init(void);
#elif defined __alpha
@@ -35,9 +37,13 @@ typedef struct { short size, dummy; char *text; } SysVmsChar;
#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)
#else
/* other machines are not yet supported */
/* other machines are not supported */
#endif