home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuawk.zip / vms / redirect.h < prev    next >
C/C++ Source or Header  |  1997-01-19  |  3KB  |  107 lines

  1. /*
  2.  * redirect.h --- definitions for functions that are OS specific.
  3.  */
  4.  
  5. /* 
  6.  * Copyright (C) 1986, 88, 89, 91-93, 1996, 1997 the Free Software Foundation, Inc.
  7.  * 
  8.  * This file is part of GAWK, the GNU implementation of the
  9.  * AWK Programming Language.
  10.  * 
  11.  * GAWK is free software; you can redistribute it and/or modify
  12.  * it under the terms of the GNU General Public License as published by
  13.  * the Free Software Foundation; either version 2 of the License, or
  14.  * (at your option) any later version.
  15.  * 
  16.  * GAWK is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  * 
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with this program; if not, write to the Free Software
  23.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  24.  */
  25.  
  26. /* This file is included by custom.h for VMS-POSIX, or first
  27.    by config.h (vms-conf.h) then again by awk.h for normal VMS.  */
  28.  
  29. #if defined(VMS_POSIX) || defined(IN_CONFIG_H)
  30.  
  31. #define DEFAULT_FILETYPE ".awk"
  32.  
  33. /* some macros to redirect some non-VMS-specific code */
  34. #define getopt        gnu_getopt
  35. #define opterr        gnu_opterr
  36. #define optarg        gnu_optarg
  37. #define optind        gnu_optind
  38. #define optopt        gnu_optopt
  39. #define regcomp        gnu_regcomp
  40. #define regexec        gnu_regexec
  41. #define regfree        gnu_regfree
  42. #define regerror    gnu_regerror
  43. #ifndef VMS_POSIX
  44. #define strftime    gnu_strftime    /* always use missing/strftime.c */
  45. #define strcasecmp    gnu_strcasecmp
  46. #define strncasecmp    gnu_strncasecmp
  47. #ifndef VMS_V7
  48. #define tzset        fake_tzset
  49. #define tzname        fake_tzname
  50. #define daylight    fake_daylight
  51. #define timezone    fake_timezone
  52. #define altzone        fake_altzone
  53. #endif
  54. #endif
  55.  
  56. #ifdef STDC_HEADERS
  57. /* This is for getopt.c and alloca.c (compiled with HAVE_CONFIG_H defined),
  58.    to prevent diagnostics about various implicitly declared functions.  */
  59. #include <stdlib.h>
  60. #include <string.h>
  61. #endif
  62.  
  63. #else    /* awk.h, not POSIX */
  64.  
  65. /* some macros to redirect to code in vms/vms_misc.c */
  66. #ifndef bcopy
  67. #define bcopy        vms_bcopy
  68. #endif
  69. #define exit        vms_exit
  70. #define open        vms_open
  71. #define popen        vms_popen
  72. #define pclose        vms_pclose
  73. #define strerror    vms_strerror
  74. #define strdup        vms_strdup
  75. #define unlink        vms_unlink
  76. extern void  exit P((int));
  77. extern int   open P((const char *,int,...));
  78. extern char *strerror P((int));
  79. extern char *strdup P((const char *str));
  80. extern int   vms_devopen P((const char *,int));
  81. # ifndef NO_TTY_FWRITE
  82. #define fwrite        tty_fwrite
  83. #define fclose        tty_fclose
  84. extern size_t fwrite P((const void *,size_t,size_t,FILE *));
  85. extern int    fclose P((FILE *));
  86. # endif
  87. extern FILE *popen P((const char *,const char *));
  88. extern int   pclose P((FILE *));
  89. extern void vms_arg_fixup P((int *,char ***));
  90. /* some things not in STDC_HEADERS */
  91. extern size_t gnu_strftime P((char *,size_t,const char *,const struct tm *));
  92. extern int unlink P((const char *));
  93. extern int getopt P((int,char **,char *));
  94. extern int isatty P((int));
  95. #ifndef fileno
  96. extern int fileno P((FILE *));
  97. #endif
  98. extern int close P((int));
  99. extern int dup P((int));
  100. extern int dup2 P((int, int));
  101. extern int read P((int, void *, int));
  102. extern int getpgrp P((void));
  103.  
  104. #endif    /* not VMS_POSIX and not IN_CONFIG_H */
  105.  
  106. /*vms/redirect.h*/
  107.