Blame vms/redirect.h

Packit 575503
/*
Packit 575503
 * redirect.h --- definitions for functions that are OS specific.
Packit 575503
 */
Packit 575503
Packit 575503
/* 
Packit 575503
 * Copyright (C) 1986, 1988, 1989, 1991-1993, 1996, 1997, 2007, 2010, 2011
Packit 575503
 * the Free Software Foundation, Inc.
Packit 575503
 * 
Packit 575503
 * This file is part of GAWK, the GNU implementation of the
Packit 575503
 * AWK Programming Language.
Packit 575503
 * 
Packit 575503
 * GAWK is free software; you can redistribute it and/or modify
Packit 575503
 * it under the terms of the GNU General Public License as published by
Packit 575503
 * the Free Software Foundation; either version 3 of the License, or
Packit 575503
 * (at your option) any later version.
Packit 575503
 * 
Packit 575503
 * GAWK is distributed in the hope that it will be useful,
Packit 575503
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 575503
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 575503
 * GNU General Public License for more details.
Packit 575503
 * 
Packit 575503
 * You should have received a copy of the GNU General Public License
Packit 575503
 * along with this program; if not, write to the Free Software
Packit 575503
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
Packit 575503
 */
Packit 575503
Packit 575503
/* This file is included by custom.h for VMS-POSIX, or first
Packit 575503
   by config.h (vms-conf.h) then again by awk.h for normal VMS.  */
Packit 575503
Packit 575503
#if defined(VMS_POSIX) || defined(IN_CONFIG_H)
Packit 575503
Packit 575503
#define DEFAULT_FILETYPE ".awk"
Packit 575503
Packit 575503
/* some macros to redirect some non-VMS-specific code */
Packit 575503
#define getopt		gnu_getopt
Packit 575503
#define opterr		gnu_opterr
Packit 575503
#define optarg		gnu_optarg
Packit 575503
#define optind		gnu_optind
Packit 575503
#define optopt		gnu_optopt
Packit 575503
#define regcomp		gnu_regcomp
Packit 575503
#define regexec		gnu_regexec
Packit 575503
#define regfree		gnu_regfree
Packit 575503
#define regerror	gnu_regerror
Packit 575503
#define setenv		gawk_setenv
Packit 575503
#define unsetenv	gawk_unsetenv
Packit 575503
#ifndef VMS_POSIX
Packit 575503
#define strftime	gnu_strftime	/* always use missing/strftime.c */
Packit 575503
#define strcasecmp	gnu_strcasecmp
Packit 575503
#define strncasecmp	gnu_strncasecmp
Packit 575503
#ifndef VMS_V7
Packit 575503
#define tzset		fake_tzset
Packit 575503
#define tzname		fake_tzname
Packit 575503
#define daylight	fake_daylight
Packit 575503
#define timezone	fake_timezone
Packit 575503
#define altzone		fake_altzone
Packit 575503
#endif
Packit 575503
#if !defined(__DECC) && !defined(VAXC2DECC) && !defined(__alpha)
Packit 575503
#define strcoll(s,t) strcmp((s),(t))	/* VAXCRTL lacks locale support */
Packit 575503
#endif
Packit 575503
#endif
Packit 575503
Packit 575503
#ifdef STDC_HEADERS
Packit 575503
/* This is for getopt.c and alloca.c (compiled with HAVE_CONFIG_H defined),
Packit 575503
   to prevent diagnostics about various implicitly declared functions.  */
Packit 575503
#include <stdlib.h>
Packit 575503
#include <string.h>
Packit 575503
#endif
Packit 575503
#ifndef VMS_POSIX
Packit 575503
/* This if for random.c. */
Packit 575503
#define gettimeofday	vms_gettimeofday
Packit 575503
#ifndef __TIMEVAL
Packit 575503
#define __TIMEVAL 1
Packit 575503
struct timeval	{ long tv_sec, tv_usec; };
Packit 575503
#endif
Packit 575503
extern int   gettimeofday(struct timeval *,void *);
Packit 575503
#endif
Packit 575503
Packit 575503
#else	/* awk.h, not POSIX */
Packit 575503
Packit 575503
/* some macros to redirect to code in vms/vms_misc.c */
Packit 575503
#ifndef bcopy
Packit 575503
#define bcopy		vms_bcopy
Packit 575503
#endif
Packit 575503
#define open		vms_open
Packit 575503
#define popen		vms_popen
Packit 575503
#define pclose		vms_pclose
Packit 575503
#ifndef HAVE_SNPRINTF
Packit 575503
#define snprintf gawk_snprintf	/* avoid %CC-I-INTRINSICDECL diagnostic */
Packit 575503
#define vsnprintf gawk_vsnprintf
Packit 575503
#endif
Packit 575503
/* supply missing or suppressed (due to defines in config.h) declarations */
Packit 575503
extern int snprintf(char *,size_t,const char *,...);
Packit 575503
extern int vsnprintf(char *restrict,size_t,const char *,va_list);
Packit 575503
extern int setenv(const char *,const char *,int);
Packit 575503
extern int unsetenv(const char *);
Packit 575503
#define strerror	vms_strerror
Packit 575503
#define strdup		vms_strdup
Packit 575503
#define unlink		vms_unlink
Packit 575503
#if defined(VAXC) || (defined(__GNUC__) && !defined(__alpha))
Packit 575503
#define fstat(fd,sb)	VMS_fstat(fd,sb)
Packit 575503
#endif
Packit 575503
extern void  exit(int);
Packit 575503
extern int   open(const char *,int,...);
Packit 575503
extern char *strerror(int);
Packit 575503
extern char *strdup(const char *str);
Packit 575503
extern int   vms_devopen(const char *,int);
Packit 575503
# ifndef NO_TTY_FWRITE
Packit 575503
#define fwrite		tty_fwrite
Packit 575503
#define fclose		tty_fclose
Packit 575503
extern size_t fwrite(const void *,size_t,size_t,FILE *);
Packit 575503
extern int    fclose(FILE *);
Packit 575503
# endif
Packit 575503
extern FILE *popen(const char *,const char *);
Packit 575503
extern int   pclose(FILE *);
Packit 575503
extern void vms_arg_fixup(int *,char ***);
Packit 575503
/* some things not in STDC_HEADERS */
Packit 575503
extern size_t gnu_strftime(char *,size_t,const char *,const struct tm *);
Packit 575503
extern int unlink(const char *);
Packit 575503
extern int getopt(int,char **,char *);
Packit 575503
extern int isatty(int);
Packit 575503
#ifndef fileno
Packit 575503
extern int fileno(FILE *);
Packit 575503
#endif
Packit 575503
extern int close(int);
Packit 575503
extern int dup(int);
Packit 575503
extern int dup2(int, int);
Packit 575503
extern int read(int, void *, int);
Packit 575503
extern int getpgrp(void);
Packit 575503
extern void tzset(void);
Packit 575503
Packit 575503
#endif	/* not VMS_POSIX and not IN_CONFIG_H */
Packit 575503
Packit 575503
/*vms/redirect.h*/